@azure/communication-chat 1.4.0-beta.2 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +22 -85
- package/dist/index.js.map +1 -1
- package/dist-esm/src/chatClient.js +5 -11
- package/dist-esm/src/chatClient.js.map +1 -1
- package/dist-esm/src/chatThreadClient.js +9 -33
- package/dist-esm/src/chatThreadClient.js.map +1 -1
- package/dist-esm/src/generated/src/chatApiClient.js +2 -2
- package/dist-esm/src/generated/src/chatApiClient.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 +2 -37
- package/dist-esm/src/generated/src/models/mappers.js.map +1 -1
- package/dist-esm/src/generated/src/models/parameters.js +1 -1
- package/dist-esm/src/generated/src/models/parameters.js.map +1 -1
- package/dist-esm/src/generated/src/tracing.js +1 -1
- package/dist-esm/src/generated/src/tracing.js.map +1 -1
- package/dist-esm/src/models/models.js.map +1 -1
- package/dist-esm/src/models/options.js.map +1 -1
- package/package.json +9 -9
- package/types/communication-chat.d.ts +7 -30
package/dist/index.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
3
5
|
var tslib = require('tslib');
|
|
4
6
|
var communicationCommon = require('@azure/communication-common');
|
|
5
7
|
var logger$1 = require('@azure/logger');
|
|
@@ -137,7 +139,7 @@ const mapToReadReceiptSdkModel = (readReceipt) => {
|
|
|
137
139
|
const tracingClient = coreTracing.createTracingClient({
|
|
138
140
|
namespace: "Azure.Communication",
|
|
139
141
|
packageName: "@azure/communication-chat",
|
|
140
|
-
packageVersion: "1.4.0
|
|
142
|
+
packageVersion: "1.4.0"
|
|
141
143
|
});
|
|
142
144
|
|
|
143
145
|
/*
|
|
@@ -628,13 +630,6 @@ const ChatParticipant = {
|
|
|
628
630
|
type: {
|
|
629
631
|
name: "DateTime"
|
|
630
632
|
}
|
|
631
|
-
},
|
|
632
|
-
metadata: {
|
|
633
|
-
serializedName: "metadata",
|
|
634
|
-
type: {
|
|
635
|
-
name: "Dictionary",
|
|
636
|
-
value: { type: { name: "String" } }
|
|
637
|
-
}
|
|
638
633
|
}
|
|
639
634
|
}
|
|
640
635
|
}
|
|
@@ -652,15 +647,9 @@ const ChatAttachment = {
|
|
|
652
647
|
}
|
|
653
648
|
},
|
|
654
649
|
attachmentType: {
|
|
650
|
+
defaultValue: "image",
|
|
651
|
+
isConstant: true,
|
|
655
652
|
serializedName: "attachmentType",
|
|
656
|
-
required: true,
|
|
657
|
-
type: {
|
|
658
|
-
name: "Enum",
|
|
659
|
-
allowedValues: ["teamsInlineImage", "teamsImage", "file"]
|
|
660
|
-
}
|
|
661
|
-
},
|
|
662
|
-
contentType: {
|
|
663
|
-
serializedName: "contentType",
|
|
664
653
|
type: {
|
|
665
654
|
name: "String"
|
|
666
655
|
}
|
|
@@ -673,7 +662,6 @@ const ChatAttachment = {
|
|
|
673
662
|
},
|
|
674
663
|
url: {
|
|
675
664
|
serializedName: "url",
|
|
676
|
-
required: true,
|
|
677
665
|
type: {
|
|
678
666
|
name: "String"
|
|
679
667
|
}
|
|
@@ -801,13 +789,6 @@ const CreateChatThreadRequest = {
|
|
|
801
789
|
}
|
|
802
790
|
}
|
|
803
791
|
}
|
|
804
|
-
},
|
|
805
|
-
metadata: {
|
|
806
|
-
serializedName: "metadata",
|
|
807
|
-
type: {
|
|
808
|
-
name: "Dictionary",
|
|
809
|
-
value: { type: { name: "String" } }
|
|
810
|
-
}
|
|
811
792
|
}
|
|
812
793
|
}
|
|
813
794
|
}
|
|
@@ -878,13 +859,6 @@ const ChatThreadProperties = {
|
|
|
878
859
|
type: {
|
|
879
860
|
name: "DateTime"
|
|
880
861
|
}
|
|
881
|
-
},
|
|
882
|
-
metadata: {
|
|
883
|
-
serializedName: "metadata",
|
|
884
|
-
type: {
|
|
885
|
-
name: "Dictionary",
|
|
886
|
-
value: { type: { name: "String" } }
|
|
887
|
-
}
|
|
888
862
|
}
|
|
889
863
|
}
|
|
890
864
|
}
|
|
@@ -962,13 +936,6 @@ const UpdateChatThreadRequest = {
|
|
|
962
936
|
type: {
|
|
963
937
|
name: "String"
|
|
964
938
|
}
|
|
965
|
-
},
|
|
966
|
-
metadata: {
|
|
967
|
-
serializedName: "metadata",
|
|
968
|
-
type: {
|
|
969
|
-
name: "Dictionary",
|
|
970
|
-
value: { type: { name: "String" } }
|
|
971
|
-
}
|
|
972
939
|
}
|
|
973
940
|
}
|
|
974
941
|
}
|
|
@@ -1079,7 +1046,7 @@ const skip = {
|
|
|
1079
1046
|
const apiVersion = {
|
|
1080
1047
|
parameterPath: "apiVersion",
|
|
1081
1048
|
mapper: {
|
|
1082
|
-
defaultValue: "2023-07
|
|
1049
|
+
defaultValue: "2023-11-07",
|
|
1083
1050
|
isConstant: true,
|
|
1084
1051
|
serializedName: "api-version",
|
|
1085
1052
|
type: {
|
|
@@ -2079,7 +2046,7 @@ class ChatApiClient extends coreClient__namespace.ServiceClient {
|
|
|
2079
2046
|
const defaults = {
|
|
2080
2047
|
requestContentType: "application/json; charset=utf-8"
|
|
2081
2048
|
};
|
|
2082
|
-
const packageDetails = `azsdk-js-communication-chat/1.4.0
|
|
2049
|
+
const packageDetails = `azsdk-js-communication-chat/1.4.0`;
|
|
2083
2050
|
const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
|
|
2084
2051
|
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
|
|
2085
2052
|
: `${packageDetails}`;
|
|
@@ -2090,7 +2057,7 @@ class ChatApiClient extends coreClient__namespace.ServiceClient {
|
|
|
2090
2057
|
// Parameter assignments
|
|
2091
2058
|
this.endpoint = endpoint;
|
|
2092
2059
|
// Assigning values to Constant parameters
|
|
2093
|
-
this.apiVersion = options.apiVersion || "2023-07
|
|
2060
|
+
this.apiVersion = options.apiVersion || "2023-11-07";
|
|
2094
2061
|
this.chatThread = new ChatThreadImpl(this);
|
|
2095
2062
|
this.chat = new ChatImpl(this);
|
|
2096
2063
|
this.addCustomApiVersionPolicy(options.apiVersion);
|
|
@@ -2185,15 +2152,6 @@ class ChatThreadClient {
|
|
|
2185
2152
|
await this.client.chatThread.updateChatThreadProperties(this.threadId, { topic: topic }, updatedOptions);
|
|
2186
2153
|
});
|
|
2187
2154
|
}
|
|
2188
|
-
/**
|
|
2189
|
-
* Updates a thread's properties.
|
|
2190
|
-
* @param options - Operation options.
|
|
2191
|
-
*/
|
|
2192
|
-
updateProperties(options = {}) {
|
|
2193
|
-
return tracingClient.withSpan("ChatThreadClient-UpdateProperties", options, async (updatedOptions) => {
|
|
2194
|
-
await this.client.chatThread.updateChatThreadProperties(this.threadId, options, updatedOptions);
|
|
2195
|
-
});
|
|
2196
|
-
}
|
|
2197
2155
|
/**
|
|
2198
2156
|
* Sends a chat message to a thread identified by threadId.
|
|
2199
2157
|
* Returns the id of the created message.
|
|
@@ -2245,16 +2203,11 @@ class ChatThreadClient {
|
|
|
2245
2203
|
return tslib.__asyncGenerator(this, arguments, function* listMessagesAll_1() {
|
|
2246
2204
|
var _a, e_1, _b, _c;
|
|
2247
2205
|
try {
|
|
2248
|
-
for (var _d = true, _e = tslib.__asyncValues(this.listMessagesPage({}, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a;) {
|
|
2206
|
+
for (var _d = true, _e = tslib.__asyncValues(this.listMessagesPage({}, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) {
|
|
2249
2207
|
_c = _f.value;
|
|
2250
2208
|
_d = false;
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
|
|
2254
|
-
}
|
|
2255
|
-
finally {
|
|
2256
|
-
_d = true;
|
|
2257
|
-
}
|
|
2209
|
+
const page = _c;
|
|
2210
|
+
yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
|
|
2258
2211
|
}
|
|
2259
2212
|
}
|
|
2260
2213
|
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
@@ -2354,16 +2307,11 @@ class ChatThreadClient {
|
|
|
2354
2307
|
return tslib.__asyncGenerator(this, arguments, function* listParticipantsAll_1() {
|
|
2355
2308
|
var _a, e_2, _b, _c;
|
|
2356
2309
|
try {
|
|
2357
|
-
for (var _d = true, _e = tslib.__asyncValues(this.listParticipantsPage({}, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a;) {
|
|
2310
|
+
for (var _d = true, _e = tslib.__asyncValues(this.listParticipantsPage({}, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) {
|
|
2358
2311
|
_c = _f.value;
|
|
2359
2312
|
_d = false;
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
|
|
2363
|
-
}
|
|
2364
|
-
finally {
|
|
2365
|
-
_d = true;
|
|
2366
|
-
}
|
|
2313
|
+
const page = _c;
|
|
2314
|
+
yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
|
|
2367
2315
|
}
|
|
2368
2316
|
}
|
|
2369
2317
|
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
@@ -2471,16 +2419,11 @@ class ChatThreadClient {
|
|
|
2471
2419
|
return tslib.__asyncGenerator(this, arguments, function* listReadReceiptsAll_1() {
|
|
2472
2420
|
var _a, e_3, _b, _c;
|
|
2473
2421
|
try {
|
|
2474
|
-
for (var _d = true, _e = tslib.__asyncValues(this.listReadReceiptsPage({}, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a;) {
|
|
2422
|
+
for (var _d = true, _e = tslib.__asyncValues(this.listReadReceiptsPage({}, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) {
|
|
2475
2423
|
_c = _f.value;
|
|
2476
2424
|
_d = false;
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
|
|
2480
|
-
}
|
|
2481
|
-
finally {
|
|
2482
|
-
_d = true;
|
|
2483
|
-
}
|
|
2425
|
+
const page = _c;
|
|
2426
|
+
yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
|
|
2484
2427
|
}
|
|
2485
2428
|
}
|
|
2486
2429
|
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
@@ -2584,6 +2527,7 @@ class ChatClient {
|
|
|
2584
2527
|
this.isRealtimeNotificationsStarted = false;
|
|
2585
2528
|
this.tokenCredential = credential;
|
|
2586
2529
|
this.clientOptions = Object.assign({}, options);
|
|
2530
|
+
this.clientOptions.signalingClientOptions = Object.assign(Object.assign({}, this.clientOptions.signalingClientOptions), { resourceEndpoint: this.endpoint });
|
|
2587
2531
|
const internalPipelineOptions = Object.assign(Object.assign({}, options), {
|
|
2588
2532
|
loggingOptions: {
|
|
2589
2533
|
logger: logger.info,
|
|
@@ -2592,8 +2536,7 @@ class ChatClient {
|
|
|
2592
2536
|
this.client = new ChatApiClient(this.endpoint, Object.assign({ endpoint: this.endpoint }, internalPipelineOptions));
|
|
2593
2537
|
const authPolicy = createCommunicationTokenCredentialPolicy(this.tokenCredential);
|
|
2594
2538
|
this.client.pipeline.addPolicy(authPolicy);
|
|
2595
|
-
|
|
2596
|
-
this.signalingClient = getSignalingClient(credential, logger, options.signalingClientOptions);
|
|
2539
|
+
this.signalingClient = getSignalingClient(credential, logger, this.clientOptions.signalingClientOptions);
|
|
2597
2540
|
}
|
|
2598
2541
|
/**
|
|
2599
2542
|
* Returns ChatThreadClient with the specific thread id.
|
|
@@ -2617,7 +2560,6 @@ class ChatClient {
|
|
|
2617
2560
|
const result = await this.client.chat.createChatThread({
|
|
2618
2561
|
topic: request.topic,
|
|
2619
2562
|
participants: (_b = options.participants) === null || _b === void 0 ? void 0 : _b.map((participant) => mapToChatParticipantRestModel(participant)),
|
|
2620
|
-
metadata: options.metadata,
|
|
2621
2563
|
}, updatedRestModelOptions);
|
|
2622
2564
|
return mapToCreateChatThreadResultSdkModel(result);
|
|
2623
2565
|
});
|
|
@@ -2647,16 +2589,11 @@ class ChatClient {
|
|
|
2647
2589
|
return tslib.__asyncGenerator(this, arguments, function* listChatThreadsAll_1() {
|
|
2648
2590
|
var _a, e_1, _b, _c;
|
|
2649
2591
|
try {
|
|
2650
|
-
for (var _d = true, _e = tslib.__asyncValues(this.listChatThreadsPage({}, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a;) {
|
|
2592
|
+
for (var _d = true, _e = tslib.__asyncValues(this.listChatThreadsPage({}, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) {
|
|
2651
2593
|
_c = _f.value;
|
|
2652
2594
|
_d = false;
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
|
|
2656
|
-
}
|
|
2657
|
-
finally {
|
|
2658
|
-
_d = true;
|
|
2659
|
-
}
|
|
2595
|
+
const page = _c;
|
|
2596
|
+
yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
|
|
2660
2597
|
}
|
|
2661
2598
|
}
|
|
2662
2599
|
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|