pi-proactive 0.2.0-beta.2 → 0.2.0-beta.3
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/CHANGELOG.md +29 -0
- package/README.md +32 -28
- package/build/cli.mjs +121 -0
- package/build/extensions/proactive.js +47 -6
- package/build/src/commands.js +78 -2
- package/build/src/config.js +511 -4
- package/build/src/daemon-config.js +221 -0
- package/build/src/daemon-contact.js +103 -0
- package/build/src/daemon-host.js +84 -0
- package/build/src/daemon.js +193 -3
- package/build/src/health.js +84 -0
- package/build/src/lineage.js +41 -2
- package/build/src/notify.js +183 -0
- package/build/src/progress-eta.js +134 -0
- package/build/src/trigger.js +43 -0
- package/build/src/trust-loop.js +321 -0
- package/build/src/trust-metrics.js +236 -0
- package/build/src/trust-notify.js +73 -0
- package/build/src/trust-policy.js +58 -0
- package/build/src/trust-registry.js +323 -0
- package/daemon/launchd.plist +48 -0
- package/daemon/pi-proactive-daemon.service +29 -0
- package/daemon/run-daemon.sh +84 -0
- package/node_modules/typebox/build/compile/code.mjs +2 -1
- package/node_modules/typebox/build/compile/validator.mjs +1 -5
- package/node_modules/typebox/build/format/date_time.d.mts +1 -2
- package/node_modules/typebox/build/format/date_time.mjs +3 -12
- 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 +0 -1
- package/node_modules/typebox/build/format/idn_email.mjs +0 -1
- 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/iri.mjs +9 -16
- 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/guard/emit.mjs +2 -2
- package/node_modules/typebox/build/guard/guard.d.mts +5 -7
- package/node_modules/typebox/build/guard/guard.mjs +9 -14
- package/node_modules/typebox/build/guard/index.mjs +0 -6
- package/node_modules/typebox/build/guard/{unicode/unicode_segment.mjs → string.mjs} +19 -16
- package/node_modules/typebox/build/schema/build.mjs +5 -5
- package/node_modules/typebox/build/schema/check.mjs +1 -1
- package/node_modules/typebox/build/schema/engine/_context.d.mts +1 -5
- package/node_modules/typebox/build/schema/engine/_context.mjs +3 -16
- package/node_modules/typebox/build/schema/engine/_functions.d.mts +2 -2
- package/node_modules/typebox/build/schema/engine/_functions.mjs +1 -1
- package/node_modules/typebox/build/schema/engine/_reducer.d.mts +3 -3
- package/node_modules/typebox/build/schema/engine/_refine.d.mts +5 -5
- package/node_modules/typebox/build/schema/engine/_refine.mjs +9 -14
- package/node_modules/typebox/build/schema/engine/_stack.d.mts +20 -34
- package/node_modules/typebox/build/schema/engine/_stack.mjs +202 -143
- package/node_modules/typebox/build/schema/engine/_unique.d.mts +2 -4
- package/node_modules/typebox/build/schema/engine/_unique.mjs +3 -7
- package/node_modules/typebox/build/schema/engine/additionalItems.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/additionalItems.mjs +3 -3
- package/node_modules/typebox/build/schema/engine/additionalProperties.d.mts +8 -5
- package/node_modules/typebox/build/schema/engine/additionalProperties.mjs +32 -27
- package/node_modules/typebox/build/schema/engine/allOf.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/allOf.mjs +1 -1
- package/node_modules/typebox/build/schema/engine/anyOf.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/anyOf.mjs +9 -4
- package/node_modules/typebox/build/schema/engine/boolean.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/boolean.mjs +6 -2
- package/node_modules/typebox/build/schema/engine/const.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/const.mjs +6 -2
- package/node_modules/typebox/build/schema/engine/contains.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/contains.mjs +9 -5
- package/node_modules/typebox/build/schema/engine/dependencies.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/dependencies.mjs +7 -5
- package/node_modules/typebox/build/schema/engine/dependentRequired.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/dependentRequired.mjs +6 -2
- package/node_modules/typebox/build/schema/engine/dependentSchemas.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/dependentSchemas.mjs +1 -2
- package/node_modules/typebox/build/schema/engine/dynamicRef.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/dynamicRef.mjs +8 -12
- package/node_modules/typebox/build/schema/engine/enum.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/enum.mjs +6 -2
- package/node_modules/typebox/build/schema/engine/exclusiveMaximum.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/exclusiveMaximum.mjs +6 -2
- package/node_modules/typebox/build/schema/engine/exclusiveMinimum.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/exclusiveMinimum.mjs +6 -2
- package/node_modules/typebox/build/schema/engine/format.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/format.mjs +8 -11
- package/node_modules/typebox/build/schema/engine/if.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/if.mjs +13 -5
- package/node_modules/typebox/build/schema/engine/index.d.mts +0 -1
- package/node_modules/typebox/build/schema/engine/index.mjs +0 -1
- package/node_modules/typebox/build/schema/engine/items.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/items.mjs +5 -8
- package/node_modules/typebox/build/schema/engine/maxContains.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/maxContains.mjs +8 -4
- package/node_modules/typebox/build/schema/engine/maxItems.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/maxItems.mjs +6 -2
- package/node_modules/typebox/build/schema/engine/maxLength.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/maxLength.mjs +6 -2
- package/node_modules/typebox/build/schema/engine/maxProperties.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/maxProperties.mjs +6 -2
- package/node_modules/typebox/build/schema/engine/maximum.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/maximum.mjs +6 -2
- package/node_modules/typebox/build/schema/engine/minContains.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/minContains.mjs +9 -5
- package/node_modules/typebox/build/schema/engine/minItems.d.mts +5 -5
- package/node_modules/typebox/build/schema/engine/minItems.mjs +6 -2
- package/node_modules/typebox/build/schema/engine/minLength.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/minLength.mjs +6 -2
- package/node_modules/typebox/build/schema/engine/minProperties.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/minProperties.mjs +6 -2
- package/node_modules/typebox/build/schema/engine/minimum.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/minimum.mjs +6 -2
- package/node_modules/typebox/build/schema/engine/multipleOf.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/multipleOf.mjs +6 -2
- package/node_modules/typebox/build/schema/engine/not.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/not.mjs +8 -4
- package/node_modules/typebox/build/schema/engine/oneOf.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/oneOf.mjs +11 -6
- package/node_modules/typebox/build/schema/engine/pattern.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/pattern.mjs +7 -3
- package/node_modules/typebox/build/schema/engine/patternProperties.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/patternProperties.mjs +5 -6
- package/node_modules/typebox/build/schema/engine/prefixItems.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/prefixItems.mjs +1 -1
- package/node_modules/typebox/build/schema/engine/properties.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/properties.mjs +3 -4
- package/node_modules/typebox/build/schema/engine/propertyNames.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/propertyNames.mjs +10 -7
- package/node_modules/typebox/build/schema/engine/recursiveRef.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/recursiveRef.mjs +8 -12
- package/node_modules/typebox/build/schema/engine/ref.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/ref.mjs +14 -18
- package/node_modules/typebox/build/schema/engine/required.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/required.mjs +6 -2
- package/node_modules/typebox/build/schema/engine/schema.d.mts +7 -7
- package/node_modules/typebox/build/schema/engine/schema.mjs +138 -136
- package/node_modules/typebox/build/schema/engine/type.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/type.mjs +6 -2
- package/node_modules/typebox/build/schema/engine/unevaluatedItems.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/unevaluatedItems.mjs +9 -5
- package/node_modules/typebox/build/schema/engine/unevaluatedProperties.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/unevaluatedProperties.mjs +9 -5
- package/node_modules/typebox/build/schema/engine/uniqueItems.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/uniqueItems.mjs +6 -2
- package/node_modules/typebox/build/schema/errors.mjs +1 -1
- package/node_modules/typebox/build/schema/intern/intern.d.mts +9 -6
- package/node_modules/typebox/build/schema/intern/intern.mjs +56 -90
- package/node_modules/typebox/build/schema/parse.mjs +0 -3
- package/node_modules/typebox/build/schema/pointer/pointer.d.mts +6 -1
- package/node_modules/typebox/build/schema/pointer/pointer.mjs +64 -47
- package/node_modules/typebox/build/schema/resolve/resolve.d.mts +32 -6
- package/node_modules/typebox/build/schema/resolve/resolve.mjs +227 -231
- package/node_modules/typebox/build/schema/schema.d.mts +0 -1
- package/node_modules/typebox/build/schema/schema.mjs +0 -1
- package/node_modules/typebox/build/system/hashing/hash.mjs +34 -63
- package/node_modules/typebox/build/system/locale/en_US.mjs +1 -2
- package/node_modules/typebox/build/system/memory/assign.d.mts +8 -2
- package/node_modules/typebox/build/system/memory/assign.mjs +6 -13
- package/node_modules/typebox/build/system/memory/clone.d.mts +5 -4
- package/node_modules/typebox/build/system/memory/clone.mjs +96 -8
- package/node_modules/typebox/build/system/memory/create.d.mts +5 -1
- package/node_modules/typebox/build/system/memory/create.mjs +13 -18
- package/node_modules/typebox/build/system/memory/discard.d.mts +1 -1
- package/node_modules/typebox/build/system/memory/discard.mjs +8 -9
- package/node_modules/typebox/build/system/memory/freeze.d.mts +4 -0
- package/node_modules/typebox/build/system/memory/freeze.mjs +6 -0
- package/node_modules/typebox/build/system/memory/update.d.mts +4 -1
- package/node_modules/typebox/build/system/memory/update.mjs +16 -43
- package/node_modules/typebox/build/system/settings/settings.d.mts +0 -11
- package/node_modules/typebox/build/system/settings/settings.mjs +0 -14
- package/node_modules/typebox/build/type/engine/evaluate/composite.d.mts +24 -2
- package/node_modules/typebox/build/type/engine/evaluate/composite.mjs +29 -2
- package/node_modules/typebox/build/type/engine/evaluate/index.d.mts +0 -1
- package/node_modules/typebox/build/type/engine/evaluate/index.mjs +0 -1
- package/node_modules/typebox/build/type/engine/evaluate/narrow.d.mts +1 -5
- package/node_modules/typebox/build/type/engine/evaluate/narrow.mjs +1 -6
- package/node_modules/typebox/build/type/engine/immutable/instantiate_add.d.mts +3 -1
- package/node_modules/typebox/build/type/engine/immutable/instantiate_add.mjs +4 -1
- 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 +3 -1
- package/node_modules/typebox/build/type/engine/optional/instantiate_add.mjs +4 -1
- package/node_modules/typebox/build/type/engine/readonly/instantiate_add.d.mts +3 -1
- package/node_modules/typebox/build/type/engine/readonly/instantiate_add.mjs +4 -1
- package/node_modules/typebox/build/type/extends/inference.d.mts +1 -1
- package/node_modules/typebox/build/type/extends/inference.mjs +2 -15
- package/node_modules/typebox/build/type/extends/tuple.d.mts +1 -2
- package/node_modules/typebox/build/type/extends/tuple.mjs +1 -21
- package/node_modules/typebox/build/value/clean/from_object.mjs +1 -1
- package/node_modules/typebox/build/value/clone/clone.d.mts +3 -4
- package/node_modules/typebox/build/value/clone/clone.mjs +7 -5
- package/node_modules/typebox/build/value/parse/parse.mjs +4 -10
- package/node_modules/typebox/build/value/shared/union_priority_sort.mjs +14 -25
- package/node_modules/typebox/package.json +1 -1
- package/node_modules/typebox/readme.md +84 -52
- package/package.json +11 -3
- package/skills/pi-proactive/SKILL.md +27 -24
- package/tools/cli.mjs +121 -0
- package/tools/daemon-install.sh +397 -0
- package/tools/daemon-uninstall.sh +226 -0
- package/node_modules/typebox/build/guard/unicode/unicode.d.mts +0 -6
- package/node_modules/typebox/build/guard/unicode/unicode.mjs +0 -35
- package/node_modules/typebox/build/schema/engine/_pathing.d.mts +0 -1
- package/node_modules/typebox/build/schema/engine/_pathing.mjs +0 -11
- package/node_modules/typebox/build/schema/meta/draft_2019_09.d.mts +0 -2
- package/node_modules/typebox/build/schema/meta/draft_2019_09.mjs +0 -288
- package/node_modules/typebox/build/schema/meta/draft_2020_12.d.mts +0 -2
- package/node_modules/typebox/build/schema/meta/draft_2020_12.mjs +0 -300
- package/node_modules/typebox/build/schema/meta/draft_3.d.mts +0 -2
- package/node_modules/typebox/build/schema/meta/draft_3.mjs +0 -143
- package/node_modules/typebox/build/schema/meta/draft_4.d.mts +0 -2
- package/node_modules/typebox/build/schema/meta/draft_4.mjs +0 -149
- package/node_modules/typebox/build/schema/meta/draft_6.d.mts +0 -2
- package/node_modules/typebox/build/schema/meta/draft_6.mjs +0 -155
- package/node_modules/typebox/build/schema/meta/draft_7.d.mts +0 -2
- package/node_modules/typebox/build/schema/meta/draft_7.mjs +0 -172
- package/node_modules/typebox/build/schema/meta/index.d.mts +0 -2
- package/node_modules/typebox/build/schema/meta/index.mjs +0 -2
- package/node_modules/typebox/build/schema/meta/meta.d.mts +0 -9
- package/node_modules/typebox/build/schema/meta/meta.mjs +0 -15
- package/node_modules/typebox/build/schema/meta/schema.d.mts +0 -6
- package/node_modules/typebox/build/schema/meta/schema.mjs +0 -1
- package/node_modules/typebox/build/system/memory/deep.d.mts +0 -2
- package/node_modules/typebox/build/system/memory/deep.mjs +0 -108
- package/node_modules/typebox/build/system/memory/finalize.d.mts +0 -4
- package/node_modules/typebox/build/system/memory/finalize.mjs +0 -30
- package/node_modules/typebox/build/system/memory/keys.d.mts +0 -2
- package/node_modules/typebox/build/system/memory/keys.mjs +0 -8
- package/node_modules/typebox/build/system/settings/internal.d.mts +0 -2
- package/node_modules/typebox/build/system/settings/internal.mjs +0 -20
- package/node_modules/typebox/build/type/engine/call/index.d.mts +0 -1
- package/node_modules/typebox/build/type/engine/call/index.mjs +0 -1
- package/node_modules/typebox/build/type/engine/evaluate/property.d.mts +0 -30
- package/node_modules/typebox/build/type/engine/evaluate/property.mjs +0 -29
- package/node_modules/typebox/build/type/engine/this/index.d.mts +0 -1
- package/node_modules/typebox/build/type/engine/this/index.mjs +0 -1
- package/node_modules/typebox/build/value/repair/from_cyclic.d.mts +0 -2
- package/node_modules/typebox/build/value/repair/from_cyclic.mjs +0 -6
- /package/node_modules/typebox/build/guard/{unicode/unicode_segment.d.mts → string.d.mts} +0 -0
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
// deno-fmt-ignore-file
|
|
2
2
|
import * as Schema from '../types/index.mjs';
|
|
3
|
-
import
|
|
3
|
+
import { Guard as G, EmitGuard as E } from '../../guard/index.mjs';
|
|
4
4
|
import { BuildSchemaPushStack, CheckSchemaPushStack, ErrorSchemaPushStack } from './schema.mjs';
|
|
5
5
|
import { InexactOptionalCheck, InexactOptionalBuild, IsExactOptional } from './_exact_optional.mjs';
|
|
6
|
-
import { Guard as G, EmitGuard as E } from '../../guard/index.mjs';
|
|
7
6
|
// ------------------------------------------------------------------
|
|
8
7
|
// Build
|
|
9
8
|
// ------------------------------------------------------------------
|
|
@@ -64,8 +63,8 @@ export function CheckProperties(stack, context, schema, value) {
|
|
|
64
63
|
export function ErrorProperties(stack, context, schemaPath, instancePath, schema, value) {
|
|
65
64
|
const required = Schema.IsRequired(schema) ? schema.required : [];
|
|
66
65
|
const isProperties = G.EveryAll(G.Entries(schema.properties), 0, ([key, schema]) => {
|
|
67
|
-
const nextSchemaPath = `${schemaPath}/properties/${
|
|
68
|
-
const nextInstancePath = `${instancePath}/${
|
|
66
|
+
const nextSchemaPath = `${schemaPath}/properties/${key}`;
|
|
67
|
+
const nextInstancePath = `${instancePath}/${key}`;
|
|
69
68
|
// Defer error generation for IsExactOptional
|
|
70
69
|
const isProperty = () => (!G.HasPropertyKey(value, key) || (ErrorSchemaPushStack(stack, context, nextSchemaPath, nextInstancePath, schema, value[key]) && context.AddKey(key)));
|
|
71
70
|
return IsExactOptional(required, key)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as Schema from '../types/index.mjs';
|
|
2
|
-
import
|
|
2
|
+
import { Stack } from './_stack.mjs';
|
|
3
3
|
import { BuildContext, CheckContext, ErrorContext } from './_context.mjs';
|
|
4
|
-
export declare function BuildPropertyNames(stack: Stack
|
|
5
|
-
export declare function CheckPropertyNames(stack: Stack
|
|
6
|
-
export declare function ErrorPropertyNames(stack: Stack
|
|
4
|
+
export declare function BuildPropertyNames(stack: Stack, context: BuildContext, schema: Schema.XPropertyNames, value: string): string;
|
|
5
|
+
export declare function CheckPropertyNames(stack: Stack, context: CheckContext, schema: Schema.XPropertyNames, value: Record<PropertyKey, unknown>): boolean;
|
|
6
|
+
export declare function ErrorPropertyNames(stack: Stack, context: ErrorContext, schemaPath: string, instancePath: string, schema: Schema.XPropertyNames, value: Record<PropertyKey, unknown>): boolean;
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
// deno-fmt-ignore-file
|
|
2
|
-
import
|
|
3
|
-
import * as Unique from './_unique.mjs';
|
|
4
|
-
import { BuildSchema, CheckSchema, ErrorSchema } from './schema.mjs';
|
|
2
|
+
import { Unique } from './_unique.mjs';
|
|
5
3
|
import { EmitGuard as E, Guard as G } from '../../guard/index.mjs';
|
|
4
|
+
import { BuildSchema, CheckSchema, ErrorSchema } from './schema.mjs';
|
|
6
5
|
// ------------------------------------------------------------------
|
|
7
6
|
// Build
|
|
8
7
|
// ------------------------------------------------------------------
|
|
9
8
|
export function BuildPropertyNames(stack, context, schema, value) {
|
|
10
|
-
const [key, _index] = [Unique
|
|
9
|
+
const [key, _index] = [Unique(), Unique()];
|
|
11
10
|
return E.Every(E.Keys(value), E.Constant(0), [key, _index], BuildSchema(stack, context, schema.propertyNames, key));
|
|
12
11
|
}
|
|
13
12
|
// ------------------------------------------------------------------
|
|
@@ -22,13 +21,17 @@ export function CheckPropertyNames(stack, context, schema, value) {
|
|
|
22
21
|
export function ErrorPropertyNames(stack, context, schemaPath, instancePath, schema, value) {
|
|
23
22
|
const propertyNames = [];
|
|
24
23
|
const isPropertyNames = G.EveryAll(G.Keys(value), 0, (key, _index) => {
|
|
25
|
-
const nextInstancePath = `${instancePath}/${
|
|
24
|
+
const nextInstancePath = `${instancePath}/${key}`;
|
|
26
25
|
const nextSchemaPath = `${schemaPath}/propertyNames`;
|
|
27
26
|
const isPropertyName = ErrorSchema(stack, context, nextSchemaPath, nextInstancePath, schema.propertyNames, key);
|
|
28
27
|
if (!isPropertyName)
|
|
29
28
|
propertyNames.push(key);
|
|
30
29
|
return isPropertyName;
|
|
31
30
|
});
|
|
32
|
-
return isPropertyNames ||
|
|
33
|
-
|
|
31
|
+
return isPropertyNames || context.AddError({
|
|
32
|
+
keyword: 'propertyNames',
|
|
33
|
+
schemaPath,
|
|
34
|
+
instancePath,
|
|
35
|
+
params: { propertyNames }
|
|
36
|
+
});
|
|
34
37
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as Schema from '../types/index.mjs';
|
|
2
|
-
import
|
|
2
|
+
import { Stack } from './_stack.mjs';
|
|
3
3
|
import { BuildContext, CheckContext, ErrorContext } from './_context.mjs';
|
|
4
|
-
export declare function BuildRecursiveRef(stack: Stack
|
|
5
|
-
export declare function CheckRecursiveRef(stack: Stack
|
|
6
|
-
export declare function ErrorRecursiveRef(stack: Stack
|
|
4
|
+
export declare function BuildRecursiveRef(stack: Stack, context: BuildContext, schema: Schema.XRecursiveRef, value: string): string;
|
|
5
|
+
export declare function CheckRecursiveRef(stack: Stack, context: CheckContext, schema: Schema.XRecursiveRef, value: unknown): boolean;
|
|
6
|
+
export declare function ErrorRecursiveRef(stack: Stack, context: ErrorContext, _schemaPath: string, instancePath: string, schema: Schema.XRecursiveRef, value: unknown): boolean;
|
|
@@ -1,29 +1,25 @@
|
|
|
1
1
|
// deno-fmt-ignore-file
|
|
2
|
-
import * as Schema from '../types/index.mjs';
|
|
3
2
|
import * as Functions from './_functions.mjs';
|
|
4
|
-
import
|
|
3
|
+
import * as Schema from '../types/index.mjs';
|
|
5
4
|
import { CheckSchema, ErrorSchema } from './schema.mjs';
|
|
6
5
|
// ------------------------------------------------------------------
|
|
7
6
|
// Build
|
|
8
7
|
// ------------------------------------------------------------------
|
|
9
8
|
export function BuildRecursiveRef(stack, context, schema, value) {
|
|
10
|
-
const target =
|
|
11
|
-
|
|
12
|
-
return Functions.CreateFunction(nextStack, context, target, value);
|
|
9
|
+
const target = stack.RecursiveRef(schema) ?? false;
|
|
10
|
+
return Functions.CreateFunction(stack, context, target, value);
|
|
13
11
|
}
|
|
14
12
|
// ------------------------------------------------------------------
|
|
15
13
|
// Check
|
|
16
14
|
// ------------------------------------------------------------------
|
|
17
15
|
export function CheckRecursiveRef(stack, context, schema, value) {
|
|
18
|
-
const target =
|
|
19
|
-
|
|
20
|
-
return (Schema.IsSchema(target) && CheckSchema(nextStack, context, target, value));
|
|
16
|
+
const target = stack.RecursiveRef(schema) ?? false;
|
|
17
|
+
return (Schema.IsSchema(target) && CheckSchema(stack, context, target, value));
|
|
21
18
|
}
|
|
22
19
|
// ------------------------------------------------------------------
|
|
23
20
|
// Error
|
|
24
21
|
// ------------------------------------------------------------------
|
|
25
|
-
export function ErrorRecursiveRef(stack, context,
|
|
26
|
-
const target =
|
|
27
|
-
|
|
28
|
-
return (Schema.IsSchema(target) && ErrorSchema(nextStack, context, schemaPath, instancePath, target, value));
|
|
22
|
+
export function ErrorRecursiveRef(stack, context, _schemaPath, instancePath, schema, value) {
|
|
23
|
+
const target = stack.RecursiveRef(schema) ?? false;
|
|
24
|
+
return (Schema.IsSchema(target) && ErrorSchema(stack, context, '#', instancePath, target, value));
|
|
29
25
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as Schema from '../types/index.mjs';
|
|
2
|
-
import
|
|
2
|
+
import { Stack } from './_stack.mjs';
|
|
3
3
|
import { BuildContext, CheckContext, ErrorContext } from './_context.mjs';
|
|
4
|
-
export declare function BuildRef(stack: Stack
|
|
5
|
-
export declare function CheckRef(stack: Stack
|
|
6
|
-
export declare function ErrorRef(stack: Stack
|
|
4
|
+
export declare function BuildRef(stack: Stack, context: BuildContext, schema: Schema.XRef, value: string): string;
|
|
5
|
+
export declare function CheckRef(stack: Stack, context: CheckContext, schema: Schema.XRef, value: unknown): boolean;
|
|
6
|
+
export declare function ErrorRef(stack: Stack, context: ErrorContext, _schemaPath: string, instancePath: string, schema: Schema.XRef, value: unknown): boolean;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
// deno-fmt-ignore-file
|
|
2
2
|
import * as Functions from './_functions.mjs';
|
|
3
3
|
import * as Schema from '../types/index.mjs';
|
|
4
|
-
import { Resolve } from '../resolve/index.mjs';
|
|
5
4
|
import { CheckContext, ErrorContext } from './_context.mjs';
|
|
6
5
|
import { EmitGuard as E } from '../../guard/index.mjs';
|
|
7
6
|
import { CheckSchema, ErrorSchema } from './schema.mjs';
|
|
@@ -22,35 +21,32 @@ function BuildRefFast(stack, context, target, value) {
|
|
|
22
21
|
return Functions.CreateFunction(stack, context, target, value);
|
|
23
22
|
}
|
|
24
23
|
export function BuildRef(stack, context, schema, value) {
|
|
25
|
-
const
|
|
26
|
-
const target = result.schema ?? false;
|
|
24
|
+
const target = stack.Ref(schema) ?? false;
|
|
27
25
|
return context.UseUnevaluated()
|
|
28
|
-
? BuildRefStandard(
|
|
29
|
-
: BuildRefFast(
|
|
26
|
+
? BuildRefStandard(stack, context, target, value)
|
|
27
|
+
: BuildRefFast(stack, context, target, value);
|
|
30
28
|
}
|
|
31
29
|
// ------------------------------------------------------------------
|
|
32
30
|
// Check
|
|
33
31
|
// ------------------------------------------------------------------
|
|
34
32
|
export function CheckRef(stack, context, schema, value) {
|
|
35
|
-
const
|
|
36
|
-
const target = result.schema ?? false;
|
|
33
|
+
const target = stack.Ref(schema) ?? false;
|
|
37
34
|
const nextContext = new CheckContext();
|
|
38
|
-
const
|
|
39
|
-
if (
|
|
35
|
+
const result = (Schema.IsSchema(target) && CheckSchema(stack, nextContext, target, value));
|
|
36
|
+
if (result)
|
|
40
37
|
context.Merge([nextContext]);
|
|
41
|
-
return
|
|
38
|
+
return result;
|
|
42
39
|
}
|
|
43
40
|
// ------------------------------------------------------------------
|
|
44
41
|
// Error
|
|
45
42
|
// ------------------------------------------------------------------
|
|
46
|
-
export function ErrorRef(stack, context,
|
|
47
|
-
const
|
|
48
|
-
const target = result.schema ?? false;
|
|
43
|
+
export function ErrorRef(stack, context, _schemaPath, instancePath, schema, value) {
|
|
44
|
+
const target = stack.Ref(schema) ?? false;
|
|
49
45
|
const nextContext = new ErrorContext();
|
|
50
|
-
const
|
|
51
|
-
if (
|
|
46
|
+
const result = (Schema.IsSchema(target) && ErrorSchema(stack, nextContext, '#', instancePath, target, value));
|
|
47
|
+
if (result)
|
|
52
48
|
context.Merge([nextContext]);
|
|
53
|
-
if (!
|
|
54
|
-
|
|
55
|
-
return
|
|
49
|
+
if (!result)
|
|
50
|
+
nextContext.GetErrors().forEach(error => context.AddError(error));
|
|
51
|
+
return result;
|
|
56
52
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as Schema from '../types/index.mjs';
|
|
2
|
-
import
|
|
2
|
+
import { Stack } from './_stack.mjs';
|
|
3
3
|
import { BuildContext, CheckContext, ErrorContext } from './_context.mjs';
|
|
4
|
-
export declare function BuildRequired(_stack: Stack
|
|
5
|
-
export declare function CheckRequired(_stack: Stack
|
|
6
|
-
export declare function ErrorRequired(_stack: Stack
|
|
4
|
+
export declare function BuildRequired(_stack: Stack, _context: BuildContext, schema: Schema.XRequired, value: string): string;
|
|
5
|
+
export declare function CheckRequired(_stack: Stack, _context: CheckContext, schema: Schema.XRequired, value: Record<PropertyKey, unknown>): boolean;
|
|
6
|
+
export declare function ErrorRequired(_stack: Stack, context: ErrorContext, schemaPath: string, instancePath: string, schema: Schema.XRequired, value: Record<PropertyKey, unknown>): boolean;
|
|
@@ -23,6 +23,10 @@ export function ErrorRequired(_stack, context, schemaPath, instancePath, schema,
|
|
|
23
23
|
requiredProperties.push(key);
|
|
24
24
|
return hasKey;
|
|
25
25
|
});
|
|
26
|
-
return isRequired ||
|
|
27
|
-
|
|
26
|
+
return isRequired || context.AddError({
|
|
27
|
+
keyword: 'required',
|
|
28
|
+
schemaPath,
|
|
29
|
+
instancePath,
|
|
30
|
+
params: { requiredProperties }
|
|
31
|
+
});
|
|
28
32
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as Schema from '../types/index.mjs';
|
|
2
|
+
import { Stack } from './_stack.mjs';
|
|
2
3
|
import { BuildContext, CheckContext, ErrorContext } from './_context.mjs';
|
|
3
|
-
|
|
4
|
-
export declare function
|
|
5
|
-
export declare function
|
|
6
|
-
export declare function
|
|
7
|
-
export declare function
|
|
8
|
-
export declare function
|
|
9
|
-
export declare function ErrorSchema(stack: Stack.XStack, context: ErrorContext, schemaPath: string, instancePath: string, schema: Schema.XSchema, value: unknown): boolean;
|
|
4
|
+
export declare function BuildSchemaPushStack(stack: Stack, context: BuildContext, schema: Schema.XSchema, value: string): string;
|
|
5
|
+
export declare function BuildSchema(stack: Stack, context: BuildContext, schema: Schema.XSchema, value: string): string;
|
|
6
|
+
export declare function CheckSchemaPushStack(stack: Stack, context: CheckContext, schema: Schema.XSchema, value: unknown): boolean;
|
|
7
|
+
export declare function CheckSchema(stack: Stack, context: CheckContext, schema: Schema.XSchema, value: unknown): boolean;
|
|
8
|
+
export declare function ErrorSchemaPushStack(stack: Stack, context: ErrorContext, schemaPath: string, instancePath: string, schema: Schema.XSchema, value: unknown): boolean;
|
|
9
|
+
export declare function ErrorSchema(stack: Stack, context: ErrorContext, schemaPath: string, instancePath: string, schema: Schema.XSchema, value: unknown): boolean;
|