sanka-baileyss 2.3.2 → 2.3.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.
Files changed (159) hide show
  1. package/WAProto/BotMetadata/BotMetadata.d.ts +594 -1
  2. package/WAProto/BotMetadata/BotMetadata.js +1910 -148
  3. package/WAProto/BotMetadata/BotMetadata.proto +36 -0
  4. package/WAProto/E2E/E2E.d.ts +570 -6
  5. package/WAProto/E2E/E2E.js +1591 -26
  6. package/WAProto/E2E/E2E.proto +10 -1
  7. package/WAProto/HistorySync/HistorySync.d.ts +806 -6
  8. package/WAProto/HistorySync/HistorySync.js +2193 -29
  9. package/WAProto/HistorySync/HistorySync.proto +2 -1
  10. package/WAProto/MdStorageMsgRowOpaqueData/MdStorageMsgRowOpaqueData.d.ts +570 -6
  11. package/WAProto/MdStorageMsgRowOpaqueData/MdStorageMsgRowOpaqueData.js +1591 -26
  12. package/WAProto/StatusAttributions/StatusAttributions.d.ts +2 -1
  13. package/WAProto/StatusAttributions/StatusAttributions.js +7 -0
  14. package/WAProto/StatusAttributions/StatusAttributions.proto +1 -0
  15. package/WAProto/SyncAction/SyncAction.d.ts +230 -0
  16. package/WAProto/SyncAction/SyncAction.js +578 -2
  17. package/WAProto/SyncAction/SyncAction.proto +13 -1
  18. package/WAProto/Web/Web.d.ts +570 -6
  19. package/WAProto/Web/Web.js +1591 -26
  20. package/lib/Defaults/baileys-version.json +2 -2
  21. package/lib/Defaults/index.d.ts +42 -25
  22. package/lib/Defaults/index.js +6 -2
  23. package/lib/Signal/Group/sender-key-record.js +23 -28
  24. package/lib/Signal/libsignal.d.ts +1 -0
  25. package/lib/Socket/Client/index.js +13 -9
  26. package/lib/Socket/Client/types.d.ts +11 -10
  27. package/lib/Socket/Client/types.js +11 -7
  28. package/lib/Socket/Client/websocket.d.ts +9 -8
  29. package/lib/Socket/Client/websocket.js +52 -47
  30. package/lib/Socket/business.d.ts +185 -182
  31. package/lib/Socket/business.js +258 -249
  32. package/lib/Socket/chats.d.ts +90 -87
  33. package/lib/Socket/chats.js +1095 -888
  34. package/lib/Socket/community.d.ts +131 -0
  35. package/lib/Socket/community.js +369 -0
  36. package/lib/Socket/groups.d.ts +50 -41
  37. package/lib/Socket/groups.js +10 -3
  38. package/lib/Socket/index.d.ts +5 -1
  39. package/lib/Socket/index.js +19 -5
  40. package/lib/Socket/messages-recv.d.ts +6 -2
  41. package/lib/Socket/messages-recv.js +31 -8
  42. package/lib/Socket/messages-send.d.ts +5 -1
  43. package/lib/Socket/messages-send.js +1293 -1351
  44. package/lib/Socket/newsletter.d.ts +142 -135
  45. package/lib/Socket/newsletter.js +274 -230
  46. package/lib/Socket/socket.d.ts +37 -35
  47. package/lib/Socket/usync.d.ts +31 -30
  48. package/lib/Socket/usync.js +74 -62
  49. package/lib/Types/Auth.d.ts +89 -72
  50. package/lib/Types/Auth.js +1 -0
  51. package/lib/Types/Call.d.ts +11 -10
  52. package/lib/Types/Call.js +1 -0
  53. package/lib/Types/Chat.d.ts +85 -62
  54. package/lib/Types/Chat.js +4 -1
  55. package/lib/Types/Contact.js +1 -0
  56. package/lib/Types/Events.d.ts +209 -191
  57. package/lib/Types/Events.js +1 -0
  58. package/lib/Types/GroupMetadata.d.ts +12 -27
  59. package/lib/Types/GroupMetadata.js +1 -0
  60. package/lib/Types/Label.d.ts +41 -39
  61. package/lib/Types/Label.js +24 -21
  62. package/lib/Types/LabelAssociation.d.ts +18 -12
  63. package/lib/Types/LabelAssociation.js +6 -3
  64. package/lib/Types/Message.d.ts +3 -2
  65. package/lib/Types/Message.js +7 -3
  66. package/lib/Types/MexUpdates.d.ts +9 -0
  67. package/lib/Types/MexUpdates.js +18 -0
  68. package/lib/Types/Newsletter.d.ts +84 -67
  69. package/lib/Types/Newsletter.js +30 -23
  70. package/lib/Types/Product.d.ts +70 -56
  71. package/lib/Types/Product.js +1 -0
  72. package/lib/Types/Signal.d.ts +46 -35
  73. package/lib/Types/Signal.js +1 -0
  74. package/lib/Types/Socket.d.ts +105 -101
  75. package/lib/Types/Socket.js +1 -0
  76. package/lib/Types/State.d.ts +37 -23
  77. package/lib/Types/State.js +13 -1
  78. package/lib/Types/USync.d.ts +21 -20
  79. package/lib/Types/USync.js +1 -0
  80. package/lib/Types/index.d.ts +51 -42
  81. package/lib/Types/index.js +25 -19
  82. package/lib/Utils/auth-utils.d.ts +14 -11
  83. package/lib/Utils/auth-utils.js +189 -182
  84. package/lib/Utils/baileys-event-stream.d.ts +12 -10
  85. package/lib/Utils/baileys-event-stream.js +52 -46
  86. package/lib/Utils/business.d.ts +15 -8
  87. package/lib/Utils/business.js +229 -217
  88. package/lib/Utils/chat-utils.d.ts +22 -12
  89. package/lib/Utils/chat-utils.js +57 -27
  90. package/lib/Utils/crypto.d.ts +31 -15
  91. package/lib/Utils/crypto.js +136 -107
  92. package/lib/Utils/decode-wa-message.d.ts +34 -245
  93. package/lib/Utils/decode-wa-message.js +205 -217
  94. package/lib/Utils/event-buffer.d.ts +30 -26
  95. package/lib/Utils/event-buffer.js +519 -515
  96. package/lib/Utils/history.d.ts +2 -8
  97. package/lib/Utils/index.js +13 -9
  98. package/lib/Utils/link-preview.d.ts +16 -14
  99. package/lib/Utils/link-preview.js +100 -92
  100. package/lib/Utils/logger.d.ts +9 -7
  101. package/lib/Utils/logger.js +1 -1
  102. package/lib/Utils/lt-hash.d.ts +10 -8
  103. package/lib/Utils/lt-hash.js +49 -44
  104. package/lib/Utils/make-mutex.d.ts +4 -2
  105. package/lib/Utils/make-mutex.js +43 -39
  106. package/lib/Utils/messages-media.d.ts +75 -50
  107. package/lib/Utils/messages.d.ts +60 -35
  108. package/lib/Utils/messages.js +87 -8
  109. package/lib/Utils/noise-handler.d.ts +13 -12
  110. package/lib/Utils/noise-handler.js +143 -138
  111. package/lib/Utils/process-message.d.ts +32 -24
  112. package/lib/Utils/process-message.js +387 -367
  113. package/lib/Utils/signal.d.ts +24 -15
  114. package/lib/Utils/signal.js +143 -131
  115. package/lib/Utils/use-mongo-file-auth-state.d.ts +3 -2
  116. package/lib/Utils/use-mongo-file-auth-state.js +72 -63
  117. package/lib/Utils/use-multi-file-auth-state.d.ts +9 -8
  118. package/lib/Utils/use-multi-file-auth-state.js +110 -102
  119. package/lib/Utils/use-single-file-auth-state.d.ts +8 -7
  120. package/lib/Utils/use-single-file-auth-state.js +66 -61
  121. package/lib/Utils/validate-connection.d.ts +5 -2
  122. package/lib/Utils/validate-connection.js +7 -6
  123. package/lib/WABinary/constants.d.ts +24 -21
  124. package/lib/WABinary/constants.js +1302 -31
  125. package/lib/WABinary/decode.d.ts +4 -1
  126. package/lib/WABinary/decode.js +267 -234
  127. package/lib/WABinary/encode.d.ts +1 -0
  128. package/lib/WABinary/encode.js +248 -226
  129. package/lib/WABinary/generic-utils.d.ts +13 -1
  130. package/lib/WABinary/generic-utils.js +113 -96
  131. package/lib/WABinary/index.js +13 -9
  132. package/lib/WABinary/jid-utils.d.ts +23 -4
  133. package/lib/WABinary/jid-utils.js +58 -39
  134. package/lib/WABinary/types.d.ts +15 -11
  135. package/lib/WABinary/types.js +1 -0
  136. package/lib/WAM/BinaryInfo.d.ts +14 -14
  137. package/lib/WAM/BinaryInfo.js +11 -8
  138. package/lib/WAM/constants.d.ts +34 -26
  139. package/lib/WAM/constants.js +15358 -15349
  140. package/lib/WAM/encode.d.ts +1 -0
  141. package/lib/WAM/encode.js +153 -144
  142. package/lib/WAM/index.js +13 -9
  143. package/lib/index.js +11 -11
  144. package/package.json +1 -66
  145. package/WASignalGroup/GroupProtocol.js +0 -1771
  146. package/WASignalGroup/ciphertext_message.js +0 -10
  147. package/WASignalGroup/group_cipher.js +0 -103
  148. package/WASignalGroup/group_session_builder.js +0 -39
  149. package/WASignalGroup/index.js +0 -5
  150. package/WASignalGroup/keyhelper.js +0 -17
  151. package/WASignalGroup/protobufs.js +0 -2
  152. package/WASignalGroup/queue_job.js +0 -64
  153. package/WASignalGroup/sender_chain_key.js +0 -38
  154. package/WASignalGroup/sender_key_distribution_message.js +0 -68
  155. package/WASignalGroup/sender_key_message.js +0 -79
  156. package/WASignalGroup/sender_key_name.js +0 -59
  157. package/WASignalGroup/sender_key_record.js +0 -47
  158. package/WASignalGroup/sender_key_state.js +0 -110
  159. package/WASignalGroup/sender_message_key.js +0 -30
