@open-wa/schema 5.10.0 → 5.11.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 (46) hide show
  1. package/dist/generated/index.cjs +1 -1
  2. package/dist/generated/index.cjs.map +1 -1
  3. package/dist/generated/index.d.cts +1 -3
  4. package/dist/generated/index.d.cts.map +1 -1
  5. package/dist/generated/index.d.mts +1 -3
  6. package/dist/generated/index.d.mts.map +1 -1
  7. package/dist/generated/index.mjs +1 -1
  8. package/dist/generated/index.mjs.map +1 -1
  9. package/dist/{index-DH0WRSA7.d.mts → index-DlfSVhzo.d.mts} +3 -4
  10. package/dist/index-DlfSVhzo.d.mts.map +1 -0
  11. package/dist/{index-BETdayaV.d.cts → index-JLPIa9s-.d.cts} +3 -4
  12. package/dist/index-JLPIa9s-.d.cts.map +1 -0
  13. package/dist/index.cjs +14 -8
  14. package/dist/index.cjs.map +1 -1
  15. package/dist/index.d.cts +1 -1
  16. package/dist/index.d.mts +1 -1
  17. package/dist/index.mjs +14 -8
  18. package/dist/index.mjs.map +1 -1
  19. package/dist/methods/index.cjs +1 -1
  20. package/dist/methods/index.d.cts +1 -1
  21. package/dist/methods/index.d.mts +1 -1
  22. package/dist/methods/index.mjs +1 -1
  23. package/dist/{methods-9kRJiEdZ.cjs → methods-CILSsPyT.cjs} +16 -17
  24. package/dist/methods-CILSsPyT.cjs.map +1 -0
  25. package/dist/{methods-NixIgGkq.mjs → methods-L7ijqbZM.mjs} +16 -17
  26. package/dist/methods-L7ijqbZM.mjs.map +1 -0
  27. package/package.json +3 -3
  28. package/src/__tests__/generators.contract.test.ts +82 -45
  29. package/src/events/asyncapi.ts +2 -2
  30. package/src/events/contracts.ts +10 -3
  31. package/src/events/polls.ts +1 -1
  32. package/src/generated/BaseClient.ts +12 -12
  33. package/src/generated/asyncapi.json +16 -7
  34. package/src/generated/openapi.json +29 -32
  35. package/src/methods/calls.ts +2 -2
  36. package/src/methods/contacts.ts +1 -1
  37. package/src/methods/groups.ts +2 -2
  38. package/src/methods/messaging.ts +7 -7
  39. package/src/methods/session.ts +1 -1
  40. package/src/methods/whatsapp-events.ts +1 -1
  41. package/src/parameters.ts +2 -2
  42. package/src/return-types.ts +1 -1
  43. package/dist/index-BETdayaV.d.cts.map +0 -1
  44. package/dist/index-DH0WRSA7.d.mts.map +0 -1
  45. package/dist/methods-9kRJiEdZ.cjs.map +0 -1
  46. package/dist/methods-NixIgGkq.mjs.map +0 -1
@@ -458,7 +458,6 @@ const HealthCheckSchema = z.object({
458
458
  state: z.string().optional(),
459
459
  isPhoneDisconnected: z.boolean().optional(),
460
460
  isHere: z.boolean().optional(),
461
- wapiInjected: z.boolean().optional(),
462
461
  online: z.boolean().optional(),
463
462
  tryingToReachPhone: z.boolean().optional(),
464
463
  retryingIn: z.number().optional(),
@@ -893,7 +892,7 @@ const messageIdsParam = z.union([z.array(messageIdParam), messageIdParam]).descr
893
892
  keyAliases: ["messages"]
894
893
  });
895
894
  const mentionedJidListParam = z.array(contactIdParam).optional().describe("List of mentioned contact IDs").register(parameterRegistry, { example: ["447123456789@c.us", "441234567890@c.us"] });
896
- const messageOptionsParam = z.unknown().optional().describe("Reserved for compatibility with legacy request shapes. The current sendText Client implementation ignores this argument; use reply() or sendTextWithMentions() for quoted replies and mentions.").register(parameterRegistry, { formatDescription: "Accepted as unknown for compatibility; currently ignored by sendText. Use reply() or sendTextWithMentions() for supported reply and mention behavior." });
895
+ const messageOptionsParam = z.unknown().optional().describe("Not used. Leave it out; use reply() for quoted replies and sendTextWithMentions() for mentions.").register(parameterRegistry, { formatDescription: "sendText ignores this value." });
897
896
  //#endregion
