@openclaw/zalo 2026.5.28-beta.4 → 2026.5.30-beta.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.
- package/dist/api.js +1 -1
- package/dist/{channel-CuSMZv6i.js → channel-C35ix-Tg.js} +1 -1
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel.runtime-5jy8uz-2.js → channel.runtime-DEPL3lws.js} +1 -1
- package/dist/{monitor-De6CIauS.js → monitor-Tw-Yqkd9.js} +12 -3
- package/npm-shrinkwrap.json +3 -3
- package/package.json +4 -4
package/dist/api.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as zaloDmPolicy, r as zaloSetupAdapter, t as createZaloSetupWizardProxy } from "./setup-core-oTTioJT-.js";
|
|
2
|
-
import { t as zaloPlugin } from "./channel-
|
|
2
|
+
import { t as zaloPlugin } from "./channel-C35ix-Tg.js";
|
|
3
3
|
import { n as resolveZaloRuntimeGroupPolicy } from "./group-access-8qHRzDHx.js";
|
|
4
4
|
import { zaloSetupWizard } from "./setup-api.js";
|
|
5
5
|
export { createZaloSetupWizardProxy, resolveZaloRuntimeGroupPolicy, zaloDmPolicy, zaloPlugin, zaloSetupAdapter, zaloSetupWizard };
|
|
@@ -173,7 +173,7 @@ function normalizeZaloMessagingTarget(raw) {
|
|
|
173
173
|
if (!trimmed) return;
|
|
174
174
|
return trimmed.replace(/^(zalo|zl):/i, "").trim();
|
|
175
175
|
}
|
|
176
|
-
const loadZaloChannelRuntime = createLazyRuntimeModule(() => import("./channel.runtime-
|
|
176
|
+
const loadZaloChannelRuntime = createLazyRuntimeModule(() => import("./channel.runtime-DEPL3lws.js"));
|
|
177
177
|
const zaloSetupWizard = createZaloSetupWizardProxy(async () => (await import("./setup-surface-BUaA8o_s.js")).zaloSetupWizard);
|
|
178
178
|
const zaloTextChunkLimit = 2e3;
|
|
179
179
|
const zaloRawSendResultAdapter = createRawChannelSendResultAdapter({
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as zaloPlugin } from "./channel-
|
|
1
|
+
import { t as zaloPlugin } from "./channel-C35ix-Tg.js";
|
|
2
2
|
export { zaloPlugin };
|
|
@@ -86,7 +86,7 @@ async function startZaloGatewayAccount(ctx) {
|
|
|
86
86
|
setStatus: ctx.setStatus
|
|
87
87
|
});
|
|
88
88
|
ctx.log?.info(`[${account.accountId}] starting provider${zaloBotLabel} mode=${mode}`);
|
|
89
|
-
const { monitorZaloProvider } = await import("./monitor-
|
|
89
|
+
const { monitorZaloProvider } = await import("./monitor-Tw-Yqkd9.js");
|
|
90
90
|
return monitorZaloProvider({
|
|
91
91
|
token,
|
|
92
92
|
account,
|
|
@@ -8,6 +8,7 @@ import { createChannelPairingController } from "openclaw/plugin-sdk/channel-pair
|
|
|
8
8
|
import { logTypingFailure } from "openclaw/plugin-sdk/channel-feedback";
|
|
9
9
|
import { resolveInboundRouteEnvelopeBuilderWithRuntime } from "openclaw/plugin-sdk/inbound-envelope";
|
|
10
10
|
import { registerPluginHttpRoute, resolveWebhookPath } from "openclaw/plugin-sdk/webhook-ingress";
|
|
11
|
+
import { asDateTimestampMs, resolveExpiresAtMsFromDurationMs } from "openclaw/plugin-sdk/number-runtime";
|
|
11
12
|
import { resolveStableChannelMessageIngress } from "openclaw/plugin-sdk/channel-ingress-runtime";
|
|
12
13
|
import { waitForAbortSignal } from "openclaw/plugin-sdk/runtime-env";
|
|
13
14
|
import { randomBytes } from "node:crypto";
|
|
@@ -63,6 +64,8 @@ async function deleteHostedZaloMediaEntry(id) {
|
|
|
63
64
|
await Promise.all([unlink(resolveHostedZaloMediaMetadataPath(id)).catch(() => void 0), unlink(resolveHostedZaloMediaBufferPath(id)).catch(() => void 0)]);
|
|
64
65
|
}
|
|
65
66
|
async function cleanupExpiredHostedZaloMedia(nowMs = Date.now()) {
|
|
67
|
+
const now = asDateTimestampMs(nowMs);
|
|
68
|
+
if (now === void 0) return;
|
|
66
69
|
let fileNames;
|
|
67
70
|
try {
|
|
68
71
|
fileNames = await readdir(ZALO_OUTBOUND_MEDIA_DIR);
|
|
@@ -73,7 +76,8 @@ async function cleanupExpiredHostedZaloMedia(nowMs = Date.now()) {
|
|
|
73
76
|
const id = fileName.slice(0, -5);
|
|
74
77
|
try {
|
|
75
78
|
const metadataRaw = await readFile(resolveHostedZaloMediaMetadataPath(id), "utf8");
|
|
76
|
-
|
|
79
|
+
const expiresAt = asDateTimestampMs(JSON.parse(metadataRaw).expiresAt);
|
|
80
|
+
if (expiresAt === void 0 || expiresAt <= now) await deleteHostedZaloMediaEntry(id);
|
|
77
81
|
} catch {
|
|
78
82
|
await deleteHostedZaloMediaEntry(id);
|
|
79
83
|
}
|
|
@@ -105,6 +109,9 @@ function resolveHostedZaloMediaRoutePath(params) {
|
|
|
105
109
|
async function prepareHostedZaloMediaUrl(params) {
|
|
106
110
|
await ensureHostedZaloMediaDir();
|
|
107
111
|
await cleanupExpiredHostedZaloMedia();
|
|
112
|
+
const now = asDateTimestampMs(Date.now());
|
|
113
|
+
const expiresAt = now === void 0 ? void 0 : resolveExpiresAtMsFromDurationMs(ZALO_OUTBOUND_MEDIA_TTL_MS, { nowMs: now });
|
|
114
|
+
if (expiresAt === void 0) throw new Error("Zalo outbound media expiry could not be resolved");
|
|
108
115
|
const media = await loadOutboundMediaFromUrl(params.mediaUrl, {
|
|
109
116
|
maxBytes: params.maxBytes,
|
|
110
117
|
...params.proxyUrl ? { proxyUrl: params.proxyUrl } : {}
|
|
@@ -123,7 +130,7 @@ async function prepareHostedZaloMediaUrl(params) {
|
|
|
123
130
|
routePath,
|
|
124
131
|
token,
|
|
125
132
|
contentType: media.contentType,
|
|
126
|
-
expiresAt
|
|
133
|
+
expiresAt
|
|
127
134
|
});
|
|
128
135
|
} catch (error) {
|
|
129
136
|
await deleteHostedZaloMediaEntry(id);
|
|
@@ -157,7 +164,9 @@ async function tryHandleHostedZaloMediaRequest(req, res) {
|
|
|
157
164
|
res.end("Not Found");
|
|
158
165
|
return true;
|
|
159
166
|
}
|
|
160
|
-
|
|
167
|
+
const now = asDateTimestampMs(Date.now());
|
|
168
|
+
const expiresAt = asDateTimestampMs(entry.metadata.expiresAt);
|
|
169
|
+
if (now === void 0 || expiresAt === void 0 || expiresAt <= now) {
|
|
161
170
|
await deleteHostedZaloMediaEntry(id);
|
|
162
171
|
res.statusCode = 410;
|
|
163
172
|
res.end("Expired");
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/zalo",
|
|
3
|
-
"version": "2026.5.
|
|
3
|
+
"version": "2026.5.30-beta.1",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@openclaw/zalo",
|
|
9
|
-
"version": "2026.5.
|
|
9
|
+
"version": "2026.5.30-beta.1",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"zod": "4.4.3"
|
|
12
12
|
},
|
|
13
13
|
"peerDependencies": {
|
|
14
|
-
"openclaw": ">=2026.5.
|
|
14
|
+
"openclaw": ">=2026.5.30-beta.1"
|
|
15
15
|
},
|
|
16
16
|
"peerDependenciesMeta": {
|
|
17
17
|
"openclaw": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/zalo",
|
|
3
|
-
"version": "2026.5.
|
|
3
|
+
"version": "2026.5.30-beta.1",
|
|
4
4
|
"description": "OpenClaw Zalo channel plugin for bot and webhook chats.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
},
|
|
9
9
|
"type": "module",
|
|
10
10
|
"peerDependencies": {
|
|
11
|
-
"openclaw": ">=2026.5.
|
|
11
|
+
"openclaw": ">=2026.5.30-beta.1"
|
|
12
12
|
},
|
|
13
13
|
"peerDependenciesMeta": {
|
|
14
14
|
"openclaw": {
|
|
@@ -39,10 +39,10 @@
|
|
|
39
39
|
"minHostVersion": ">=2026.4.10"
|
|
40
40
|
},
|
|
41
41
|
"compat": {
|
|
42
|
-
"pluginApi": ">=2026.5.
|
|
42
|
+
"pluginApi": ">=2026.5.30-beta.1"
|
|
43
43
|
},
|
|
44
44
|
"build": {
|
|
45
|
-
"openclawVersion": "2026.5.
|
|
45
|
+
"openclawVersion": "2026.5.30-beta.1"
|
|
46
46
|
},
|
|
47
47
|
"release": {
|
|
48
48
|
"publishToClawHub": true,
|