@wildix/xbees-conversations-client 4.0.3 → 4.1.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.
Files changed (45) hide show
  1. package/dist-cjs/Conversations.js +4 -0
  2. package/dist-cjs/commands/GetMessengerChannelIdCommand.js +20 -0
  3. package/dist-cjs/commands/GetOrCreateMessengerChannelCommand.js +20 -0
  4. package/dist-cjs/commands/index.js +2 -0
  5. package/dist-cjs/models/enums.js +11 -1
  6. package/dist-cjs/runtimeConfig.native.js +3 -0
  7. package/dist-cjs/schemas/schemas_0.js +64 -28
  8. package/dist-es/Conversations.js +4 -0
  9. package/dist-es/commands/GetMessengerChannelIdCommand.js +16 -0
  10. package/dist-es/commands/GetOrCreateMessengerChannelCommand.js +16 -0
  11. package/dist-es/commands/index.js +2 -0
  12. package/dist-es/models/enums.js +10 -0
  13. package/dist-es/runtimeConfig.native.js +3 -0
  14. package/dist-es/schemas/schemas_0.js +59 -23
  15. package/dist-types/Conversations.d.ts +14 -0
  16. package/dist-types/ConversationsClient.d.ts +4 -2
  17. package/dist-types/commands/CreateGroupChannelCommand.d.ts +8 -0
  18. package/dist-types/commands/CreateKiteChannelCommand.d.ts +8 -0
  19. package/dist-types/commands/DescribeEventCommand.d.ts +30 -0
  20. package/dist-types/commands/GetChannelCommand.d.ts +4 -0
  21. package/dist-types/commands/GetMessageCommand.d.ts +2 -0
  22. package/dist-types/commands/GetMessengerChannelIdCommand.d.ts +83 -0
  23. package/dist-types/commands/GetOrCreateDirectChannelCommand.d.ts +4 -0
  24. package/dist-types/commands/GetOrCreateMessengerChannelCommand.d.ts +162 -0
  25. package/dist-types/commands/GetOrCreateSmsChannelCommand.d.ts +4 -0
  26. package/dist-types/commands/GetOrCreateTelephonyChannelCommand.d.ts +4 -0
  27. package/dist-types/commands/GetOrCreateWhatsAppChannelCommand.d.ts +4 -0
  28. package/dist-types/commands/JoinChannelCommand.d.ts +4 -0
  29. package/dist-types/commands/ListChannelsCommand.d.ts +4 -0
  30. package/dist-types/commands/ListMessagesCommand.d.ts +2 -0
  31. package/dist-types/commands/ListPinnedMessagesCommand.d.ts +2 -0
  32. package/dist-types/commands/PartialUpdateChannelCommand.d.ts +9 -1
  33. package/dist-types/commands/PartialUpdateMessageCommand.d.ts +4 -0
  34. package/dist-types/commands/QueryChannelsCommand.d.ts +4 -0
  35. package/dist-types/commands/SendGiphyCommand.d.ts +2 -0
  36. package/dist-types/commands/SendMessageCommand.d.ts +4 -0
  37. package/dist-types/commands/SendSystemMessageCommand.d.ts +2 -0
  38. package/dist-types/commands/UpdateChannelCommand.d.ts +8 -0
  39. package/dist-types/commands/UpdateMessageCommand.d.ts +4 -0
  40. package/dist-types/commands/index.d.ts +2 -0
  41. package/dist-types/models/enums.d.ts +26 -0
  42. package/dist-types/models/models_0.d.ts +173 -2
  43. package/dist-types/runtimeConfig.native.d.ts +2 -1
  44. package/dist-types/schemas/schemas_0.d.ts +6 -0
  45. package/package.json +7 -5
