@blade-hq/agent-client 1.1.1 → 1.1.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/README.md +48 -25
- package/dist/blade-client.d.ts +2 -14
- package/dist/index.d.ts +5 -2
- package/dist/index.js +212 -106
- package/dist/index.js.map +1 -1
- package/dist/resources/models.d.ts +15 -0
- package/dist/resources/sessions.d.ts +8 -1
- package/dist/session/agent-session.d.ts +10 -0
- package/dist/session/definition.d.ts +49 -0
- package/dist/shared/projection/helpers.d.ts +1 -1
- package/dist/types/rest.d.ts +378 -10
- package/dist/version.d.ts +4 -42
- package/node_modules/@ark/schema/LICENSE +7 -0
- package/node_modules/@ark/schema/README.md +18 -0
- package/node_modules/@ark/schema/out/config.d.ts +58 -0
- package/node_modules/@ark/schema/out/config.js +95 -0
- package/node_modules/@ark/schema/out/constraint.d.ts +67 -0
- package/node_modules/@ark/schema/out/constraint.js +136 -0
- package/node_modules/@ark/schema/out/generic.d.ts +73 -0
- package/node_modules/@ark/schema/out/generic.js +76 -0
- package/node_modules/@ark/schema/out/index.d.ts +47 -0
- package/node_modules/@ark/schema/out/index.js +47 -0
- package/node_modules/@ark/schema/out/intrinsic.d.ts +24 -0
- package/node_modules/@ark/schema/out/intrinsic.js +56 -0
- package/node_modules/@ark/schema/out/kinds.d.ts +73 -0
- package/node_modules/@ark/schema/out/kinds.js +71 -0
- package/node_modules/@ark/schema/out/module.d.ts +24 -0
- package/node_modules/@ark/schema/out/module.js +15 -0
- package/node_modules/@ark/schema/out/node.d.ts +154 -0
- package/node_modules/@ark/schema/out/node.js +438 -0
- package/node_modules/@ark/schema/out/parse.d.ts +52 -0
- package/node_modules/@ark/schema/out/parse.js +215 -0
- package/node_modules/@ark/schema/out/predicate.d.ts +52 -0
- package/node_modules/@ark/schema/out/predicate.js +63 -0
- package/node_modules/@ark/schema/out/refinements/after.d.ts +41 -0
- package/node_modules/@ark/schema/out/refinements/after.js +35 -0
- package/node_modules/@ark/schema/out/refinements/before.d.ts +41 -0
- package/node_modules/@ark/schema/out/refinements/before.js +41 -0
- package/node_modules/@ark/schema/out/refinements/divisor.d.ts +43 -0
- package/node_modules/@ark/schema/out/refinements/divisor.js +58 -0
- package/node_modules/@ark/schema/out/refinements/exactLength.d.ts +49 -0
- package/node_modules/@ark/schema/out/refinements/exactLength.js +55 -0
- package/node_modules/@ark/schema/out/refinements/kinds.d.ts +34 -0
- package/node_modules/@ark/schema/out/refinements/kinds.js +25 -0
- package/node_modules/@ark/schema/out/refinements/max.d.ts +37 -0
- package/node_modules/@ark/schema/out/refinements/max.js +45 -0
- package/node_modules/@ark/schema/out/refinements/maxLength.d.ts +40 -0
- package/node_modules/@ark/schema/out/refinements/maxLength.js +49 -0
- package/node_modules/@ark/schema/out/refinements/min.d.ts +37 -0
- package/node_modules/@ark/schema/out/refinements/min.js +39 -0
- package/node_modules/@ark/schema/out/refinements/minLength.d.ts +40 -0
- package/node_modules/@ark/schema/out/refinements/minLength.js +47 -0
- package/node_modules/@ark/schema/out/refinements/pattern.d.ts +43 -0
- package/node_modules/@ark/schema/out/refinements/pattern.js +52 -0
- package/node_modules/@ark/schema/out/refinements/range.d.ts +106 -0
- package/node_modules/@ark/schema/out/refinements/range.js +103 -0
- package/node_modules/@ark/schema/out/roots/alias.d.ts +45 -0
- package/node_modules/@ark/schema/out/roots/alias.js +115 -0
- package/node_modules/@ark/schema/out/roots/basis.d.ts +12 -0
- package/node_modules/@ark/schema/out/roots/basis.js +26 -0
- package/node_modules/@ark/schema/out/roots/domain.d.ts +45 -0
- package/node_modules/@ark/schema/out/roots/domain.js +72 -0
- package/node_modules/@ark/schema/out/roots/intersection.d.ts +98 -0
- package/node_modules/@ark/schema/out/roots/intersection.js +292 -0
- package/node_modules/@ark/schema/out/roots/morph.d.ts +62 -0
- package/node_modules/@ark/schema/out/roots/morph.js +159 -0
- package/node_modules/@ark/schema/out/roots/proto.d.ts +53 -0
- package/node_modules/@ark/schema/out/roots/proto.js +101 -0
- package/node_modules/@ark/schema/out/roots/root.d.ts +145 -0
- package/node_modules/@ark/schema/out/roots/root.js +455 -0
- package/node_modules/@ark/schema/out/roots/union.d.ts +99 -0
- package/node_modules/@ark/schema/out/roots/union.js +718 -0
- package/node_modules/@ark/schema/out/roots/unit.d.ts +41 -0
- package/node_modules/@ark/schema/out/roots/unit.js +86 -0
- package/node_modules/@ark/schema/out/roots/utils.d.ts +3 -0
- package/node_modules/@ark/schema/out/roots/utils.js +6 -0
- package/node_modules/@ark/schema/out/scope.d.ts +158 -0
- package/node_modules/@ark/schema/out/scope.js +481 -0
- package/node_modules/@ark/schema/out/shared/compile.d.ts +62 -0
- package/node_modules/@ark/schema/out/shared/compile.js +145 -0
- package/node_modules/@ark/schema/out/shared/declare.d.ts +80 -0
- package/node_modules/@ark/schema/out/shared/declare.js +1 -0
- package/node_modules/@ark/schema/out/shared/disjoint.d.ts +41 -0
- package/node_modules/@ark/schema/out/shared/disjoint.js +65 -0
- package/node_modules/@ark/schema/out/shared/errors.d.ts +145 -0
- package/node_modules/@ark/schema/out/shared/errors.js +252 -0
- package/node_modules/@ark/schema/out/shared/implement.d.ts +151 -0
- package/node_modules/@ark/schema/out/shared/implement.js +98 -0
- package/node_modules/@ark/schema/out/shared/intersections.d.ts +10 -0
- package/node_modules/@ark/schema/out/shared/intersections.js +132 -0
- package/node_modules/@ark/schema/out/shared/jsonSchema.d.ts +93 -0
- package/node_modules/@ark/schema/out/shared/jsonSchema.js +1 -0
- package/node_modules/@ark/schema/out/shared/registry.d.ts +7 -0
- package/node_modules/@ark/schema/out/shared/registry.js +10 -0
- package/node_modules/@ark/schema/out/shared/standardSchema.d.ts +122 -0
- package/node_modules/@ark/schema/out/shared/standardSchema.js +2 -0
- package/node_modules/@ark/schema/out/shared/toJsonSchema.d.ts +139 -0
- package/node_modules/@ark/schema/out/shared/toJsonSchema.js +40 -0
- package/node_modules/@ark/schema/out/shared/traversal.d.ts +117 -0
- package/node_modules/@ark/schema/out/shared/traversal.js +226 -0
- package/node_modules/@ark/schema/out/shared/utils.d.ts +34 -0
- package/node_modules/@ark/schema/out/shared/utils.js +8 -0
- package/node_modules/@ark/schema/out/structure/index.d.ts +46 -0
- package/node_modules/@ark/schema/out/structure/index.js +89 -0
- package/node_modules/@ark/schema/out/structure/optional.d.ts +49 -0
- package/node_modules/@ark/schema/out/structure/optional.js +127 -0
- package/node_modules/@ark/schema/out/structure/prop.d.ts +45 -0
- package/node_modules/@ark/schema/out/structure/prop.js +85 -0
- package/node_modules/@ark/schema/out/structure/required.d.ts +39 -0
- package/node_modules/@ark/schema/out/structure/required.js +38 -0
- package/node_modules/@ark/schema/out/structure/sequence.d.ts +110 -0
- package/node_modules/@ark/schema/out/structure/sequence.js +521 -0
- package/node_modules/@ark/schema/out/structure/shared.d.ts +4 -0
- package/node_modules/@ark/schema/out/structure/shared.js +4 -0
- package/node_modules/@ark/schema/out/structure/structure.d.ts +113 -0
- package/node_modules/@ark/schema/out/structure/structure.js +747 -0
- package/node_modules/@ark/schema/package.json +51 -0
- package/node_modules/@ark/util/LICENSE +7 -0
- package/node_modules/@ark/util/out/arrays.d.ts +166 -0
- package/node_modules/@ark/util/out/arrays.js +147 -0
- package/node_modules/@ark/util/out/clone.d.ts +4 -0
- package/node_modules/@ark/util/out/clone.js +33 -0
- package/node_modules/@ark/util/out/describe.d.ts +25 -0
- package/node_modules/@ark/util/out/describe.js +1 -0
- package/node_modules/@ark/util/out/domain.d.ts +48 -0
- package/node_modules/@ark/util/out/domain.js +25 -0
- package/node_modules/@ark/util/out/errors.d.ts +29 -0
- package/node_modules/@ark/util/out/errors.js +17 -0
- package/node_modules/@ark/util/out/flatMorph.d.ts +41 -0
- package/node_modules/@ark/util/out/flatMorph.js +24 -0
- package/node_modules/@ark/util/out/functions.d.ts +33 -0
- package/node_modules/@ark/util/out/functions.js +53 -0
- package/node_modules/@ark/util/out/generics.d.ts +59 -0
- package/node_modules/@ark/util/out/generics.js +5 -0
- package/node_modules/@ark/util/out/get.d.ts +9 -0
- package/node_modules/@ark/util/out/get.js +7 -0
- package/node_modules/@ark/util/out/hkt.d.ts +27 -0
- package/node_modules/@ark/util/out/hkt.js +5 -0
- package/node_modules/@ark/util/out/index.d.ts +24 -0
- package/node_modules/@ark/util/out/index.js +24 -0
- package/node_modules/@ark/util/out/intersections.d.ts +50 -0
- package/node_modules/@ark/util/out/intersections.js +1 -0
- package/node_modules/@ark/util/out/isomorphic.d.ts +5 -0
- package/node_modules/@ark/util/out/isomorphic.js +19 -0
- package/node_modules/@ark/util/out/keys.d.ts +18 -0
- package/node_modules/@ark/util/out/keys.js +1 -0
- package/node_modules/@ark/util/out/lazily.d.ts +1 -0
- package/node_modules/@ark/util/out/lazily.js +16 -0
- package/node_modules/@ark/util/out/numbers.d.ts +72 -0
- package/node_modules/@ark/util/out/numbers.js +138 -0
- package/node_modules/@ark/util/out/objectKinds.d.ts +205 -0
- package/node_modules/@ark/util/out/objectKinds.js +150 -0
- package/node_modules/@ark/util/out/path.d.ts +22 -0
- package/node_modules/@ark/util/out/path.js +65 -0
- package/node_modules/@ark/util/out/primitive.d.ts +16 -0
- package/node_modules/@ark/util/out/primitive.js +3 -0
- package/node_modules/@ark/util/out/records.d.ts +183 -0
- package/node_modules/@ark/util/out/records.js +63 -0
- package/node_modules/@ark/util/out/registry.d.ts +21 -0
- package/node_modules/@ark/util/out/registry.js +49 -0
- package/node_modules/@ark/util/out/scanner.d.ts +44 -0
- package/node_modules/@ark/util/out/scanner.js +87 -0
- package/node_modules/@ark/util/out/serialize.d.ts +34 -0
- package/node_modules/@ark/util/out/serialize.js +150 -0
- package/node_modules/@ark/util/out/strings.d.ts +33 -0
- package/node_modules/@ark/util/out/strings.js +59 -0
- package/node_modules/@ark/util/out/traits.d.ts +89 -0
- package/node_modules/@ark/util/out/traits.js +75 -0
- package/node_modules/@ark/util/out/unionToTuple.d.ts +14 -0
- package/node_modules/@ark/util/out/unionToTuple.js +1 -0
- package/node_modules/@ark/util/package.json +39 -0
- package/node_modules/@ark/util/tsconfig.base.json +18 -0
- package/node_modules/@socket.io/component-emitter/LICENSE +24 -0
- package/node_modules/@socket.io/component-emitter/Readme.md +79 -0
- package/node_modules/@socket.io/component-emitter/lib/cjs/index.d.ts +179 -0
- package/node_modules/@socket.io/component-emitter/lib/cjs/index.js +176 -0
- package/node_modules/@socket.io/component-emitter/lib/cjs/package.json +4 -0
- package/node_modules/@socket.io/component-emitter/lib/esm/index.d.ts +179 -0
- package/node_modules/@socket.io/component-emitter/lib/esm/index.js +169 -0
- package/node_modules/@socket.io/component-emitter/lib/esm/package.json +4 -0
- package/node_modules/@socket.io/component-emitter/package.json +28 -0
- package/node_modules/arkregex/LICENSE +7 -0
- package/node_modules/arkregex/README.md +61 -0
- package/node_modules/arkregex/out/charset.d.ts +15 -0
- package/node_modules/arkregex/out/charset.js +1 -0
- package/node_modules/arkregex/out/escape.d.ts +29 -0
- package/node_modules/arkregex/out/escape.js +10 -0
- package/node_modules/arkregex/out/execArray.d.ts +23 -0
- package/node_modules/arkregex/out/execArray.js +1 -0
- package/node_modules/arkregex/out/group.d.ts +33 -0
- package/node_modules/arkregex/out/group.js +6 -0
- package/node_modules/arkregex/out/index.d.ts +1 -0
- package/node_modules/arkregex/out/index.js +1 -0
- package/node_modules/arkregex/out/parse.d.ts +10 -0
- package/node_modules/arkregex/out/parse.js +1 -0
- package/node_modules/arkregex/out/quantify.d.ts +43 -0
- package/node_modules/arkregex/out/quantify.js +2 -0
- package/node_modules/arkregex/out/regex.d.ts +38 -0
- package/node_modules/arkregex/out/regex.js +2 -0
- package/node_modules/arkregex/out/state.d.ts +359 -0
- package/node_modules/arkregex/out/state.js +2 -0
- package/node_modules/arkregex/package.json +42 -0
- package/node_modules/arktype/LICENSE +7 -0
- package/node_modules/arktype/README.md +157 -0
- package/node_modules/arktype/out/attributes.d.ts +104 -0
- package/node_modules/arktype/out/attributes.js +3 -0
- package/node_modules/arktype/out/config.d.ts +35 -0
- package/node_modules/arktype/out/config.js +3 -0
- package/node_modules/arktype/out/declare.d.ts +35 -0
- package/node_modules/arktype/out/declare.js +1 -0
- package/node_modules/arktype/out/fn.d.ts +61 -0
- package/node_modules/arktype/out/fn.js +54 -0
- package/node_modules/arktype/out/generic.d.ts +118 -0
- package/node_modules/arktype/out/generic.js +37 -0
- package/node_modules/arktype/out/index.d.ts +12 -0
- package/node_modules/arktype/out/index.js +9 -0
- package/node_modules/arktype/out/keywords/Array.d.ts +20 -0
- package/node_modules/arktype/out/keywords/Array.js +21 -0
- package/node_modules/arktype/out/keywords/FormData.d.ts +15 -0
- package/node_modules/arktype/out/keywords/FormData.js +40 -0
- package/node_modules/arktype/out/keywords/TypedArray.d.ts +19 -0
- package/node_modules/arktype/out/keywords/TypedArray.js +16 -0
- package/node_modules/arktype/out/keywords/builtins.d.ts +18 -0
- package/node_modules/arktype/out/keywords/builtins.js +11 -0
- package/node_modules/arktype/out/keywords/constructors.d.ts +31 -0
- package/node_modules/arktype/out/keywords/constructors.js +16 -0
- package/node_modules/arktype/out/keywords/keywords.d.ts +70 -0
- package/node_modules/arktype/out/keywords/keywords.js +48 -0
- package/node_modules/arktype/out/keywords/number.d.ts +23 -0
- package/node_modules/arktype/out/keywords/number.js +49 -0
- package/node_modules/arktype/out/keywords/string.d.ts +334 -0
- package/node_modules/arktype/out/keywords/string.js +463 -0
- package/node_modules/arktype/out/keywords/ts.d.ts +108 -0
- package/node_modules/arktype/out/keywords/ts.js +82 -0
- package/node_modules/arktype/out/match.d.ts +152 -0
- package/node_modules/arktype/out/match.js +95 -0
- package/node_modules/arktype/out/module.d.ts +22 -0
- package/node_modules/arktype/out/module.js +3 -0
- package/node_modules/arktype/out/nary.d.ts +473 -0
- package/node_modules/arktype/out/nary.js +1 -0
- package/node_modules/arktype/out/parser/ast/bounds.d.ts +18 -0
- package/node_modules/arktype/out/parser/ast/bounds.js +1 -0
- package/node_modules/arktype/out/parser/ast/default.d.ts +8 -0
- package/node_modules/arktype/out/parser/ast/default.js +1 -0
- package/node_modules/arktype/out/parser/ast/divisor.d.ts +9 -0
- package/node_modules/arktype/out/parser/ast/divisor.js +1 -0
- package/node_modules/arktype/out/parser/ast/generic.d.ts +17 -0
- package/node_modules/arktype/out/parser/ast/generic.js +1 -0
- package/node_modules/arktype/out/parser/ast/infer.d.ts +25 -0
- package/node_modules/arktype/out/parser/ast/infer.js +1 -0
- package/node_modules/arktype/out/parser/ast/keyof.d.ts +7 -0
- package/node_modules/arktype/out/parser/ast/keyof.js +1 -0
- package/node_modules/arktype/out/parser/ast/utils.d.ts +8 -0
- package/node_modules/arktype/out/parser/ast/utils.js +1 -0
- package/node_modules/arktype/out/parser/ast/validate.d.ts +30 -0
- package/node_modules/arktype/out/parser/ast/validate.js +3 -0
- package/node_modules/arktype/out/parser/definition.d.ts +30 -0
- package/node_modules/arktype/out/parser/definition.js +74 -0
- package/node_modules/arktype/out/parser/objectLiteral.d.ts +70 -0
- package/node_modules/arktype/out/parser/objectLiteral.js +113 -0
- package/node_modules/arktype/out/parser/property.d.ts +34 -0
- package/node_modules/arktype/out/parser/property.js +16 -0
- package/node_modules/arktype/out/parser/reduce/dynamic.d.ts +42 -0
- package/node_modules/arktype/out/parser/reduce/dynamic.js +153 -0
- package/node_modules/arktype/out/parser/reduce/shared.d.ts +39 -0
- package/node_modules/arktype/out/parser/reduce/shared.js +25 -0
- package/node_modules/arktype/out/parser/reduce/static.d.ts +186 -0
- package/node_modules/arktype/out/parser/reduce/static.js +1 -0
- package/node_modules/arktype/out/parser/shift/operand/date.d.ts +11 -0
- package/node_modules/arktype/out/parser/shift/operand/date.js +23 -0
- package/node_modules/arktype/out/parser/shift/operand/enclosed.d.ts +57 -0
- package/node_modules/arktype/out/parser/shift/operand/enclosed.js +78 -0
- package/node_modules/arktype/out/parser/shift/operand/genericArgs.d.ts +27 -0
- package/node_modules/arktype/out/parser/shift/operand/genericArgs.js +16 -0
- package/node_modules/arktype/out/parser/shift/operand/operand.d.ts +8 -0
- package/node_modules/arktype/out/parser/shift/operand/operand.js +16 -0
- package/node_modules/arktype/out/parser/shift/operand/unenclosed.d.ts +43 -0
- package/node_modules/arktype/out/parser/shift/operand/unenclosed.js +59 -0
- package/node_modules/arktype/out/parser/shift/operator/bounds.d.ts +24 -0
- package/node_modules/arktype/out/parser/shift/operator/bounds.js +91 -0
- package/node_modules/arktype/out/parser/shift/operator/brand.d.ts +7 -0
- package/node_modules/arktype/out/parser/shift/operator/brand.js +6 -0
- package/node_modules/arktype/out/parser/shift/operator/default.d.ts +24 -0
- package/node_modules/arktype/out/parser/shift/operator/default.js +15 -0
- package/node_modules/arktype/out/parser/shift/operator/divisor.d.ts +8 -0
- package/node_modules/arktype/out/parser/shift/operator/divisor.js +13 -0
- package/node_modules/arktype/out/parser/shift/operator/operator.d.ts +14 -0
- package/node_modules/arktype/out/parser/shift/operator/operator.js +28 -0
- package/node_modules/arktype/out/parser/shift/tokens.d.ts +33 -0
- package/node_modules/arktype/out/parser/shift/tokens.js +37 -0
- package/node_modules/arktype/out/parser/string.d.ts +30 -0
- package/node_modules/arktype/out/parser/string.js +42 -0
- package/node_modules/arktype/out/parser/tupleExpressions.d.ts +79 -0
- package/node_modules/arktype/out/parser/tupleExpressions.js +75 -0
- package/node_modules/arktype/out/parser/tupleLiteral.d.ts +95 -0
- package/node_modules/arktype/out/parser/tupleLiteral.js +128 -0
- package/node_modules/arktype/out/scope.d.ts +158 -0
- package/node_modules/arktype/out/scope.js +106 -0
- package/node_modules/arktype/out/type.d.ts +144 -0
- package/node_modules/arktype/out/type.js +55 -0
- package/node_modules/arktype/out/variants/array.d.ts +12 -0
- package/node_modules/arktype/out/variants/array.js +1 -0
- package/node_modules/arktype/out/variants/base.d.ts +542 -0
- package/node_modules/arktype/out/variants/base.js +1 -0
- package/node_modules/arktype/out/variants/date.d.ts +10 -0
- package/node_modules/arktype/out/variants/date.js +1 -0
- package/node_modules/arktype/out/variants/instantiate.d.ts +12 -0
- package/node_modules/arktype/out/variants/instantiate.js +1 -0
- package/node_modules/arktype/out/variants/number.d.ts +11 -0
- package/node_modules/arktype/out/variants/number.js +1 -0
- package/node_modules/arktype/out/variants/object.d.ts +107 -0
- package/node_modules/arktype/out/variants/object.js +1 -0
- package/node_modules/arktype/out/variants/string.d.ts +15 -0
- package/node_modules/arktype/out/variants/string.js +1 -0
- package/node_modules/arktype/package.json +57 -0
- package/node_modules/debug/LICENSE +20 -0
- package/node_modules/debug/README.md +481 -0
- package/node_modules/debug/package.json +64 -0
- package/node_modules/debug/src/browser.js +272 -0
- package/node_modules/debug/src/common.js +292 -0
- package/node_modules/debug/src/index.js +10 -0
- package/node_modules/debug/src/node.js +263 -0
- package/node_modules/engine.io-client/LICENSE +22 -0
- package/node_modules/engine.io-client/README.md +331 -0
- package/node_modules/engine.io-client/build/cjs/browser-entrypoint.d.ts +3 -0
- package/node_modules/engine.io-client/build/cjs/browser-entrypoint.js +4 -0
- package/node_modules/engine.io-client/build/cjs/contrib/has-cors.d.ts +1 -0
- package/node_modules/engine.io-client/build/cjs/contrib/has-cors.js +14 -0
- package/node_modules/engine.io-client/build/cjs/contrib/parseqs.d.ts +15 -0
- package/node_modules/engine.io-client/build/cjs/contrib/parseqs.js +38 -0
- package/node_modules/engine.io-client/build/cjs/contrib/parseuri.d.ts +1 -0
- package/node_modules/engine.io-client/build/cjs/contrib/parseuri.js +67 -0
- package/node_modules/engine.io-client/build/cjs/globals.d.ts +4 -0
- package/node_modules/engine.io-client/build/cjs/globals.js +26 -0
- package/node_modules/engine.io-client/build/cjs/globals.node.d.ts +21 -0
- package/node_modules/engine.io-client/build/cjs/globals.node.js +97 -0
- package/node_modules/engine.io-client/build/cjs/index.d.ts +15 -0
- package/node_modules/engine.io-client/build/cjs/index.js +32 -0
- package/node_modules/engine.io-client/build/cjs/package.json +10 -0
- package/node_modules/engine.io-client/build/cjs/socket.d.ts +482 -0
- package/node_modules/engine.io-client/build/cjs/socket.js +765 -0
- package/node_modules/engine.io-client/build/cjs/transport.d.ts +106 -0
- package/node_modules/engine.io-client/build/cjs/transport.js +153 -0
- package/node_modules/engine.io-client/build/cjs/transports/index.d.ts +8 -0
- package/node_modules/engine.io-client/build/cjs/transports/index.js +11 -0
- package/node_modules/engine.io-client/build/cjs/transports/polling-fetch.d.ts +15 -0
- package/node_modules/engine.io-client/build/cjs/transports/polling-fetch.js +60 -0
- package/node_modules/engine.io-client/build/cjs/transports/polling-xhr.d.ts +108 -0
- package/node_modules/engine.io-client/build/cjs/transports/polling-xhr.js +285 -0
- package/node_modules/engine.io-client/build/cjs/transports/polling-xhr.node.d.ts +11 -0
- package/node_modules/engine.io-client/build/cjs/transports/polling-xhr.node.js +44 -0
- package/node_modules/engine.io-client/build/cjs/transports/polling.d.ts +52 -0
- package/node_modules/engine.io-client/build/cjs/transports/polling.js +165 -0
- package/node_modules/engine.io-client/build/cjs/transports/websocket.d.ts +36 -0
- package/node_modules/engine.io-client/build/cjs/transports/websocket.js +136 -0
- package/node_modules/engine.io-client/build/cjs/transports/websocket.node.d.ts +14 -0
- package/node_modules/engine.io-client/build/cjs/transports/websocket.node.js +68 -0
- package/node_modules/engine.io-client/build/cjs/transports/webtransport.d.ts +18 -0
- package/node_modules/engine.io-client/build/cjs/transports/webtransport.js +94 -0
- package/node_modules/engine.io-client/build/cjs/util.d.ts +7 -0
- package/node_modules/engine.io-client/build/cjs/util.js +65 -0
- package/node_modules/engine.io-client/build/esm/browser-entrypoint.d.ts +3 -0
- package/node_modules/engine.io-client/build/esm/browser-entrypoint.js +2 -0
- package/node_modules/engine.io-client/build/esm/contrib/has-cors.d.ts +1 -0
- package/node_modules/engine.io-client/build/esm/contrib/has-cors.js +11 -0
- package/node_modules/engine.io-client/build/esm/contrib/parseqs.d.ts +15 -0
- package/node_modules/engine.io-client/build/esm/contrib/parseqs.js +34 -0
- package/node_modules/engine.io-client/build/esm/contrib/parseuri.d.ts +1 -0
- package/node_modules/engine.io-client/build/esm/contrib/parseuri.js +64 -0
- package/node_modules/engine.io-client/build/esm/globals.d.ts +4 -0
- package/node_modules/engine.io-client/build/esm/globals.js +22 -0
- package/node_modules/engine.io-client/build/esm/globals.node.d.ts +21 -0
- package/node_modules/engine.io-client/build/esm/globals.node.js +91 -0
- package/node_modules/engine.io-client/build/esm/index.d.ts +15 -0
- package/node_modules/engine.io-client/build/esm/index.js +15 -0
- package/node_modules/engine.io-client/build/esm/package.json +10 -0
- package/node_modules/engine.io-client/build/esm/socket.d.ts +482 -0
- package/node_modules/engine.io-client/build/esm/socket.js +727 -0
- package/node_modules/engine.io-client/build/esm/transport.d.ts +106 -0
- package/node_modules/engine.io-client/build/esm/transport.js +142 -0
- package/node_modules/engine.io-client/build/esm/transports/index.d.ts +8 -0
- package/node_modules/engine.io-client/build/esm/transports/index.js +8 -0
- package/node_modules/engine.io-client/build/esm/transports/polling-fetch.d.ts +15 -0
- package/node_modules/engine.io-client/build/esm/transports/polling-fetch.js +56 -0
- package/node_modules/engine.io-client/build/esm/transports/polling-xhr.d.ts +108 -0
- package/node_modules/engine.io-client/build/esm/transports/polling-xhr.js +271 -0
- package/node_modules/engine.io-client/build/esm/transports/polling-xhr.node.d.ts +11 -0
- package/node_modules/engine.io-client/build/esm/transports/polling-xhr.node.js +17 -0
- package/node_modules/engine.io-client/build/esm/transports/polling.d.ts +52 -0
- package/node_modules/engine.io-client/build/esm/transports/polling.js +145 -0
- package/node_modules/engine.io-client/build/esm/transports/websocket.d.ts +36 -0
- package/node_modules/engine.io-client/build/esm/transports/websocket.js +125 -0
- package/node_modules/engine.io-client/build/esm/transports/websocket.node.d.ts +14 -0
- package/node_modules/engine.io-client/build/esm/transports/websocket.node.js +41 -0
- package/node_modules/engine.io-client/build/esm/transports/webtransport.d.ts +18 -0
- package/node_modules/engine.io-client/build/esm/transports/webtransport.js +80 -0
- package/node_modules/engine.io-client/build/esm/util.d.ts +7 -0
- package/node_modules/engine.io-client/build/esm/util.js +59 -0
- package/node_modules/engine.io-client/build/esm-debug/browser-entrypoint.d.ts +3 -0
- package/node_modules/engine.io-client/build/esm-debug/browser-entrypoint.js +2 -0
- package/node_modules/engine.io-client/build/esm-debug/contrib/has-cors.d.ts +1 -0
- package/node_modules/engine.io-client/build/esm-debug/contrib/has-cors.js +11 -0
- package/node_modules/engine.io-client/build/esm-debug/contrib/parseqs.d.ts +15 -0
- package/node_modules/engine.io-client/build/esm-debug/contrib/parseqs.js +34 -0
- package/node_modules/engine.io-client/build/esm-debug/contrib/parseuri.d.ts +1 -0
- package/node_modules/engine.io-client/build/esm-debug/contrib/parseuri.js +64 -0
- package/node_modules/engine.io-client/build/esm-debug/globals.d.ts +4 -0
- package/node_modules/engine.io-client/build/esm-debug/globals.js +22 -0
- package/node_modules/engine.io-client/build/esm-debug/globals.node.d.ts +21 -0
- package/node_modules/engine.io-client/build/esm-debug/globals.node.js +91 -0
- package/node_modules/engine.io-client/build/esm-debug/index.d.ts +15 -0
- package/node_modules/engine.io-client/build/esm-debug/index.js +15 -0
- package/node_modules/engine.io-client/build/esm-debug/package.json +10 -0
- package/node_modules/engine.io-client/build/esm-debug/socket.d.ts +482 -0
- package/node_modules/engine.io-client/build/esm-debug/socket.js +756 -0
- package/node_modules/engine.io-client/build/esm-debug/transport.d.ts +106 -0
- package/node_modules/engine.io-client/build/esm-debug/transport.js +145 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/index.d.ts +8 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/index.js +8 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/polling-fetch.d.ts +15 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/polling-fetch.js +56 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/polling-xhr.d.ts +108 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/polling-xhr.js +276 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/polling-xhr.node.d.ts +11 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/polling-xhr.node.js +17 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/polling.d.ts +52 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/polling.js +158 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/websocket.d.ts +36 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/websocket.js +128 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/websocket.node.d.ts +14 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/websocket.node.js +41 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/webtransport.d.ts +18 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/webtransport.js +87 -0
- package/node_modules/engine.io-client/build/esm-debug/util.d.ts +7 -0
- package/node_modules/engine.io-client/build/esm-debug/util.js +59 -0
- package/node_modules/engine.io-client/dist/engine.io.esm.min.js +7 -0
- package/node_modules/engine.io-client/dist/engine.io.esm.min.js.map +1 -0
- package/node_modules/engine.io-client/dist/engine.io.js +3064 -0
- package/node_modules/engine.io-client/dist/engine.io.js.map +1 -0
- package/node_modules/engine.io-client/dist/engine.io.min.js +7 -0
- package/node_modules/engine.io-client/dist/engine.io.min.js.map +1 -0
- package/node_modules/engine.io-client/package.json +95 -0
- package/node_modules/engine.io-parser/LICENSE +22 -0
- package/node_modules/engine.io-parser/Readme.md +158 -0
- package/node_modules/engine.io-parser/build/cjs/commons.d.ts +14 -0
- package/node_modules/engine.io-parser/build/cjs/commons.js +19 -0
- package/node_modules/engine.io-parser/build/cjs/contrib/base64-arraybuffer.d.ts +2 -0
- package/node_modules/engine.io-parser/build/cjs/contrib/base64-arraybuffer.js +48 -0
- package/node_modules/engine.io-parser/build/cjs/decodePacket.browser.d.ts +2 -0
- package/node_modules/engine.io-parser/build/cjs/decodePacket.browser.js +66 -0
- package/node_modules/engine.io-parser/build/cjs/decodePacket.d.ts +2 -0
- package/node_modules/engine.io-parser/build/cjs/decodePacket.js +59 -0
- package/node_modules/engine.io-parser/build/cjs/encodePacket.browser.d.ts +4 -0
- package/node_modules/engine.io-parser/build/cjs/encodePacket.browser.js +72 -0
- package/node_modules/engine.io-parser/build/cjs/encodePacket.d.ts +3 -0
- package/node_modules/engine.io-parser/build/cjs/encodePacket.js +38 -0
- package/node_modules/engine.io-parser/build/cjs/index.d.ts +9 -0
- package/node_modules/engine.io-parser/build/cjs/index.js +164 -0
- package/node_modules/engine.io-parser/build/cjs/package.json +8 -0
- package/node_modules/engine.io-parser/build/esm/commons.d.ts +14 -0
- package/node_modules/engine.io-parser/build/esm/commons.js +14 -0
- package/node_modules/engine.io-parser/build/esm/contrib/base64-arraybuffer.d.ts +2 -0
- package/node_modules/engine.io-parser/build/esm/contrib/base64-arraybuffer.js +43 -0
- package/node_modules/engine.io-parser/build/esm/decodePacket.browser.d.ts +2 -0
- package/node_modules/engine.io-parser/build/esm/decodePacket.browser.js +62 -0
- package/node_modules/engine.io-parser/build/esm/decodePacket.d.ts +2 -0
- package/node_modules/engine.io-parser/build/esm/decodePacket.js +55 -0
- package/node_modules/engine.io-parser/build/esm/encodePacket.browser.d.ts +4 -0
- package/node_modules/engine.io-parser/build/esm/encodePacket.browser.js +68 -0
- package/node_modules/engine.io-parser/build/esm/encodePacket.d.ts +3 -0
- package/node_modules/engine.io-parser/build/esm/encodePacket.js +33 -0
- package/node_modules/engine.io-parser/build/esm/index.d.ts +9 -0
- package/node_modules/engine.io-parser/build/esm/index.js +156 -0
- package/node_modules/engine.io-parser/build/esm/package.json +8 -0
- package/node_modules/engine.io-parser/package.json +46 -0
- package/node_modules/ms/index.js +162 -0
- package/node_modules/ms/license.md +21 -0
- package/node_modules/ms/package.json +38 -0
- package/node_modules/ms/readme.md +59 -0
- package/node_modules/socket.io-client/LICENSE +21 -0
- package/node_modules/socket.io-client/README.md +29 -0
- package/node_modules/socket.io-client/build/cjs/browser-entrypoint.d.ts +2 -0
- package/node_modules/socket.io-client/build/cjs/browser-entrypoint.js +4 -0
- package/node_modules/socket.io-client/build/cjs/contrib/backo2.d.ts +12 -0
- package/node_modules/socket.io-client/build/cjs/contrib/backo2.js +69 -0
- package/node_modules/socket.io-client/build/cjs/index.d.ts +29 -0
- package/node_modules/socket.io-client/build/cjs/index.js +76 -0
- package/node_modules/socket.io-client/build/cjs/manager.d.ts +295 -0
- package/node_modules/socket.io-client/build/cjs/manager.js +416 -0
- package/node_modules/socket.io-client/build/cjs/on.d.ts +2 -0
- package/node_modules/socket.io-client/build/cjs/on.js +9 -0
- package/node_modules/socket.io-client/build/cjs/socket.d.ts +593 -0
- package/node_modules/socket.io-client/build/cjs/socket.js +909 -0
- package/node_modules/socket.io-client/build/cjs/url.d.ts +33 -0
- package/node_modules/socket.io-client/build/cjs/url.js +69 -0
- package/node_modules/socket.io-client/build/esm/browser-entrypoint.d.ts +2 -0
- package/node_modules/socket.io-client/build/esm/browser-entrypoint.js +2 -0
- package/node_modules/socket.io-client/build/esm/contrib/backo2.d.ts +12 -0
- package/node_modules/socket.io-client/build/esm/contrib/backo2.js +66 -0
- package/node_modules/socket.io-client/build/esm/index.d.ts +29 -0
- package/node_modules/socket.io-client/build/esm/index.js +58 -0
- package/node_modules/socket.io-client/build/esm/manager.d.ts +295 -0
- package/node_modules/socket.io-client/build/esm/manager.js +367 -0
- package/node_modules/socket.io-client/build/esm/on.d.ts +2 -0
- package/node_modules/socket.io-client/build/esm/on.js +6 -0
- package/node_modules/socket.io-client/build/esm/package.json +5 -0
- package/node_modules/socket.io-client/build/esm/socket.d.ts +593 -0
- package/node_modules/socket.io-client/build/esm/socket.js +880 -0
- package/node_modules/socket.io-client/build/esm/url.d.ts +33 -0
- package/node_modules/socket.io-client/build/esm/url.js +59 -0
- package/node_modules/socket.io-client/build/esm-debug/browser-entrypoint.d.ts +2 -0
- package/node_modules/socket.io-client/build/esm-debug/browser-entrypoint.js +2 -0
- package/node_modules/socket.io-client/build/esm-debug/contrib/backo2.d.ts +12 -0
- package/node_modules/socket.io-client/build/esm-debug/contrib/backo2.js +66 -0
- package/node_modules/socket.io-client/build/esm-debug/index.d.ts +29 -0
- package/node_modules/socket.io-client/build/esm-debug/index.js +62 -0
- package/node_modules/socket.io-client/build/esm-debug/manager.d.ts +295 -0
- package/node_modules/socket.io-client/build/esm-debug/manager.js +386 -0
- package/node_modules/socket.io-client/build/esm-debug/on.d.ts +2 -0
- package/node_modules/socket.io-client/build/esm-debug/on.js +6 -0
- package/node_modules/socket.io-client/build/esm-debug/package.json +5 -0
- package/node_modules/socket.io-client/build/esm-debug/socket.d.ts +593 -0
- package/node_modules/socket.io-client/build/esm-debug/socket.js +902 -0
- package/node_modules/socket.io-client/build/esm-debug/url.d.ts +33 -0
- package/node_modules/socket.io-client/build/esm-debug/url.js +63 -0
- package/node_modules/socket.io-client/dist/socket.io.esm.min.js +7 -0
- package/node_modules/socket.io-client/dist/socket.io.esm.min.js.map +1 -0
- package/node_modules/socket.io-client/dist/socket.io.js +4955 -0
- package/node_modules/socket.io-client/dist/socket.io.js.map +1 -0
- package/node_modules/socket.io-client/dist/socket.io.min.js +7 -0
- package/node_modules/socket.io-client/dist/socket.io.min.js.map +1 -0
- package/node_modules/socket.io-client/dist/socket.io.msgpack.min.js +7 -0
- package/node_modules/socket.io-client/dist/socket.io.msgpack.min.js.map +1 -0
- package/node_modules/socket.io-client/package.json +101 -0
- package/node_modules/socket.io-parser/LICENSE +20 -0
- package/node_modules/socket.io-parser/Readme.md +81 -0
- package/node_modules/socket.io-parser/build/cjs/binary.d.ts +20 -0
- package/node_modules/socket.io-parser/build/cjs/binary.js +87 -0
- package/node_modules/socket.io-parser/build/cjs/index.d.ts +91 -0
- package/node_modules/socket.io-parser/build/cjs/index.js +359 -0
- package/node_modules/socket.io-parser/build/cjs/is-binary.d.ts +7 -0
- package/node_modules/socket.io-parser/build/cjs/is-binary.js +54 -0
- package/node_modules/socket.io-parser/build/cjs/package.json +3 -0
- package/node_modules/socket.io-parser/build/esm/binary.d.ts +20 -0
- package/node_modules/socket.io-parser/build/esm/binary.js +83 -0
- package/node_modules/socket.io-parser/build/esm/index.d.ts +91 -0
- package/node_modules/socket.io-parser/build/esm/index.js +348 -0
- package/node_modules/socket.io-parser/build/esm/is-binary.d.ts +7 -0
- package/node_modules/socket.io-parser/build/esm/is-binary.js +50 -0
- package/node_modules/socket.io-parser/build/esm/package.json +3 -0
- package/node_modules/socket.io-parser/build/esm-debug/binary.d.ts +20 -0
- package/node_modules/socket.io-parser/build/esm-debug/binary.js +83 -0
- package/node_modules/socket.io-parser/build/esm-debug/index.d.ts +91 -0
- package/node_modules/socket.io-parser/build/esm-debug/index.js +353 -0
- package/node_modules/socket.io-parser/build/esm-debug/is-binary.d.ts +7 -0
- package/node_modules/socket.io-parser/build/esm-debug/is-binary.js +50 -0
- package/node_modules/socket.io-parser/build/esm-debug/package.json +3 -0
- package/node_modules/socket.io-parser/package.json +44 -0
- package/node_modules/ws/LICENSE +20 -0
- package/node_modules/ws/README.md +548 -0
- package/node_modules/ws/browser.js +8 -0
- package/node_modules/ws/index.js +13 -0
- package/node_modules/ws/lib/buffer-util.js +131 -0
- package/node_modules/ws/lib/constants.js +18 -0
- package/node_modules/ws/lib/event-target.js +292 -0
- package/node_modules/ws/lib/extension.js +203 -0
- package/node_modules/ws/lib/limiter.js +55 -0
- package/node_modules/ws/lib/permessage-deflate.js +528 -0
- package/node_modules/ws/lib/receiver.js +706 -0
- package/node_modules/ws/lib/sender.js +602 -0
- package/node_modules/ws/lib/stream.js +161 -0
- package/node_modules/ws/lib/subprotocol.js +62 -0
- package/node_modules/ws/lib/validation.js +152 -0
- package/node_modules/ws/lib/websocket-server.js +550 -0
- package/node_modules/ws/lib/websocket.js +1388 -0
- package/node_modules/ws/package.json +69 -0
- package/node_modules/ws/wrapper.mjs +8 -0
- package/node_modules/xmlhttprequest-ssl/LICENSE +22 -0
- package/node_modules/xmlhttprequest-ssl/README.md +67 -0
- package/node_modules/xmlhttprequest-ssl/lib/XMLHttpRequest.js +689 -0
- package/node_modules/xmlhttprequest-ssl/package.json +40 -0
- package/package.json +34 -4
- package/public-api.md +85 -23
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { node, schemaScope } from "./scope.js";
|
|
2
|
+
import { $ark } from "./shared/registry.js";
|
|
3
|
+
import { arrayIndexSource } from "./structure/shared.js";
|
|
4
|
+
const intrinsicBases = schemaScope({
|
|
5
|
+
bigint: "bigint",
|
|
6
|
+
// since we know this won't be reduced, it can be safely cast to a union
|
|
7
|
+
boolean: [{ unit: false }, { unit: true }],
|
|
8
|
+
false: { unit: false },
|
|
9
|
+
never: [],
|
|
10
|
+
null: { unit: null },
|
|
11
|
+
number: "number",
|
|
12
|
+
object: "object",
|
|
13
|
+
string: "string",
|
|
14
|
+
symbol: "symbol",
|
|
15
|
+
true: { unit: true },
|
|
16
|
+
unknown: {},
|
|
17
|
+
undefined: { unit: undefined },
|
|
18
|
+
Array,
|
|
19
|
+
Date
|
|
20
|
+
}, { prereducedAliases: true }).export();
|
|
21
|
+
$ark.intrinsic = { ...intrinsicBases };
|
|
22
|
+
const intrinsicRoots = schemaScope({
|
|
23
|
+
integer: {
|
|
24
|
+
domain: "number",
|
|
25
|
+
divisor: 1
|
|
26
|
+
},
|
|
27
|
+
lengthBoundable: ["string", Array],
|
|
28
|
+
key: ["string", "symbol"],
|
|
29
|
+
nonNegativeIntegerString: { domain: "string", pattern: arrayIndexSource }
|
|
30
|
+
}, { prereducedAliases: true }).export();
|
|
31
|
+
// needed to parse index signatures for JSON
|
|
32
|
+
Object.assign($ark.intrinsic, intrinsicRoots);
|
|
33
|
+
const intrinsicJson = schemaScope({
|
|
34
|
+
jsonPrimitive: [
|
|
35
|
+
"string",
|
|
36
|
+
"number",
|
|
37
|
+
{ unit: true },
|
|
38
|
+
{ unit: false },
|
|
39
|
+
{ unit: null }
|
|
40
|
+
],
|
|
41
|
+
jsonObject: {
|
|
42
|
+
domain: "object",
|
|
43
|
+
index: {
|
|
44
|
+
signature: "string",
|
|
45
|
+
value: "$jsonData"
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
jsonData: ["$jsonPrimitive", "$jsonObject"]
|
|
49
|
+
}, { prereducedAliases: true }).export();
|
|
50
|
+
export const intrinsic = {
|
|
51
|
+
...intrinsicBases,
|
|
52
|
+
...intrinsicRoots,
|
|
53
|
+
...intrinsicJson,
|
|
54
|
+
emptyStructure: node("structure", {}, { prereduced: true })
|
|
55
|
+
};
|
|
56
|
+
$ark.intrinsic = { ...intrinsic };
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { type array, type listable } from "@ark/util";
|
|
2
|
+
import type { BaseNode } from "./node.ts";
|
|
3
|
+
import { Predicate } from "./predicate.ts";
|
|
4
|
+
import { Divisor } from "./refinements/divisor.ts";
|
|
5
|
+
import { type BoundDeclarations, type BoundNodesByKind } from "./refinements/kinds.ts";
|
|
6
|
+
import { Pattern } from "./refinements/pattern.ts";
|
|
7
|
+
import { Alias } from "./roots/alias.ts";
|
|
8
|
+
import { Domain } from "./roots/domain.ts";
|
|
9
|
+
import { Intersection } from "./roots/intersection.ts";
|
|
10
|
+
import { Morph } from "./roots/morph.ts";
|
|
11
|
+
import { Proto } from "./roots/proto.ts";
|
|
12
|
+
import { Union } from "./roots/union.ts";
|
|
13
|
+
import { Unit } from "./roots/unit.ts";
|
|
14
|
+
import type { BaseScope } from "./scope.ts";
|
|
15
|
+
import type { ConstraintKind, NodeKind, OpenNodeKind, RootKind, UnknownAttachments, UnknownNodeImplementation } from "./shared/implement.ts";
|
|
16
|
+
import type { makeRootAndArrayPropertiesMutable } from "./shared/utils.ts";
|
|
17
|
+
import { Index } from "./structure/index.ts";
|
|
18
|
+
import { Optional } from "./structure/optional.ts";
|
|
19
|
+
import { Required } from "./structure/required.ts";
|
|
20
|
+
import { Sequence } from "./structure/sequence.ts";
|
|
21
|
+
import { Structure } from "./structure/structure.ts";
|
|
22
|
+
export interface NodeDeclarationsByKind extends BoundDeclarations {
|
|
23
|
+
alias: Alias.Declaration;
|
|
24
|
+
domain: Domain.Declaration;
|
|
25
|
+
unit: Unit.Declaration;
|
|
26
|
+
proto: Proto.Declaration;
|
|
27
|
+
union: Union.Declaration;
|
|
28
|
+
morph: Morph.Declaration;
|
|
29
|
+
intersection: Intersection.Declaration;
|
|
30
|
+
sequence: Sequence.Declaration;
|
|
31
|
+
divisor: Divisor.Declaration;
|
|
32
|
+
required: Required.Declaration;
|
|
33
|
+
optional: Optional.Declaration;
|
|
34
|
+
index: Index.Declaration;
|
|
35
|
+
pattern: Pattern.Declaration;
|
|
36
|
+
predicate: Predicate.Declaration;
|
|
37
|
+
structure: Structure.Declaration;
|
|
38
|
+
}
|
|
39
|
+
export declare const nodeImplementationsByKind: Record<NodeKind, UnknownNodeImplementation>;
|
|
40
|
+
export declare const nodeClassesByKind: Record<NodeKind, new (attachments: UnknownAttachments, $: BaseScope) => BaseNode>;
|
|
41
|
+
interface NodesByKind extends BoundNodesByKind {
|
|
42
|
+
alias: Alias.Node;
|
|
43
|
+
union: Union.Node;
|
|
44
|
+
morph: Morph.Node;
|
|
45
|
+
intersection: Intersection.Node;
|
|
46
|
+
unit: Unit.Node;
|
|
47
|
+
proto: Proto.Node;
|
|
48
|
+
domain: Domain.Node;
|
|
49
|
+
divisor: Divisor.Node;
|
|
50
|
+
pattern: Pattern.Node;
|
|
51
|
+
predicate: Predicate.Node;
|
|
52
|
+
required: Required.Node;
|
|
53
|
+
optional: Optional.Node;
|
|
54
|
+
index: Index.Node;
|
|
55
|
+
sequence: Sequence.Node;
|
|
56
|
+
structure: Structure.Node;
|
|
57
|
+
}
|
|
58
|
+
export type nodeOfKind<kind extends NodeKind> = NodesByKind[kind];
|
|
59
|
+
export type Declaration<kind extends NodeKind> = NodeDeclarationsByKind[kind];
|
|
60
|
+
export type NodeSchema<kind extends NodeKind> = Declaration<kind>["schema"];
|
|
61
|
+
export type RootSchema<kind extends RootKind = RootKind> = NodeSchema<kind>;
|
|
62
|
+
export type NormalizedSchema<kind extends NodeKind> = Declaration<kind>["normalizedSchema"];
|
|
63
|
+
export type childKindOf<kind extends NodeKind> = Declaration<kind>["childKind"];
|
|
64
|
+
export type Prerequisite<kind extends NodeKind> = Declaration<kind>["prerequisite"];
|
|
65
|
+
export type reducibleKindOf<kind extends NodeKind> = Declaration<kind>["reducibleTo"] extends NodeKind ? Declaration<kind>["reducibleTo"] : kind;
|
|
66
|
+
export type Inner<kind extends NodeKind> = Declaration<kind>["inner"];
|
|
67
|
+
export type defAttachedAs<kind extends ConstraintKind> = kind extends OpenNodeKind ? listable<NodeSchema<kind>> : NodeSchema<kind>;
|
|
68
|
+
export type innerAttachedAs<kind extends ConstraintKind> = kind extends OpenNodeKind ? array<nodeOfKind<kind>> : nodeOfKind<kind>;
|
|
69
|
+
/** make nested arrays mutable while keeping nested nodes immutable */
|
|
70
|
+
export type mutableInnerOfKind<kind extends NodeKind> = makeRootAndArrayPropertiesMutable<Inner<kind>>;
|
|
71
|
+
export type mutableNormalizedRootOfKind<kind extends NodeKind> = makeRootAndArrayPropertiesMutable<NormalizedSchema<kind>>;
|
|
72
|
+
export type errorContext<kind extends NodeKind> = Declaration<kind>["errorContext"];
|
|
73
|
+
export {};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { deepClone, envHasCsp, flatMorph, withAlphabetizedKeys } from "@ark/util";
|
|
2
|
+
import { mergeConfigs } from "./config.js";
|
|
3
|
+
import { Predicate } from "./predicate.js";
|
|
4
|
+
import { Divisor } from "./refinements/divisor.js";
|
|
5
|
+
import { boundClassesByKind, boundImplementationsByKind } from "./refinements/kinds.js";
|
|
6
|
+
import { Pattern } from "./refinements/pattern.js";
|
|
7
|
+
import { Alias } from "./roots/alias.js";
|
|
8
|
+
import { Domain } from "./roots/domain.js";
|
|
9
|
+
import { Intersection } from "./roots/intersection.js";
|
|
10
|
+
import { Morph } from "./roots/morph.js";
|
|
11
|
+
import { Proto } from "./roots/proto.js";
|
|
12
|
+
import { Union } from "./roots/union.js";
|
|
13
|
+
import { Unit } from "./roots/unit.js";
|
|
14
|
+
import { $ark } from "./shared/registry.js";
|
|
15
|
+
import { ToJsonSchema } from "./shared/toJsonSchema.js";
|
|
16
|
+
import { Index } from "./structure/index.js";
|
|
17
|
+
import { Optional } from "./structure/optional.js";
|
|
18
|
+
import { Required } from "./structure/required.js";
|
|
19
|
+
import { Sequence } from "./structure/sequence.js";
|
|
20
|
+
import { Structure } from "./structure/structure.js";
|
|
21
|
+
export const nodeImplementationsByKind = {
|
|
22
|
+
...boundImplementationsByKind,
|
|
23
|
+
alias: Alias.implementation,
|
|
24
|
+
domain: Domain.implementation,
|
|
25
|
+
unit: Unit.implementation,
|
|
26
|
+
proto: Proto.implementation,
|
|
27
|
+
union: Union.implementation,
|
|
28
|
+
morph: Morph.implementation,
|
|
29
|
+
intersection: Intersection.implementation,
|
|
30
|
+
divisor: Divisor.implementation,
|
|
31
|
+
pattern: Pattern.implementation,
|
|
32
|
+
predicate: Predicate.implementation,
|
|
33
|
+
required: Required.implementation,
|
|
34
|
+
optional: Optional.implementation,
|
|
35
|
+
index: Index.implementation,
|
|
36
|
+
sequence: Sequence.implementation,
|
|
37
|
+
structure: Structure.implementation
|
|
38
|
+
};
|
|
39
|
+
$ark.defaultConfig = withAlphabetizedKeys(Object.assign(flatMorph(nodeImplementationsByKind, (kind, implementation) => [
|
|
40
|
+
kind,
|
|
41
|
+
implementation.defaults
|
|
42
|
+
]), {
|
|
43
|
+
jitless: envHasCsp(),
|
|
44
|
+
clone: deepClone,
|
|
45
|
+
onUndeclaredKey: "ignore",
|
|
46
|
+
exactOptionalPropertyTypes: true,
|
|
47
|
+
numberAllowsNaN: false,
|
|
48
|
+
dateAllowsInvalid: false,
|
|
49
|
+
onFail: null,
|
|
50
|
+
keywords: {},
|
|
51
|
+
toJsonSchema: ToJsonSchema.defaultConfig
|
|
52
|
+
}));
|
|
53
|
+
$ark.resolvedConfig = mergeConfigs($ark.defaultConfig, $ark.config);
|
|
54
|
+
export const nodeClassesByKind = {
|
|
55
|
+
...boundClassesByKind,
|
|
56
|
+
alias: Alias.Node,
|
|
57
|
+
domain: Domain.Node,
|
|
58
|
+
unit: Unit.Node,
|
|
59
|
+
proto: Proto.Node,
|
|
60
|
+
union: Union.Node,
|
|
61
|
+
morph: Morph.Node,
|
|
62
|
+
intersection: Intersection.Node,
|
|
63
|
+
divisor: Divisor.Node,
|
|
64
|
+
pattern: Pattern.Node,
|
|
65
|
+
predicate: Predicate.Node,
|
|
66
|
+
required: Required.Node,
|
|
67
|
+
optional: Optional.Node,
|
|
68
|
+
index: Index.Node,
|
|
69
|
+
sequence: Sequence.Node,
|
|
70
|
+
structure: Structure.Node
|
|
71
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { DynamicBase, type anyOrNever } from "@ark/util";
|
|
2
|
+
import type { BaseRoot } from "./roots/root.ts";
|
|
3
|
+
import type { BaseScope, InternalResolution, InternalResolutions } from "./scope.ts";
|
|
4
|
+
import { arkKind } from "./shared/utils.ts";
|
|
5
|
+
export type PreparsedNodeResolution = {
|
|
6
|
+
[arkKind]: "generic" | "module";
|
|
7
|
+
};
|
|
8
|
+
export declare class RootModule<exports extends {} = {}> extends DynamicBase<exports> {
|
|
9
|
+
get [arkKind](): "module";
|
|
10
|
+
}
|
|
11
|
+
export interface InternalModule<exports extends InternalResolutions = InternalResolutions> extends RootModule<exports> {
|
|
12
|
+
root?: BaseRoot;
|
|
13
|
+
}
|
|
14
|
+
export declare const bindModule: (module: InternalModule, $: BaseScope) => InternalModule;
|
|
15
|
+
type exportSchemaScope<$> = {
|
|
16
|
+
[k in keyof $]: instantiateRoot<$[k]>;
|
|
17
|
+
};
|
|
18
|
+
export type instantiateRoot<t> = t extends InternalResolution ? [
|
|
19
|
+
t
|
|
20
|
+
] extends [anyOrNever] ? BaseRoot : t : BaseRoot;
|
|
21
|
+
export declare const SchemaModule: new <$ = {}>(types: exportSchemaScope<$>) => SchemaModule<$>;
|
|
22
|
+
export interface SchemaModule<$ = {}> extends RootModule<exportSchemaScope<$>> {
|
|
23
|
+
}
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { DynamicBase, flatMorph } from "@ark/util";
|
|
2
|
+
import { arkKind, hasArkKind } from "./shared/utils.js";
|
|
3
|
+
export class RootModule extends DynamicBase {
|
|
4
|
+
// ensure `[arkKind]` is non-enumerable so it doesn't get spread on import/export
|
|
5
|
+
get [arkKind]() {
|
|
6
|
+
return "module";
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
export const bindModule = (module, $) => new RootModule(flatMorph(module, (alias, value) => [
|
|
10
|
+
alias,
|
|
11
|
+
hasArkKind(value, "module") ?
|
|
12
|
+
bindModule(value, $)
|
|
13
|
+
: $.bindReference(value)
|
|
14
|
+
]));
|
|
15
|
+
export const SchemaModule = RootModule;
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { Callable, type GuardablePredicate, type JsonStructure, type Key, type array, type conform, type listable, type mutable, type requireKeys } from "@ark/util";
|
|
2
|
+
import type { BaseConstraint } from "./constraint.ts";
|
|
3
|
+
import type { Inner, NormalizedSchema, childKindOf, nodeOfKind, reducibleKindOf } from "./kinds.ts";
|
|
4
|
+
import type { BaseParseOptions } from "./parse.ts";
|
|
5
|
+
import type { Intersection } from "./roots/intersection.ts";
|
|
6
|
+
import type { Morph } from "./roots/morph.ts";
|
|
7
|
+
import type { BaseRoot } from "./roots/root.ts";
|
|
8
|
+
import type { Unit } from "./roots/unit.ts";
|
|
9
|
+
import type { BaseScope } from "./scope.ts";
|
|
10
|
+
import type { NodeCompiler } from "./shared/compile.ts";
|
|
11
|
+
import type { BaseNodeDeclaration, TypeMeta, attachmentsOf } from "./shared/declare.ts";
|
|
12
|
+
import type { ArkErrors } from "./shared/errors.ts";
|
|
13
|
+
import { type BasisKind, type NodeKind, type OpenNodeKind, type RefinementKind, type StructuralKind, type UnknownAttachments } from "./shared/implement.ts";
|
|
14
|
+
import { Traversal, type TraverseAllows, type TraverseApply } from "./shared/traversal.ts";
|
|
15
|
+
import type { UndeclaredKeyHandling } from "./structure/structure.ts";
|
|
16
|
+
export declare abstract class BaseNode<
|
|
17
|
+
/** @ts-ignore allow instantiation assignment to the base type */
|
|
18
|
+
out d extends BaseNodeDeclaration = BaseNodeDeclaration> extends Callable<(data: d["prerequisite"], ctx?: Traversal, onFail?: ArkErrors.Handler | null) => unknown, attachmentsOf<d>> {
|
|
19
|
+
attachments: UnknownAttachments;
|
|
20
|
+
$: BaseScope;
|
|
21
|
+
onFail: ArkErrors.Handler | null;
|
|
22
|
+
includesTransform: boolean;
|
|
23
|
+
includesContextualPredicate: boolean;
|
|
24
|
+
isCyclic: boolean;
|
|
25
|
+
allowsRequiresContext: boolean;
|
|
26
|
+
rootApplyStrategy: "allows" | "contextual" | "optimistic" | "branchedOptimistic";
|
|
27
|
+
contextFreeMorph: ((data: unknown) => unknown) | undefined;
|
|
28
|
+
rootApply: (data: unknown, onFail: ArkErrors.Handler | null) => unknown;
|
|
29
|
+
referencesById: Record<string, BaseNode>;
|
|
30
|
+
shallowReferences: BaseNode[];
|
|
31
|
+
flatRefs: FlatRef[];
|
|
32
|
+
flatMorphs: FlatRef<Morph.Node | Intersection.Node>[];
|
|
33
|
+
allows: (data: d["prerequisite"]) => boolean;
|
|
34
|
+
get shallowMorphs(): array<Morph>;
|
|
35
|
+
constructor(attachments: UnknownAttachments, $: BaseScope);
|
|
36
|
+
protected createRootApply(): this["rootApply"];
|
|
37
|
+
abstract traverseAllows: TraverseAllows<d["prerequisite"]>;
|
|
38
|
+
abstract traverseApply: TraverseApply<d["prerequisite"]>;
|
|
39
|
+
abstract expression: string;
|
|
40
|
+
abstract compile(js: NodeCompiler): void;
|
|
41
|
+
readonly compiledMeta: string;
|
|
42
|
+
protected cacheGetter<name extends keyof this>(name: name, value: this[name]): this[name];
|
|
43
|
+
get description(): string;
|
|
44
|
+
get references(): BaseNode[];
|
|
45
|
+
readonly precedence: number;
|
|
46
|
+
precompilation: string | undefined;
|
|
47
|
+
assert: (data: d["prerequisite"], pipedFromCtx?: Traversal) => unknown;
|
|
48
|
+
traverse(data: d["prerequisite"], pipedFromCtx?: Traversal): ArkErrors | {} | null | undefined;
|
|
49
|
+
/** rawIn should be used internally instead */
|
|
50
|
+
get in(): unknown;
|
|
51
|
+
get rawIn(): BaseNode;
|
|
52
|
+
/** rawOut should be used internally instead */
|
|
53
|
+
get out(): unknown;
|
|
54
|
+
get rawOut(): BaseNode;
|
|
55
|
+
getIo(ioKind: "in" | "out"): BaseNode;
|
|
56
|
+
toJSON(): JsonStructure;
|
|
57
|
+
toString(): string;
|
|
58
|
+
equals(r: unknown): boolean;
|
|
59
|
+
ifEquals(r: unknown): BaseNode | undefined;
|
|
60
|
+
hasKind<kind extends NodeKind>(kind: kind): this is nodeOfKind<kind>;
|
|
61
|
+
assertHasKind<kind extends NodeKind>(kind: kind): nodeOfKind<kind>;
|
|
62
|
+
hasKindIn<kinds extends NodeKind[]>(...kinds: kinds): this is nodeOfKind<kinds[number]>;
|
|
63
|
+
assertHasKindIn<kinds extends NodeKind[]>(...kinds: kinds): nodeOfKind<kinds[number]>;
|
|
64
|
+
isBasis(): this is nodeOfKind<BasisKind>;
|
|
65
|
+
isConstraint(): this is BaseConstraint;
|
|
66
|
+
isStructural(): this is nodeOfKind<StructuralKind>;
|
|
67
|
+
isRefinement(): this is nodeOfKind<RefinementKind>;
|
|
68
|
+
isRoot(): this is BaseRoot;
|
|
69
|
+
isUnknown(): boolean;
|
|
70
|
+
isNever(): boolean;
|
|
71
|
+
hasUnit<value>(value: unknown): this is Unit.Node & {
|
|
72
|
+
unit: value;
|
|
73
|
+
};
|
|
74
|
+
hasOpenIntersection(): this is nodeOfKind<OpenNodeKind>;
|
|
75
|
+
get nestableExpression(): string;
|
|
76
|
+
select<const selector extends NodeSelector.CompositeInput, predicate extends GuardablePredicate<NodeSelector.inferSelectKind<d["kind"], selector>>>(selector: NodeSelector.validateComposite<selector, predicate>): NodeSelector.infer<d["kind"], selector>;
|
|
77
|
+
select<const selector extends NodeSelector.Single>(selector: selector): NodeSelector.infer<d["kind"], selector>;
|
|
78
|
+
private _select;
|
|
79
|
+
transform<mapper extends DeepNodeTransformation>(mapper: mapper, opts?: DeepNodeTransformOptions): nodeOfKind<reducibleKindOf<this["kind"]>> | Extract<ReturnType<mapper>, null>;
|
|
80
|
+
protected _createTransformContext(opts: DeepNodeTransformOptions | undefined): DeepNodeTransformContext;
|
|
81
|
+
protected _transform(mapper: DeepNodeTransformation, ctx: DeepNodeTransformContext): BaseNode | null;
|
|
82
|
+
configureReferences(meta: TypeMeta.MappableInput.Internal, selector?: NodeSelector): this;
|
|
83
|
+
}
|
|
84
|
+
/** a literal key (named property) or a node (index signatures) representing part of a type structure */
|
|
85
|
+
export type KeyOrKeyNode = Key | BaseRoot;
|
|
86
|
+
export type GettableKeyOrNode = KeyOrKeyNode | number;
|
|
87
|
+
export type FlatRef<root extends BaseRoot = BaseRoot> = {
|
|
88
|
+
path: array<KeyOrKeyNode>;
|
|
89
|
+
node: root;
|
|
90
|
+
propString: string;
|
|
91
|
+
};
|
|
92
|
+
export type NodeSelector = NodeSelector.Single | NodeSelector.Composite;
|
|
93
|
+
export declare namespace NodeSelector {
|
|
94
|
+
type SelectableFn<input, returns, kind extends NodeKind = NodeKind> = {
|
|
95
|
+
<const selector extends NodeSelector.CompositeInput, predicate extends GuardablePredicate<NodeSelector.inferSelectKind<kind, selector>>>(input: input, selector?: NodeSelector.validateComposite<selector, predicate>): returns;
|
|
96
|
+
<const selector extends NodeSelector.Single>(input: input, selector?: selector): returns;
|
|
97
|
+
};
|
|
98
|
+
type Single = NodeSelector.Boundary | NodeSelector.Kind | GuardablePredicate<BaseNode>;
|
|
99
|
+
type Boundary = "self" | "child" | "shallow" | "references";
|
|
100
|
+
type Kind = NodeKind;
|
|
101
|
+
type Method = "filter" | "assertFilter" | "find" | "assertFind";
|
|
102
|
+
interface Composite {
|
|
103
|
+
method?: Method;
|
|
104
|
+
boundary?: Boundary;
|
|
105
|
+
kind?: Kind;
|
|
106
|
+
where?: GuardablePredicate<BaseNode>;
|
|
107
|
+
}
|
|
108
|
+
type Normalized = requireKeys<Composite, "method" | "boundary">;
|
|
109
|
+
type CompositeInput = Omit<Composite, "where">;
|
|
110
|
+
type BaseResult = BaseNode | BaseNode[] | undefined;
|
|
111
|
+
type validateComposite<selector, predicate> = {
|
|
112
|
+
[k in keyof selector]: k extends "where" ? predicate : conform<selector[k], CompositeInput[k & keyof CompositeInput]>;
|
|
113
|
+
};
|
|
114
|
+
type infer<selfKind extends NodeKind, selector> = applyMethod<selector extends NodeSelector.WhereCastInput<any, infer narrowed> ? narrowed : NodeSelector.inferSelectKind<selfKind, selector>, selector>;
|
|
115
|
+
type BoundaryInput<b extends Boundary> = b | {
|
|
116
|
+
boundary: b;
|
|
117
|
+
};
|
|
118
|
+
type KindInput<k extends Kind> = k | {
|
|
119
|
+
kind: k;
|
|
120
|
+
};
|
|
121
|
+
type WhereCastInput<kindNode extends BaseNode, narrowed extends kindNode> = ((In: kindNode) => In is narrowed) | {
|
|
122
|
+
where: (In: kindNode) => In is narrowed;
|
|
123
|
+
};
|
|
124
|
+
type inferSelectKind<selfKind extends NodeKind, selector> = selectKind<selfKind, selector> extends infer kind extends NodeKind ? NodeKind extends kind ? BaseNode : nodeOfKind<kind> : never;
|
|
125
|
+
type selectKind<selfKind extends NodeKind, selector> = selector extends BoundaryInput<"self"> ? selfKind : selector extends KindInput<infer kind> ? kind : selector extends BoundaryInput<"child"> ? selfKind | childKindOf<selfKind> : NodeKind;
|
|
126
|
+
type applyMethod<t, selector> = selector extends {
|
|
127
|
+
method: infer method extends Method;
|
|
128
|
+
} ? method extends "filter" ? t[] : method extends "assertFilter" ? [t, ...t[]] : method extends "find" ? t | undefined : method extends "assertFind" ? t : never : t[];
|
|
129
|
+
}
|
|
130
|
+
export declare const typePathToPropString: (path: array<KeyOrKeyNode>) => string;
|
|
131
|
+
export declare const flatRef: <node extends BaseRoot>(path: array<KeyOrKeyNode>, node: node) => FlatRef<node>;
|
|
132
|
+
export declare const flatRefsAreEqual: (l: FlatRef, r: FlatRef) => boolean;
|
|
133
|
+
export declare const appendUniqueFlatRefs: <node extends BaseRoot>(existing: FlatRef<node>[] | undefined, refs: listable<FlatRef<node>>) => FlatRef<node>[];
|
|
134
|
+
export declare const appendUniqueNodes: <node extends BaseNode>(existing: node[] | undefined, refs: listable<node>) => node[];
|
|
135
|
+
export type DeepNodeTransformOptions = {
|
|
136
|
+
shouldTransform?: ShouldTransformFn;
|
|
137
|
+
bindScope?: BaseScope;
|
|
138
|
+
prereduced?: boolean;
|
|
139
|
+
selected?: readonly BaseNode[] | undefined;
|
|
140
|
+
};
|
|
141
|
+
export type ShouldTransformFn = (node: BaseNode, ctx: DeepNodeTransformContext) => boolean;
|
|
142
|
+
export interface DeepNodeTransformContext extends DeepNodeTransformOptions {
|
|
143
|
+
root: BaseNode;
|
|
144
|
+
selected: readonly BaseNode[] | undefined;
|
|
145
|
+
path: mutable<array<KeyOrKeyNode>>;
|
|
146
|
+
seen: {
|
|
147
|
+
[originalId: string]: (() => BaseNode | undefined) | undefined;
|
|
148
|
+
};
|
|
149
|
+
parseOptions: BaseParseOptions;
|
|
150
|
+
undeclaredKeyHandling: UndeclaredKeyHandling | undefined;
|
|
151
|
+
}
|
|
152
|
+
export type DeepNodeTransformation = <kind extends NodeKind>(kind: kind, innerWithMeta: Inner<kind> & {
|
|
153
|
+
meta: ArkEnv.meta;
|
|
154
|
+
}, ctx: DeepNodeTransformContext) => NormalizedSchema<kind> | null;
|