@openclaw/line 2026.11.3 → 2026.11.5-beta.2
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/.setup/api-4BpGVN1-.mjs +3 -0
- package/dist/.setup/{api-WIupE7U1.mjs → api-BRnngy5R.mjs} +1 -1
- package/dist/.setup/{card-command-Dnkl21vg.mjs → card-command-2y-RSLPg.mjs} +26 -43
- package/dist/.setup/{channel-DIEVJ4PQ.mjs → channel-DJcpjKpx.mjs} +237 -332
- package/dist/.setup/channel.runtime-CdfKsNz4.mjs +4 -0
- package/dist/.setup/{monitor-JlOPDECF.mjs → monitor-BkuPFFxZ.mjs} +240 -329
- package/dist/.setup/{outbound.runtime-pciQUWJd.mjs → outbound.runtime-BPo_111h.mjs} +2 -2
- package/dist/.setup/{send-kjjjemFi.mjs → send-C1JZOFMA.mjs} +32 -81
- package/dist/.setup/{send-retry-Dzbkz5wG.mjs → send-retry-Bf2Xr6ZN.mjs} +175 -80
- package/dist/.setup/{template-messages-COcdie6C.mjs → template-messages-C1Kkr0-e.mjs} +32 -44
- package/dist/.source-module-urls/2c97352967966b7ab9f67f528eb25c098b6fe10ea0e4616ffae3851ed839d81e.json +1 -0
- package/dist/api.js +2 -2
- package/dist/channel-plugin-api.js +1 -2
- package/dist/contract-api.js +1 -2
- package/dist/index.js +1 -1
- package/dist/runtime-api.js +1 -2
- package/dist/setup-api.js +1 -2
- package/dist/setup-entry.js +1 -1
- package/node_modules/@line/bot-sdk/node_modules/@types/node/README.md +1 -1
- package/node_modules/@line/bot-sdk/node_modules/@types/node/package.json +2 -2
- package/node_modules/@line/bot-sdk/node_modules/@types/node/util.d.ts +7 -4
- package/node_modules/typebox/build/format/duration.d.mts +2 -2
- package/node_modules/typebox/build/format/duration.mjs +2 -2
- package/node_modules/typebox/build/format/idn_email.d.mts +1 -0
- package/node_modules/typebox/build/format/idn_email.mjs +1 -0
- package/node_modules/typebox/build/format/idn_hostname.d.mts +1 -1
- package/node_modules/typebox/build/format/idn_hostname.mjs +1 -1
- package/node_modules/typebox/build/format/ipv4.d.mts +2 -2
- package/node_modules/typebox/build/format/ipv4.mjs +2 -2
- package/node_modules/typebox/build/format/ipv6.d.mts +1 -1
- package/node_modules/typebox/build/format/ipv6.mjs +1 -1
- package/node_modules/typebox/build/format/relative_json_pointer.d.mts +2 -2
- package/node_modules/typebox/build/format/relative_json_pointer.mjs +2 -2
- package/node_modules/typebox/build/schema/build.mjs +1 -0
- package/node_modules/typebox/build/schema/engine/_unique.d.mts +4 -2
- package/node_modules/typebox/build/schema/engine/_unique.mjs +7 -3
- package/node_modules/typebox/build/schema/engine/additionalItems.mjs +3 -3
- package/node_modules/typebox/build/schema/engine/additionalProperties.d.mts +0 -3
- package/node_modules/typebox/build/schema/engine/additionalProperties.mjs +15 -17
- package/node_modules/typebox/build/schema/engine/contains.mjs +3 -3
- package/node_modules/typebox/build/schema/engine/index.d.mts +1 -0
- package/node_modules/typebox/build/schema/engine/index.mjs +1 -0
- package/node_modules/typebox/build/schema/engine/items.mjs +7 -4
- package/node_modules/typebox/build/schema/engine/maxContains.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/minContains.mjs +3 -3
- package/node_modules/typebox/build/schema/engine/oneOf.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/patternProperties.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/propertyNames.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/unevaluatedItems.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/unevaluatedProperties.mjs +2 -2
- package/node_modules/typebox/build/system/hashing/hash.mjs +63 -34
- package/node_modules/typebox/build/system/locale/en_US.mjs +2 -1
- package/node_modules/typebox/build/system/memory/assign.d.mts +2 -8
- package/node_modules/typebox/build/system/memory/assign.mjs +13 -6
- package/node_modules/typebox/build/system/memory/clone.d.mts +4 -5
- package/node_modules/typebox/build/system/memory/clone.mjs +8 -96
- package/node_modules/typebox/build/system/memory/create.d.mts +1 -5
- package/node_modules/typebox/build/system/memory/create.mjs +18 -13
- package/node_modules/typebox/build/system/memory/deep.d.mts +2 -0
- package/node_modules/typebox/build/system/memory/deep.mjs +108 -0
- package/node_modules/typebox/build/system/memory/discard.d.mts +1 -1
- package/node_modules/typebox/build/system/memory/discard.mjs +9 -8
- package/node_modules/typebox/build/system/memory/finalize.d.mts +4 -0
- package/node_modules/typebox/build/system/memory/finalize.mjs +30 -0
- package/node_modules/typebox/build/system/memory/keys.d.mts +2 -0
- package/node_modules/typebox/build/system/memory/keys.mjs +8 -0
- package/node_modules/typebox/build/system/memory/update.d.mts +1 -4
- package/node_modules/typebox/build/system/memory/update.mjs +43 -16
- package/node_modules/typebox/build/type/engine/call/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/call/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/evaluate/composite.d.mts +2 -24
- package/node_modules/typebox/build/type/engine/evaluate/composite.mjs +2 -29
- package/node_modules/typebox/build/type/engine/evaluate/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/evaluate/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/evaluate/narrow.d.mts +5 -1
- package/node_modules/typebox/build/type/engine/evaluate/narrow.mjs +6 -1
- package/node_modules/typebox/build/type/engine/evaluate/property.d.mts +30 -0
- package/node_modules/typebox/build/type/engine/evaluate/property.mjs +29 -0
- package/node_modules/typebox/build/type/engine/immutable/instantiate_add.d.mts +1 -3
- package/node_modules/typebox/build/type/engine/immutable/instantiate_add.mjs +1 -4
- package/node_modules/typebox/build/type/engine/object/from_intersect.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/object/from_intersect.mjs +2 -2
- package/node_modules/typebox/build/type/engine/object/from_union.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/object/from_union.mjs +2 -2
- package/node_modules/typebox/build/type/engine/optional/instantiate_add.d.mts +1 -3
- package/node_modules/typebox/build/type/engine/optional/instantiate_add.mjs +1 -4
- package/node_modules/typebox/build/type/engine/readonly/instantiate_add.d.mts +1 -3
- package/node_modules/typebox/build/type/engine/readonly/instantiate_add.mjs +1 -4
- package/node_modules/typebox/build/type/engine/this/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/this/index.mjs +1 -0
- package/node_modules/typebox/build/value/clone/clone.d.mts +4 -3
- package/node_modules/typebox/build/value/clone/clone.mjs +5 -7
- package/node_modules/typebox/build/value/repair/from_cyclic.d.mts +2 -0
- package/node_modules/typebox/build/value/repair/from_cyclic.mjs +6 -0
- package/node_modules/typebox/build/value/shared/union_priority_sort.mjs +25 -14
- package/node_modules/typebox/package.json +1 -1
- package/node_modules/typebox/readme.md +1 -1
- package/node_modules/zod/package.json +1 -1
- package/node_modules/zod/src/v4/classic/tests/array.test.ts +27 -0
- package/node_modules/zod/src/v4/classic/tests/map.test.ts +7 -0
- package/node_modules/zod/src/v4/classic/tests/set.test.ts +6 -0
- package/node_modules/zod/src/v4/core/compile.ts +9 -0
- package/node_modules/zod/src/v4/core/schemas.ts +35 -1
- package/node_modules/zod/src/v4/core/util.ts +13 -0
- package/node_modules/zod/src/v4/core/versions.ts +1 -1
- package/node_modules/zod/v4/core/compile.cjs +8 -0
- package/node_modules/zod/v4/core/compile.js +8 -0
- package/node_modules/zod/v4/core/schemas.cjs +30 -0
- package/node_modules/zod/v4/core/schemas.d.cts +3 -1
- package/node_modules/zod/v4/core/schemas.d.ts +3 -1
- package/node_modules/zod/v4/core/schemas.js +30 -0
- package/node_modules/zod/v4/core/util.cjs +15 -0
- package/node_modules/zod/v4/core/util.d.cts +2 -0
- package/node_modules/zod/v4/core/util.d.ts +2 -0
- package/node_modules/zod/v4/core/util.js +14 -0
- package/node_modules/zod/v4/core/versions.cjs +1 -1
- package/node_modules/zod/v4/core/versions.js +1 -1
- package/package.json +6 -6
- package/dist/.setup/api-BMSLc5Fi.mjs +0 -3
- package/dist/.setup/channel.runtime-CDy9DQUW.mjs +0 -4
- package/dist/.setup/monitor.runtime-DsIFiXEZ.mjs +0 -2
- package/dist/.setup/probe.runtime-D2MUF_B_.mjs +0 -2
- package/node_modules/typebox/build/system/memory/freeze.d.mts +0 -4
- package/node_modules/typebox/build/system/memory/freeze.mjs +0 -6
package/dist/setup-entry.js
CHANGED
|
@@ -4,7 +4,7 @@ import { fileURLToPath } from "node:url";
|
|
|
4
4
|
var setup_entry_default = defineBundledChannelSetupEntry({
|
|
5
5
|
importMetaUrl: import.meta.url,
|
|
6
6
|
plugin: {
|
|
7
|
-
specifier: fileURLToPath(new URL(".setup/api-
|
|
7
|
+
specifier: fileURLToPath(new URL(".setup/api-4BpGVN1-.mjs", import.meta.url).href),
|
|
8
8
|
exportName: "lineSetupPlugin"
|
|
9
9
|
}
|
|
10
10
|
});
|
|
@@ -8,7 +8,7 @@ This package contains type definitions for node (https://nodejs.org/).
|
|
|
8
8
|
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node/v24.
|
|
9
9
|
|
|
10
10
|
### Additional Details
|
|
11
|
-
* Last updated:
|
|
11
|
+
* Last updated: Fri, 09 Oct 2026 18:42:20 GMT
|
|
12
12
|
* Dependencies: [undici-types](https://npmjs.com/package/undici-types)
|
|
13
13
|
|
|
14
14
|
# Credits
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/node",
|
|
3
|
-
"version": "24.19.
|
|
3
|
+
"version": "24.19.2",
|
|
4
4
|
"description": "TypeScript definitions for node",
|
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
|
|
6
6
|
"license": "MIT",
|
|
@@ -135,6 +135,6 @@
|
|
|
135
135
|
"undici-types": ">=7.24.0 <7.24.7"
|
|
136
136
|
},
|
|
137
137
|
"peerDependencies": {},
|
|
138
|
-
"typesPublisherContentHash": "
|
|
138
|
+
"typesPublisherContentHash": "fbbbfd0b983273dbfc30bcb497b88333fe11caabe5b12057ad838da74e578ca0",
|
|
139
139
|
"typeScriptVersion": "5.6"
|
|
140
140
|
}
|
|
@@ -1292,11 +1292,14 @@ declare module "util" {
|
|
|
1292
1292
|
*
|
|
1293
1293
|
* // 3-digit hex color (shorthand)
|
|
1294
1294
|
* console.log(styleText('#f00', 'Red text'));
|
|
1295
|
+
*
|
|
1296
|
+
* // Hex color combined with other modifiers
|
|
1297
|
+
* console.log(styleText(['#00f', 'bold'], 'Bold blue text'));
|
|
1295
1298
|
* ```
|
|
1296
1299
|
*
|
|
1297
1300
|
* The full list of formats can be found in [modifiers](https://nodejs.org/docs/latest-v24.x/api/util.html#modifiers).
|
|
1298
|
-
* @param format A text format
|
|
1299
|
-
* or
|
|
1301
|
+
* @param format A text format defined in `util.inspect.colors`, a hex color in `#RGB` or `#RRGGBB` form,
|
|
1302
|
+
* or an Array of text formats and/or hex colors.
|
|
1300
1303
|
* @param text The text to to be formatted.
|
|
1301
1304
|
* @since v20.12.0
|
|
1302
1305
|
*/
|
|
@@ -1305,8 +1308,8 @@ declare module "util" {
|
|
|
1305
1308
|
| ForegroundColors
|
|
1306
1309
|
| BackgroundColors
|
|
1307
1310
|
| Modifiers
|
|
1308
|
-
|
|
|
1309
|
-
| `#${string}
|
|
1311
|
+
| `#${string}`
|
|
1312
|
+
| Array<ForegroundColors | BackgroundColors | Modifiers | `#${string}`>,
|
|
1310
1313
|
text: string,
|
|
1311
1314
|
options?: StyleTextOptions,
|
|
1312
1315
|
): string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Returns true if the value is a valid
|
|
3
|
-
* @specification https://
|
|
2
|
+
* Returns true if the value is a valid duration.
|
|
3
|
+
* @specification https://www.rfc-editor.org/rfc/rfc3339.html#appendix-A
|
|
4
4
|
*/
|
|
5
5
|
export declare function IsDuration(value: string): boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const Duration = /^P((\d+Y(\d+M(\d+D)?)?|\d+M(\d+D)?|\d+D)(T(\d+H(\d+M(\d+S)?)?|\d+M(\d+S)?|\d+S))?|T(\d+H(\d+M(\d+S)?)?|\d+M(\d+S)?|\d+S)|\d+W)$/;
|
|
2
2
|
/**
|
|
3
|
-
* Returns true if the value is a valid
|
|
4
|
-
* @specification https://
|
|
3
|
+
* Returns true if the value is a valid duration.
|
|
4
|
+
* @specification https://www.rfc-editor.org/rfc/rfc3339.html#appendix-A
|
|
5
5
|
*/
|
|
6
6
|
export function IsDuration(value) {
|
|
7
7
|
return Duration.test(value);
|
|
@@ -2,6 +2,7 @@ const IdnEmail = /^(?:[A-Za-z0-9!#$%&'*+\/=?^_`{|}~\u{0080}-\u{10FFFF}-]+(?:\.[A
|
|
|
2
2
|
/**
|
|
3
3
|
* Returns true if the value is an IdnEmail
|
|
4
4
|
* @specification https://datatracker.ietf.org/doc/html/rfc4952
|
|
5
|
+
* @specification https://datatracker.ietf.org/doc/html/rfc6531
|
|
5
6
|
*/
|
|
6
7
|
export function IsIdnEmail(value) {
|
|
7
8
|
return IdnEmail.test(value.normalize('NFC'));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Returns true if the value is a valid internationalized (IDN) hostname.
|
|
3
|
-
* @specification https://
|
|
3
|
+
* @specification https://datatracker.ietf.org/doc/html/rfc5890
|
|
4
4
|
* @specification https://tools.ietf.org/html/rfc5891
|
|
5
5
|
* @specification https://tools.ietf.org/html/rfc5892
|
|
6
6
|
* @specification https://tools.ietf.org/html/rfc5893
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as Idna from './idna/index.mjs';
|
|
2
2
|
/**
|
|
3
3
|
* Returns true if the value is a valid internationalized (IDN) hostname.
|
|
4
|
-
* @specification https://
|
|
4
|
+
* @specification https://datatracker.ietf.org/doc/html/rfc5890
|
|
5
5
|
* @specification https://tools.ietf.org/html/rfc5891
|
|
6
6
|
* @specification https://tools.ietf.org/html/rfc5892
|
|
7
7
|
* @specification https://tools.ietf.org/html/rfc5893
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Returns true if the value is
|
|
3
|
-
* @specification
|
|
2
|
+
* Returns true if the value is an IPv4 address
|
|
3
|
+
* @specification https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2
|
|
4
4
|
*/
|
|
5
5
|
export declare function IsIPv4(value: string): boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const IPv4 = /^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/;
|
|
2
2
|
/**
|
|
3
|
-
* Returns true if the value is
|
|
4
|
-
* @specification
|
|
3
|
+
* Returns true if the value is an IPv4 address
|
|
4
|
+
* @specification https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2
|
|
5
5
|
*/
|
|
6
6
|
export function IsIPv4(value) {
|
|
7
7
|
return IPv4.test(value);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const IPv6 = /^(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:)?[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)$/i;
|
|
2
2
|
/**
|
|
3
3
|
* Returns true if the value is an IPv6 address
|
|
4
|
-
* @specification
|
|
4
|
+
* @specification https://datatracker.ietf.org/doc/html/rfc4291#section-2.2
|
|
5
5
|
*/
|
|
6
6
|
export function IsIPv6(value) {
|
|
7
7
|
return IPv6.test(value);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Returns true if the value is a relative
|
|
3
|
-
* @specification https://datatracker.ietf.org/doc/html/
|
|
2
|
+
* Returns true if the value is a relative JSON Pointer
|
|
3
|
+
* @specification https://datatracker.ietf.org/doc/html/draft-handrews-relative-json-pointer/
|
|
4
4
|
* @source https://github.com/ajv-validator/ajv-formats
|
|
5
5
|
*/
|
|
6
6
|
export declare function IsRelativeJsonPointer(value: string): boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const RelativeJsonPointer = /^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;
|
|
2
2
|
/**
|
|
3
|
-
* Returns true if the value is a relative
|
|
4
|
-
* @specification https://datatracker.ietf.org/doc/html/
|
|
3
|
+
* Returns true if the value is a relative JSON Pointer
|
|
4
|
+
* @specification https://datatracker.ietf.org/doc/html/draft-handrews-relative-json-pointer/
|
|
5
5
|
* @source https://github.com/ajv-validator/ajv-formats
|
|
6
6
|
*/
|
|
7
7
|
export function IsRelativeJsonPointer(value) {
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
let index = 0;
|
|
2
|
-
/**
|
|
3
|
-
export function
|
|
4
|
-
return `
|
|
2
|
+
/** Creates a unique variable name */
|
|
3
|
+
export function CreateUnique() {
|
|
4
|
+
return `unique_${index++}`;
|
|
5
|
+
}
|
|
6
|
+
/** Resets the unique variable name counter */
|
|
7
|
+
export function ResetUnique() {
|
|
8
|
+
index = 0;
|
|
5
9
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// deno-fmt-ignore-file
|
|
2
2
|
import * as Schema from '../types/index.mjs';
|
|
3
|
-
import
|
|
3
|
+
import * as Unique from './_unique.mjs';
|
|
4
4
|
import { Guard as G, EmitGuard as E } from '../../guard/index.mjs';
|
|
5
5
|
import { BuildSchemaPushStack, CheckSchemaPushStack, ErrorSchemaPushStack } from './schema.mjs';
|
|
6
6
|
// ------------------------------------------------------------------
|
|
@@ -13,14 +13,14 @@ function IsValid(schema) {
|
|
|
13
13
|
// Build
|
|
14
14
|
// ------------------------------------------------------------------
|
|
15
15
|
function BuildAdditionalItemsStandard(stack, context, schema, value) {
|
|
16
|
-
const [item, index] = [Unique(), Unique()];
|
|
16
|
+
const [item, index] = [Unique.CreateUnique(), Unique.CreateUnique()];
|
|
17
17
|
const isSchema = BuildSchemaPushStack(stack, context, schema.additionalItems, item);
|
|
18
18
|
const isLength = E.IsLessThan(index, E.Constant(schema.items.length));
|
|
19
19
|
const addIndex = context.AddIndex(index);
|
|
20
20
|
return E.Every(value, E.Constant(0), [item, index], E.Or(isLength, E.And(isSchema, addIndex)));
|
|
21
21
|
}
|
|
22
22
|
function BuildAdditionalItemsFast(stack, context, schema, value) {
|
|
23
|
-
const [item, index] = [Unique(), Unique()];
|
|
23
|
+
const [item, index] = [Unique.CreateUnique(), Unique.CreateUnique()];
|
|
24
24
|
const isSchema = BuildSchemaPushStack(stack, context, schema.additionalItems, item);
|
|
25
25
|
const isLength = E.IsLessThan(index, E.Constant(schema.items.length));
|
|
26
26
|
return E.Every(value, E.Constant(0), [item, index], E.Or(isLength, isSchema));
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import * as Schema from '../types/index.mjs';
|
|
2
2
|
import * as Stack from './_stack.mjs';
|
|
3
3
|
import { BuildContext, CheckContext, ErrorContext } from './_context.mjs';
|
|
4
|
-
export declare function CanAdditionalPropertiesFast(_context: BuildContext, schema: Schema.XAdditionalProperties, _value: string): schema is Schema.XAdditionalProperties & Schema.XRequired;
|
|
5
|
-
export declare function BuildAdditionalPropertiesFast(_context: BuildContext, schema: Schema.XAdditionalProperties & Schema.XRequired, value: string): string;
|
|
6
|
-
export declare function BuildAdditionalPropertiesStandard(stack: Stack.XStack, context: BuildContext, schema: Schema.XAdditionalProperties, value: string): string;
|
|
7
4
|
export declare function BuildAdditionalProperties(stack: Stack.XStack, context: BuildContext, schema: Schema.XAdditionalProperties, value: string): string;
|
|
8
5
|
export declare function CheckAdditionalProperties(stack: Stack.XStack, context: CheckContext, schema: Schema.XAdditionalProperties, value: Record<PropertyKey, unknown>): boolean;
|
|
9
6
|
export declare function ErrorAdditionalProperties(stack: Stack.XStack, context: ErrorContext, schemaPath: string, instancePath: string, schema: Schema.XAdditionalProperties, value: Record<PropertyKey, unknown>): boolean;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// deno-fmt-ignore-file
|
|
2
2
|
import * as Schema from '../types/index.mjs';
|
|
3
|
+
import * as Unique from './_unique.mjs';
|
|
3
4
|
import * as Externals from './_externals.mjs';
|
|
4
5
|
import * as Pathing from './_pathing.mjs';
|
|
5
|
-
import { Unique } from './_unique.mjs';
|
|
6
6
|
import { UnicodeRegExp } from './_regexp.mjs';
|
|
7
7
|
import { EmitGuard as E, Guard as G } from '../../guard/index.mjs';
|
|
8
8
|
import { BuildSchemaPushStack, CheckSchemaPushStack, ErrorSchemaPushStack } from './schema.mjs';
|
|
@@ -42,35 +42,33 @@ function GetPropertiesPattern(schema) {
|
|
|
42
42
|
return G.IsEqual(patterns.length, 0) ? '(?!)' : `(${patterns.join('|')})`;
|
|
43
43
|
}
|
|
44
44
|
// ------------------------------------------------------------------
|
|
45
|
-
// BuildAdditionalPropertiesFast
|
|
45
|
+
// BuildAdditionalPropertiesFast (AdditionalProperties False)
|
|
46
46
|
//
|
|
47
|
-
//
|
|
48
|
-
//
|
|
49
|
-
//
|
|
50
|
-
// - `additionalProperties` is explicitly set to false,
|
|
51
|
-
// - the schema uses only `properties` (no `patternProperties`),
|
|
52
|
-
// - and all defined properties are required (i.e., no optional keys).
|
|
53
|
-
//
|
|
54
|
-
// This constraint is common when enforcing strict object shapes
|
|
55
|
-
// with only known, fixed keys. When all these conditions are met,
|
|
56
|
-
// we can generate a simplified and efficient runtime check.
|
|
47
|
+
// - AdditionalProperties is explicitly set to false,
|
|
48
|
+
// - The schema uses only Properties (no PatternProperties),
|
|
49
|
+
// - Required contains exactly the keys in Properties.
|
|
57
50
|
//
|
|
58
51
|
// ------------------------------------------------------------------
|
|
59
|
-
|
|
52
|
+
function HasExactRequiredProperties(schema) {
|
|
53
|
+
const keys = G.Keys(schema.properties);
|
|
54
|
+
return G.IsEqual(keys.length, schema.required.length)
|
|
55
|
+
&& G.Every(keys, 0, (key) => schema.required.includes(key));
|
|
56
|
+
}
|
|
57
|
+
function CanAdditionalPropertiesFast(_context, schema, _value) {
|
|
60
58
|
return Schema.IsRequired(schema)
|
|
61
59
|
&& Schema.IsProperties(schema)
|
|
62
60
|
&& !Schema.IsPatternProperties(schema)
|
|
63
61
|
&& G.IsEqual(schema.additionalProperties, false)
|
|
64
|
-
&&
|
|
62
|
+
&& HasExactRequiredProperties(schema);
|
|
65
63
|
}
|
|
66
|
-
|
|
64
|
+
function BuildAdditionalPropertiesFast(_context, schema, value) {
|
|
67
65
|
return E.IsEqual(E.Member(E.Call(E.Member('Object', 'getOwnPropertyNames'), [value]), 'length'), E.Constant(schema.required.length));
|
|
68
66
|
}
|
|
69
67
|
// ------------------------------------------------------------------
|
|
70
68
|
// BuildAdditionalPropertiesStandard
|
|
71
69
|
// ------------------------------------------------------------------
|
|
72
|
-
|
|
73
|
-
const [key, _index] = [Unique(), Unique()];
|
|
70
|
+
function BuildAdditionalPropertiesStandard(stack, context, schema, value) {
|
|
71
|
+
const [key, _index] = [Unique.CreateUnique(), Unique.CreateUnique()];
|
|
74
72
|
const regexp = Externals.CreateVariable(UnicodeRegExp(GetPropertiesPattern(schema)));
|
|
75
73
|
const isSchema = BuildSchemaPushStack(stack, context, schema.additionalProperties, `${value}[${key}]`);
|
|
76
74
|
const isKey = E.Call(E.Member(regexp, 'test'), [key]);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// deno-fmt-ignore-file
|
|
2
2
|
import * as Schema from '../types/index.mjs';
|
|
3
|
-
import
|
|
3
|
+
import * as Unique from './_unique.mjs';
|
|
4
4
|
import { EmitGuard as E, Guard as G } from '../../guard/index.mjs';
|
|
5
5
|
import { BuildSchema, CheckSchema } from './schema.mjs';
|
|
6
6
|
// ------------------------------------------------------------------
|
|
@@ -13,13 +13,13 @@ function IsValid(schema) {
|
|
|
13
13
|
// Build
|
|
14
14
|
// ------------------------------------------------------------------
|
|
15
15
|
function BuildContainsStandard(stack, context, schema, value) {
|
|
16
|
-
const [item, index] = [Unique(), Unique()];
|
|
16
|
+
const [item, index] = [Unique.CreateUnique(), Unique.CreateUnique()];
|
|
17
17
|
const isLength = E.Not(E.IsEqual(E.Member(value, 'length'), E.Constant(0)));
|
|
18
18
|
const isSome = E.SomeAll(value, [item, index], E.And(BuildSchema(stack, context, schema.contains, item), context.AddIndex(index)));
|
|
19
19
|
return E.And(isLength, isSome);
|
|
20
20
|
}
|
|
21
21
|
function BuildContainsFast(stack, context, schema, value) {
|
|
22
|
-
const [item] = [Unique()];
|
|
22
|
+
const [item] = [Unique.CreateUnique()];
|
|
23
23
|
const isLength = E.Not(E.IsEqual(E.Member(value, 'length'), E.Constant(0)));
|
|
24
24
|
const isSome = E.Some(value, [item, '_'], BuildSchema(stack, context, schema.contains, item));
|
|
25
25
|
return E.And(isLength, isSome);
|
|
@@ -4,6 +4,7 @@ export * from './_functions.mjs';
|
|
|
4
4
|
export * from './_reducer.mjs';
|
|
5
5
|
export * from './_refine.mjs';
|
|
6
6
|
export * from './_stack.mjs';
|
|
7
|
+
export * from './_unique.mjs';
|
|
7
8
|
export * from './additionalItems.mjs';
|
|
8
9
|
export * from './additionalProperties.mjs';
|
|
9
10
|
export * from './allOf.mjs';
|
|
@@ -7,6 +7,7 @@ export * from './_functions.mjs';
|
|
|
7
7
|
export * from './_reducer.mjs';
|
|
8
8
|
export * from './_refine.mjs';
|
|
9
9
|
export * from './_stack.mjs';
|
|
10
|
+
export * from './_unique.mjs';
|
|
10
11
|
// ------------------------------------------------------------------
|
|
11
12
|
// Schematics
|
|
12
13
|
// ------------------------------------------------------------------
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// deno-fmt-ignore-file
|
|
2
2
|
import * as Schema from '../types/index.mjs';
|
|
3
|
+
import * as Unique from './_unique.mjs';
|
|
3
4
|
import { BuildSchemaPushStack, CheckSchemaPushStack, ErrorSchemaPushStack } from './schema.mjs';
|
|
4
5
|
import { Guard as G, EmitGuard as E } from '../../guard/index.mjs';
|
|
5
6
|
// ------------------------------------------------------------------
|
|
@@ -44,14 +45,16 @@ function ErrorItemsSized(stack, context, schemaPath, instancePath, schema, value
|
|
|
44
45
|
// ------------------------------------------------------------------
|
|
45
46
|
function BuildItemsUnsizedStandard(stack, context, schema, value) {
|
|
46
47
|
const offset = Schema.IsPrefixItems(schema) ? schema.prefixItems.length : 0;
|
|
47
|
-
const
|
|
48
|
+
const [item] = [Unique.CreateUnique()];
|
|
49
|
+
const isSchema = BuildSchemaPushStack(stack, context, schema.items, item);
|
|
48
50
|
const addIndex = context.AddIndex('index');
|
|
49
|
-
return E.Every(value, E.Constant(offset), [
|
|
51
|
+
return E.Every(value, E.Constant(offset), [item, 'index'], E.And(isSchema, addIndex));
|
|
50
52
|
}
|
|
51
53
|
function BuildItemsUnsizedFast(stack, context, schema, value) {
|
|
52
54
|
const offset = Schema.IsPrefixItems(schema) ? schema.prefixItems.length : 0;
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
+
const [item] = [Unique.CreateUnique()];
|
|
56
|
+
const isSchema = BuildSchemaPushStack(stack, context, schema.items, item);
|
|
57
|
+
return E.Every(value, E.Constant(offset), [item, 'index'], isSchema);
|
|
55
58
|
}
|
|
56
59
|
function BuildItemsUnsized(stack, context, schema, value) {
|
|
57
60
|
return context.UseUnevaluated()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// deno-fmt-ignore-file
|
|
2
2
|
import * as Schema from '../types/index.mjs';
|
|
3
|
-
import
|
|
3
|
+
import * as Unique from './_unique.mjs';
|
|
4
4
|
import { Guard as G, EmitGuard as E } from '../../guard/index.mjs';
|
|
5
5
|
import { BuildSchema, CheckSchema } from './schema.mjs';
|
|
6
6
|
// ------------------------------------------------------------------
|
|
@@ -15,7 +15,7 @@ function IsValid(schema) {
|
|
|
15
15
|
export function BuildMaxContains(stack, context, schema, value) {
|
|
16
16
|
if (!IsValid(schema))
|
|
17
17
|
return E.Constant(true);
|
|
18
|
-
const [item] = [Unique()];
|
|
18
|
+
const [item] = [Unique.CreateUnique()];
|
|
19
19
|
const count = E.Counted(value, [item, '_'], BuildSchema(stack, context, schema.contains, item));
|
|
20
20
|
return E.IsLessEqualThan(count, E.Constant(schema.maxContains));
|
|
21
21
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// deno-fmt-ignore-file
|
|
2
2
|
import * as Schema from '../types/index.mjs';
|
|
3
|
-
import
|
|
3
|
+
import * as Unique from './_unique.mjs';
|
|
4
4
|
import { Guard as G, EmitGuard as E } from '../../guard/index.mjs';
|
|
5
5
|
import { BuildSchema, CheckSchema } from './schema.mjs';
|
|
6
6
|
// ------------------------------------------------------------------
|
|
@@ -13,12 +13,12 @@ function IsValid(schema) {
|
|
|
13
13
|
// Build
|
|
14
14
|
// ------------------------------------------------------------------
|
|
15
15
|
function BuildMinContainsStandard(stack, context, schema, value) {
|
|
16
|
-
const [item, index] = [Unique(), Unique()];
|
|
16
|
+
const [item, index] = [Unique.CreateUnique(), Unique.CreateUnique()];
|
|
17
17
|
const count = E.Counted(value, [item, index], E.And(BuildSchema(stack, context, schema.contains, item), context.AddIndex(index)));
|
|
18
18
|
return E.IsGreaterEqualThan(count, E.Constant(schema.minContains));
|
|
19
19
|
}
|
|
20
20
|
function BuildMinContainsFast(stack, context, schema, value) {
|
|
21
|
-
const [item] = [Unique()];
|
|
21
|
+
const [item] = [Unique.CreateUnique()];
|
|
22
22
|
const count = E.Counted(value, [item, '_'], BuildSchema(stack, context, schema.contains, item));
|
|
23
23
|
return E.IsGreaterEqualThan(count, E.Constant(schema.minContains));
|
|
24
24
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// deno-fmt-ignore-file
|
|
2
2
|
import { Reducer } from './_reducer.mjs';
|
|
3
|
-
import
|
|
3
|
+
import * as Unique from './_unique.mjs';
|
|
4
4
|
import { CheckContext, ErrorContext } from './_context.mjs';
|
|
5
5
|
import { BuildSchema, CheckSchema, ErrorSchema } from './schema.mjs';
|
|
6
6
|
import { EmitGuard as E, Guard as G } from '../../guard/index.mjs';
|
|
@@ -11,7 +11,7 @@ function BuildOneOfStandard(stack, context, schema, value) {
|
|
|
11
11
|
return Reducer(stack, context, schema.oneOf, value, E.IsEqual(E.Member('results', 'length'), E.Constant(1)));
|
|
12
12
|
}
|
|
13
13
|
function BuildOneOfFast(stack, context, schema, value) {
|
|
14
|
-
const [result] = [Unique()];
|
|
14
|
+
const [result] = [Unique.CreateUnique()];
|
|
15
15
|
const results = E.ArrayLiteral(schema.oneOf.map((schema) => BuildSchema(stack, context, schema, value)));
|
|
16
16
|
const count = E.Counted(results, [result, '_'], E.IsEqual(result, E.Constant(true)));
|
|
17
17
|
return E.IsEqual(count, E.Constant(1));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// deno-fmt-ignore-file
|
|
2
|
+
import * as Unique from './_unique.mjs';
|
|
2
3
|
import * as Externals from './_externals.mjs';
|
|
3
4
|
import * as Pathing from './_pathing.mjs';
|
|
4
|
-
import { Unique } from './_unique.mjs';
|
|
5
5
|
import { UnicodeRegExp } from './_regexp.mjs';
|
|
6
6
|
import { BuildSchemaPushStack, CheckSchemaPushStack, ErrorSchemaPushStack } from './schema.mjs';
|
|
7
7
|
import { Guard as G, EmitGuard as E } from '../../guard/index.mjs';
|
|
@@ -10,7 +10,7 @@ import { Guard as G, EmitGuard as E } from '../../guard/index.mjs';
|
|
|
10
10
|
// ------------------------------------------------------------------
|
|
11
11
|
export function BuildPatternProperties(stack, context, schema, value) {
|
|
12
12
|
return E.ReduceAnd(G.Entries(schema.patternProperties).map(([pattern, schema]) => {
|
|
13
|
-
const [key, prop] = [Unique(), Unique()];
|
|
13
|
+
const [key, prop] = [Unique.CreateUnique(), Unique.CreateUnique()];
|
|
14
14
|
const regexp = Externals.CreateVariable(UnicodeRegExp(pattern));
|
|
15
15
|
const notKey = E.Not(E.Call(E.Member(regexp, 'test'), [key]));
|
|
16
16
|
const isSchema = BuildSchemaPushStack(stack, context, schema, prop);
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// deno-fmt-ignore-file
|
|
2
2
|
import * as Pathing from './_pathing.mjs';
|
|
3
|
-
import
|
|
3
|
+
import * as Unique from './_unique.mjs';
|
|
4
4
|
import { BuildSchema, CheckSchema, ErrorSchema } from './schema.mjs';
|
|
5
5
|
import { EmitGuard as E, Guard as G } from '../../guard/index.mjs';
|
|
6
6
|
// ------------------------------------------------------------------
|
|
7
7
|
// Build
|
|
8
8
|
// ------------------------------------------------------------------
|
|
9
9
|
export function BuildPropertyNames(stack, context, schema, value) {
|
|
10
|
-
const [key, _index] = [Unique(), Unique()];
|
|
10
|
+
const [key, _index] = [Unique.CreateUnique(), Unique.CreateUnique()];
|
|
11
11
|
return E.Every(E.Keys(value), E.Constant(0), [key, _index], BuildSchema(stack, context, schema.propertyNames, key));
|
|
12
12
|
}
|
|
13
13
|
// ------------------------------------------------------------------
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// deno-fmt-ignore-file
|
|
2
|
-
import
|
|
2
|
+
import * as Unique from './_unique.mjs';
|
|
3
3
|
import { ErrorContext } from './_context.mjs';
|
|
4
4
|
import { BuildSchema, CheckSchema, ErrorSchema } from './schema.mjs';
|
|
5
5
|
import { Guard as G, EmitGuard as E } from '../../guard/index.mjs';
|
|
@@ -7,7 +7,7 @@ import { Guard as G, EmitGuard as E } from '../../guard/index.mjs';
|
|
|
7
7
|
// Build
|
|
8
8
|
// ------------------------------------------------------------------
|
|
9
9
|
export function BuildUnevaluatedItems(stack, context, schema, value) {
|
|
10
|
-
const [index, item] = [Unique(), Unique()];
|
|
10
|
+
const [index, item] = [Unique.CreateUnique(), Unique.CreateUnique()];
|
|
11
11
|
const indices = E.Call(E.Member('context', 'GetIndices'), []);
|
|
12
12
|
const hasIndex = E.Call(E.Member('indices', 'has'), [index]);
|
|
13
13
|
const isSchema = BuildSchema(stack, context, schema.unevaluatedItems, item);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// deno-fmt-ignore-file
|
|
2
|
-
import
|
|
2
|
+
import * as Unique from './_unique.mjs';
|
|
3
3
|
import { ErrorContext } from './_context.mjs';
|
|
4
4
|
import { BuildSchema, CheckSchema, ErrorSchema } from './schema.mjs';
|
|
5
5
|
import { Guard as G, EmitGuard as E } from '../../guard/index.mjs';
|
|
@@ -7,7 +7,7 @@ import { Guard as G, EmitGuard as E } from '../../guard/index.mjs';
|
|
|
7
7
|
// Build
|
|
8
8
|
// ------------------------------------------------------------------
|
|
9
9
|
export function BuildUnevaluatedProperties(stack, context, schema, value) {
|
|
10
|
-
const [key, prop] = [Unique(), Unique()];
|
|
10
|
+
const [key, prop] = [Unique.CreateUnique(), Unique.CreateUnique()];
|
|
11
11
|
const keys = E.Call(E.Member('context', 'GetKeys'), []);
|
|
12
12
|
const hasKey = E.Call(E.Member('keys', 'has'), [key]);
|
|
13
13
|
const addKey = E.Call(E.Member('context', 'AddKey'), [key]);
|