@@ -1,29 +1,35 @@
1
1
  /** Association type */
2
2
  export declare const enum LabelAssociationType {
3
- Chat = "label_jid",
4
- Message = "label_message"
3
+ Chat = "label_jid",
4
+ Message = "label_message"
5
5
  }
6
+
6
7
  export type LabelAssociationTypes = LabelAssociationType
8
+
7
9
  /** Association for chat */
8
10
  export interface ChatLabelAssociation {
9
- type: LabelAssociationType.Chat
10
- chatId: string
11
- labelId: string
11
+ type: LabelAssociationType.Chat
12
+ chatId: string
13
+ labelId: string
12
14
  }
15
+
13
16
  /** Association for message */
14
17
  export interface MessageLabelAssociation {
15
- type: LabelAssociationType.Message
16
- chatId: string
17
- messageId: string
18
- labelId: string
18
+ type: LabelAssociationType.Message
19
+ chatId: string
20
+ messageId: string
21
+ labelId: string
19
22
  }
23
+
20
24
  export type LabelAssociation = ChatLabelAssociation | MessageLabelAssociation
25
+
21
26
  /** Body for add/remove chat label association action */
22
27
  export interface ChatLabelAssociationActionBody {
23
- labelId: string
28
+ labelId: string
24
29
  }
