@openclaw/zalo 2026.9.4 → 2026.9.5
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/assets/activity.svg +40 -0
- package/assets/icon.png +0 -0
- package/dist/{actions.runtime-2MsIGd0H.js → .setup/actions.runtime-DZsb7I67.mjs} +1 -1
- package/dist/.setup/api-BPF84XFR.mjs +6 -0
- package/dist/{channel-mgXGK008.js → .setup/channel-D14b6qHz.mjs} +11 -9
- package/dist/{channel.runtime-aikbF-5l.js → .setup/channel.runtime-BA2foB5C.mjs} +3 -3
- package/dist/{monitor-CXlZtCk9.js → .setup/monitor-Cu5XdWDg.mjs} +5 -5
- package/dist/{monitor.webhook-DOCUBaE5.js → .setup/monitor.webhook-SDR5zoSA.mjs} +2 -2
- package/dist/.setup/secret-contract-api-DKDS_ZlS.mjs +3 -0
- package/dist/{send-CIMDH1gH.js → .setup/send-C01aoqEH.mjs} +31 -13
- package/dist/{setup-surface--Y84d_LY.js → .setup/setup-surface-CNyPRzlv.mjs} +1 -1
- package/dist/{webhook-spool-CPxf_Kwe.js → .setup/webhook-spool-nmnflXt2.mjs} +2 -2
- package/dist/api.js +3 -3
- package/dist/channel-plugin-api.js +1 -1
- package/dist/contract-api.js +1 -1
- package/dist/runtime-api.js +1 -1
- package/dist/secret-contract-api.js +1 -1
- package/dist/setup-api.js +2 -2
- package/dist/setup-entry.js +3 -2
- package/dist/setup-surface.js +2 -2
- package/node_modules/zod/README.md +27 -0
- package/node_modules/zod/compile.cjs +77 -0
- package/node_modules/zod/compile.d.cts +1 -0
- package/node_modules/zod/compile.d.ts +1 -0
- package/node_modules/zod/compile.js +52 -0
- package/node_modules/zod/index.cjs +2 -2
- package/node_modules/zod/index.d.cts +1 -2
- package/node_modules/zod/index.d.ts +1 -2
- package/node_modules/zod/index.js +5 -2
- package/node_modules/zod/package.json +13 -2
- package/node_modules/zod/src/compile.ts +56 -0
- package/node_modules/zod/src/index.ts +5 -2
- package/node_modules/zod/src/v3/ZodError.ts +22 -12
- package/node_modules/zod/src/v3/tests/error.test.ts +35 -0
- package/node_modules/zod/src/v3/tests/intersection.test.ts +18 -0
- package/node_modules/zod/src/v3/tests/language-server.test.ts +1 -2
- package/node_modules/zod/src/v3/tests/object.test.ts +3 -6
- package/node_modules/zod/src/v3/tests/readonly.test.ts +0 -80
- package/node_modules/zod/src/v3/tests/string.test.ts +6 -0
- package/node_modules/zod/src/v3/types.ts +5 -5
- package/node_modules/zod/src/v4/classic/checks.ts +1 -0
- package/node_modules/zod/src/v4/classic/compat.ts +26 -18
- package/node_modules/zod/src/v4/classic/deep-partial.ts +76 -0
- package/node_modules/zod/src/v4/classic/errors.ts +59 -44
- package/node_modules/zod/src/v4/classic/external.ts +12 -9
- package/node_modules/zod/src/v4/classic/from-json-schema.ts +140 -78
- package/node_modules/zod/src/v4/classic/in-out.ts +45 -0
- package/node_modules/zod/src/v4/classic/index.ts +2 -2
- package/node_modules/zod/src/v4/classic/iso.ts +2 -72
- package/node_modules/zod/src/v4/classic/parse.ts +10 -4
- package/node_modules/zod/src/v4/classic/schemas.ts +452 -262
- package/node_modules/zod/src/v4/classic/tests/apply.test.ts +27 -0
- package/node_modules/zod/src/v4/classic/tests/array.test.ts +2 -2
- package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +135 -0
- package/node_modules/zod/src/v4/classic/tests/bigint.test.ts +30 -1
- package/node_modules/zod/src/v4/classic/tests/catch.test.ts +278 -0
- package/node_modules/zod/src/v4/classic/tests/codec-examples.test.ts +1 -2
- package/node_modules/zod/src/v4/classic/tests/codec.test.ts +2 -1
- package/node_modules/zod/src/v4/classic/tests/continuability.test.ts +2 -2
- package/node_modules/zod/src/v4/classic/tests/credit-card.test.ts +76 -0
- package/node_modules/zod/src/v4/classic/tests/cyclic-data.test.ts +720 -0
- package/node_modules/zod/src/v4/classic/tests/date.test.ts +30 -0
- package/node_modules/zod/src/v4/classic/tests/datetime.test.ts +32 -18
- package/node_modules/zod/src/v4/classic/tests/deep-partial.test.ts +380 -0
- package/node_modules/zod/src/v4/classic/tests/default-locale.test.ts +32 -0
- package/node_modules/zod/src/v4/classic/tests/default.test.ts +46 -0
- package/node_modules/zod/src/v4/classic/tests/detached-methods.test.ts +31 -7
- package/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +155 -13
- package/node_modules/zod/src/v4/classic/tests/enum.test.ts +11 -0
- package/node_modules/zod/src/v4/classic/tests/error-utils.test.ts +112 -2
- package/node_modules/zod/src/v4/classic/tests/error.test.ts +274 -6
- package/node_modules/zod/src/v4/classic/tests/from-json-schema.test.ts +425 -10
- package/node_modules/zod/src/v4/classic/tests/function.test.ts +31 -0
- package/node_modules/zod/src/v4/classic/tests/global-config.test.ts +2 -9
- package/node_modules/zod/src/v4/classic/tests/hash.test.ts +1 -2
- package/node_modules/zod/src/v4/classic/tests/in-out.test.ts +159 -0
- package/node_modules/zod/src/v4/classic/tests/index.test.ts +21 -2
- package/node_modules/zod/src/v4/classic/tests/instance-footprint.test.ts +281 -0
- package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +47 -0
- package/node_modules/zod/src/v4/classic/tests/intersection.test.ts +136 -0
- package/node_modules/zod/src/v4/classic/tests/issue-schema.test.ts +183 -0
- package/node_modules/zod/src/v4/classic/tests/jitless-allows-eval.test.ts +3 -10
- package/node_modules/zod/src/v4/classic/tests/lazy.test.ts +36 -1
- package/node_modules/zod/src/v4/classic/tests/literal.test.ts +12 -1
- package/node_modules/zod/src/v4/classic/tests/map.test.ts +12 -0
- package/node_modules/zod/src/v4/classic/tests/number.test.ts +46 -9
- package/node_modules/zod/src/v4/classic/tests/object.test.ts +245 -12
- package/node_modules/zod/src/v4/classic/tests/optin-ladder.test.ts +234 -0
- package/node_modules/zod/src/v4/classic/tests/optional.test.ts +49 -16
- package/node_modules/zod/src/v4/classic/tests/partial.test.ts +51 -4
- package/node_modules/zod/src/v4/classic/tests/preprocess-types.test.ts +20 -2
- package/node_modules/zod/src/v4/classic/tests/readonly.test.ts +0 -68
- package/node_modules/zod/src/v4/classic/tests/record.test.ts +186 -18
- package/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +33 -2
- package/node_modules/zod/src/v4/classic/tests/redos.test.ts +68 -0
- package/node_modules/zod/src/v4/classic/tests/refine.test.ts +60 -0
- package/node_modules/zod/src/v4/classic/tests/set.test.ts +9 -0
- package/node_modules/zod/src/v4/classic/tests/string.test.ts +127 -5
- package/node_modules/zod/src/v4/classic/tests/stringbool.test.ts +18 -0
- package/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +11 -2
- package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +1585 -173
- package/node_modules/zod/src/v4/classic/tests/tuple.test.ts +45 -30
- package/node_modules/zod/src/v4/classic/tests/union.test.ts +39 -2
- package/node_modules/zod/src/v4/classic/tests/validate.test.ts +76 -0
- package/node_modules/zod/src/v4/classic/tests/validations.test.ts +2 -2
- package/node_modules/zod/src/v4/core/api.ts +48 -12
- package/node_modules/zod/src/v4/core/checks.ts +57 -44
- package/node_modules/zod/src/v4/core/compile.ts +2188 -0
- package/node_modules/zod/src/v4/core/core.ts +98 -19
- package/node_modules/zod/src/v4/core/doc.ts +11 -7
- package/node_modules/zod/src/v4/core/errors.ts +115 -24
- package/node_modules/zod/src/v4/core/index.ts +3 -0
- package/node_modules/zod/src/v4/core/json-schema-generator.ts +6 -1
- package/node_modules/zod/src/v4/core/json-schema-processors.ts +257 -93
- package/node_modules/zod/src/v4/core/json-schema.ts +2 -1
- package/node_modules/zod/src/v4/core/memoizer.ts +284 -0
- package/node_modules/zod/src/v4/core/parse.ts +131 -38
- package/node_modules/zod/src/v4/core/regexes.ts +30 -13
- package/node_modules/zod/src/v4/core/registries.ts +2 -2
- package/node_modules/zod/src/v4/core/schemas.ts +759 -461
- package/node_modules/zod/src/v4/core/tests/compile-differential.test.ts +969 -0
- package/node_modules/zod/src/v4/core/tests/compile-global.test.ts +89 -0
- package/node_modules/zod/src/v4/core/tests/compile-off-by-default.test.ts +26 -0
- package/node_modules/zod/src/v4/core/tests/compile-stats.test.ts +34 -0
- package/node_modules/zod/src/v4/core/tests/compile.test.ts +1639 -0
- package/node_modules/zod/src/v4/core/tests/locales/el.test.ts +1 -2
- package/node_modules/zod/src/v4/core/tests/locales/es.test.ts +1 -2
- package/node_modules/zod/src/v4/core/tests/locales/fr.test.ts +3 -3
- package/node_modules/zod/src/v4/core/tests/locales/parity.test.ts +42 -0
- package/node_modules/zod/src/v4/core/tests/locales/tk.test.ts +69 -0
- package/node_modules/zod/src/v4/core/tests/treeshake.test.ts +51 -0
- package/node_modules/zod/src/v4/core/tests/url-no-canparse.test.ts +31 -0
- package/node_modules/zod/src/v4/core/to-json-schema.ts +275 -42
- package/node_modules/zod/src/v4/core/util.ts +268 -42
- package/node_modules/zod/src/v4/core/versions.ts +2 -2
- package/node_modules/zod/src/v4/core/visit.ts +193 -0
- package/node_modules/zod/src/v4/index.ts +3 -3
- package/node_modules/zod/src/v4/locales/ar.ts +3 -0
- package/node_modules/zod/src/v4/locales/az.ts +3 -0
- package/node_modules/zod/src/v4/locales/be.ts +10 -0
- package/node_modules/zod/src/v4/locales/bg.ts +3 -0
- package/node_modules/zod/src/v4/locales/bn.ts +121 -0
- package/node_modules/zod/src/v4/locales/ca.ts +3 -0
- package/node_modules/zod/src/v4/locales/ckb.ts +138 -0
- package/node_modules/zod/src/v4/locales/cs.ts +3 -0
- package/node_modules/zod/src/v4/locales/da.ts +5 -2
- package/node_modules/zod/src/v4/locales/de.ts +3 -0
- package/node_modules/zod/src/v4/locales/el.ts +1 -0
- package/node_modules/zod/src/v4/locales/en.ts +15 -4
- package/node_modules/zod/src/v4/locales/eo.ts +3 -0
- package/node_modules/zod/src/v4/locales/es.ts +2 -0
- package/node_modules/zod/src/v4/locales/fa.ts +3 -0
- package/node_modules/zod/src/v4/locales/fi.ts +3 -0
- package/node_modules/zod/src/v4/locales/fr-CA.ts +3 -0
- package/node_modules/zod/src/v4/locales/fr.ts +19 -14
- package/node_modules/zod/src/v4/locales/gu.ts +121 -0
- package/node_modules/zod/src/v4/locales/he.ts +6 -1
- package/node_modules/zod/src/v4/locales/hi.ts +124 -0
- package/node_modules/zod/src/v4/locales/hr.ts +2 -0
- package/node_modules/zod/src/v4/locales/hu.ts +3 -0
- package/node_modules/zod/src/v4/locales/hy.ts +9 -0
- package/node_modules/zod/src/v4/locales/id.ts +3 -0
- package/node_modules/zod/src/v4/locales/index.ts +10 -0
- package/node_modules/zod/src/v4/locales/is.ts +3 -0
- package/node_modules/zod/src/v4/locales/it.ts +3 -0
- package/node_modules/zod/src/v4/locales/ja.ts +3 -0
- package/node_modules/zod/src/v4/locales/ka.ts +3 -0
- package/node_modules/zod/src/v4/locales/km.ts +3 -0
- package/node_modules/zod/src/v4/locales/kn.ts +124 -0
- package/node_modules/zod/src/v4/locales/ko.ts +3 -0
- package/node_modules/zod/src/v4/locales/lt.ts +2 -0
- package/node_modules/zod/src/v4/locales/mk.ts +3 -0
- package/node_modules/zod/src/v4/locales/ms.ts +3 -0
- package/node_modules/zod/src/v4/locales/ne.ts +126 -0
- package/node_modules/zod/src/v4/locales/nl.ts +3 -0
- package/node_modules/zod/src/v4/locales/nn.ts +119 -0
- package/node_modules/zod/src/v4/locales/no.ts +5 -2
- package/node_modules/zod/src/v4/locales/ota.ts +3 -0
- package/node_modules/zod/src/v4/locales/pl.ts +3 -0
- package/node_modules/zod/src/v4/locales/ps.ts +3 -0
- package/node_modules/zod/src/v4/locales/pt-BR.ts +159 -0
- package/node_modules/zod/src/v4/locales/pt.ts +99 -58
- package/node_modules/zod/src/v4/locales/ro.ts +1 -0
- package/node_modules/zod/src/v4/locales/ru.ts +10 -0
- package/node_modules/zod/src/v4/locales/sk.ts +121 -0
- package/node_modules/zod/src/v4/locales/sl.ts +3 -0
- package/node_modules/zod/src/v4/locales/sv.ts +5 -2
- package/node_modules/zod/src/v4/locales/ta.ts +3 -0
- package/node_modules/zod/src/v4/locales/th.ts +3 -0
- package/node_modules/zod/src/v4/locales/tk.ts +111 -0
- package/node_modules/zod/src/v4/locales/tr.ts +3 -0
- package/node_modules/zod/src/v4/locales/uk.ts +3 -0
- package/node_modules/zod/src/v4/locales/ur.ts +3 -0
- package/node_modules/zod/src/v4/locales/uz.ts +1 -0
- package/node_modules/zod/src/v4/locales/vi.ts +3 -0
- package/node_modules/zod/src/v4/locales/yo.ts +3 -0
- package/node_modules/zod/src/v4/locales/zh-CN.ts +3 -0
- package/node_modules/zod/src/v4/locales/zh-TW.ts +3 -0
- package/node_modules/zod/src/v4/mini/checks.ts +1 -0
- package/node_modules/zod/src/v4/mini/deep-partial.ts +73 -0
- package/node_modules/zod/src/v4/mini/external.ts +10 -1
- package/node_modules/zod/src/v4/mini/in-out.ts +45 -0
- package/node_modules/zod/src/v4/mini/parse.ts +2 -0
- package/node_modules/zod/src/v4/mini/schemas.ts +135 -56
- package/node_modules/zod/src/v4/mini/tests/apply.test.ts +33 -0
- package/node_modules/zod/src/v4/mini/tests/assignability.test.ts +62 -1
- package/node_modules/zod/src/v4/mini/tests/checks.test.ts +14 -0
- package/node_modules/zod/src/v4/mini/tests/codec.test.ts +35 -1
- package/node_modules/zod/src/v4/mini/tests/cyclic-data.test.ts +84 -0
- package/node_modules/zod/src/v4/mini/tests/deep-partial.test.ts +54 -0
- package/node_modules/zod/src/v4/mini/tests/error.test.ts +23 -4
- package/node_modules/zod/src/v4/mini/tests/functions.test.ts +9 -0
- package/node_modules/zod/src/v4/mini/tests/index.test.ts +72 -5
- package/node_modules/zod/src/v4/mini/tests/number.test.ts +14 -0
- package/node_modules/zod/src/v4/mini/tests/object.test.ts +65 -0
- package/node_modules/zod/src/v4/mini/tests/string.test.ts +21 -0
- package/node_modules/zod/v3/ZodError.cjs +22 -12
- package/node_modules/zod/v3/ZodError.d.cts +1 -1
- package/node_modules/zod/v3/ZodError.d.ts +1 -1
- package/node_modules/zod/v3/ZodError.js +22 -12
- package/node_modules/zod/v3/types.cjs +7 -5
- package/node_modules/zod/v3/types.js +7 -5
- package/node_modules/zod/v4/classic/checks.cjs +2 -1
- package/node_modules/zod/v4/classic/checks.d.cts +1 -1
- package/node_modules/zod/v4/classic/checks.d.ts +1 -1
- package/node_modules/zod/v4/classic/checks.js +1 -1
- package/node_modules/zod/v4/classic/compat.d.cts +9 -11
- package/node_modules/zod/v4/classic/compat.d.ts +9 -11
- package/node_modules/zod/v4/classic/deep-partial.cjs +39 -0
- package/node_modules/zod/v4/classic/deep-partial.d.cts +14 -0
- package/node_modules/zod/v4/classic/deep-partial.d.ts +14 -0
- package/node_modules/zod/v4/classic/deep-partial.js +13 -0
- package/node_modules/zod/v4/classic/errors.cjs +43 -34
- package/node_modules/zod/v4/classic/errors.d.cts +3 -4
- package/node_modules/zod/v4/classic/errors.d.ts +3 -4
- package/node_modules/zod/v4/classic/errors.js +43 -34
- package/node_modules/zod/v4/classic/external.cjs +30 -27
- package/node_modules/zod/v4/classic/external.d.cts +5 -2
- package/node_modules/zod/v4/classic/external.d.ts +5 -2
- package/node_modules/zod/v4/classic/external.js +5 -8
- package/node_modules/zod/v4/classic/from-json-schema.cjs +136 -75
- package/node_modules/zod/v4/classic/from-json-schema.js +136 -75
- package/node_modules/zod/v4/classic/in-out.cjs +63 -0
- package/node_modules/zod/v4/classic/in-out.d.cts +8 -0
- package/node_modules/zod/v4/classic/in-out.d.ts +8 -0
- package/node_modules/zod/v4/classic/in-out.js +36 -0
- package/node_modules/zod/v4/classic/index.cjs +2 -2
- package/node_modules/zod/v4/classic/index.d.cts +1 -2
- package/node_modules/zod/v4/classic/index.d.ts +1 -2
- package/node_modules/zod/v4/classic/index.js +2 -2
- package/node_modules/zod/v4/classic/iso.cjs +11 -22
- package/node_modules/zod/v4/classic/iso.d.cts +2 -17
- package/node_modules/zod/v4/classic/iso.d.ts +2 -17
- package/node_modules/zod/v4/classic/iso.js +2 -17
- package/node_modules/zod/v4/classic/parse.cjs +4 -1
- package/node_modules/zod/v4/classic/parse.d.cts +17 -4
- package/node_modules/zod/v4/classic/parse.d.ts +17 -4
- package/node_modules/zod/v4/classic/parse.js +1 -0
- package/node_modules/zod/v4/classic/schemas.cjs +498 -398
- package/node_modules/zod/v4/classic/schemas.d.cts +53 -18
- package/node_modules/zod/v4/classic/schemas.d.ts +53 -18
- package/node_modules/zod/v4/classic/schemas.js +492 -396
- package/node_modules/zod/v4/core/api.cjs +23 -4
- package/node_modules/zod/v4/core/api.d.cts +13 -9
- package/node_modules/zod/v4/core/api.d.ts +13 -9
- package/node_modules/zod/v4/core/api.js +21 -4
- package/node_modules/zod/v4/core/checks.cjs +37 -31
- package/node_modules/zod/v4/core/checks.d.cts +13 -13
- package/node_modules/zod/v4/core/checks.d.ts +13 -13
- package/node_modules/zod/v4/core/checks.js +37 -31
- package/node_modules/zod/v4/core/compile.cjs +1813 -0
- package/node_modules/zod/v4/core/compile.d.cts +51 -0
- package/node_modules/zod/v4/core/compile.d.ts +51 -0
- package/node_modules/zod/v4/core/compile.js +1783 -0
- package/node_modules/zod/v4/core/core.cjs +81 -18
- package/node_modules/zod/v4/core/core.d.cts +16 -4
- package/node_modules/zod/v4/core/core.d.ts +16 -4
- package/node_modules/zod/v4/core/core.js +82 -19
- package/node_modules/zod/v4/core/doc.cjs +5 -7
- package/node_modules/zod/v4/core/doc.d.cts +3 -1
- package/node_modules/zod/v4/core/doc.d.ts +3 -1
- package/node_modules/zod/v4/core/doc.js +5 -7
- package/node_modules/zod/v4/core/errors.cjs +110 -25
- package/node_modules/zod/v4/core/errors.d.cts +4 -0
- package/node_modules/zod/v4/core/errors.d.ts +4 -0
- package/node_modules/zod/v4/core/errors.js +110 -25
- package/node_modules/zod/v4/core/index.cjs +5 -1
- package/node_modules/zod/v4/core/index.d.cts +3 -0
- package/node_modules/zod/v4/core/index.d.ts +3 -0
- package/node_modules/zod/v4/core/index.js +3 -0
- package/node_modules/zod/v4/core/json-schema-generator.cjs +4 -0
- package/node_modules/zod/v4/core/json-schema-generator.d.cts +2 -2
- package/node_modules/zod/v4/core/json-schema-generator.d.ts +2 -2
- package/node_modules/zod/v4/core/json-schema-generator.js +4 -0
- package/node_modules/zod/v4/core/json-schema-processors.cjs +264 -95
- package/node_modules/zod/v4/core/json-schema-processors.js +243 -97
- package/node_modules/zod/v4/core/json-schema.d.cts +2 -1
- package/node_modules/zod/v4/core/json-schema.d.ts +2 -1
- package/node_modules/zod/v4/core/memoizer.cjs +272 -0
- package/node_modules/zod/v4/core/memoizer.d.cts +15 -0
- package/node_modules/zod/v4/core/memoizer.d.ts +15 -0
- package/node_modules/zod/v4/core/memoizer.js +265 -0
- package/node_modules/zod/v4/core/parse.cjs +96 -34
- package/node_modules/zod/v4/core/parse.d.cts +14 -11
- package/node_modules/zod/v4/core/parse.d.ts +14 -11
- package/node_modules/zod/v4/core/parse.js +94 -33
- package/node_modules/zod/v4/core/regexes.cjs +27 -15
- package/node_modules/zod/v4/core/regexes.d.cts +2 -0
- package/node_modules/zod/v4/core/regexes.d.ts +2 -0
- package/node_modules/zod/v4/core/regexes.js +24 -13
- package/node_modules/zod/v4/core/registries.js +2 -2
- package/node_modules/zod/v4/core/schemas.cjs +537 -326
- package/node_modules/zod/v4/core/schemas.d.cts +100 -31
- package/node_modules/zod/v4/core/schemas.d.ts +100 -31
- package/node_modules/zod/v4/core/schemas.js +526 -325
- package/node_modules/zod/v4/core/to-json-schema.cjs +242 -39
- package/node_modules/zod/v4/core/to-json-schema.d.cts +42 -3
- package/node_modules/zod/v4/core/to-json-schema.d.ts +42 -3
- package/node_modules/zod/v4/core/to-json-schema.js +241 -39
- package/node_modules/zod/v4/core/util.cjs +212 -31
- package/node_modules/zod/v4/core/util.d.cts +58 -1
- package/node_modules/zod/v4/core/util.d.ts +58 -1
- package/node_modules/zod/v4/core/util.js +202 -30
- package/node_modules/zod/v4/core/versions.cjs +2 -2
- package/node_modules/zod/v4/core/versions.d.cts +1 -1
- package/node_modules/zod/v4/core/versions.d.ts +1 -1
- package/node_modules/zod/v4/core/versions.js +2 -2
- package/node_modules/zod/v4/core/visit.cjs +195 -0
- package/node_modules/zod/v4/core/visit.d.cts +30 -0
- package/node_modules/zod/v4/core/visit.d.ts +30 -0
- package/node_modules/zod/v4/core/visit.js +169 -0
- package/node_modules/zod/v4/index.cjs +15 -5
- package/node_modules/zod/v4/index.d.cts +2 -2
- package/node_modules/zod/v4/index.d.ts +2 -2
- package/node_modules/zod/v4/index.js +3 -2
- package/node_modules/zod/v4/locales/ar.cjs +3 -0
- package/node_modules/zod/v4/locales/ar.js +3 -0
- package/node_modules/zod/v4/locales/az.cjs +3 -0
- package/node_modules/zod/v4/locales/az.js +3 -0
- package/node_modules/zod/v4/locales/be.cjs +10 -0
- package/node_modules/zod/v4/locales/be.js +10 -0
- package/node_modules/zod/v4/locales/bg.cjs +3 -0
- package/node_modules/zod/v4/locales/bg.js +3 -0
- package/node_modules/zod/v4/locales/bn.cjs +138 -0
- package/node_modules/zod/v4/locales/bn.d.cts +5 -0
- package/node_modules/zod/v4/locales/bn.d.ts +4 -0
- package/node_modules/zod/v4/locales/bn.js +111 -0
- package/node_modules/zod/v4/locales/ca.cjs +3 -0
- package/node_modules/zod/v4/locales/ca.js +3 -0
- package/node_modules/zod/v4/locales/ckb.cjs +158 -0
- package/node_modules/zod/v4/locales/ckb.d.cts +5 -0
- package/node_modules/zod/v4/locales/ckb.d.ts +4 -0
- package/node_modules/zod/v4/locales/ckb.js +131 -0
- package/node_modules/zod/v4/locales/cs.cjs +3 -0
- package/node_modules/zod/v4/locales/cs.js +3 -0
- package/node_modules/zod/v4/locales/da.cjs +5 -2
- package/node_modules/zod/v4/locales/da.js +5 -2
- package/node_modules/zod/v4/locales/de.cjs +3 -0
- package/node_modules/zod/v4/locales/de.js +3 -0
- package/node_modules/zod/v4/locales/el.cjs +1 -0
- package/node_modules/zod/v4/locales/el.js +1 -0
- package/node_modules/zod/v4/locales/en.cjs +14 -4
- package/node_modules/zod/v4/locales/en.js +14 -4
- package/node_modules/zod/v4/locales/eo.cjs +3 -0
- package/node_modules/zod/v4/locales/eo.js +3 -0
- package/node_modules/zod/v4/locales/es.cjs +2 -0
- package/node_modules/zod/v4/locales/es.js +2 -0
- package/node_modules/zod/v4/locales/fa.cjs +3 -0
- package/node_modules/zod/v4/locales/fa.js +3 -0
- package/node_modules/zod/v4/locales/fi.cjs +3 -0
- package/node_modules/zod/v4/locales/fi.js +3 -0
- package/node_modules/zod/v4/locales/fr-CA.cjs +3 -0
- package/node_modules/zod/v4/locales/fr-CA.js +3 -0
- package/node_modules/zod/v4/locales/fr.cjs +16 -14
- package/node_modules/zod/v4/locales/fr.js +16 -14
- package/node_modules/zod/v4/locales/gu.cjs +138 -0
- package/node_modules/zod/v4/locales/gu.d.cts +5 -0
- package/node_modules/zod/v4/locales/gu.d.ts +4 -0
- package/node_modules/zod/v4/locales/gu.js +111 -0
- package/node_modules/zod/v4/locales/he.cjs +5 -0
- package/node_modules/zod/v4/locales/he.js +5 -0
- package/node_modules/zod/v4/locales/hi.cjs +136 -0
- package/node_modules/zod/v4/locales/hi.d.cts +5 -0
- package/node_modules/zod/v4/locales/hi.d.ts +4 -0
- package/node_modules/zod/v4/locales/hi.js +109 -0
- package/node_modules/zod/v4/locales/hr.cjs +2 -0
- package/node_modules/zod/v4/locales/hr.js +2 -0
- package/node_modules/zod/v4/locales/hu.cjs +3 -0
- package/node_modules/zod/v4/locales/hu.js +3 -0
- package/node_modules/zod/v4/locales/hy.cjs +9 -0
- package/node_modules/zod/v4/locales/hy.js +9 -0
- package/node_modules/zod/v4/locales/id.cjs +3 -0
- package/node_modules/zod/v4/locales/id.js +3 -0
- package/node_modules/zod/v4/locales/index.cjs +22 -2
- package/node_modules/zod/v4/locales/index.d.cts +10 -0
- package/node_modules/zod/v4/locales/index.d.ts +10 -0
- package/node_modules/zod/v4/locales/index.js +10 -0
- package/node_modules/zod/v4/locales/is.cjs +3 -0
- package/node_modules/zod/v4/locales/is.js +3 -0
- package/node_modules/zod/v4/locales/it.cjs +3 -0
- package/node_modules/zod/v4/locales/it.js +3 -0
- package/node_modules/zod/v4/locales/ja.cjs +3 -0
- package/node_modules/zod/v4/locales/ja.js +3 -0
- package/node_modules/zod/v4/locales/ka.cjs +3 -0
- package/node_modules/zod/v4/locales/ka.js +3 -0
- package/node_modules/zod/v4/locales/km.cjs +3 -0
- package/node_modules/zod/v4/locales/km.js +3 -0
- package/node_modules/zod/v4/locales/kn.cjs +141 -0
- package/node_modules/zod/v4/locales/kn.d.cts +5 -0
- package/node_modules/zod/v4/locales/kn.d.ts +4 -0
- package/node_modules/zod/v4/locales/kn.js +114 -0
- package/node_modules/zod/v4/locales/ko.cjs +3 -0
- package/node_modules/zod/v4/locales/ko.js +3 -0
- package/node_modules/zod/v4/locales/lt.cjs +2 -0
- package/node_modules/zod/v4/locales/lt.js +2 -0
- package/node_modules/zod/v4/locales/mk.cjs +3 -0
- package/node_modules/zod/v4/locales/mk.js +3 -0
- package/node_modules/zod/v4/locales/ms.cjs +3 -0
- package/node_modules/zod/v4/locales/ms.js +3 -0
- package/node_modules/zod/v4/locales/ne.cjs +136 -0
- package/node_modules/zod/v4/locales/ne.d.cts +5 -0
- package/node_modules/zod/v4/locales/ne.d.ts +4 -0
- package/node_modules/zod/v4/locales/ne.js +109 -0
- package/node_modules/zod/v4/locales/nl.cjs +3 -0
- package/node_modules/zod/v4/locales/nl.js +3 -0
- package/node_modules/zod/v4/locales/nn.cjs +138 -0
- package/node_modules/zod/v4/locales/nn.d.cts +5 -0
- package/node_modules/zod/v4/locales/nn.d.ts +4 -0
- package/node_modules/zod/v4/locales/nn.js +111 -0
- package/node_modules/zod/v4/locales/no.cjs +5 -2
- package/node_modules/zod/v4/locales/no.js +5 -2
- package/node_modules/zod/v4/locales/ota.cjs +3 -0
- package/node_modules/zod/v4/locales/ota.js +3 -0
- package/node_modules/zod/v4/locales/pl.cjs +3 -0
- package/node_modules/zod/v4/locales/pl.js +3 -0
- package/node_modules/zod/v4/locales/ps.cjs +3 -0
- package/node_modules/zod/v4/locales/ps.js +3 -0
- package/node_modules/zod/v4/locales/pt-BR.cjs +168 -0
- package/node_modules/zod/v4/locales/pt-BR.d.cts +5 -0
- package/node_modules/zod/v4/locales/pt-BR.d.ts +4 -0
- package/node_modules/zod/v4/locales/pt-BR.js +141 -0
- package/node_modules/zod/v4/locales/pt.cjs +87 -55
- package/node_modules/zod/v4/locales/pt.js +87 -55
- package/node_modules/zod/v4/locales/ro.cjs +1 -0
- package/node_modules/zod/v4/locales/ro.js +1 -0
- package/node_modules/zod/v4/locales/ru.cjs +10 -0
- package/node_modules/zod/v4/locales/ru.js +10 -0
- package/node_modules/zod/v4/locales/sk.cjs +141 -0
- package/node_modules/zod/v4/locales/sk.d.cts +5 -0
- package/node_modules/zod/v4/locales/sk.d.ts +4 -0
- package/node_modules/zod/v4/locales/sk.js +114 -0
- package/node_modules/zod/v4/locales/sl.cjs +3 -0
- package/node_modules/zod/v4/locales/sl.js +3 -0
- package/node_modules/zod/v4/locales/sv.cjs +5 -2
- package/node_modules/zod/v4/locales/sv.js +5 -2
- package/node_modules/zod/v4/locales/ta.cjs +3 -0
- package/node_modules/zod/v4/locales/ta.js +3 -0
- package/node_modules/zod/v4/locales/th.cjs +3 -0
- package/node_modules/zod/v4/locales/th.js +3 -0
- package/node_modules/zod/v4/locales/tk.cjs +132 -0
- package/node_modules/zod/v4/locales/tk.d.cts +5 -0
- package/node_modules/zod/v4/locales/tk.d.ts +4 -0
- package/node_modules/zod/v4/locales/tk.js +105 -0
- package/node_modules/zod/v4/locales/tr.cjs +3 -0
- package/node_modules/zod/v4/locales/tr.js +3 -0
- package/node_modules/zod/v4/locales/uk.cjs +3 -0
- package/node_modules/zod/v4/locales/uk.js +3 -0
- package/node_modules/zod/v4/locales/ur.cjs +3 -0
- package/node_modules/zod/v4/locales/ur.js +3 -0
- package/node_modules/zod/v4/locales/uz.cjs +1 -0
- package/node_modules/zod/v4/locales/uz.js +1 -0
- package/node_modules/zod/v4/locales/vi.cjs +3 -0
- package/node_modules/zod/v4/locales/vi.js +3 -0
- package/node_modules/zod/v4/locales/yo.cjs +3 -0
- package/node_modules/zod/v4/locales/yo.js +3 -0
- package/node_modules/zod/v4/locales/zh-CN.cjs +3 -0
- package/node_modules/zod/v4/locales/zh-CN.js +3 -0
- package/node_modules/zod/v4/locales/zh-TW.cjs +3 -0
- package/node_modules/zod/v4/locales/zh-TW.js +3 -0
- package/node_modules/zod/v4/mini/checks.cjs +2 -1
- package/node_modules/zod/v4/mini/checks.d.cts +1 -1
- package/node_modules/zod/v4/mini/checks.d.ts +1 -1
- package/node_modules/zod/v4/mini/checks.js +1 -1
- package/node_modules/zod/v4/mini/deep-partial.cjs +39 -0
- package/node_modules/zod/v4/mini/deep-partial.d.cts +14 -0
- package/node_modules/zod/v4/mini/deep-partial.d.ts +14 -0
- package/node_modules/zod/v4/mini/deep-partial.js +13 -0
- package/node_modules/zod/v4/mini/external.cjs +12 -1
- package/node_modules/zod/v4/mini/external.d.cts +5 -2
- package/node_modules/zod/v4/mini/external.d.ts +5 -2
- package/node_modules/zod/v4/mini/external.js +3 -1
- package/node_modules/zod/v4/mini/in-out.cjs +63 -0
- package/node_modules/zod/v4/mini/in-out.d.cts +8 -0
- package/node_modules/zod/v4/mini/in-out.d.ts +8 -0
- package/node_modules/zod/v4/mini/in-out.js +36 -0
- package/node_modules/zod/v4/mini/parse.cjs +3 -1
- package/node_modules/zod/v4/mini/parse.d.cts +1 -1
- package/node_modules/zod/v4/mini/parse.d.ts +1 -1
- package/node_modules/zod/v4/mini/parse.js +1 -1
- package/node_modules/zod/v4/mini/schemas.cjs +75 -47
- package/node_modules/zod/v4/mini/schemas.d.cts +43 -13
- package/node_modules/zod/v4/mini/schemas.d.ts +43 -13
- package/node_modules/zod/v4/mini/schemas.js +71 -45
- package/openclaw.plugin.json +12 -28
- package/package.json +9 -6
- package/node_modules/zod/src/v4/core/config.ts +0 -15
- /package/dist/{group-access-8qHRzDHx.js → .setup/group-access-8qHRzDHx.mjs} +0 -0
- /package/dist/{runtime-Dfhzt7qb.js → .setup/runtime-Dfhzt7qb.mjs} +0 -0
- /package/dist/{secret-contract-Cpsqe5Cv.js → .setup/secret-contract-Cpsqe5Cv.mjs} +0 -0
- /package/dist/{setup-core-CCMLSh4Q.js → .setup/setup-core-CCMLSh4Q.mjs} +0 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
|
2
|
+
<!--
|
|
3
|
+
Source: simple-icons@13.21.0, icons/zalo.svg
|
|
4
|
+
https://www.npmjs.com/package/simple-icons/v/13.21.0
|
|
5
|
+
https://github.com/simple-icons/simple-icons
|
|
6
|
+
|
|
7
|
+
# CC0 1.0 Universal
|
|
8
|
+
|
|
9
|
+
## Statement of Purpose
|
|
10
|
+
|
|
11
|
+
The laws of most jurisdictions throughout the world automatically confer exclusive Copyright and Related Rights (defined below) upon the creator and subsequent owner(s) (each and all, an “owner”) of an original work of authorship and/or a database (each, a “Work”).
|
|
12
|
+
|
|
13
|
+
Certain owners wish to permanently relinquish those rights to a Work for the purpose of contributing to a commons of creative, cultural and scientific works (“Commons”) that the public can reliably and without fear of later claims of infringement build upon, modify, incorporate in other works, reuse and redistribute as freely as possible in any form whatsoever and for any purposes, including without limitation commercial purposes. These owners may contribute to the Commons to promote the ideal of a free culture and the further production of creative, cultural and scientific works, or to gain reputation or greater distribution for their Work in part through the use and efforts of others.
|
|
14
|
+
|
|
15
|
+
For these and/or other purposes and motivations, and without any expectation of additional consideration or compensation, the person associating CC0 with a Work (the “Affirmer”), to the extent that he or she is an owner of Copyright and Related Rights in the Work, voluntarily elects to apply CC0 to the Work and publicly distribute the Work under its terms, with knowledge of his or her Copyright and Related Rights in the Work and the meaning and intended legal effect of CC0 on those rights.
|
|
16
|
+
|
|
17
|
+
1. Copyright and Related Rights. A Work made available under CC0 may be protected by copyright and related or neighboring rights (“Copyright and Related Rights”). Copyright and Related Rights include, but are not limited to, the following:
|
|
18
|
+
1. the right to reproduce, adapt, distribute, perform, display, communicate, and translate a Work;
|
|
19
|
+
2. moral rights retained by the original author(s) and/or performer(s);
|
|
20
|
+
3. publicity and privacy rights pertaining to a person’s image or likeness depicted in a Work;
|
|
21
|
+
4. rights protecting against unfair competition in regards to a Work, subject to the limitations in paragraph 4(i), below;
|
|
22
|
+
5. rights protecting the extraction, dissemination, use and reuse of data in a Work;
|
|
23
|
+
6. database rights (such as those arising under Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, and under any national implementation thereof, including any amended or successor version of such directive); and
|
|
24
|
+
7. other similar, equivalent or corresponding rights throughout the world based on applicable law or treaty, and any national implementations thereof.
|
|
25
|
+
|
|
26
|
+
2. Waiver. To the greatest extent permitted by, but not in contravention of, applicable law, Affirmer hereby overtly, fully, permanently, irrevocably and unconditionally waives, abandons, and surrenders all of Affirmer’s Copyright and Related Rights and associated claims and causes of action, whether now known or unknown (including existing as well as future claims and causes of action), in the Work (i) in all territories worldwide, (ii) for the maximum duration provided by applicable law or treaty (including future time extensions), (iii) in any current or future medium and for any number of copies, and (iv) for any purpose whatsoever, including without limitation commercial, advertising or promotional purposes (the “Waiver”). Affirmer makes the Waiver for the benefit of each member of the public at large and to the detriment of Affirmer’s heirs and successors, fully intending that such Waiver shall not be subject to revocation, rescission, cancellation, termination, or any other legal or equitable action to disrupt the quiet enjoyment of the Work by the public as contemplated by Affirmer’s express Statement of Purpose.
|
|
27
|
+
|
|
28
|
+
3. Public License Fallback. Should any part of the Waiver for any reason be judged legally invalid or ineffective under applicable law, then the Waiver shall be preserved to the maximum extent permitted taking into account Affirmer’s express Statement of Purpose. In addition, to the extent the Waiver is so judged Affirmer hereby grants to each affected person a royalty-free, non transferable, non sublicensable, non exclusive, irrevocable and unconditional license to exercise Affirmer’s Copyright and Related Rights in the Work (i) in all territories worldwide, (ii) for the maximum duration provided by applicable law or treaty (including future time extensions), (iii) in any current or future medium and for any number of copies, and (iv) for any purpose whatsoever, including without limitation commercial, advertising or promotional purposes (the “License”). The License shall be deemed effective as of the date CC0 was applied by Affirmer to the Work. Should any part of the License for any reason be judged legally invalid or ineffective under applicable law, such partial invalidity or ineffectiveness shall not invalidate the remainder of the License, and in such case Affirmer hereby affirms that he or she will not (i) exercise any of his or her remaining Copyright and Related Rights in the Work or (ii) assert any associated claims and causes of action with respect to the Work, in either case contrary to Affirmer’s express Statement of Purpose.
|
|
29
|
+
|
|
30
|
+
4. Limitations and Disclaimers.
|
|
31
|
+
1. No trademark or patent rights held by Affirmer are waived, abandoned, surrendered, licensed or otherwise affected by this document.
|
|
32
|
+
2. Affirmer offers the Work as-is and makes no representations or warranties of any kind concerning the Work, express, implied, statutory or otherwise, including without limitation warranties of title, merchantability, fitness for a particular purpose, non infringement, or the absence of latent or other defects, accuracy, or the present or absence of errors, whether or not discoverable, all to the greatest extent permissible under applicable law.
|
|
33
|
+
3. Affirmer disclaims responsibility for clearing rights of other persons that may apply to the Work or any use thereof, including without limitation any person’s Copyright and Related Rights in the Work. Further, Affirmer disclaims responsibility for obtaining any necessary consents, permissions or other rights required for any use of the Work.
|
|
34
|
+
4. Affirmer understands and acknowledges that Creative Commons is not a party to this document and has no duty or obligation with respect to this CC0 or use of the Work.
|
|
35
|
+
|
|
36
|
+
For more information, please see <https://creativecommons.org/publicdomain/zero/1.0>.
|
|
37
|
+
Names and marks remain the property of their respective owners.
|
|
38
|
+
-->
|
|
39
|
+
<path fill="currentColor" stroke="none" d="M12.49 10.2722v-.4496h1.3467v6.3218h-.7704a.576.576 0 01-.5763-.5729l-.0006.0005a3.273 3.273 0 01-1.9372.6321c-1.8138 0-3.2844-1.4697-3.2844-3.2823 0-1.8125 1.4706-3.2822 3.2844-3.2822a3.273 3.273 0 011.9372.6321l.0006.0005zM6.9188 7.7896v.205c0 .3823-.051.6944-.2995 1.0605l-.03.0343c-.0542.0615-.1815.206-.2421.2843L2.024 14.8h4.8948v.7682a.5764.5764 0 01-.5767.5761H0v-.3622c0-.4436.1102-.6414.2495-.8476L4.8582 9.23H.1922V7.7896h6.7266zm8.5513 8.3548a.4805.4805 0 01-.4803-.4798v-7.875h1.4416v8.3548H15.47zM20.6934 9.6C22.52 9.6 24 11.0807 24 12.9044c0 1.8252-1.4801 3.306-3.3066 3.306-1.8264 0-3.3066-1.4808-3.3066-3.306 0-1.8237 1.4802-3.3044 3.3066-3.3044zm-10.1412 5.253c1.0675 0 1.9324-.8645 1.9324-1.9312 0-1.065-.865-1.9295-1.9324-1.9295s-1.9324.8644-1.9324 1.9295c0 1.0667.865 1.9312 1.9324 1.9312zm10.1412-.0033c1.0737 0 1.945-.8707 1.945-1.9453 0-1.073-.8713-1.9436-1.945-1.9436-1.0753 0-1.945.8706-1.945 1.9436 0 1.0746.8697 1.9453 1.945 1.9453z" />
|
|
40
|
+
</svg>
|
package/assets/icon.png
ADDED
|
Binary file
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { n as zaloDmPolicy, r as zaloSetupAdapter, t as createZaloSetupWizardProxy } from "./setup-core-CCMLSh4Q.mjs";
|
|
2
|
+
import { t as zaloPlugin } from "./channel-D14b6qHz.mjs";
|
|
3
|
+
import { n as resolveZaloRuntimeGroupPolicy } from "./group-access-8qHRzDHx.mjs";
|
|
4
|
+
import { zaloSetupWizard } from "../setup-api.js";
|
|
5
|
+
import "../api.js";
|
|
6
|
+
export { createZaloSetupWizardProxy, resolveZaloRuntimeGroupPolicy, zaloDmPolicy, zaloPlugin, zaloSetupAdapter, zaloSetupWizard };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as isZaloAccountConfigured, d as resolveZaloAccount, i as zaloSetupContract, l as listZaloAccountIds, p as buildSecretInputSchema, s as inspectZaloAccount, t as createZaloSetupWizardProxy, u as resolveDefaultZaloAccountId } from "./setup-core-CCMLSh4Q.
|
|
2
|
-
import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries } from "./secret-contract-Cpsqe5Cv.
|
|
1
|
+
import { c as isZaloAccountConfigured, d as resolveZaloAccount, i as zaloSetupContract, l as listZaloAccountIds, p as buildSecretInputSchema, s as inspectZaloAccount, t as createZaloSetupWizardProxy, u as resolveDefaultZaloAccountId } from "./setup-core-CCMLSh4Q.mjs";
|
|
2
|
+
import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries } from "./secret-contract-Cpsqe5Cv.mjs";
|
|
3
3
|
import { describeWebhookAccountSnapshot } from "openclaw/plugin-sdk/account-helpers";
|
|
4
4
|
import { DEFAULT_ACCOUNT_ID } from "openclaw/plugin-sdk/account-id";
|
|
5
5
|
import { formatAllowFromLowercase } from "openclaw/plugin-sdk/allow-from";
|
|
@@ -24,7 +24,7 @@ import { z } from "zod";
|
|
|
24
24
|
import { buildChannelOutboundSessionRoute, stripChannelTargetPrefix, stripTargetKindPrefix } from "openclaw/plugin-sdk/core";
|
|
25
25
|
import { coerceStatusIssueAccountId, readStatusIssueFields } from "openclaw/plugin-sdk/extension-shared";
|
|
26
26
|
//#region extensions/zalo/src/actions.ts
|
|
27
|
-
const loadZaloActionsRuntime = createLazyRuntimeNamedExport(() => import("./actions.runtime-
|
|
27
|
+
const loadZaloActionsRuntime = createLazyRuntimeNamedExport(() => import("./actions.runtime-DZsb7I67.mjs"), "zaloActionsRuntime");
|
|
28
28
|
const providerId = "zalo";
|
|
29
29
|
const ZALO_ACTIONS = /* @__PURE__ */ new Set(["send"]);
|
|
30
30
|
function listEnabledAccounts(cfg, accountId) {
|
|
@@ -46,7 +46,7 @@ const zaloMessageActions = {
|
|
|
46
46
|
},
|
|
47
47
|
supportsAction: ({ action }) => ZALO_ACTIONS.has(action),
|
|
48
48
|
extractToolSend: ({ args }) => extractToolSend(args, "sendMessage"),
|
|
49
|
-
handleAction: async ({ action, params, cfg, accountId }) => {
|
|
49
|
+
handleAction: async ({ action, params, cfg, accountId, assertDirectAdapterHandoff }) => {
|
|
50
50
|
if (action === "send") {
|
|
51
51
|
const to = readStringParam(params, "to", { required: true });
|
|
52
52
|
const content = readStringParam(params, "message", {
|
|
@@ -58,7 +58,8 @@ const zaloMessageActions = {
|
|
|
58
58
|
const result = await sendMessageZalo(to ?? "", content ?? "", {
|
|
59
59
|
accountId: accountId ?? void 0,
|
|
60
60
|
mediaUrl: mediaUrl ?? void 0,
|
|
61
|
-
cfg
|
|
61
|
+
cfg,
|
|
62
|
+
assertDirectAdapterHandoff
|
|
62
63
|
});
|
|
63
64
|
if (!result.ok) return jsonResult({
|
|
64
65
|
ok: false,
|
|
@@ -186,8 +187,8 @@ function looksLikeZaloChatId(raw, normalized) {
|
|
|
186
187
|
const target = normalizeZaloMessagingTarget(normalized ?? raw);
|
|
187
188
|
return Boolean(target);
|
|
188
189
|
}
|
|
189
|
-
const loadZaloChannelRuntime = createLazyRuntimeModule(() => import("./channel.runtime-
|
|
190
|
-
const zaloSetupWizard = createZaloSetupWizardProxy(async () => (await import("./setup-surface
|
|
190
|
+
const loadZaloChannelRuntime = createLazyRuntimeModule(() => import("./channel.runtime-BA2foB5C.mjs"));
|
|
191
|
+
const zaloSetupWizard = createZaloSetupWizardProxy(async () => (await import("./setup-surface-CNyPRzlv.mjs").then((n) => n.t)).zaloSetupWizard);
|
|
191
192
|
const zaloTextChunkLimit = 2e3;
|
|
192
193
|
async function sendZaloDelivery(ctx) {
|
|
193
194
|
const result = await (await loadZaloChannelRuntime()).sendZaloText({
|
|
@@ -195,7 +196,8 @@ async function sendZaloDelivery(ctx) {
|
|
|
195
196
|
text: ctx.text,
|
|
196
197
|
accountId: ctx.accountId ?? void 0,
|
|
197
198
|
mediaUrl: ctx.mediaUrl,
|
|
198
|
-
cfg: ctx.cfg
|
|
199
|
+
cfg: ctx.cfg,
|
|
200
|
+
assertDirectAdapterHandoff: ctx.assertDirectAdapterHandoff
|
|
199
201
|
});
|
|
200
202
|
if (!result.ok) throw new Error(result.error ?? `Failed to send Zalo ${ctx.mediaUrl ? "media" : "message"}`);
|
|
201
203
|
return {
|
|
@@ -266,7 +268,7 @@ const collectZaloSecurityWarnings = createOpenProviderGroupPolicyWarningCollecto
|
|
|
266
268
|
const collectZaloOpenGroupFindings = createConditionalWarningCollector.findings({
|
|
267
269
|
collectWarnings: collectZaloSecurityWarnings,
|
|
268
270
|
checkId: "channels.zalo.groups.open",
|
|
269
|
-
severity: "
|
|
271
|
+
severity: "warn",
|
|
270
272
|
title: "Zalo security warning"
|
|
271
273
|
});
|
|
272
274
|
const zaloPlugin = createChatChannelPlugin({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { m as normalizeSecretInputString } from "./setup-core-CCMLSh4Q.
|
|
2
|
-
import { a as getMe, n as resolveZaloProxyFetch, r as ZaloApiError, t as sendMessageZalo } from "./send-
|
|
1
|
+
import { m as normalizeSecretInputString } from "./setup-core-CCMLSh4Q.mjs";
|
|
2
|
+
import { a as getMe, n as resolveZaloProxyFetch, r as ZaloApiError, t as sendMessageZalo } from "./send-C01aoqEH.mjs";
|
|
3
3
|
import { createAccountStatusSink } from "openclaw/plugin-sdk/channel-outbound";
|
|
4
4
|
import { runChannelProbe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
5
5
|
//#region extensions/zalo/src/probe.ts
|
|
@@ -62,7 +62,7 @@ async function startZaloGatewayAccount(ctx) {
|
|
|
62
62
|
setStatus: ctx.setStatus
|
|
63
63
|
});
|
|
64
64
|
ctx.log?.info(`[${account.accountId}] starting provider${zaloBotLabel} mode=${mode}`);
|
|
65
|
-
const { monitorZaloProvider } = await import("./monitor-
|
|
65
|
+
const { monitorZaloProvider } = await import("./monitor-Cu5XdWDg.mjs");
|
|
66
66
|
return monitorZaloProvider({
|
|
67
67
|
token,
|
|
68
68
|
account,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as resolveZaloRuntimeGroupPolicy, t as normalizeZaloAllowEntry } from "./group-access-8qHRzDHx.
|
|
2
|
-
import { t as getZaloRuntime } from "./runtime-Dfhzt7qb.
|
|
3
|
-
import { c as sendChatAction, d as setWebhook, f as ZALO_OUTBOUND_MEDIA_TTL_MS, i as deleteWebhook, l as sendMessage, n as resolveZaloProxyFetch, o as getUpdates, r as ZaloApiError, s as getWebhookInfo, u as sendPhoto } from "./send-
|
|
1
|
+
import { n as resolveZaloRuntimeGroupPolicy, t as normalizeZaloAllowEntry } from "./group-access-8qHRzDHx.mjs";
|
|
2
|
+
import { t as getZaloRuntime } from "./runtime-Dfhzt7qb.mjs";
|
|
3
|
+
import { c as sendChatAction, d as setWebhook, f as ZALO_OUTBOUND_MEDIA_TTL_MS, i as deleteWebhook, l as sendMessage, n as resolveZaloProxyFetch, o as getUpdates, r as ZaloApiError, s as getWebhookInfo, u as sendPhoto } from "./send-C01aoqEH.mjs";
|
|
4
4
|
import { createMessageReceiptFromOutboundResults } from "openclaw/plugin-sdk/channel-outbound";
|
|
5
5
|
import { createLazyRuntimeModule, createLazyRuntimeNamedExport } from "openclaw/plugin-sdk/lazy-runtime";
|
|
6
6
|
import { deliverTextOrMediaReply, resolveSendableOutboundReplyParts } from "openclaw/plugin-sdk/reply-payload";
|
|
@@ -173,8 +173,8 @@ function resolveZaloTimestampMs(date) {
|
|
|
173
173
|
if (!date) return;
|
|
174
174
|
return date >= UNIX_MILLISECONDS_THRESHOLD ? date : date * 1e3;
|
|
175
175
|
}
|
|
176
|
-
const loadZaloWebhookRuntime = createLazyRuntimeNamedExport(() => import("./monitor.webhook-
|
|
177
|
-
const loadZaloWebhookIngressRuntime = createLazyRuntimeNamedExport(() => import("./webhook-spool-
|
|
176
|
+
const loadZaloWebhookRuntime = createLazyRuntimeNamedExport(() => import("./monitor.webhook-SDR5zoSA.mjs"), "zaloWebhookRuntime");
|
|
177
|
+
const loadZaloWebhookIngressRuntime = createLazyRuntimeNamedExport(() => import("./webhook-spool-nmnflXt2.mjs"), "zaloWebhookIngressRuntime");
|
|
178
178
|
const loadZaloWebhookModule = createLazyRuntimeModule(async () => ({
|
|
179
179
|
...await loadZaloWebhookRuntime(),
|
|
180
180
|
...await loadZaloWebhookIngressRuntime()
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { WEBHOOK_ANOMALY_COUNTER_DEFAULTS, WEBHOOK_RATE_LIMIT_DEFAULTS, applyBasicWebhookRequestGuards, createFixedWindowRateLimiter, createWebhookAnomalyTracker, registerWebhookTarget, registerWebhookTargetWithPluginRoute, resolveClientIp, resolveWebhookTargetWithAuthOrRejectSync, withResolvedWebhookRequestPipeline } from "
|
|
2
|
-
import { ZaloWebhookPayloadError } from "./webhook-spool-
|
|
1
|
+
import { WEBHOOK_ANOMALY_COUNTER_DEFAULTS, WEBHOOK_RATE_LIMIT_DEFAULTS, applyBasicWebhookRequestGuards, createFixedWindowRateLimiter, createWebhookAnomalyTracker, registerWebhookTarget, registerWebhookTargetWithPluginRoute, resolveClientIp, resolveWebhookTargetWithAuthOrRejectSync, withResolvedWebhookRequestPipeline } from "../runtime-api.js";
|
|
2
|
+
import { ZaloWebhookPayloadError } from "./webhook-spool-nmnflXt2.mjs";
|
|
3
3
|
import { safeEqualSecret } from "openclaw/plugin-sdk/security-runtime";
|
|
4
4
|
import { readWebhookBodyOrReject } from "openclaw/plugin-sdk/webhook-request-guards";
|
|
5
5
|
//#region extensions/zalo/src/monitor.webhook.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as resolveZaloAccount, f as resolveZaloToken } from "./setup-core-CCMLSh4Q.
|
|
1
|
+
import { d as resolveZaloAccount, f as resolveZaloToken } from "./setup-core-CCMLSh4Q.mjs";
|
|
2
2
|
import { createMessageReceiptFromOutboundResults } from "openclaw/plugin-sdk/channel-outbound";
|
|
3
3
|
import { stripChannelTargetPrefix, stripTargetKindPrefix } from "openclaw/plugin-sdk/core";
|
|
4
4
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
@@ -55,12 +55,14 @@ async function callZaloApi(method, token, body, options) {
|
|
|
55
55
|
const timeoutId = setTimeout(() => controller.abort(), requestTimeoutMs);
|
|
56
56
|
const fetcher = options?.fetch ?? fetch;
|
|
57
57
|
try {
|
|
58
|
-
const
|
|
58
|
+
const request = {
|
|
59
59
|
method: "POST",
|
|
60
60
|
headers: { "Content-Type": "application/json" },
|
|
61
61
|
body: body ? JSON.stringify(body) : void 0,
|
|
62
62
|
signal: controller.signal
|
|
63
|
-
}
|
|
63
|
+
};
|
|
64
|
+
options?.assertDirectAdapterHandoff?.();
|
|
65
|
+
const response = await fetcher(url, request);
|
|
64
66
|
await assertOkOrThrowProviderError(response, `zalo.${method}`);
|
|
65
67
|
const data = await readProviderJsonResponse(response, `zalo.${method}`);
|
|
66
68
|
if (!data.ok) throw new ZaloApiError(data.description ?? `Zalo API error: ${method}`, data.error_code, data.description);
|
|
@@ -81,13 +83,16 @@ async function getMe(token, timeoutMs, fetcher) {
|
|
|
81
83
|
/**
|
|
82
84
|
* Send a text message
|
|
83
85
|
*/
|
|
84
|
-
async function sendMessage(token, params, fetcher) {
|
|
85
|
-
return callZaloApi("sendMessage", token, params, {
|
|
86
|
+
async function sendMessage(token, params, fetcher, assertDirectAdapterHandoff) {
|
|
87
|
+
return callZaloApi("sendMessage", token, params, {
|
|
88
|
+
fetch: fetcher,
|
|
89
|
+
assertDirectAdapterHandoff
|
|
90
|
+
});
|
|
86
91
|
}
|
|
87
92
|
/**
|
|
88
93
|
* Send a photo message
|
|
89
94
|
*/
|
|
90
|
-
async function sendPhoto(token, params, fetcher) {
|
|
95
|
+
async function sendPhoto(token, params, fetcher, assertDirectAdapterHandoff) {
|
|
91
96
|
const photoUrl = params.photo.trim();
|
|
92
97
|
let parsedPhotoUrl;
|
|
93
98
|
try {
|
|
@@ -102,7 +107,8 @@ async function sendPhoto(token, params, fetcher) {
|
|
|
102
107
|
photo: parsedPhotoUrl.href
|
|
103
108
|
}, {
|
|
104
109
|
timeoutMs: ZALO_SEND_PHOTO_REQUEST_TIMEOUT_MS,
|
|
105
|
-
fetch: fetcher
|
|
110
|
+
fetch: fetcher,
|
|
111
|
+
assertDirectAdapterHandoff
|
|
106
112
|
});
|
|
107
113
|
}
|
|
108
114
|
/**
|
|
@@ -191,15 +197,27 @@ function toZaloSendResult(response, params) {
|
|
|
191
197
|
})
|
|
192
198
|
};
|
|
193
199
|
}
|
|
194
|
-
async function runZaloSend(failureMessage, params, send) {
|
|
200
|
+
async function runZaloSend(failureMessage, params, assertDirectAdapterHandoff, send) {
|
|
201
|
+
let handoffRejected = false;
|
|
202
|
+
let handoffError;
|
|
203
|
+
const assertCurrent = assertDirectAdapterHandoff ? () => {
|
|
204
|
+
try {
|
|
205
|
+
assertDirectAdapterHandoff();
|
|
206
|
+
} catch (error) {
|
|
207
|
+
handoffRejected = true;
|
|
208
|
+
handoffError = error;
|
|
209
|
+
throw error;
|
|
210
|
+
}
|
|
211
|
+
} : void 0;
|
|
195
212
|
try {
|
|
196
|
-
const result = toZaloSendResult(await send(), params);
|
|
213
|
+
const result = toZaloSendResult(await send(assertCurrent), params);
|
|
197
214
|
return result.ok ? result : {
|
|
198
215
|
ok: false,
|
|
199
216
|
error: failureMessage,
|
|
200
217
|
receipt: result.receipt
|
|
201
218
|
};
|
|
202
219
|
} catch (err) {
|
|
220
|
+
if (handoffRejected && Object.is(handoffError, err)) throw err;
|
|
203
221
|
return {
|
|
204
222
|
ok: false,
|
|
205
223
|
error: formatErrorMessage(err),
|
|
@@ -278,19 +296,19 @@ async function sendMessageZalo(chatId, text, options = {}) {
|
|
|
278
296
|
return await runZaloSend("Failed to send photo", {
|
|
279
297
|
chatId: context.chatId,
|
|
280
298
|
kind: "media"
|
|
281
|
-
}, () => sendPhoto(context.token, {
|
|
299
|
+
}, options.assertDirectAdapterHandoff, (assertCurrent) => sendPhoto(context.token, {
|
|
282
300
|
chat_id: context.chatId,
|
|
283
301
|
photo: photoUrl,
|
|
284
302
|
caption: caption !== void 0 ? truncateUtf16Safe(caption, 2e3) : void 0
|
|
285
|
-
}, context.fetcher));
|
|
303
|
+
}, context.fetcher, assertCurrent));
|
|
286
304
|
}
|
|
287
305
|
return await runZaloSend("Failed to send message", {
|
|
288
306
|
chatId: context.chatId,
|
|
289
307
|
kind: "text"
|
|
290
|
-
}, () => sendMessage(context.token, {
|
|
308
|
+
}, options.assertDirectAdapterHandoff, (assertCurrent) => sendMessage(context.token, {
|
|
291
309
|
chat_id: context.chatId,
|
|
292
310
|
text: truncateUtf16Safe(text, 2e3)
|
|
293
|
-
}, context.fetcher));
|
|
311
|
+
}, context.fetcher, assertCurrent));
|
|
294
312
|
}
|
|
295
313
|
//#endregion
|
|
296
314
|
export { getMe as a, sendChatAction as c, setWebhook as d, ZALO_OUTBOUND_MEDIA_TTL_MS as f, deleteWebhook as i, sendMessage as l, resolveZaloProxyFetch as n, getUpdates as o, ZaloApiError as r, getWebhookInfo as s, sendMessageZalo as t, sendPhoto as u };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as noteZaloTokenHelp, n as zaloDmPolicy, o as promptZaloAllowFrom, s as inspectZaloAccount } from "./setup-core-CCMLSh4Q.
|
|
1
|
+
import { a as noteZaloTokenHelp, n as zaloDmPolicy, o as promptZaloAllowFrom, s as inspectZaloAccount } from "./setup-core-CCMLSh4Q.mjs";
|
|
2
2
|
import { DEFAULT_ACCOUNT_ID, buildSingleChannelSecretPromptState, createSetupTranslator, createStandardChannelSetupStatus, hasConfiguredSecretInput, patchTopLevelChannelConfigSection, promptSingleChannelSecretInput, runSingleChannelSecretStep } from "openclaw/plugin-sdk/setup";
|
|
3
3
|
//#region \0rolldown/runtime.js
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as getZaloRuntime } from "./runtime-Dfhzt7qb.
|
|
2
|
-
import { r as ZaloApiError } from "./send-
|
|
1
|
+
import { t as getZaloRuntime } from "./runtime-Dfhzt7qb.mjs";
|
|
2
|
+
import { r as ZaloApiError } from "./send-C01aoqEH.mjs";
|
|
3
3
|
import { DEFAULT_INGRESS_ADOPTION_STALL_MS, DEFAULT_INGRESS_RETRY_MAX_ATTEMPTS, bindIngressLifecycleToReplyOptions, createChannelIngressError, createChannelIngressMonitor } from "openclaw/plugin-sdk/channel-outbound";
|
|
4
4
|
import { normalizeNullableString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
5
5
|
import { z } from "zod";
|
package/dist/api.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as zaloDmPolicy, r as zaloSetupAdapter, t as createZaloSetupWizardProxy } from "
|
|
2
|
-
import { t as zaloPlugin } from "
|
|
3
|
-
import { n as resolveZaloRuntimeGroupPolicy } from "
|
|
1
|
+
import { n as zaloDmPolicy, r as zaloSetupAdapter, t as createZaloSetupWizardProxy } from "./.setup/setup-core-CCMLSh4Q.mjs";
|
|
2
|
+
import { t as zaloPlugin } from "./.setup/channel-D14b6qHz.mjs";
|
|
3
|
+
import { n as resolveZaloRuntimeGroupPolicy } from "./.setup/group-access-8qHRzDHx.mjs";
|
|
4
4
|
import { zaloSetupWizard } from "./setup-api.js";
|
|
5
5
|
export { createZaloSetupWizardProxy, resolveZaloRuntimeGroupPolicy, zaloDmPolicy, zaloPlugin, zaloSetupAdapter, zaloSetupWizard };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as zaloPlugin } from "
|
|
1
|
+
import { t as zaloPlugin } from "./.setup/channel-D14b6qHz.mjs";
|
|
2
2
|
export { zaloPlugin };
|
package/dist/contract-api.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as resolveZaloRuntimeGroupPolicy } from "
|
|
1
|
+
import { n as resolveZaloRuntimeGroupPolicy } from "./.setup/group-access-8qHRzDHx.mjs";
|
|
2
2
|
export { resolveZaloRuntimeGroupPolicy };
|
package/dist/runtime-api.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as setZaloRuntime } from "
|
|
1
|
+
import { n as setZaloRuntime } from "./.setup/runtime-Dfhzt7qb.mjs";
|
|
2
2
|
import { formatAllowFromLowercase, isNormalizedSenderAllowed } from "openclaw/plugin-sdk/allow-from";
|
|
3
3
|
import { createChannelMessageReplyPipeline } from "openclaw/plugin-sdk/channel-outbound";
|
|
4
4
|
import { PAIRING_APPROVED_MESSAGE, buildTokenChannelStatusSummary } from "openclaw/plugin-sdk/channel-status";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries, t as channelSecrets } from "
|
|
1
|
+
import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries, t as channelSecrets } from "./.setup/secret-contract-Cpsqe5Cv.mjs";
|
|
2
2
|
export { channelSecrets, collectRuntimeConfigAssignments, secretTargetRegistryEntries };
|
package/dist/setup-api.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as zaloDmPolicy, r as zaloSetupAdapter, t as createZaloSetupWizardProxy } from "
|
|
2
|
-
import { n as resolveZaloRuntimeGroupPolicy } from "
|
|
1
|
+
import { n as zaloDmPolicy, r as zaloSetupAdapter, t as createZaloSetupWizardProxy } from "./.setup/setup-core-CCMLSh4Q.mjs";
|
|
2
|
+
import { n as resolveZaloRuntimeGroupPolicy } from "./.setup/group-access-8qHRzDHx.mjs";
|
|
3
3
|
import { loadBundledEntryExportSync } from "openclaw/plugin-sdk/channel-entry-contract";
|
|
4
4
|
//#region extensions/zalo/setup-api.ts
|
|
5
5
|
function createLazyObjectValue(load) {
|
package/dist/setup-entry.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { defineBundledChannelSetupEntry } from "openclaw/plugin-sdk/channel-entry-contract";
|
|
2
|
+
import { fileURLToPath } from "node:url";
|
|
2
3
|
//#region extensions/zalo/setup-entry.ts
|
|
3
4
|
var setup_entry_default = defineBundledChannelSetupEntry({
|
|
4
5
|
importMetaUrl: import.meta.url,
|
|
5
6
|
plugin: {
|
|
6
|
-
specifier: "
|
|
7
|
+
specifier: fileURLToPath(new URL(".setup/api-BPF84XFR.mjs", import.meta.url).href),
|
|
7
8
|
exportName: "zaloPlugin"
|
|
8
9
|
},
|
|
9
10
|
secrets: {
|
|
10
|
-
specifier: "
|
|
11
|
+
specifier: fileURLToPath(new URL(".setup/secret-contract-api-DKDS_ZlS.mjs", import.meta.url).href),
|
|
11
12
|
exportName: "channelSecrets"
|
|
12
13
|
}
|
|
13
14
|
});
|
package/dist/setup-surface.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { n as zaloSetupWizard } from "
|
|
2
|
-
import { r as zaloSetupAdapter } from "
|
|
1
|
+
import { n as zaloSetupWizard } from "./.setup/setup-surface-CNyPRzlv.mjs";
|
|
2
|
+
import { r as zaloSetupAdapter } from "./.setup/setup-core-CCMLSh4Q.mjs";
|
|
3
3
|
export { zaloSetupAdapter, zaloSetupWizard };
|
|
@@ -113,6 +113,33 @@ await schema.parseAsync("hello");
|
|
|
113
113
|
// => "hello"
|
|
114
114
|
```
|
|
115
115
|
|
|
116
|
+
### AOT compilation
|
|
117
|
+
|
|
118
|
+
For hot validation paths, `z.compile(schema)` returns a schema clone with an ahead-of-time compiled fast path. Valid inputs take the compiled path; invalid inputs fall back to the regular parser so error reporting stays identical.
|
|
119
|
+
|
|
120
|
+
Across a 55-schema benchmark the median speedup is **2.4x**, and it scales with how much work the schema does per parse: a large array of objects is ~9x, a 20-key object ~9x, a nested object ~4.5x, while a bare `z.string()` gains nothing — compilation removes per-node dispatch and allocation, and a single `typeof` has none to remove.
|
|
121
|
+
|
|
122
|
+
```ts
|
|
123
|
+
const CompiledPlayer = z.compile(Player);
|
|
124
|
+
|
|
125
|
+
CompiledPlayer.parse({ username: "billie", xp: 100 });
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
To enable compilation globally for schemas constructed after import:
|
|
129
|
+
|
|
130
|
+
```ts
|
|
131
|
+
import "zod/compile"; // place before modules that define schemas
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
Things to know:
|
|
135
|
+
|
|
136
|
+
- Compilation uses `new Function`. Global mode is automatically disabled when `z.config({ jitless: true })` is set (e.g. CSP environments); calling `z.compile()` directly is an explicit opt-in.
|
|
137
|
+
- Schemas with async refinements or transforms can't be compiled, and neither can a few other constructs. That is not an error: `z.compile()` hands the schema back unchanged and it keeps using the regular parser, exactly as global mode leaves it. Pass `{ strict: true }` to throw `ZodCompileAsyncError` / `ZodCompileUnsupportedError` instead.
|
|
138
|
+
- On invalid input, refinements and transforms may run twice (fast path, then fallback).
|
|
139
|
+
- Deriving a new schema from a compiled one (`.refine()`, `.extend()`, etc.) returns an uncompiled schema — compile the final schema.
|
|
140
|
+
|
|
141
|
+
See [`compile` docs](https://zod.dev/compile) for details.
|
|
142
|
+
|
|
116
143
|
### Handling errors
|
|
117
144
|
|
|
118
145
|
When validation fails, the `.parse()` method will throw a `ZodError` instance with granular information about the validation issues.
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Side-effect-only: installs the post-processor on `globalConfig`. Listed in `package.json`'s `sideEffects`, and nothing else references it, so apps that never import it drop the compiler.
|
|
3
|
+
//
|
|
4
|
+
// Usage:
|
|
5
|
+
//
|
|
6
|
+
// import "zod/compile";
|
|
7
|
+
// import * as z from "zod";
|
|
8
|
+
// // every schema constructed below this is compiled on first parse
|
|
9
|
+
//
|
|
10
|
+
// Module evaluation order matters: schemas constructed in modules that evaluate before this import will not be compiled. Place this import in the app entry point, before any module that constructs schemas at top level.
|
|
11
|
+
//
|
|
12
|
+
// Failure handling: if the compiler refuses a schema (async refinement, unsupported feature, etc.) the shim permanently restores the runtime `_zod.run` for that schema. The schema continues to work via the regular runtime parser — no observable difference to the caller.
|
|
13
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
20
|
+
}) : (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
o[k2] = m[k];
|
|
23
|
+
}));
|
|
24
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
+
}) : function(o, v) {
|
|
27
|
+
o["default"] = v;
|
|
28
|
+
});
|
|
29
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
30
|
+
if (mod && mod.__esModule) return mod;
|
|
31
|
+
var result = {};
|
|
32
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
33
|
+
__setModuleDefault(result, mod);
|
|
34
|
+
return result;
|
|
35
|
+
};
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
const compile_js_1 = require("./v4/core/compile.cjs");
|
|
38
|
+
const core = __importStar(require("./v4/core/index.cjs"));
|
|
39
|
+
let compiling = false;
|
|
40
|
+
core.globalConfig.postProcessor = (inst) => {
|
|
41
|
+
if (compiling)
|
|
42
|
+
return;
|
|
43
|
+
const originalRun = inst._zod?.run;
|
|
44
|
+
if (typeof originalRun !== "function")
|
|
45
|
+
return;
|
|
46
|
+
const shim = (payload, ctx) => {
|
|
47
|
+
// Bypass the fast path for any non-forward / non-sync / check-skipping call. The runtime owns those contracts.
|
|
48
|
+
if (ctx?.async || ctx?.direction === "backward" || ctx?.skipChecks) {
|
|
49
|
+
return originalRun(payload, ctx);
|
|
50
|
+
}
|
|
51
|
+
compiling = true;
|
|
52
|
+
try {
|
|
53
|
+
// Respect the jitless config: it exists precisely so CSP/no-eval environments never reach `new Function`. Global mode must not bypass it (explicit z.compile calls remain an explicit opt-in).
|
|
54
|
+
if (core.globalConfig.jitless) {
|
|
55
|
+
inst._zod.run = originalRun;
|
|
56
|
+
return originalRun(payload, ctx);
|
|
57
|
+
}
|
|
58
|
+
// Strict: the shim owns its own fallback below, and a non-strict compile would hand back `inst` — whose run is this shim — and reinstall it on itself.
|
|
59
|
+
const compiled = (0, compile_js_1.compile)(inst, { strict: true });
|
|
60
|
+
// Only the run wrapper. Copying the compiled parse/safeParse closures would make their fallback re-enter this instance and run user callbacks a third time.
|
|
61
|
+
inst._zod.run = compiled._zod.run;
|
|
62
|
+
inst._zod.bag.fallbackRun = compiled._zod.bag.fallbackRun;
|
|
63
|
+
inst._zod.bag.validator = compiled._zod.bag.validator;
|
|
64
|
+
}
|
|
65
|
+
catch {
|
|
66
|
+
// Permanent fallback for unsupported schemas.
|
|
67
|
+
inst._zod.run = originalRun;
|
|
68
|
+
}
|
|
69
|
+
finally {
|
|
70
|
+
compiling = false;
|
|
71
|
+
}
|
|
72
|
+
return inst._zod.run(payload, ctx);
|
|
73
|
+
};
|
|
74
|
+
// Expose the pre-shim runtime so `compile()` invoked elsewhere can unwrap past the shim and capture the source-of-truth runtime. Without this, a user calling `z.compile(s)` after global mode is enabled would capture the shim itself, which would feed the wrapper into itself on fallback.
|
|
75
|
+
shim.__originalRun = originalRun;
|
|
76
|
+
inst._zod.run = shim;
|
|
77
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
// Side-effect-only: installs the post-processor on `globalConfig`. Listed in `package.json`'s `sideEffects`, and nothing else references it, so apps that never import it drop the compiler.
|
|
2
|
+
//
|
|
3
|
+
// Usage:
|
|
4
|
+
//
|
|
5
|
+
// import "zod/compile";
|
|
6
|
+
// import * as z from "zod";
|
|
7
|
+
// // every schema constructed below this is compiled on first parse
|
|
8
|
+
//
|
|
9
|
+
// Module evaluation order matters: schemas constructed in modules that evaluate before this import will not be compiled. Place this import in the app entry point, before any module that constructs schemas at top level.
|
|
10
|
+
//
|
|
11
|
+
// Failure handling: if the compiler refuses a schema (async refinement, unsupported feature, etc.) the shim permanently restores the runtime `_zod.run` for that schema. The schema continues to work via the regular runtime parser — no observable difference to the caller.
|
|
12
|
+
import { compile } from "./v4/core/compile.js";
|
|
13
|
+
import * as core from "./v4/core/index.js";
|
|
14
|
+
let compiling = false;
|
|
15
|
+
core.globalConfig.postProcessor = (inst) => {
|
|
16
|
+
if (compiling)
|
|
17
|
+
return;
|
|
18
|
+
const originalRun = inst._zod?.run;
|
|
19
|
+
if (typeof originalRun !== "function")
|
|
20
|
+
return;
|
|
21
|
+
const shim = (payload, ctx) => {
|
|
22
|
+
// Bypass the fast path for any non-forward / non-sync / check-skipping call. The runtime owns those contracts.
|
|
23
|
+
if (ctx?.async || ctx?.direction === "backward" || ctx?.skipChecks) {
|
|
24
|
+
return originalRun(payload, ctx);
|
|
25
|
+
}
|
|
26
|
+
compiling = true;
|
|
27
|
+
try {
|
|
28
|
+
// Respect the jitless config: it exists precisely so CSP/no-eval environments never reach `new Function`. Global mode must not bypass it (explicit z.compile calls remain an explicit opt-in).
|
|
29
|
+
if (core.globalConfig.jitless) {
|
|
30
|
+
inst._zod.run = originalRun;
|
|
31
|
+
return originalRun(payload, ctx);
|
|
32
|
+
}
|
|
33
|
+
// Strict: the shim owns its own fallback below, and a non-strict compile would hand back `inst` — whose run is this shim — and reinstall it on itself.
|
|
34
|
+
const compiled = compile(inst, { strict: true });
|
|
35
|
+
// Only the run wrapper. Copying the compiled parse/safeParse closures would make their fallback re-enter this instance and run user callbacks a third time.
|
|
36
|
+
inst._zod.run = compiled._zod.run;
|
|
37
|
+
inst._zod.bag.fallbackRun = compiled._zod.bag.fallbackRun;
|
|
38
|
+
inst._zod.bag.validator = compiled._zod.bag.validator;
|
|
39
|
+
}
|
|
40
|
+
catch {
|
|
41
|
+
// Permanent fallback for unsupported schemas.
|
|
42
|
+
inst._zod.run = originalRun;
|
|
43
|
+
}
|
|
44
|
+
finally {
|
|
45
|
+
compiling = false;
|
|
46
|
+
}
|
|
47
|
+
return inst._zod.run(payload, ctx);
|
|
48
|
+
};
|
|
49
|
+
// Expose the pre-shim runtime so `compile()` invoked elsewhere can unwrap past the shim and capture the source-of-truth runtime. Without this, a user calling `z.compile(s)` after global mode is enabled would capture the shim itself, which would feed the wrapper into itself on fallback.
|
|
50
|
+
shim.__originalRun = originalRun;
|
|
51
|
+
inst._zod.run = shim;
|
|
52
|
+
};
|
|
@@ -26,8 +26,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
26
26
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.z = void 0;
|
|
29
|
+
exports.default = exports.z = void 0;
|
|
30
30
|
const z = __importStar(require("./v4/classic/external.cjs"));
|
|
31
31
|
exports.z = z;
|
|
32
|
-
__exportStar(require("./v4/classic/external.cjs"), exports);
|
|
33
32
|
exports.default = z;
|
|
33
|
+
__exportStar(require("./v4/classic/external.cjs"), exports);
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import * as z from "./v4/classic/external.js";
|
|
2
2
|
export * from "./v4/classic/external.js";
|
|
3
|
-
export
|
|
4
|
-
export
|
|
3
|
+
// Aliasing the binding, instead of `export default z`, keeps the default export a
|
|
4
|
+
// re-export of `z` rather than a fresh namespace value. Rollup and Webpack can then
|
|
5
|
+
// shake `import z from "zod"` as they already shake `import { z } from "zod"` — without
|
|
6
|
+
// this they pull in every locale. See #6050.
|
|
7
|
+
export { z, z as default };
|