@@ -1,4 +1,4 @@
1
- import type { ActionTriggerStatus, AssignChannelVariant, ButtonVariant, ChannelAccess, ChannelContextEventAttendeeStatus, ChannelContextSource, ChannelMemberRole, ChannelType, ChannelWhatsAppStatus, ConversationFileCategory, GroupChannelCreationEventType, GroupChannelUnsetOptions, MessageSmsStatus, MessageType, MessageUnsetFields, MessageWhatsAppStatus, ReactionType, WebhookEventType } from "./enums";
1
+ import type { ActionTriggerStatus, AssignChannelVariant, ButtonVariant, ChannelAccess, ChannelContextEventAttendeeStatus, ChannelContextSource, ChannelMemberRole, ChannelMessengerStatus, ChannelType, ChannelWhatsAppStatus, ConversationFileCategory, GroupChannelCreationEventType, GroupChannelUnsetOptions, MessageMessengerStatus, MessageSmsStatus, MessageType, MessageUnsetFields, MessageWhatsAppStatus, ReactionType, WebhookEventType } from "./enums";
2
2
  /**
3
3
  * @public
4
4
  */
@@ -107,6 +107,14 @@ export interface Channel {
107
107
  mms?: boolean | undefined;
108
108
  whatsapp?: boolean | undefined;
109
109
  whatsappStatus?: ChannelWhatsAppStatus | undefined;
110
+ messenger?: boolean | undefined;
111
+ /**
112
+ * Set when classound refused a reply because the person's messaging window is closed (a 409 on the send). Unset by the next inbound message, which is the only thing that reopens the window.
113
+ * @public
114
+ */
115
+ messengerStatus?: ChannelMessengerStatus | undefined;
116
+ messengerPageId?: string | undefined;
117
+ messengerReplyUntil?: number | undefined;
110
118
  broadcast?: boolean | undefined;
111
119
  external?: boolean | undefined;
112
120
  autoRecord?: boolean | undefined;
@@ -339,6 +347,12 @@ export interface Message {
339
347
  forward?: MessageForward | undefined;
340
348
  whatsapp?: boolean | undefined;
341
349
  whatsappStatus?: MessageWhatsAppStatus | undefined;
350
+ messenger?: boolean | undefined;
351
+ /**
352
+ * The delivery state of a Facebook Messenger message an agent sent, the same four states as WhatsApp. TRYING, SENT and ERROR are written by kite around the send; DELIVERED and a late ERROR arrive through the MESSENGER.STATUS stream event. A READ report is recorded as DELIVERED, as the WhatsApp producer does one hop earlier.
353
+ * @public
354
+ */
355
+ messengerStatus?: MessageMessengerStatus | undefined;
342
356
  sms?: boolean | undefined;
343
357
  smsStatus?: MessageSmsStatus | undefined;
344
358
  markdown?: boolean | undefined;
@@ -372,7 +386,7 @@ export interface UserToInvite {
372
386
  */
373
387
  email?: string | undefined;
374
388
  /**
375
- * The phone number of the invited user. This phone number is used to create or find the user if an email address is not provided.
389
+ * The phone number of the invited user. This phone number is used to create or find the user if an email address is not provided. On Facebook Messenger it is not a phone number at all: the caller passes the Page Scoped ID, so the identity key stays the one the supplier reports. UserPhone allows up to 17 digits and a Page Scoped ID is 17, so there is no headroom left.
376
390
  * @public
377
391
  */
378
392
  phone?: string | undefined;
@@ -748,6 +762,26 @@ export interface CreateGroupChannelInput {
748
762
  * @public
749
763
  */
750
764
  whatsapp?: boolean | undefined;
765
+ /**
766
+ * Indicates if the channel supports Facebook Messenger. Default is false.
767
+ * @public
768
+ */
769
+ messenger?: boolean | undefined;
770
+ /**
771
+ * The Messenger reply state of the channel: WINDOW_CLOSED after classound refused a reply, absent while a reply can be sent.
772
+ * @public
773
+ */
774
+ messengerStatus?: ChannelMessengerStatus | undefined;
775
+ /**
776
+ * The Facebook Page ID the conversation runs through. Written by kite from the inbound event, because the channel id hashes the page's linked service and not the page, and a reply has to name the page it is sent from.
777
+ * @public
778
+ */
779
+ messengerPageId?: string | undefined;
780
+ /**
781
+ * Epoch seconds until which a reply still reaches the person: Meta's 7 day HUMAN_AGENT deadline, restarted by each inbound message. classound applies the tag itself, so this is the one deadline a client has to show. 0 means the deadline is not known, which is what the inbound event carries when the session row was gone before it could be read back; it does not mean the window has closed, so a client reads the window as closed on `messengerReplyUntil > 0 && now > messengerReplyUntil` and shows nothing at 0.
782
+ * @public
783
+ */
784
+ messengerReplyUntil?: number | undefined;
751
785
  /**
752
786
  * The unique identifier of the assignee.
753
787
  * @public
@@ -838,6 +872,12 @@ export interface InitialMessage {
838
872
  forward?: MessageForward | undefined;
839
873
  whatsapp?: boolean | undefined;
840
874
  whatsappStatus?: MessageWhatsAppStatus | undefined;
875
+ messenger?: boolean | undefined;
876
+ /**
877
+ * The delivery state of a Facebook Messenger message an agent sent, the same four states as WhatsApp. TRYING, SENT and ERROR are written by kite around the send; DELIVERED and a late ERROR arrive through the MESSENGER.STATUS stream event. A READ report is recorded as DELIVERED, as the WhatsApp producer does one hop earlier.
878
+ * @public
879
+ */
880
+ messengerStatus?: MessageMessengerStatus | undefined;
841
881
  sms?: boolean | undefined;
842
882
  smsStatus?: MessageSmsStatus | undefined;
843
883
  markdown?: boolean | undefined;
@@ -863,6 +903,12 @@ export interface WelcomeMessage {
863
903
  forward?: MessageForward | undefined;
864
904
  whatsapp?: boolean | undefined;
865
905
  whatsappStatus?: MessageWhatsAppStatus | undefined;
906
+ messenger?: boolean | undefined;
907
+ /**
908
+ * The delivery state of a Facebook Messenger message an agent sent, the same four states as WhatsApp. TRYING, SENT and ERROR are written by kite around the send; DELIVERED and a late ERROR arrive through the MESSENGER.STATUS stream event. A READ report is recorded as DELIVERED, as the WhatsApp producer does one hop earlier.
909
+ * @public
910
+ */
911
+ messengerStatus?: MessageMessengerStatus | undefined;
866
912
  sms?: boolean | undefined;
867
913
  smsStatus?: MessageSmsStatus | undefined;
868
914
  markdown?: boolean | undefined;
@@ -1435,6 +1481,37 @@ export interface GetMessageInput {
1435
1481
  export interface GetMessageOutput {
1436
1482
  message: Message;
1437
1483
  }
1484
+ /**
1485
+ * @public
1486
+ */
1487
+ export interface GetMessengerChannelIdInput {
1488
+ /**
1489
+ * The unique identifier of the user when a service token is used. Required if used PBX or S2S token.
1490
+ * @public
1491
+ */
1492
+ userId?: string | undefined;
1493
+ /**
1494
+ * The unique identifier of the telephony channel.
1495
+ * @public
1496
+ */
1497
+ serviceUri: string;
1498
+ /**
1499
+ * The unique identifier of the recipient. Required if recipientNumber is not provided.
1500
+ * @public
1501
+ */
1502
+ recipientId?: string | undefined;
1503
+ /**
1504
+ * The unique identifier of the recipient. Required if recipientId is not provided.
1505
+ * @public
1506
+ */
1507
+ recipientNumber?: string | undefined;
1508
+ }
1509
+ /**
1510
+ * @public
1511
+ */
1512
+ export interface GetMessengerChannelIdOutput {
1513
+ channelId: string;
1514
+ }
1438
1515
  /**
1439
1516
  * @public
1440
1517
  */
@@ -1461,6 +1538,42 @@ export interface GetOrCreateDirectChannelInput {
1461
1538
  export interface GetOrCreateDirectChannelOutput {
1462
1539
  channel: Channel;
1463
1540
  }
1541
+ /**
1542
+ * @public
1543
+ */
1544
+ export interface GetOrCreateMessengerChannelInput {
1545
+ /**
1546
+ * The unique identifier of the user when a service token is used. Required if used PBX or S2S token.
1547
+ * @public
1548
+ */
1549
+ userId?: string | undefined;
1550
+ /**
1551
+ * The unique identifier of the telephony channel.
1552
+ * @public
1553
+ */
1554
+ serviceUri: string;
1555
+ /**
1556
+ * The unique identifier of the recipient. Required if recipientNumber is not provided.
1557
+ * @public
1558
+ */
1559
+ recipientId?: string | undefined;
1560
+ /**
1561
+ * The unique identifier of the recipient. Required if recipientId is not provided.
1562
+ * @public
1563
+ */
1564
+ recipientNumber?: string | undefined;
1565
+ /**
1566
+ * Indicates if the channel is outgoing. It's prevents applying routing settings for the channel. This parameter will be reset to false after 48 hours. Default is false.
1567
+ * @public
1568
+ */
1569
+ outgoing?: boolean | undefined;
1570
+ }
1571
+ /**
1572
+ * @public
1573
+ */
1574
+ export interface GetOrCreateMessengerChannelOutput {
1575
+ channel: Channel;
1576
+ }
1464
1577
  /**
1465
1578
  * @public
1466
1579
  */
@@ -2140,6 +2253,26 @@ export interface PartialUpdateChannelSetOptions {
2140
2253
  * @public
2141
2254
  */
2142
2255
  whatsapp?: boolean | undefined;
2256
+ /**
2257
+ * Indicates if the channel supports Facebook Messenger. Default is false.
2258
+ * @public
2259
+ */
2260
+ messenger?: boolean | undefined;
2261
+ /**
2262
+ * The Messenger reply state of the channel: WINDOW_CLOSED after classound refused a reply, absent while a reply can be sent.
2263
+ * @public
2264
+ */
2265
+ messengerStatus?: ChannelMessengerStatus | undefined;
2266
+ /**
2267
+ * The Facebook Page ID the conversation runs through. Written by kite from the inbound event, because the channel id hashes the page's linked service and not the page, and a reply has to name the page it is sent from.
2268
+ * @public
2269
+ */
2270
+ messengerPageId?: string | undefined;
2271
+ /**
2272
+ * Epoch seconds until which a reply still reaches the person: Meta's 7 day HUMAN_AGENT deadline, restarted by each inbound message. classound applies the tag itself, so this is the one deadline a client has to show. 0 means the deadline is not known, which is what the inbound event carries when the session row was gone before it could be read back; it does not mean the window has closed, so a client reads the window as closed on `messengerReplyUntil > 0 && now > messengerReplyUntil` and shows nothing at 0.
2273
+ * @public
2274
+ */
2275
+ messengerReplyUntil?: number | undefined;
2143
2276
  /**
2144
2277
  * The unique identifier of the assignee.
2145
2278
  * @public
@@ -2202,6 +2335,12 @@ export interface PartialUpdateMessageSetInput {
2202
2335
  forward?: MessageForward | undefined;
2203
2336
  whatsapp?: boolean | undefined;
2204
2337
  whatsappStatus?: MessageWhatsAppStatus | undefined;
2338
+ messenger?: boolean | undefined;
2339
+ /**
2340
+ * The delivery state of a Facebook Messenger message an agent sent, the same four states as WhatsApp. TRYING, SENT and ERROR are written by kite around the send; DELIVERED and a late ERROR arrive through the MESSENGER.STATUS stream event. A READ report is recorded as DELIVERED, as the WhatsApp producer does one hop earlier.
2341
+ * @public
2342
+ */
2343
+ messengerStatus?: MessageMessengerStatus | undefined;
2205
2344
  sms?: boolean | undefined;
2206
2345
  smsStatus?: MessageSmsStatus | undefined;
2207
2346
  markdown?: boolean | undefined;
@@ -2423,6 +2562,12 @@ export interface SendMessageInput {
2423
2562
  forward?: MessageForward | undefined;
2424
2563
  whatsapp?: boolean | undefined;
2425
2564
  whatsappStatus?: MessageWhatsAppStatus | undefined;
2565
+ messenger?: boolean | undefined;
2566
+ /**
2567
+ * The delivery state of a Facebook Messenger message an agent sent, the same four states as WhatsApp. TRYING, SENT and ERROR are written by kite around the send; DELIVERED and a late ERROR arrive through the MESSENGER.STATUS stream event. A READ report is recorded as DELIVERED, as the WhatsApp producer does one hop earlier.
2568
+ * @public
2569
+ */
2570
+ messengerStatus?: MessageMessengerStatus | undefined;
2426
2571
  sms?: boolean | undefined;
2427
2572
  smsStatus?: MessageSmsStatus | undefined;
2428
2573
  markdown?: boolean | undefined;
@@ -2811,6 +2956,26 @@ export interface UpdateChannelInput {
2811
2956
  * @public
2812
2957
  */
2813
2958
  whatsapp?: boolean | undefined;
2959
+ /**
2960
+ * Indicates if the channel supports Facebook Messenger. Default is false.
2961
+ * @public
2962
+ */
2963
+ messenger?: boolean | undefined;
2964
+ /**
2965
+ * The Messenger reply state of the channel: WINDOW_CLOSED after classound refused a reply, absent while a reply can be sent.
2966
+ * @public
2967
+ */
2968
+ messengerStatus?: ChannelMessengerStatus | undefined;
2969
+ /**
2970
+ * The Facebook Page ID the conversation runs through. Written by kite from the inbound event, because the channel id hashes the page's linked service and not the page, and a reply has to name the page it is sent from.
2971
+ * @public
2972
+ */
2973
+ messengerPageId?: string | undefined;
2974
+ /**
2975
+ * Epoch seconds until which a reply still reaches the person: Meta's 7 day HUMAN_AGENT deadline, restarted by each inbound message. classound applies the tag itself, so this is the one deadline a client has to show. 0 means the deadline is not known, which is what the inbound event carries when the session row was gone before it could be read back; it does not mean the window has closed, so a client reads the window as closed on `messengerReplyUntil > 0 && now > messengerReplyUntil` and shows nothing at 0.
2976
+ * @public
2977
+ */
2978
+ messengerReplyUntil?: number | undefined;
2814
2979
  /**
2815
2980
  * The unique identifier of the assignee.
2816
2981
  * @public
@@ -2884,6 +3049,12 @@ export interface UpdateMessageInput {
2884
3049
  forward?: MessageForward | undefined;
2885
3050
  whatsapp?: boolean | undefined;
2886
3051
  whatsappStatus?: MessageWhatsAppStatus | undefined;
3052
+ messenger?: boolean | undefined;
3053
+ /**
3054
+ * The delivery state of a Facebook Messenger message an agent sent, the same four states as WhatsApp. TRYING, SENT and ERROR are written by kite around the send; DELIVERED and a late ERROR arrive through the MESSENGER.STATUS stream event. A READ report is recorded as DELIVERED, as the WhatsApp producer does one hop earlier.
3055
+ * @public
3056
+ */
3057
+ messengerStatus?: MessageMessengerStatus | undefined;
2887
3058
  sms?: boolean | undefined;
2888
3059
  smsStatus?: MessageSmsStatus | undefined;
2889
3060
  markdown?: boolean | undefined;
@@ -1,11 +1,12 @@
1
+ import { XhrHttpHandler as RequestHandler } from "@wildix/smithy-react-native";
1
2
  import type { ConversationsClientConfig } from "./ConversationsClient";
2
3
  /**
3
4
  * @internal
4
5
  */
5
6
  export declare const getRuntimeConfig: (config: ConversationsClientConfig) => {
6
7
  runtime: string;
8
+ requestHandler: RequestHandler;
7
9
  sha256: import("@smithy/types").HashConstructor;
8
- requestHandler: import("@smithy/types").NodeHttpHandlerOptions | import("@smithy/types").FetchHttpHandlerOptions | Record<string, unknown> | import("@smithy/core/protocols").HttpHandler<any> | import("@smithy/fetch-http-handler").FetchHttpHandler;
9
10
  cacheMiddleware?: boolean;
10
11
  protocol: import("@smithy/types").ClientProtocol<any, any> | import("@smithy/types").ClientProtocolCtor<any, any> | typeof import("@aws-sdk/core/protocols").AwsRestJsonProtocol;
11
12
  protocolSettings: {
@@ -80,8 +80,12 @@ export declare var GetInboxStateInput$: StaticStructureSchema;
80
80
  export declare var GetInboxStateOutput$: StaticStructureSchema;
81
81
  export declare var GetMessageInput$: StaticStructureSchema;
82
82
  export declare var GetMessageOutput$: StaticStructureSchema;
83
+ export declare var GetMessengerChannelIdInput$: StaticStructureSchema;
84
+ export declare var GetMessengerChannelIdOutput$: StaticStructureSchema;
83
85
  export declare var GetOrCreateDirectChannelInput$: StaticStructureSchema;
84
86
  export declare var GetOrCreateDirectChannelOutput$: StaticStructureSchema;
87
+ export declare var GetOrCreateMessengerChannelInput$: StaticStructureSchema;
88
+ export declare var GetOrCreateMessengerChannelOutput$: StaticStructureSchema;
85
89
  export declare var GetOrCreateSmsChannelInput$: StaticStructureSchema;
86
90
  export declare var GetOrCreateSmsChannelOutput$: StaticStructureSchema;
87
91
  export declare var GetOrCreateTelephonyChannelInput$: StaticStructureSchema;
@@ -238,7 +242,9 @@ export declare var GetDirectChannelId$: StaticOperationSchema;
238
242
  export declare var GetFilePresignedDownloadUrl$: StaticOperationSchema;
239
243
  export declare var GetInboxState$: StaticOperationSchema;
240
244
  export declare var GetMessage$: StaticOperationSchema;
245
+ export declare var GetMessengerChannelId$: StaticOperationSchema;
241
246
  export declare var GetOrCreateDirectChannel$: StaticOperationSchema;
247
+ export declare var GetOrCreateMessengerChannel$: StaticOperationSchema;
242
248
  export declare var GetOrCreateSmsChannel$: StaticOperationSchema;
243
249
  export declare var GetOrCreateTelephonyChannel$: StaticOperationSchema;
244
250
  export declare var GetOrCreateWhatsAppChannel$: StaticOperationSchema;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@wildix/xbees-conversations-client",
3
3
  "description": "@wildix/xbees-conversations-client client",
4
- "version": "4.0.3",
4
+ "version": "4.1.0",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
7
7
  "build:cjs": "tsc -p tsconfig.cjs.json",
@@ -24,7 +24,8 @@
24
24
  "@smithy/core": "^3.24.5",
25
25
  "@smithy/fetch-http-handler": "^5.4.5",
26
26
  "@smithy/node-http-handler": "^4.7.5",
27
- "@smithy/types": "^4.14.2"
27
+ "@smithy/types": "^4.14.2",
28
+ "@wildix/smithy-react-native": "^1.0.0"
28
29
  },
29
30
  "devDependencies": {
30
31
  "@tsconfig/node20": "20.1.8",
@@ -48,10 +49,11 @@
48
49
  "dist-*/**"
49
50
  ],
50
51
  "license": "Apache-2.0",
51
- "browser": {
52
- "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser"
53
- },
54
52
  "react-native": {
53
+ "@aws-sdk/core/client": "@aws-sdk/core/dist-es/submodules/client/index.native.js",
55
54
  "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native"
55
+ },
56
+ "browser": {
57
+ "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser"
56
58
  }
57
59
  }