30
+
25
31
  /** body for add/remove message label association action */
26
32
  export interface MessageLabelAssociationActionBody {
27
- labelId: string
28
- messageId: string
33
+ labelId: string
34
+ messageId: string
29
35
  }
@@ -1,10 +1,13 @@
1
1
  "use strict"
2
+
2
3
  Object.defineProperty(exports, "__esModule", { value: true })
4
+
3
5
  /** Association type */
4
6
  const LabelAssociationType = {
5
- Chat: "label_jid",
6
- Message: "label_message"
7
+ Chat: "label_jid",
8
+ Message: "label_message"
7
9
  }
10
+
8
11
  module.exports = {
9
- LabelAssociationType
12
+ LabelAssociationType
10
13
  }
@@ -26,12 +26,12 @@ export type WATextMessage = proto.Message.IExtendedTextMessage
26
26
 
27
27
  export type WAContextInfo = proto.IContextInfo
28
28
 
29
- export type WAEventMessage = proto.Message.IEventMessage
30
-
31
29
  export type WALocationMessage = proto.Message.ILocationMessage
32
30
 
33
31
  export type WAOrderMessage = proto.Message.IOrderMessage
34
32
 
33
+ export type WAEventMessage = proto.Message.IEventMessage
34
+
35
35
  export type WAGenericMediaMessage = proto.Message.IVideoMessage | proto.Message.IImageMessage | proto.Message.IAudioMessage | proto.Message.IDocumentMessage | proto.Message.IStickerMessage
