@open-wa/schema 5.0.0-alpha.8 → 5.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 (100) hide show
  1. package/LICENSE.md +2 -2
  2. package/README.md +1 -1
  3. package/dist/generated/index.cjs +8 -2
  4. package/dist/generated/index.cjs.map +1 -1
  5. package/dist/generated/index.d.cts +1164 -452
  6. package/dist/generated/index.d.cts.map +1 -1
  7. package/dist/generated/index.d.mts +1164 -452
  8. package/dist/generated/index.d.mts.map +1 -1
  9. package/dist/generated/index.mjs +8 -2
  10. package/dist/generated/index.mjs.map +1 -1
  11. package/dist/{http-manifest-BlJWPKsp.d.mts → http-manifest-CqjUoaDB.d.cts} +12 -13
  12. package/dist/http-manifest-CqjUoaDB.d.cts.map +1 -0
  13. package/dist/{http-manifest-DCOVY9QZ.d.cts → http-manifest-CqjUoaDB.d.mts} +12 -13
  14. package/dist/http-manifest-CqjUoaDB.d.mts.map +1 -0
  15. package/dist/http-manifest.cjs +1 -1
  16. package/dist/http-manifest.cjs.map +1 -1
  17. package/dist/http-manifest.d.cts +1 -1
  18. package/dist/http-manifest.d.mts +1 -1
  19. package/dist/http-manifest.mjs +1 -1
  20. package/dist/http-manifest.mjs.map +1 -1
  21. package/dist/{implementor-DIBNbQXA.d.cts → implementor-ACLHTHby.d.cts} +1 -2
  22. package/dist/implementor-ACLHTHby.d.cts.map +1 -0
  23. package/dist/{implementor-DoN9ga7C.d.mts → implementor-ACLHTHby.d.mts} +1 -2
  24. package/dist/implementor-ACLHTHby.d.mts.map +1 -0
  25. package/dist/implementor.cjs +1 -1
  26. package/dist/implementor.cjs.map +1 -1
  27. package/dist/implementor.d.cts +1 -1
  28. package/dist/implementor.d.mts +1 -1
  29. package/dist/implementor.mjs +1 -1
  30. package/dist/implementor.mjs.map +1 -1
  31. package/dist/{index-BB9uyLe8.d.cts → index-DTztyYhw.d.cts} +935 -103
  32. package/dist/index-DTztyYhw.d.cts.map +1 -0
  33. package/dist/{index-D77q1gPk.d.mts → index-nVKR0RmZ.d.mts} +935 -103
  34. package/dist/index-nVKR0RmZ.d.mts.map +1 -0
  35. package/dist/index.cjs +58 -6
  36. package/dist/index.cjs.map +1 -1
  37. package/dist/index.d.cts +4 -4
  38. package/dist/index.d.mts +4 -4
  39. package/dist/index.mjs +31 -7
  40. package/dist/index.mjs.map +1 -1
  41. package/dist/methods/index.cjs +5 -1
  42. package/dist/methods/index.d.cts +2 -2
  43. package/dist/methods/index.d.mts +2 -2
  44. package/dist/methods/index.mjs +2 -2
  45. package/dist/{methods-BXZrkKjP.mjs → methods-BSv5O3bS.mjs} +318 -3
  46. package/dist/methods-BSv5O3bS.mjs.map +1 -0
  47. package/dist/{methods-CuiwUO7-.cjs → methods-DO0JONvB.cjs} +473 -2
  48. package/dist/methods-DO0JONvB.cjs.map +1 -0
  49. package/dist/{registry-CsyR8i6y.mjs → registry-BIddXpin.mjs} +26 -1
  50. package/dist/{registry-CsyR8i6y.mjs.map → registry-BIddXpin.mjs.map} +1 -1
  51. package/dist/{registry-TbMVoiw5.cjs → registry-_s9a7_jl.cjs} +26 -1
  52. package/dist/{registry-TbMVoiw5.cjs.map → registry-_s9a7_jl.cjs.map} +1 -1
  53. package/package.json +12 -10
  54. package/src/__tests__/generators.contract.test.ts +181 -0
  55. package/src/__tests__/registry.contract.test.ts +81 -0
  56. package/src/client-config.ts +30 -0
  57. package/src/codecs.test.ts +41 -0
  58. package/src/codecs.ts +191 -0
  59. package/src/common-types.ts +280 -0
  60. package/src/config.ts +47 -0
  61. package/src/enums.ts +63 -0
  62. package/src/events/groups.ts +33 -0
  63. package/src/events/index.ts +4 -0
  64. package/src/events/messaging.ts +86 -0
  65. package/src/events/registry.ts +124 -0
  66. package/src/events/state.ts +59 -0
  67. package/src/generated/AliasMap.ts +216 -0
  68. package/src/generated/BaseClient.ts +878 -0
  69. package/src/generated/BaseNamespacedClient.ts +214 -0
  70. package/src/generated/index.ts +5 -0
  71. package/src/generated/openapi.json +8949 -0
  72. package/src/generated/types.ts +383 -0
  73. package/src/http-manifest.ts +97 -0
  74. package/src/implementor.test.ts +88 -0
  75. package/src/implementor.ts +75 -0
  76. package/src/index.ts +44 -0
  77. package/src/interactive.ts +151 -0
  78. package/src/methods/business.ts +51 -0
  79. package/src/methods/chats.ts +263 -0
  80. package/src/methods/communities.ts +119 -0
  81. package/src/methods/contacts.ts +158 -0
  82. package/src/methods/groups.ts +376 -0
  83. package/src/methods/index.ts +34 -0
  84. package/src/methods/interactive.ts +21 -0
  85. package/src/methods/labels.ts +86 -0
  86. package/src/methods/media.ts +36 -0
  87. package/src/methods/messaging.ts +828 -0
  88. package/src/methods/session.ts +261 -0
  89. package/src/methods/status.ts +120 -0
  90. package/src/parameters.ts +237 -0
  91. package/src/registry.test.ts +30 -0
  92. package/src/registry.ts +601 -0
  93. package/dist/http-manifest-BlJWPKsp.d.mts.map +0 -1
  94. package/dist/http-manifest-DCOVY9QZ.d.cts.map +0 -1
  95. package/dist/implementor-DIBNbQXA.d.cts.map +0 -1
  96. package/dist/implementor-DoN9ga7C.d.mts.map +0 -1
  97. package/dist/index-BB9uyLe8.d.cts.map +0 -1
  98. package/dist/index-D77q1gPk.d.mts.map +0 -1
  99. package/dist/methods-BXZrkKjP.mjs.map +0 -1
  100. package/dist/methods-CuiwUO7-.cjs.map +0 -1
