@violetix/baileys 0.5.6 → 0.6.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.
- package/README.md +1530 -2009
- package/WAProto/index.d.ts +14030 -14586
- package/WAProto/index.js +58426 -88874
- package/lib/Defaults/index.d.ts +2 -7
- package/lib/Defaults/index.js +5 -20
- package/lib/Signal/Group/sender-key-message.js +19 -1
- package/lib/Signal/libsignal.js +82 -29
- package/lib/Signal/xeddsa-fast.js +114 -0
- package/lib/Socket/Client/types.js +6 -8
- package/lib/Socket/Client/websocket.js +3 -38
- package/lib/Socket/business.d.ts +0 -3
- package/lib/Socket/chats.d.ts +0 -3
- package/lib/Socket/chats.js +18 -45
- package/lib/Socket/communities.d.ts +0 -3
- package/lib/Socket/graphql.js +3 -7
- package/lib/Socket/groups.d.ts +0 -3
- package/lib/Socket/groups.js +3 -8
- package/lib/Socket/index.d.ts +15 -17
- package/lib/Socket/messages-recv.d.ts +0 -3
- package/lib/Socket/messages-recv.js +43 -127
- package/lib/Socket/messages-send.d.ts +0 -4
- package/lib/Socket/messages-send.js +63 -191
- package/lib/Socket/newsletter.d.ts +0 -3
- package/lib/Socket/newsletter.js +1 -2
- package/lib/Socket/newsletter.js.map +1 -1
- package/lib/Socket/socket.d.ts +0 -9
- package/lib/Socket/socket.js +53 -346
- package/lib/Store/make-in-memory-store.js +30 -41
- package/lib/Types/Auth.d.ts +2 -60
- package/lib/Types/Bussines.d.ts +2 -9
- package/lib/Types/Call.d.ts +2 -22
- package/lib/Types/Chat.d.ts +1 -2
- package/lib/Types/Contact.d.ts +2 -11
- package/lib/Types/Events.d.ts +2 -41
- package/lib/Types/GroupMetadata.d.ts +2 -36
- package/lib/Types/Message.d.ts +1 -11
- package/lib/Types/Product.d.ts +2 -5
- package/lib/Types/Signal.d.ts +2 -10
- package/lib/Types/Socket.d.ts +2 -33
- package/lib/Types/USync.d.ts +2 -9
- package/lib/Types/index.d.ts +1 -3
- package/lib/Utils/auth-utils.d.ts +2 -3
- package/lib/Utils/auth-utils.js +53 -37
- package/lib/Utils/business.js +11 -25
- package/lib/Utils/chat-utils.js +4 -6
- package/lib/Utils/decode-wa-message.js +2 -2
- package/lib/Utils/event-buffer.js +12 -21
- package/lib/Utils/generics.d.ts +5 -5
- package/lib/Utils/generics.js +7 -25
- package/lib/Utils/history.d.ts +1 -2
- package/lib/Utils/history.js +83 -137
- package/lib/Utils/index.d.ts +0 -4
- package/lib/Utils/index.js +0 -4
- package/lib/Utils/listener-guard.js +0 -2
- package/lib/Utils/message-retry-manager.js +0 -20
- package/lib/Utils/messages-media.d.ts +8 -39
- package/lib/Utils/messages-media.js +89 -218
- package/lib/Utils/messages.d.ts +0 -1
- package/lib/Utils/messages.js +36 -122
- package/lib/Utils/process-message.d.ts +0 -18
- package/lib/Utils/process-message.js +47 -99
- package/lib/Utils/rich-message-utils.js +4 -3
- package/lib/Utils/use-multi-file-auth-state.d.ts +3 -5
- package/lib/Utils/use-multi-file-auth-state.js +6 -27
- package/lib/Utils/use-single-file-auth-state.d.ts +1 -1
- package/lib/Utils/use-single-file-auth-state.js +3 -12
- package/lib/WABinary/types.d.ts +2 -6
- package/lib/WAUSync/Protocols/USyncBusinessProtocol.js +3 -6
- package/lib/WAUSync/Protocols/USyncContactProtocol.js +2 -3
- package/lib/WAUSync/USyncQuery.d.ts +1 -1
- package/lib/WAUSync/USyncQuery.js +4 -7
- package/package.json +107 -123
- package/lib/Utils/a2ui.d.ts +0 -50
- package/lib/Utils/a2ui.js +0 -168
- package/lib/Utils/anchor-guard.d.ts +0 -71
- package/lib/Utils/anchor-guard.js +0 -404
- package/lib/Utils/connection-manager.d.ts +0 -44
- package/lib/Utils/connection-manager.js +0 -258
- package/lib/Utils/ignore-key.d.ts +0 -51
- package/lib/Utils/ignore-key.js +0 -176
|
@@ -51,11 +51,7 @@ const makeDebouncedSaver = (filePath, getData, logger, delayMs = 500) => {
|
|
|
51
51
|
clearTimeout(timer);
|
|
52
52
|
try {
|
|
53
53
|
writeFileSync(filePath, JSON.stringify(getData(), BufferJSON.replacer));
|
|
54
|
-
} catch
|
|
55
|
-
// Last-chance save on the way out. Nothing left to retry with, but a silent
|
|
56
|
-
// failure here loses the session and looks like a random logout next boot.
|
|
57
|
-
logger?.error?.({ err, filePath }, 'Failed to save credentials on exit');
|
|
58
|
-
}
|
|
54
|
+
} catch { }
|
|
59
55
|
}
|
|
60
56
|
};
|
|
61
57
|
|
|
@@ -86,7 +82,7 @@ const makeDebouncedSaver = (filePath, getData, logger, delayMs = 500) => {
|
|
|
86
82
|
return { save, flush: flushNow, destroy };
|
|
87
83
|
};
|
|
88
84
|
|
|
89
|
-
export const useMultiFileAuthState = async (folder
|
|
85
|
+
export const useMultiFileAuthState = async (folder) => {
|
|
90
86
|
const writeData = async (data, file) => {
|
|
91
87
|
const filePath = join(folder, fixFileName(file));
|
|
92
88
|
const mutex = getFileLock(filePath);
|
|
@@ -111,13 +107,7 @@ export const useMultiFileAuthState = async (folder, logger) => {
|
|
|
111
107
|
release();
|
|
112
108
|
}
|
|
113
109
|
});
|
|
114
|
-
} catch
|
|
115
|
-
// A missing file is the normal "no such key yet" answer. Anything else — corrupt
|
|
116
|
-
// JSON, bad permissions — also yields null, which silently starts a fresh pairing,
|
|
117
|
-
// so it is logged rather than swallowed.
|
|
118
|
-
if (err?.code !== 'ENOENT') {
|
|
119
|
-
logger?.warn?.({ err, file }, 'Failed to read auth state file');
|
|
120
|
-
}
|
|
110
|
+
} catch {
|
|
121
111
|
return null;
|
|
122
112
|
}
|
|
123
113
|
};
|
|
@@ -129,12 +119,7 @@ export const useMultiFileAuthState = async (folder, logger) => {
|
|
|
129
119
|
return mutex.acquire().then(async (release) => {
|
|
130
120
|
try {
|
|
131
121
|
await unlink(filePath);
|
|
132
|
-
} catch
|
|
133
|
-
// Deleting a key that was never written is normal.
|
|
134
|
-
if (err?.code !== 'ENOENT') {
|
|
135
|
-
logger?.warn?.({ err, file }, 'Failed to remove auth state file');
|
|
136
|
-
}
|
|
137
|
-
}
|
|
122
|
+
} catch { }
|
|
138
123
|
finally {
|
|
139
124
|
release();
|
|
140
125
|
}
|
|
@@ -154,7 +139,7 @@ export const useMultiFileAuthState = async (folder, logger) => {
|
|
|
154
139
|
const fixFileName = (file) => file?.replace(/\//g, '__')?.replace(/:/g, '-');
|
|
155
140
|
const creds = (await readData('creds.json')) || initAuthCreds();
|
|
156
141
|
const credsPath = join(folder, 'creds.json');
|
|
157
|
-
const debouncer = makeDebouncedSaver(credsPath, () => creds,
|
|
142
|
+
const debouncer = makeDebouncedSaver(credsPath, () => creds, null, 500);
|
|
158
143
|
|
|
159
144
|
return {
|
|
160
145
|
state: {
|
|
@@ -185,12 +170,6 @@ export const useMultiFileAuthState = async (folder, logger) => {
|
|
|
185
170
|
}
|
|
186
171
|
},
|
|
187
172
|
saveCreds: debouncer.save,
|
|
188
|
-
_flushCreds: debouncer.flush
|
|
189
|
-
/**
|
|
190
|
-
* Drops the process exit/SIGINT/SIGTERM listeners this auth state installed. A long-lived
|
|
191
|
-
* host that opens and closes many sessions leaks one set per call without it, and Node
|
|
192
|
-
* starts warning about listener counts after eleven.
|
|
193
|
-
*/
|
|
194
|
-
_destroy: debouncer.destroy
|
|
173
|
+
_flushCreds: debouncer.flush
|
|
195
174
|
};
|
|
196
175
|
};
|
|
@@ -8,7 +8,7 @@ import { Mutex } from 'async-mutex';
|
|
|
8
8
|
// Lia@Changes 25-03-26 --- Add useSingleFileAuthState with integrated cache
|
|
9
9
|
const FLUSH_TIMEOUT_MS = 3000;
|
|
10
10
|
// Lia@Changes 22-04-26 --- Enhanced useSingleFileAuthState with LRUCache
|
|
11
|
-
export const useSingleFileAuthState = async (fileName
|
|
11
|
+
export const useSingleFileAuthState = async (fileName) => {
|
|
12
12
|
const cache = new LRUCache({
|
|
13
13
|
max: 20000,
|
|
14
14
|
ttl: 1000 * DEFAULT_CACHE_TTLS.SIGNAL_STORE,
|
|
@@ -32,12 +32,7 @@ export const useSingleFileAuthState = async (fileName, logger) => {
|
|
|
32
32
|
cache.set(keyName, value);
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
-
catch
|
|
36
|
-
// A missing file is a fresh session. Corrupt JSON or bad permissions also land
|
|
37
|
-
// here and silently discard a working session, so they are logged.
|
|
38
|
-
if (err?.code !== 'ENOENT') {
|
|
39
|
-
logger?.warn?.({ err, fileName }, 'Failed to load auth state file, starting empty');
|
|
40
|
-
}
|
|
35
|
+
catch {
|
|
41
36
|
fileData = {};
|
|
42
37
|
}
|
|
43
38
|
isLoaded = true;
|
|
@@ -54,11 +49,7 @@ export const useSingleFileAuthState = async (fileName, logger) => {
|
|
|
54
49
|
await writeFile(tempFile, JSON.stringify(fileData, BufferJSON.replacer));
|
|
55
50
|
await rename(tempFile, fileName);
|
|
56
51
|
}
|
|
57
|
-
catch
|
|
58
|
-
// Swallowing this lost every key written since the last successful flush with
|
|
59
|
-
// no trace, which surfaces later as a session that cannot decrypt.
|
|
60
|
-
logger?.error?.({ err, fileName }, 'Failed to flush auth state file');
|
|
61
|
-
}
|
|
52
|
+
catch { }
|
|
62
53
|
});
|
|
63
54
|
}, FLUSH_TIMEOUT_MS);
|
|
64
55
|
};
|
package/lib/WABinary/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getBinaryNodeChild, getBinaryNodeChildren } from '../../WABinary/index.js';
|
|
1
|
+
import { assertNodeErrorFree, getBinaryNodeChild, getBinaryNodeChildren } from '../../WABinary/index.js';
|
|
2
2
|
export class USyncBusinessProtocol {
|
|
3
3
|
constructor(profileVersion = '2') {
|
|
4
4
|
this.name = 'business'
|
|
@@ -10,8 +10,7 @@ export class USyncBusinessProtocol {
|
|
|
10
10
|
attrs: {},
|
|
11
11
|
content: [
|
|
12
12
|
{ tag: 'verified_name', attrs: {} },
|
|
13
|
-
|
|
14
|
-
...(this.profileVersion ? [{ tag: 'profile', attrs: { v: this.profileVersion } }] : [])
|
|
13
|
+
{ tag: 'profile', attrs: { v: this.profileVersion } }
|
|
15
14
|
]
|
|
16
15
|
}
|
|
17
16
|
}
|
|
@@ -27,9 +26,7 @@ export class USyncBusinessProtocol {
|
|
|
27
26
|
}
|
|
28
27
|
parser(node) {
|
|
29
28
|
if (node.tag !== 'business') return null
|
|
30
|
-
|
|
31
|
-
// not a query failure, so it must not abort the whole usync result
|
|
32
|
-
if (getBinaryNodeChild(node, 'error')) return null
|
|
29
|
+
assertNodeErrorFree(node)
|
|
33
30
|
const verifiedNameNode = getBinaryNodeChild(node, 'verified_name')
|
|
34
31
|
const profileNode = getBinaryNodeChild(node, 'profile')
|
|
35
32
|
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { assertNodeErrorFree } from '../../WABinary/index.js';
|
|
2
2
|
import { USyncUser } from '../USyncUser.js';
|
|
3
3
|
export class USyncContactProtocol {
|
|
4
|
-
constructor(
|
|
4
|
+
constructor() {
|
|
5
5
|
this.name = 'contact';
|
|
6
|
-
this.addressingMode = addressingMode;
|
|
7
6
|
}
|
|
8
7
|
getQueryElement() {
|
|
9
8
|
return {
|
|
10
9
|
tag: 'contact',
|
|
11
|
-
attrs:
|
|
10
|
+
attrs: {}
|
|
12
11
|
};
|
|
13
12
|
}
|
|
14
13
|
getUserElement(user) {
|
|
@@ -17,7 +17,7 @@ export class USyncQuery {
|
|
|
17
17
|
sideList: any[];
|
|
18
18
|
} | undefined;
|
|
19
19
|
withDeviceProtocol(): this;
|
|
20
|
-
withContactProtocol(
|
|
20
|
+
withContactProtocol(): this;
|
|
21
21
|
withStatusProtocol(): this;
|
|
22
22
|
withDisappearingModeProtocol(): this;
|
|
23
23
|
withBotProfileProtocol(): this;
|
|
@@ -61,10 +61,7 @@ export class USyncQuery {
|
|
|
61
61
|
}
|
|
62
62
|
const parseUserNodes = (nodes) => nodes.reduce((acc, node) => {
|
|
63
63
|
const id = node?.attrs.jid;
|
|
64
|
-
|
|
65
|
-
// username key before it reveals the account; keep the row so callers can see that
|
|
66
|
-
const keyRequired = !id && !!getBinaryNodeChild(node, 'contact')?.attrs?.username;
|
|
67
|
-
if (id || keyRequired) {
|
|
64
|
+
if (id) {
|
|
68
65
|
// a user-level error attr means the contact has blocked us; WA uses
|
|
69
66
|
// 401/403/405 on the <user> node in that case
|
|
70
67
|
const userErrorCode = node?.attrs?.error ? parseInt(node.attrs.error, 10) : 0;
|
|
@@ -118,7 +115,7 @@ export class USyncQuery {
|
|
|
118
115
|
if (isBlockedByAttr) {
|
|
119
116
|
data.isBlockedByContact = true;
|
|
120
117
|
}
|
|
121
|
-
acc.push({ ...data, id
|
|
118
|
+
acc.push({ ...data, id });
|
|
122
119
|
}
|
|
123
120
|
return acc;
|
|
124
121
|
}, []);
|
|
@@ -136,8 +133,8 @@ export class USyncQuery {
|
|
|
136
133
|
this.protocols.push(new USyncDeviceProtocol());
|
|
137
134
|
return this;
|
|
138
135
|
}
|
|
139
|
-
withContactProtocol(
|
|
140
|
-
this.protocols.push(new USyncContactProtocol(
|
|
136
|
+
withContactProtocol() {
|
|
137
|
+
this.protocols.push(new USyncContactProtocol());
|
|
141
138
|
return this;
|
|
142
139
|
}
|
|
143
140
|
withStatusProtocol() {
|
package/package.json
CHANGED
|
@@ -1,125 +1,109 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
"
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
"
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
"
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
"
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
"picomatch@npm:^2.0.4": "^2.3.2",
|
|
110
|
-
"picomatch@npm:^2.3.1": "^2.3.2",
|
|
111
|
-
"picomatch@npm:^4.0.0": "^4.0.4",
|
|
112
|
-
"picomatch@npm:^4.0.2": "^4.0.4",
|
|
113
|
-
"socks": "^2.8.8",
|
|
114
|
-
"tar": "^7.5.11",
|
|
115
|
-
"tmp": "^0.2.5",
|
|
116
|
-
"underscore": "^1.13.8",
|
|
117
|
-
"yaml@npm:^2.6.1": "^2.8.4"
|
|
118
|
-
},
|
|
119
|
-
"packageManager": "yarn@4.9.2",
|
|
120
|
-
"devDependencies": {
|
|
121
|
-
"@types/node": "^20.19.43",
|
|
122
|
-
"protobufjs-cli": "^1.3.3",
|
|
123
|
-
"typescript": "^7.0.2"
|
|
124
|
-
}
|
|
2
|
+
"name": "@violetix/baileys",
|
|
3
|
+
"version": "0.6.0",
|
|
4
|
+
"description": "Enhanced Baileys v7 with fixes for newsletter media uploads, plus support for interactive messages, albums, and additional message types.",
|
|
5
|
+
"main": "lib/index.js",
|
|
6
|
+
"types": "lib/index.d.ts",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"preinstall": "node ./engine-requirements.js"
|
|
10
|
+
},
|
|
11
|
+
"engines": {
|
|
12
|
+
"node": ">=20.0.0"
|
|
13
|
+
},
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "git+https://github.com/itsliaaa/baileys.git"
|
|
17
|
+
},
|
|
18
|
+
"files": [
|
|
19
|
+
"lib/**/*",
|
|
20
|
+
"WAProto/**/*",
|
|
21
|
+
"engine-requirements.js"
|
|
22
|
+
],
|
|
23
|
+
"keywords": [
|
|
24
|
+
"automation",
|
|
25
|
+
"baileys",
|
|
26
|
+
"bot",
|
|
27
|
+
"interactive-messages",
|
|
28
|
+
"js-whatsapp",
|
|
29
|
+
"multi-device",
|
|
30
|
+
"whatsapp",
|
|
31
|
+
"whatsapp-api",
|
|
32
|
+
"whatsapp-bot",
|
|
33
|
+
"whatsapp-web"
|
|
34
|
+
],
|
|
35
|
+
"homepage": "https://github.com/itsliaaa/baileys#readme",
|
|
36
|
+
"author": "Lia Wynn",
|
|
37
|
+
"license": "MIT",
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"@adiwajshing/keyed-db": "^0.2.4",
|
|
40
|
+
"@cacheable/node-cache": "^1.4.0",
|
|
41
|
+
"@hapi/boom": "^9.1.3",
|
|
42
|
+
"@noble/curves": "2.4.0",
|
|
43
|
+
"async-mutex": "^0.5.0",
|
|
44
|
+
"fflate": "^0.8.2",
|
|
45
|
+
"libsignal": "^6.0.0",
|
|
46
|
+
"lru-cache": "^11.2.6",
|
|
47
|
+
"music-metadata": "^11.12.3",
|
|
48
|
+
"p-queue": "^9.1.0",
|
|
49
|
+
"pino": "^9.6.0",
|
|
50
|
+
"protobufjs": "^7.5.6",
|
|
51
|
+
"whatsapp-rust-bridge": "0.5.5",
|
|
52
|
+
"ws": "^8.19.0"
|
|
53
|
+
},
|
|
54
|
+
"peerDependencies": {
|
|
55
|
+
"@napi-rs/image": "~1.12.0",
|
|
56
|
+
"audio-decode": "^2.2.3",
|
|
57
|
+
"better-sqlite3": "^11.0.0",
|
|
58
|
+
"jimp": "^1.6.1",
|
|
59
|
+
"link-preview-js": "^3.0.0",
|
|
60
|
+
"sharp": "*"
|
|
61
|
+
},
|
|
62
|
+
"peerDependenciesMeta": {
|
|
63
|
+
"@napi-rs/image": {
|
|
64
|
+
"optional": true
|
|
65
|
+
},
|
|
66
|
+
"audio-decode": {
|
|
67
|
+
"optional": true
|
|
68
|
+
},
|
|
69
|
+
"better-sqlite3": {
|
|
70
|
+
"optional": true
|
|
71
|
+
},
|
|
72
|
+
"jimp": {
|
|
73
|
+
"optional": true
|
|
74
|
+
},
|
|
75
|
+
"link-preview-js": {
|
|
76
|
+
"optional": true
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
"resolutions": {
|
|
80
|
+
"ajv@npm:^6.12.4": "^6.14.0",
|
|
81
|
+
"basic-ftp": "^5.2.4",
|
|
82
|
+
"brace-expansion@npm:^1.1.7": "^1.1.13",
|
|
83
|
+
"brace-expansion@npm:^2.0.1": "^2.0.3",
|
|
84
|
+
"flatted": "^3.4.2",
|
|
85
|
+
"glob@npm:^10.2.2": "^10.5.0",
|
|
86
|
+
"glob@npm:^10.3.10": "^10.5.0",
|
|
87
|
+
"glob@npm:^10.5.0": "^10.5.0",
|
|
88
|
+
"handlebars": "^4.7.9",
|
|
89
|
+
"ip-address": "^10.1.1",
|
|
90
|
+
"js-yaml@npm:^3.13.1": "^3.14.2",
|
|
91
|
+
"js-yaml@npm:^4.1.0": "^4.1.1",
|
|
92
|
+
"markdown-it": "^14.1.1",
|
|
93
|
+
"minimatch@npm:^3.0.4": "^3.1.5",
|
|
94
|
+
"minimatch@npm:^3.1.2": "^3.1.5",
|
|
95
|
+
"minimatch@npm:^5.0.1": "^5.1.8",
|
|
96
|
+
"minimatch@npm:^9.0.4": "^9.0.9",
|
|
97
|
+
"minimatch@npm:^9.0.5": "^9.0.9",
|
|
98
|
+
"picomatch@npm:^2.0.4": "^2.3.2",
|
|
99
|
+
"picomatch@npm:^2.3.1": "^2.3.2",
|
|
100
|
+
"picomatch@npm:^4.0.0": "^4.0.4",
|
|
101
|
+
"picomatch@npm:^4.0.2": "^4.0.4",
|
|
102
|
+
"socks": "^2.8.8",
|
|
103
|
+
"tar": "^7.5.11",
|
|
104
|
+
"tmp": "^0.2.5",
|
|
105
|
+
"underscore": "^1.13.8",
|
|
106
|
+
"yaml@npm:^2.6.1": "^2.8.4"
|
|
107
|
+
},
|
|
108
|
+
"packageManager": "yarn@4.9.2"
|
|
125
109
|
}
|
package/lib/Utils/a2ui.d.ts
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
export type A2UIWidget = {
|
|
2
|
-
uuid: string;
|
|
3
|
-
data: string;
|
|
4
|
-
type: string;
|
|
5
|
-
fallback?: string;
|
|
6
|
-
};
|
|
7
|
-
export type A2UIBuildOptions = {
|
|
8
|
-
uuid?: string;
|
|
9
|
-
surfaceId?: string;
|
|
10
|
-
type?: string;
|
|
11
|
-
/** `false` emits a bare `{ components }` payload instead of the `createSurface` envelope. */
|
|
12
|
-
wrapped?: boolean;
|
|
13
|
-
};
|
|
14
|
-
export type A2UIChoice = {
|
|
15
|
-
label: string;
|
|
16
|
-
value: unknown;
|
|
17
|
-
};
|
|
18
|
-
export type A2UIListCardItem = {
|
|
19
|
-
title: string;
|
|
20
|
-
price?: string;
|
|
21
|
-
trailingLabel?: string;
|
|
22
|
-
assetId?: string;
|
|
23
|
-
assetType?: string;
|
|
24
|
-
emphasis?: string;
|
|
25
|
-
};
|
|
26
|
-
/** Every method registers a component and returns its id; container methods take those ids. */
|
|
27
|
-
export declare class A2UI {
|
|
28
|
-
constructor(options?: { catalogId?: string; version?: string });
|
|
29
|
-
text(text: string, options?: { id?: string; variant?: string }): string;
|
|
30
|
-
image(url: string, options?: { id?: string; variant?: string; fit?: string }): string;
|
|
31
|
-
video(url: string, options?: { id?: string }): string;
|
|
32
|
-
checkbox(label: string, options?: { id?: string; value?: boolean }): string;
|
|
33
|
-
textField(label: string, options?: { id?: string; variant?: string }): string;
|
|
34
|
-
button(childId: string, options?: { id?: string; variant?: string; action?: any }): string;
|
|
35
|
-
card(childId: string, options?: { id?: string }): string;
|
|
36
|
-
column(children: string[], options?: { id?: string; justify?: string; align?: string }): string;
|
|
37
|
-
row(children: string[], options?: { id?: string }): string;
|
|
38
|
-
divider(options?: { id?: string }): string;
|
|
39
|
-
choicePicker(label: string, options: A2UIChoice[], extra?: {
|
|
40
|
-
id?: string;
|
|
41
|
-
variant?: string;
|
|
42
|
-
value?: unknown;
|
|
43
|
-
displayStyle?: string;
|
|
44
|
-
filterable?: boolean;
|
|
45
|
-
}): string;
|
|
46
|
-
root(children: string[]): this;
|
|
47
|
-
listCard(input: { title: string; items: A2UIListCardItem[]; fallbackText?: string; uuid?: string }): this;
|
|
48
|
-
build(options?: A2UIBuildOptions): A2UIWidget;
|
|
49
|
-
}
|
|
50
|
-
export declare const buildA2UIWidget: (a2ui: A2UI | A2UIWidget, options?: A2UIBuildOptions) => A2UIWidget;
|