@open-wa/schema 5.0.0-alpha.2 → 5.0.0-alpha.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.
- package/dist/generated/index.cjs +598 -0
- package/dist/generated/index.cjs.map +1 -0
- package/dist/generated/index.d.cts +3674 -0
- package/dist/generated/index.d.cts.map +1 -0
- package/dist/generated/index.d.mts +3674 -0
- package/dist/generated/index.d.mts.map +1 -0
- package/dist/generated/index.mjs +595 -0
- package/dist/generated/index.mjs.map +1 -0
- package/dist/http-manifest-BQIxNSNP.d.mts +177 -0
- package/dist/http-manifest-BQIxNSNP.d.mts.map +1 -0
- package/dist/http-manifest-Cgp405eE.d.cts +177 -0
- package/dist/http-manifest-Cgp405eE.d.cts.map +1 -0
- package/dist/http-manifest.cjs +59 -0
- package/dist/http-manifest.cjs.map +1 -0
- package/dist/http-manifest.d.cts +2 -0
- package/dist/http-manifest.d.mts +2 -0
- package/dist/http-manifest.mjs +58 -0
- package/dist/http-manifest.mjs.map +1 -0
- package/dist/implementor-DIBNbQXA.d.cts +8 -0
- package/dist/implementor-DIBNbQXA.d.cts.map +1 -0
- package/dist/implementor-DoN9ga7C.d.mts +8 -0
- package/dist/implementor-DoN9ga7C.d.mts.map +1 -0
- package/dist/implementor.cjs +50 -0
- package/dist/implementor.cjs.map +1 -0
- package/dist/implementor.d.cts +2 -0
- package/dist/implementor.d.mts +2 -0
- package/dist/implementor.mjs +48 -0
- package/dist/implementor.mjs.map +1 -0
- package/dist/index-BpnIT_UN.d.mts +1323 -0
- package/dist/index-BpnIT_UN.d.mts.map +1 -0
- package/dist/index-BsqJbJE4.d.cts +1323 -0
- package/dist/index-BsqJbJE4.d.cts.map +1 -0
- package/dist/index.cjs +649 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +4 -0
- package/dist/index.d.mts +4 -0
- package/dist/index.mjs +299 -0
- package/dist/index.mjs.map +1 -0
- package/dist/methods/index.cjs +125 -0
- package/dist/methods/index.d.cts +2 -0
- package/dist/methods/index.d.mts +2 -0
- package/dist/methods/index.mjs +2 -0
- package/dist/methods-BXZrkKjP.mjs +2633 -0
- package/dist/methods-BXZrkKjP.mjs.map +1 -0
- package/dist/methods-CuiwUO7-.cjs +3802 -0
- package/dist/methods-CuiwUO7-.cjs.map +1 -0
- package/dist/registry-CsyR8i6y.mjs +284 -0
- package/dist/registry-CsyR8i6y.mjs.map +1 -0
- package/dist/registry-TbMVoiw5.cjs +355 -0
- package/dist/registry-TbMVoiw5.cjs.map +1 -0
- package/package.json +6 -3
- package/CHANGELOG.md +0 -31
- package/client_migration_doc.md +0 -467
- package/codecs_and_params_plan.md +0 -936
- package/migration_plan_doc.md +0 -223
- package/scripts/gen-client-implementation.ts +0 -129
- package/scripts/gen-client-reference-docs.ts +0 -621
- package/scripts/gen-openapi.ts +0 -96
- package/scripts/gen-types.ts +0 -43
- package/scripts/verify-v5-pipeline.ts +0 -85
- package/src/__tests__/generators.contract.test.ts +0 -181
- package/src/__tests__/registry.contract.test.ts +0 -81
- package/src/client-config.ts +0 -30
- package/src/codecs.test.ts +0 -41
- package/src/codecs.ts +0 -191
- package/src/common-types.ts +0 -280
- package/src/config.ts +0 -47
- package/src/enums.ts +0 -63
- package/src/events/groups.ts +0 -33
- package/src/events/index.ts +0 -4
- package/src/events/messaging.ts +0 -72
- package/src/events/registry.ts +0 -114
- package/src/events/state.ts +0 -59
- package/src/generated/AliasMap.ts +0 -214
- package/src/generated/BaseClient.ts +0 -868
- package/src/generated/BaseNamespacedClient.ts +0 -212
- package/src/generated/index.ts +0 -5
- package/src/generated/openapi.json +0 -7799
- package/src/generated/types.ts +0 -377
- package/src/http-manifest.ts +0 -97
- package/src/implementor.test.ts +0 -88
- package/src/implementor.ts +0 -75
- package/src/index.ts +0 -43
- package/src/methods/business.ts +0 -51
- package/src/methods/chats.ts +0 -263
- package/src/methods/communities.ts +0 -119
- package/src/methods/contacts.ts +0 -158
- package/src/methods/groups.ts +0 -376
- package/src/methods/index.ts +0 -33
- package/src/methods/labels.ts +0 -86
- package/src/methods/media.ts +0 -36
- package/src/methods/messaging.ts +0 -828
- package/src/methods/session.ts +0 -261
- package/src/methods/status.ts +0 -120
- package/src/open-wa-utils.d.ts +0 -4
- package/src/parameters.ts +0 -237
- package/src/registry.test.ts +0 -30
- package/src/registry.ts +0 -601
- package/tsconfig.generated.json +0 -11
- package/tsconfig.json +0 -15
- package/tsdown.config.ts +0 -16
- package/vitest.config.ts +0 -10
package/src/methods/groups.ts
DELETED
|
@@ -1,376 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { defineMethodV2 } from '../registry';
|
|
3
|
-
import { contactIdParam, groupIdParam, withNewMessagesOnlyParam } from '../parameters';
|
|
4
|
-
|
|
5
|
-
export const getGroupMembers = defineMethodV2('getGroupMembers', {
|
|
6
|
-
meta: {
|
|
7
|
-
description: 'Retrieves members of a group',
|
|
8
|
-
action: 'read',
|
|
9
|
-
namespace: 'groups',
|
|
10
|
-
license: 'none',
|
|
11
|
-
functionality: 'both',
|
|
12
|
-
httpMethod: 'GET',
|
|
13
|
-
},
|
|
14
|
-
input: z.object({ groupId: groupIdParam }),
|
|
15
|
-
parameterOrder: ['groupId'],
|
|
16
|
-
output: z.array(z.any()),
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
export const getAllGroups = defineMethodV2('getAllGroups', {
|
|
20
|
-
meta: {
|
|
21
|
-
description: 'Get all groups',
|
|
22
|
-
action: 'read',
|
|
23
|
-
namespace: 'groups',
|
|
24
|
-
license: 'none',
|
|
25
|
-
functionality: 'both',
|
|
26
|
-
httpMethod: 'GET',
|
|
27
|
-
},
|
|
28
|
-
input: z.object({ withNewMessagesOnly: withNewMessagesOnlyParam }),
|
|
29
|
-
parameterOrder: ['withNewMessagesOnly'],
|
|
30
|
-
output: z.array(z.any()),
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
export const getGroupMembersId = defineMethodV2('getGroupMembersId', {
|
|
34
|
-
meta: {
|
|
35
|
-
description: 'Get group member IDs',
|
|
36
|
-
action: 'read',
|
|
37
|
-
namespace: 'groups',
|
|
38
|
-
license: 'none',
|
|
39
|
-
functionality: 'both',
|
|
40
|
-
httpMethod: 'GET',
|
|
41
|
-
aliases: {
|
|
42
|
-
explicit: ['getGroupMemberIds'],
|
|
43
|
-
namespacedName: 'getMemberIds',
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
input: z.object({ groupId: groupIdParam }),
|
|
47
|
-
parameterOrder: ['groupId'],
|
|
48
|
-
output: z.array(z.string()),
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
export const getGroupInfo = defineMethodV2('getGroupInfo', {
|
|
52
|
-
meta: {
|
|
53
|
-
description: 'Get group metadata',
|
|
54
|
-
action: 'read',
|
|
55
|
-
namespace: 'groups',
|
|
56
|
-
license: 'none',
|
|
57
|
-
functionality: 'both',
|
|
58
|
-
httpMethod: 'GET',
|
|
59
|
-
},
|
|
60
|
-
input: z.object({ groupId: groupIdParam }),
|
|
61
|
-
parameterOrder: ['groupId'],
|
|
62
|
-
output: z.any(),
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
export const getGroupAdmins = defineMethodV2('getGroupAdmins', {
|
|
66
|
-
meta: {
|
|
67
|
-
description: 'Get group admins',
|
|
68
|
-
action: 'read',
|
|
69
|
-
namespace: 'groups',
|
|
70
|
-
license: 'none',
|
|
71
|
-
functionality: 'both',
|
|
72
|
-
httpMethod: 'GET',
|
|
73
|
-
},
|
|
74
|
-
input: z.object({ groupId: groupIdParam }),
|
|
75
|
-
parameterOrder: ['groupId'],
|
|
76
|
-
output: z.array(z.any()),
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
export const getKickedGroups = defineMethodV2('getKickedGroups', {
|
|
80
|
-
meta: {
|
|
81
|
-
description: 'Get groups where kicked',
|
|
82
|
-
action: 'read',
|
|
83
|
-
namespace: 'groups',
|
|
84
|
-
license: 'none',
|
|
85
|
-
functionality: 'both',
|
|
86
|
-
httpMethod: 'GET',
|
|
87
|
-
},
|
|
88
|
-
input: z.object({}),
|
|
89
|
-
parameterOrder: [],
|
|
90
|
-
output: z.array(z.string()),
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
export const getGroupInviteLink = defineMethodV2('getGroupInviteLink', {
|
|
94
|
-
meta: {
|
|
95
|
-
description: 'Get group invite link',
|
|
96
|
-
action: 'read',
|
|
97
|
-
namespace: 'groups',
|
|
98
|
-
license: 'none',
|
|
99
|
-
functionality: 'both',
|
|
100
|
-
httpMethod: 'GET',
|
|
101
|
-
},
|
|
102
|
-
input: z.object({ groupId: groupIdParam }),
|
|
103
|
-
parameterOrder: ['groupId'],
|
|
104
|
-
output: z.string(),
|
|
105
|
-
});
|
|
106
|
-
|
|
107
|
-
export const createGroup = defineMethodV2('createGroup', {
|
|
108
|
-
meta: {
|
|
109
|
-
description: 'Create new group',
|
|
110
|
-
action: 'send',
|
|
111
|
-
namespace: 'groups',
|
|
112
|
-
license: 'restricted',
|
|
113
|
-
functionality: 'both',
|
|
114
|
-
httpMethod: 'POST',
|
|
115
|
-
},
|
|
116
|
-
input: z.object({
|
|
117
|
-
name: z.string().describe('Group name'),
|
|
118
|
-
contacts: z.array(contactIdParam).describe('Contact IDs to add'),
|
|
119
|
-
}),
|
|
120
|
-
parameterOrder: ['name', 'contacts'],
|
|
121
|
-
output: z.any(),
|
|
122
|
-
});
|
|
123
|
-
|
|
124
|
-
export const leaveGroup = defineMethodV2('leaveGroup', {
|
|
125
|
-
meta: {
|
|
126
|
-
description: 'Leave a group',
|
|
127
|
-
action: 'update',
|
|
128
|
-
namespace: 'groups',
|
|
129
|
-
license: 'none',
|
|
130
|
-
functionality: 'both',
|
|
131
|
-
httpMethod: 'PUT',
|
|
132
|
-
},
|
|
133
|
-
input: z.object({ groupId: groupIdParam }),
|
|
134
|
-
parameterOrder: ['groupId'],
|
|
135
|
-
output: z.any(),
|
|
136
|
-
});
|
|
137
|
-
|
|
138
|
-
export const joinGroupViaLink = defineMethodV2('joinGroupViaLink', {
|
|
139
|
-
meta: {
|
|
140
|
-
description: 'Join group via invite link',
|
|
141
|
-
action: 'send',
|
|
142
|
-
namespace: 'groups',
|
|
143
|
-
license: 'restricted',
|
|
144
|
-
functionality: 'both',
|
|
145
|
-
httpMethod: 'POST',
|
|
146
|
-
aliases: {
|
|
147
|
-
explicit: ['joinGroup'],
|
|
148
|
-
namespacedName: 'join',
|
|
149
|
-
},
|
|
150
|
-
},
|
|
151
|
-
input: z.object({
|
|
152
|
-
link: z.string().url().describe('Group invite link'),
|
|
153
|
-
returnChatObj: z.boolean().optional().describe('Return chat object'),
|
|
154
|
-
}),
|
|
155
|
-
parameterOrder: ['link', 'returnChatObj'],
|
|
156
|
-
output: z.union([z.string(), z.boolean(), z.number(), z.any()]),
|
|
157
|
-
});
|
|
158
|
-
|
|
159
|
-
export const revokeGroupInviteLink = defineMethodV2('revokeGroupInviteLink', {
|
|
160
|
-
meta: {
|
|
161
|
-
description: 'Revoke group invite link',
|
|
162
|
-
action: 'update',
|
|
163
|
-
namespace: 'groups',
|
|
164
|
-
license: 'none',
|
|
165
|
-
functionality: 'both',
|
|
166
|
-
httpMethod: 'PUT',
|
|
167
|
-
},
|
|
168
|
-
input: z.object({ groupId: groupIdParam }),
|
|
169
|
-
parameterOrder: ['groupId'],
|
|
170
|
-
output: z.union([z.string(), z.boolean()]),
|
|
171
|
-
});
|
|
172
|
-
|
|
173
|
-
export const setGroupTitle = defineMethodV2('setGroupTitle', {
|
|
174
|
-
meta: {
|
|
175
|
-
description: 'Set group title',
|
|
176
|
-
action: 'update',
|
|
177
|
-
namespace: 'groups',
|
|
178
|
-
license: 'none',
|
|
179
|
-
functionality: 'both',
|
|
180
|
-
httpMethod: 'PUT',
|
|
181
|
-
},
|
|
182
|
-
input: z.object({
|
|
183
|
-
groupId: groupIdParam,
|
|
184
|
-
title: z.string().describe('New group title'),
|
|
185
|
-
}),
|
|
186
|
-
parameterOrder: ['groupId', 'title'],
|
|
187
|
-
output: z.boolean(),
|
|
188
|
-
});
|
|
189
|
-
|
|
190
|
-
export const setGroupDescription = defineMethodV2('setGroupDescription', {
|
|
191
|
-
meta: {
|
|
192
|
-
description: 'Set group description',
|
|
193
|
-
action: 'update',
|
|
194
|
-
namespace: 'groups',
|
|
195
|
-
license: 'none',
|
|
196
|
-
functionality: 'both',
|
|
197
|
-
httpMethod: 'PUT',
|
|
198
|
-
},
|
|
199
|
-
input: z.object({
|
|
200
|
-
groupId: groupIdParam,
|
|
201
|
-
description: z.string().describe('New group description'),
|
|
202
|
-
}),
|
|
203
|
-
parameterOrder: ['groupId', 'description'],
|
|
204
|
-
output: z.boolean(),
|
|
205
|
-
});
|
|
206
|
-
|
|
207
|
-
export const setGroupIcon = defineMethodV2('setGroupIcon', {
|
|
208
|
-
meta: {
|
|
209
|
-
description: 'Set group icon',
|
|
210
|
-
action: 'update',
|
|
211
|
-
namespace: 'groups',
|
|
212
|
-
license: 'none',
|
|
213
|
-
functionality: 'both',
|
|
214
|
-
httpMethod: 'PUT',
|
|
215
|
-
},
|
|
216
|
-
input: z.object({
|
|
217
|
-
groupId: groupIdParam,
|
|
218
|
-
image: z.string().describe('Image data URL'),
|
|
219
|
-
}),
|
|
220
|
-
parameterOrder: ['groupId', 'image'],
|
|
221
|
-
output: z.boolean(),
|
|
222
|
-
});
|
|
223
|
-
|
|
224
|
-
export const setGroupToAdminsOnly = defineMethodV2('setGroupToAdminsOnly', {
|
|
225
|
-
meta: {
|
|
226
|
-
description: 'Restrict group to admins only',
|
|
227
|
-
action: 'update',
|
|
228
|
-
namespace: 'groups',
|
|
229
|
-
license: 'none',
|
|
230
|
-
functionality: 'both',
|
|
231
|
-
httpMethod: 'PUT',
|
|
232
|
-
aliases: {
|
|
233
|
-
namespacedName: 'setAdminsOnly',
|
|
234
|
-
},
|
|
235
|
-
},
|
|
236
|
-
input: z.object({
|
|
237
|
-
groupId: groupIdParam,
|
|
238
|
-
onlyAdmins: z.boolean().describe('Admins only setting'),
|
|
239
|
-
}),
|
|
240
|
-
parameterOrder: ['groupId', 'onlyAdmins'],
|
|
241
|
-
output: z.boolean(),
|
|
242
|
-
});
|
|
243
|
-
|
|
244
|
-
export const setGroupEditToAdminsOnly = defineMethodV2('setGroupEditToAdminsOnly', {
|
|
245
|
-
meta: {
|
|
246
|
-
description: 'Restrict group editing to admins only',
|
|
247
|
-
action: 'update',
|
|
248
|
-
namespace: 'groups',
|
|
249
|
-
license: 'none',
|
|
250
|
-
functionality: 'both',
|
|
251
|
-
httpMethod: 'PUT',
|
|
252
|
-
aliases: {
|
|
253
|
-
namespacedName: 'setEditAdminsOnly',
|
|
254
|
-
},
|
|
255
|
-
},
|
|
256
|
-
input: z.object({
|
|
257
|
-
groupId: groupIdParam,
|
|
258
|
-
onlyAdmins: z.boolean().describe('Admins only setting'),
|
|
259
|
-
}),
|
|
260
|
-
parameterOrder: ['groupId', 'onlyAdmins'],
|
|
261
|
-
output: z.boolean(),
|
|
262
|
-
});
|
|
263
|
-
|
|
264
|
-
export const addParticipant = defineMethodV2('addParticipant', {
|
|
265
|
-
meta: {
|
|
266
|
-
description: 'Add participant to group',
|
|
267
|
-
action: 'update',
|
|
268
|
-
namespace: 'groups',
|
|
269
|
-
license: 'none',
|
|
270
|
-
functionality: 'both',
|
|
271
|
-
httpMethod: 'PUT',
|
|
272
|
-
aliases: {
|
|
273
|
-
explicit: ['addGroupParticipant'],
|
|
274
|
-
},
|
|
275
|
-
},
|
|
276
|
-
input: z.object({
|
|
277
|
-
groupId: groupIdParam,
|
|
278
|
-
contactId: contactIdParam,
|
|
279
|
-
}),
|
|
280
|
-
parameterOrder: ['groupId', 'contactId'],
|
|
281
|
-
output: z.boolean(),
|
|
282
|
-
});
|
|
283
|
-
|
|
284
|
-
export const removeParticipant = defineMethodV2('removeParticipant', {
|
|
285
|
-
meta: {
|
|
286
|
-
description: 'Remove participant from group',
|
|
287
|
-
action: 'update',
|
|
288
|
-
namespace: 'groups',
|
|
289
|
-
license: 'none',
|
|
290
|
-
functionality: 'both',
|
|
291
|
-
httpMethod: 'PUT',
|
|
292
|
-
aliases: {
|
|
293
|
-
explicit: ['removeGroupParticipant'],
|
|
294
|
-
},
|
|
295
|
-
},
|
|
296
|
-
input: z.object({
|
|
297
|
-
groupId: groupIdParam,
|
|
298
|
-
contactId: contactIdParam,
|
|
299
|
-
}),
|
|
300
|
-
parameterOrder: ['groupId', 'contactId'],
|
|
301
|
-
output: z.boolean(),
|
|
302
|
-
});
|
|
303
|
-
|
|
304
|
-
export const promoteParticipant = defineMethodV2('promoteParticipant', {
|
|
305
|
-
meta: {
|
|
306
|
-
description: 'Promote participant to admin',
|
|
307
|
-
action: 'update',
|
|
308
|
-
namespace: 'groups',
|
|
309
|
-
license: 'none',
|
|
310
|
-
functionality: 'both',
|
|
311
|
-
httpMethod: 'PUT',
|
|
312
|
-
aliases: {
|
|
313
|
-
explicit: ['promoteGroupParticipant'],
|
|
314
|
-
},
|
|
315
|
-
},
|
|
316
|
-
input: z.object({
|
|
317
|
-
groupId: groupIdParam,
|
|
318
|
-
contactId: contactIdParam,
|
|
319
|
-
}),
|
|
320
|
-
parameterOrder: ['groupId', 'contactId'],
|
|
321
|
-
output: z.union([z.boolean(), z.string()]),
|
|
322
|
-
});
|
|
323
|
-
|
|
324
|
-
export const demoteParticipant = defineMethodV2('demoteParticipant', {
|
|
325
|
-
meta: {
|
|
326
|
-
description: 'Demote participant from admin',
|
|
327
|
-
action: 'update',
|
|
328
|
-
namespace: 'groups',
|
|
329
|
-
license: 'none',
|
|
330
|
-
functionality: 'both',
|
|
331
|
-
httpMethod: 'PUT',
|
|
332
|
-
aliases: {
|
|
333
|
-
explicit: ['demoteGroupParticipant'],
|
|
334
|
-
},
|
|
335
|
-
},
|
|
336
|
-
input: z.object({
|
|
337
|
-
groupId: groupIdParam,
|
|
338
|
-
contactId: contactIdParam,
|
|
339
|
-
}),
|
|
340
|
-
parameterOrder: ['groupId', 'contactId'],
|
|
341
|
-
output: z.union([z.boolean(), z.string()]),
|
|
342
|
-
});
|
|
343
|
-
|
|
344
|
-
export const approveGroupJoinRequest = defineMethodV2('approveGroupJoinRequest', {
|
|
345
|
-
meta: {
|
|
346
|
-
description: 'Approve group join request',
|
|
347
|
-
action: 'update',
|
|
348
|
-
namespace: 'groups',
|
|
349
|
-
license: 'none',
|
|
350
|
-
functionality: 'both',
|
|
351
|
-
httpMethod: 'PUT',
|
|
352
|
-
},
|
|
353
|
-
input: z.object({
|
|
354
|
-
groupId: groupIdParam,
|
|
355
|
-
contactId: contactIdParam,
|
|
356
|
-
}),
|
|
357
|
-
parameterOrder: ['groupId', 'contactId'],
|
|
358
|
-
output: z.union([z.string(), z.boolean()]),
|
|
359
|
-
});
|
|
360
|
-
|
|
361
|
-
export const rejectGroupJoinRequest = defineMethodV2('rejectGroupJoinRequest', {
|
|
362
|
-
meta: {
|
|
363
|
-
description: 'Reject group join request',
|
|
364
|
-
action: 'update',
|
|
365
|
-
namespace: 'groups',
|
|
366
|
-
license: 'none',
|
|
367
|
-
functionality: 'both',
|
|
368
|
-
httpMethod: 'PUT',
|
|
369
|
-
},
|
|
370
|
-
input: z.object({
|
|
371
|
-
groupId: groupIdParam,
|
|
372
|
-
contactId: contactIdParam,
|
|
373
|
-
}),
|
|
374
|
-
parameterOrder: ['groupId', 'contactId'],
|
|
375
|
-
output: z.union([z.string(), z.boolean()]),
|
|
376
|
-
});
|
package/src/methods/index.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
// ============================================================================
|
|
2
|
-
// Method Exports
|
|
3
|
-
// ============================================================================
|
|
4
|
-
|
|
5
|
-
// Messaging Methods
|
|
6
|
-
export * from './messaging';
|
|
7
|
-
|
|
8
|
-
// Chat Methods
|
|
9
|
-
export * from './chats';
|
|
10
|
-
|
|
11
|
-
// Contact Methods
|
|
12
|
-
export * from './contacts';
|
|
13
|
-
|
|
14
|
-
// Group Methods
|
|
15
|
-
export * from './groups';
|
|
16
|
-
|
|
17
|
-
// Community Methods
|
|
18
|
-
export * from './communities';
|
|
19
|
-
|
|
20
|
-
// Status/Story Methods
|
|
21
|
-
export * from './status';
|
|
22
|
-
|
|
23
|
-
// Label Methods
|
|
24
|
-
export * from './labels';
|
|
25
|
-
|
|
26
|
-
// Business Methods
|
|
27
|
-
export * from './business';
|
|
28
|
-
|
|
29
|
-
// Session Methods
|
|
30
|
-
export * from './session';
|
|
31
|
-
|
|
32
|
-
// Media Methods
|
|
33
|
-
export * from './media';
|
package/src/methods/labels.ts
DELETED
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { defineMethodV2 } from '../registry';
|
|
3
|
-
import { toParam } from '../parameters';
|
|
4
|
-
|
|
5
|
-
// ============================================================================
|
|
6
|
-
// Label Methods
|
|
7
|
-
// ============================================================================
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Get all labels
|
|
11
|
-
*/
|
|
12
|
-
export const getAllLabels = defineMethodV2('getAllLabels', {
|
|
13
|
-
meta: {
|
|
14
|
-
description: 'Get all labels',
|
|
15
|
-
action: 'read',
|
|
16
|
-
namespace: 'labels',
|
|
17
|
-
license: 'none',
|
|
18
|
-
functionality: 'business-only',
|
|
19
|
-
httpMethod: 'GET',
|
|
20
|
-
},
|
|
21
|
-
input: z.object({}),
|
|
22
|
-
parameterOrder: [],
|
|
23
|
-
output: z.array(z.any())
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Get chats by label
|
|
28
|
-
*/
|
|
29
|
-
export const getChatsByLabel = defineMethodV2('getChatsByLabel', {
|
|
30
|
-
meta: {
|
|
31
|
-
description: 'Get chats by label',
|
|
32
|
-
action: 'read',
|
|
33
|
-
namespace: 'labels',
|
|
34
|
-
license: 'none',
|
|
35
|
-
functionality: 'business-only',
|
|
36
|
-
httpMethod: 'GET',
|
|
37
|
-
aliases: {
|
|
38
|
-
namespacedName: 'getChats',
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
input: z.object({
|
|
42
|
-
label: z.string().describe('Label name')
|
|
43
|
-
}),
|
|
44
|
-
parameterOrder: ['label'],
|
|
45
|
-
output: z.array(z.any())
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Add label
|
|
50
|
-
*/
|
|
51
|
-
export const addLabel = defineMethodV2('addLabel', {
|
|
52
|
-
meta: {
|
|
53
|
-
description: 'Add label to chat',
|
|
54
|
-
action: 'update',
|
|
55
|
-
namespace: 'labels',
|
|
56
|
-
license: 'none',
|
|
57
|
-
functionality: 'business-only',
|
|
58
|
-
httpMethod: 'PUT',
|
|
59
|
-
},
|
|
60
|
-
input: z.object({
|
|
61
|
-
label: z.string().describe('Label ID or name'),
|
|
62
|
-
chatId: toParam
|
|
63
|
-
}),
|
|
64
|
-
parameterOrder: ['label', 'chatId'],
|
|
65
|
-
output: z.boolean()
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Remove label
|
|
70
|
-
*/
|
|
71
|
-
export const removeLabel = defineMethodV2('removeLabel', {
|
|
72
|
-
meta: {
|
|
73
|
-
description: 'Remove label from chat',
|
|
74
|
-
action: 'update',
|
|
75
|
-
namespace: 'labels',
|
|
76
|
-
license: 'none',
|
|
77
|
-
functionality: 'business-only',
|
|
78
|
-
httpMethod: 'PUT',
|
|
79
|
-
},
|
|
80
|
-
input: z.object({
|
|
81
|
-
label: z.string().describe('Label ID or name'),
|
|
82
|
-
chatId: toParam
|
|
83
|
-
}),
|
|
84
|
-
parameterOrder: ['label', 'chatId'],
|
|
85
|
-
output: z.boolean()
|
|
86
|
-
});
|
package/src/methods/media.ts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { defineMethodV2 } from '../registry';
|
|
3
|
-
import { MessageSchema } from '../common-types';
|
|
4
|
-
|
|
5
|
-
export const decryptMedia = defineMethodV2('decryptMedia', {
|
|
6
|
-
meta: {
|
|
7
|
-
description: 'Decrypts media from a message',
|
|
8
|
-
action: 'read',
|
|
9
|
-
namespace: 'media',
|
|
10
|
-
license: 'none',
|
|
11
|
-
functionality: 'both',
|
|
12
|
-
httpMethod: 'POST',
|
|
13
|
-
},
|
|
14
|
-
input: z.object({
|
|
15
|
-
message: MessageSchema.describe('Message object containing media'),
|
|
16
|
-
}),
|
|
17
|
-
parameterOrder: ['message'],
|
|
18
|
-
output: z.string().describe('Base64 encoded decrypted media'),
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
export const downloadMedia = defineMethodV2('downloadMedia', {
|
|
22
|
-
meta: {
|
|
23
|
-
description: 'Downloads and decrypts media from a message to a file',
|
|
24
|
-
action: 'read',
|
|
25
|
-
namespace: 'media',
|
|
26
|
-
license: 'none',
|
|
27
|
-
functionality: 'both',
|
|
28
|
-
httpMethod: 'POST',
|
|
29
|
-
},
|
|
30
|
-
input: z.object({
|
|
31
|
-
message: MessageSchema.describe('Message object containing media'),
|
|
32
|
-
path: z.string().describe('File path to save the media'),
|
|
33
|
-
}),
|
|
34
|
-
parameterOrder: ['message', 'path'],
|
|
35
|
-
output: z.string().describe('Path to the saved file'),
|
|
36
|
-
});
|