@@ -0,0 +1,214 @@
1
+ /* eslint-disable */
2
+ /**
3
+ * This file was automatically generated by packages/schema/scripts/gen-client-implementation.ts
4
+ * Do not edit this file manually.
5
+ */
6
+ import { BaseClient } from './BaseClient';
7
+
8
+ export abstract class BaseNamespacedClient extends BaseClient {
9
+ public business = {
10
+ getOrder: this.getOrder,
11
+ getProducts: this.getBusinessProducts,
12
+ getProfile: this.getBusinessProfile,
13
+ getProfilesProducts: this.getBusinessProducts
14
+ };
15
+
16
+ public chatIds = {
17
+ all: this.getAllChatIds,
18
+ getAll: this.getAllChatIds,
19
+ list: this.getAllChatIds
20
+ };
21
+
22
+ public chats = {
23
+ all: this.getAllChats,
24
+ archive: this.archiveChat,
25
+ clear: this.clearChat,
26
+ delete: this.deleteChat,
27
+ get: this.getChat,
28
+ getAll: this.getAllChats,
29
+ getById: this.getChat,
30
+ getWithNonContacts: this.getChatWithNonContacts,
31
+ isOnline: this.isChatOnline,
32
+ list: this.getAllChats,
33
+ markAsRead: this.markAsRead,
34
+ markAsUnread: this.markAsUnread,
35
+ mute: this.muteChat,
36
+ pin: this.pinChat,
37
+ setEphemeral: this.setChatEphemeral,
38
+ unarchive: this.unarchiveChat,
39
+ unmute: this.unmuteChat,
40
+ unpin: this.unpinChat
41
+ };
42
+
43
+ public communities = {
44
+ all: this.getAllCommunities,
45
+ getAdminIds: this.getCommunityAdminIds,
46
+ getAdmins: this.getCommunityAdmins,
47
+ getAll: this.getAllCommunities,
48
+ getInfo: this.getCommunityInfo,
49
+ getParticipantIds: this.getCommunityParticipantIds,
50
+ getParticipants: this.getCommunityParticipants,
51
+ list: this.getAllCommunities
52
+ };
53
+
54
+ public contacts = {
55
+ all: this.getAllContacts,
56
+ block: this.blockContact,
57
+ checkNumberStatus: this.checkNumberStatus,
58
+ checkReadReceipts: this.checkReadReceipts,
59
+ contactBlock: this.blockContact,
60
+ contactUnblock: this.unblockContact,
61
+ get: this.getContact,
62
+ getAll: this.getAllContacts,
63
+ getBlockedIds: this.getBlockedIds,
64
+ getCommonGroups: this.getCommonGroups,
65
+ getNumberProfile: this.getNumberProfile,
66
+ getProfilePicFromServer: this.getProfilePicture,
67
+ getProfilePicture: this.getProfilePicture,
68
+ getReadReceipts: this.checkReadReceipts,
69
+ list: this.getAllContacts,
70
+ unblock: this.unblockContact
71
+ };
72
+
73
+ public groups = {
74
+ addParticipant: this.addParticipant,
75
+ all: this.getAllGroups,
76
+ approveJoinRequest: this.approveGroupJoinRequest,
77
+ create: this.createGroup,
78
+ demoteParticipant: this.demoteParticipant,
79
+ getAdmins: this.getGroupAdmins,
80
+ getAll: this.getAllGroups,
81
+ getInfo: this.getGroupInfo,
82
+ getInviteLink: this.getGroupInviteLink,
83
+ getKicked: this.getKickedGroups,
84
+ getMemberIds: this.getGroupMembersId,
85
+ getMembers: this.getGroupMembers,
86
+ getMembersId: this.getGroupMembersId,
87
+ join: this.joinGroupViaLink,
88
+ joinViaLink: this.joinGroupViaLink,
89
+ leave: this.leaveGroup,
90
+ list: this.getAllGroups,
91
+ promoteParticipant: this.promoteParticipant,
92
+ rejectJoinRequest: this.rejectGroupJoinRequest,
93
+ removeParticipant: this.removeParticipant,
94
+ revokeInviteLink: this.revokeGroupInviteLink,
95
+ setAdminsOnly: this.setGroupToAdminsOnly,
96
+ setDescription: this.setGroupDescription,
97
+ setEditAdminsOnly: this.setGroupEditToAdminsOnly,
98
+ setEditToAdminsOnly: this.setGroupEditToAdminsOnly,
99
+ setIcon: this.setGroupIcon,
100
+ setTitle: this.setGroupTitle,
101
+ setToAdminsOnly: this.setGroupToAdminsOnly
102
+ };
103
+
104
+ public labels = {
105
+ add: this.addLabel,
106
+ all: this.getAllLabels,
107
+ getAll: this.getAllLabels,
108
+ getChats: this.getChatsByLabel,
109
+ getChatsBy: this.getChatsByLabel,
110
+ list: this.getAllLabels,
111
+ remove: this.removeLabel
112
+ };
113
+
114
+ public media = {
115
+ decrypt: this.decryptMedia,
116
+ download: this.downloadMedia
117
+ };
118
+
119
+ public messages = {
120
+ all: this.getAllMessages,
121
+ delete: this.deleteMessage,
122
+ forward: this.forwardMessages,
123
+ get: this.getMessageById,
124
+ getAll: this.getAllMessages,
125
+ getById: this.getMessageById,
126
+ getForLLM: this.getMessagesForLLM,
127
+ getGptArray: this.getMessagesForLLM,
128
+ getInfo: this.getMessageInfo,
129
+ getMyLast: this.getMyLastMessage,
130
+ getStarred: this.getStarredMessages,
131
+ getUnsent: this.getUnsentMessages,
132
+ getVCards: this.getVCards,
133
+ list: this.getAllMessages,
134
+ loadEarlier: this.loadEarlierMessages,
135
+ loadOlder: this.loadEarlierMessages,
136
+ react: this.react,
137
+ sendAdvancedButtons: this.sendAdvancedButtons,
138
+ sendAudio: this.sendAudio,
139
+ sendBanner: this.sendBanner,
140
+ sendButtons: this.sendButtons,
141
+ sendContact: this.sendContact,
142
+ sendContacts: this.sendMultipleContacts,
143
+ sendFile: this.sendFile,
144
+ sendFileFromUrl: this.sendFileFromUrl,
145
+ sendImage: this.sendImage,
146
+ sendInteractive: this.sendInteractive,
147
+ sendLink: this.sendLinkWithAutoPreview,
148
+ sendLinkWithAutoPreview: this.sendLinkWithAutoPreview,
149
+ sendLinkWithThumbnail: this.sendMessageWithThumb,
150
+ sendList: this.sendListMessage,
151
+ sendLocation: this.sendLocation,
152
+ sendMultipleContacts: this.sendMultipleContacts,
153
+ sendPaymentRequest: this.sendPaymentRequest,
154
+ sendPoll: this.sendPoll,
155
+ sendPtt: this.sendPtt,
156
+ sendRaw: this.sendRawMessage,
157
+ sendReplyWithMentions: this.sendReplyWithMentions,
158
+ sendSeen: this.sendSeen,
159
+ sendText: this.sendText,
160
+ sendTextWithMentions: this.sendTextWithMentions,
161
+ sendVCard: this.sendVCard,
162
+ sendVideoAsGif: this.sendVideoAsGif,
163
+ sendVoiceNote: this.sendPtt,
164
+ sendWithThumb: this.sendMessageWithThumb,
165
+ sendYoutubeLink: this.sendYouTubeLink,
166
+ sendYouTubeLink: this.sendYouTubeLink,
167
+ star: this.starMessage,
168
+ unstar: this.unstarMessage
169
+ };
170
+
171
+ public mystatus = {
172
+ getStatus: this.getStatus
173
+ };
174
+
175
+ public session = {
176
+ getAmountOfLoadedMessages: this.getLoadedMessageCount,
177
+ getBatteryLevel: this.getBatteryLevel,
178
+ getConnectionState: this.getConnectionState,
179
+ getFeatures: this.getFeatures,
180
+ getGeneratedUserAgent: this.getUserAgent,
181
+ getHostNumber: this.getHostNumber,
182
+ getIsPlugged: this.isPlugged,
183
+ getLicenseType: this.getLicenseType,
184
+ getLoadedMessageCount: this.getLoadedMessageCount,
185
+ getMe: this.getMe,
186
+ getProcessStats: this.getProcessStats,
187
+ getSnapshot: this.getSnapshot,
188
+ getUserAgent: this.getUserAgent,
189
+ getWAVersion: this.getWAVersion,
190
+ getWhatsAppVersion: this.getWAVersion,
191
+ healthCheck: this.healthCheck,
192
+ isPlugged: this.isPlugged,
193
+ setDisplayName: this.setMyName,
194
+ setMyName: this.setMyName,
195
+ setMyStatus: this.setMyStatus,
196
+ setName: this.setMyName,
197
+ setProfilePic: this.setProfilePicture,
198
+ setProfilePicture: this.setProfilePicture,
199
+ setStatus: this.setMyStatus,
200
+ setStatusText: this.setMyStatus,
201
+ takeScreenshot: this.getSnapshot
202
+ };
203
+
204
+ public status = {
205
+ delete: this.deleteStatus,
206
+ deleteAll: this.deleteAllStatus,
207
+ get: this.getStories,
208
+ getAll: this.getStories,
209
+ getStories: this.getStories,
210
+ postImage: this.postImageStatus,
211
+ postText: this.postTextStatus,
212
+ postVideo: this.postVideoStatus
213
+ };
214
+ }
@@ -0,0 +1,5 @@
1
+ /* eslint-disable */
2
+ export * from './AliasMap';
3
+ export * from './BaseClient';
4
+ export * from './BaseNamespacedClient';
5
+ export * from './types';