36
36
 
37
37
  export declare const WAMessageStubType = proto.WebMessageInfo.StubType
@@ -435,6 +435,7 @@ export type MediaGenerationOptions = {
435
435
  export type MessageContentGenerationOptions = MediaGenerationOptions & {
436
436
  getUrlInfo?: (text: string) => Promise<WAUrlInfo | undefined>
437
437
  getProfilePicUrl?: (jid: string) => Promise<string | undefined>
438
+ getCallLink?: (type: 'audio' | 'video', event?: number) => Promise<string | undefined>
438
439
  }
439
440
 
440
441
  export type MessageGenerationOptions = MessageContentGenerationOptions & MessageGenerationOptionsFromContent
@@ -1,9 +1,13 @@
1
1
  "use strict"
2
+
2
3
  Object.defineProperty(exports, "__esModule", { value: true })
4
+
3
5
  const WAProto_1 = require("../../WAProto")
6
+
4
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
+
5
9
  module.exports = {
6
- WAMessageStubType: WAProto_1.proto.WebMessageInfo.StubType,
7
- WAMessageStatus: WAProto_1.proto.WebMessageInfo.Status,
8
- WAProto: WAProto_1.proto
10
+ WAMessageStubType: WAProto_1.proto.WebMessageInfo.StubType,
11
+ WAMessageStatus: WAProto_1.proto.WebMessageInfo.Status,
12
+ WAProto: WAProto_1.proto
9
13
  }
@@ -0,0 +1,9 @@
1
+ export declare const enum MexUpdatesOperations {
2
+ OWNER_COMMUNITY = "NotificationCommunityOwnerUpdate",
3
+ GROUP_LIMIT_SHARING = "NotificationGroupLimitSharingPropertyUpdate"
4
+ }
5
+
6
+ export declare const enum XWAPathsUpdates {
7
+ GROUP_SHARING_CHANGE = "xwa2_notify_group_on_prop_change",
8
+ COMMUNITY_OWNER_CHANGE = "xwa2_notify_group_on_participants_roles_change"
9
+ }
@@ -0,0 +1,18 @@
1
+ "use strict"
2
+
3
+ Object.defineProperty(exports, "__esModule", { value: true })
4
+
5
+ const MexUpdatesOperations = {
6
+ OWNER_COMMUNITY: "NotificationCommunityOwnerUpdate",
7
+ GROUP_LIMIT_SHARING: "NotificationGroupLimitSharingPropertyUpdate"
8
+ }
9
+
10
+ const XWAPathsMexUpdates = {
11
+ GROUP_SHARING_CHANGE: "xwa2_notify_group_on_prop_change",
12
+ COMMUNITY_OWNER_CHANGE: "xwa2_notify_group_on_participants_roles_change"
13
+ }
14
+
15
+ module.exports = {
16
+ MexUpdatesOperations,
17
+ XWAPathsMexUpdates
18
+ }
@@ -1,92 +1,109 @@
1
1
  import { proto } from '../../WAProto'
2
+
2
3
  export type NewsletterReactionMode = 'ALL' | 'BASIC' | 'NONE'
4
+
3
5
  export type NewsletterState = 'ACTIVE' | 'GEOSUSPENDED' | 'SUSPENDED'
6
+
4
7
  export type NewsletterVerification = 'VERIFIED' | 'UNVERIFIED'
8
+
5
9
  export type NewsletterMute = 'ON' | 'OFF' | 'UNDEFINED'
10
+
6
11
  export type NewsletterViewRole = 'ADMIN' | 'GUEST' | 'OWNER' | 'SUBSCRIBER'
12
+
7
13
  export type NewsletterViewerMetadata = {
8
- mute: NewsletterMute
9
- view_role: NewsletterViewRole
14
+ mute: NewsletterMute
15
+ view_role: NewsletterViewRole
10
16
  }
17
+
11
18
  export type NewsletterMetadata = {
12
- /**jid of newsletter */
13
- id: string
14
- /**state of newsletter */
15
- state: NewsletterState
16
- /**creation timestamp of newsletter */
17
- creation_time: number
18
- /**name of newsletter */
19
- name: string
20
- /**timestamp of last name modification of newsletter */
21
- nameTime: number
22
- /**description of newsletter */
23
- description: string
24
- /**timestamp of last description modification of newsletter */
25
- descriptionTime: number
26
- /**invite code of newsletter */
27
- invite: string
28
- /**i dont know */
29
- handle: null
30
- /**direct path of picture */
31
- picture: string | null
32
- /**direct path of picture preview (lower quality) */
33
- preview: string | null
34
- /**reaction mode of newsletter */
35
- reaction_codes?: NewsletterReactionMode
36
- /**subscribers count of newsletter */
37
- subscribers: number
38
- /**verification state of newsletter */
39
- verification: NewsletterVerification
40
- /**viewer metadata */
41
- viewer_metadata: NewsletterViewerMetadata
19
+ /**jid of newsletter */
20
+ id: string
21
+ /**state of newsletter */
22
+ state: NewsletterState
23
+ /**creation timestamp of newsletter */
24
+ creation_time: number
25
+ /**name of newsletter */
26
+ name: string
27
+ /**timestamp of last name modification of newsletter */
28
+ nameTime: number
29
+ /**description of newsletter */
30
+ description: string
31
+ /**timestamp of last description modification of newsletter */
32
+ descriptionTime: number
33
+ /**invite code of newsletter */
34
+ invite: string
35
+ /**i dont know */
36
+ handle: null
37
+ /**direct path of picture */
38
+ picture: string | null
39
+ /**direct path of picture preview (lower quality) */
40
+ preview: string | null
41
+ /**reaction mode of newsletter */
42
+ reaction_codes?: NewsletterReactionMode
43
+ /**subscribers count of newsletter */
44
+ subscribers: number
45
+ /**verification state of newsletter */
46
+ verification: NewsletterVerification
47
+ /**viewer metadata */
48
+ viewer_metadata: NewsletterViewerMetadata
42
49
  }
50
+
43
51
  export type SubscriberAction = 'promote' | 'demote'
52
+
44
53
  export type ReactionModeUpdate = {
45
- reaction_codes: {
46
- blocked_codes: null
47
- enabled_ts_sec: null
48
- value: NewsletterReactionMode
49
- }
54
+ reaction_codes: {
55
+ blocked_codes: null
56
+ enabled_ts_sec: null
57
+ value: NewsletterReactionMode
58
+ }
50
59
  }
60
+
51
61
  /**only exists reaction mode update */
52
62
  export type NewsletterSettingsUpdate = ReactionModeUpdate
63
+
53
64
  export type NewsletterReaction = {
54
- count: number
55
- code: string
65
+ count: number
66
+ code: string
56
67
  }
68
+
57
69
  export type NewsletterFetchedUpdate = {
58
- /**id of message in newsletter, starts from 100 */
59
- server_id: string
60
- /**count of views in this message */
61
- views?: number
62
- /**reactions in this message */
63
- reactions: NewsletterReaction[]
64
- /**the message, if you requested only updates, you will not receive message */
65
- message?: proto.IWebMessageInfo
70
+ /**id of message in newsletter, starts from 100 */
71
+ server_id: string
72
+ /**count of views in this message */
73
+ views?: number
74
+ /**reactions in this message */
75
+ reactions: NewsletterReaction[]
76
+ /**the message, if you requested only updates, you will not receive message */
77
+ message?: proto.IWebMessageInfo
66
78
  }
79
+
67
80
  export declare const enum MexOperations {
68
- PROMOTE = "NotificationNewsletterAdminPromote",
69
- DEMOTE = "NotificationNewsletterAdminDemote",
70
- UPDATE = "NotificationNewsletterUpdate"
81
+ PROMOTE = "NotificationNewsletterAdminPromote",
82
+ DEMOTE = "NotificationNewsletterAdminDemote",
83
+ UPDATE = "NotificationNewsletterUpdate"
71
84
  }
85
+
72
86
  export declare const enum XWAPaths {
73
- PROMOTE = "xwa2_notify_newsletter_admin_promote",
74
- DEMOTE = "xwa2_notify_newsletter_admin_demote",
75
- ADMIN_COUNT = "xwa2_newsletter_admin",
76
- CREATE = "xwa2_newsletter_create",
77
- NEWSLETTER = "xwa2_newsletter",
78
- METADATA_UPDATE = "xwa2_notify_newsletter_on_metadata_update"
87
+ PROMOTE = "xwa2_notify_newsletter_admin_promote",
88
+ DEMOTE = "xwa2_notify_newsletter_admin_demote",
89
+ ADMIN_COUNT = "xwa2_newsletter_admin",
90
+ CREATE = "xwa2_newsletter_create",
91
+ NEWSLETTER = "xwa2_newsletter",
92
+ SUBSCRIBED = "xwa2_newsletter_subscribed",
93
+ METADATA_UPDATE = "xwa2_notify_newsletter_on_metadata_update"
79
94
  }
95
+
80
96
  export declare const enum QueryIds {
81
- JOB_MUTATION = "7150902998257522",
82
- METADATA = "6620195908089573",
83
- UNFOLLOW = "7238632346214362",
84
- FOLLOW = "7871414976211147",
85
- UNMUTE = "7337137176362961",
86
- MUTE = "25151904754424642",
87
- CREATE = "6996806640408138",
88
- ADMIN_COUNT = "7130823597031706",
89
- CHANGE_OWNER = "7341777602580933",
90
- DELETE = "8316537688363079",
91
- DEMOTE = "6551828931592903"
97
+ JOB_MUTATION = "7150902998257522",
98
+ METADATA = "6620195908089573",
99
+ UNFOLLOW = "7238632346214362",
100
+ FOLLOW = "7871414976211147",
101
+ UNMUTE = "7337137176362961",
102
+ MUTE = "25151904754424642",
103
+ CREATE = "6996806640408138",
104
+ ADMIN_COUNT = "7130823597031706",
105
+ CHANGE_OWNER = "7341777602580933",
106
+ DELETE = "8316537688363079",
107
+ DEMOTE = "6551828931592903",
108
+ SUBSCRIBED = "6388546374527196"
92
109
  }
@@ -1,33 +1,40 @@
1
1
  "use strict"
2
+
2
3
  Object.defineProperty(exports, "__esModule", { value: true })
4
+
3
5
  const MexOperations = {
4
- PROMOTE: "NotificationNewsletterAdminPromote",
5
- DEMOTE: "NotificationNewsletterAdminDemote",
6
- UPDATE: "NotificationNewsletterUpdate"
6
+ PROMOTE: "NotificationNewsletterAdminPromote",
7
+ DEMOTE: "NotificationNewsletterAdminDemote",
8
+ UPDATE: "NotificationNewsletterUpdate"
7
9
  }
10
+
8
11
  const XWAPaths = {
9
- PROMOTE: "xwa2_notify_newsletter_admin_promote",
10
- DEMOTE: "xwa2_notify_newsletter_admin_demote",
11
- ADMIN_COUNT: "xwa2_newsletter_admin",
12
- CREATE: "xwa2_newsletter_create",
13
- NEWSLETTER: "xwa2_newsletter",
14
- METADATA_UPDATE: "xwa2_notify_newsletter_on_metadata_update"
12
+ PROMOTE: "xwa2_notify_newsletter_admin_promote",
13
+ DEMOTE: "xwa2_notify_newsletter_admin_demote",
14
+ ADMIN_COUNT: "xwa2_newsletter_admin",
15
+ CREATE: "xwa2_newsletter_create",
16
+ NEWSLETTER: "xwa2_newsletter",
17
+ SUBSCRIBED: "xwa2_newsletter_subscribed",
18
+ METADATA_UPDATE: "xwa2_notify_newsletter_on_metadata_update"
15
19
  }
20
+
16
21
  const QueryIds = {
17
- JOB_MUTATION: "7150902998257522",
18
- METADATA: "6620195908089573",
19
- UNFOLLOW: "7238632346214362",
20
- FOLLOW: "7871414976211147",
21
- UNMUTE: "7337137176362961",
22
- MUTE: "25151904754424642",
23
- CREATE: "6996806640408138",
24
- ADMIN_COUNT: "7130823597031706",
25
- CHANGE_OWNER: "7341777602580933",
26
- DELETE: "8316537688363079",
27
- DEMOTE: "6551828931592903"
22
+ JOB_MUTATION: "7150902998257522",
23
+ METADATA: "6620195908089573",
24
+ UNFOLLOW: "7238632346214362",
25
+ FOLLOW: "7871414976211147",
26
+ UNMUTE: "7337137176362961",
27
+ MUTE: "25151904754424642",
28
+ CREATE: "6996806640408138",
29
+ ADMIN_COUNT: "7130823597031706",
30
+ CHANGE_OWNER: "7341777602580933",
31
+ DELETE: "8316537688363079",
32
+ DEMOTE: "6551828931592903",
33
+ SUBSCRIBED: "6388546374527196"
28
34
  }
35
+
29
36
  module.exports = {
30
- MexOperations,
31
- XWAPaths,
32
- QueryIds
37
+ MexOperations,
38
+ XWAPaths,
39
+ QueryIds
33
40
  }
@@ -1,78 +1,92 @@
1
1
  import { WAMediaUpload } from './Message'
2
+
2
3
  export type CatalogResult = {
3
- data: {
4
- paging: {
5
- cursors: {
6
- before: string
7
- after: string
8
- }
9
- }
10
- data: any[]
11
- }
12
- }
4
+ data: {
5
+ paging: {
6
+ cursors: {
7
+ before: string
8
+ after: string
9
+ }
10
+ }
11
+ data: any[]
12
+ }
13
+ }
14
+
13
15
  export type ProductCreateResult = {
14
- data: {
15
- product: {}
16
- }
16
+ data: {
17
+ product: {}
18
+ }
17
19
  }
