@open-wa/schema 5.3.0 → 5.5.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 (74) hide show
  1. package/dist/calling-media--BLrFrPc.cjs +113 -0
  2. package/dist/calling-media--BLrFrPc.cjs.map +1 -0
  3. package/dist/calling-media-BNTYvogE.mjs +60 -0
  4. package/dist/calling-media-BNTYvogE.mjs.map +1 -0
  5. package/dist/calling-media-CeGgSzhw.d.cts +48 -0
  6. package/dist/calling-media-CeGgSzhw.d.cts.map +1 -0
  7. package/dist/calling-media-CeGgSzhw.d.mts +48 -0
  8. package/dist/calling-media-CeGgSzhw.d.mts.map +1 -0
  9. package/dist/calling-media.cjs +8 -0
  10. package/dist/calling-media.d.cts +2 -0
  11. package/dist/calling-media.d.mts +2 -0
  12. package/dist/calling-media.mjs +2 -0
  13. package/dist/generated/index.cjs +94 -3
  14. package/dist/generated/index.cjs.map +1 -1
  15. package/dist/generated/index.d.cts +2328 -133
  16. package/dist/generated/index.d.cts.map +1 -1
  17. package/dist/generated/index.d.mts +2328 -133
  18. package/dist/generated/index.d.mts.map +1 -1
  19. package/dist/generated/index.mjs +94 -3
  20. package/dist/generated/index.mjs.map +1 -1
  21. package/dist/{index-C9Ad0lEr.d.cts → index-BWvNXopK.d.cts} +2375 -41
  22. package/dist/index-BWvNXopK.d.cts.map +1 -0
  23. package/dist/{index-D0QN2PaW.d.mts → index-Co8HQxm8.d.mts} +2375 -41
  24. package/dist/index-Co8HQxm8.d.mts.map +1 -0
  25. package/dist/index.cjs +191 -20
  26. package/dist/index.cjs.map +1 -1
  27. package/dist/index.d.cts +3 -2
  28. package/dist/index.d.mts +3 -2
  29. package/dist/index.mjs +105 -21
  30. package/dist/index.mjs.map +1 -1
  31. package/dist/methods/index.cjs +34 -1
  32. package/dist/methods/index.d.cts +2 -2
  33. package/dist/methods/index.d.mts +2 -2
  34. package/dist/methods/index.mjs +2 -2
  35. package/dist/{methods-BhLsQNtL.mjs → methods-BH7nDC3z.mjs} +816 -51
  36. package/dist/methods-BH7nDC3z.mjs.map +1 -0
  37. package/dist/{methods-BGmdzjd3.cjs → methods-DpDzgsbe.cjs} +1284 -63
  38. package/dist/methods-DpDzgsbe.cjs.map +1 -0
  39. package/package.json +15 -4
  40. package/src/calling-media.ts +64 -0
  41. package/src/calling-wire.ts +17 -0
  42. package/src/calling.ts +61 -0
  43. package/src/common-types.ts +16 -0
  44. package/src/effect-projection.ts +67 -0
  45. package/src/events/calls.ts +12 -0
  46. package/src/events/groups.ts +30 -6
  47. package/src/events/index.ts +4 -0
  48. package/src/events/messaging.ts +7 -7
  49. package/src/events/polls.ts +11 -0
  50. package/src/events/registry.ts +2 -1
  51. package/src/events/whatsapp-events.ts +13 -0
  52. package/src/generated/AliasMap.ts +30 -1
  53. package/src/generated/BaseClient.ts +153 -8
  54. package/src/generated/BaseNamespacedClient.ts +36 -1
  55. package/src/generated/openapi.json +22999 -12765
  56. package/src/generated/types.ts +87 -0
  57. package/src/index.ts +10 -0
  58. package/src/license.ts +10 -0
  59. package/src/media-options.ts +46 -0
  60. package/src/methods/calls.ts +23 -0
  61. package/src/methods/contacts.ts +10 -1
  62. package/src/methods/groups.ts +9 -3
  63. package/src/methods/index.ts +2 -0
  64. package/src/methods/messaging.ts +159 -45
  65. package/src/methods/session.ts +10 -0
  66. package/src/methods/whatsapp-events.ts +35 -0
  67. package/src/polls.ts +37 -0
  68. package/src/session-refresh.ts +15 -0
  69. package/src/whatsapp-event-registry.ts +17 -0
  70. package/src/whatsapp-events.ts +91 -0
  71. package/dist/index-C9Ad0lEr.d.cts.map +0 -1
  72. package/dist/index-D0QN2PaW.d.mts.map +0 -1
  73. package/dist/methods-BGmdzjd3.cjs.map +0 -1
  74. package/dist/methods-BhLsQNtL.mjs.map +0 -1
@@ -1,6 +1,185 @@
1
1
  const require_registry = require("./registry-_s9a7_jl.cjs");
2
2
  let zod = require("zod");
3
+ let effect = require("effect");
3
4
  let _open_wa_utils = require("@open-wa/utils");
5
+ //#region src/effect-projection.ts
6
+ /** Project Effect contracts into the serving method and listener registry. */
7
+ function projectEffectSchema(schema) {
8
+ if ("fields" in schema) {
9
+ const fields = schema.fields;
10
+ const shape = Object.fromEntries(Object.entries(fields).map(([name, field]) => {
11
+ const optional = field.ast.context?.isOptional === true;
12
+ const hasUndefined = field.ast._tag === "Union" && field.ast.types.some((member) => member._tag === "Undefined");
13
+ const value = projectEffectSchema(!optional ? field : hasUndefined ? effect.Schema.required(field) : effect.Schema.requiredKey(field));
14
+ return [name, optional ? value.optional() : value];
15
+ }));
16
+ return zod.z.object(shape);
17
+ }
18
+ const document = effect.Schema.toJsonSchemaDocument(schema);
19
+ const project = (node) => {
20
+ if (node.$ref) {
21
+ const key = node.$ref.split("/").at(-1);
22
+ return project(document.definitions[key]);
23
+ }
24
+ if ("const" in node) return zod.z.literal(node.const);
25
+ if (node.enum) return zod.z.union(node.enum.map((value) => zod.z.literal(value)));
26
+ const members = node.anyOf ?? node.oneOf;
27
+ if (members) return zod.z.union(members.map(project));
28
+ switch (node.type) {
29
+ case "string": {
30
+ let value = zod.z.string();
31
+ if (node.minLength !== void 0) value = value.min(node.minLength);
32
+ if (node.maxLength !== void 0) value = value.max(node.maxLength);
33
+ return value;
34
+ }
35
+ case "number":
36
+ case "integer": {
37
+ let value = node.type === "integer" ? zod.z.number().int() : zod.z.number();
38
+ if (node.minimum !== void 0) value = value.min(node.minimum);
39
+ if (node.maximum !== void 0) value = value.max(node.maximum);
40
+ if (node.exclusiveMinimum !== void 0) value = value.gt(node.exclusiveMinimum);
41
+ if (node.exclusiveMaximum !== void 0) value = value.lt(node.exclusiveMaximum);
42
+ return value;
43
+ }
44
+ case "boolean": return zod.z.boolean();
45
+ case "null": return zod.z.null();
46
+ case "array": return zod.z.array(project(node.items ?? {}));
47
+ case "object": {
48
+ const properties = node.properties ?? {};
49
+ const values = typeof node.additionalProperties === "object" ? project(node.additionalProperties) : node.additionalProperties ? zod.z.unknown() : void 0;
50
+ if (!Object.keys(properties).length && values) return zod.z.record(zod.z.string(), values);
51
+ const required = new Set(node.required ?? []);
52
+ const object = zod.z.object(Object.fromEntries(Object.entries(properties).map(([key, value]) => {
53
+ const field = project(value);
54
+ return [key, required.has(key) ? field : field.optional()];
55
+ })));
56
+ return values ? object.catchall(values) : object;
57
+ }
58
+ default: return zod.z.unknown();
59
+ }
60
+ };
61
+ return project(document.schema);
62
+ }
63
+ //#endregion
64
+ //#region src/whatsapp-events.ts
65
+ const id$1 = effect.Schema.String.check(effect.Schema.isMinLength(1));
66
+ const seconds = effect.Schema.Number.check(effect.Schema.isInt(), effect.Schema.isGreaterThanOrEqualTo(0), effect.Schema.isLessThanOrEqualTo(2147483647));
67
+ const milliseconds = effect.Schema.Number.check(effect.Schema.isInt(), effect.Schema.isGreaterThanOrEqualTo(0));
68
+ /** Native WhatsApp event input. All event times are Unix seconds. */
69
+ const EventInputSchema = effect.Schema.Struct({
70
+ name: effect.Schema.String.check(effect.Schema.isMinLength(1)),
71
+ startTime: seconds,
72
+ endTime: effect.Schema.optional(seconds),
73
+ description: effect.Schema.optional(effect.Schema.String),
74
+ location: effect.Schema.optional(effect.Schema.String),
75
+ extraGuestsAllowed: effect.Schema.optional(effect.Schema.Boolean),
76
+ callType: effect.Schema.optional(effect.Schema.Literals(["voice", "video"])),
77
+ isScheduledCall: effect.Schema.optional(effect.Schema.Boolean),
78
+ requireApproval: effect.Schema.optional(effect.Schema.Boolean),
79
+ quotedMsgId: effect.Schema.optional(id$1)
80
+ });
81
+ function validateEventInput(input) {
82
+ const event = effect.Schema.decodeUnknownSync(EventInputSchema)(input);
83
+ if (!event.name.trim()) throw new Error("An event needs a name.");
84
+ if (event.endTime !== void 0 && event.endTime < event.startTime) throw new Error("Event endTime must be at or after startTime.");
85
+ if (event.isScheduledCall && !event.callType) throw new Error("A scheduled call needs a callType.");
86
+ return event;
87
+ }
88
+ const EventUpdateSchema = effect.Schema.Struct({
89
+ name: effect.Schema.optional(effect.Schema.String.check(effect.Schema.isMinLength(1))),
90
+ startTime: effect.Schema.optional(seconds),
91
+ endTime: effect.Schema.optional(effect.Schema.NullOr(seconds)),
92
+ description: effect.Schema.optional(effect.Schema.String),
93
+ location: effect.Schema.optional(effect.Schema.String)
94
+ });
95
+ function validateEventUpdate(input) {
96
+ const changes = effect.Schema.decodeUnknownSync(EventUpdateSchema)(input);
97
+ if (changes.name !== void 0 && !changes.name.trim()) throw new Error("An event needs a name.");
98
+ if (changes.startTime !== void 0 && changes.endTime != null && changes.endTime < changes.startTime) throw new Error("Event endTime must be at or after startTime.");
99
+ return changes;
100
+ }
101
+ /** A JSON-safe event snapshot. Message secrets and encrypted RSVP data stay private. */
102
+ const WhatsAppEventSchema = effect.Schema.Struct({
103
+ id: id$1,
104
+ chatId: id$1,
105
+ creatorId: id$1,
106
+ name: effect.Schema.String,
107
+ startTime: seconds,
108
+ endTime: effect.Schema.optional(seconds),
109
+ description: effect.Schema.optional(effect.Schema.String),
110
+ location: effect.Schema.optional(effect.Schema.Struct({
111
+ name: effect.Schema.optional(effect.Schema.String),
112
+ latitude: effect.Schema.optional(effect.Schema.Number.check(effect.Schema.isGreaterThanOrEqualTo(-90), effect.Schema.isLessThanOrEqualTo(90))),
113
+ longitude: effect.Schema.optional(effect.Schema.Number.check(effect.Schema.isGreaterThanOrEqualTo(-180), effect.Schema.isLessThanOrEqualTo(180)))
114
+ })),
115
+ joinLink: effect.Schema.optional(effect.Schema.String),
116
+ isScheduledCall: effect.Schema.optional(effect.Schema.Boolean),
117
+ extraGuestsAllowed: effect.Schema.optional(effect.Schema.Boolean),
118
+ isCanceled: effect.Schema.Boolean,
119
+ fromMe: effect.Schema.Boolean,
120
+ timestamp: seconds
121
+ });
122
+ const EventResponseTypeSchema = effect.Schema.Literals([
123
+ "going",
124
+ "notGoing",
125
+ "maybe",
126
+ "unknown"
127
+ ]);
128
+ const EventResponseSchema = effect.Schema.Struct({
129
+ id: id$1,
130
+ eventId: id$1,
131
+ chatId: id$1,
132
+ senderId: id$1,
133
+ response: EventResponseTypeSchema,
134
+ /** Sender's monotonically increasing RSVP timestamp, in milliseconds. */
135
+ timestamp: milliseconds,
136
+ fromMe: effect.Schema.Boolean
137
+ });
138
+ const EventListOptionsSchema = effect.Schema.Struct({
139
+ limit: effect.Schema.optional(effect.Schema.Number.check(effect.Schema.isInt(), effect.Schema.isGreaterThanOrEqualTo(1), effect.Schema.isLessThanOrEqualTo(100))),
140
+ before: effect.Schema.optional(id$1)
141
+ });
142
+ const EventPageSchema = effect.Schema.Struct({
143
+ events: effect.Schema.Array(WhatsAppEventSchema),
144
+ nextCursor: effect.Schema.NullOr(id$1)
145
+ });
146
+ const decodeWhatsAppEvent = effect.Schema.decodeUnknownSync(WhatsAppEventSchema);
147
+ const decodeEventResponse = effect.Schema.decodeUnknownSync(EventResponseSchema);
148
+ const serializeWhatsAppEvent = (event) => JSON.stringify(effect.Schema.encodeSync(WhatsAppEventSchema)(event));
149
+ const deserializeWhatsAppEvent = (json) => decodeWhatsAppEvent(JSON.parse(json));
150
+ const serializeEventResponse = (response) => JSON.stringify(effect.Schema.encodeSync(EventResponseSchema)(response));
151
+ const deserializeEventResponse = (json) => decodeEventResponse(JSON.parse(json));
152
+ //#endregion
153
+ //#region src/whatsapp-event-registry.ts
154
+ const EventInputRegistrySchema = projectEffectSchema(EventInputSchema).superRefine((value, ctx) => {
155
+ try {
156
+ validateEventInput(value);
157
+ } catch (error) {
158
+ ctx.addIssue({
159
+ code: "custom",
160
+ message: String(error)
161
+ });
162
+ }
163
+ }).meta({ examples: [{
164
+ name: "Community meetup",
165
+ startTime: 1893456e3,
166
+ description: "Meet the community"
167
+ }] });
168
+ const EventUpdateRegistrySchema = projectEffectSchema(EventUpdateSchema).superRefine((value, ctx) => {
169
+ try {
170
+ validateEventUpdate(value);
171
+ } catch (error) {
172
+ ctx.addIssue({
173
+ code: "custom",
174
+ message: String(error)
175
+ });
176
+ }
177
+ }).meta({ examples: [{ description: "Updated meetup details" }] });
178
+ const WhatsAppEventRegistrySchema = projectEffectSchema(WhatsAppEventSchema);
179
+ const EventResponseRegistrySchema = projectEffectSchema(EventResponseSchema);
180
+ const EventListOptionsRegistrySchema = projectEffectSchema(EventListOptionsSchema);
181
+ const EventPageRegistrySchema = projectEffectSchema(EventPageSchema);
182
+ //#endregion
4
183
  //#region src/common-types.ts
