@twilio/conversations 2.3.1-rc.0 → 2.4.0-rc.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/builds/lib.d.ts CHANGED
@@ -110,6 +110,7 @@ declare class Configuration {
110
110
  readonly userIdentity: string;
111
111
  readonly userInfo: string;
112
112
  readonly myConversations: string;
113
+ readonly channelMetadataCacheCapacity: number;
113
114
  constructor(options: ClientOptions, configurationResponse: ConfigurationResponse, logger: Logger);
114
115
  }
115
116
  interface CommandExecutorServices {
@@ -1180,6 +1181,21 @@ declare class ContentTemplate {
1180
1181
  */
1181
1182
  constructor(contentTemplateResponse: ContentTemplateResponse);
1182
1183
  }
1184
+ type ChannelMetadataClientServices = {
1185
+ commandExecutor: CommandExecutor;
1186
+ };
1187
+ declare class ChannelMetadata {
1188
+ readonly type: string;
1189
+ readonly data: unknown;
1190
+ constructor(type: string, data: unknown);
1191
+ }
1192
+ declare class ChannelMetadataClient {
1193
+ private readonly _services;
1194
+ private readonly _configuration;
1195
+ private readonly _cache;
1196
+ constructor(services: ChannelMetadataClientServices, configuration: Configuration);
1197
+ getChannelMetadata(conversationSid: string, messageSid: string): Promise<ChannelMetadata | null>;
1198
+ }
1183
1199
  type MessageEvents = {
1184
1200
  updated: (data: {
1185
1201
  message: Message;
@@ -1190,6 +1206,7 @@ interface MessageServices {
1190
1206
  mcsClient: McsClient;
1191
1207
  network: Network;
1192
1208
  commandExecutor: CommandExecutor;
1209
+ channelMetadataClient: ChannelMetadataClient;
1193
1210
  }
1194
1211
  interface MessageLinks {
1195
1212
  self: string;
@@ -1223,6 +1240,7 @@ interface MessageData {
1223
1240
  media?: Media;
1224
1241
  memberSid?: string;
1225
1242
  delivery?: AggregatedDeliveryDescriptor;
1243
+ channelMetadata?: boolean;
1226
1244
  }
1227
1245
  /**
1228
1246
  * A message in a conversation.
@@ -1395,6 +1413,11 @@ declare class Message extends ReplayEventEmitter<MessageEvents> {
1395
1413
  * {@link Message.contentSid} is null.
1396
1414
  */
1397
1415
  getContentData(): CancellablePromise<ContentData | null>;
1416
+ /**
1417
+ * Get the {@link ChannelMetadata} for this message. Resolves to `null` if
1418
+ * the message doesn't have any channel metadata.
1419
+ */
1420
+ getChannelMetadata(): Promise<ChannelMetadata | null>;
1398
1421
  }
1399
1422
  /**
1400
1423
  * Pagination helper interface.
@@ -1557,6 +1580,7 @@ interface MessagesServices {
1557
1580
  network: Network;
1558
1581
  syncClient: SyncClient;
1559
1582
  commandExecutor: CommandExecutor;
1583
+ channelMetadataClient: ChannelMetadataClient;
1560
1584
  }
1561
1585
  /**
1562
1586
  * Represents the collection of messages in a conversation
@@ -1851,6 +1875,7 @@ interface ConversationServices {
1851
1875
  mcsClient: McsClient;
1852
1876
  syncClient: SyncClient;
1853
1877
  commandExecutor: CommandExecutor;
1878
+ channelMetadataClient: ChannelMetadataClient;
1854
1879
  }
1855
1880
  /**
1856
1881
  * Conversation descriptor.
@@ -2507,6 +2532,10 @@ interface ClientOptions {
2507
2532
  * The level of logging to enable.
2508
2533
  */
2509
2534
  logLevel?: LogLevel;
2535
+ /**
2536
+ * The cache capacity for channel metadata.
2537
+ */
2538
+ channelMetadataCacheCapacity?: number;
2510
2539
  region?: string;
2511
2540
  productId?: string;
2512
2541
  twilsockClient?: TwilsockClient;