@openclaw/whatsapp 2026.7.2-beta.2 → 2026.7.2-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{access-control-DazDX3RB.js → access-control-CRz_v6bR.js} +4 -5
- package/dist/{accounts-CKOFMPf-.js → accounts-CxPuEFi-.js} +44 -4
- package/dist/{action-runtime-Bf-12TIH.js → action-runtime-CHU7xb6o.js} +2 -2
- package/dist/action-runtime-api.js +1 -1
- package/dist/action-runtime.runtime.js +1 -1
- package/dist/{active-listener-5kHap439.js → active-listener-BEjWsCNM.js} +1 -1
- package/dist/api.js +12 -15
- package/dist/{approval-handler.runtime-CBiGQuZ5.js → approval-handler.runtime-C4ddB7Kc.js} +4 -4
- package/dist/{approval-reactions-BGQoz25s.js → approval-reactions-P2HXjmln.js} +3 -3
- package/dist/{auth-store-BQi9pZqQ.js → auth-store-DirYMTbo.js} +4 -3
- package/dist/call-tool-api.js +4 -4
- package/dist/{channel-DbadDUDD.js → channel-B9xjrOGG.js} +37 -19
- package/dist/channel-config-api.js +1 -1
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel-react-action-PoRWfP9x.js → channel-react-action-CBW-PA8q.js} +10 -13
- package/dist/{channel.runtime-BDDy4Lhz.js → channel.runtime-DdKuhlNu.js} +5 -5
- package/dist/{channel.setup-BZ-po8fg.js → channel.setup-DXUCPHel.js} +3 -6
- package/dist/{config-schema-BZ8h1hWA.js → config-schema-C6IeKIC0.js} +6 -0
- package/dist/{connection-controller-C1rwfWb4.js → connection-controller-BVRExqrB.js} +186 -27
- package/dist/connection-controller-runtime-context-DG0tuYuw.js +23 -0
- package/dist/contract-api.js +1 -1
- package/dist/directory-config-BTbJkV1W.js +196 -0
- package/dist/directory-contract-api.js +1 -1
- package/dist/doctor-CwzVXKoE.js +10 -0
- package/dist/doctor-contract-api.js +35 -79
- package/dist/{group-session-key-CLTZeH_F.js → group-session-key-DJSdYfnb.js} +9 -4
- package/dist/{identity-D7L8LCuH.js → identity-BM4_wZeM.js} +2 -2
- package/dist/light-runtime-api.js +2 -2
- package/dist/{login-DGIoToX8.js → login-BKUm7KSk.js} +6 -7
- package/dist/{login-qr-X-CZHOk9.js → login-qr-DagJvMbg.js} +7 -8
- package/dist/login-qr-runtime.js +1 -1
- package/dist/{monitor-BZ8QvCeV.js → monitor-CBVNJ2lb.js} +623 -400
- package/dist/question-reactions-CaOrSYzU.js +142 -0
- package/dist/runtime-BLlToOi6.js +21 -0
- package/dist/runtime-api.js +10 -10
- package/dist/runtime-setter-api.js +1 -1
- package/dist/{send-D9Ydnn4o.js → send-DhJVN30g.js} +38 -85
- package/dist/{send-api-W33lI2nR.js → send-api-CpHwbor_.js} +38 -32
- package/dist/{setup-finalize-DBf1jjBj.js → setup-finalize-9XzKdFq6.js} +3 -3
- package/dist/setup-plugin-api.js +1 -1
- package/dist/{setup-surface-CiKGdNJv.js → setup-surface-Kv3mPki2.js} +3 -3
- package/dist/{setup-core-3aSOoK2T.js → shared-CuqHFnKd.js} +78 -56
- package/dist/{session-mxWFn0eS.js → socket-close-BoSHhQNJ.js} +226 -7
- package/dist/{targets-runtime-Bsh0HR9y.js → targets-runtime-CKFrhoX4.js} +142 -29
- package/dist/text-runtime-CU_IlbK5.js +4 -0
- package/node_modules/@protobufjs/utf8/CHANGELOG.md +8 -0
- package/node_modules/@protobufjs/utf8/index.js +29 -18
- package/node_modules/@protobufjs/utf8/package.json +2 -2
- package/node_modules/@protobufjs/utf8/tests/index.js +5 -0
- package/node_modules/@thi.ng/bitstream/package.json +4 -4
- package/node_modules/@thi.ng/errors/package.json +4 -4
- package/node_modules/@types/node/README.md +1 -1
- package/node_modules/@types/node/fs/promises.d.ts +16 -6
- package/node_modules/@types/node/package.json +2 -2
- package/node_modules/audio-type/package.json +3 -2
- package/node_modules/lru-cache/dist/commonjs/browser/index.d.ts.map +1 -1
- package/node_modules/lru-cache/dist/commonjs/browser/index.js +11 -4
- package/node_modules/lru-cache/dist/commonjs/browser/index.js.map +1 -1
- package/node_modules/lru-cache/dist/commonjs/browser/index.min.js +1 -1
- package/node_modules/lru-cache/dist/commonjs/browser/index.min.js.map +3 -3
- package/node_modules/lru-cache/dist/commonjs/index.d.ts.map +1 -1
- package/node_modules/lru-cache/dist/commonjs/index.js +11 -4
- package/node_modules/lru-cache/dist/commonjs/index.js.map +1 -1
- package/node_modules/lru-cache/dist/commonjs/index.min.js +1 -1
- package/node_modules/lru-cache/dist/commonjs/index.min.js.map +3 -3
- package/node_modules/lru-cache/dist/commonjs/node/index.d.ts.map +1 -1
- package/node_modules/lru-cache/dist/commonjs/node/index.js +11 -4
- package/node_modules/lru-cache/dist/commonjs/node/index.js.map +1 -1
- package/node_modules/lru-cache/dist/commonjs/node/index.min.js +1 -1
- package/node_modules/lru-cache/dist/commonjs/node/index.min.js.map +3 -3
- package/node_modules/lru-cache/dist/esm/browser/index.d.ts.map +1 -1
- package/node_modules/lru-cache/dist/esm/browser/index.js +11 -4
- package/node_modules/lru-cache/dist/esm/browser/index.js.map +1 -1
- package/node_modules/lru-cache/dist/esm/browser/index.min.js +1 -1
- package/node_modules/lru-cache/dist/esm/browser/index.min.js.map +3 -3
- package/node_modules/lru-cache/dist/esm/index.d.ts.map +1 -1
- package/node_modules/lru-cache/dist/esm/index.js +11 -4
- package/node_modules/lru-cache/dist/esm/index.js.map +1 -1
- package/node_modules/lru-cache/dist/esm/index.min.js +1 -1
- package/node_modules/lru-cache/dist/esm/index.min.js.map +3 -3
- package/node_modules/lru-cache/dist/esm/node/index.d.ts.map +1 -1
- package/node_modules/lru-cache/dist/esm/node/index.js +11 -4
- package/node_modules/lru-cache/dist/esm/node/index.js.map +1 -1
- package/node_modules/lru-cache/dist/esm/node/index.min.js +1 -1
- package/node_modules/lru-cache/dist/esm/node/index.min.js.map +3 -3
- package/node_modules/lru-cache/package.json +1 -1
- package/node_modules/music-metadata/lib/common/Util.d.ts +1 -1
- package/node_modules/music-metadata/lib/common/Util.js +7 -1
- package/node_modules/music-metadata/lib/id3v2/FrameHeader.js +23 -3
- package/node_modules/music-metadata/lib/id3v2/FrameParser.js +2 -2
- package/node_modules/music-metadata/lib/id3v2/ID3v2Token.js +1 -1
- package/node_modules/music-metadata/lib/mp4/AtomToken.js +38 -13
- package/node_modules/music-metadata/lib/mpeg/MpegParser.js +1 -1
- package/node_modules/music-metadata/package.json +6 -6
- package/node_modules/p-queue/dist/index.js +17 -6
- package/node_modules/p-queue/package.json +1 -1
- package/node_modules/protobufjs/dist/light/protobuf.js +145 -188
- package/node_modules/protobufjs/dist/light/protobuf.js.map +1 -1
- package/node_modules/protobufjs/dist/light/protobuf.min.js +3 -3
- package/node_modules/protobufjs/dist/light/protobuf.min.js.map +1 -1
- package/node_modules/protobufjs/dist/minimal/protobuf.js +33 -76
- package/node_modules/protobufjs/dist/minimal/protobuf.js.map +1 -1
- package/node_modules/protobufjs/dist/minimal/protobuf.min.js +3 -3
- package/node_modules/protobufjs/dist/minimal/protobuf.min.js.map +1 -1
- package/node_modules/protobufjs/dist/protobuf.js +168 -208
- package/node_modules/protobufjs/dist/protobuf.js.map +1 -1
- package/node_modules/protobufjs/dist/protobuf.min.js +3 -3
- package/node_modules/protobufjs/dist/protobuf.min.js.map +1 -1
- package/node_modules/protobufjs/index.d.ts +0 -8
- package/node_modules/protobufjs/package.json +2 -3
- package/node_modules/protobufjs/src/parse.js +3 -0
- package/node_modules/protobufjs/src/util/minimal.js +0 -3
- package/node_modules/typebox/build/compile/validator.d.mts +1 -4
- package/node_modules/typebox/build/guard/guard.d.mts +1 -1
- package/node_modules/typebox/build/guard/guard.mjs +5 -2
- package/node_modules/typebox/build/guard/string.mjs +16 -4
- package/node_modules/typebox/build/schema/engine/_functions.mjs +34 -15
- package/node_modules/typebox/build/type/action/readonly_object.d.mts +5 -0
- package/node_modules/typebox/build/type/action/readonly_object.mjs +8 -0
- package/node_modules/typebox/build/typebox.d.mts +1 -1
- package/node_modules/typebox/build/typebox.mjs +1 -1
- package/node_modules/typebox/package.json +1 -1
- package/node_modules/typebox/readme.md +29 -32
- package/node_modules/ws/lib/receiver.js +15 -32
- package/node_modules/ws/lib/websocket-server.js +4 -4
- package/node_modules/ws/lib/websocket.js +4 -4
- package/node_modules/ws/package.json +5 -1
- package/npm-shrinkwrap.json +41 -45
- package/openclaw.plugin.json +139 -179
- package/package.json +21 -11
- package/dist/account-config-LiT9wWH9.js +0 -43
- package/dist/connection-controller-runtime-context-CbTsqmPT.js +0 -14
- package/dist/directory-config-CLBQrjtC.js +0 -37
- package/dist/doctor-By3SB4lm.js +0 -48
- package/dist/runtime-BfAdAEYT.js +0 -8
- package/dist/text-runtime-BTGkMN0o.js +0 -4
- package/node_modules/@protobufjs/inquire/CHANGELOG.md +0 -8
- package/node_modules/@protobufjs/inquire/LICENSE +0 -26
- package/node_modules/@protobufjs/inquire/README.md +0 -13
- package/node_modules/@protobufjs/inquire/index.d.ts +0 -10
- package/node_modules/@protobufjs/inquire/index.js +0 -38
- package/node_modules/@protobufjs/inquire/package.json +0 -21
- package/node_modules/@protobufjs/inquire/tests/data/array.js +0 -1
- package/node_modules/@protobufjs/inquire/tests/data/emptyArray.js +0 -1
- package/node_modules/@protobufjs/inquire/tests/data/emptyObject.js +0 -1
- package/node_modules/@protobufjs/inquire/tests/data/object.js +0 -1
- package/node_modules/@protobufjs/inquire/tests/index.js +0 -20
|
@@ -2489,14 +2489,6 @@ export namespace util {
|
|
|
2489
2489
|
*/
|
|
2490
2490
|
function fetch(path: string, options?: IFetchOptions): Promise<(string|Uint8Array)>;
|
|
2491
2491
|
|
|
2492
|
-
/**
|
|
2493
|
-
* Requires a module only if available.
|
|
2494
|
-
* @param moduleName Module to require
|
|
2495
|
-
* @returns Required module if available and not empty, otherwise `null`
|
|
2496
|
-
* @deprecated Legacy optional require helper. Will be removed in a future release.
|
|
2497
|
-
*/
|
|
2498
|
-
function inquire(moduleName: string): object;
|
|
2499
|
-
|
|
2500
2492
|
/** A minimal path module to resolve Unix, Windows and URL paths alike. */
|
|
2501
2493
|
namespace path {
|
|
2502
2494
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "protobufjs",
|
|
3
|
-
"version": "7.6.
|
|
3
|
+
"version": "7.6.5",
|
|
4
4
|
"versionScheme": "~",
|
|
5
5
|
"description": "Protocol Buffers for JavaScript (& TypeScript).",
|
|
6
6
|
"author": "Daniel Wirtz <dcode+protobufjs@dcode.io>",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"bench": "node bench",
|
|
38
38
|
"build": "npm run build:bundle && npm run build:types",
|
|
39
39
|
"build:bundle": "gulp --gulpfile scripts/gulpfile.js",
|
|
40
|
-
"build:types": "node cli/bin/pbts --main --global protobuf --out index.d.ts src/ lib/aspromise/index.js lib/base64/index.js lib/codegen/index.js lib/eventemitter/index.js lib/float/index.js lib/fetch/index.js lib/
|
|
40
|
+
"build:types": "node cli/bin/pbts --main --global protobuf --out index.d.ts src/ lib/aspromise/index.js lib/base64/index.js lib/codegen/index.js lib/eventemitter/index.js lib/float/index.js lib/fetch/index.js lib/path/index.js lib/pool/index.js lib/utf8/index.js",
|
|
41
41
|
"changelog": "node scripts/changelog -w",
|
|
42
42
|
"coverage": "npm run coverage:test && npm run coverage:report",
|
|
43
43
|
"coverage:test": "nyc --silent tape -r ./lib/tape-adapter tests/*.js tests/node/*.js",
|
|
@@ -63,7 +63,6 @@
|
|
|
63
63
|
"@protobufjs/eventemitter": "^1.1.1",
|
|
64
64
|
"@protobufjs/fetch": "^1.1.1",
|
|
65
65
|
"@protobufjs/float": "^1.0.2",
|
|
66
|
-
"@protobufjs/inquire": "^1.1.2",
|
|
67
66
|
"@protobufjs/path": "^1.1.2",
|
|
68
67
|
"@protobufjs/pool": "^1.1.0",
|
|
69
68
|
"@protobufjs/utf8": "^1.1.1",
|
|
@@ -13,9 +13,6 @@ util.EventEmitter = require("@protobufjs/eventemitter");
|
|
|
13
13
|
// float handling accross browsers
|
|
14
14
|
util.float = require("@protobufjs/float");
|
|
15
15
|
|
|
16
|
-
// requires modules optionally and hides the call from bundlers
|
|
17
|
-
util.inquire = require("@protobufjs/inquire");
|
|
18
|
-
|
|
19
16
|
// converts to / from utf8 encoded strings
|
|
20
17
|
util.utf8 = require("@protobufjs/utf8");
|
|
21
18
|
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import { type TLocalizedValidationError } from '../error/index.mjs';
|
|
2
2
|
import { type StaticDecode, type StaticEncode, type TProperties, type TSchema } from '../type/index.mjs';
|
|
3
|
-
import { BuildResult, EvaluateResult } from '../schema/index.mjs';
|
|
4
3
|
export declare class Validator<Context extends TProperties = TProperties, Type extends TSchema = TSchema, Encode extends unknown = StaticEncode<Type, Context>, Decode extends unknown = StaticDecode<Type, Context>> {
|
|
5
4
|
private readonly hasCodec;
|
|
6
5
|
private readonly buildResult;
|
|
7
6
|
private readonly evaluateResult;
|
|
8
|
-
/** Constructs a Validator
|
|
7
|
+
/** Constructs a Validator. */
|
|
9
8
|
constructor(context: Context, type: Type);
|
|
10
|
-
/** Constructs a Validator with the given arguments. */
|
|
11
|
-
constructor(hasCodec: boolean, buildResult: BuildResult, evaluateResult: EvaluateResult);
|
|
12
9
|
/** Returns true if this Validator is using JIT acceleration. */
|
|
13
10
|
IsAccelerated(): boolean;
|
|
14
11
|
/** Returns the Context for this validator. */
|
|
@@ -61,5 +61,5 @@ export declare function Keys(value: Record<PropertyKey, unknown>): string[];
|
|
|
61
61
|
export declare function Symbols(value: Record<PropertyKey, unknown>): symbol[];
|
|
62
62
|
/** Returns the property values for the given object via `Object.values()` */
|
|
63
63
|
export declare function Values(value: Record<PropertyKey, unknown>): unknown[];
|
|
64
|
-
/**
|
|
64
|
+
/** Returns true if left and right values are structurally equal */
|
|
65
65
|
export declare function IsDeepEqual(left: unknown, right: unknown): boolean;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// deno-fmt-ignore-file
|
|
1
2
|
import * as String from './string.mjs';
|
|
2
3
|
// --------------------------------------------------------------------------
|
|
3
4
|
// Guards
|
|
@@ -203,7 +204,9 @@ function DeepEqualArray(left, right) {
|
|
|
203
204
|
return IsArray(right) && IsEqual(left.length, right.length) &&
|
|
204
205
|
left.every((_, index) => IsDeepEqual(left[index], right[index]));
|
|
205
206
|
}
|
|
206
|
-
/**
|
|
207
|
+
/** Returns true if left and right values are structurally equal */
|
|
207
208
|
export function IsDeepEqual(left, right) {
|
|
208
|
-
return (IsArray(left) ? DeepEqualArray(left, right) :
|
|
209
|
+
return (IsArray(left) ? DeepEqualArray(left, right) :
|
|
210
|
+
IsObject(left) ? DeepEqualObject(left, right) :
|
|
211
|
+
IsEqual(left, right));
|
|
209
212
|
}
|
|
@@ -5,6 +5,18 @@ function IsBetween(value, min, max) {
|
|
|
5
5
|
return value >= min && value <= max;
|
|
6
6
|
}
|
|
7
7
|
// --------------------------------------------------------------------------
|
|
8
|
+
// IsZeroWidthJoiner
|
|
9
|
+
// --------------------------------------------------------------------------
|
|
10
|
+
function IsZeroWidthJoiner(value) {
|
|
11
|
+
return (value === 0x200D);
|
|
12
|
+
}
|
|
13
|
+
// --------------------------------------------------------------------------
|
|
14
|
+
// IsHighSurrogate
|
|
15
|
+
// --------------------------------------------------------------------------
|
|
16
|
+
function IsHighSurrogate(value) {
|
|
17
|
+
return IsBetween(value, 0xD800, 0xDBFF);
|
|
18
|
+
}
|
|
19
|
+
// --------------------------------------------------------------------------
|
|
8
20
|
// IsRegionalIndicator
|
|
9
21
|
// --------------------------------------------------------------------------
|
|
10
22
|
function IsRegionalIndicator(value) {
|
|
@@ -72,10 +84,10 @@ function NextGraphemeClusterIndex(value, clusterStart) {
|
|
|
72
84
|
// IsGraphemeCodePoint
|
|
73
85
|
// --------------------------------------------------------------------------
|
|
74
86
|
function IsGraphemeCodePoint(value) {
|
|
75
|
-
return (
|
|
76
|
-
|
|
77
|
-
(value
|
|
78
|
-
|
|
87
|
+
return (IsHighSurrogate(value) ||
|
|
88
|
+
IsCombiningMark(value) ||
|
|
89
|
+
IsVariationSelector(value) ||
|
|
90
|
+
IsZeroWidthJoiner(value));
|
|
79
91
|
}
|
|
80
92
|
// --------------------------------------------------------------------------
|
|
81
93
|
// GraphemeCount
|
|
@@ -1,47 +1,66 @@
|
|
|
1
1
|
// deno-fmt-ignore-file
|
|
2
|
-
import * as Schema from '../types/index.mjs';
|
|
3
2
|
import { Hashing } from '../../system/hashing/index.mjs';
|
|
4
3
|
import { EmitGuard as E } from '../../guard/index.mjs';
|
|
5
4
|
import { BuildSchema } from './schema.mjs';
|
|
6
|
-
const
|
|
5
|
+
const index = [0];
|
|
6
|
+
const names = new Map;
|
|
7
|
+
const funcs = new Map();
|
|
8
|
+
// ------------------------------------------------------------------
|
|
9
|
+
// CreateName
|
|
10
|
+
// ------------------------------------------------------------------
|
|
11
|
+
function NextName() {
|
|
12
|
+
return Hashing.Hash(index[0]++);
|
|
13
|
+
}
|
|
14
|
+
function CreateName(schema, href) {
|
|
15
|
+
if (!names.has(schema))
|
|
16
|
+
names.set(schema, new Map());
|
|
17
|
+
const hrefs = names.get(schema);
|
|
18
|
+
if (hrefs.has(href))
|
|
19
|
+
return hrefs.get(href);
|
|
20
|
+
const name = NextName();
|
|
21
|
+
hrefs.set(href, name);
|
|
22
|
+
return name;
|
|
23
|
+
}
|
|
7
24
|
// ------------------------------------------------------------------
|
|
8
25
|
// CreateCallExpression
|
|
9
26
|
// ------------------------------------------------------------------
|
|
10
|
-
function CreateCallExpression(context, _schema,
|
|
27
|
+
function CreateCallExpression(context, _schema, name, value) {
|
|
11
28
|
return context.UseUnevaluated()
|
|
12
|
-
? E.Call(`check_${
|
|
13
|
-
: E.Call(`check_${
|
|
29
|
+
? E.Call(`check_${name}`, ['context', value])
|
|
30
|
+
: E.Call(`check_${name}`, [value]);
|
|
14
31
|
}
|
|
15
32
|
// ------------------------------------------------------------------
|
|
16
33
|
// CreateFunctionExpression
|
|
17
34
|
// ------------------------------------------------------------------
|
|
18
|
-
function CreateFunctionExpression(stack, context, schema,
|
|
35
|
+
function CreateFunctionExpression(stack, context, schema, name) {
|
|
19
36
|
const expression = BuildSchema(stack, context, schema, 'value');
|
|
20
37
|
return context.UseUnevaluated()
|
|
21
|
-
? E.ConstDeclaration(`check_${
|
|
22
|
-
: E.ConstDeclaration(`check_${
|
|
38
|
+
? E.ConstDeclaration(`check_${name}`, E.ArrowFunction(['context', 'value'], expression))
|
|
39
|
+
: E.ConstDeclaration(`check_${name}`, E.ArrowFunction(['value'], expression));
|
|
23
40
|
}
|
|
24
41
|
// ------------------------------------------------------------------
|
|
25
42
|
// ResetFunctions
|
|
26
43
|
// ------------------------------------------------------------------
|
|
27
44
|
export function ResetFunctions() {
|
|
28
|
-
|
|
45
|
+
index[0] = 0;
|
|
46
|
+
names.clear();
|
|
47
|
+
funcs.clear();
|
|
29
48
|
}
|
|
30
49
|
// ------------------------------------------------------------------
|
|
31
50
|
// GetFunctions
|
|
32
51
|
// ------------------------------------------------------------------
|
|
33
52
|
export function GetFunctions() {
|
|
34
|
-
return [...
|
|
53
|
+
return [...funcs.values()];
|
|
35
54
|
}
|
|
36
55
|
// ------------------------------------------------------------------
|
|
37
56
|
// CreateFunction
|
|
38
57
|
// ------------------------------------------------------------------
|
|
39
58
|
export function CreateFunction(stack, context, schema, value) {
|
|
40
|
-
const
|
|
41
|
-
const call = CreateCallExpression(context, schema,
|
|
42
|
-
if (
|
|
59
|
+
const name = CreateName(schema, stack.BaseURL().href);
|
|
60
|
+
const call = CreateCallExpression(context, schema, name, value);
|
|
61
|
+
if (funcs.has(name))
|
|
43
62
|
return call;
|
|
44
|
-
|
|
45
|
-
|
|
63
|
+
funcs.set(name, '');
|
|
64
|
+
funcs.set(name, CreateFunctionExpression(stack, context, schema, name));
|
|
46
65
|
return call;
|
|
47
66
|
}
|
|
@@ -9,3 +9,8 @@ export declare function ReadonlyObjectDeferred<Type extends TSchema>(type: Type,
|
|
|
9
9
|
export type TReadonlyObject<Type extends TSchema> = (TReadonlyObjectAction<Type>);
|
|
10
10
|
/** This type is an alias for TypeScript's `Readonly<T>` utility type. It will make all properties of a TObject readonly or marks an TArray or TTuple as immutable `readonly T[]`. */
|
|
11
11
|
export declare function ReadonlyObject<Type extends TSchema>(type: Type, options?: TSchemaOptions): TReadonlyObject<Type>;
|
|
12
|
+
/**
|
|
13
|
+
* This type has been renamed to ReadonlyObject.
|
|
14
|
+
* @deprecated
|
|
15
|
+
*/
|
|
16
|
+
export declare const ReadonlyType: typeof ReadonlyObject;
|
|
@@ -9,3 +9,11 @@ export function ReadonlyObjectDeferred(type, options = {}) {
|
|
|
9
9
|
export function ReadonlyObject(type, options = {}) {
|
|
10
10
|
return ReadonlyObjectAction(type, options);
|
|
11
11
|
}
|
|
12
|
+
// ------------------------------------------------------------------
|
|
13
|
+
// Alias
|
|
14
|
+
// ------------------------------------------------------------------
|
|
15
|
+
/**
|
|
16
|
+
* This type has been renamed to ReadonlyObject.
|
|
17
|
+
* @deprecated
|
|
18
|
+
*/
|
|
19
|
+
export const ReadonlyType = ReadonlyObject;
|
|
@@ -19,7 +19,7 @@ export { Omit, type TOmit, type TOmitDeferred } from './type/action/omit.mjs';
|
|
|
19
19
|
export { Parameters, type TParameters, type TParametersDeferred } from './type/action/parameters.mjs';
|
|
20
20
|
export { Partial, type TPartial, type TPartialDeferred } from './type/action/partial.mjs';
|
|
21
21
|
export { Pick, type TPick, type TPickDeferred } from './type/action/pick.mjs';
|
|
22
|
-
export { ReadonlyObject, type TReadonlyObject, type TReadonlyObjectDeferred } from './type/action/readonly_object.mjs';
|
|
22
|
+
export { ReadonlyObject, ReadonlyType, type TReadonlyObject, type TReadonlyObjectDeferred } from './type/action/readonly_object.mjs';
|
|
23
23
|
export { Required, type TRequired, type TRequiredDeferred } from './type/action/required.mjs';
|
|
24
24
|
export { ReturnType, type TReturnType, type TReturnTypeDeferred } from './type/action/return_type.mjs';
|
|
25
25
|
export { type TUncapitalize, type TUncapitalizeDeferred, Uncapitalize } from './type/action/uncapitalize.mjs';
|
|
@@ -31,7 +31,7 @@ export { Omit } from './type/action/omit.mjs';
|
|
|
31
31
|
export { Parameters } from './type/action/parameters.mjs';
|
|
32
32
|
export { Partial } from './type/action/partial.mjs';
|
|
33
33
|
export { Pick } from './type/action/pick.mjs';
|
|
34
|
-
export { ReadonlyObject } from './type/action/readonly_object.mjs';
|
|
34
|
+
export { ReadonlyObject, ReadonlyType } from './type/action/readonly_object.mjs';
|
|
35
35
|
export { Required } from './type/action/required.mjs';
|
|
36
36
|
export { ReturnType } from './type/action/return_type.mjs';
|
|
37
37
|
export { Uncapitalize } from './type/action/uncapitalize.mjs';
|
|
@@ -111,27 +111,24 @@ type User = Type.Static<typeof User> // type User = {
|
|
|
111
111
|
|
|
112
112
|
## Script
|
|
113
113
|
|
|
114
|
-
[Documentation](https://sinclairzx81.github.io/typebox/#/docs/script/overview) | [Example 1](https://www.typescriptlang.org/play/?target=99&module=7#code/
|
|
115
|
-
|
|
116
|
-
TypeBox includes a syntax engine that can transform TypeScript declarations into JSON Schema. The engine is a full syntactic frontend to Type.* and supports many advanced type-level constructs such as Conditional, Mapped, Indexed, Infer, Generics, Distributed types and more. This feature is implemented symmetrically at runtime and statically via TypeScript Template Literal types.
|
|
117
|
-
|
|
118
|
-
Syntax highlighting is available via the [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=sinclairzx81.typebox-script)
|
|
114
|
+
[Documentation](https://sinclairzx81.github.io/typebox/#/docs/script/overview) | [Example 1](https://www.typescriptlang.org/play/?target=99&module=7#code/JYWwDg9gTgLgBAFQJ5gKZwGZQiOByGFVAIwgA88AoSgehrgFkIATAVwBtVKBjCAOwDO8BgEMYACzgBeREQB0AZW5RgYGAAoABpThxCaOADVU3GNABM0uAG84ZAFxw+rEMVRQANHCSPnr93AAvjp6REYmZlAAzFa2Dk4ubp7evonuXgBeqf5QQSH66Mam0AAssXbZSV4+CTmZlelwAO4NucGaAJTUdHAAIqhofMyofMIsHFy8gvC2DKgCkoFWyGiKyqoaohJemrr5YcawqGSxIbqQAsAwwPyORZElHmdO0CAi7HcR0FFPurqsADdPsUoOYQsFdAU4ABxVA4VAwKBIU5-OAA9zXbjzT5HMgAbQAur8-sAhsAsQJWoTwfsDFt3MB3ii-iJXMARjBgQ9ibpmMAMBhWAJUFzSjy4AI0NwOCIoKKoCUaZCwnMFszdABzOEgBFIxyw+GIpDit4wBnvRz0lTvGmdbr0ABKrFGoHQDtQGE4phufEoqvEcjA2DQsHZAjkWsNSMDwYxYbk6NDFLkV1QIHDQYgIeu80DEEu134MazcdzZD98wDmez8cjOqNxZrucTmNzqfTjdL4b4r3endDZYrC37OfDdd1SBH8Zb5LbZo71a7ckBU8H-tX4dN5vYG7kfIFQtQu-L68XA83Ym3u9ZxHZo2PQ6rsfPci31p3Z9HcklJhlUAftD0AoMBiOScAAJJ8Bg7gjFilCCnw3r8HAUAjMMUDqDqCyOCsR7AaB3AADwFBAGCMJWAB8HQ2CEWEBuODYzhSeIAAwEnmBY+nI5a6HREbahOCZxsxbFyD2UBvDuPFwHxDHRkx8ysexK7SXxb6Mju+6CsK3G0ZWr6Xu+cg3neMC6bx+nqX2P7Suwsq6YEQA) | [Example 2](https://www.typescriptlang.org/play/?target=99&module=7#code/JYWwDg9gTgLgBAFQJ5gKZwGZQiOByGFVAIwgA88AoSgehrgFkIATAVwBtVKA7AQxFQBnMLwDG6BrxgALOAG9KcOKjKRYcURG6D4ANVSiY0AExwAvIiIA6APLEAVgZgAKOXDIAuS2isA5ViDEqFDOAJQANHBIXsg+-oHBYXAAvqGKyqrQ8Jraek7QAMzm3qi2Dk6u7jHW8UEhEVHVcQF1YZEAXk2ltYmhKWlKKmrZWjpw+obQACzFsaV2joaVniV+Lb2R0as99R1dawm7cADu+ztJqZTJ1HRwACKoaNzMqNzwTGyclDlj+rAqs2sCwqCiUkEEwBgwC0XkkMisEyMUCm4XS3GgIF47FhUmkCPyUAKqKUrAAbjj4YiTFc0j94ABxVA4VAwKBIQE+YFLUFwUnBKHiQT7ACCUCgvCQzj+MBUEXSwGewEFIrFEuccwOrVCaUudMYUmCwCxHPm5W56X4xGArxgFLxVORxLgzGAGAwrEEqDt+MmjvSwgMHF4UG9DqmNO+o3eQlkFg1XJcPIA5kyBKytozmemnZiZVAjdj9XmCxHaPQAEqsN6gdDl1AYTiGaHcSgMGNWMDYNCwa2CKwprNsjtd-m9qx8nuCqyQ1AgPudiDdqFCDsQCFQrTDxejldkVvthdLscDtNDw87vsTgUrmdzrdHlfoqCY9j3i9WPdtwR4889lcnlkzxHP9L1HKdb3nYDlz7Mk3xAj992-ODoKsXNDSxZCxxdN0PVKX8UM-A8oLHND8ww-Cx0ta03kw3dEJ-YiV1IgtaL7ANRCDKBWIQss4AAZRgKQlTgABJbgMGCV5xEod1uCbLQ4CgV4XhCARv32AShNEAAeQg0AgDBGBjAA+PoeTUvEAPTccwKEABtAAGABdVd12bBClAs-tU0ApAbMneznKsJ8Xw8uAvKsocryVQKXNgvdPPbZiMOw91PTCrzktfKibQypKDTI192M4hDkiAA) | [Challenge](test/typescript/readme.md)
|
|
119
115
|
|
|
116
|
+
TypeBox includes a runtime scripting engine that can transform TypeScript definitions into JSON Schema. The engine is implemented symmetrically at runtime and inside TypeScript's type system. It supports many programmable type-level constructs such as Conditional, Mapped, Indexed, Generic, Distributive Conditional, and more. The engine is designed for TypeScript 7 but is supported in TypeScript 5 and above.
|
|
120
117
|
|
|
121
118
|
### Example
|
|
122
119
|
|
|
123
|
-
|
|
120
|
+
Syntax highlighting is available via the [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=sinclairzx81.typebox-script)
|
|
124
121
|
|
|
125
122
|
```typescript
|
|
126
123
|
// Module
|
|
127
124
|
const Math = Type.Script(`
|
|
128
125
|
type Vector2 = { x: number, y: number }
|
|
129
|
-
type Vector3 =
|
|
130
|
-
type Vector4 =
|
|
126
|
+
type Vector3 = { x: number, y: number, z: number }
|
|
127
|
+
type Vector4 = { x: number, y: number, z: number, w: number }
|
|
131
128
|
`)
|
|
132
129
|
|
|
133
130
|
// Dependent Module
|
|
134
|
-
const { Mesh } = Type.Script(
|
|
131
|
+
const { Mesh } = Type.Script(Math, `
|
|
135
132
|
type Vertex = {
|
|
136
133
|
position: Vector4,
|
|
137
134
|
normal: Vector3,
|
|
@@ -298,29 +295,29 @@ The following table shows compile performance for various JSON Schema structures
|
|
|
298
295
|
┌──────────────────────┬─────────────┬─────────────┐
|
|
299
296
|
│ Compile │ TB1X │ AJV8 │
|
|
300
297
|
├──────────────────────┼─────────────┼─────────────┤
|
|
301
|
-
│ Boolean │
|
|
302
|
-
│ Number │
|
|
303
|
-
│ String │
|
|
304
|
-
│ Null │
|
|
305
|
-
│ Literal_String │
|
|
306
|
-
│ Literal_Number │
|
|
307
|
-
│ Literal_Boolean │
|
|
308
|
-
│ Pattern │
|
|
309
|
-
│ Object_Open │
|
|
310
|
-
│ Object_Close │
|
|
311
|
-
│ Object_Vector3 │
|
|
312
|
-
│ Object_Basis3 │
|
|
313
|
-
│ Intersect_And │
|
|
314
|
-
│ Intersect_Structural │
|
|
315
|
-
│ Union_Or │
|
|
316
|
-
│ Union_Structural │
|
|
317
|
-
│ Tuple_Values │
|
|
318
|
-
│ Tuple_Objects │
|
|
319
|
-
│ Array_Numbers_4 │
|
|
320
|
-
│ Array_Numbers_8 │
|
|
321
|
-
│ Array_Numbers_16 │
|
|
322
|
-
│ Array_Objects_Open │
|
|
323
|
-
│ Array_Objects_Close │
|
|
298
|
+
│ Boolean │ 39.7K ops/s │ 6.8K ops/s │
|
|
299
|
+
│ Number │ 86.2K ops/s │ 7.5K ops/s │
|
|
300
|
+
│ String │ 82.6K ops/s │ 8.2K ops/s │
|
|
301
|
+
│ Null │ 62K ops/s │ 7.3K ops/s │
|
|
302
|
+
│ Literal_String │ 72.1K ops/s │ 5.7K ops/s │
|
|
303
|
+
│ Literal_Number │ 72.7K ops/s │ 6.9K ops/s │
|
|
304
|
+
│ Literal_Boolean │ 80.9K ops/s │ 7K ops/s │
|
|
305
|
+
│ Pattern │ 38.7K ops/s │ 5.7K ops/s │
|
|
306
|
+
│ Object_Open │ 16.3K ops/s │ 1.3K ops/s │
|
|
307
|
+
│ Object_Close │ 15.7K ops/s │ 952 ops/s │
|
|
308
|
+
│ Object_Vector3 │ 40.2K ops/s │ 3.2K ops/s │
|
|
309
|
+
│ Object_Basis3 │ 16.1K ops/s │ 834 ops/s │
|
|
310
|
+
│ Intersect_And │ 45.7K ops/s │ 3.5K ops/s │
|
|
311
|
+
│ Intersect_Structural │ 21K ops/s │ 1.6K ops/s │
|
|
312
|
+
│ Union_Or │ 45.1K ops/s │ 3.4K ops/s │
|
|
313
|
+
│ Union_Structural │ 27.6K ops/s │ 2K ops/s │
|
|
314
|
+
│ Tuple_Values │ 14.7K ops/s │ 2K ops/s │
|
|
315
|
+
│ Tuple_Objects │ 3.7K ops/s │ 380 ops/s │
|
|
316
|
+
│ Array_Numbers_4 │ 73.6K ops/s │ 4.3K ops/s │
|
|
317
|
+
│ Array_Numbers_8 │ 50.9K ops/s │ 3.8K ops/s │
|
|
318
|
+
│ Array_Numbers_16 │ 85K ops/s │ 3.9K ops/s │
|
|
319
|
+
│ Array_Objects_Open │ 18.9K ops/s │ 789 ops/s │
|
|
320
|
+
│ Array_Objects_Close │ 17.9K ops/s │ 909 ops/s │
|
|
324
321
|
└──────────────────────┴─────────────┴─────────────┘
|
|
325
322
|
```
|
|
326
323
|
|
|
@@ -77,6 +77,7 @@ class Receiver extends Writable {
|
|
|
77
77
|
|
|
78
78
|
this._totalPayloadLength = 0;
|
|
79
79
|
this._messageLength = 0;
|
|
80
|
+
this._numFragments = 0;
|
|
80
81
|
this._fragments = [];
|
|
81
82
|
|
|
82
83
|
this._errored = false;
|
|
@@ -500,6 +501,19 @@ class Receiver extends Writable {
|
|
|
500
501
|
return;
|
|
501
502
|
}
|
|
502
503
|
|
|
504
|
+
if (this._maxFragments > 0 && ++this._numFragments > this._maxFragments) {
|
|
505
|
+
const error = this.createError(
|
|
506
|
+
RangeError,
|
|
507
|
+
'Too many message fragments',
|
|
508
|
+
false,
|
|
509
|
+
1008,
|
|
510
|
+
'WS_ERR_TOO_MANY_BUFFERED_PARTS'
|
|
511
|
+
);
|
|
512
|
+
|
|
513
|
+
cb(error);
|
|
514
|
+
return;
|
|
515
|
+
}
|
|
516
|
+
|
|
503
517
|
if (this._compressed) {
|
|
504
518
|
this._state = INFLATING;
|
|
505
519
|
this.decompress(data, cb);
|
|
@@ -507,22 +521,6 @@ class Receiver extends Writable {
|
|
|
507
521
|
}
|
|
508
522
|
|
|
509
523
|
if (data.length) {
|
|
510
|
-
if (
|
|
511
|
-
this._maxFragments > 0 &&
|
|
512
|
-
this._fragments.length >= this._maxFragments
|
|
513
|
-
) {
|
|
514
|
-
const error = this.createError(
|
|
515
|
-
RangeError,
|
|
516
|
-
'Too many message fragments',
|
|
517
|
-
false,
|
|
518
|
-
1008,
|
|
519
|
-
'WS_ERR_TOO_MANY_BUFFERED_PARTS'
|
|
520
|
-
);
|
|
521
|
-
|
|
522
|
-
cb(error);
|
|
523
|
-
return;
|
|
524
|
-
}
|
|
525
|
-
|
|
526
524
|
//
|
|
527
525
|
// This message is not compressed so its length is the sum of the payload
|
|
528
526
|
// length of all fragments.
|
|
@@ -562,22 +560,6 @@ class Receiver extends Writable {
|
|
|
562
560
|
return;
|
|
563
561
|
}
|
|
564
562
|
|
|
565
|
-
if (
|
|
566
|
-
this._maxFragments > 0 &&
|
|
567
|
-
this._fragments.length >= this._maxFragments
|
|
568
|
-
) {
|
|
569
|
-
const error = this.createError(
|
|
570
|
-
RangeError,
|
|
571
|
-
'Too many message fragments',
|
|
572
|
-
false,
|
|
573
|
-
1008,
|
|
574
|
-
'WS_ERR_TOO_MANY_BUFFERED_PARTS'
|
|
575
|
-
);
|
|
576
|
-
|
|
577
|
-
cb(error);
|
|
578
|
-
return;
|
|
579
|
-
}
|
|
580
|
-
|
|
581
563
|
this._fragments.push(buf);
|
|
582
564
|
}
|
|
583
565
|
|
|
@@ -604,6 +586,7 @@ class Receiver extends Writable {
|
|
|
604
586
|
this._totalPayloadLength = 0;
|
|
605
587
|
this._messageLength = 0;
|
|
606
588
|
this._fragmented = 0;
|
|
589
|
+
this._numFragments = 0;
|
|
607
590
|
this._fragments = [];
|
|
608
591
|
|
|
609
592
|
if (this._opcode === 2) {
|
|
@@ -43,9 +43,9 @@ class WebSocketServer extends EventEmitter {
|
|
|
43
43
|
* called
|
|
44
44
|
* @param {Function} [options.handleProtocols] A hook to handle protocols
|
|
45
45
|
* @param {String} [options.host] The hostname where to bind the server
|
|
46
|
-
* @param {Number} [options.maxBufferedChunks=
|
|
46
|
+
* @param {Number} [options.maxBufferedChunks=262144] The maximum number of
|
|
47
47
|
* buffered data chunks
|
|
48
|
-
* @param {Number} [options.maxFragments=
|
|
48
|
+
* @param {Number} [options.maxFragments=16384] The maximum number of message
|
|
49
49
|
* fragments
|
|
50
50
|
* @param {Number} [options.maxPayload=104857600] The maximum allowed message
|
|
51
51
|
* size
|
|
@@ -69,8 +69,8 @@ class WebSocketServer extends EventEmitter {
|
|
|
69
69
|
options = {
|
|
70
70
|
allowSynchronousEvents: true,
|
|
71
71
|
autoPong: true,
|
|
72
|
-
maxBufferedChunks:
|
|
73
|
-
maxFragments:
|
|
72
|
+
maxBufferedChunks: 256 * 1024,
|
|
73
|
+
maxFragments: 16 * 1024,
|
|
74
74
|
maxPayload: 100 * 1024 * 1024,
|
|
75
75
|
skipUTF8Validation: false,
|
|
76
76
|
perMessageDeflate: false,
|
|
@@ -646,9 +646,9 @@ module.exports = WebSocket;
|
|
|
646
646
|
* masking key
|
|
647
647
|
* @param {Number} [options.handshakeTimeout] Timeout in milliseconds for the
|
|
648
648
|
* handshake request
|
|
649
|
-
* @param {Number} [options.maxBufferedChunks=
|
|
649
|
+
* @param {Number} [options.maxBufferedChunks=262144] The maximum number of
|
|
650
650
|
* buffered data chunks
|
|
651
|
-
* @param {Number} [options.maxFragments=
|
|
651
|
+
* @param {Number} [options.maxFragments=16384] The maximum number of message
|
|
652
652
|
* fragments
|
|
653
653
|
* @param {Number} [options.maxPayload=104857600] The maximum allowed message
|
|
654
654
|
* size
|
|
@@ -670,8 +670,8 @@ function initAsClient(websocket, address, protocols, options) {
|
|
|
670
670
|
autoPong: true,
|
|
671
671
|
closeTimeout: CLOSE_TIMEOUT,
|
|
672
672
|
protocolVersion: protocolVersions[1],
|
|
673
|
-
maxBufferedChunks:
|
|
674
|
-
maxFragments:
|
|
673
|
+
maxBufferedChunks: 256 * 1024,
|
|
674
|
+
maxFragments: 16 * 1024,
|
|
675
675
|
maxPayload: 100 * 1024 * 1024,
|
|
676
676
|
skipUTF8Validation: false,
|
|
677
677
|
perMessageDeflate: true,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ws",
|
|
3
|
-
"version": "8.21.
|
|
3
|
+
"version": "8.21.1",
|
|
4
4
|
"description": "Simple to use, blazing fast and thoroughly tested websocket client and server for Node.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"HyBi",
|
|
@@ -66,5 +66,9 @@
|
|
|
66
66
|
"nyc": "^15.0.0",
|
|
67
67
|
"prettier": "^3.0.0",
|
|
68
68
|
"utf-8-validate": "^6.0.0"
|
|
69
|
+
},
|
|
70
|
+
"allowScripts": {
|
|
71
|
+
"bufferutil": true,
|
|
72
|
+
"utf-8-validate": true
|
|
69
73
|
}
|
|
70
74
|
}
|