20
+
18
21
  export type CatalogStatus = {
19
- status: string
20
- canAppeal: boolean
22
+ status: string
23
+ canAppeal: boolean
21
24
  }
25
+
22
26
  export type CatalogCollection = {
23
- id: string
24
- name: string
25
- products: Product[]
26
- status: CatalogStatus
27
+ id: string
28
+ name: string
29
+ products: Product[]
30
+ status: CatalogStatus
27
31
  }
32
+
28
33
  export type ProductAvailability = 'in stock'
34
+
29
35
  export type ProductBase = {
30
- name: string
31
- retailerId?: string
32
- url?: string
33
- description: string
34
- price: number
35
- currency: string
36
- isHidden?: boolean
37
- }
36
+ name: string
37
+ retailerId?: string
38
+ url?: string
39
+ description: string
40
+ price: number
41
+ currency: string
42
+ isHidden?: boolean
43
+ }
44
+
38
45
  export type ProductCreate = ProductBase & {
39
- /** ISO country code for product origin. Set to undefined for no country */
40
- originCountryCode: string | undefined
41
- /** images of the product */
42
- images: WAMediaUpload[]
46
+ /** ISO country code for product origin. Set to undefined for no country */
47
+ originCountryCode: string | undefined
48
+ /** images of the product */
49
+ images: WAMediaUpload[]
43
50
  }
