zapry-openclaw-plugin 0.0.1 → 0.0.3
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 +6 -4
- package/dist/index.d.ts +12 -0
- package/dist/index.js +344 -0
- package/dist/index.js.map +1 -0
- package/dist/src/actions.d.ts +14 -0
- package/dist/src/actions.js +2026 -0
- package/dist/src/actions.js.map +1 -0
- package/dist/src/api-client.d.ts +96 -0
- package/dist/src/api-client.js +252 -0
- package/dist/src/api-client.js.map +1 -0
- package/dist/src/channel.d.ts +127 -0
- package/dist/src/channel.js +248 -0
- package/dist/src/channel.js.map +1 -0
- package/dist/src/config.d.ts +4 -0
- package/dist/src/config.js +58 -0
- package/dist/src/config.js.map +1 -0
- package/dist/src/inbound.d.ts +27 -0
- package/dist/src/inbound.js +2826 -0
- package/dist/src/inbound.js.map +1 -0
- package/dist/src/monitor.d.ts +18 -0
- package/dist/src/monitor.js +113 -0
- package/dist/src/monitor.js.map +1 -0
- package/dist/src/profile-sync.d.ts +5 -0
- package/dist/src/profile-sync.js +153 -0
- package/dist/src/profile-sync.js.map +1 -0
- package/dist/src/runtime.d.ts +18 -0
- package/dist/src/runtime.js +41 -0
- package/dist/src/runtime.js.map +1 -0
- package/dist/src/send.d.ts +6 -0
- package/dist/src/send.js +222 -0
- package/dist/src/send.js.map +1 -0
- package/dist/src/types.d.ts +152 -0
- package/dist/src/types.js +3 -0
- package/dist/src/types.js.map +1 -0
- package/package.json +16 -4
- package/index.ts +0 -345
- package/src/actions.ts +0 -2241
- package/src/api-client.ts +0 -357
- package/src/channel.ts +0 -268
- package/src/config.ts +0 -68
- package/src/inbound.ts +0 -3494
- package/src/monitor.ts +0 -144
- package/src/profile-sync.ts +0 -195
- package/src/runtime.ts +0 -66
- package/src/send.ts +0 -257
- package/src/types.ts +0 -175
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# zapry-openclaw-plugin
|
|
2
2
|
|
|
3
3
|
OpenClaw channel plugin for [Zapry](https://zapry.io) — a social platform with messaging, groups, feed, clubs, and wallet.
|
|
4
4
|
|
|
@@ -16,9 +16,11 @@ Install this plugin to let your OpenClaw agent interact with Zapry through `chan
|
|
|
16
16
|
## Install
|
|
17
17
|
|
|
18
18
|
```bash
|
|
19
|
-
openclaw plugins install
|
|
19
|
+
openclaw plugins install zapry-openclaw-plugin
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
+
The npm package name is `zapry-openclaw-plugin`, while the OpenClaw plugin/channel id remains `zapry`.
|
|
23
|
+
|
|
22
24
|
## Development Notes
|
|
23
25
|
|
|
24
26
|
- `node_modules/` is ignored by Git and should not be committed.
|
|
@@ -30,7 +32,7 @@ git rm -r --cached node_modules
|
|
|
30
32
|
|
|
31
33
|
## Configure
|
|
32
34
|
|
|
33
|
-
Get a bot token from
|
|
35
|
+
Get a bot token from Zapry BotMother, then add it to your config:
|
|
34
36
|
|
|
35
37
|
```jsonc
|
|
36
38
|
// ~/.openclaw/openclaw.json
|
|
@@ -118,7 +120,7 @@ Audio generation helper:
|
|
|
118
120
|
| Field | Type | Default | Description |
|
|
119
121
|
|-------|------|---------|-------------|
|
|
120
122
|
| `botToken` | string | — | Bot token from BotMother (required) |
|
|
121
|
-
| `apiBaseUrl` | string | `https://openapi
|
|
123
|
+
| `apiBaseUrl` | string | `https://openapi.mimo.immo` | Zapry API server URL |
|
|
122
124
|
| `mode` | `"polling"` \| `"webhook"` | `"polling"` | Inbound runtime now uses polling as the single processing path; `webhook` is accepted but falls back to polling |
|
|
123
125
|
| `webhookUrl` | string | — | Legacy webhook callback URL, retained only for backward-compatible config parsing |
|
|
124
126
|
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,344 @@
|
|
|
1
|
+
if (typeof globalThis.DOMMatrix === "undefined") {
|
|
2
|
+
globalThis.DOMMatrix = class DOMMatrix {
|
|
3
|
+
a;
|
|
4
|
+
b;
|
|
5
|
+
c;
|
|
6
|
+
d;
|
|
7
|
+
e;
|
|
8
|
+
f;
|
|
9
|
+
m11;
|
|
10
|
+
m12;
|
|
11
|
+
m21;
|
|
12
|
+
m22;
|
|
13
|
+
m41;
|
|
14
|
+
m42;
|
|
15
|
+
is2D = true;
|
|
16
|
+
isIdentity = false;
|
|
17
|
+
constructor(init) {
|
|
18
|
+
const v = Array.isArray(init) ? init : [];
|
|
19
|
+
this.a = this.m11 = v[0] ?? 1;
|
|
20
|
+
this.b = this.m12 = v[1] ?? 0;
|
|
21
|
+
this.c = this.m21 = v[2] ?? 0;
|
|
22
|
+
this.d = this.m22 = v[3] ?? 1;
|
|
23
|
+
this.e = this.m41 = v[4] ?? 0;
|
|
24
|
+
this.f = this.m42 = v[5] ?? 0;
|
|
25
|
+
}
|
|
26
|
+
inverse() { return new DOMMatrix(); }
|
|
27
|
+
multiply() { return new DOMMatrix(); }
|
|
28
|
+
scale() { return new DOMMatrix(); }
|
|
29
|
+
translate() { return new DOMMatrix(); }
|
|
30
|
+
transformPoint(p) { return { x: p?.x ?? 0, y: p?.y ?? 0, z: 0, w: 1 }; }
|
|
31
|
+
static fromMatrix() { return new DOMMatrix(); }
|
|
32
|
+
static fromFloat32Array(a) { return new DOMMatrix(Array.from(a)); }
|
|
33
|
+
static fromFloat64Array(a) { return new DOMMatrix(Array.from(a)); }
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
try {
|
|
37
|
+
const { createRequire } = require("node:module");
|
|
38
|
+
const { pathToFileURL } = require("node:url");
|
|
39
|
+
const _r = createRequire(require("node:path").join(process.cwd(), "package.json"));
|
|
40
|
+
const _pdfjsAbs = _r.resolve("pdfjs-dist/legacy/build/pdf.mjs");
|
|
41
|
+
const _workerAbs = _r.resolve("pdfjs-dist/legacy/build/pdf.worker.mjs");
|
|
42
|
+
import(pathToFileURL(_pdfjsAbs).href).then((pdfjs) => {
|
|
43
|
+
if (pdfjs?.GlobalWorkerOptions && !pdfjs.GlobalWorkerOptions.workerSrc) {
|
|
44
|
+
pdfjs.GlobalWorkerOptions.workerSrc = _workerAbs;
|
|
45
|
+
}
|
|
46
|
+
}).catch(() => { });
|
|
47
|
+
}
|
|
48
|
+
catch { }
|
|
49
|
+
import { zapryPlugin } from "./src/channel.js";
|
|
50
|
+
import { buildZaprySkillRequestHeaders, getZaprySkillInvocationContext, resolveZaprySkillRequestHeaders, setZapryRuntime, } from "./src/runtime.js";
|
|
51
|
+
import { resolveZapryAccount } from "./src/config.js";
|
|
52
|
+
import { handleZapryAction } from "./src/actions.js";
|
|
53
|
+
const ZAPRY_ACTION_TOOL_ACTIONS = [
|
|
54
|
+
"send", "send-message",
|
|
55
|
+
"send-photo", "send-video", "send-document", "send-audio", "send-voice", "send-animation",
|
|
56
|
+
"generate-audio",
|
|
57
|
+
"delete-message", "answer-callback-query",
|
|
58
|
+
"get-file", "get-my-profile", "get-me",
|
|
59
|
+
"get-my-groups", "get-my-chats",
|
|
60
|
+
"get-chat-member", "get-chat-members", "get-chat-member-count", "get-chat-administrators",
|
|
61
|
+
"mute-chat-member", "kick-chat-member", "set-chat-title", "set-chat-description",
|
|
62
|
+
"get-user-profile-photos", "set-my-wallet-address", "set-my-friend-verify",
|
|
63
|
+
"get-my-contacts", "get-my-friend-requests",
|
|
64
|
+
"accept-friend-request", "reject-friend-request", "add-friend", "delete-friend",
|
|
65
|
+
"set-my-soul", "get-my-soul", "set-my-skills", "get-my-skills",
|
|
66
|
+
"set-my-name", "set-my-description",
|
|
67
|
+
"get-trending-posts", "get-latest-posts", "get-my-posts", "search-posts",
|
|
68
|
+
"delete-post", "comment-post", "like-post", "share-post",
|
|
69
|
+
"get-updates", "set-webhook", "get-webhook-info", "delete-webhook", "webhooks-token",
|
|
70
|
+
"get-chat-history",
|
|
71
|
+
];
|
|
72
|
+
async function resolveRuntimeConfig(api) {
|
|
73
|
+
const runtimeConfig = api?.runtime?.config;
|
|
74
|
+
const loadConfig = runtimeConfig?.loadConfig;
|
|
75
|
+
if (typeof loadConfig === "function") {
|
|
76
|
+
try {
|
|
77
|
+
return await Promise.resolve(loadConfig());
|
|
78
|
+
}
|
|
79
|
+
catch {
|
|
80
|
+
// fall through
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return runtimeConfig ?? {};
|
|
84
|
+
}
|
|
85
|
+
function sameUserIdentity(left, right) {
|
|
86
|
+
const normalizedLeft = left.trim();
|
|
87
|
+
const normalizedRight = right.trim();
|
|
88
|
+
if (!normalizedLeft || !normalizedRight) {
|
|
89
|
+
return false;
|
|
90
|
+
}
|
|
91
|
+
if (normalizedLeft === normalizedRight) {
|
|
92
|
+
return true;
|
|
93
|
+
}
|
|
94
|
+
const leftNum = Number(normalizedLeft);
|
|
95
|
+
const rightNum = Number(normalizedRight);
|
|
96
|
+
return Number.isFinite(leftNum) && Number.isFinite(rightNum) && leftNum === rightNum;
|
|
97
|
+
}
|
|
98
|
+
function resolveOwnerIdFromBotToken(botToken) {
|
|
99
|
+
const trimmed = String(botToken ?? "").trim();
|
|
100
|
+
const separatorIdx = trimmed.indexOf(":");
|
|
101
|
+
if (separatorIdx <= 0) {
|
|
102
|
+
return "";
|
|
103
|
+
}
|
|
104
|
+
return trimmed.slice(0, separatorIdx).trim();
|
|
105
|
+
}
|
|
106
|
+
function resolveToolAccount(toolCtx, cfg, requestedAccountId) {
|
|
107
|
+
return resolveZapryAccount(cfg, requestedAccountId ?? toolCtx?.agentAccountId);
|
|
108
|
+
}
|
|
109
|
+
function resolveToolSenderId(toolCtx) {
|
|
110
|
+
const senderIdFromToolCtx = String(toolCtx?.requesterSenderId ?? "").trim();
|
|
111
|
+
if (senderIdFromToolCtx) {
|
|
112
|
+
return senderIdFromToolCtx;
|
|
113
|
+
}
|
|
114
|
+
const invocationCtx = getZaprySkillInvocationContext();
|
|
115
|
+
return String(invocationCtx?.senderId ?? "").trim();
|
|
116
|
+
}
|
|
117
|
+
function resolveToolSenderIsOwner(toolCtx, account) {
|
|
118
|
+
if (toolCtx?.senderIsOwner === true) {
|
|
119
|
+
return true;
|
|
120
|
+
}
|
|
121
|
+
if (toolCtx?.senderIsOwner === false) {
|
|
122
|
+
return false;
|
|
123
|
+
}
|
|
124
|
+
const senderId = resolveToolSenderId(toolCtx);
|
|
125
|
+
const ownerId = resolveOwnerIdFromBotToken(account.botToken);
|
|
126
|
+
return sameUserIdentity(senderId, ownerId);
|
|
127
|
+
}
|
|
128
|
+
function shouldExposeZapryOwnerTools(toolCtx, account) {
|
|
129
|
+
if (toolCtx?.messageChannel !== "zapry") {
|
|
130
|
+
return true;
|
|
131
|
+
}
|
|
132
|
+
const senderId = resolveToolSenderId(toolCtx);
|
|
133
|
+
if (!senderId) {
|
|
134
|
+
return false;
|
|
135
|
+
}
|
|
136
|
+
return resolveToolSenderIsOwner(toolCtx, account);
|
|
137
|
+
}
|
|
138
|
+
function resolveToolRequestHeaders(toolCtx) {
|
|
139
|
+
const senderId = resolveToolSenderId(toolCtx);
|
|
140
|
+
if (senderId) {
|
|
141
|
+
const invocationCtx = getZaprySkillInvocationContext();
|
|
142
|
+
return buildZaprySkillRequestHeaders({
|
|
143
|
+
senderId,
|
|
144
|
+
messageSid: invocationCtx?.messageSid,
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
return resolveZaprySkillRequestHeaders();
|
|
148
|
+
}
|
|
149
|
+
function ownerDeniedToolResult() {
|
|
150
|
+
return JSON.stringify({
|
|
151
|
+
ok: false,
|
|
152
|
+
error: "只能是主人才可以调用",
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
const plugin = {
|
|
156
|
+
id: "zapry",
|
|
157
|
+
name: "Zapry",
|
|
158
|
+
description: "Zapry social platform channel plugin — messaging, groups, feed, clubs, and bot self-management",
|
|
159
|
+
configSchema: {
|
|
160
|
+
type: "object",
|
|
161
|
+
additionalProperties: false,
|
|
162
|
+
properties: {},
|
|
163
|
+
},
|
|
164
|
+
register(api) {
|
|
165
|
+
setZapryRuntime(api.runtime);
|
|
166
|
+
api.registerChannel({ plugin: zapryPlugin });
|
|
167
|
+
api.registerTool((toolCtx) => {
|
|
168
|
+
const toolCfg = toolCtx?.config ?? api?.runtime?.config ?? {};
|
|
169
|
+
const account = resolveToolAccount(toolCtx, toolCfg);
|
|
170
|
+
if (!shouldExposeZapryOwnerTools(toolCtx, account)) {
|
|
171
|
+
return null;
|
|
172
|
+
}
|
|
173
|
+
return {
|
|
174
|
+
name: "zapry_post",
|
|
175
|
+
label: "Zapry Post to Feed",
|
|
176
|
+
description: "Post to Zapry public feed (广场). This is the ONLY way to create a feed post. " +
|
|
177
|
+
"Pass content and optionally images. No target or routing needed.",
|
|
178
|
+
parameters: {
|
|
179
|
+
type: "object",
|
|
180
|
+
properties: {
|
|
181
|
+
content: {
|
|
182
|
+
type: "string",
|
|
183
|
+
description: "Post text content (required)",
|
|
184
|
+
},
|
|
185
|
+
images: {
|
|
186
|
+
type: "array",
|
|
187
|
+
items: { type: "string" },
|
|
188
|
+
description: "Array of image sources: local file paths, data: URIs, HTTP(S) URLs, or Zapry file IDs (mf_*)",
|
|
189
|
+
},
|
|
190
|
+
},
|
|
191
|
+
required: ["content"],
|
|
192
|
+
},
|
|
193
|
+
execute: async (_toolCallId, args) => {
|
|
194
|
+
try {
|
|
195
|
+
const cfg = await resolveRuntimeConfig(api);
|
|
196
|
+
const account = resolveToolAccount(toolCtx, cfg);
|
|
197
|
+
if (!shouldExposeZapryOwnerTools(toolCtx, account)) {
|
|
198
|
+
return ownerDeniedToolResult();
|
|
199
|
+
}
|
|
200
|
+
const result = await handleZapryAction({
|
|
201
|
+
action: "create-post",
|
|
202
|
+
channel: "zapry",
|
|
203
|
+
account,
|
|
204
|
+
params: { content: args.content, images: args.images },
|
|
205
|
+
requestHeaders: resolveToolRequestHeaders(toolCtx),
|
|
206
|
+
});
|
|
207
|
+
return JSON.stringify(result, null, 2);
|
|
208
|
+
}
|
|
209
|
+
catch (err) {
|
|
210
|
+
return JSON.stringify({
|
|
211
|
+
ok: false,
|
|
212
|
+
error: err instanceof Error ? err.message : String(err),
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
},
|
|
216
|
+
};
|
|
217
|
+
});
|
|
218
|
+
api.registerTool((toolCtx) => {
|
|
219
|
+
const toolCfg = toolCtx?.config ?? api?.runtime?.config ?? {};
|
|
220
|
+
const account = resolveToolAccount(toolCtx, toolCfg);
|
|
221
|
+
if (!shouldExposeZapryOwnerTools(toolCtx, account)) {
|
|
222
|
+
return null;
|
|
223
|
+
}
|
|
224
|
+
return {
|
|
225
|
+
name: "zapry_action",
|
|
226
|
+
label: "Zapry Platform Action",
|
|
227
|
+
description: "Execute a Zapry platform action. Use this for: " +
|
|
228
|
+
"sending media (send-photo, send-video, send-audio, send-document, send-voice, send-animation) to any chat including groups. " +
|
|
229
|
+
"IMPORTANT: For send-photo, if user asks for an image without providing one, use 'prompt' parameter (e.g. action='send-photo', prompt='bitcoin logo') — image is auto-generated, NO photo/URL needed. " +
|
|
230
|
+
"profile queries (get-my-profile, get-me), friend operations " +
|
|
231
|
+
"(get-my-friend-requests, accept-friend-request, add-friend, etc.), " +
|
|
232
|
+
"group management (get-chat-members, mute-chat-member, kick-chat-member, etc.), " +
|
|
233
|
+
"feed reading (get-trending-posts, get-latest-posts, search-posts, etc.), " +
|
|
234
|
+
"feed interactions (delete-post, comment-post, like-post, share-post), " +
|
|
235
|
+
"bot settings (set-my-soul, set-my-skills, set-my-name, etc.), " +
|
|
236
|
+
"chat history (get-chat-history), " +
|
|
237
|
+
"and webhook/file operations (get-file, set-webhook, get-updates, etc.). " +
|
|
238
|
+
"Pass the action name and action-specific parameters as top-level fields.",
|
|
239
|
+
parameters: {
|
|
240
|
+
type: "object",
|
|
241
|
+
properties: {
|
|
242
|
+
action: {
|
|
243
|
+
type: "string",
|
|
244
|
+
description: "The Zapry action to execute",
|
|
245
|
+
enum: [...ZAPRY_ACTION_TOOL_ACTIONS],
|
|
246
|
+
},
|
|
247
|
+
chat_id: {
|
|
248
|
+
type: "string",
|
|
249
|
+
description: "Chat/group ID (for group management actions like get-chat-members, mute-chat-member, etc.)",
|
|
250
|
+
},
|
|
251
|
+
user_id: {
|
|
252
|
+
type: "string",
|
|
253
|
+
description: "User ID (for friend actions, chat member actions, etc.)",
|
|
254
|
+
},
|
|
255
|
+
file_id: {
|
|
256
|
+
type: "string",
|
|
257
|
+
description: "File ID (for get-file)",
|
|
258
|
+
},
|
|
259
|
+
keyword: {
|
|
260
|
+
type: "string",
|
|
261
|
+
description: "Search keyword (for search-posts)",
|
|
262
|
+
},
|
|
263
|
+
dynamic_id: {
|
|
264
|
+
type: "string",
|
|
265
|
+
description: "Post/dynamic ID (for delete-post, comment-post, like-post, share-post)",
|
|
266
|
+
},
|
|
267
|
+
photo: {
|
|
268
|
+
type: "string",
|
|
269
|
+
description: "Photo source: external URL (auto-downloaded), data URI, local path, or /_temp/media URL (for send-photo). If omitted but 'prompt' is provided, image will be auto-generated.",
|
|
270
|
+
},
|
|
271
|
+
prompt: {
|
|
272
|
+
type: "string",
|
|
273
|
+
description: "PREFERRED for send-photo when user asks for an image: describe what to generate (e.g. 'bitcoin logo', 'cute cat'). Image is auto-generated and sent — no photo/URL needed.",
|
|
274
|
+
},
|
|
275
|
+
video: {
|
|
276
|
+
type: "string",
|
|
277
|
+
description: "Video source (for send-video)",
|
|
278
|
+
},
|
|
279
|
+
document: {
|
|
280
|
+
type: "string",
|
|
281
|
+
description: "Document source (for send-document)",
|
|
282
|
+
},
|
|
283
|
+
audio: {
|
|
284
|
+
type: "string",
|
|
285
|
+
description: "Audio source (for send-audio)",
|
|
286
|
+
},
|
|
287
|
+
voice: {
|
|
288
|
+
type: "string",
|
|
289
|
+
description: "Voice source (for send-voice)",
|
|
290
|
+
},
|
|
291
|
+
animation: {
|
|
292
|
+
type: "string",
|
|
293
|
+
description: "Animation/GIF source (for send-animation)",
|
|
294
|
+
},
|
|
295
|
+
content: {
|
|
296
|
+
type: "string",
|
|
297
|
+
description: "Text content (for comment-post)",
|
|
298
|
+
},
|
|
299
|
+
limit: {
|
|
300
|
+
type: "number",
|
|
301
|
+
description: "Limit for results (for get-chat-history, default 50, max 50)",
|
|
302
|
+
},
|
|
303
|
+
page: {
|
|
304
|
+
type: "number",
|
|
305
|
+
description: "Page number for paginated results",
|
|
306
|
+
},
|
|
307
|
+
page_size: {
|
|
308
|
+
type: "number",
|
|
309
|
+
description: "Page size for paginated results",
|
|
310
|
+
},
|
|
311
|
+
},
|
|
312
|
+
required: ["action"],
|
|
313
|
+
additionalProperties: true,
|
|
314
|
+
},
|
|
315
|
+
execute: async (_toolCallId, args) => {
|
|
316
|
+
try {
|
|
317
|
+
const { action, channel: _ch, accountId: reqAccountId, ...params } = args ?? {};
|
|
318
|
+
const cfg = await resolveRuntimeConfig(api);
|
|
319
|
+
const account = resolveToolAccount(toolCtx, cfg, reqAccountId);
|
|
320
|
+
if (!shouldExposeZapryOwnerTools(toolCtx, account)) {
|
|
321
|
+
return ownerDeniedToolResult();
|
|
322
|
+
}
|
|
323
|
+
const result = await handleZapryAction({
|
|
324
|
+
action,
|
|
325
|
+
channel: "zapry",
|
|
326
|
+
account,
|
|
327
|
+
params,
|
|
328
|
+
requestHeaders: resolveToolRequestHeaders(toolCtx),
|
|
329
|
+
});
|
|
330
|
+
return JSON.stringify(result, null, 2);
|
|
331
|
+
}
|
|
332
|
+
catch (err) {
|
|
333
|
+
return JSON.stringify({
|
|
334
|
+
ok: false,
|
|
335
|
+
error: err instanceof Error ? err.message : String(err),
|
|
336
|
+
});
|
|
337
|
+
}
|
|
338
|
+
},
|
|
339
|
+
};
|
|
340
|
+
});
|
|
341
|
+
},
|
|
342
|
+
};
|
|
343
|
+
export default plugin;
|
|
344
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,IAAI,OAAO,UAAU,CAAC,SAAS,KAAK,WAAW,EAAE,CAAC;IAC/C,UAAkB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AAM,oBAAoB,CAAC,GAAG,CAAC,CAAC;wBAC5C,MAAM,OAAO,GAAG,kBAAkB,CAAC,OAAO,EAAE,GAAG,EAAE,YAAY,CAAC,CAAC;wBAC/D,IAAI,CAAC,2BAA2B,CAAC,OAAO,EAAE,OAAO,CAAC,EAAE,CAAC;4BACnD,OAAO,qBAAqB,EAAE,CAAC;wBACjC,CAAC;wBACD,MAAM,MAAM,GAAG,MAAM,iBAAiB,CAAC;4BACrC,MAAM;4BACN,OAAO,EAAE,OAAO;4BAChB,OAAO;4BACP,MAAM;4BACN,cAAc,EAAE,yBAAyB,CAAC,OAAO,CAAC;yBACnD,CAAC,CAAC;wBACH,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;oBACzC,CAAC;oBAAC,OAAO,GAAG,EAAE,CAAC;wBACb,OAAO,IAAI,CAAC,SAAS,CAAC;4BACpB,EAAE,EAAE,KAAK;4BACT,KAAK,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;yBACxD,CAAC,CAAC;oBACL,CAAC;gBACH,CAAC;aACF,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;CACF,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ResolvedZapryAccount } from "./types.js";
|
|
2
|
+
export type ActionContext = {
|
|
3
|
+
action: string;
|
|
4
|
+
channel: string;
|
|
5
|
+
account: ResolvedZapryAccount;
|
|
6
|
+
params: Record<string, any>;
|
|
7
|
+
requestHeaders?: Record<string, string>;
|
|
8
|
+
};
|
|
9
|
+
export type ActionResult = {
|
|
10
|
+
ok: boolean;
|
|
11
|
+
result?: any;
|
|
12
|
+
error?: string;
|
|
13
|
+
};
|
|
14
|
+
export declare function handleZapryAction(ctx: ActionContext): Promise<ActionResult>;
|