@twilio/conversations 3.0.1-rc.102 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/builds/browser.esm.js +10846 -0
- package/builds/browser.esm.js.map +1 -0
- package/builds/browser.js +891 -260
- package/builds/browser.js.map +1 -1
- package/builds/lib.d.ts +162 -52
- package/builds/lib.esm.d.ts +3178 -0
- package/builds/lib.esm.js +10845 -0
- package/builds/lib.js +900 -260
- package/builds/lib.js.map +1 -1
- package/builds/twilio-conversations.js +9407 -10424
- package/builds/twilio-conversations.js.map +1 -0
- package/builds/twilio-conversations.min.js +2 -1
- package/builds/twilio-conversations.min.js.map +1 -0
- package/dist/aggregated-delivery-receipt.js +1 -5
- package/dist/aggregated-delivery-receipt.js.map +1 -1
- package/dist/channel-metadata-client.js +5 -10
- package/dist/channel-metadata-client.js.map +1 -1
- package/dist/client.js +218 -204
- package/dist/client.js.map +1 -1
- package/dist/command-executor.js +6 -10
- package/dist/command-executor.js.map +1 -1
- package/dist/configuration.js +14 -14
- package/dist/configuration.js.map +1 -1
- package/dist/content-client.js +5 -9
- package/dist/content-client.js.map +1 -1
- package/dist/content-template.js +1 -7
- package/dist/content-template.js.map +1 -1
- package/dist/conversation.js +170 -134
- package/dist/conversation.js.map +1 -1
- package/dist/data/conversations.js +44 -46
- package/dist/data/conversations.js.map +1 -1
- package/dist/data/messages.js +18 -22
- package/dist/data/messages.js.map +1 -1
- package/dist/data/participants.js +22 -25
- package/dist/data/participants.js.map +1 -1
- package/dist/data/users.js +10 -14
- package/dist/data/users.js.map +1 -1
- package/dist/detailed-delivery-receipt.js +1 -5
- package/dist/detailed-delivery-receipt.js.map +1 -1
- package/dist/index.js +17 -46
- package/dist/index.js.map +1 -1
- package/dist/interfaces/notification-types.js +1 -5
- package/dist/interfaces/notification-types.js.map +1 -1
- package/dist/interfaces/rules.js +7 -13
- package/dist/interfaces/rules.js.map +1 -1
- package/dist/logger.js +9 -29
- package/dist/logger.js.map +1 -1
- package/dist/media.js +32 -25
- package/dist/media.js.map +1 -1
- package/dist/message-builder.js +43 -47
- package/dist/message-builder.js.map +1 -1
- package/dist/message-recipients-client.js +231 -0
- package/dist/message-recipients-client.js.map +1 -0
- package/dist/message.js +120 -98
- package/dist/message.js.map +1 -1
- package/dist/node_modules/quick-lru/index.js +1 -5
- package/dist/node_modules/quick-lru/index.js.map +1 -1
- package/dist/node_modules/tslib/tslib.es6.js +7 -6
- package/dist/node_modules/tslib/tslib.es6.js.map +1 -1
- package/dist/packages/conversations/package.json.js +2 -6
- package/dist/packages/conversations/package.json.js.map +1 -1
- package/dist/participant.js +32 -37
- package/dist/participant.js.map +1 -1
- package/dist/push-notification.js +1 -5
- package/dist/push-notification.js.map +1 -1
- package/dist/rest-paginator.js +1 -5
- package/dist/rest-paginator.js.map +1 -1
- package/dist/services/network.js +3 -7
- package/dist/services/network.js.map +1 -1
- package/dist/services/typing-indicator.js +7 -10
- package/dist/services/typing-indicator.js.map +1 -1
- package/dist/unsent-message.js +5 -9
- package/dist/unsent-message.js.map +1 -1
- package/dist/user.js +21 -30
- package/dist/user.js.map +1 -1
- package/dist/util/deferred.js +1 -5
- package/dist/util/deferred.js.map +1 -1
- package/dist/util/index.js +36 -9
- package/dist/util/index.js.map +1 -1
- package/dist/utils/uuid.js +145 -0
- package/dist/utils/uuid.js.map +1 -0
- package/package.json +14 -17
- package/docs/assets/css/main.css +0 -2660
- package/docs/assets/images/icons.png +0 -0
- package/docs/assets/images/icons@2x.png +0 -0
- package/docs/assets/images/widgets.png +0 -0
- package/docs/assets/images/widgets@2x.png +0 -0
- package/docs/assets/js/main.js +0 -248
- package/docs/assets/js/search.js +0 -1
- package/docs/classes/AggregatedDeliveryReceipt.html +0 -3184
- package/docs/classes/CancellablePromise.html +0 -3213
- package/docs/classes/ChannelMetadata.html +0 -3050
- package/docs/classes/Client.html +0 -4278
- package/docs/classes/ContentTemplate.html +0 -3116
- package/docs/classes/ContentTemplateVariable.html +0 -3116
- package/docs/classes/Conversation.html +0 -4359
- package/docs/classes/DetailedDeliveryReceipt.html +0 -3163
- package/docs/classes/Media.html +0 -3167
- package/docs/classes/Message.html +0 -3803
- package/docs/classes/MessageBuilder.html +0 -3318
- package/docs/classes/Participant.html +0 -3444
- package/docs/classes/PushNotification.html +0 -3130
- package/docs/classes/RestPaginator.html +0 -3160
- package/docs/classes/UnsentMessage.html +0 -3042
- package/docs/classes/User.html +0 -3349
- package/docs/index.html +0 -4333
- package/docs/interfaces/ClientOptions.html +0 -3050
- package/docs/interfaces/ConversationBindings.html +0 -3001
- package/docs/interfaces/ConversationEmailBinding.html +0 -3001
- package/docs/interfaces/ConversationLimits.html +0 -3098
- package/docs/interfaces/ConversationState.html +0 -3050
- package/docs/interfaces/ConversationUpdatedEventArgs.html +0 -3001
- package/docs/interfaces/CreateConversationOptions.html +0 -3066
- package/docs/interfaces/LastMessage.html +0 -3050
- package/docs/interfaces/Paginator.html +0 -3141
- package/docs/interfaces/ParticipantBindings.html +0 -3001
- package/docs/interfaces/ParticipantEmailBinding.html +0 -3001
- package/docs/interfaces/PushNotificationData.html +0 -3114
- package/docs/interfaces/SendEmailOptions.html +0 -3034
- package/docs/interfaces/SendMediaOptions.html +0 -3068
- package/docs/modules.html +0 -4334
package/dist/client.js
CHANGED
|
@@ -126,8 +126,6 @@ This software includes platform.js under the following license.
|
|
|
126
126
|
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
127
127
|
|
|
128
128
|
*/
|
|
129
|
-
'use strict';
|
|
130
|
-
|
|
131
129
|
var global =
|
|
132
130
|
typeof global !== "undefined"
|
|
133
131
|
? global
|
|
@@ -137,31 +135,30 @@ var global =
|
|
|
137
135
|
? window
|
|
138
136
|
: {};
|
|
139
137
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
var channelMetadataClient = require('./channel-metadata-client.js');
|
|
138
|
+
import { __decorate, __metadata } from './node_modules/tslib/tslib.es6.js';
|
|
139
|
+
import { Logger } from './logger.js';
|
|
140
|
+
import { Configuration } from './configuration.js';
|
|
141
|
+
import { User } from './user.js';
|
|
142
|
+
import { Network } from './services/network.js';
|
|
143
|
+
import { NotificationTypes } from './interfaces/notification-types.js';
|
|
144
|
+
import { InitRegistration, TwilsockClient, TelemetryEventDescription, TelemetryPoint } from 'twilsock';
|
|
145
|
+
import { Notifications } from '@twilio/notifications';
|
|
146
|
+
import { SyncClient } from 'twilio-sync';
|
|
147
|
+
import { CancellablePromise, McsClient } from '@twilio/mcs-client';
|
|
148
|
+
import { Conversations } from './data/conversations.js';
|
|
149
|
+
import { Users } from './data/users.js';
|
|
150
|
+
import { TypingIndicator } from './services/typing-indicator.js';
|
|
151
|
+
import { PushNotification } from './push-notification.js';
|
|
152
|
+
import { deepClone, parseToNumber } from './util/index.js';
|
|
153
|
+
import { validateTypesAsync, nonEmptyString, objectSchema, literal, pureObject, nonEmptyArray, validateTypes, validateConstructorTypes } from '@twilio/declarative-type-validator';
|
|
154
|
+
import { version } from './packages/conversations/package.json.js';
|
|
155
|
+
import { CommandExecutor } from './command-executor.js';
|
|
156
|
+
import { ReplayEventEmitter } from '@twilio/replay-event-emitter';
|
|
157
|
+
import { Media } from './media.js';
|
|
158
|
+
import { deprecated, deprecationWarning } from '@twilio/deprecation-decorator';
|
|
159
|
+
import { ContentClient } from './content-client.js';
|
|
160
|
+
import { ChannelMetadataClient } from './channel-metadata-client.js';
|
|
161
|
+
import { MessageRecipientsClient } from './message-recipients-client.js';
|
|
165
162
|
|
|
166
163
|
var Client_1;
|
|
167
164
|
/**
|
|
@@ -172,9 +169,9 @@ class ClientServices {
|
|
|
172
169
|
/**
|
|
173
170
|
* A client is the starting point to the Twilio Conversations functionality.
|
|
174
171
|
*/
|
|
175
|
-
|
|
172
|
+
let Client = Client_1 = class Client extends ReplayEventEmitter {
|
|
176
173
|
/**
|
|
177
|
-
* Returned Conversations instance is not yet fully initialized. Calling any
|
|
174
|
+
* Returned Conversations Client instance is not yet fully initialized. Calling any
|
|
178
175
|
* operations will block until it is. Use connection events to monitor when
|
|
179
176
|
* client becomes fully available (connectionStateChanged with state
|
|
180
177
|
* 'connected') or not available (connectionStateChange with state 'denied',
|
|
@@ -190,20 +187,20 @@ exports.Client = Client_1 = class Client extends replayEventEmitter.ReplayEventE
|
|
|
190
187
|
/**
|
|
191
188
|
* Current version of the Conversations client.
|
|
192
189
|
*/
|
|
193
|
-
this.version =
|
|
190
|
+
this.version = version;
|
|
194
191
|
/**
|
|
195
192
|
* Client connection state.
|
|
196
193
|
*/
|
|
197
194
|
this.connectionState = "unknown";
|
|
198
195
|
/**
|
|
199
|
-
*
|
|
196
|
+
* Parse a push notification payload.
|
|
200
197
|
*/
|
|
201
198
|
this.parsePushNotification = Client_1.parsePushNotification;
|
|
202
199
|
this._fpaToken = fpaToken !== null && fpaToken !== void 0 ? fpaToken : "";
|
|
203
200
|
this._options = options !== null && options !== void 0 ? options : {};
|
|
204
201
|
if (!this._options.disableDeepClone) {
|
|
205
202
|
let options = Object.assign(Object.assign({}, this._options), { transport: undefined, twilsockClient: undefined });
|
|
206
|
-
options =
|
|
203
|
+
options = deepClone(options);
|
|
207
204
|
options.transport = this._options.transport;
|
|
208
205
|
options.twilsockClient = this._options.twilsockClient;
|
|
209
206
|
this._options = options;
|
|
@@ -218,7 +215,7 @@ exports.Client = Client_1 = class Client extends replayEventEmitter.ReplayEventE
|
|
|
218
215
|
}
|
|
219
216
|
if (!this._options.clientMetadata.hasOwnProperty("sdk")) {
|
|
220
217
|
this._options.clientMetadata.sdk = "JS";
|
|
221
|
-
this._options.clientMetadata.sdkv =
|
|
218
|
+
this._options.clientMetadata.sdkv = version;
|
|
222
219
|
}
|
|
223
220
|
// Enable session local storage for Sync
|
|
224
221
|
this._options.Sync = this._options.Sync || {};
|
|
@@ -232,7 +229,7 @@ exports.Client = Client_1 = class Client extends replayEventEmitter.ReplayEventE
|
|
|
232
229
|
throw new Error("A valid Twilio token should be provided");
|
|
233
230
|
}
|
|
234
231
|
this._services = new ClientServices();
|
|
235
|
-
this._myself = new
|
|
232
|
+
this._myself = new User("", "", null, this._services);
|
|
236
233
|
const startTwilsock = !this._options.twilsockClient;
|
|
237
234
|
// Create default init registrations if none were provided.
|
|
238
235
|
// Otherwise, the outside party have to list all the init registrations they
|
|
@@ -240,45 +237,46 @@ exports.Client = Client_1 = class Client extends replayEventEmitter.ReplayEventE
|
|
|
240
237
|
// Init registrations passed to the Conversations client will be passed down
|
|
241
238
|
// to the Sync client as well.
|
|
242
239
|
if (!this._options.initRegistrations) {
|
|
243
|
-
const initRegistration = new
|
|
240
|
+
const initRegistration = new InitRegistration(productId);
|
|
244
241
|
Client_1.populateInitRegistrations(initRegistration);
|
|
245
242
|
this._options.initRegistrations = [initRegistration];
|
|
246
243
|
}
|
|
247
244
|
this._services.twilsockClient = this._options.twilsockClient =
|
|
248
|
-
(_b = this._options.twilsockClient) !== null && _b !== void 0 ? _b : new
|
|
249
|
-
this._services.twilsockClient.on(
|
|
250
|
-
this._services.twilsockClient.on(
|
|
251
|
-
this._services.twilsockClient.on(
|
|
245
|
+
(_b = this._options.twilsockClient) !== null && _b !== void 0 ? _b : new TwilsockClient(fpaToken, productId, this._options);
|
|
246
|
+
this._services.twilsockClient.on(Client_1.tokenAboutToExpire, () => this.emit(Client_1.tokenAboutToExpire));
|
|
247
|
+
this._services.twilsockClient.on(Client_1.tokenExpired, () => this.emit(Client_1.tokenExpired));
|
|
248
|
+
this._services.twilsockClient.on(Client_1.connectionError, (error) => this.emit(Client_1.connectionError, error));
|
|
252
249
|
this._services.twilsockClient.on("stateChanged", (state) => {
|
|
253
250
|
Client_1._logger.debug(`Handling stateChanged for ConversationsClient: new state ${state}`);
|
|
254
251
|
if (state !== this.connectionState) {
|
|
255
252
|
this.connectionState = state;
|
|
256
|
-
this.emit(
|
|
253
|
+
this.emit(Client_1.connectionStateChanged, this.connectionState);
|
|
257
254
|
}
|
|
258
255
|
});
|
|
259
256
|
this._services.transport = this._options.transport = ((_c = this._options
|
|
260
257
|
.transport) !== null && _c !== void 0 ? _c : this._options.twilsockClient);
|
|
261
258
|
this._services.notificationClient = this._options.notificationsClient =
|
|
262
|
-
(_d = this._options.notificationsClient) !== null && _d !== void 0 ? _d : new
|
|
259
|
+
(_d = this._options.notificationsClient) !== null && _d !== void 0 ? _d : new Notifications(fpaToken, this._options);
|
|
263
260
|
this._services.syncClient = this._options.syncClient =
|
|
264
|
-
(_e = this._options.syncClient) !== null && _e !== void 0 ? _e : new
|
|
261
|
+
(_e = this._options.syncClient) !== null && _e !== void 0 ? _e : new SyncClient(fpaToken, this._options);
|
|
265
262
|
const configurationOptions = (options === null || options === void 0 ? void 0 : options.Chat) || (options === null || options === void 0 ? void 0 : options.IPMessaging) || options || {};
|
|
266
263
|
const region = configurationOptions.region || (options === null || options === void 0 ? void 0 : options.region);
|
|
267
264
|
const baseUrl = configurationOptions.apiUri ||
|
|
268
265
|
configurationOptions.typingUri ||
|
|
269
266
|
`https://aim.${region || "us1"}.twilio.com`;
|
|
270
|
-
this._services.commandExecutor = new
|
|
271
|
-
this._services.contentClient = new
|
|
267
|
+
this._services.commandExecutor = new CommandExecutor(baseUrl, { transport: this._options.transport }, productId);
|
|
268
|
+
this._services.contentClient = new ContentClient(this._services);
|
|
272
269
|
const emitFailed = (error) => {
|
|
273
270
|
this._rejectEnsureReady(error);
|
|
274
|
-
this.emit(
|
|
275
|
-
this.emit(
|
|
271
|
+
this.emit(Client_1.stateChanged, "failed");
|
|
272
|
+
this.emit(Client_1.initFailed, { error });
|
|
276
273
|
};
|
|
277
274
|
const emitDisconnected = () => {
|
|
278
275
|
emitFailed({
|
|
279
276
|
terminal: true,
|
|
280
277
|
message: "Twilsock has disconnected.",
|
|
281
278
|
});
|
|
279
|
+
this._initializeEnsureReady((options === null || options === void 0 ? void 0 : options.throwErrorsAlways) || false);
|
|
282
280
|
};
|
|
283
281
|
this._services.twilsockClient.once("connectionError", emitFailed);
|
|
284
282
|
this._services.twilsockClient.once("disconnected", emitDisconnected);
|
|
@@ -288,9 +286,9 @@ exports.Client = Client_1 = class Client extends replayEventEmitter.ReplayEventE
|
|
|
288
286
|
this._services.twilsockClient.off("disconnected", emitDisconnected);
|
|
289
287
|
try {
|
|
290
288
|
const startupEvent = "conversations.client.startup";
|
|
291
|
-
this._services.twilsockClient.addPartialTelemetryEvent(new
|
|
289
|
+
this._services.twilsockClient.addPartialTelemetryEvent(new TelemetryEventDescription(startupEvent, "Conversations client startup", new Date()), startupEvent, TelemetryPoint.Start);
|
|
292
290
|
await this._initialize();
|
|
293
|
-
this._services.twilsockClient.addPartialTelemetryEvent(new
|
|
291
|
+
this._services.twilsockClient.addPartialTelemetryEvent(new TelemetryEventDescription("", "", new Date()), startupEvent, TelemetryPoint.End);
|
|
294
292
|
}
|
|
295
293
|
catch (err) {
|
|
296
294
|
// Fail ChatClient if initialization is incomplete
|
|
@@ -299,16 +297,13 @@ exports.Client = Client_1 = class Client extends replayEventEmitter.ReplayEventE
|
|
|
299
297
|
message: err.message,
|
|
300
298
|
};
|
|
301
299
|
this._rejectEnsureReady(connectionError);
|
|
302
|
-
this.emit(
|
|
303
|
-
this.emit(
|
|
300
|
+
this.emit(Client_1.stateChanged, "failed");
|
|
301
|
+
this.emit(Client_1.initFailed, {
|
|
304
302
|
error: connectionError,
|
|
305
303
|
});
|
|
306
304
|
}
|
|
307
305
|
});
|
|
308
|
-
this.
|
|
309
|
-
this._resolveEnsureReady = resolve;
|
|
310
|
-
this._rejectEnsureReady = reject;
|
|
311
|
-
}).catch(() => void 0); // @todo How to process unhandled rejection here?
|
|
306
|
+
this._initializeEnsureReady((options === null || options === void 0 ? void 0 : options.throwErrorsAlways) || false);
|
|
312
307
|
if (startTwilsock) {
|
|
313
308
|
this._services.twilsockClient.connect();
|
|
314
309
|
}
|
|
@@ -400,7 +395,7 @@ exports.Client = Client_1 = class Client extends replayEventEmitter.ReplayEventE
|
|
|
400
395
|
body = ((_a = apsPayload.alert) === null || _a === void 0 ? void 0 : _a.body) || null;
|
|
401
396
|
title = ((_b = apsPayload.alert) === null || _b === void 0 ? void 0 : _b.title) || null;
|
|
402
397
|
}
|
|
403
|
-
return new
|
|
398
|
+
return new PushNotification({
|
|
404
399
|
title,
|
|
405
400
|
body,
|
|
406
401
|
sound: apsPayload.sound || null,
|
|
@@ -417,7 +412,7 @@ exports.Client = Client_1 = class Client extends replayEventEmitter.ReplayEventE
|
|
|
417
412
|
throw new Error("Provided push notification payload does not contain Programmable Chat push notification type");
|
|
418
413
|
}
|
|
419
414
|
const data = Client_1._parsePushNotificationChatData(notificationPayload.data);
|
|
420
|
-
return new
|
|
415
|
+
return new PushNotification({
|
|
421
416
|
title: dataPayload.twi_title || null,
|
|
422
417
|
body: dataPayload.twi_body || null,
|
|
423
418
|
sound: dataPayload.twi_sound || null,
|
|
@@ -441,7 +436,7 @@ exports.Client = Client_1 = class Client extends replayEventEmitter.ReplayEventE
|
|
|
441
436
|
continue;
|
|
442
437
|
}
|
|
443
438
|
if (key === "message_index" || key === "media_count") {
|
|
444
|
-
const number =
|
|
439
|
+
const number = parseToNumber(value);
|
|
445
440
|
if (number !== null) {
|
|
446
441
|
result[Client_1._supportedPushDataFields[key]] = number;
|
|
447
442
|
}
|
|
@@ -467,8 +462,8 @@ exports.Client = Client_1 = class Client extends replayEventEmitter.ReplayEventE
|
|
|
467
462
|
* @param reg The init registration to populate.
|
|
468
463
|
*/
|
|
469
464
|
static populateInitRegistrations(reg) {
|
|
470
|
-
reg.populateInitRegistrations([
|
|
471
|
-
|
|
465
|
+
reg.populateInitRegistrations([NotificationTypes.TYPING_INDICATOR]);
|
|
466
|
+
SyncClient.populateInitRegistrations(reg);
|
|
472
467
|
}
|
|
473
468
|
/**
|
|
474
469
|
* Gracefully shut down the client.
|
|
@@ -504,7 +499,7 @@ exports.Client = Client_1 = class Client extends replayEventEmitter.ReplayEventE
|
|
|
504
499
|
if (!conversation) {
|
|
505
500
|
conversation = await this.peekConversationBySid(conversationSid);
|
|
506
501
|
if (conversation) {
|
|
507
|
-
|
|
502
|
+
deprecationWarning("The method getConversationBySid is deprecated to retrieve conversations you're not part of. Use peekConversationBySid instead.");
|
|
508
503
|
}
|
|
509
504
|
}
|
|
510
505
|
if (!conversation) {
|
|
@@ -515,7 +510,6 @@ exports.Client = Client_1 = class Client extends replayEventEmitter.ReplayEventE
|
|
|
515
510
|
/**
|
|
516
511
|
* Peek a conversation by its SID.
|
|
517
512
|
* @param conversationSid Conversation sid
|
|
518
|
-
* @internal
|
|
519
513
|
*/
|
|
520
514
|
async peekConversationBySid(conversationSid) {
|
|
521
515
|
await this._ensureReady;
|
|
@@ -628,7 +622,7 @@ exports.Client = Client_1 = class Client extends replayEventEmitter.ReplayEventE
|
|
|
628
622
|
* @param mediaSids Set of media sids to query for the content URL.
|
|
629
623
|
*/
|
|
630
624
|
getTemporaryContentUrlsForMediaSids(mediaSids) {
|
|
631
|
-
return new
|
|
625
|
+
return new CancellablePromise(async (resolve, reject, onCancel) => {
|
|
632
626
|
if (!this._services.mcsClient || !mediaSids) {
|
|
633
627
|
reject(new Error("Media Content Service is unavailable"));
|
|
634
628
|
return;
|
|
@@ -671,12 +665,13 @@ exports.Client = Client_1 = class Client extends replayEventEmitter.ReplayEventE
|
|
|
671
665
|
*/
|
|
672
666
|
async _initialize() {
|
|
673
667
|
const configurationResponse = await this._services.commandExecutor.fetchResource("Client/v2/Configuration");
|
|
674
|
-
this._configuration = new
|
|
675
|
-
this._services.channelMetadataClient = new
|
|
668
|
+
this._configuration = new Configuration(this._options, configurationResponse, Client_1._logger);
|
|
669
|
+
this._services.channelMetadataClient = new ChannelMetadataClient(this._services, this._configuration);
|
|
670
|
+
this._services.messageRecipientsClient = new MessageRecipientsClient(this._services, this._configuration);
|
|
676
671
|
this._myself._resolveInitialization(this._configuration, this._configuration.userIdentity, this._configuration.userInfo, true);
|
|
677
|
-
this._services.typingIndicator = new
|
|
678
|
-
this._services.network = new
|
|
679
|
-
this._services.users = new
|
|
672
|
+
this._services.typingIndicator = new TypingIndicator(this.getConversationBySid.bind(this), this._configuration, this._services);
|
|
673
|
+
this._services.network = new Network(this._configuration, this._services);
|
|
674
|
+
this._services.users = new Users(this._myself, this._configuration, this._services);
|
|
680
675
|
this._services.users.on("userSubscribed", (user) => {
|
|
681
676
|
this.emit("userSubscribed", user);
|
|
682
677
|
});
|
|
@@ -684,7 +679,7 @@ exports.Client = Client_1 = class Client extends replayEventEmitter.ReplayEventE
|
|
|
684
679
|
this._services.users.on("userUnsubscribed", (user) => {
|
|
685
680
|
this.emit("userUnsubscribed", user);
|
|
686
681
|
});
|
|
687
|
-
this._conversationsEntity = new
|
|
682
|
+
this._conversationsEntity = new Conversations(this._configuration, this._services);
|
|
688
683
|
this._conversationsEntity.on("conversationAdded", (conversation) => {
|
|
689
684
|
this.emit("conversationAdded", conversation);
|
|
690
685
|
});
|
|
@@ -714,15 +709,16 @@ exports.Client = Client_1 = class Client extends replayEventEmitter.ReplayEventE
|
|
|
714
709
|
.fetchConversations()
|
|
715
710
|
.then(() => this._conversationsEntity)
|
|
716
711
|
.catch((error) => {
|
|
712
|
+
console.error("Failed to fetch conversations _conversationsPromise -> client.ts", error);
|
|
717
713
|
throw error;
|
|
718
714
|
});
|
|
719
715
|
await this._services.users.myself._ensureFetched();
|
|
720
716
|
Client_1._supportedPushChannels.forEach((channelType) => this._subscribeToPushNotifications(channelType));
|
|
721
717
|
this._services.typingIndicator.initialize();
|
|
722
|
-
this._services.mcsClient = new
|
|
718
|
+
this._services.mcsClient = new McsClient(this._fpaToken, this._configuration.links.mediaService, this._configuration.links.mediaSetService, Object.assign(Object.assign({}, this._options), { transport: undefined }));
|
|
723
719
|
this._resolveEnsureReady();
|
|
724
|
-
this.emit(
|
|
725
|
-
this.emit(
|
|
720
|
+
this.emit(Client_1.stateChanged, "initialized");
|
|
721
|
+
this.emit(Client_1.initialized);
|
|
726
722
|
}
|
|
727
723
|
/**
|
|
728
724
|
* Subscribe to push notifications.
|
|
@@ -730,11 +726,11 @@ exports.Client = Client_1 = class Client extends replayEventEmitter.ReplayEventE
|
|
|
730
726
|
*/
|
|
731
727
|
_subscribeToPushNotifications(channelType) {
|
|
732
728
|
[
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
729
|
+
NotificationTypes.NEW_MESSAGE,
|
|
730
|
+
NotificationTypes.ADDED_TO_CONVERSATION,
|
|
731
|
+
NotificationTypes.REMOVED_FROM_CONVERSATION,
|
|
732
|
+
NotificationTypes.TYPING_INDICATOR,
|
|
733
|
+
NotificationTypes.CONSUMPTION_UPDATE,
|
|
738
734
|
].forEach((messageType) => {
|
|
739
735
|
this._services.notificationClient.subscribe(channelType, messageType);
|
|
740
736
|
});
|
|
@@ -745,15 +741,31 @@ exports.Client = Client_1 = class Client extends replayEventEmitter.ReplayEventE
|
|
|
745
741
|
*/
|
|
746
742
|
_unsubscribeFromPushNotifications(channelType) {
|
|
747
743
|
[
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
744
|
+
NotificationTypes.NEW_MESSAGE,
|
|
745
|
+
NotificationTypes.ADDED_TO_CONVERSATION,
|
|
746
|
+
NotificationTypes.REMOVED_FROM_CONVERSATION,
|
|
747
|
+
NotificationTypes.TYPING_INDICATOR,
|
|
748
|
+
NotificationTypes.CONSUMPTION_UPDATE,
|
|
753
749
|
].forEach((messageType) => {
|
|
754
750
|
this._services.notificationClient.unsubscribe(channelType, messageType);
|
|
755
751
|
});
|
|
756
752
|
}
|
|
753
|
+
/**
|
|
754
|
+
* Initialize the ensureReady promise.
|
|
755
|
+
*/
|
|
756
|
+
_initializeEnsureReady(throwErrorsAlways) {
|
|
757
|
+
this._ensureReady = new Promise((resolve, reject) => {
|
|
758
|
+
this._resolveEnsureReady = resolve;
|
|
759
|
+
this._rejectEnsureReady = reject;
|
|
760
|
+
}).catch((error) => {
|
|
761
|
+
if (throwErrorsAlways) {
|
|
762
|
+
throw error;
|
|
763
|
+
}
|
|
764
|
+
else {
|
|
765
|
+
return void 0;
|
|
766
|
+
}
|
|
767
|
+
});
|
|
768
|
+
}
|
|
757
769
|
};
|
|
758
770
|
/**
|
|
759
771
|
* Fired when a conversation becomes visible to the client. The event is also
|
|
@@ -764,7 +776,7 @@ exports.Client = Client_1 = class Client extends replayEventEmitter.ReplayEventE
|
|
|
764
776
|
* 1. {@link Conversation} `conversation` - the conversation in question
|
|
765
777
|
* @event
|
|
766
778
|
*/
|
|
767
|
-
|
|
779
|
+
Client.conversationAdded = "conversationAdded";
|
|
768
780
|
/**
|
|
769
781
|
* Fired when the client joins a conversation.
|
|
770
782
|
*
|
|
@@ -772,7 +784,7 @@ exports.Client.conversationAdded = "conversationAdded";
|
|
|
772
784
|
* 1. {@link Conversation} `conversation` - the conversation in question
|
|
773
785
|
* @event
|
|
774
786
|
*/
|
|
775
|
-
|
|
787
|
+
Client.conversationJoined = "conversationJoined";
|
|
776
788
|
/**
|
|
777
789
|
* Fired when the client leaves a conversation.
|
|
778
790
|
*
|
|
@@ -780,7 +792,7 @@ exports.Client.conversationJoined = "conversationJoined";
|
|
|
780
792
|
* 1. {@link Conversation} `conversation` - the conversation in question
|
|
781
793
|
* @event
|
|
782
794
|
*/
|
|
783
|
-
|
|
795
|
+
Client.conversationLeft = "conversationLeft";
|
|
784
796
|
/**
|
|
785
797
|
* Fired when a conversation is no longer visible to the client.
|
|
786
798
|
*
|
|
@@ -788,7 +800,7 @@ exports.Client.conversationLeft = "conversationLeft";
|
|
|
788
800
|
* 1. {@link Conversation} `conversation` - the conversation in question
|
|
789
801
|
* @event
|
|
790
802
|
*/
|
|
791
|
-
|
|
803
|
+
Client.conversationRemoved = "conversationRemoved";
|
|
792
804
|
/**
|
|
793
805
|
* Fired when the attributes or the metadata of a conversation have been
|
|
794
806
|
* updated. During conversation's creation and initialization, this event
|
|
@@ -803,7 +815,7 @@ exports.Client.conversationRemoved = "conversationRemoved";
|
|
|
803
815
|
* for the update
|
|
804
816
|
* @event
|
|
805
817
|
*/
|
|
806
|
-
|
|
818
|
+
Client.conversationUpdated = "conversationUpdated";
|
|
807
819
|
/**
|
|
808
820
|
* Fired when a participant has joined a conversation.
|
|
809
821
|
*
|
|
@@ -811,7 +823,7 @@ exports.Client.conversationUpdated = "conversationUpdated";
|
|
|
811
823
|
* 1. {@link Participant} `participant` - the participant in question
|
|
812
824
|
* @event
|
|
813
825
|
*/
|
|
814
|
-
|
|
826
|
+
Client.participantJoined = "participantJoined";
|
|
815
827
|
/**
|
|
816
828
|
* Fired when a participant has left a conversation.
|
|
817
829
|
*
|
|
@@ -819,7 +831,7 @@ exports.Client.participantJoined = "participantJoined";
|
|
|
819
831
|
* 1. {@link Participant} `participant` - the participant in question
|
|
820
832
|
* @event
|
|
821
833
|
*/
|
|
822
|
-
|
|
834
|
+
Client.participantLeft = "participantLeft";
|
|
823
835
|
/**
|
|
824
836
|
* Fired when a participant's fields have been updated.
|
|
825
837
|
*
|
|
@@ -831,7 +843,7 @@ exports.Client.participantLeft = "participantLeft";
|
|
|
831
843
|
* for the update
|
|
832
844
|
* @event
|
|
833
845
|
*/
|
|
834
|
-
|
|
846
|
+
Client.participantUpdated = "participantUpdated";
|
|
835
847
|
/**
|
|
836
848
|
* Fired when a new message has been added to the conversation on the server.
|
|
837
849
|
*
|
|
@@ -839,7 +851,7 @@ exports.Client.participantUpdated = "participantUpdated";
|
|
|
839
851
|
* 1. {@link Message} `message` - the message in question
|
|
840
852
|
* @event
|
|
841
853
|
*/
|
|
842
|
-
|
|
854
|
+
Client.messageAdded = "messageAdded";
|
|
843
855
|
/**
|
|
844
856
|
* Fired when a message is removed from the message list of a conversation.
|
|
845
857
|
*
|
|
@@ -847,7 +859,7 @@ exports.Client.messageAdded = "messageAdded";
|
|
|
847
859
|
* 1. {@link Message} `message` - the message in question
|
|
848
860
|
* @event
|
|
849
861
|
*/
|
|
850
|
-
|
|
862
|
+
Client.messageRemoved = "messageRemoved";
|
|
851
863
|
/**
|
|
852
864
|
* Fired when the fields of an existing message are updated with new values.
|
|
853
865
|
*
|
|
@@ -859,17 +871,17 @@ exports.Client.messageRemoved = "messageRemoved";
|
|
|
859
871
|
* the update
|
|
860
872
|
* @event
|
|
861
873
|
*/
|
|
862
|
-
|
|
874
|
+
Client.messageUpdated = "messageUpdated";
|
|
863
875
|
/**
|
|
864
876
|
* Fired when the token is about to expire and needs to be updated.
|
|
865
877
|
* @event
|
|
866
878
|
*/
|
|
867
|
-
|
|
879
|
+
Client.tokenAboutToExpire = "tokenAboutToExpire";
|
|
868
880
|
/**
|
|
869
881
|
* Fired when the token has expired.
|
|
870
882
|
* @event
|
|
871
883
|
*/
|
|
872
|
-
|
|
884
|
+
Client.tokenExpired = "tokenExpired";
|
|
873
885
|
/**
|
|
874
886
|
* Fired when a participant has stopped typing.
|
|
875
887
|
*
|
|
@@ -877,7 +889,7 @@ exports.Client.tokenExpired = "tokenExpired";
|
|
|
877
889
|
* 1. {@link Participant} `participant` - the participant in question
|
|
878
890
|
* @event
|
|
879
891
|
*/
|
|
880
|
-
|
|
892
|
+
Client.typingEnded = "typingEnded";
|
|
881
893
|
/**
|
|
882
894
|
* Fired when a participant has started typing.
|
|
883
895
|
*
|
|
@@ -885,7 +897,7 @@ exports.Client.typingEnded = "typingEnded";
|
|
|
885
897
|
* 1. {@link Participant} `participant` - the participant in question
|
|
886
898
|
* @event
|
|
887
899
|
*/
|
|
888
|
-
|
|
900
|
+
Client.typingStarted = "typingStarted";
|
|
889
901
|
/**
|
|
890
902
|
* Fired when the client has received (and parsed) a push notification via one
|
|
891
903
|
* of the push channels (apn or fcm).
|
|
@@ -895,7 +907,7 @@ exports.Client.typingStarted = "typingStarted";
|
|
|
895
907
|
* question
|
|
896
908
|
* @event
|
|
897
909
|
*/
|
|
898
|
-
|
|
910
|
+
Client.pushNotification = "pushNotification";
|
|
899
911
|
/**
|
|
900
912
|
* Fired when the client has subscribed to a user.
|
|
901
913
|
*
|
|
@@ -903,7 +915,7 @@ exports.Client.pushNotification = "pushNotification";
|
|
|
903
915
|
* 1. {@link User} `user` - the user in question
|
|
904
916
|
* @event
|
|
905
917
|
*/
|
|
906
|
-
|
|
918
|
+
Client.userSubscribed = "userSubscribed";
|
|
907
919
|
/**
|
|
908
920
|
* Fired when the client has unsubscribed from a user.
|
|
909
921
|
*
|
|
@@ -911,7 +923,7 @@ exports.Client.userSubscribed = "userSubscribed";
|
|
|
911
923
|
* 1. {@link User} `user` - the user in question
|
|
912
924
|
* @event
|
|
913
925
|
*/
|
|
914
|
-
|
|
926
|
+
Client.userUnsubscribed = "userUnsubscribed";
|
|
915
927
|
/**
|
|
916
928
|
* Fired when the properties or the reachability status of a user have been
|
|
917
929
|
* updated.
|
|
@@ -924,7 +936,7 @@ exports.Client.userUnsubscribed = "userUnsubscribed";
|
|
|
924
936
|
* update
|
|
925
937
|
* @event
|
|
926
938
|
*/
|
|
927
|
-
|
|
939
|
+
Client.userUpdated = "userUpdated";
|
|
928
940
|
/**
|
|
929
941
|
* @deprecated Use initialized or initFailed events instead
|
|
930
942
|
* Fired when the state of the client has been changed.
|
|
@@ -933,12 +945,12 @@ exports.Client.userUpdated = "userUpdated";
|
|
|
933
945
|
* 1. {@link State} `state` - the new client state
|
|
934
946
|
* @event
|
|
935
947
|
*/
|
|
936
|
-
|
|
948
|
+
Client.stateChanged = "stateChanged";
|
|
937
949
|
/**
|
|
938
950
|
* Fired when the client has completed initialization successfully.
|
|
939
951
|
* @event
|
|
940
952
|
*/
|
|
941
|
-
|
|
953
|
+
Client.initialized = "initialized";
|
|
942
954
|
/**
|
|
943
955
|
* Fired when the client initialization failed.
|
|
944
956
|
*
|
|
@@ -948,7 +960,7 @@ exports.Client.initialized = "initialized";
|
|
|
948
960
|
* * Error? `error` - the initialization error if present
|
|
949
961
|
* @event
|
|
950
962
|
*/
|
|
951
|
-
|
|
963
|
+
Client.initFailed = "initFailed";
|
|
952
964
|
/**
|
|
953
965
|
* Fired when the connection state of the client has been changed.
|
|
954
966
|
*
|
|
@@ -956,7 +968,7 @@ exports.Client.initFailed = "initFailed";
|
|
|
956
968
|
* 1. {@link ConnectionState} `state` - the new connection state
|
|
957
969
|
* @event
|
|
958
970
|
*/
|
|
959
|
-
|
|
971
|
+
Client.connectionStateChanged = "connectionStateChanged";
|
|
960
972
|
/**
|
|
961
973
|
* Fired when the connection is interrupted for an unexpected reason.
|
|
962
974
|
*
|
|
@@ -969,26 +981,26 @@ exports.Client.connectionStateChanged = "connectionStateChanged";
|
|
|
969
981
|
* * number? `errorCode` - Twilio public error code if available
|
|
970
982
|
* @event
|
|
971
983
|
*/
|
|
972
|
-
|
|
984
|
+
Client.connectionError = "connectionError";
|
|
973
985
|
/**
|
|
974
986
|
* Current version of the Conversations client.
|
|
975
987
|
*/
|
|
976
|
-
|
|
988
|
+
Client.version = version;
|
|
977
989
|
/**
|
|
978
990
|
* Logger instance.
|
|
979
991
|
*/
|
|
980
|
-
|
|
992
|
+
Client._logger = Logger.scope("Client");
|
|
981
993
|
/**
|
|
982
994
|
* Supported push notification channels.
|
|
983
995
|
*/
|
|
984
|
-
|
|
996
|
+
Client._supportedPushChannels = [
|
|
985
997
|
"fcm",
|
|
986
998
|
"apn",
|
|
987
999
|
];
|
|
988
1000
|
/**
|
|
989
1001
|
* Supported push data fields.
|
|
990
1002
|
*/
|
|
991
|
-
|
|
1003
|
+
Client._supportedPushDataFields = {
|
|
992
1004
|
conversation_sid: "conversationSid",
|
|
993
1005
|
conversation_title: "conversationTitle",
|
|
994
1006
|
message_sid: "messageSid",
|
|
@@ -996,105 +1008,107 @@ exports.Client._supportedPushDataFields = {
|
|
|
996
1008
|
media_count: "mediaCount",
|
|
997
1009
|
media: "media", // object
|
|
998
1010
|
};
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
],
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
],
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
],
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
],
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
],
|
|
1028
|
-
|
|
1029
|
-
|
|
1011
|
+
__decorate([
|
|
1012
|
+
deprecated("token"),
|
|
1013
|
+
__metadata("design:type", String),
|
|
1014
|
+
__metadata("design:paramtypes", [])
|
|
1015
|
+
], Client.prototype, "token", null);
|
|
1016
|
+
__decorate([
|
|
1017
|
+
validateTypesAsync(nonEmptyString),
|
|
1018
|
+
__metadata("design:type", Function),
|
|
1019
|
+
__metadata("design:paramtypes", [String]),
|
|
1020
|
+
__metadata("design:returntype", Promise)
|
|
1021
|
+
], Client.prototype, "updateToken", null);
|
|
1022
|
+
__decorate([
|
|
1023
|
+
validateTypesAsync(nonEmptyString),
|
|
1024
|
+
__metadata("design:type", Function),
|
|
1025
|
+
__metadata("design:paramtypes", [String]),
|
|
1026
|
+
__metadata("design:returntype", Promise)
|
|
1027
|
+
], Client.prototype, "getConversationBySid", null);
|
|
1028
|
+
__decorate([
|
|
1029
|
+
validateTypesAsync(nonEmptyString),
|
|
1030
|
+
__metadata("design:type", Function),
|
|
1031
|
+
__metadata("design:paramtypes", [String]),
|
|
1032
|
+
__metadata("design:returntype", Promise)
|
|
1033
|
+
], Client.prototype, "peekConversationBySid", null);
|
|
1034
|
+
__decorate([
|
|
1035
|
+
validateTypesAsync(nonEmptyString),
|
|
1036
|
+
__metadata("design:type", Function),
|
|
1037
|
+
__metadata("design:paramtypes", [String]),
|
|
1038
|
+
__metadata("design:returntype", Promise)
|
|
1039
|
+
], Client.prototype, "getConversationByUniqueName", null);
|
|
1040
|
+
__decorate([
|
|
1041
|
+
validateTypesAsync([
|
|
1030
1042
|
"undefined",
|
|
1031
|
-
|
|
1043
|
+
objectSchema("conversation options", {
|
|
1032
1044
|
friendlyName: ["string", "undefined"],
|
|
1033
1045
|
isPrivate: ["boolean", "undefined"],
|
|
1034
1046
|
uniqueName: ["string", "undefined"],
|
|
1035
1047
|
}),
|
|
1036
1048
|
]),
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
],
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
],
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
],
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
],
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
],
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
],
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
],
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
],
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
],
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
],
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
],
|
|
1049
|
+
__metadata("design:type", Function),
|
|
1050
|
+
__metadata("design:paramtypes", [Object]),
|
|
1051
|
+
__metadata("design:returntype", Promise)
|
|
1052
|
+
], Client.prototype, "createConversation", null);
|
|
1053
|
+
__decorate([
|
|
1054
|
+
validateTypesAsync(literal("fcm", "apn"), "string"),
|
|
1055
|
+
__metadata("design:type", Function),
|
|
1056
|
+
__metadata("design:paramtypes", [String, String]),
|
|
1057
|
+
__metadata("design:returntype", Promise)
|
|
1058
|
+
], Client.prototype, "setPushRegistrationId", null);
|
|
1059
|
+
__decorate([
|
|
1060
|
+
validateTypesAsync(literal("fcm", "apn")),
|
|
1061
|
+
__metadata("design:type", Function),
|
|
1062
|
+
__metadata("design:paramtypes", [String]),
|
|
1063
|
+
__metadata("design:returntype", Promise)
|
|
1064
|
+
], Client.prototype, "unsetPushRegistrationId", null);
|
|
1065
|
+
__decorate([
|
|
1066
|
+
validateTypesAsync(literal("fcm", "apn"), nonEmptyString),
|
|
1067
|
+
__metadata("design:type", Function),
|
|
1068
|
+
__metadata("design:paramtypes", [String, String]),
|
|
1069
|
+
__metadata("design:returntype", Promise)
|
|
1070
|
+
], Client.prototype, "removePushRegistrations", null);
|
|
1071
|
+
__decorate([
|
|
1072
|
+
validateTypesAsync(pureObject),
|
|
1073
|
+
__metadata("design:type", Function),
|
|
1074
|
+
__metadata("design:paramtypes", [Object]),
|
|
1075
|
+
__metadata("design:returntype", Promise)
|
|
1076
|
+
], Client.prototype, "handlePushNotification", null);
|
|
1077
|
+
__decorate([
|
|
1078
|
+
validateTypesAsync(nonEmptyString),
|
|
1079
|
+
__metadata("design:type", Function),
|
|
1080
|
+
__metadata("design:paramtypes", [String]),
|
|
1081
|
+
__metadata("design:returntype", Promise)
|
|
1082
|
+
], Client.prototype, "getUser", null);
|
|
1083
|
+
__decorate([
|
|
1084
|
+
validateTypesAsync(nonEmptyArray("strings", "string")),
|
|
1085
|
+
__metadata("design:type", Function),
|
|
1086
|
+
__metadata("design:paramtypes", [Array]),
|
|
1087
|
+
__metadata("design:returntype", CancellablePromise)
|
|
1088
|
+
], Client.prototype, "getTemporaryContentUrlsForMediaSids", null);
|
|
1089
|
+
__decorate([
|
|
1090
|
+
validateTypesAsync(nonEmptyArray("media", Media)),
|
|
1091
|
+
__metadata("design:type", Function),
|
|
1092
|
+
__metadata("design:paramtypes", [Array]),
|
|
1093
|
+
__metadata("design:returntype", CancellablePromise)
|
|
1094
|
+
], Client.prototype, "getTemporaryContentUrlsForMedia", null);
|
|
1095
|
+
__decorate([
|
|
1096
|
+
deprecated("Client.create()", "new Client()"),
|
|
1097
|
+
validateTypesAsync("string", ["undefined", pureObject]),
|
|
1098
|
+
__metadata("design:type", Function),
|
|
1099
|
+
__metadata("design:paramtypes", [String, Object]),
|
|
1100
|
+
__metadata("design:returntype", Promise)
|
|
1101
|
+
], Client, "create", null);
|
|
1102
|
+
__decorate([
|
|
1103
|
+
validateTypes(pureObject),
|
|
1104
|
+
__metadata("design:type", Function),
|
|
1105
|
+
__metadata("design:paramtypes", [Object]),
|
|
1106
|
+
__metadata("design:returntype", PushNotification)
|
|
1107
|
+
], Client, "parsePushNotification", null);
|
|
1108
|
+
Client = Client_1 = __decorate([
|
|
1109
|
+
validateConstructorTypes(nonEmptyString, [pureObject, "undefined"]),
|
|
1110
|
+
__metadata("design:paramtypes", [String, Object])
|
|
1111
|
+
], Client);
|
|
1112
|
+
|
|
1113
|
+
export { Client };
|
|
1100
1114
|
//# sourceMappingURL=client.js.map
|