@openclaw/mattermost 2026.9.3 → 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/.setup/channel-plugin-api-CKz3b0dp.mjs +40 -0
- package/dist/.setup/channel-plugin-api-N-mnrhds.mjs +3 -0
- package/dist/{channel-plugin-runtime-C4u91PKh.js → .setup/channel-plugin-runtime-Ca4cZHq2.mjs} +15 -30
- package/dist/{channel.runtime-CGEfnc2y.js → .setup/channel.runtime-C074p7wv.mjs} +377 -115
- package/dist/{client-Dt7Q-j5B.js → .setup/client-Cx71KZ1x.mjs} +27 -15
- package/dist/{interactions-DF1FH27_.js → .setup/interactions-BG-CQbVD.mjs} +3 -3
- package/dist/{monitor-auth-C6RGYyn-.js → .setup/monitor-auth-DBoM2Bja.mjs} +16 -3
- package/dist/{normalize-R-ATEEHC.js → .setup/normalize-BQzx2u8S.mjs} +47 -7
- package/dist/.setup/secret-contract-api-Drab0Nqx.mjs +3 -0
- package/dist/{slash-state-BjBTvP7u.js → .setup/slash-state-CmyIYDIc.mjs} +59 -15
- package/dist/api.js +2 -2
- package/dist/channel-plugin-api.js +2 -39
- package/dist/channel-plugin-runtime.js +1 -1
- package/dist/doctor-contract-api.js +1 -1
- package/dist/gateway-auth-api.js +1 -1
- package/dist/policy-api.js +1 -1
- package/dist/runtime-api.js +1 -1
- package/dist/secret-contract-api.js +1 -1
- package/dist/setup-entry.js +3 -2
- package/dist/slash-route-api.js +1 -1
- 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 +16 -29
- package/package.json +8 -8
- package/node_modules/ws/LICENSE +0 -20
- package/node_modules/ws/README.md +0 -548
- package/node_modules/ws/browser.js +0 -8
- package/node_modules/ws/index.js +0 -22
- package/node_modules/ws/lib/buffer-util.js +0 -131
- package/node_modules/ws/lib/constants.js +0 -19
- package/node_modules/ws/lib/event-target.js +0 -292
- package/node_modules/ws/lib/extension.js +0 -203
- package/node_modules/ws/lib/limiter.js +0 -55
- package/node_modules/ws/lib/permessage-deflate.js +0 -530
- package/node_modules/ws/lib/receiver.js +0 -743
- package/node_modules/ws/lib/sender.js +0 -607
- package/node_modules/ws/lib/stream.js +0 -161
- package/node_modules/ws/lib/subprotocol.js +0 -62
- package/node_modules/ws/lib/validation.js +0 -152
- package/node_modules/ws/lib/websocket-server.js +0 -562
- package/node_modules/ws/lib/websocket.js +0 -1407
- package/node_modules/ws/package.json +0 -74
- package/node_modules/ws/wrapper.mjs +0 -21
- package/node_modules/zod/src/v4/core/config.ts +0 -15
- /package/dist/{doctor-contract-mvORF4f6.js → .setup/doctor-contract-mvORF4f6.mjs} +0 -0
- /package/dist/{gateway-auth-bypass-B93t91oq.js → .setup/gateway-auth-bypass-B93t91oq.mjs} +0 -0
- /package/dist/{ingress-identity-DNl4yQSc.js → .setup/ingress-identity-DNl4yQSc.mjs} +0 -0
- /package/dist/{runtime-CNB4YGqJ.js → .setup/runtime-CNB4YGqJ.mjs} +0 -0
- /package/dist/{secret-contract-qg3NXRlS.js → .setup/secret-contract-qg3NXRlS.mjs} +0 -0
|
@@ -1,530 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const zlib = require('zlib');
|
|
4
|
-
|
|
5
|
-
const bufferUtil = require('./buffer-util');
|
|
6
|
-
const Limiter = require('./limiter');
|
|
7
|
-
const { kStatusCode } = require('./constants');
|
|
8
|
-
|
|
9
|
-
const FastBuffer = Buffer[Symbol.species];
|
|
10
|
-
const TRAILER = Buffer.from([0x00, 0x00, 0xff, 0xff]);
|
|
11
|
-
const kPerMessageDeflate = Symbol('permessage-deflate');
|
|
12
|
-
const kTotalLength = Symbol('total-length');
|
|
13
|
-
const kCallback = Symbol('callback');
|
|
14
|
-
const kBuffers = Symbol('buffers');
|
|
15
|
-
const kError = Symbol('error');
|
|
16
|
-
|
|
17
|
-
//
|
|
18
|
-
// We limit zlib concurrency, which prevents severe memory fragmentation
|
|
19
|
-
// as documented in https://github.com/nodejs/node/issues/8871#issuecomment-250915913
|
|
20
|
-
// and https://github.com/websockets/ws/issues/1202
|
|
21
|
-
//
|
|
22
|
-
// Intentionally global; it's the global thread pool that's an issue.
|
|
23
|
-
//
|
|
24
|
-
let zlibLimiter;
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* permessage-deflate implementation.
|
|
28
|
-
*/
|
|
29
|
-
class PerMessageDeflate {
|
|
30
|
-
/**
|
|
31
|
-
* Creates a PerMessageDeflate instance.
|
|
32
|
-
*
|
|
33
|
-
* @param {Object} [options] Configuration options
|
|
34
|
-
* @param {(Boolean|Number)} [options.clientMaxWindowBits] Advertise support
|
|
35
|
-
* for, or request, a custom client window size
|
|
36
|
-
* @param {Boolean} [options.clientNoContextTakeover=false] Advertise/
|
|
37
|
-
* acknowledge disabling of client context takeover
|
|
38
|
-
* @param {Number} [options.concurrencyLimit=10] The number of concurrent
|
|
39
|
-
* calls to zlib
|
|
40
|
-
* @param {Boolean} [options.isServer=false] Create the instance in either
|
|
41
|
-
* server or client mode
|
|
42
|
-
* @param {Number} [options.maxPayload=0] The maximum allowed message length
|
|
43
|
-
* @param {(Boolean|Number)} [options.serverMaxWindowBits] Request/confirm the
|
|
44
|
-
* use of a custom server window size
|
|
45
|
-
* @param {Boolean} [options.serverNoContextTakeover=false] Request/accept
|
|
46
|
-
* disabling of server context takeover
|
|
47
|
-
* @param {Number} [options.threshold=1024] Size (in bytes) below which
|
|
48
|
-
* messages should not be compressed if context takeover is disabled
|
|
49
|
-
* @param {Object} [options.zlibDeflateOptions] Options to pass to zlib on
|
|
50
|
-
* deflate
|
|
51
|
-
* @param {Object} [options.zlibInflateOptions] Options to pass to zlib on
|
|
52
|
-
* inflate
|
|
53
|
-
*/
|
|
54
|
-
constructor(options) {
|
|
55
|
-
this._options = options || {};
|
|
56
|
-
this._threshold =
|
|
57
|
-
this._options.threshold !== undefined ? this._options.threshold : 1024;
|
|
58
|
-
this._maxPayload = this._options.maxPayload | 0;
|
|
59
|
-
this._isServer = !!this._options.isServer;
|
|
60
|
-
this._deflate = null;
|
|
61
|
-
this._inflate = null;
|
|
62
|
-
|
|
63
|
-
this.params = null;
|
|
64
|
-
|
|
65
|
-
if (!zlibLimiter) {
|
|
66
|
-
const concurrency =
|
|
67
|
-
this._options.concurrencyLimit !== undefined
|
|
68
|
-
? this._options.concurrencyLimit
|
|
69
|
-
: 10;
|
|
70
|
-
zlibLimiter = new Limiter(concurrency);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* @type {String}
|
|
76
|
-
*/
|
|
77
|
-
static get extensionName() {
|
|
78
|
-
return 'permessage-deflate';
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* Create an extension negotiation offer.
|
|
83
|
-
*
|
|
84
|
-
* @return {Object} Extension parameters
|
|
85
|
-
* @public
|
|
86
|
-
*/
|
|
87
|
-
offer() {
|
|
88
|
-
const params = {};
|
|
89
|
-
|
|
90
|
-
if (this._options.serverNoContextTakeover) {
|
|
91
|
-
params.server_no_context_takeover = true;
|
|
92
|
-
}
|
|
93
|
-
if (this._options.clientNoContextTakeover) {
|
|
94
|
-
params.client_no_context_takeover = true;
|
|
95
|
-
}
|
|
96
|
-
if (this._options.serverMaxWindowBits) {
|
|
97
|
-
params.server_max_window_bits = this._options.serverMaxWindowBits;
|
|
98
|
-
}
|
|
99
|
-
if (this._options.clientMaxWindowBits) {
|
|
100
|
-
params.client_max_window_bits = this._options.clientMaxWindowBits;
|
|
101
|
-
} else if (this._options.clientMaxWindowBits == null) {
|
|
102
|
-
params.client_max_window_bits = true;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
return params;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* Accept an extension negotiation offer/response.
|
|
110
|
-
*
|
|
111
|
-
* @param {Array} configurations The extension negotiation offers/reponse
|
|
112
|
-
* @return {Object} Accepted configuration
|
|
113
|
-
* @public
|
|
114
|
-
*/
|
|
115
|
-
accept(configurations) {
|
|
116
|
-
configurations = this.normalizeParams(configurations);
|
|
117
|
-
|
|
118
|
-
this.params = this._isServer
|
|
119
|
-
? this.acceptAsServer(configurations)
|
|
120
|
-
: this.acceptAsClient(configurations);
|
|
121
|
-
|
|
122
|
-
return this.params;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
* Releases all resources used by the extension.
|
|
127
|
-
*
|
|
128
|
-
* @public
|
|
129
|
-
*/
|
|
130
|
-
cleanup() {
|
|
131
|
-
if (this._inflate) {
|
|
132
|
-
this._inflate.close();
|
|
133
|
-
this._inflate = null;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
if (this._deflate) {
|
|
137
|
-
const callback = this._deflate[kCallback];
|
|
138
|
-
|
|
139
|
-
this._deflate.close();
|
|
140
|
-
this._deflate = null;
|
|
141
|
-
|
|
142
|
-
if (callback) {
|
|
143
|
-
callback(
|
|
144
|
-
new Error(
|
|
145
|
-
'The deflate stream was closed while data was being processed'
|
|
146
|
-
)
|
|
147
|
-
);
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
/**
|
|
153
|
-
* Accept an extension negotiation offer.
|
|
154
|
-
*
|
|
155
|
-
* @param {Array} offers The extension negotiation offers
|
|
156
|
-
* @return {Object} Accepted configuration
|
|
157
|
-
* @private
|
|
158
|
-
*/
|
|
159
|
-
acceptAsServer(offers) {
|
|
160
|
-
const opts = this._options;
|
|
161
|
-
const accepted = offers.find((params) => {
|
|
162
|
-
if (
|
|
163
|
-
(opts.serverNoContextTakeover === false &&
|
|
164
|
-
params.server_no_context_takeover) ||
|
|
165
|
-
(params.server_max_window_bits &&
|
|
166
|
-
(opts.serverMaxWindowBits === false ||
|
|
167
|
-
(typeof opts.serverMaxWindowBits === 'number' &&
|
|
168
|
-
opts.serverMaxWindowBits > params.server_max_window_bits))) ||
|
|
169
|
-
(typeof opts.clientMaxWindowBits === 'number' &&
|
|
170
|
-
(typeof params.client_max_window_bits === 'number'
|
|
171
|
-
? opts.clientMaxWindowBits > params.client_max_window_bits
|
|
172
|
-
: !params.client_max_window_bits))
|
|
173
|
-
) {
|
|
174
|
-
return false;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
return true;
|
|
178
|
-
});
|
|
179
|
-
|
|
180
|
-
if (!accepted) {
|
|
181
|
-
throw new Error('None of the extension offers can be accepted');
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
if (opts.serverNoContextTakeover) {
|
|
185
|
-
accepted.server_no_context_takeover = true;
|
|
186
|
-
}
|
|
187
|
-
if (opts.clientNoContextTakeover) {
|
|
188
|
-
accepted.client_no_context_takeover = true;
|
|
189
|
-
}
|
|
190
|
-
if (typeof opts.serverMaxWindowBits === 'number') {
|
|
191
|
-
accepted.server_max_window_bits = opts.serverMaxWindowBits;
|
|
192
|
-
}
|
|
193
|
-
if (typeof opts.clientMaxWindowBits === 'number') {
|
|
194
|
-
accepted.client_max_window_bits = opts.clientMaxWindowBits;
|
|
195
|
-
} else if (
|
|
196
|
-
accepted.client_max_window_bits === true ||
|
|
197
|
-
opts.clientMaxWindowBits === false
|
|
198
|
-
) {
|
|
199
|
-
delete accepted.client_max_window_bits;
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
return accepted;
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
/**
|
|
206
|
-
* Accept the extension negotiation response.
|
|
207
|
-
*
|
|
208
|
-
* @param {Array} response The extension negotiation response
|
|
209
|
-
* @return {Object} Accepted configuration
|
|
210
|
-
* @private
|
|
211
|
-
*/
|
|
212
|
-
acceptAsClient(response) {
|
|
213
|
-
const params = response[0];
|
|
214
|
-
|
|
215
|
-
if (
|
|
216
|
-
this._options.clientNoContextTakeover === false &&
|
|
217
|
-
params.client_no_context_takeover
|
|
218
|
-
) {
|
|
219
|
-
throw new Error('Unexpected parameter "client_no_context_takeover"');
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
if (!params.client_max_window_bits) {
|
|
223
|
-
if (typeof this._options.clientMaxWindowBits === 'number') {
|
|
224
|
-
params.client_max_window_bits = this._options.clientMaxWindowBits;
|
|
225
|
-
}
|
|
226
|
-
} else if (
|
|
227
|
-
this._options.clientMaxWindowBits === false ||
|
|
228
|
-
(typeof this._options.clientMaxWindowBits === 'number' &&
|
|
229
|
-
params.client_max_window_bits > this._options.clientMaxWindowBits)
|
|
230
|
-
) {
|
|
231
|
-
throw new Error(
|
|
232
|
-
'Unexpected or invalid parameter "client_max_window_bits"'
|
|
233
|
-
);
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
return params;
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
/**
|
|
240
|
-
* Normalize parameters.
|
|
241
|
-
*
|
|
242
|
-
* @param {Array} configurations The extension negotiation offers/reponse
|
|
243
|
-
* @return {Array} The offers/response with normalized parameters
|
|
244
|
-
* @private
|
|
245
|
-
*/
|
|
246
|
-
normalizeParams(configurations) {
|
|
247
|
-
configurations.forEach((params) => {
|
|
248
|
-
Object.keys(params).forEach((key) => {
|
|
249
|
-
let value = params[key];
|
|
250
|
-
|
|
251
|
-
if (value.length > 1) {
|
|
252
|
-
throw new Error(`Parameter "${key}" must have only a single value`);
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
value = value[0];
|
|
256
|
-
|
|
257
|
-
if (key === 'client_max_window_bits') {
|
|
258
|
-
if (value !== true) {
|
|
259
|
-
const num = +value;
|
|
260
|
-
if (!Number.isInteger(num) || num < 8 || num > 15) {
|
|
261
|
-
throw new TypeError(
|
|
262
|
-
`Invalid value for parameter "${key}": ${value}`
|
|
263
|
-
);
|
|
264
|
-
}
|
|
265
|
-
value = num;
|
|
266
|
-
} else if (!this._isServer) {
|
|
267
|
-
throw new TypeError(
|
|
268
|
-
`Invalid value for parameter "${key}": ${value}`
|
|
269
|
-
);
|
|
270
|
-
}
|
|
271
|
-
} else if (key === 'server_max_window_bits') {
|
|
272
|
-
const num = +value;
|
|
273
|
-
if (!Number.isInteger(num) || num < 8 || num > 15) {
|
|
274
|
-
throw new TypeError(
|
|
275
|
-
`Invalid value for parameter "${key}": ${value}`
|
|
276
|
-
);
|
|
277
|
-
}
|
|
278
|
-
value = num;
|
|
279
|
-
} else if (
|
|
280
|
-
key === 'client_no_context_takeover' ||
|
|
281
|
-
key === 'server_no_context_takeover'
|
|
282
|
-
) {
|
|
283
|
-
if (value !== true) {
|
|
284
|
-
throw new TypeError(
|
|
285
|
-
`Invalid value for parameter "${key}": ${value}`
|
|
286
|
-
);
|
|
287
|
-
}
|
|
288
|
-
} else {
|
|
289
|
-
throw new Error(`Unknown parameter "${key}"`);
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
params[key] = value;
|
|
293
|
-
});
|
|
294
|
-
});
|
|
295
|
-
|
|
296
|
-
return configurations;
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
/**
|
|
300
|
-
* Decompress data. Concurrency limited.
|
|
301
|
-
*
|
|
302
|
-
* @param {Buffer} data Compressed data
|
|
303
|
-
* @param {Boolean} fin Specifies whether or not this is the last fragment
|
|
304
|
-
* @param {Function} callback Callback
|
|
305
|
-
* @public
|
|
306
|
-
*/
|
|
307
|
-
decompress(data, fin, callback) {
|
|
308
|
-
zlibLimiter.add((done) => {
|
|
309
|
-
this._decompress(data, fin, (err, result) => {
|
|
310
|
-
done();
|
|
311
|
-
callback(err, result);
|
|
312
|
-
});
|
|
313
|
-
});
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
/**
|
|
317
|
-
* Compress data. Concurrency limited.
|
|
318
|
-
*
|
|
319
|
-
* @param {(Buffer|String)} data Data to compress
|
|
320
|
-
* @param {Boolean} fin Specifies whether or not this is the last fragment
|
|
321
|
-
* @param {Function} callback Callback
|
|
322
|
-
* @public
|
|
323
|
-
*/
|
|
324
|
-
compress(data, fin, callback) {
|
|
325
|
-
zlibLimiter.add((done) => {
|
|
326
|
-
this._compress(data, fin, (err, result) => {
|
|
327
|
-
done();
|
|
328
|
-
callback(err, result);
|
|
329
|
-
});
|
|
330
|
-
});
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
/**
|
|
334
|
-
* Decompress data.
|
|
335
|
-
*
|
|
336
|
-
* @param {Buffer} data Compressed data
|
|
337
|
-
* @param {Boolean} fin Specifies whether or not this is the last fragment
|
|
338
|
-
* @param {Function} callback Callback
|
|
339
|
-
* @private
|
|
340
|
-
*/
|
|
341
|
-
_decompress(data, fin, callback) {
|
|
342
|
-
const endpoint = this._isServer ? 'client' : 'server';
|
|
343
|
-
|
|
344
|
-
if (!this._inflate) {
|
|
345
|
-
const key = `${endpoint}_max_window_bits`;
|
|
346
|
-
const windowBits =
|
|
347
|
-
typeof this.params[key] !== 'number'
|
|
348
|
-
? zlib.Z_DEFAULT_WINDOWBITS
|
|
349
|
-
: this.params[key];
|
|
350
|
-
|
|
351
|
-
this._inflate = zlib.createInflateRaw({
|
|
352
|
-
...this._options.zlibInflateOptions,
|
|
353
|
-
windowBits
|
|
354
|
-
});
|
|
355
|
-
this._inflate[kPerMessageDeflate] = this;
|
|
356
|
-
this._inflate[kTotalLength] = 0;
|
|
357
|
-
this._inflate[kBuffers] = [];
|
|
358
|
-
this._inflate.on('error', inflateOnError);
|
|
359
|
-
this._inflate.on('data', inflateOnData);
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
this._inflate[kCallback] = callback;
|
|
363
|
-
|
|
364
|
-
this._inflate.write(data);
|
|
365
|
-
if (fin) this._inflate.write(TRAILER);
|
|
366
|
-
|
|
367
|
-
this._inflate.flush(() => {
|
|
368
|
-
const err = this._inflate[kError];
|
|
369
|
-
|
|
370
|
-
if (err) {
|
|
371
|
-
this._inflate.close();
|
|
372
|
-
this._inflate = null;
|
|
373
|
-
callback(err);
|
|
374
|
-
return;
|
|
375
|
-
}
|
|
376
|
-
|
|
377
|
-
const data = bufferUtil.concat(
|
|
378
|
-
this._inflate[kBuffers],
|
|
379
|
-
this._inflate[kTotalLength]
|
|
380
|
-
);
|
|
381
|
-
|
|
382
|
-
if (this._inflate._readableState.endEmitted) {
|
|
383
|
-
this._inflate.close();
|
|
384
|
-
this._inflate = null;
|
|
385
|
-
} else {
|
|
386
|
-
this._inflate[kTotalLength] = 0;
|
|
387
|
-
this._inflate[kBuffers] = [];
|
|
388
|
-
|
|
389
|
-
if (fin && this.params[`${endpoint}_no_context_takeover`]) {
|
|
390
|
-
this._inflate.reset();
|
|
391
|
-
}
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
callback(null, data);
|
|
395
|
-
});
|
|
396
|
-
}
|
|
397
|
-
|
|
398
|
-
/**
|
|
399
|
-
* Compress data.
|
|
400
|
-
*
|
|
401
|
-
* @param {(Buffer|String)} data Data to compress
|
|
402
|
-
* @param {Boolean} fin Specifies whether or not this is the last fragment
|
|
403
|
-
* @param {Function} callback Callback
|
|
404
|
-
* @private
|
|
405
|
-
*/
|
|
406
|
-
_compress(data, fin, callback) {
|
|
407
|
-
const endpoint = this._isServer ? 'server' : 'client';
|
|
408
|
-
|
|
409
|
-
if (!this._deflate) {
|
|
410
|
-
const key = `${endpoint}_max_window_bits`;
|
|
411
|
-
const windowBits =
|
|
412
|
-
typeof this.params[key] !== 'number'
|
|
413
|
-
? zlib.Z_DEFAULT_WINDOWBITS
|
|
414
|
-
: this.params[key];
|
|
415
|
-
|
|
416
|
-
this._deflate = zlib.createDeflateRaw({
|
|
417
|
-
...this._options.zlibDeflateOptions,
|
|
418
|
-
windowBits
|
|
419
|
-
});
|
|
420
|
-
|
|
421
|
-
this._deflate[kTotalLength] = 0;
|
|
422
|
-
this._deflate[kBuffers] = [];
|
|
423
|
-
|
|
424
|
-
this._deflate.on('data', deflateOnData);
|
|
425
|
-
}
|
|
426
|
-
|
|
427
|
-
this._deflate[kCallback] = callback;
|
|
428
|
-
|
|
429
|
-
this._deflate.write(data);
|
|
430
|
-
this._deflate.flush(zlib.Z_SYNC_FLUSH, () => {
|
|
431
|
-
if (!this._deflate) {
|
|
432
|
-
//
|
|
433
|
-
// The deflate stream was closed while data was being processed.
|
|
434
|
-
//
|
|
435
|
-
return;
|
|
436
|
-
}
|
|
437
|
-
|
|
438
|
-
let data = bufferUtil.concat(
|
|
439
|
-
this._deflate[kBuffers],
|
|
440
|
-
this._deflate[kTotalLength]
|
|
441
|
-
);
|
|
442
|
-
|
|
443
|
-
if (fin) {
|
|
444
|
-
data = new FastBuffer(data.buffer, data.byteOffset, data.length - 4);
|
|
445
|
-
}
|
|
446
|
-
|
|
447
|
-
//
|
|
448
|
-
// Ensure that the callback will not be called again in
|
|
449
|
-
// `PerMessageDeflate#cleanup()`.
|
|
450
|
-
//
|
|
451
|
-
this._deflate[kCallback] = null;
|
|
452
|
-
|
|
453
|
-
this._deflate[kTotalLength] = 0;
|
|
454
|
-
this._deflate[kBuffers] = [];
|
|
455
|
-
|
|
456
|
-
if (fin && this.params[`${endpoint}_no_context_takeover`]) {
|
|
457
|
-
this._deflate.reset();
|
|
458
|
-
}
|
|
459
|
-
|
|
460
|
-
callback(null, data);
|
|
461
|
-
});
|
|
462
|
-
}
|
|
463
|
-
}
|
|
464
|
-
|
|
465
|
-
module.exports = PerMessageDeflate;
|
|
466
|
-
|
|
467
|
-
/**
|
|
468
|
-
* The listener of the `zlib.DeflateRaw` stream `'data'` event.
|
|
469
|
-
*
|
|
470
|
-
* @param {Buffer} chunk A chunk of data
|
|
471
|
-
* @private
|
|
472
|
-
*/
|
|
473
|
-
function deflateOnData(chunk) {
|
|
474
|
-
this[kBuffers].push(chunk);
|
|
475
|
-
this[kTotalLength] += chunk.length;
|
|
476
|
-
}
|
|
477
|
-
|
|
478
|
-
/**
|
|
479
|
-
* The listener of the `zlib.InflateRaw` stream `'data'` event.
|
|
480
|
-
*
|
|
481
|
-
* @param {Buffer} chunk A chunk of data
|
|
482
|
-
* @private
|
|
483
|
-
*/
|
|
484
|
-
function inflateOnData(chunk) {
|
|
485
|
-
this[kTotalLength] += chunk.length;
|
|
486
|
-
|
|
487
|
-
if (
|
|
488
|
-
this[kPerMessageDeflate]._maxPayload < 1 ||
|
|
489
|
-
this[kTotalLength] <= this[kPerMessageDeflate]._maxPayload
|
|
490
|
-
) {
|
|
491
|
-
this[kBuffers].push(chunk);
|
|
492
|
-
return;
|
|
493
|
-
}
|
|
494
|
-
|
|
495
|
-
this[kError] = new RangeError('Max payload size exceeded');
|
|
496
|
-
this[kError].code = 'WS_ERR_UNSUPPORTED_MESSAGE_LENGTH';
|
|
497
|
-
this[kError][kStatusCode] = 1009;
|
|
498
|
-
this.removeListener('data', inflateOnData);
|
|
499
|
-
|
|
500
|
-
//
|
|
501
|
-
// The choice to employ `zlib.reset()` over `zlib.close()` is dictated by the
|
|
502
|
-
// fact that in Node.js versions prior to 13.10.0, the callback for
|
|
503
|
-
// `zlib.flush()` is not called if `zlib.close()` is used. Utilizing
|
|
504
|
-
// `zlib.reset()` ensures that either the callback is invoked or an error is
|
|
505
|
-
// emitted.
|
|
506
|
-
//
|
|
507
|
-
this.reset();
|
|
508
|
-
}
|
|
509
|
-
|
|
510
|
-
/**
|
|
511
|
-
* The listener of the `zlib.InflateRaw` stream `'error'` event.
|
|
512
|
-
*
|
|
513
|
-
* @param {Error} err The emitted error
|
|
514
|
-
* @private
|
|
515
|
-
*/
|
|
516
|
-
function inflateOnError(err) {
|
|
517
|
-
//
|
|
518
|
-
// There is no need to call `Zlib#close()` as the handle is automatically
|
|
519
|
-
// closed when an error is emitted.
|
|
520
|
-
//
|
|
521
|
-
this[kPerMessageDeflate]._inflate = null;
|
|
522
|
-
|
|
523
|
-
if (this[kError]) {
|
|
524
|
-
this[kCallback](this[kError]);
|
|
525
|
-
return;
|
|
526
|
-
}
|
|
527
|
-
|
|
528
|
-
err[kStatusCode] = 1007;
|
|
529
|
-
this[kCallback](err);
|
|
530
|
-
}
|