5
184
  const ContactIdSchema$1 = zod.z.string().brand("ContactId").describe("Opaque WhatsApp contact identifier. Preserve the exact value returned by the API.");
6
185
  const ChatIdSchema$1 = zod.z.string().brand("ChatId").describe("Opaque conversation identifier. Use the exact value returned by a message event or chat lookup.");
@@ -40,6 +219,9 @@ let MessageTypes = /* @__PURE__ */ function(MessageTypes) {
40
219
  MessageTypes["VOICE"] = "ptt";
41
220
  MessageTypes["IMAGE"] = "image";
42
221
  MessageTypes["VIDEO"] = "video";
222
+ MessageTypes["ALBUM"] = "album";
223
+ MessageTypes["EVENT_CREATION"] = "event_creation";
224
+ MessageTypes["EVENT_RESPONSE"] = "event_response";
43
225
  MessageTypes["DOCUMENT"] = "document";
44
226
  MessageTypes["STICKER"] = "sticker";
45
227
  MessageTypes["LOCATION"] = "location";
@@ -65,6 +247,8 @@ let MessageAck = /* @__PURE__ */ function(MessageAck) {
65
247
  * An enum of all the "simple listeners". A simple listener is a listener that just takes one parameter which is the callback function to handle the event.
66
248
  */
67
249
  let SimpleListener = /* @__PURE__ */ function(SimpleListener) {
250
+ SimpleListener["Event"] = "onEvent";
251
+ SimpleListener["EventResponse"] = "onEventResponse";
68
252
  /**
69
253
  * Represents [[onMessage]]
70
254
  */
@@ -165,6 +349,12 @@ const MessageSchemaBase = zod.z.object({
165
349
  labels: zod.z.array(zod.z.string()).optional(),
166
350
  mentionedJidList: zod.z.array(ContactIdSchema$1).optional(),
167
351
  caption: zod.z.string().optional(),
352
+ event: WhatsAppEventRegistrySchema.optional(),
353
+ expectedImageCount: zod.z.number().int().nonnegative().nullable().optional().describe("Number of image messages declared by an album container; not a received-media count."),
354
+ expectedVideoCount: zod.z.number().int().nonnegative().nullable().optional().describe("Number of video messages declared by an album container, including GIF videos."),
355
+ parentMsgKey: MessageIdSchema$1.nullable().optional().describe("Serialized parent message ID for associated media."),
356
+ associationType: zod.z.string().nullable().optional().describe("WhatsApp association type. Album media uses MEDIA_ALBUM."),
357
+ isGif: zod.z.boolean().optional(),
168
358
  sender: zod.z.any(),
169
359
  timestamp: zod.z.number(),
170
360
  content: zod.z.string(),
@@ -434,6 +624,117 @@ const StorySchema = MessageSchema.omit({
434
624
  sender: ContactSchema.nullable().optional()
435
625
  }).describe("Message-shaped status entry, based on the legacy story API. Chat and sender may be absent or null. The licensed getStories payload has not been verified against this model.");
436
626
  //#endregion
627
+ //#region src/media-options.ts
628
+ const quote = { quotedMsgId: MessageIdSchema$1.optional().describe("A message in the destination chat to quote") };
629
+ const caption = { caption: zod.z.string().optional().describe("Caption for the attachment") };
630
+ const viewOnce = { viewOnce: zod.z.boolean().optional().describe("Use WhatsApp view-once media") };
631
+ const ImageSendOptionsSchema = zod.z.strictObject({
632
+ type: zod.z.literal("image"),
633
+ ...caption,
634
+ ...quote,
635
+ ...viewOnce
636
+ });
637
+ const VideoSendOptionsSchema = zod.z.strictObject({
638
+ type: zod.z.literal("video"),
639
+ ...caption,
640
+ ...quote,
641
+ ...viewOnce,
642
+ isGif: zod.z.boolean().optional().describe("Loop an MP4 as a WhatsApp GIF"),
643
+ videoNote: zod.z.boolean().optional().describe("Send a square MP4, at most 60 seconds, as a circular video note (PTV)")
644
+ }).superRefine((options, ctx) => {
645
+ if (options.videoNote && options.isGif) ctx.addIssue({
646
+ code: "custom",
647
+ path: ["isGif"],
648
+ message: "A video note cannot also be a GIF"
649
+ });
650
+ if (options.isGif && options.viewOnce) ctx.addIssue({
651
+ code: "custom",
652
+ path: ["viewOnce"],
653
+ message: "A GIF cannot be view once"
654
+ });
655
+ if (options.videoNote && options.caption) ctx.addIssue({
656
+ code: "custom",
657
+ path: ["caption"],
658
+ message: "Video notes do not support captions"
659
+ });
660
+ });
661
+ const AudioSendOptionsSchema = zod.z.strictObject({
662
+ type: zod.z.literal("audio"),
663
+ ...quote,
664
+ ...viewOnce,
665
+ ptt: zod.z.boolean().optional().describe("Send audio as a voice note; does not transcode it")
666
+ }).refine((options) => !options.viewOnce || options.ptt === true, {
667
+ path: ["viewOnce"],
668
+ message: "View-once audio must be a voice note (ptt: true)"
669
+ });
670
+ const DocumentSendOptionsSchema = zod.z.strictObject({
671
+ type: zod.z.literal("document"),
672
+ ...caption,
673
+ ...quote
674
+ }).describe("Force document presentation, even for an image, video or audio file");
675
+ const AutoMediaSendOptionsSchema = zod.z.strictObject({
676
+ type: zod.z.literal("auto").optional(),
677
+ ...caption,
678
+ ...quote,
679
+ ...viewOnce
680
+ }).describe("Detect presentation from the file MIME type; view once requires an image or video");
681
+ const MediaSendOptionsSchema = zod.z.discriminatedUnion("type", [
682
+ AutoMediaSendOptionsSchema,
683
+ ImageSendOptionsSchema,
684
+ VideoSendOptionsSchema,
685
+ AudioSendOptionsSchema,
686
+ DocumentSendOptionsSchema
687
+ ]);
688
+ const AudioAttachmentOptionsSchema = zod.z.strictObject({ ...quote });
689
+ const VoiceNoteOptionsSchema = zod.z.strictObject({
690
+ ...quote,
691
+ ...viewOnce
692
+ });
693
+ const GifSendOptionsSchema = zod.z.strictObject({
694
+ ...caption,
695
+ ...quote
696
+ });
697
+ //#endregion
698
+ //#region src/polls.ts
699
+ const PollSendOptionsSchema = zod.z.strictObject({
700
+ selectableCount: zod.z.number().int().min(0).optional().describe("Selection limit; default 1, zero allows all options"),
701
+ quotedMsgId: MessageIdSchema$1.optional(),
702
+ endTime: zod.z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER).optional().describe("Closing time as Unix milliseconds; must be in the future"),
703
+ hideVoterNames: zod.z.boolean().optional().describe("Hide voter names in WhatsApp; not a cryptographic anonymity guarantee")
704
+ });
705
+ const PollVoteSchema = zod.z.strictObject({
706
+ pollId: MessageIdSchema$1,
707
+ chatId: ChatIdSchema$1,
708
+ id: MessageIdSchema$1.optional().describe("Omitted when the poll hides voter names"),
709
+ senderId: ContactIdSchema$1.optional().describe("Omitted when the poll hides voter names"),
710
+ selectedOptionIds: zod.z.array(zod.z.number().int().nonnegative()),
711
+ timestamp: zod.z.number().int().nonnegative().describe("Native vote timestamp in Unix milliseconds"),
712
+ fromMe: zod.z.boolean(),
713
+ hideVoterNames: zod.z.boolean()
714
+ });
715
+ const PollResultsSchema = zod.z.strictObject({
716
+ pollId: MessageIdSchema$1,
717
+ chatId: ChatIdSchema$1,
718
+ name: zod.z.string(),
719
+ selectableCount: zod.z.number().int().nonnegative(),
720
+ endTime: zod.z.number().int().nonnegative().optional(),
721
+ isClosed: zod.z.boolean(),
722
+ hideVoterNames: zod.z.boolean(),
723
+ options: zod.z.array(zod.z.strictObject({
724
+ id: zod.z.number().int().nonnegative(),
725
+ name: zod.z.string(),
726
+ count: zod.z.number().int().nonnegative()
727
+ })),
728
+ voterCount: zod.z.number().int().nonnegative(),
729
+ votes: zod.z.array(PollVoteSchema).optional().describe("Omitted for hidden-voter polls"),
730
+ scope: zod.z.literal("synced").describe("Hydrated local WhatsApp data, which may not include unsynced votes")
731
+ });
732
+ const PinDurationSchema = zod.z.enum([
733
+ "OneDay",
734
+ "SevenDays",
735
+ "ThirtyDays"
736
+ ]);
737
+ //#endregion
437
738
  //#region src/codecs.ts
438
739
  const chatIdPattern = /^\d+(-\d+)?@(c|g)\.us$|^\d+@lid$/;
439
740
  const contactIdPattern = /^\d+@c\.us$/;
@@ -655,6 +956,84 @@ const messageOptionsParam = zod.z.unknown().optional().describe("Reserved for co
655
956
  //#region src/methods/messaging.ts
656
957
  /** The normalized serialized message key returned by the public sendText client. */
657
958
  const SendTextResultSchema = zod.z.string().regex(/^(true|false)_[^\s_]+@[^\s_]+_[^\s]+$/).brand("MessageId").describe("Validated serialized message ID. This confirms the send returned an ID, not delivery or reading.");
959
+ const StickerJobSchema = zod.z.object({
960
+ effects: zod.z.array(zod.z.union([zod.z.string(), zod.z.object({
961
+ name: zod.z.string(),
962
+ options: zod.z.record(zod.z.string(), zod.z.unknown()).optional()
963
+ }).strict()])).max(8).optional(),
964
+ backend: zod.z.enum([
965
+ "auto",
966
+ "browser",
967
+ "standalone"
968
+ ]).optional().describe("Defaults to browser when it supports the entire job; otherwise the entire job runs standalone."),
969
+ quality: zod.z.number().min(.01).max(1).optional().describe("Maximum encoding quality; encoding can reduce quality to meet sticker byte limits."),
970
+ fit: zod.z.enum(["contain", "cover"]).optional(),
971
+ circle: zod.z.boolean().optional(),
972
+ background: zod.z.string().max(64).optional(),
973
+ trim: zod.z.tuple([zod.z.number().nonnegative(), zod.z.number().positive()]).refine(([start, end]) => end > start).optional(),
974
+ fps: zod.z.number().int().min(1).max(30).optional(),
975
+ loopCount: zod.z.number().int().min(0).max(65535).optional(),
976
+ author: zod.z.string().max(128).optional(),
977
+ pack: zod.z.string().max(128).optional(),
978
+ quotedMsgId: messageIdParam.optional().describe("Reply with the sticker to a loaded message in the destination chat.")
979
+ }).strict();
980
+ const sendSticker = require_registry.defineMethodV2("sendSticker", {
981
+ meta: {
982
+ description: "Render a sticker locally using automatic whole-job backend selection and ordered effects, then submit through the private donor finalizer. Author and pack labels are configurable; donor app links are owned by the installed patch. Returns a submitted message ID, not a delivery receipt. Unknown send outcomes must be reconciled before retrying.",
983
+ action: "send",
984
+ namespace: "messages",
985
+ license: "none",
986
+ functionality: "both",
987
+ httpMethod: "POST",
988
+ wapiOverride: "sendStickerJob"
989
+ },
990
+ input: zod.z.object({
991
+ to: toParam,
992
+ input: zod.z.string().regex(/^(?:data:(?:image|video)\/[^;,]+;base64,[A-Za-z0-9+/]+={0,2}|https?:\/\/\S+)$/).describe("A media data URL or HTTP(S) URL. The local library additionally accepts bytes, Blob and local filenames."),
993
+ job: StickerJobSchema.optional()
994
+ }),
995
+ parameterOrder: [
996
+ "to",
997
+ "input",
998
+ "job"
999
+ ],
1000
+ output: SendTextResultSchema
1001
+ });
1002
+ const AlbumMediaSchema = zod.z.object({
1003
+ file: zod.z.string().regex(/^data:(image|video)\/[^;,]+;base64,[A-Za-z0-9+/]+={0,2}$/).describe("Image or video as a base64 data URL. For a WhatsApp GIF, supply an MP4 video and set isGif to true."),
1004
+ filename: zod.z.string().min(1).describe("Filename including its extension"),
1005
+ isGif: zod.z.boolean().optional().describe("Send an MP4 video as a looping WhatsApp GIF")
1006
+ }).refine((media) => !media.isGif || media.file.startsWith("data:video/mp4;base64,"), {
1007
+ message: "GIF album items require MP4 video data",
1008
+ path: ["file"]
1009
+ });
1010
+ const AlbumSendResultSchema = zod.z.object({
1011
+ albumId: MessageIdSchema$1,
1012
+ messageIds: zod.z.array(MessageIdSchema$1).min(2)
1013
+ }).describe("Submitted album parent and child message IDs, in input order. Submission does not confirm recipient delivery. Runtime failures include the album ID and submitted child IDs when available. A lost connection can leave the send outcome unknown; inspect the chat before retrying.");
1014
+ const sendAlbum = require_registry.defineMethodV2("sendAlbum", {
1015
+ meta: {
1016
+ description: "Sends images and videos together as a native WhatsApp album with one caption on its first item. GIFs use MP4 video data with isGif: true. Documents are rejected. Phone-number IDs are resolved to LIDs; the destination chat must already be loaded and allow sending. WhatsApp controls the minimum item count and upload limits. Runtime failures include the parent and submitted child IDs when available; inspect the chat before retrying.",
1017
+ action: "send",
1018
+ namespace: "messages",
1019
+ license: "none",
1020
+ functionality: "both",
1021
+ httpMethod: "POST"
1022
+ },
1023
+ input: zod.z.object({
1024
+ to: toParam,
1025
+ media: zod.z.array(AlbumMediaSchema).min(2).describe("Album items in send order"),
1026
+ caption: captionParam.optional().default(""),
1027
+ quotedMsgId: messageIdParam.optional().describe("Message to quote on the first album item")
1028
+ }),
1029
+ parameterOrder: [
1030
+ "to",
1031
+ "media",
1032
+ "caption",
1033
+ "quotedMsgId"
1034
+ ],
1035
+ output: AlbumSendResultSchema
1036
+ });
658
1037
  /**
659
1038
  * Sends a text message to a chat
660
1039
  */
@@ -764,7 +1143,7 @@ const sendPaymentRequest = require_registry.defineMethodV2("sendPaymentRequest",
764
1143
  */
765
1144
  const sendImage = require_registry.defineMethodV2("sendImage", {
766
1145
  meta: {
767
- description: "Sends an image to a chat",
1146
+ description: "Sends media through the native attachment pipeline, including images and videos. Options select presentation, view once, GIF playback or circular video notes; media is not transcoded. Returns submission status, not a delivery receipt.",
768
1147
  action: "send",
769
1148
  namespace: "messages",
770
1149
  license: "none",
@@ -773,28 +1152,24 @@ const sendImage = require_registry.defineMethodV2("sendImage", {
773
1152
  },
774
1153
  input: zod.z.object({
775
1154
  to: toParam,
776
- imgData: imageDataParam,
777
- filename: filenameParam,
778
- caption: captionParam,
779
- id: messageIdParam.optional(),
780
- waitForId: waitForIdParam
1155
+ file: fileDataParam,
1156
+ filename: filenameParam.optional(),
1157
+ options: MediaSendOptionsSchema.optional().default({})
781
1158
  }),
782
1159
  parameterOrder: [
783
1160
  "to",
784
- "imgData",
1161
+ "file",
785
1162
  "filename",
786
- "caption",
787
- "id",
788
- "waitForId"
1163
+ "options"
789
1164
  ],
790
- output: MessageIdReturnSchema.or(zod.z.boolean()).or(zod.z.string())
1165
+ output: MessageIdReturnSchema.or(zod.z.boolean())
791
1166
  });
792
1167
  /**
793
1168
  * Sends a file/document
794
1169
  */
795
1170
  const sendFile = require_registry.defineMethodV2("sendFile", {
796
1171
  meta: {
797
- description: "Sends a file or document to a chat",
1172
+ description: "Sends an image, video, audio file or document using MIME detection or an explicit typed presentation. Incompatible options are rejected before sending. Media is not transcoded.",
798
1173
  action: "send",
799
1174
  namespace: "messages",
800
1175
  license: "none",
@@ -804,23 +1179,23 @@ const sendFile = require_registry.defineMethodV2("sendFile", {
804
1179
  input: zod.z.object({
805
1180
  to: toParam,
806
1181
  file: fileDataParam,
807
- filename: filenameParam,
808
- caption: captionParam
1182
+ filename: filenameParam.optional(),
1183
+ options: MediaSendOptionsSchema.optional().default({})
809
1184
  }),
810
1185
  parameterOrder: [
811
1186
  "to",
812
1187
  "file",
813
1188
  "filename",
814
- "caption"
1189
+ "options"
815
1190
  ],
816
- output: MessageIdReturnSchema.or(zod.z.string())
1191
+ output: MessageIdReturnSchema.or(zod.z.boolean())
817
1192
  });
818
1193
  /**
819
1194
  * Sends an audio file
820
1195
  */
821
1196
  const sendAudio = require_registry.defineMethodV2("sendAudio", {
822
1197
  meta: {
823
- description: "Sends an audio file to a chat",
1198
+ description: "Sends an audio attachment with an optional quoted message. Use sendPtt for voice notes and view-once audio.",
824
1199
  action: "send",
825
1200
  namespace: "messages",
826
1201
  license: "none",
@@ -830,14 +1205,14 @@ const sendAudio = require_registry.defineMethodV2("sendAudio", {
830
1205
  input: zod.z.object({
831
1206
  to: toParam,
832
1207
  file: audioDataParam,
833
- filename: filenameParam,
834
- quotedMsgId: messageIdParam.optional()
1208
+ filename: filenameParam.optional(),
1209
+ options: AudioAttachmentOptionsSchema.optional().default({})
835
1210
  }),
836
1211
  parameterOrder: [
837
1212
  "to",
838
1213
  "file",
839
1214
  "filename",
840
- "quotedMsgId"
1215
+ "options"
841
1216
  ],
842
1217
  output: MessageIdReturnSchema.or(zod.z.boolean())
843
1218
  });
@@ -846,7 +1221,7 @@ const sendAudio = require_registry.defineMethodV2("sendAudio", {
846
1221
  */
847
1222
  const sendPtt = require_registry.defineMethodV2("sendPtt", {
848
1223
  meta: {
849
- description: "Sends a voice note (push-to-talk) to a chat",
1224
+ description: "Sends prepared audio as a voice note, optionally view once. It does not transcode the input; use suitable voice-note audio such as Ogg Opus.",
850
1225
  action: "send",
851
1226
  namespace: "messages",
852
1227
  license: "none",
@@ -857,12 +1232,12 @@ const sendPtt = require_registry.defineMethodV2("sendPtt", {
857
1232
  input: zod.z.object({
858
1233
  to: toParam,
859
1234
  file: audioDataParam,
860
- quotedMsgId: messageIdParam.optional()
1235
+ options: VoiceNoteOptionsSchema.optional().default({})
861
1236
  }),
862
1237
  parameterOrder: [
863
1238
  "to",
864
1239
  "file",
865
- "quotedMsgId"
1240
+ "options"
866
1241
  ],
867
1242
  output: MessageIdReturnSchema.or(zod.z.boolean())
868
1243
  });
@@ -871,7 +1246,7 @@ const sendPtt = require_registry.defineMethodV2("sendPtt", {
871
1246
  */
872
1247
  const sendVideoAsGif = require_registry.defineMethodV2("sendVideoAsGif", {
873
1248
  meta: {
874
- description: "Sends a video as an animated GIF",
1249
+ description: "Sends MP4 video with WhatsApp GIF playback. GIF is a video presentation flag; this method does not convert a GIF image or transcode video.",
875
1250
  action: "send",
876
1251
  namespace: "messages",
877
1252
  license: "none",
@@ -881,16 +1256,14 @@ const sendVideoAsGif = require_registry.defineMethodV2("sendVideoAsGif", {
881
1256
  input: zod.z.object({
882
1257
  to: toParam,
883
1258
  file: videoDataParam,
884
- filename: filenameParam,
885
- caption: captionParam,
886
- quotedMsgId: messageIdParam.optional()
1259
+ filename: filenameParam.optional(),
1260
+ options: GifSendOptionsSchema.optional().default({})
887
1261
  }),
888
1262
  parameterOrder: [
889
1263
  "to",
890
1264
  "file",
891
1265
  "filename",
892
- "caption",
893
- "quotedMsgId"
1266
+ "options"
894
1267
  ],
895
1268
  output: MessageIdReturnSchema.or(zod.z.boolean())
896
1269
  });
@@ -948,7 +1321,7 @@ const sendVCard = require_registry.defineMethodV2("sendVCard", {
948
1321
  "contactName",
949
1322
  "contactNumber"
950
1323
  ],
951
- output: zod.z.boolean()
1324
+ output: MessageIdReturnSchema.or(zod.z.boolean())
952
1325
  });
953
1326
  /**
954
1327
  * Sends a contact
@@ -967,7 +1340,7 @@ const sendContact = require_registry.defineMethodV2("sendContact", {
967
1340
  contactId: contactIdParam.or(zod.z.array(contactIdParam))
968
1341
  }),
969
1342
  parameterOrder: ["to", "contactId"],
970
- output: MessageIdReturnSchema.or(zod.z.boolean()).or(zod.z.void())
1343
+ output: MessageIdReturnSchema.or(zod.z.boolean()).or(zod.z.array(MessageIdReturnSchema.or(zod.z.boolean())))
971
1344
  });
972
1345
  /**
973
1346
  * Sends multiple contacts
@@ -987,7 +1360,7 @@ const sendMultipleContacts = require_registry.defineMethodV2("sendMultipleContac
987
1360
  },
988
1361
  input: zod.z.object({
989
1362
  to: toParam,
990
- contactIds: zod.z.array(contactIdParam)
1363
+ contactIds: zod.z.array(contactIdParam).min(1)
991
1364
  }),
992
1365
  parameterOrder: ["to", "contactIds"],
993
1366
  output: MessageIdReturnSchema.or(zod.z.boolean())
@@ -1084,7 +1457,7 @@ const sendListMessage = require_registry.defineMethodV2("sendListMessage", {
1084
1457
  */
1085
1458
  const sendPoll = require_registry.defineMethodV2("sendPoll", {
1086
1459
  meta: {
1087
- description: "Sends a poll message",
1460
+ description: "Sends a text poll with a selection limit, quote, optional closing time in Unix milliseconds and hidden voter names. Closing time and hidden names require native WhatsApp support for the sending account/chat. These fields select the native V6 poll payload.",
1088
1461
  action: "send",
1089
1462
  namespace: "messages",
1090
1463
  license: "none",
@@ -1093,18 +1466,85 @@ const sendPoll = require_registry.defineMethodV2("sendPoll", {
1093
1466
  },
1094
1467
  input: zod.z.object({
1095
1468
  to: toParam,
1096
- name: zod.z.string().describe("Poll question"),
1097
- options: zod.z.array(zod.z.string()).min(2).max(12).describe("Poll options (2-12)"),
1098
- selectableCount: zod.z.number().optional().default(1).describe("Number of selectable options")
1469
+ name: zod.z.string().trim().min(1).max(500).describe("Poll question"),
1470
+ options: zod.z.array(zod.z.string().trim().min(1).max(255)).min(2).max(20).describe("Poll choices; the account may have a lower native limit"),
1471
+ config: PollSendOptionsSchema.optional().default({})
1472
+ }).refine((input) => (input.config.selectableCount ?? 1) <= input.options.length, {
1473
+ path: ["config", "selectableCount"],
1474
+ message: "Selection limit cannot exceed the number of poll options"
1475
+ }).refine((input) => new Set(input.options).size === input.options.length, {
1476
+ path: ["options"],
1477
+ message: "Poll choices must be unique"
1099
1478
  }),
1100
1479
  parameterOrder: [
1101
1480
  "to",
1102
1481
  "name",
1103
1482
  "options",
1104
- "selectableCount"
1483
+ "config"
1105
1484
  ],
1106
1485
  output: MessageIdReturnSchema.or(zod.z.boolean())
1107
1486
  });
1487
+ const voteOnPoll = require_registry.defineMethodV2("voteOnPoll", {
1488
+ meta: {
1489
+ description: "Votes using option IDs returned by getPollResults; an empty array removes the current vote. The poll must be open and allow this account to vote.",
1490
+ action: "send",
1491
+ namespace: "messages",
1492
+ license: "none",
1493
+ functionality: "both",
1494
+ httpMethod: "POST"
1495
+ },
1496
+ input: zod.z.object({
1497
+ messageId: messageIdParam,
1498
+ optionIds: zod.z.array(zod.z.number().int().nonnegative()).max(20)
1499
+ }).refine((input) => new Set(input.optionIds).size === input.optionIds.length, {
1500
+ path: ["optionIds"],
1501
+ message: "Duplicate poll choices are not allowed"
1502
+ }),
1503
+ parameterOrder: ["messageId", "optionIds"],
1504
+ output: zod.z.boolean()
1505
+ });
1506
+ const getPollResults = require_registry.defineMethodV2("getPollResults", {
1507
+ meta: {
1508
+ description: "Hydrates the local poll vote store and returns synced counts, choices and votes. Hidden-voter polls omit voter identities and the votes array. Unsynced votes may be absent.",
1509
+ action: "get",
1510
+ namespace: "messages",
1511
+ license: "none",
1512
+ functionality: "both",
1513
+ httpMethod: "POST"
1514
+ },
1515
+ input: zod.z.object({ messageId: messageIdParam }),
1516
+ parameterOrder: ["messageId"],
1517
+ output: PollResultsSchema
1518
+ });
1519
+ const pinMessage = require_registry.defineMethodV2("pinMessage", {
1520
+ meta: {
1521
+ description: "Pins a message in its chat for everyone, subject to native permissions. This differs from pinChat, which changes the current account chat list.",
1522
+ action: "set",
1523
+ namespace: "messages",
1524
+ license: "none",
1525
+ functionality: "both",
1526
+ httpMethod: "POST"
1527
+ },
1528
+ input: zod.z.object({
1529
+ messageId: messageIdParam,
1530
+ duration: PinDurationSchema.optional().default("SevenDays")
1531
+ }),
1532
+ parameterOrder: ["messageId", "duration"],
1533
+ output: zod.z.boolean()
1534
+ });
1535
+ const unpinMessage = require_registry.defineMethodV2("unpinMessage", {
1536
+ meta: {
1537
+ description: "Removes a message pin for everyone, subject to native chat permissions.",
1538
+ action: "set",
1539
+ namespace: "messages",
1540
+ license: "none",
1541
+ functionality: "both",
1542
+ httpMethod: "POST"
1543
+ },
1544
+ input: zod.z.object({ messageId: messageIdParam }),
1545
+ parameterOrder: ["messageId"],
1546
+ output: zod.z.boolean()
1547
+ });
1108
1548
  /**
1109
1549
  * Sends a banner image
1110
1550
  */
@@ -1304,6 +1744,19 @@ const getMessageById = require_registry.defineMethodV2("getMessageById", {
1304
1744
  parameterOrder: ["messageId"],
1305
1745
  output: MessageSchema.nullable().or(zod.z.literal(false))
1306
1746
  });
1747
+ const getAlbumMessages = require_registry.defineMethodV2("getAlbumMessages", {
1748
+ meta: {
1749
+ description: "Returns currently loaded image and video messages associated with an album, including GIF videos. The album can arrive before its media, so the array may be incomplete. Returns false if the album is not loaded or the ID belongs to another message type.",
1750
+ action: "read",
1751
+ namespace: "messages",
1752
+ license: "none",
1753
+ functionality: "both",
1754
+ httpMethod: "GET"
1755
+ },
1756
+ input: zod.z.object({ messageId: messageIdParam.describe("Album container message ID") }),
1757
+ parameterOrder: ["messageId"],
1758
+ output: zod.z.array(MessageSchema).or(zod.z.literal(false)).describe("A snapshot of currently loaded album media. An empty or partial array does not mean that the sender sent an empty or partial album. Each item retains its caption and can be passed to decryptMedia or downloadMedia.")
1759
+ });
1307
1760
  /**
1308
1761
  * Retrieves all messages in the session
1309
1762
  */
@@ -1437,6 +1890,22 @@ const unstarMessage = require_registry.defineMethodV2("unstarMessage", {
1437
1890
  parameterOrder: ["messageId"],
1438
1891
  output: zod.z.boolean()
1439
1892
  });
1893
+ const editMessage = require_registry.defineMethodV2("editMessage", {
1894
+ meta: {
1895
+ description: "Edits the text of a message through the installed private patch",
1896
+ action: "update",
1897
+ namespace: "messages",
1898
+ license: "none",
1899
+ functionality: "both",
1900
+ httpMethod: "PUT"
1901
+ },
1902
+ input: zod.z.object({
1903
+ messageId: messageIdParam,
1904
+ newContent: zod.z.string().describe("Replacement message text")
1905
+ }),
1906
+ parameterOrder: ["messageId", "newContent"],
1907
+ output: zod.z.boolean()
1908
+ });
1440
1909
  const react = require_registry.defineMethodV2("react", {
1441
1910
  meta: {
1442
1911
  description: "React to message with emoji",
@@ -1493,7 +1962,7 @@ const loadEarlierMessages = require_registry.defineMethodV2("loadEarlierMessages
1493
1962
  });
1494
1963
  const sendFileFromUrl = require_registry.defineMethodV2("sendFileFromUrl", {
1495
1964
  meta: {
1496
- description: "Downloads a file from a URL and sends it to a chat",
1965
+ description: "Downloads media and sends it through sendFile with the same typed presentation options.",
1497
1966
  action: "send",
1498
1967
  namespace: "messages",
1499
1968
  license: "none",
@@ -1503,18 +1972,18 @@ const sendFileFromUrl = require_registry.defineMethodV2("sendFileFromUrl", {
1503
1972
  input: zod.z.object({
1504
1973
  to: toParam,
1505
1974
  url: zod.z.string().url().describe("URL of the file to download"),
1506
- filename: zod.z.string().describe("Filename for the sent file"),
1507
- caption: zod.z.string().optional().describe("Caption for the file"),
1975
+ filename: filenameParam.optional(),
1976
+ options: MediaSendOptionsSchema.optional().default({}),
1508
1977
  headers: zod.z.record(zod.z.string(), zod.z.string()).optional().describe("HTTP headers for the download request")
1509
1978
  }),
1510
1979
  parameterOrder: [
1511
1980
  "to",
1512
1981
  "url",
1513
1982
  "filename",
1514
- "caption",
1983
+ "options",
1515
1984
  "headers"
1516
1985
  ],
1517
- output: zod.z.string().or(zod.z.boolean()).describe("Message ID or success status")
1986
+ output: MessageIdReturnSchema.or(zod.z.string()).or(zod.z.boolean()).describe("Message ID or success status")
1518
1987
  });
1519
1988
  //#endregion
1520
1989
  //#region src/methods/chats.ts
@@ -1746,6 +2215,32 @@ const isChatOnline = require_registry.defineMethodV2("isChatOnline", {
1746
2215
  });
1747
2216
  //#endregion
1748
2217
  //#region src/methods/contacts.ts
2218
+ const requestPhoneNumber = require_registry.defineMethodV2("requestPhoneNumber", {
2219
+ meta: {
2220
+ description: "Ask a direct LID chat to voluntarily share their phone number. A submitted request does not confirm sharing.",
2221
+ action: "send",
2222
+ namespace: "contacts",
2223
+ license: "none",
2224
+ functionality: "both",
2225
+ httpMethod: "POST"
2226
+ },
2227
+ input: zod.z.object({ to: toParam }),
2228
+ parameterOrder: ["to"],
2229
+ output: messageIdParam
2230
+ });
2231
+ const sharePhoneNumber = require_registry.defineMethodV2("sharePhoneNumber", {
2232
+ meta: {
2233
+ description: "Share the signed-in account’s own phone number with a direct LID chat using WhatsApp’s native protocol. No arbitrary phone number is accepted.",
2234
+ action: "send",
2235
+ namespace: "contacts",
2236
+ license: "none",
2237
+ functionality: "both",
2238
+ httpMethod: "POST"
2239
+ },
2240
+ input: zod.z.object({ to: toParam }),
2241
+ parameterOrder: ["to"],
2242
+ output: messageIdParam
2243
+ });
1749
2244
  const getAllContacts = require_registry.defineMethodV2("getAllContacts", {
1750
2245
  meta: {
1751
2246
  description: "Retrieves all contacts",
@@ -1928,9 +2423,13 @@ const getGroupMembersId = require_registry.defineMethodV2("getGroupMembersId", {
1928
2423
  parameterOrder: ["groupId"],
1929
2424
  output: zod.z.array(ContactIdSchema$1)
1930
2425
  });
2426
+ const GroupInfoSchema = zod.z.object({
2427
+ title: zod.z.string(),
2428
+ description: zod.z.string().nullish()
2429
+ }).passthrough().describe("Group title and description returned by the private getGroupInfo patch.");
1931
2430
  const getGroupInfo = require_registry.defineMethodV2("getGroupInfo", {
1932
2431
  meta: {
1933
- description: "Get group metadata",
2432
+ description: "Get the group title and description through the installed private patch",
1934
2433
  action: "read",
1935
2434
  namespace: "groups",
1936
2435
  license: "none",
@@ -1939,7 +2438,7 @@ const getGroupInfo = require_registry.defineMethodV2("getGroupInfo", {
1939
2438
  },
1940
2439
  input: zod.z.object({ groupId: groupIdParam }),
1941
2440
  parameterOrder: ["groupId"],
1942
- output: GroupMetadataSchema.nullable()
2441
+ output: GroupInfoSchema.or(zod.z.string()).nullable()
1943
2442
  });
1944
2443
  const getGroupAdmins = require_registry.defineMethodV2("getGroupAdmins", {
1945
2444
  meta: {
@@ -2556,6 +3055,21 @@ const getOrder = require_registry.defineMethodV2("getOrder", {
2556
3055
  output: OrderSchema
2557
3056
  });
2558
3057
  //#endregion
3058
+ //#region src/license.ts
3059
+ /** Licence access selected by the server, distinct from WhatsApp feature flags. */
3060
+ const LicenseFeaturesSchema = effect.Schema.Struct({
3061
+ status: effect.Schema.Literals([
3062
+ "valid",
3063
+ "missing",
3064
+ "invalid",
3065
+ "expired",
3066
+ "metadata_only"
3067
+ ]),
3068
+ keyType: effect.Schema.NullOr(effect.Schema.String),
3069
+ expiresAt: effect.Schema.NullOr(effect.Schema.Number),
3070
+ features: effect.Schema.Record(effect.Schema.String, effect.Schema.Boolean)
3071
+ });
3072
+ //#endregion
2559
3073
  //#region src/methods/session.ts
2560
3074
  const getMe = require_registry.defineMethodV2("getMe", {
2561
3075
  meta: {
@@ -2664,6 +3178,19 @@ const getLicenseType = require_registry.defineMethodV2("getLicenseType", {
2664
3178
  parameterOrder: [],
2665
3179
  output: LicenseTypeSchema.or(zod.z.literal(false))
2666
3180
  });
3181
+ const getLicenseFeatures = require_registry.defineMethodV2("getLicenseFeatures", {
3182
+ meta: {
3183
+ description: "Get enabled and disabled licensed features from the accepted licence patch. This reports licence access; actions check runtime availability automatically.",
3184
+ action: "read",
3185
+ namespace: "session",
3186
+ license: "none",
3187
+ functionality: "both",
3188
+ httpMethod: "GET"
3189
+ },
3190
+ input: zod.z.object({}),
3191
+ parameterOrder: [],
3192
+ output: projectEffectSchema(LicenseFeaturesSchema)
3193
+ });
2667
3194
  const getUserAgent = require_registry.defineMethodV2("getUserAgent", {
2668
3195
  meta: {
2669
3196
  description: "Get user agent",
@@ -2883,7 +3410,7 @@ const actions = zod.z.array(InteractiveActionSchema).min(1).superRefine((items,
2883
3410
  ids.add(item.id);
2884
3411
  });
2885
3412
  });
2886
- const media = {
3413
+ const media$1 = {
2887
3414
  source: text.describe("HTTP(S) URL, local file path or base64 data URL; resolved by the client before sending"),
2888
3415
  filename: text.optional(),
2889
3416
  title: zod.z.string().optional()
@@ -2895,15 +3422,15 @@ const InteractiveHeaderSchema = zod.z.discriminatedUnion("type", [
2895
3422
  }).strict(),
2896
3423
  zod.z.object({
2897
3424
  type: zod.z.literal("image"),
2898
- ...media
3425
+ ...media$1
2899
3426
  }).strict(),
2900
3427
  zod.z.object({
2901
3428
  type: zod.z.literal("video"),
2902
- ...media
3429
+ ...media$1
2903
3430
  }).strict(),
2904
3431
  zod.z.object({
2905
3432
  type: zod.z.literal("document"),
2906
- ...media
3433
+ ...media$1
2907
3434
  }).strict()
2908
3435
  ]);
2909
3436
  const base = {
@@ -2952,7 +3479,7 @@ const CarouselCardSchema = zod.z.object({
2952
3479
  body: text,
2953
3480
  header: zod.z.object({
2954
3481
  type: zod.z.literal("image"),
2955
- ...media
3482
+ ...media$1
2956
3483
  }).strict(),
2957
3484
  actions
2958
3485
  }).strict();
@@ -3138,43 +3665,353 @@ const sendRawMessage = require_registry.defineMethodV2("sendRawMessage", {
3138
3665
  output: zod.z.string()
3139
3666
  });
3140
3667
  //#endregion
3141
- Object.defineProperty(exports, "Base64ToDataUrlSchema", {
3668
+ //#region src/calling.ts
3669
+ const RawAudioFormatSchema = effect.Schema.Struct({
3670
+ encoding: effect.Schema.Literals(["pcm16le", "float32le"]),
3671
+ sampleRate: effect.Schema.Number,
3672
+ channels: effect.Schema.Literals([1, 2])
3673
+ });
3674
+ const MediaDescriptorSchema = effect.Schema.Struct({
3675
+ kind: effect.Schema.Literals([
3676
+ "file",
3677
+ "url",
3678
+ "device",
3679
+ "remote"
3680
+ ]),
3681
+ path: effect.Schema.optional(effect.Schema.String),
3682
+ url: effect.Schema.optional(effect.Schema.String),
3683
+ deviceId: effect.Schema.optional(effect.Schema.String),
3684
+ raw: effect.Schema.optional(RawAudioFormatSchema),
3685
+ headers: effect.Schema.optional(effect.Schema.Record(effect.Schema.String, effect.Schema.String)),
3686
+ overwrite: effect.Schema.optional(effect.Schema.Boolean),
3687
+ loop: effect.Schema.optional(effect.Schema.Boolean),
3688
+ remoteId: effect.Schema.optional(effect.Schema.String)
3689
+ });
3690
+ const CallMediaOptionsSchema = effect.Schema.Struct({
3691
+ microphone: effect.Schema.optional(effect.Schema.Unknown),
3692
+ speaker: effect.Schema.optional(effect.Schema.Unknown),
3693
+ camera: effect.Schema.optional(effect.Schema.Unknown),
3694
+ onMediaFailure: effect.Schema.optional(effect.Schema.Literals(["end", "keep-open"]))
3695
+ });
3696
+ const CallIdentitySchema = effect.Schema.Struct({
3697
+ id: effect.Schema.String,
3698
+ sessionId: effect.Schema.String,
3699
+ generation: effect.Schema.String
3700
+ });
3701
+ const CallEndReasonSchema = effect.Schema.Struct({
3702
+ code: effect.Schema.String,
3703
+ message: effect.Schema.String,
3704
+ source: effect.Schema.Literals([
3705
+ "local",
3706
+ "media",
3707
+ "license",
3708
+ "session",
3709
+ "whatsapp"
3710
+ ])
3711
+ });
3712
+ const CallSnapshotSchema = effect.Schema.Struct({
3713
+ ...CallIdentitySchema.fields,
3714
+ peer: effect.Schema.String,
3715
+ state: effect.Schema.String,
3716
+ direction: effect.Schema.Literals(["incoming", "outgoing"]),
3717
+ video: effect.Schema.Boolean,
3718
+ terminal: effect.Schema.Boolean,
3719
+ observedAt: effect.Schema.Number,
3720
+ endReason: effect.Schema.optional(CallEndReasonSchema),
3721
+ media: effect.Schema.optional(effect.Schema.Struct({
3722
+ state: effect.Schema.Literals(["attached", "ended"]),
3723
+ reason: effect.Schema.optional(effect.Schema.String)
3724
+ }))
3725
+ });
3726
+ const CallReasonSchema = effect.Schema.Struct({
3727
+ code: effect.Schema.String,
3728
+ message: effect.Schema.String,
3729
+ status: effect.Schema.Number
3730
+ });
3731
+ const CallActionResultSchema = effect.Schema.Union([effect.Schema.Struct({
3732
+ ok: effect.Schema.Literal(true),
3733
+ status: effect.Schema.Literal("requested"),
3734
+ callId: effect.Schema.optional(effect.Schema.String)
3735
+ }), effect.Schema.Struct({
3736
+ ok: effect.Schema.Literal(false),
3737
+ status: effect.Schema.Literals([
3738
+ "unavailable",
3739
+ "failed",
3740
+ "unknown"
3741
+ ]),
3742
+ reason: CallReasonSchema,
3743
+ callId: effect.Schema.optional(effect.Schema.String)
3744
+ })]);
3745
+ const CallCapabilitiesSchema = effect.Schema.Struct({
3746
+ control: effect.Schema.Boolean,
3747
+ audio: effect.Schema.Boolean,
3748
+ video: effect.Schema.Boolean,
3749
+ reason: effect.Schema.optional(CallReasonSchema)
3750
+ });
3751
+ //#endregion
3752
+ //#region src/methods/calls.ts
3753
+ const media = effect.Schema.optional(effect.Schema.Unknown);
3754
+ const actionInput = effect.Schema.Struct({
3755
+ call: CallIdentitySchema,
3756
+ media: effect.Schema.optional(CallMediaOptionsSchema)
3757
+ });
3758
+ const register = (name, input, output, parameters, description) => require_registry.defineMethodV2(name, {
3759
+ meta: {
3760
+ namespace: "calls",
3761
+ action: "update",
3762
+ httpMethod: "POST",
3763
+ license: name === "getCallCapabilities" ? "none" : "restricted",
3764
+ functionality: "both",
3765
+ description
3766
+ },
3767
+ input: projectEffectSchema(input),
3768
+ parameterOrder: parameters,
3769
+ output: projectEffectSchema(output)
3770
+ });
3771
+ const getCallCapabilities = register("getCallCapabilities", effect.Schema.Struct({}), CallCapabilitiesSchema, [], "Optional calling availability for UI and diagnostics. Actions perform admission automatically.");
3772
+ const getActiveCall = register("getActiveCall", effect.Schema.Struct({}), effect.Schema.NullOr(CallSnapshotSchema), [], "Get the current call snapshot. SDK clients hydrate its bound methods.");
3773
+ const acceptCall = register("acceptCall", actionInput, CallActionResultSchema, ["call", "media"], "Prepare media and accept this incoming call.");
3774
+ const startCall = register("startCall", effect.Schema.Struct({
3775
+ to: effect.Schema.String,
3776
+ microphone: media,
3777
+ speaker: media,
3778
+ camera: media
3779
+ }), CallActionResultSchema, [
3780
+ "to",
3781
+ "microphone",
3782
+ "speaker",
3783
+ "camera"
3784
+ ], "Prepare media and place an outgoing audio or video call.");
3785
+ const rejectCall = register("rejectCall", effect.Schema.Struct({ call: CallIdentitySchema }), CallActionResultSchema, ["call"], "Reject this call with native state confirmation.");
3786
+ const endCall = register("endCall", effect.Schema.Struct({ call: CallIdentitySchema }), CallActionResultSchema, ["call"], "Request hangup for this call.");
3787
+ const muteCall = register("muteCall", effect.Schema.Struct({
3788
+ call: CallIdentitySchema,
3789
+ muted: effect.Schema.Boolean
3790
+ }), CallActionResultSchema, ["call", "muted"], "Mute or unmute the microphone without ending reception.");
3791
+ const clearCallAudio = register("clearCallAudio", effect.Schema.Struct({ call: CallIdentitySchema }), CallActionResultSchema, ["call"], "Discard queued outgoing audio.");
3792
+ const setCallMedia = register("setCallMedia", actionInput, CallActionResultSchema, ["call", "media"], "Prepare a replacement before releasing the working media.");
3793
+ const observeCallAudio = register("observeCallAudio", effect.Schema.Struct({
3794
+ call: CallIdentitySchema,
3795
+ speaker: effect.Schema.Unknown
3796
+ }), effect.Schema.Union([effect.Schema.Struct({
3797
+ ok: effect.Schema.Literal(true),
3798
+ status: effect.Schema.Literal("requested"),
3799
+ observerId: effect.Schema.String
3800
+ }), CallActionResultSchema]), ["call", "speaker"], "Attach an isolated receive-only audio sink. Its failure does not interrupt the call owner.");
3801
+ const stopCallAudioObserver = register("stopCallAudioObserver", effect.Schema.Struct({
3802
+ call: CallIdentitySchema,
3803
+ observerId: effect.Schema.String
3804
+ }), CallActionResultSchema, ["call", "observerId"], "Stop an audio observer and finalize its sink.");
3805
+ //#endregion
3806
+ //#region src/methods/whatsapp-events.ts
3807
+ const meta = {
3808
+ namespace: "events",
3809
+ license: "none",
3810
+ functionality: "both"
3811
+ };
3812
+ const sendEvent = require_registry.defineMethodV2("sendEvent", {
3813
+ meta: {
3814
+ ...meta,
3815
+ action: "send",
3816
+ httpMethod: "POST",
3817
+ description: "Send a native WhatsApp event with Unix-second times. Returns its submitted message ID; delivery is observed through ACKs."
3818
+ },
3819
+ input: zod.z.object({
3820
+ to: toParam,
3821
+ event: EventInputRegistrySchema
3822
+ }),
3823
+ parameterOrder: ["to", "event"],
3824
+ output: messageIdParam
3825
+ });
3826
+ const getEvent = require_registry.defineMethodV2("getEvent", {
3827
+ meta: {
3828
+ ...meta,
3829
+ action: "read",
3830
+ httpMethod: "GET",
3831
+ description: "Retrieve an event by message ID from WhatsApp local history. Returns null when absent."
3832
+ },
3833
+ input: zod.z.object({ eventId: messageIdParam }),
3834
+ parameterOrder: ["eventId"],
3835
+ output: WhatsAppEventRegistrySchema.nullable()
3836
+ });
3837
+ const getEvents = require_registry.defineMethodV2("getEvents", {
3838
+ meta: {
3839
+ ...meta,
3840
+ action: "read",
3841
+ httpMethod: "GET",
3842
+ description: "Page through a chat’s locally synced event history, newest first. Pass nextCursor as options.before to retrieve the next page."
3843
+ },
3844
+ input: zod.z.object({
3845
+ chatId: toParam,
3846
+ options: EventListOptionsRegistrySchema.optional()
3847
+ }),
3848
+ parameterOrder: ["chatId", "options"],
3849
+ output: EventPageRegistrySchema
3850
+ });
3851
+ const getEventResponses = require_registry.defineMethodV2("getEventResponses", {
3852
+ meta: {
3853
+ ...meta,
3854
+ action: "read",
3855
+ httpMethod: "GET",
3856
+ description: "Get the latest decrypted RSVP per participant, including responses persisted in WhatsApp local history."
3857
+ },
3858
+ input: zod.z.object({ eventId: messageIdParam }),
3859
+ parameterOrder: ["eventId"],
3860
+ output: EventResponseRegistrySchema.array()
3861
+ });
3862
+ const editEvent = require_registry.defineMethodV2("editEvent", {
3863
+ meta: {
3864
+ ...meta,
3865
+ action: "update",
3866
+ httpMethod: "POST",
3867
+ description: "Edit an event created by this account. Unspecified fields retain their current values; endTime: null removes the end time."
3868
+ },
3869
+ input: zod.z.object({
3870
+ eventId: messageIdParam,
3871
+ changes: EventUpdateRegistrySchema
3872
+ }),
3873
+ parameterOrder: ["eventId", "changes"],
3874
+ output: zod.z.boolean()
3875
+ });
3876
+ const cancelEvent = require_registry.defineMethodV2("cancelEvent", {
3877
+ meta: {
3878
+ ...meta,
3879
+ action: "update",
3880
+ httpMethod: "POST",
3881
+ description: "Cancel an event created by this account using WhatsApp’s encrypted event edit action."
3882
+ },
3883
+ input: zod.z.object({ eventId: messageIdParam }),
3884
+ parameterOrder: ["eventId"],
3885
+ output: zod.z.boolean()
3886
+ });
3887
+ const respondToEvent = require_registry.defineMethodV2("respondToEvent", {
3888
+ meta: {
3889
+ ...meta,
3890
+ action: "send",
3891
+ httpMethod: "POST",
3892
+ description: "RSVP through WhatsApp’s native encrypted event-response action."
3893
+ },
3894
+ input: zod.z.object({
3895
+ eventId: messageIdParam,
3896
+ response: zod.z.enum([
3897
+ "going",
3898
+ "notGoing",
3899
+ "maybe"
3900
+ ]).meta({ examples: ["going"] })
3901
+ }),
3902
+ parameterOrder: ["eventId", "response"],
3903
+ output: zod.z.boolean()
3904
+ });
3905
+ //#endregion
3906
+ Object.defineProperty(exports, "AlbumMediaSchema", {
3142
3907
  enumerable: true,
3143
3908
  get: function() {
3144
- return Base64ToDataUrlSchema;
3909
+ return AlbumMediaSchema;
3145
3910
  }
3146
3911
  });
3147
- Object.defineProperty(exports, "BookingContentSchema", {
3912
+ Object.defineProperty(exports, "AlbumSendResultSchema", {
3148
3913
  enumerable: true,
3149
3914
  get: function() {
3150
- return BookingContentSchema;
3915
+ return AlbumSendResultSchema;
3151
3916
  }
3152
3917
  });
3153
- Object.defineProperty(exports, "BusinessProfileSchema", {
3918
+ Object.defineProperty(exports, "AudioAttachmentOptionsSchema", {
3154
3919
  enumerable: true,
3155
3920
  get: function() {
3156
- return BusinessProfileSchema;
3921
+ return AudioAttachmentOptionsSchema;
3157
3922
  }
3158
3923
  });
3159
- Object.defineProperty(exports, "ButtonsContentSchema", {
3924
+ Object.defineProperty(exports, "AudioSendOptionsSchema", {
3160
3925
  enumerable: true,
3161
3926
  get: function() {
3162
- return ButtonsContentSchema;
3927
+ return AudioSendOptionsSchema;
3163
3928
  }
3164
3929
  });
3165
- Object.defineProperty(exports, "CallActionSchema", {
3930
+ Object.defineProperty(exports, "AutoMediaSendOptionsSchema", {
3166
3931
  enumerable: true,
3167
3932
  get: function() {
3168
- return CallActionSchema;
3933
+ return AutoMediaSendOptionsSchema;
3169
3934
  }
3170
3935
  });
3171
- Object.defineProperty(exports, "CarouselCardSchema", {
3936
+ Object.defineProperty(exports, "Base64ToDataUrlSchema", {
3172
3937
  enumerable: true,
3173
3938
  get: function() {
3174
- return CarouselCardSchema;
3939
+ return Base64ToDataUrlSchema;
3175
3940
  }
3176
3941
  });
3177
- Object.defineProperty(exports, "CarouselContentSchema", {
3942
+ Object.defineProperty(exports, "BookingContentSchema", {
3943
+ enumerable: true,
3944
+ get: function() {
3945
+ return BookingContentSchema;
3946
+ }
3947
+ });
3948
+ Object.defineProperty(exports, "BusinessProfileSchema", {
3949
+ enumerable: true,
3950
+ get: function() {
3951
+ return BusinessProfileSchema;
3952
+ }
3953
+ });
3954
+ Object.defineProperty(exports, "ButtonsContentSchema", {
3955
+ enumerable: true,
3956
+ get: function() {
3957
+ return ButtonsContentSchema;
3958
+ }
3959
+ });
3960
+ Object.defineProperty(exports, "CallActionResultSchema", {
3961
+ enumerable: true,
3962
+ get: function() {
3963
+ return CallActionResultSchema;
3964
+ }
3965
+ });
3966
+ Object.defineProperty(exports, "CallActionSchema", {
3967
+ enumerable: true,
3968
+ get: function() {
3969
+ return CallActionSchema;
3970
+ }
3971
+ });
3972
+ Object.defineProperty(exports, "CallCapabilitiesSchema", {
3973
+ enumerable: true,
3974
+ get: function() {
3975
+ return CallCapabilitiesSchema;
3976
+ }
3977
+ });
3978
+ Object.defineProperty(exports, "CallEndReasonSchema", {
3979
+ enumerable: true,
3980
+ get: function() {
3981
+ return CallEndReasonSchema;
3982
+ }
3983
+ });
3984
+ Object.defineProperty(exports, "CallIdentitySchema", {
3985
+ enumerable: true,
3986
+ get: function() {
3987
+ return CallIdentitySchema;
3988
+ }
3989
+ });
3990
+ Object.defineProperty(exports, "CallMediaOptionsSchema", {
3991
+ enumerable: true,
3992
+ get: function() {
3993
+ return CallMediaOptionsSchema;
3994
+ }
3995
+ });
3996
+ Object.defineProperty(exports, "CallReasonSchema", {
3997
+ enumerable: true,
3998
+ get: function() {
3999
+ return CallReasonSchema;
4000
+ }
4001
+ });
4002
+ Object.defineProperty(exports, "CallSnapshotSchema", {
4003
+ enumerable: true,
4004
+ get: function() {
4005
+ return CallSnapshotSchema;
4006
+ }
4007
+ });
4008
+ Object.defineProperty(exports, "CarouselCardSchema", {
4009
+ enumerable: true,
4010
+ get: function() {
4011
+ return CarouselCardSchema;
4012
+ }
4013
+ });
4014
+ Object.defineProperty(exports, "CarouselContentSchema", {
3178
4015
  enumerable: true,
3179
4016
  get: function() {
3180
4017
  return CarouselContentSchema;
@@ -3252,6 +4089,12 @@ Object.defineProperty(exports, "ContactIdSchema", {
3252
4089
  return ContactIdSchema;
3253
4090
  }
3254
4091
  });
4092
+ Object.defineProperty(exports, "ContactIdSchema$1", {
4093
+ enumerable: true,
4094
+ get: function() {
4095
+ return ContactIdSchema$1;
4096
+ }
4097
+ });
3255
4098
  Object.defineProperty(exports, "ContactSchema", {
3256
4099
  enumerable: true,
3257
4100
  get: function() {
@@ -3276,6 +4119,54 @@ Object.defineProperty(exports, "DataURLSchema", {
3276
4119
  return DataURLSchema;
3277
4120
  }
3278
4121
  });
4122
+ Object.defineProperty(exports, "DocumentSendOptionsSchema", {
4123
+ enumerable: true,
4124
+ get: function() {
4125
+ return DocumentSendOptionsSchema;
4126
+ }
4127
+ });
4128
+ Object.defineProperty(exports, "EventInputSchema", {
4129
+ enumerable: true,
4130
+ get: function() {
4131
+ return EventInputSchema;
4132
+ }
4133
+ });
4134
+ Object.defineProperty(exports, "EventListOptionsSchema", {
4135
+ enumerable: true,
4136
+ get: function() {
4137
+ return EventListOptionsSchema;
4138
+ }
4139
+ });
4140
+ Object.defineProperty(exports, "EventPageSchema", {
4141
+ enumerable: true,
4142
+ get: function() {
4143
+ return EventPageSchema;
4144
+ }
4145
+ });
4146
+ Object.defineProperty(exports, "EventResponseRegistrySchema", {
4147
+ enumerable: true,
4148
+ get: function() {
4149
+ return EventResponseRegistrySchema;
4150
+ }
4151
+ });
4152
+ Object.defineProperty(exports, "EventResponseSchema", {
4153
+ enumerable: true,
4154
+ get: function() {
4155
+ return EventResponseSchema;
4156
+ }
4157
+ });
4158
+ Object.defineProperty(exports, "EventResponseTypeSchema", {
4159
+ enumerable: true,
4160
+ get: function() {
4161
+ return EventResponseTypeSchema;
4162
+ }
4163
+ });
4164
+ Object.defineProperty(exports, "EventUpdateSchema", {
4165
+ enumerable: true,
4166
+ get: function() {
4167
+ return EventUpdateSchema;
4168
+ }
4169
+ });
3279
4170
  Object.defineProperty(exports, "FeatureFlagsSchema", {
3280
4171
  enumerable: true,
3281
4172
  get: function() {
@@ -3306,6 +4197,12 @@ Object.defineProperty(exports, "FormResponseSchema", {
3306
4197
  return FormResponseSchema;
3307
4198
  }
3308
4199
  });
4200
+ Object.defineProperty(exports, "GifSendOptionsSchema", {
4201
+ enumerable: true,
4202
+ get: function() {
4203
+ return GifSendOptionsSchema;
4204
+ }
4205
+ });
3309
4206
  Object.defineProperty(exports, "GroupChatIdSchema", {
3310
4207
  enumerable: true,
3311
4208
  get: function() {
@@ -3330,6 +4227,18 @@ Object.defineProperty(exports, "GroupIdSchema", {
3330
4227
  return GroupIdSchema;
3331
4228
  }
3332
4229
  });
4230
+ Object.defineProperty(exports, "GroupIdSchema$1", {
4231
+ enumerable: true,
4232
+ get: function() {
4233
+ return GroupIdSchema$1;
4234
+ }
4235
+ });
4236
+ Object.defineProperty(exports, "GroupInfoSchema", {
4237
+ enumerable: true,
4238
+ get: function() {
4239
+ return GroupInfoSchema;
4240
+ }
4241
+ });
3333
4242
  Object.defineProperty(exports, "GroupMetadataSchema", {
3334
4243
  enumerable: true,
3335
4244
  get: function() {
@@ -3360,6 +4269,12 @@ Object.defineProperty(exports, "IdSchema", {
3360
4269
  return IdSchema;
3361
4270
  }
3362
4271
  });
4272
+ Object.defineProperty(exports, "ImageSendOptionsSchema", {
4273
+ enumerable: true,
4274
+ get: function() {
4275
+ return ImageSendOptionsSchema;
4276
+ }
4277
+ });
3363
4278
  Object.defineProperty(exports, "InteractiveActionSchema", {
3364
4279
  enumerable: true,
3365
4280
  get: function() {
@@ -3414,6 +4329,12 @@ Object.defineProperty(exports, "LabelSchema", {
3414
4329
  return LabelSchema;
3415
4330
  }
3416
4331
  });
4332
+ Object.defineProperty(exports, "LicenseFeaturesSchema", {
4333
+ enumerable: true,
4334
+ get: function() {
4335
+ return LicenseFeaturesSchema;
4336
+ }
4337
+ });
3417
4338
  Object.defineProperty(exports, "LicenseTypeSchema", {
3418
4339
  enumerable: true,
3419
4340
  get: function() {
@@ -3444,6 +4365,18 @@ Object.defineProperty(exports, "LocationSchema", {
3444
4365
  return LocationSchema;
3445
4366
  }
3446
4367
  });
4368
+ Object.defineProperty(exports, "MediaDescriptorSchema", {
4369
+ enumerable: true,
4370
+ get: function() {
4371
+ return MediaDescriptorSchema;
4372
+ }
4373
+ });
4374
+ Object.defineProperty(exports, "MediaSendOptionsSchema", {
4375
+ enumerable: true,
4376
+ get: function() {
4377
+ return MediaSendOptionsSchema;
4378
+ }
4379
+ });
3447
4380
  Object.defineProperty(exports, "MessageAck", {
3448
4381
  enumerable: true,
3449
4382
  get: function() {
@@ -3522,6 +4455,30 @@ Object.defineProperty(exports, "OrderSchema", {
3522
4455
  return OrderSchema;
3523
4456
  }
3524
4457
  });
4458
+ Object.defineProperty(exports, "PinDurationSchema", {
4459
+ enumerable: true,
4460
+ get: function() {
4461
+ return PinDurationSchema;
4462
+ }
4463
+ });
4464
+ Object.defineProperty(exports, "PollResultsSchema", {
4465
+ enumerable: true,
4466
+ get: function() {
4467
+ return PollResultsSchema;
4468
+ }
4469
+ });
4470
+ Object.defineProperty(exports, "PollSendOptionsSchema", {
4471
+ enumerable: true,
4472
+ get: function() {
4473
+ return PollSendOptionsSchema;
4474
+ }
4475
+ });
4476
+ Object.defineProperty(exports, "PollVoteSchema", {
4477
+ enumerable: true,
4478
+ get: function() {
4479
+ return PollVoteSchema;
4480
+ }
4481
+ });
3525
4482
  Object.defineProperty(exports, "ProcessStatsSchema", {
3526
4483
  enumerable: true,
3527
4484
  get: function() {
@@ -3534,6 +4491,12 @@ Object.defineProperty(exports, "ProductSchema", {
3534
4491
  return ProductSchema;
3535
4492
  }
3536
4493
  });
4494
+ Object.defineProperty(exports, "RawAudioFormatSchema", {
4495
+ enumerable: true,
4496
+ get: function() {
4497
+ return RawAudioFormatSchema;
4498
+ }
4499
+ });
3537
4500
  Object.defineProperty(exports, "ReplyActionSchema", {
3538
4501
  enumerable: true,
3539
4502
  get: function() {
@@ -3570,6 +4533,12 @@ Object.defineProperty(exports, "SimpleListener", {
3570
4533
  return SimpleListener;
3571
4534
  }
3572
4535
  });
4536
+ Object.defineProperty(exports, "StickerJobSchema", {
4537
+ enumerable: true,
4538
+ get: function() {
4539
+ return StickerJobSchema;
4540
+ }
4541
+ });
3573
4542
  Object.defineProperty(exports, "StorySchema", {
3574
4543
  enumerable: true,
3575
4544
  get: function() {
@@ -3588,6 +4557,36 @@ Object.defineProperty(exports, "UnixSecondsToDateSchema", {
3588
4557
  return UnixSecondsToDateSchema;
3589
4558
  }
3590
4559
  });
4560
+ Object.defineProperty(exports, "VideoSendOptionsSchema", {
4561
+ enumerable: true,
4562
+ get: function() {
4563
+ return VideoSendOptionsSchema;
4564
+ }
4565
+ });
4566
+ Object.defineProperty(exports, "VoiceNoteOptionsSchema", {
4567
+ enumerable: true,
4568
+ get: function() {
4569
+ return VoiceNoteOptionsSchema;
4570
+ }
4571
+ });
4572
+ Object.defineProperty(exports, "WhatsAppEventRegistrySchema", {
4573
+ enumerable: true,
4574
+ get: function() {
4575
+ return WhatsAppEventRegistrySchema;
4576
+ }
4577
+ });
4578
+ Object.defineProperty(exports, "WhatsAppEventSchema", {
4579
+ enumerable: true,
4580
+ get: function() {
4581
+ return WhatsAppEventSchema;
4582
+ }
4583
+ });
4584
+ Object.defineProperty(exports, "acceptCall", {
4585
+ enumerable: true,
4586
+ get: function() {
4587
+ return acceptCall;
4588
+ }
4589
+ });
3591
4590
  Object.defineProperty(exports, "addLabel", {
3592
4591
  enumerable: true,
3593
4592
  get: function() {
@@ -3630,6 +4629,12 @@ Object.defineProperty(exports, "blockContact", {
3630
4629
  return blockContact;
3631
4630
  }
3632
4631
  });
4632
+ Object.defineProperty(exports, "cancelEvent", {
4633
+ enumerable: true,
4634
+ get: function() {
4635
+ return cancelEvent;
4636
+ }
4637
+ });
3633
4638
  Object.defineProperty(exports, "captionParam", {
3634
4639
  enumerable: true,
3635
4640
  get: function() {
@@ -3660,6 +4665,12 @@ Object.defineProperty(exports, "checkReadReceipts", {
3660
4665
  return checkReadReceipts;
3661
4666
  }
3662
4667
  });
4668
+ Object.defineProperty(exports, "clearCallAudio", {
4669
+ enumerable: true,
4670
+ get: function() {
4671
+ return clearCallAudio;
4672
+ }
4673
+ });
3663
4674
  Object.defineProperty(exports, "clearChat", {
3664
4675
  enumerable: true,
3665
4676
  get: function() {
@@ -3702,6 +4713,18 @@ Object.defineProperty(exports, "createGroup", {
3702
4713
  return createGroup;
3703
4714
  }
3704
4715
  });
4716
+ Object.defineProperty(exports, "decodeEventResponse", {
4717
+ enumerable: true,
4718
+ get: function() {
4719
+ return decodeEventResponse;
4720
+ }
4721
+ });
4722
+ Object.defineProperty(exports, "decodeWhatsAppEvent", {
4723
+ enumerable: true,
4724
+ get: function() {
4725
+ return decodeWhatsAppEvent;
4726
+ }
4727
+ });
3705
4728
  Object.defineProperty(exports, "decryptMedia", {
3706
4729
  enumerable: true,
3707
4730
  get: function() {
@@ -3744,6 +4767,18 @@ Object.defineProperty(exports, "demoteParticipant", {
3744
4767
  return demoteParticipant;
3745
4768
  }
3746
4769
  });
4770
+ Object.defineProperty(exports, "deserializeEventResponse", {
4771
+ enumerable: true,
4772
+ get: function() {
4773
+ return deserializeEventResponse;
4774
+ }
4775
+ });
4776
+ Object.defineProperty(exports, "deserializeWhatsAppEvent", {
4777
+ enumerable: true,
4778
+ get: function() {
4779
+ return deserializeWhatsAppEvent;
4780
+ }
4781
+ });
3747
4782
  Object.defineProperty(exports, "documentDataParam", {
3748
4783
  enumerable: true,
3749
4784
  get: function() {
@@ -3756,6 +4791,24 @@ Object.defineProperty(exports, "downloadMedia", {
3756
4791
  return downloadMedia;
3757
4792
  }
3758
4793
  });
4794
+ Object.defineProperty(exports, "editEvent", {
4795
+ enumerable: true,
4796
+ get: function() {
4797
+ return editEvent;
4798
+ }
4799
+ });
4800
+ Object.defineProperty(exports, "editMessage", {
4801
+ enumerable: true,
4802
+ get: function() {
4803
+ return editMessage;
4804
+ }
4805
+ });
4806
+ Object.defineProperty(exports, "endCall", {
4807
+ enumerable: true,
4808
+ get: function() {
4809
+ return endCall;
4810
+ }
4811
+ });
3759
4812
  Object.defineProperty(exports, "fileDataParam", {
3760
4813
  enumerable: true,
3761
4814
  get: function() {
@@ -3804,6 +4857,18 @@ Object.defineProperty(exports, "forwardMessages", {
3804
4857
  return forwardMessages;
3805
4858
  }
3806
4859
  });
4860
+ Object.defineProperty(exports, "getActiveCall", {
4861
+ enumerable: true,
4862
+ get: function() {
4863
+ return getActiveCall;
4864
+ }
4865
+ });
4866
+ Object.defineProperty(exports, "getAlbumMessages", {
4867
+ enumerable: true,
4868
+ get: function() {
4869
+ return getAlbumMessages;
4870
+ }
4871
+ });
3807
4872
  Object.defineProperty(exports, "getAllChatIds", {
3808
4873
  enumerable: true,
3809
4874
  get: function() {
@@ -3870,6 +4935,12 @@ Object.defineProperty(exports, "getBusinessProfile", {
3870
4935
  return getBusinessProfile;
3871
4936
  }
3872
4937
  });
4938
+ Object.defineProperty(exports, "getCallCapabilities", {
4939
+ enumerable: true,
4940
+ get: function() {
4941
+ return getCallCapabilities;
4942
+ }
4943
+ });
3873
4944
  Object.defineProperty(exports, "getChat", {
3874
4945
  enumerable: true,
3875
4946
  get: function() {
@@ -3936,6 +5007,24 @@ Object.defineProperty(exports, "getContact", {
3936
5007
  return getContact;
3937
5008
  }
3938
5009
  });
5010
+ Object.defineProperty(exports, "getEvent", {
5011
+ enumerable: true,
5012
+ get: function() {
5013
+ return getEvent;
5014
+ }
5015
+ });
5016
+ Object.defineProperty(exports, "getEventResponses", {
5017
+ enumerable: true,
5018
+ get: function() {
5019
+ return getEventResponses;
5020
+ }
5021
+ });
5022
+ Object.defineProperty(exports, "getEvents", {
5023
+ enumerable: true,
5024
+ get: function() {
5025
+ return getEvents;
5026
+ }
5027
+ });
3939
5028
  Object.defineProperty(exports, "getFeatures", {
3940
5029
  enumerable: true,
3941
5030
  get: function() {
@@ -3984,6 +5073,12 @@ Object.defineProperty(exports, "getKickedGroups", {
3984
5073
  return getKickedGroups;
3985
5074
  }
3986
5075
  });
5076
+ Object.defineProperty(exports, "getLicenseFeatures", {
5077
+ enumerable: true,
5078
+ get: function() {
5079
+ return getLicenseFeatures;
5080
+ }
5081
+ });
3987
5082
  Object.defineProperty(exports, "getLicenseType", {
3988
5083
  enumerable: true,
3989
5084
  get: function() {
@@ -4038,6 +5133,12 @@ Object.defineProperty(exports, "getOrder", {
4038
5133
  return getOrder;
4039
5134
  }
4040
5135
  });
5136
+ Object.defineProperty(exports, "getPollResults", {
5137
+ enumerable: true,
5138
+ get: function() {
5139
+ return getPollResults;
5140
+ }
5141
+ });
4041
5142
  Object.defineProperty(exports, "getProcessStats", {
4042
5143
  enumerable: true,
4043
5144
  get: function() {
@@ -4242,6 +5343,12 @@ Object.defineProperty(exports, "messageOptionsParam", {
4242
5343
  return messageOptionsParam;
4243
5344
  }
4244
5345
  });
5346
+ Object.defineProperty(exports, "muteCall", {
5347
+ enumerable: true,
5348
+ get: function() {
5349
+ return muteCall;
5350
+ }
5351
+ });
4245
5352
  Object.defineProperty(exports, "muteChat", {
4246
5353
  enumerable: true,
4247
5354
  get: function() {
@@ -4254,6 +5361,12 @@ Object.defineProperty(exports, "nameParam", {
4254
5361
  return nameParam;
4255
5362
  }
4256
5363
  });
5364
+ Object.defineProperty(exports, "observeCallAudio", {
5365
+ enumerable: true,
5366
+ get: function() {
5367
+ return observeCallAudio;
5368
+ }
5369
+ });
4257
5370
  Object.defineProperty(exports, "onlyLocalParam", {
4258
5371
  enumerable: true,
4259
5372
  get: function() {
@@ -4266,6 +5379,12 @@ Object.defineProperty(exports, "pinChat", {
4266
5379
  return pinChat;
4267
5380
  }
4268
5381
  });
5382
+ Object.defineProperty(exports, "pinMessage", {
5383
+ enumerable: true,
5384
+ get: function() {
5385
+ return pinMessage;
5386
+ }
5387
+ });
4269
5388
  Object.defineProperty(exports, "postImageStatus", {
4270
5389
  enumerable: true,
4271
5390
  get: function() {
@@ -4284,6 +5403,12 @@ Object.defineProperty(exports, "postVideoStatus", {
4284
5403
  return postVideoStatus;
4285
5404
  }
4286
5405
  });
5406
+ Object.defineProperty(exports, "projectEffectSchema", {
5407
+ enumerable: true,
5408
+ get: function() {
5409
+ return projectEffectSchema;
5410
+ }
5411
+ });
4287
5412
  Object.defineProperty(exports, "promoteParticipant", {
4288
5413
  enumerable: true,
4289
5414
  get: function() {
@@ -4296,6 +5421,12 @@ Object.defineProperty(exports, "react", {
4296
5421
  return react;
4297
5422
  }
4298
5423
  });
5424
+ Object.defineProperty(exports, "rejectCall", {
5425
+ enumerable: true,
5426
+ get: function() {
5427
+ return rejectCall;
5428
+ }
5429
+ });
4299
5430
  Object.defineProperty(exports, "rejectGroupJoinRequest", {
4300
5431
  enumerable: true,
4301
5432
  get: function() {
@@ -4314,6 +5445,18 @@ Object.defineProperty(exports, "removeParticipant", {
4314
5445
  return removeParticipant;
4315
5446
  }
4316
5447
  });
5448
+ Object.defineProperty(exports, "requestPhoneNumber", {
5449
+ enumerable: true,
5450
+ get: function() {
5451
+ return requestPhoneNumber;
5452
+ }
5453
+ });
5454
+ Object.defineProperty(exports, "respondToEvent", {
5455
+ enumerable: true,
5456
+ get: function() {
5457
+ return respondToEvent;
5458
+ }
5459
+ });
4317
5460
  Object.defineProperty(exports, "revokeGroupInviteLink", {
4318
5461
  enumerable: true,
4319
5462
  get: function() {
@@ -4326,6 +5469,12 @@ Object.defineProperty(exports, "sendAdvancedButtons", {
4326
5469
  return sendAdvancedButtons;
4327
5470
  }
4328
5471
  });
5472
+ Object.defineProperty(exports, "sendAlbum", {
5473
+ enumerable: true,
5474
+ get: function() {
5475
+ return sendAlbum;
5476
+ }
5477
+ });
4329
5478
  Object.defineProperty(exports, "sendAudio", {
4330
5479
  enumerable: true,
4331
5480
  get: function() {
@@ -4350,6 +5499,12 @@ Object.defineProperty(exports, "sendContact", {
4350
5499
  return sendContact;
4351
5500
  }
4352
5501
  });
5502
+ Object.defineProperty(exports, "sendEvent", {
5503
+ enumerable: true,
5504
+ get: function() {
5505
+ return sendEvent;
5506
+ }
5507
+ });
4353
5508
  Object.defineProperty(exports, "sendFile", {
4354
5509
  enumerable: true,
4355
5510
  get: function() {
@@ -4440,6 +5595,12 @@ Object.defineProperty(exports, "sendSeen", {
4440
5595
  return sendSeen;
4441
5596
  }
4442
5597
  });
5598
+ Object.defineProperty(exports, "sendSticker", {
5599
+ enumerable: true,
5600
+ get: function() {
5601
+ return sendSticker;
5602
+ }
5603
+ });
4443
5604
  Object.defineProperty(exports, "sendText", {
4444
5605
  enumerable: true,
4445
5606
  get: function() {
@@ -4470,6 +5631,24 @@ Object.defineProperty(exports, "sendYouTubeLink", {
4470
5631
  return sendYouTubeLink;
4471
5632
  }
4472
5633
  });
5634
+ Object.defineProperty(exports, "serializeEventResponse", {
5635
+ enumerable: true,
5636
+ get: function() {
5637
+ return serializeEventResponse;
5638
+ }
5639
+ });
5640
+ Object.defineProperty(exports, "serializeWhatsAppEvent", {
5641
+ enumerable: true,
5642
+ get: function() {
5643
+ return serializeWhatsAppEvent;
5644
+ }
5645
+ });
5646
+ Object.defineProperty(exports, "setCallMedia", {
5647
+ enumerable: true,
5648
+ get: function() {
5649
+ return setCallMedia;
5650
+ }
5651
+ });
4473
5652
  Object.defineProperty(exports, "setChatEphemeral", {
4474
5653
  enumerable: true,
4475
5654
  get: function() {
@@ -4524,6 +5703,12 @@ Object.defineProperty(exports, "setProfilePicture", {
4524
5703
  return setProfilePicture;
4525
5704
  }
4526
5705
  });
5706
+ Object.defineProperty(exports, "sharePhoneNumber", {
5707
+ enumerable: true,
5708
+ get: function() {
5709
+ return sharePhoneNumber;
5710
+ }
5711
+ });
4527
5712
  Object.defineProperty(exports, "skipMyMessagesParam", {
4528
5713
  enumerable: true,
4529
5714
  get: function() {
@@ -4536,6 +5721,12 @@ Object.defineProperty(exports, "starMessage", {
4536
5721
  return starMessage;
4537
5722
  }
4538
5723
  });
5724
+ Object.defineProperty(exports, "startCall", {
5725
+ enumerable: true,
5726
+ get: function() {
5727
+ return startCall;
5728
+ }
5729
+ });
4539
5730
  Object.defineProperty(exports, "statusTextParam", {
4540
5731
  enumerable: true,
4541
5732
  get: function() {
@@ -4548,6 +5739,12 @@ Object.defineProperty(exports, "stickerDataParam", {
4548
5739
  return stickerDataParam;
4549
5740
  }
4550
5741
  });
5742
+ Object.defineProperty(exports, "stopCallAudioObserver", {
5743
+ enumerable: true,
5744
+ get: function() {
5745
+ return stopCallAudioObserver;
5746
+ }
5747
+ });
4551
5748
  Object.defineProperty(exports, "toParam", {
4552
5749
  enumerable: true,
4553
5750
  get: function() {
@@ -4590,6 +5787,12 @@ Object.defineProperty(exports, "unpinChat", {
4590
5787
  return unpinChat;
4591
5788
  }
4592
5789
  });
5790
+ Object.defineProperty(exports, "unpinMessage", {
5791
+ enumerable: true,
5792
+ get: function() {
5793
+ return unpinMessage;
5794
+ }
5795
+ });
4593
5796
  Object.defineProperty(exports, "unstarMessage", {
4594
5797
  enumerable: true,
4595
5798
  get: function() {
@@ -4608,12 +5811,30 @@ Object.defineProperty(exports, "userAgentParam", {
4608
5811
  return userAgentParam;
4609
5812
  }
4610
5813
  });
5814
+ Object.defineProperty(exports, "validateEventInput", {
5815
+ enumerable: true,
5816
+ get: function() {
5817
+ return validateEventInput;
5818
+ }
5819
+ });
5820
+ Object.defineProperty(exports, "validateEventUpdate", {
5821
+ enumerable: true,
5822
+ get: function() {
5823
+ return validateEventUpdate;
5824
+ }
5825
+ });
4611
5826
  Object.defineProperty(exports, "videoDataParam", {
4612
5827
  enumerable: true,
4613
5828
  get: function() {
4614
5829
  return videoDataParam;
4615
5830
  }
4616
5831
  });
5832
+ Object.defineProperty(exports, "voteOnPoll", {
5833
+ enumerable: true,
5834
+ get: function() {
5835
+ return voteOnPoll;
5836
+ }
5837
+ });
4617
5838
  Object.defineProperty(exports, "waitForIdParam", {
4618
5839
  enumerable: true,
4619
5840
  get: function() {
@@ -4627,4 +5848,4 @@ Object.defineProperty(exports, "withNewMessagesOnlyParam", {
4627
5848
  }
4628
5849
  });
4629
5850
 
4630
- //# sourceMappingURL=methods-BGmdzjd3.cjs.map
5851
+ //# sourceMappingURL=methods-DpDzgsbe.cjs.map