51
+
44
52
  export type ProductUpdate = Omit<ProductCreate, 'originCountryCode'>
53
+
45
54
  export type Product = ProductBase & {
46
- id: string
47
- imageUrls: {
48
- [_: string]: string
49
- }
50
- reviewStatus: {
51
- [_: string]: string
52
- }
53
- availability: ProductAvailability
54
- }
55
+ id: string
56
+ imageUrls: {
57
+ [_: string]: string
58
+ }
59
+ reviewStatus: {
60
+ [_: string]: string
61
+ }
62
+ availability: ProductAvailability
63
+ }
64
+
55
65
  export type OrderPrice = {
56
- currency: string
57
- total: number
66
+ currency: string
67
+ total: number
58
68
  }
69
+
59
70
  export type OrderProduct = {
60
- id: string
61
- imageUrl: string
62
- name: string
63
- quantity: number
64
- currency: string
65
- price: number
66
- }
71
+ id: string
72
+ imageUrl: string
73
+ name: string
74
+ quantity: number
75
+ currency: string
76
+ price: number
77
+ }
78
+
67
79
  export type OrderDetails = {
68
- price: OrderPrice
69
- products: OrderProduct[]
80
+ price: OrderPrice
81
+ products: OrderProduct[]
70
82
  }
83
+
71
84
  export type CatalogCursor = string
