@nanazx/baileys 1.0.0 → 1.0.1

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.
@@ -73,7 +73,6 @@ const executeWWWGraphQL = async (
73
73
  return parseGraphQLResponse(json, dataPath)
74
74
  }
75
75
 
76
- export { executeWWWGraphQL }
77
76
 
78
77
  /**
79
78
  * Execute a facebook-schema GraphQL query over HTTPS.
@@ -92,7 +91,6 @@ export { executeWWWGraphQL }
92
91
  const executeFacebookGraphQL = (docId, variables, accessToken, dataPath = null, lang = 'en') =>
93
92
  executeWWWGraphQL(docId, variables, accessToken, dataPath, lang, ENDPOINTS.ACS)
94
93
 
95
- export { executeFacebookGraphQL }
96
94
 
97
95
  /**
98
96
  * Execute a wamo-schema GraphQL query over HTTPS.
@@ -131,7 +129,6 @@ const executeWamoGraphQL = async (docId, variables, wamoAuth = {}, dataPath = nu
131
129
  return parseGraphQLResponse(json, dataPath)
132
130
  }
133
131
 
134
- export { executeWamoGraphQL }
135
132
 
136
133
  // ── Wamo schema IDs (whatsapp-android-wamo_client_persist_ids.json) ──────────
137
134
  const WAMO_GQL_IDS = {
package/lib/Socket/mex.js CHANGED
@@ -1,42 +1,4 @@
1
- import { Boom } from '@hapi/boom';
2
- import { getBinaryNodeChild, S_WHATSAPP_NET } from '../WABinary/index.js';
3
- const wMexQuery = (variables, queryId, query, generateMessageTag) => {
4
- return query({
5
- tag: 'iq',
6
- attrs: {
7
- id: generateMessageTag(),
8
- type: 'get',
9
- to: S_WHATSAPP_NET,
10
- xmlns: 'w:mex'
11
- },
12
- content: [
13
- {
14
- tag: 'query',
15
- attrs: { query_id: queryId },
16
- content: Buffer.from(JSON.stringify({ variables }), 'utf-8')
17
- }
18
- ]
19
- });
20
- };
21
- export const executeWMexQuery = async (variables, queryId, dataPath, query, generateMessageTag) => {
22
- const result = await wMexQuery(variables, queryId, query, generateMessageTag);
23
- const child = getBinaryNodeChild(result, 'result');
24
- if (child?.content) {
25
- const data = JSON.parse(child.content.toString());
26
- if (data.errors && data.errors.length > 0) {
27
- const errorMessages = data.errors.map((err) => err.message || 'Unknown error').join(', ');
28
- const firstError = data.errors[0];
29
- const errorCode = firstError.extensions?.error_code || 400;
30
- throw new Boom(`GraphQL server error: ${errorMessages}`, { statusCode: errorCode, data: firstError });
31
- }
32
- const response = dataPath ? data?.data?.[dataPath] : data?.data;
33
- if (typeof response !== 'undefined') {
34
- return response;
35
- }
36
- }
37
- const action = (dataPath || '').startsWith('xwa2_')
38
- ? dataPath.substring(5).replace(/_/g, ' ')
39
- : dataPath?.replace(/_/g, ' ');
40
- throw new Boom(`Failed to ${action}, unexpected response structure.`, { statusCode: 400, data: result });
41
- };
42
- //# sourceMappingURL=mex.js.map
1
+ // XWAPaths dan QueryIds versi lama (Mex.js) digantikan oleh Newsletter.js yang merupakan superset-nya.
2
+ // Di-re-export dari sini agar kode yang sudah import dari Mex.js tetap kompatibel.
3
+ export { XWAPaths, QueryIds } from './Newsletter.js';
4
+ //# sourceMappingURL=Mex.js.map
@@ -791,7 +791,7 @@ export function getAggregateVotesInPollMessage({ message, pollUpdates }, meId) {
791
791
  * @param meId your jid
792
792
  * @returns A list of response types & their responders
793
793
  */
794
- export function getAggregateResponsesInEventMessage({ eventResponses }, meId) {
794
+ export function getAggregateResponsesInEventMessageLegacy({ eventResponses }, meId) {
795
795
  const responseTypes = ['GOING', 'NOT_GOING', 'MAYBE'];
796
796
  const responseMap = {};
797
797
  for (const type of responseTypes) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@nanazx/baileys",
3
3
  "type": "module",
4
- "version": "1.0.0",
4
+ "version": "1.0.1",
5
5
  "description": "Original Baileys, but with additional features",
6
6
  "keywords": [
7
7
  "whatsapp",