@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,33 @@
|
|
|
1
|
+
type ParsedUrl = {
|
|
2
|
+
source: string;
|
|
3
|
+
protocol: string;
|
|
4
|
+
authority: string;
|
|
5
|
+
userInfo: string;
|
|
6
|
+
user: string;
|
|
7
|
+
password: string;
|
|
8
|
+
host: string;
|
|
9
|
+
port: string;
|
|
10
|
+
relative: string;
|
|
11
|
+
path: string;
|
|
12
|
+
directory: string;
|
|
13
|
+
file: string;
|
|
14
|
+
query: string;
|
|
15
|
+
anchor: string;
|
|
16
|
+
pathNames: Array<string>;
|
|
17
|
+
queryKey: {
|
|
18
|
+
[key: string]: string;
|
|
19
|
+
};
|
|
20
|
+
id: string;
|
|
21
|
+
href: string;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* URL parser.
|
|
25
|
+
*
|
|
26
|
+
* @param uri - url
|
|
27
|
+
* @param path - the request path of the connection
|
|
28
|
+
* @param loc - An object meant to mimic window.location.
|
|
29
|
+
* Defaults to window.location.
|
|
30
|
+
* @public
|
|
31
|
+
*/
|
|
32
|
+
export declare function url(uri: string | ParsedUrl, path?: string, loc?: Location): ParsedUrl;
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.url = url;
|
|
7
|
+
const engine_io_client_1 = require("engine.io-client");
|
|
8
|
+
const debug_1 = __importDefault(require("debug")); // debug()
|
|
9
|
+
const debug = (0, debug_1.default)("socket.io-client:url"); // debug()
|
|
10
|
+
/**
|
|
11
|
+
* URL parser.
|
|
12
|
+
*
|
|
13
|
+
* @param uri - url
|
|
14
|
+
* @param path - the request path of the connection
|
|
15
|
+
* @param loc - An object meant to mimic window.location.
|
|
16
|
+
* Defaults to window.location.
|
|
17
|
+
* @public
|
|
18
|
+
*/
|
|
19
|
+
function url(uri, path = "", loc) {
|
|
20
|
+
let obj = uri;
|
|
21
|
+
// default to window.location
|
|
22
|
+
loc = loc || (typeof location !== "undefined" && location);
|
|
23
|
+
if (null == uri)
|
|
24
|
+
uri = loc.protocol + "//" + loc.host;
|
|
25
|
+
// relative path support
|
|
26
|
+
if (typeof uri === "string") {
|
|
27
|
+
if ("/" === uri.charAt(0)) {
|
|
28
|
+
if ("/" === uri.charAt(1)) {
|
|
29
|
+
uri = loc.protocol + uri;
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
uri = loc.host + uri;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
if (!/^(https?|wss?):\/\//.test(uri)) {
|
|
36
|
+
debug("protocol-less url %s", uri);
|
|
37
|
+
if ("undefined" !== typeof loc) {
|
|
38
|
+
uri = loc.protocol + "//" + uri;
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
uri = "https://" + uri;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
// parse
|
|
45
|
+
debug("parse %s", uri);
|
|
46
|
+
obj = (0, engine_io_client_1.parse)(uri);
|
|
47
|
+
}
|
|
48
|
+
// make sure we treat `localhost:80` and `localhost` equally
|
|
49
|
+
if (!obj.port) {
|
|
50
|
+
if (/^(http|ws)$/.test(obj.protocol)) {
|
|
51
|
+
obj.port = "80";
|
|
52
|
+
}
|
|
53
|
+
else if (/^(http|ws)s$/.test(obj.protocol)) {
|
|
54
|
+
obj.port = "443";
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
obj.path = obj.path || "/";
|
|
58
|
+
const ipv6 = obj.host.indexOf(":") !== -1;
|
|
59
|
+
const host = ipv6 ? "[" + obj.host + "]" : obj.host;
|
|
60
|
+
// define unique id
|
|
61
|
+
obj.id = obj.protocol + "://" + host + ":" + obj.port + path;
|
|
62
|
+
// define href
|
|
63
|
+
obj.href =
|
|
64
|
+
obj.protocol +
|
|
65
|
+
"://" +
|
|
66
|
+
host +
|
|
67
|
+
(loc && loc.port === obj.port ? "" : ":" + obj.port);
|
|
68
|
+
return obj;
|
|
69
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Initialize backoff timer with `opts`.
|
|
3
|
+
*
|
|
4
|
+
* - `min` initial timeout in milliseconds [100]
|
|
5
|
+
* - `max` max timeout [10000]
|
|
6
|
+
* - `jitter` [0]
|
|
7
|
+
* - `factor` [2]
|
|
8
|
+
*
|
|
9
|
+
* @param {Object} opts
|
|
10
|
+
* @api public
|
|
11
|
+
*/
|
|
12
|
+
export declare function Backoff(opts: any): void;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Initialize backoff timer with `opts`.
|
|
3
|
+
*
|
|
4
|
+
* - `min` initial timeout in milliseconds [100]
|
|
5
|
+
* - `max` max timeout [10000]
|
|
6
|
+
* - `jitter` [0]
|
|
7
|
+
* - `factor` [2]
|
|
8
|
+
*
|
|
9
|
+
* @param {Object} opts
|
|
10
|
+
* @api public
|
|
11
|
+
*/
|
|
12
|
+
export function Backoff(opts) {
|
|
13
|
+
opts = opts || {};
|
|
14
|
+
this.ms = opts.min || 100;
|
|
15
|
+
this.max = opts.max || 10000;
|
|
16
|
+
this.factor = opts.factor || 2;
|
|
17
|
+
this.jitter = opts.jitter > 0 && opts.jitter <= 1 ? opts.jitter : 0;
|
|
18
|
+
this.attempts = 0;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Return the backoff duration.
|
|
22
|
+
*
|
|
23
|
+
* @return {Number}
|
|
24
|
+
* @api public
|
|
25
|
+
*/
|
|
26
|
+
Backoff.prototype.duration = function () {
|
|
27
|
+
var ms = this.ms * Math.pow(this.factor, this.attempts++);
|
|
28
|
+
if (this.jitter) {
|
|
29
|
+
var rand = Math.random();
|
|
30
|
+
var deviation = Math.floor(rand * this.jitter * ms);
|
|
31
|
+
ms = (Math.floor(rand * 10) & 1) == 0 ? ms - deviation : ms + deviation;
|
|
32
|
+
}
|
|
33
|
+
return Math.min(ms, this.max) | 0;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Reset the number of attempts.
|
|
37
|
+
*
|
|
38
|
+
* @api public
|
|
39
|
+
*/
|
|
40
|
+
Backoff.prototype.reset = function () {
|
|
41
|
+
this.attempts = 0;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Set the minimum duration
|
|
45
|
+
*
|
|
46
|
+
* @api public
|
|
47
|
+
*/
|
|
48
|
+
Backoff.prototype.setMin = function (min) {
|
|
49
|
+
this.ms = min;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Set the maximum duration
|
|
53
|
+
*
|
|
54
|
+
* @api public
|
|
55
|
+
*/
|
|
56
|
+
Backoff.prototype.setMax = function (max) {
|
|
57
|
+
this.max = max;
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* Set the jitter
|
|
61
|
+
*
|
|
62
|
+
* @api public
|
|
63
|
+
*/
|
|
64
|
+
Backoff.prototype.setJitter = function (jitter) {
|
|
65
|
+
this.jitter = jitter;
|
|
66
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Manager, ManagerOptions } from "./manager.js";
|
|
2
|
+
import { DisconnectDescription, Socket, SocketOptions } from "./socket.js";
|
|
3
|
+
/**
|
|
4
|
+
* Looks up an existing `Manager` for multiplexing.
|
|
5
|
+
* If the user summons:
|
|
6
|
+
*
|
|
7
|
+
* `io('http://localhost/a');`
|
|
8
|
+
* `io('http://localhost/b');`
|
|
9
|
+
*
|
|
10
|
+
* We reuse the existing instance based on same scheme/port/host,
|
|
11
|
+
* and we initialize sockets for each namespace.
|
|
12
|
+
*
|
|
13
|
+
* @public
|
|
14
|
+
*/
|
|
15
|
+
declare function lookup(opts?: Partial<ManagerOptions & SocketOptions>): Socket;
|
|
16
|
+
declare function lookup(uri?: string, opts?: Partial<ManagerOptions & SocketOptions>): Socket;
|
|
17
|
+
/**
|
|
18
|
+
* Protocol version.
|
|
19
|
+
*
|
|
20
|
+
* @public
|
|
21
|
+
*/
|
|
22
|
+
export { protocol } from "socket.io-parser";
|
|
23
|
+
/**
|
|
24
|
+
* Expose constructors for standalone build.
|
|
25
|
+
*
|
|
26
|
+
* @public
|
|
27
|
+
*/
|
|
28
|
+
export { DisconnectDescription, Manager, ManagerOptions, Socket, SocketOptions, lookup as io, lookup as connect, lookup as default, };
|
|
29
|
+
export { Fetch, NodeXHR, XHR, NodeWebSocket, WebSocket, WebTransport, } from "engine.io-client";
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { url } from "./url.js";
|
|
2
|
+
import { Manager } from "./manager.js";
|
|
3
|
+
import { Socket } from "./socket.js";
|
|
4
|
+
/**
|
|
5
|
+
* Managers cache.
|
|
6
|
+
*/
|
|
7
|
+
const cache = {};
|
|
8
|
+
function lookup(uri, opts) {
|
|
9
|
+
if (typeof uri === "object") {
|
|
10
|
+
opts = uri;
|
|
11
|
+
uri = undefined;
|
|
12
|
+
}
|
|
13
|
+
opts = opts || {};
|
|
14
|
+
const parsed = url(uri, opts.path || "/socket.io");
|
|
15
|
+
const source = parsed.source;
|
|
16
|
+
const id = parsed.id;
|
|
17
|
+
const path = parsed.path;
|
|
18
|
+
const sameNamespace = cache[id] && path in cache[id]["nsps"];
|
|
19
|
+
const newConnection = opts.forceNew ||
|
|
20
|
+
opts["force new connection"] ||
|
|
21
|
+
false === opts.multiplex ||
|
|
22
|
+
sameNamespace;
|
|
23
|
+
let io;
|
|
24
|
+
if (newConnection) {
|
|
25
|
+
io = new Manager(source, opts);
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
if (!cache[id]) {
|
|
29
|
+
cache[id] = new Manager(source, opts);
|
|
30
|
+
}
|
|
31
|
+
io = cache[id];
|
|
32
|
+
}
|
|
33
|
+
if (parsed.query && !opts.query) {
|
|
34
|
+
opts.query = parsed.queryKey;
|
|
35
|
+
}
|
|
36
|
+
return io.socket(parsed.path, opts);
|
|
37
|
+
}
|
|
38
|
+
// so that "lookup" can be used both as a function (e.g. `io(...)`) and as a
|
|
39
|
+
// namespace (e.g. `io.connect(...)`), for backward compatibility
|
|
40
|
+
Object.assign(lookup, {
|
|
41
|
+
Manager,
|
|
42
|
+
Socket,
|
|
43
|
+
io: lookup,
|
|
44
|
+
connect: lookup,
|
|
45
|
+
});
|
|
46
|
+
/**
|
|
47
|
+
* Protocol version.
|
|
48
|
+
*
|
|
49
|
+
* @public
|
|
50
|
+
*/
|
|
51
|
+
export { protocol } from "socket.io-parser";
|
|
52
|
+
/**
|
|
53
|
+
* Expose constructors for standalone build.
|
|
54
|
+
*
|
|
55
|
+
* @public
|
|
56
|
+
*/
|
|
57
|
+
export { Manager, Socket, lookup as io, lookup as connect, lookup as default, };
|
|
58
|
+
export { Fetch, NodeXHR, XHR, NodeWebSocket, WebSocket, WebTransport, } from "engine.io-client";
|
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
import { Socket as Engine, SocketOptions as EngineOptions } from "engine.io-client";
|
|
2
|
+
import { Socket, SocketOptions, DisconnectDescription } from "./socket.js";
|
|
3
|
+
import { Packet } from "socket.io-parser";
|
|
4
|
+
import { DefaultEventsMap, EventsMap, Emitter } from "@socket.io/component-emitter";
|
|
5
|
+
export interface ManagerOptions extends EngineOptions {
|
|
6
|
+
/**
|
|
7
|
+
* Should we force a new Manager for this connection?
|
|
8
|
+
* @default false
|
|
9
|
+
*/
|
|
10
|
+
forceNew: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Should we multiplex our connection (reuse existing Manager) ?
|
|
13
|
+
* @default true
|
|
14
|
+
*/
|
|
15
|
+
multiplex: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* The path to get our client file from, in the case of the server
|
|
18
|
+
* serving it
|
|
19
|
+
* @default '/socket.io'
|
|
20
|
+
*/
|
|
21
|
+
path: string;
|
|
22
|
+
/**
|
|
23
|
+
* Should we allow reconnections?
|
|
24
|
+
* @default true
|
|
25
|
+
*/
|
|
26
|
+
reconnection: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* How many reconnection attempts should we try?
|
|
29
|
+
* @default Infinity
|
|
30
|
+
*/
|
|
31
|
+
reconnectionAttempts: number;
|
|
32
|
+
/**
|
|
33
|
+
* The time delay in milliseconds between reconnection attempts
|
|
34
|
+
* @default 1000
|
|
35
|
+
*/
|
|
36
|
+
reconnectionDelay: number;
|
|
37
|
+
/**
|
|
38
|
+
* The max time delay in milliseconds between reconnection attempts
|
|
39
|
+
* @default 5000
|
|
40
|
+
*/
|
|
41
|
+
reconnectionDelayMax: number;
|
|
42
|
+
/**
|
|
43
|
+
* Used in the exponential backoff jitter when reconnecting
|
|
44
|
+
* @default 0.5
|
|
45
|
+
*/
|
|
46
|
+
randomizationFactor: number;
|
|
47
|
+
/**
|
|
48
|
+
* The timeout in milliseconds for our connection attempt
|
|
49
|
+
* @default 20000
|
|
50
|
+
*/
|
|
51
|
+
timeout: number;
|
|
52
|
+
/**
|
|
53
|
+
* Should we automatically connect?
|
|
54
|
+
* @default true
|
|
55
|
+
*/
|
|
56
|
+
autoConnect: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* the parser to use. Defaults to an instance of the Parser that ships with socket.io.
|
|
59
|
+
*/
|
|
60
|
+
parser: any;
|
|
61
|
+
}
|
|
62
|
+
interface ManagerReservedEvents {
|
|
63
|
+
open: () => void;
|
|
64
|
+
error: (err: Error) => void;
|
|
65
|
+
ping: () => void;
|
|
66
|
+
packet: (packet: Packet) => void;
|
|
67
|
+
close: (reason: string, description?: DisconnectDescription) => void;
|
|
68
|
+
reconnect_failed: () => void;
|
|
69
|
+
reconnect_attempt: (attempt: number) => void;
|
|
70
|
+
reconnect_error: (err: Error) => void;
|
|
71
|
+
reconnect: (attempt: number) => void;
|
|
72
|
+
}
|
|
73
|
+
export declare class Manager<ListenEvents extends EventsMap = DefaultEventsMap, EmitEvents extends EventsMap = ListenEvents> extends Emitter<{}, {}, ManagerReservedEvents> {
|
|
74
|
+
/**
|
|
75
|
+
* The Engine.IO client instance
|
|
76
|
+
*
|
|
77
|
+
* @public
|
|
78
|
+
*/
|
|
79
|
+
engine: Engine;
|
|
80
|
+
/**
|
|
81
|
+
* @private
|
|
82
|
+
*/
|
|
83
|
+
_autoConnect: boolean;
|
|
84
|
+
/**
|
|
85
|
+
* @private
|
|
86
|
+
*/
|
|
87
|
+
_readyState: "opening" | "open" | "closed";
|
|
88
|
+
/**
|
|
89
|
+
* @private
|
|
90
|
+
*/
|
|
91
|
+
_reconnecting: boolean;
|
|
92
|
+
private readonly uri;
|
|
93
|
+
opts: Partial<ManagerOptions>;
|
|
94
|
+
private nsps;
|
|
95
|
+
private subs;
|
|
96
|
+
private backoff;
|
|
97
|
+
private setTimeoutFn;
|
|
98
|
+
private clearTimeoutFn;
|
|
99
|
+
private _reconnection;
|
|
100
|
+
private _reconnectionAttempts;
|
|
101
|
+
private _reconnectionDelay;
|
|
102
|
+
private _randomizationFactor;
|
|
103
|
+
private _reconnectionDelayMax;
|
|
104
|
+
private _timeout;
|
|
105
|
+
private encoder;
|
|
106
|
+
private decoder;
|
|
107
|
+
private skipReconnect;
|
|
108
|
+
/**
|
|
109
|
+
* `Manager` constructor.
|
|
110
|
+
*
|
|
111
|
+
* @param uri - engine instance or engine uri/opts
|
|
112
|
+
* @param opts - options
|
|
113
|
+
* @public
|
|
114
|
+
*/
|
|
115
|
+
constructor(opts: Partial<ManagerOptions>);
|
|
116
|
+
constructor(uri?: string, opts?: Partial<ManagerOptions>);
|
|
117
|
+
constructor(uri?: string | Partial<ManagerOptions>, opts?: Partial<ManagerOptions>);
|
|
118
|
+
/**
|
|
119
|
+
* Sets the `reconnection` config.
|
|
120
|
+
*
|
|
121
|
+
* @param {Boolean} v - true/false if it should automatically reconnect
|
|
122
|
+
* @return {Manager} self or value
|
|
123
|
+
* @public
|
|
124
|
+
*/
|
|
125
|
+
reconnection(v: boolean): this;
|
|
126
|
+
reconnection(): boolean;
|
|
127
|
+
reconnection(v?: boolean): this | boolean;
|
|
128
|
+
/**
|
|
129
|
+
* Sets the reconnection attempts config.
|
|
130
|
+
*
|
|
131
|
+
* @param {Number} v - max reconnection attempts before giving up
|
|
132
|
+
* @return {Manager} self or value
|
|
133
|
+
* @public
|
|
134
|
+
*/
|
|
135
|
+
reconnectionAttempts(v: number): this;
|
|
136
|
+
reconnectionAttempts(): number;
|
|
137
|
+
reconnectionAttempts(v?: number): this | number;
|
|
138
|
+
/**
|
|
139
|
+
* Sets the delay between reconnections.
|
|
140
|
+
*
|
|
141
|
+
* @param {Number} v - delay
|
|
142
|
+
* @return {Manager} self or value
|
|
143
|
+
* @public
|
|
144
|
+
*/
|
|
145
|
+
reconnectionDelay(v: number): this;
|
|
146
|
+
reconnectionDelay(): number;
|
|
147
|
+
reconnectionDelay(v?: number): this | number;
|
|
148
|
+
/**
|
|
149
|
+
* Sets the randomization factor
|
|
150
|
+
*
|
|
151
|
+
* @param v - the randomization factor
|
|
152
|
+
* @return self or value
|
|
153
|
+
* @public
|
|
154
|
+
*/
|
|
155
|
+
randomizationFactor(v: number): this;
|
|
156
|
+
randomizationFactor(): number;
|
|
157
|
+
randomizationFactor(v?: number): this | number;
|
|
158
|
+
/**
|
|
159
|
+
* Sets the maximum delay between reconnections.
|
|
160
|
+
*
|
|
161
|
+
* @param v - delay
|
|
162
|
+
* @return self or value
|
|
163
|
+
* @public
|
|
164
|
+
*/
|
|
165
|
+
reconnectionDelayMax(v: number): this;
|
|
166
|
+
reconnectionDelayMax(): number;
|
|
167
|
+
reconnectionDelayMax(v?: number): this | number;
|
|
168
|
+
/**
|
|
169
|
+
* Sets the connection timeout. `false` to disable
|
|
170
|
+
*
|
|
171
|
+
* @param v - connection timeout
|
|
172
|
+
* @return self or value
|
|
173
|
+
* @public
|
|
174
|
+
*/
|
|
175
|
+
timeout(v: number | boolean): this;
|
|
176
|
+
timeout(): number | boolean;
|
|
177
|
+
timeout(v?: number | boolean): this | number | boolean;
|
|
178
|
+
/**
|
|
179
|
+
* Starts trying to reconnect if reconnection is enabled and we have not
|
|
180
|
+
* started reconnecting yet
|
|
181
|
+
*
|
|
182
|
+
* @private
|
|
183
|
+
*/
|
|
184
|
+
private maybeReconnectOnOpen;
|
|
185
|
+
/**
|
|
186
|
+
* Sets the current transport `socket`.
|
|
187
|
+
*
|
|
188
|
+
* @param {Function} fn - optional, callback
|
|
189
|
+
* @return self
|
|
190
|
+
* @public
|
|
191
|
+
*/
|
|
192
|
+
open(fn?: (err?: Error) => void): this;
|
|
193
|
+
/**
|
|
194
|
+
* Alias for open()
|
|
195
|
+
*
|
|
196
|
+
* @return self
|
|
197
|
+
* @public
|
|
198
|
+
*/
|
|
199
|
+
connect(fn?: (err?: Error) => void): this;
|
|
200
|
+
/**
|
|
201
|
+
* Called upon transport open.
|
|
202
|
+
*
|
|
203
|
+
* @private
|
|
204
|
+
*/
|
|
205
|
+
private onopen;
|
|
206
|
+
/**
|
|
207
|
+
* Called upon a ping.
|
|
208
|
+
*
|
|
209
|
+
* @private
|
|
210
|
+
*/
|
|
211
|
+
private onping;
|
|
212
|
+
/**
|
|
213
|
+
* Called with data.
|
|
214
|
+
*
|
|
215
|
+
* @private
|
|
216
|
+
*/
|
|
217
|
+
private ondata;
|
|
218
|
+
/**
|
|
219
|
+
* Called when parser fully decodes a packet.
|
|
220
|
+
*
|
|
221
|
+
* @private
|
|
222
|
+
*/
|
|
223
|
+
private ondecoded;
|
|
224
|
+
/**
|
|
225
|
+
* Called upon socket error.
|
|
226
|
+
*
|
|
227
|
+
* @private
|
|
228
|
+
*/
|
|
229
|
+
private onerror;
|
|
230
|
+
/**
|
|
231
|
+
* Creates a new socket for the given `nsp`.
|
|
232
|
+
*
|
|
233
|
+
* @return {Socket}
|
|
234
|
+
* @public
|
|
235
|
+
*/
|
|
236
|
+
socket(nsp: string, opts?: Partial<SocketOptions>): Socket;
|
|
237
|
+
/**
|
|
238
|
+
* Called upon a socket close.
|
|
239
|
+
*
|
|
240
|
+
* @param socket
|
|
241
|
+
* @private
|
|
242
|
+
*/
|
|
243
|
+
_destroy(socket: Socket): void;
|
|
244
|
+
/**
|
|
245
|
+
* Writes a packet.
|
|
246
|
+
*
|
|
247
|
+
* @param packet
|
|
248
|
+
* @private
|
|
249
|
+
*/
|
|
250
|
+
_packet(packet: Partial<Packet & {
|
|
251
|
+
query: string;
|
|
252
|
+
options: any;
|
|
253
|
+
}>): void;
|
|
254
|
+
/**
|
|
255
|
+
* Clean up transport subscriptions and packet buffer.
|
|
256
|
+
*
|
|
257
|
+
* @private
|
|
258
|
+
*/
|
|
259
|
+
private cleanup;
|
|
260
|
+
/**
|
|
261
|
+
* Close the current socket.
|
|
262
|
+
*
|
|
263
|
+
* @private
|
|
264
|
+
*/
|
|
265
|
+
_close(): void;
|
|
266
|
+
/**
|
|
267
|
+
* Alias for close()
|
|
268
|
+
*
|
|
269
|
+
* @private
|
|
270
|
+
*/
|
|
271
|
+
private disconnect;
|
|
272
|
+
/**
|
|
273
|
+
* Called when:
|
|
274
|
+
*
|
|
275
|
+
* - the low-level engine is closed
|
|
276
|
+
* - the parser encountered a badly formatted packet
|
|
277
|
+
* - all sockets are disconnected
|
|
278
|
+
*
|
|
279
|
+
* @private
|
|
280
|
+
*/
|
|
281
|
+
private onclose;
|
|
282
|
+
/**
|
|
283
|
+
* Attempt a reconnection.
|
|
284
|
+
*
|
|
285
|
+
* @private
|
|
286
|
+
*/
|
|
287
|
+
private reconnect;
|
|
288
|
+
/**
|
|
289
|
+
* Called upon successful reconnect.
|
|
290
|
+
*
|
|
291
|
+
* @private
|
|
292
|
+
*/
|
|
293
|
+
private onreconnect;
|
|
294
|
+
}
|
|
295
|
+
export {};
|