898
897
  //#region src/methods/messaging.ts
899
898
  /** The normalized serialized message key returned by the public sendText client. */
@@ -907,7 +906,7 @@ const StickerJobSchema = z.object({
907
906
  "auto",
908
907
  "browser",
909
908
  "standalone"
910
- ]).optional().describe("Defaults to browser when it supports the entire job; otherwise the entire job runs standalone."),
909
+ ]).optional().describe("Where the sticker is rendered. `auto` (the default) picks the best option for the whole job."),
911
910
  quality: z.number().min(.01).max(1).optional().describe("Maximum encoding quality; encoding can reduce quality to meet sticker byte limits."),
912
911
  fit: z.enum(["contain", "cover"]).optional(),
913
912
  circle: z.boolean().optional(),
@@ -921,7 +920,7 @@ const StickerJobSchema = z.object({
921
920
  }).strict();
922
921
  const sendSticker = defineMethodV2("sendSticker", {
923
922
  meta: {
924
- 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.",
923
+ description: "Turn an image or video into a sticker, apply optional effects and author and pack labels, and send it. Resolves to the message ID once WhatsApp accepts it, not a delivery receipt. If the outcome is unknown, check the chat before you retry.",
925
924
  action: "send",
926
925
  namespace: "messages",
927
926
  license: "none",
@@ -981,7 +980,7 @@ const sendAlbum = defineMethodV2("sendAlbum", {
981
980
  */
982
981
  const sendText = defineMethodV2("sendText", {
983
982
  meta: {
984
- description: "Sends a text message and returns a validated serialized message ID. The in-process Client throws SendTextError on failure. An unknown outcome means the message may have been sent: check the chat before retrying. Starting a chat with a new number requires an applied restricted or premium license.",
983
+ description: "Send a text message to a chat. Starting a chat with a number that has never messaged you needs a Restricted or Premium license.",
985
984
  action: "send",
986
985
  namespace: "messages",
987
986
  license: "none",
@@ -1085,7 +1084,7 @@ const sendPaymentRequest = defineMethodV2("sendPaymentRequest", {
1085
1084
  */
1086
1085
  const sendImage = defineMethodV2("sendImage", {
1087
1086
  meta: {
1088
- 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.",
1087
+ description: "Send an image or video, or any other media file, as a WhatsApp attachment. Options set the caption, view once, GIF playback or a round video note. Media is sent as is, without conversion. Resolves to the send result, not a delivery receipt.",
1089
1088
  action: "send",
1090
1089
  namespace: "messages",
1091
1090
  license: "none",
@@ -1399,7 +1398,7 @@ const sendListMessage = defineMethodV2("sendListMessage", {
1399
1398
  */
1400
1399
  const sendPoll = defineMethodV2("sendPoll", {
1401
1400
  meta: {
1402
- 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.",
1401
+ description: "Send a poll with a selection limit, an optional quoted message, an optional closing time in Unix milliseconds and optionally hidden voter names. Closing times and hidden names only work where WhatsApp supports them for the sending account and chat.",
1403
1402
  action: "send",
1404
1403
  namespace: "messages",
1405
1404
  license: "none",
@@ -1447,7 +1446,7 @@ const voteOnPoll = defineMethodV2("voteOnPoll", {
1447
1446
  });
1448
1447
  const getPollResults = defineMethodV2("getPollResults", {
1449
1448
  meta: {
1450
- 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.",
1449
+ description: "Get the current counts, choices and votes for a poll. Polls with hidden voters leave out voter identities and the votes array, and very recent votes may not appear yet.",
1451
1450
  action: "get",
1452
1451
  namespace: "messages",
1453
1452
  license: "none",
@@ -1834,7 +1833,7 @@ const unstarMessage = defineMethodV2("unstarMessage", {
1834
1833
  });
1835
1834
  const editMessage = defineMethodV2("editMessage", {
1836
1835
  meta: {
1837
- description: "Edits the text of a message through the installed private patch",
1836
+ description: "Edit the text of a message you sent",
1838
1837
  action: "update",
1839
1838
  namespace: "messages",
1840
1839
  license: "none",
@@ -2172,7 +2171,7 @@ const requestPhoneNumber = defineMethodV2("requestPhoneNumber", {
2172
2171
  });
2173
2172
  const sharePhoneNumber = defineMethodV2("sharePhoneNumber", {
2174
2173
  meta: {
2175
- 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.",
2174
+ description: "Share the logged-in account’s own phone number in a one-to-one chat that only shows a LID. You can’t share any other number.",
2176
2175
  action: "send",
2177
2176
  namespace: "contacts",
2178
2177
  license: "none",
@@ -2368,10 +2367,10 @@ const getGroupMembersId = defineMethodV2("getGroupMembersId", {
2368
2367
  const GroupInfoSchema = z.object({
2369
2368
  title: z.string(),
2370
2369
  description: z.string().nullish()
2371
- }).passthrough().describe("Group title and description returned by the private getGroupInfo patch.");
2370
+ }).passthrough().describe("The group title and description.");
2372
2371
  const getGroupInfo = defineMethodV2("getGroupInfo", {
2373
2372
  meta: {
2374
- description: "Get the group title and description through the installed private patch",
2373
+ description: "Get a group title and description",
2375
2374
  action: "read",
2376
2375
  namespace: "groups",
2377
2376
  license: "none",
@@ -3122,7 +3121,7 @@ const getLicenseType = defineMethodV2("getLicenseType", {
3122
3121
  });
3123
3122
  const getLicenseFeatures = defineMethodV2("getLicenseFeatures", {
3124
3123
  meta: {
3125
- description: "Get enabled and disabled licensed features from the accepted licence patch. This reports licence access; actions check runtime availability automatically.",
3124
+ description: "List which licensed features your license key turns on. Each method still checks availability when you call it.",
3126
3125
  action: "read",
3127
3126
  namespace: "session",
3128
3127
  license: "none",
@@ -3433,7 +3432,7 @@ const register = (name, input, output, parameters, description) => defineMethodV
3433
3432
  output: projectEffectSchema(output)
3434
3433
  });
3435
3434
  const getCallCapabilities = register("getCallCapabilities", Schema.Struct({}), CallCapabilitiesSchema, [], "Optional calling availability for UI and diagnostics. Actions perform admission automatically.");
3436
- const getActiveCall = register("getActiveCall", Schema.Struct({}), Schema.NullOr(CallSnapshotSchema), [], "Get the current call snapshot. SDK clients hydrate its bound methods.");
3435
+ const getActiveCall = register("getActiveCall", Schema.Struct({}), Schema.NullOr(CallSnapshotSchema), [], "Get the current call, if there is one. In the SDK the result also has methods to control the call.");
3437
3436
  const acceptCall = register("acceptCall", actionInput, CallActionResultSchema, ["call", "media"], "Prepare media and accept this incoming call.");
3438
3437
  const startCall = register("startCall", Schema.Struct({
3439
3438
  to: Schema.String,
@@ -3446,7 +3445,7 @@ const startCall = register("startCall", Schema.Struct({
3446
3445
  "speaker",
3447
3446
  "camera"
3448
3447
  ], "Prepare media and place an outgoing audio or video call.");
3449
- const rejectCall = register("rejectCall", Schema.Struct({ call: CallIdentitySchema }), CallActionResultSchema, ["call"], "Reject this call with native state confirmation.");
3448
+ const rejectCall = register("rejectCall", Schema.Struct({ call: CallIdentitySchema }), CallActionResultSchema, ["call"], "Reject an incoming call and wait for WhatsApp to confirm it.");
3450
3449
  const endCall = register("endCall", Schema.Struct({ call: CallIdentitySchema }), CallActionResultSchema, ["call"], "Request hangup for this call.");
3451
3450
  const muteCall = register("muteCall", Schema.Struct({
3452
3451
  call: CallIdentitySchema,
@@ -3553,7 +3552,7 @@ const respondToEvent = defineMethodV2("respondToEvent", {
3553
3552
  ...meta,
3554
3553
  action: "send",
3555
3554
  httpMethod: "POST",
3556
- description: "RSVP through WhatsApp’s native encrypted event-response action."
3555
+ description: "Send your RSVP to a WhatsApp event."
3557
3556
  },
3558
3557
  input: z.object({
3559
3558
  eventId: messageIdParam,
@@ -3569,4 +3568,4 @@ const respondToEvent = defineMethodV2("respondToEvent", {
3569
3568
  //#endregion
3570
3569
  export { getBusinessProfile as $, StorySchema as $i, sendSeen as $n, UnixSecondsToDateSchema as $r, archiveChat as $t, sendInteractive as A, validateEventInput as Aa, BusinessProfileSchema as Ai, getUnsentMessages as An, nameParam as Ar, joinGroupViaLink as At, getLoadedMessageCount as B, GroupCreationResultSchema as Bi, sendContact as Bn, Base64ToDataUrlSchema as Br, setGroupToAdminsOnly as Bt, CallMediaOptionsSchema as C, WhatsAppEventSchema as Ca, AutoMediaSendOptionsSchema as Ci, getAllMessages as Cn, latitudeParam as Cr, getAllGroups as Ct, RawAudioFormatSchema as D, deserializeWhatsAppEvent as Da, MediaSendOptionsSchema as Di, getMyLastMessage as Dn, messageIdParam as Dr, getGroupMembers as Dt, MediaDescriptorSchema as E, deserializeEventResponse as Ea, ImageSendOptionsSchema as Ei, getMessagesForLLM as En, mentionedJidListParam as Er, getGroupInviteLink as Et, getConnectionState as F, CommunityMetadataSchema as Fi, sendAdvancedButtons as Fn, toParam as Fr, revokeGroupInviteLink as Ft, getWAVersion as G, LicenseTypeSchema as Gi, sendListMessage as Gn, FileToDataUrlSchema as Gr, getBlockedIds as Gt, getProcessStats as H, HostAccountSchema as Hi, sendFileFromUrl as Hn, ChatIdSchema as Hr, checkNumberStatus as Ht, getFeatures as I, CommunityParticipantIdsSchema as Ii, sendAlbum as In, userAgentParam as Ir, setGroupDescription as It, setMyName as J, NumberCheckSchema as Ji, sendMultipleContacts as Jn, HexColorSchema as Jr, getNumberProfile as Jt, healthCheck as K, MessageInfoSchema as Ki, sendLocation as Kn, GroupIdCodecSchema as Kr, getCommonGroups as Kt, getHostNumber as L, CommunityParticipantsSchema as Li, sendAudio as Ln, videoDataParam as Lr, setGroupEditToAdminsOnly as Lt, decryptMedia as M, CommonGroupSchema as Mi, loadEarlierMessages as Mn, skipMyMessagesParam as Mr, promoteParticipant as Mt, downloadMedia as N, CommunityAdminIdsSchema as Ni, pinMessage as Nn, statusTextParam as Nr, rejectGroupJoinRequest as Nt, SendInteractiveInputSchema as O, serializeEventResponse as Oa, VideoSendOptionsSchema as Oi, getPollResults as On, messageIdsParam as Or, getGroupMembersId as Ot, getBatteryLevel as P, CommunityAdminsSchema as Pi, react as Pn, stickerDataParam as Pr, removeParticipant as Pt, getBusinessProducts as Q, ProductSchema as Qi, sendReplyWithMentions as Qn, UnixMillisToDateSchema as Qr, unblockContact as Qt, getLicenseFeatures as R, ContactStatusSchema as Ri, sendBanner as Rn, waitForIdParam as Rr, setGroupIcon as Rt, CallIdentitySchema as S, EventUpdateSchema as Sa, AudioSendOptionsSchema as Si, getAlbumMessages as Sn, includeNotificationsParam as Sr, demoteParticipant as St, CallSnapshotSchema as T, decodeWhatsAppEvent as Ta, GifSendOptionsSchema as Ti, getMessageInfo as Tn, longitudeParam as Tr, getGroupInfo as Tt, getSnapshot as U, LLMMessageSchema as Ui, sendImage as Un, ContactIdCodecSchema as Ur, checkReadReceipts as Ut, getMe as V, HealthCheckSchema as Vi, sendFile as Vn, ChatIdCodecSchema as Vr, blockContact as Vt, getUserAgent as W, LabelSchema as Wi, sendLinkWithAutoPreview as Wn, ContactIdSchema as Wr, getAllContacts as Wt, setProfilePicture as X, OrderSchema as Xi, sendPoll as Xn, MessageIdCodecSchema as Xr, requestPhoneNumber as Xt, setMyStatus as Y, NumberProfileSchema as Yi, sendPaymentRequest as Yn, IsoDatetimeToDateSchema as Yr, getProfilePicture as Yt, LicenseFeaturesSchema as Z, ProcessStatsSchema as Zi, sendPtt as Zn, MessageIdSchema as Zr, sharePhoneNumber as Zt, startCall as _, EventInputSchema as _a, PinDurationSchema as _i, SendTextResultSchema as _n, fileDataParam as _r, getCommunityParticipants as _t, getEvents as a, GroupIdSchema$1 as aa, fileToBufferCodec as ai, getChatWithNonContacts as an, sendYouTubeLink as ar, deleteAllStatus as at, CallCapabilitiesSchema as b, EventResponseSchema as ba, PollVoteSchema as bi, editMessage as bn, imageDataParam as br, approveGroupJoinRequest as bt, acceptCall as c, LocationSchema as ca, fileToTempPathCodec as ci, markAsUnread as cn, unstarMessage as cr, getStories as ct, getActiveCall as d, MessageSchema as da, isoDatetimeToDate as di, setChatEphemeral as dn, captionParam as dr, postVideoStatus as dt, ChatSchema as ea, base64ToDataUrlCodec as ei, clearChat as en, sendSticker as er, getOrder as et, getCallCapabilities as f, MessageTypes as fa, jsonStringCodec as fi, unarchiveChat as fn, chatIdParam as fr, getAllCommunities as ft, setCallMedia as g, WhatsAppEventRegistrySchema as ga, urlToDataUrlCodec as gi, AlbumSendResultSchema as gn, documentDataParam as gr, getCommunityParticipantIds as gt, rejectCall as h, EventResponseRegistrySchema as ha, unixSecondsToDate as hi, AlbumMediaSchema as hn, contentParam as hr, getCommunityInfo as ht, getEventResponses as i, GroupChatIdSchema as ia, fileToBase64Codec as ii, getChat as in, sendVideoAsGif as ir, removeLabel as it, sendRawMessage as j, validateEventUpdate as ja, CartItemSchema as ji, getVCards as jn, onlyLocalParam as jr, leaveGroup as jt, SendRawMessageInputSchema as k, serializeWhatsAppEvent as ka, VoiceNoteOptionsSchema as ki, getStarredMessages as kn, messageOptionsParam as kr, getKickedGroups as kt, clearCallAudio as l, MessageAck as la, groupIdCodec as li, muteChat as ln, voteOnPoll as lr, postImageStatus as lt, observeCallAudio as m, SimpleListener as ma, unixMillisToDate as mi, unpinChat as mn, contactIdParam as mr, getCommunityAdmins as mt, editEvent as n, ContactSchema as na, contactIdCodec as ni, getAllChatIds as nn, sendTextWithMentions as nr, getAllLabels as nt, respondToEvent as o, GroupMetadataSchema as oa, fileToDataUrlCodec as oi, isChatOnline as on, starMessage as or, deleteStatus as ot, muteCall as p, SerializedMessageIdSchema as pa, messageIdCodec as pi, unmuteChat as pn, communityIdParam as pr, getCommunityAdminIds as pt, isPlugged as q, MessageInteractionSchema as qi, sendMessageWithThumb as qn, GroupIdSchema as qr, getContact as qt, getEvent as r, DataURLSchema as ra, createFileCodec as ri, getAllChats as rn, sendVCard as rr, getChatsByLabel as rt, sendEvent as s, IdSchema as sa, fileToStreamCodec as si, markAsRead as sn, unpinMessage as sr, getStatus as st, cancelEvent as t, ContactIdSchema$1 as ta, chatIdCodec as ti, deleteChat as tn, sendText as tr, addLabel as tt, endCall as u, MessageIdReturnSchema as ua, hexColorCodec as ui, pinChat as un, audioDataParam as ur, postTextStatus as ut, stopCallAudioObserver as v, EventListOptionsSchema as va, PollResultsSchema as vi, StickerJobSchema as vn, filenameParam as vr, GroupInfoSchema as vt, CallReasonSchema as w, decodeEventResponse as wa, DocumentSendOptionsSchema as wi, getMessageById as wn, locationNameParam as wr, getGroupAdmins as wt, CallEndReasonSchema as x, EventResponseTypeSchema as xa, AudioAttachmentOptionsSchema as xi, forwardMessages as xn, includeMeParam as xr, createGroup as xt, CallActionResultSchema as y, EventPageSchema as ya, PollSendOptionsSchema as yi, deleteMessage as yn, groupIdParam as yr, addParticipant as yt, getLicenseType as z, FeatureFlagsSchema as zi, sendButtons as zn, withNewMessagesOnlyParam as zr, setGroupTitle as zt };
3571
3570
 
3572
- //# sourceMappingURL=methods-NixIgGkq.mjs.map
3571
+ //# sourceMappingURL=methods-L7ijqbZM.mjs.map