85
+
72
86
  export type GetCatalogOptions = {
73
- /** cursor to start from */
74
- cursor?: CatalogCursor
75
- /** number of products to fetch */
76
- limit?: number
77
- jid?: string
87
+ /** cursor to start from */
88
+ cursor?: CatalogCursor
89
+ /** number of products to fetch */
90
+ limit?: number
91
+ jid?: string
78
92
  }
@@ -1,2 +1,3 @@
1
1
  "use strict"
2
+
2
3
  Object.defineProperty(exports, "__esModule", { value: true })
@@ -1,57 +1,68 @@
1
1
  import { proto } from '../../WAProto'
2
+
2
3
  type DecryptGroupSignalOpts = {
3
- group: string
4
- authorJid: string
5
- msg: Uint8Array
4
+ group: string
5
+ authorJid: string
6
+ msg: Uint8Array
6
7
  }
8
+
7
9
  type ProcessSenderKeyDistributionMessageOpts = {
8
- item: proto.Message.ISenderKeyDistributionMessage
9
- authorJid: string
10
+ item: proto.Message.ISenderKeyDistributionMessage
11
+ authorJid: string
10
12
  }
13
+
11
14
  type DecryptSignalProtoOpts = {
12
- jid: string
13
- type: 'pkmsg' | 'msg'
14
- ciphertext: Uint8Array
15
+ jid: string
16
+ type: 'pkmsg' | 'msg'
17
+ ciphertext: Uint8Array
15
18
  }
19
+
16
20
  type EncryptMessageOpts = {
17
- jid: string
18
- data: Uint8Array
21
+ jid: string
22
+ data: Uint8Array
19
23
  }
24
+
20
25
  type EncryptGroupMessageOpts = {
21
- group: string
22
- data: Uint8Array
23
- meId: string
26
+ group: string
27
+ data: Uint8Array
28
+ meId: string
24
29
  }
30
+
25
31
  type PreKey = {
26
- keyId: number
27
- publicKey: Uint8Array
32
+ keyId: number
33
+ publicKey: Uint8Array
28
34
  }
35
+
29
36
  type SignedPreKey = PreKey & {
30
- signature: Uint8Array
37
+ signature: Uint8Array
31
38
  }
39
+
32
40
  type E2ESession = {
33
- registrationId: number
34
- identityKey: Uint8Array
35
- signedPreKey: SignedPreKey
36
- preKey: PreKey
41
+ registrationId: number
42
+ identityKey: Uint8Array
43
+ signedPreKey: SignedPreKey
44
+ preKey: PreKey
37
45
  }
46
+
38
47
  type E2ESessionOpts = {
39
- jid: string
40
- session: E2ESession
48
+ jid: string
49
+ session: E2ESession
41
50
  }
51
+
42
52
  export type SignalRepository = {
43
- decryptGroupMessage(opts: DecryptGroupSignalOpts): Promise<Uint8Array>
44
- processSenderKeyDistributionMessage(opts: ProcessSenderKeyDistributionMessageOpts): Promise<void>
45
- decryptMessage(opts: DecryptSignalProtoOpts): Promise<Uint8Array>
46
- encryptMessage(opts: EncryptMessageOpts): Promise<{
47
- type: 'pkmsg' | 'msg'
48
- ciphertext: Uint8Array
49
- }>
50
- encryptGroupMessage(opts: EncryptGroupMessageOpts): Promise<{
51
- senderKeyDistributionMessage: Uint8Array
52
- ciphertext: Uint8Array
53
- }>
54
- injectE2ESession(opts: E2ESessionOpts): Promise<void>
55
- jidToSignalProtocolAddress(jid: string): string
53
+ decryptGroupMessage(opts: DecryptGroupSignalOpts): Promise<Uint8Array>
54
+ processSenderKeyDistributionMessage(opts: ProcessSenderKeyDistributionMessageOpts): Promise<void>
55
+ decryptMessage(opts: DecryptSignalProtoOpts): Promise<Uint8Array>
56
+ encryptMessage(opts: EncryptMessageOpts): Promise<{
57
+ type: 'pkmsg' | 'msg'
58
+ ciphertext: Uint8Array
59
+ }>
60
+ encryptGroupMessage(opts: EncryptGroupMessageOpts): Promise<{
61
+ senderKeyDistributionMessage: Uint8Array
62
+ ciphertext: Uint8Array
63
+ }>
64
+ injectE2ESession(opts: E2ESessionOpts): Promise<void>
65
+ jidToSignalProtocolAddress(jid: string): string
56
66
  }
67
+
57
68
  export {}
@@ -1,2 +1,3 @@
1
1
  "use strict"
2
+
2
3
  Object.defineProperty(exports, "__esModule", { value: true })