@openclaw/firecrawl-plugin 2026.7.1-beta.2 → 2026.7.1-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api.js +1 -1
- package/dist/{firecrawl-client-uDbJtqeP.js → firecrawl-client-xZqyVUBg.js} +8 -10
- package/dist/{firecrawl-fetch-provider-BG92VjO3.js → firecrawl-fetch-provider-CasPevAg.js} +7 -2
- package/dist/{firecrawl-search-provider-CsDudtpj.js → firecrawl-search-provider-C_iN9LEC.js} +1 -1
- package/dist/index.js +3 -3
- package/dist/web-fetch-provider.js +1 -1
- package/dist/web-search-provider.js +1 -1
- package/dist/web-search-shared.js +10 -9
- package/node_modules/typebox/build/compile/validator.d.mts +2 -7
- package/node_modules/typebox/build/compile/validator.mjs +6 -36
- package/node_modules/typebox/build/error/errors.d.mts +1 -7
- package/node_modules/typebox/build/format/_idna.mjs +36 -6
- package/node_modules/typebox/build/format/_puny.mjs +4 -1
- package/node_modules/typebox/build/format/uuid.d.mts +2 -2
- package/node_modules/typebox/build/format/uuid.mjs +3 -3
- package/node_modules/typebox/build/guard/emit.d.mts +0 -4
- package/node_modules/typebox/build/guard/emit.mjs +0 -8
- package/node_modules/typebox/build/guard/guard.d.mts +4 -8
- package/node_modules/typebox/build/guard/guard.mjs +5 -13
- package/node_modules/typebox/build/schema/engine/boolean.d.mts +3 -3
- package/node_modules/typebox/build/schema/engine/boolean.mjs +4 -4
- package/node_modules/typebox/build/schema/engine/index.d.mts +0 -1
- package/node_modules/typebox/build/schema/engine/index.mjs +0 -1
- package/node_modules/typebox/build/schema/engine/schema.mjs +5 -10
- package/node_modules/typebox/build/schema/engine/type.mjs +14 -18
- package/node_modules/typebox/build/schema/types/dependencies.mjs +1 -1
- package/node_modules/typebox/build/schema/types/index.d.mts +0 -1
- package/node_modules/typebox/build/schema/types/index.mjs +0 -1
- package/node_modules/typebox/build/schema/types/schema.d.mts +1 -1
- package/node_modules/typebox/build/schema/types/schema.mjs +2 -2
- package/node_modules/typebox/build/system/locale/ar_001.mjs +0 -1
- package/node_modules/typebox/build/system/locale/bn_BD.mjs +0 -1
- package/node_modules/typebox/build/system/locale/cs_CZ.mjs +0 -1
- package/node_modules/typebox/build/system/locale/de_DE.mjs +0 -1
- package/node_modules/typebox/build/system/locale/el_GR.mjs +0 -1
- package/node_modules/typebox/build/system/locale/en_US.mjs +0 -1
- package/node_modules/typebox/build/system/locale/es_419.mjs +0 -1
- package/node_modules/typebox/build/system/locale/es_AR.mjs +0 -1
- package/node_modules/typebox/build/system/locale/es_ES.mjs +0 -1
- package/node_modules/typebox/build/system/locale/es_MX.mjs +0 -1
- package/node_modules/typebox/build/system/locale/fa_IR.mjs +0 -1
- package/node_modules/typebox/build/system/locale/fil_PH.mjs +0 -1
- package/node_modules/typebox/build/system/locale/fr_CA.mjs +0 -1
- package/node_modules/typebox/build/system/locale/fr_FR.mjs +0 -1
- package/node_modules/typebox/build/system/locale/ha_NG.mjs +0 -1
- package/node_modules/typebox/build/system/locale/hi_IN.mjs +0 -1
- package/node_modules/typebox/build/system/locale/hu_HU.mjs +0 -1
- package/node_modules/typebox/build/system/locale/id_ID.mjs +0 -1
- package/node_modules/typebox/build/system/locale/it_IT.mjs +0 -1
- package/node_modules/typebox/build/system/locale/ja_JP.mjs +0 -1
- package/node_modules/typebox/build/system/locale/ko_KR.mjs +0 -1
- package/node_modules/typebox/build/system/locale/ms_MY.mjs +0 -1
- package/node_modules/typebox/build/system/locale/nl_NL.mjs +0 -1
- package/node_modules/typebox/build/system/locale/pl_PL.mjs +0 -1
- package/node_modules/typebox/build/system/locale/pt_BR.mjs +0 -1
- package/node_modules/typebox/build/system/locale/pt_PT.mjs +0 -1
- package/node_modules/typebox/build/system/locale/ro_RO.mjs +0 -1
- package/node_modules/typebox/build/system/locale/ru_RU.mjs +0 -1
- package/node_modules/typebox/build/system/locale/sv_SE.mjs +0 -1
- package/node_modules/typebox/build/system/locale/sw_TZ.mjs +0 -1
- package/node_modules/typebox/build/system/locale/th_TH.mjs +0 -1
- package/node_modules/typebox/build/system/locale/tr_TR.mjs +0 -1
- package/node_modules/typebox/build/system/locale/uk_UA.mjs +0 -1
- package/node_modules/typebox/build/system/locale/ur_PK.mjs +0 -1
- package/node_modules/typebox/build/system/locale/vi_VN.mjs +0 -1
- package/node_modules/typebox/build/system/locale/yo_NG.mjs +0 -1
- package/node_modules/typebox/build/system/locale/zh_Hans.mjs +0 -1
- package/node_modules/typebox/build/system/locale/zh_Hant.mjs +0 -1
- package/node_modules/typebox/build/system/memory/clone.d.mts +2 -3
- package/node_modules/typebox/build/system/memory/clone.mjs +73 -26
- package/node_modules/typebox/build/system/settings/settings.d.mts +15 -0
- package/node_modules/typebox/build/system/settings/settings.mjs +3 -1
- package/node_modules/typebox/build/type/action/_add_immutable.d.mts +11 -0
- package/node_modules/typebox/build/type/action/_add_immutable.mjs +11 -0
- package/node_modules/typebox/build/type/action/_add_optional.d.mts +11 -0
- package/node_modules/typebox/build/type/action/_add_optional.mjs +11 -0
- package/node_modules/typebox/build/type/action/_add_readonly.d.mts +11 -0
- package/node_modules/typebox/build/type/action/_add_readonly.mjs +11 -0
- package/node_modules/typebox/build/type/action/_remove_immutable.d.mts +11 -0
- package/node_modules/typebox/build/type/action/_remove_immutable.mjs +11 -0
- package/node_modules/typebox/build/type/action/_remove_optional.d.mts +11 -0
- package/node_modules/typebox/build/type/action/_remove_optional.mjs +11 -0
- package/node_modules/typebox/build/type/action/_remove_readonly.d.mts +11 -0
- package/node_modules/typebox/build/type/action/_remove_readonly.mjs +11 -0
- package/node_modules/typebox/build/type/action/conditional.d.mts +2 -3
- package/node_modules/typebox/build/type/action/conditional.mjs +2 -1
- package/node_modules/typebox/build/type/action/index.d.mts +7 -4
- package/node_modules/typebox/build/type/action/index.mjs +7 -4
- package/node_modules/typebox/build/type/action/mapped.d.mts +2 -3
- package/node_modules/typebox/build/type/action/mapped.mjs +2 -1
- package/node_modules/typebox/build/type/action/module.d.mts +8 -7
- package/node_modules/typebox/build/type/action/module.mjs +7 -6
- package/node_modules/typebox/build/type/action/readonly_object.d.mts +0 -5
- package/node_modules/typebox/build/type/action/readonly_object.mjs +0 -5
- package/node_modules/typebox/build/type/action/with.d.mts +11 -0
- package/node_modules/typebox/build/type/action/with.mjs +11 -0
- package/node_modules/typebox/build/type/engine/call/distribute_arguments.mjs +1 -1
- package/node_modules/typebox/build/type/engine/call/instantiate.d.mts +1 -3
- package/node_modules/typebox/build/type/engine/call/instantiate.mjs +3 -2
- package/node_modules/typebox/build/type/engine/call/resolve_arguments.mjs +2 -2
- package/node_modules/typebox/build/type/engine/constructor_parameters/instantiate.d.mts +3 -4
- package/node_modules/typebox/build/type/engine/constructor_parameters/instantiate.mjs +2 -1
- package/node_modules/typebox/build/type/engine/cyclic/candidates.d.mts +2 -3
- package/node_modules/typebox/build/type/engine/cyclic/candidates.mjs +3 -6
- package/node_modules/typebox/build/type/engine/cyclic/check.d.mts +6 -9
- package/node_modules/typebox/build/type/engine/cyclic/check.mjs +10 -16
- package/node_modules/typebox/build/type/engine/cyclic/dependencies.d.mts +1 -4
- package/node_modules/typebox/build/type/engine/cyclic/dependencies.mjs +9 -15
- package/node_modules/typebox/build/type/engine/cyclic/extends.d.mts +1 -4
- package/node_modules/typebox/build/type/engine/cyclic/extends.mjs +8 -14
- package/node_modules/typebox/build/type/engine/cyclic/instantiate.d.mts +2 -5
- package/node_modules/typebox/build/type/engine/cyclic/instantiate.mjs +3 -2
- package/node_modules/typebox/build/type/engine/enum/index.d.mts +0 -1
- package/node_modules/typebox/build/type/engine/enum/index.mjs +0 -1
- package/node_modules/typebox/build/type/engine/evaluate/broaden.d.mts +1 -2
- package/node_modules/typebox/build/type/engine/evaluate/broaden.mjs +2 -6
- package/node_modules/typebox/build/type/engine/evaluate/composite.d.mts +10 -6
- package/node_modules/typebox/build/type/engine/evaluate/composite.mjs +10 -6
- package/node_modules/typebox/build/type/engine/evaluate/distribute.d.mts +2 -1
- package/node_modules/typebox/build/type/engine/evaluate/distribute.mjs +3 -3
- package/node_modules/typebox/build/type/engine/evaluate/evaluate.d.mts +17 -5
- package/node_modules/typebox/build/type/engine/evaluate/evaluate.mjs +34 -8
- package/node_modules/typebox/build/type/engine/exclude/operation.d.mts +5 -6
- package/node_modules/typebox/build/type/engine/exclude/operation.mjs +11 -12
- package/node_modules/typebox/build/type/engine/extract/operation.d.mts +5 -6
- package/node_modules/typebox/build/type/engine/extract/operation.mjs +11 -12
- package/node_modules/typebox/build/type/engine/immutable/instantiate_add.d.mts +10 -0
- package/node_modules/typebox/build/type/engine/immutable/instantiate_add.mjs +14 -0
- package/node_modules/typebox/build/type/engine/immutable/instantiate_remove.d.mts +10 -0
- package/node_modules/typebox/build/type/engine/immutable/instantiate_remove.mjs +14 -0
- package/node_modules/typebox/build/type/engine/index.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/index.mjs +2 -2
- package/node_modules/typebox/build/type/engine/indexable/from_dependent.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/indexable/from_dependent.mjs +8 -0
- package/node_modules/typebox/build/type/engine/indexable/from_enum.d.mts +3 -3
- package/node_modules/typebox/build/type/engine/indexable/from_enum.mjs +4 -4
- package/node_modules/typebox/build/type/engine/indexable/from_template_literal.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/indexable/from_template_literal.mjs +3 -3
- package/node_modules/typebox/build/type/engine/indexable/from_type.d.mts +3 -1
- package/node_modules/typebox/build/type/engine/indexable/from_type.mjs +9 -6
- package/node_modules/typebox/build/type/engine/indexed/instantiate.d.mts +2 -1
- package/node_modules/typebox/build/type/engine/indexed/instantiate.mjs +5 -2
- package/node_modules/typebox/build/type/engine/instantiate.d.mts +44 -31
- package/node_modules/typebox/build/type/engine/instantiate.mjs +82 -83
- package/node_modules/typebox/build/type/engine/interface/instantiate.d.mts +3 -6
- package/node_modules/typebox/build/type/engine/intrinsics/from_template_literal.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/intrinsics/from_template_literal.mjs +3 -3
- package/node_modules/typebox/build/type/engine/keyof/instantiate.d.mts +2 -1
- package/node_modules/typebox/build/type/engine/keyof/instantiate.mjs +5 -1
- package/node_modules/typebox/build/type/engine/mapped/mapped_operation.d.mts +4 -4
- package/node_modules/typebox/build/type/engine/mapped/mapped_operation.mjs +3 -3
- package/node_modules/typebox/build/type/engine/mapped/mapped_variants.d.mts +5 -4
- package/node_modules/typebox/build/type/engine/mapped/mapped_variants.mjs +10 -5
- package/node_modules/typebox/build/type/engine/module/instantiate.d.mts +7 -9
- package/node_modules/typebox/build/type/engine/module/instantiate.mjs +17 -15
- package/node_modules/typebox/build/type/engine/object/from_dependent.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/object/from_dependent.mjs +8 -0
- package/node_modules/typebox/build/type/engine/object/from_type.d.mts +3 -1
- package/node_modules/typebox/build/type/engine/object/from_type.mjs +8 -5
- package/node_modules/typebox/build/type/engine/object/from_union.mjs +2 -2
- package/node_modules/typebox/build/type/engine/optional/instantiate_add.d.mts +10 -0
- package/node_modules/typebox/build/type/engine/optional/instantiate_add.mjs +14 -0
- package/node_modules/typebox/build/type/engine/optional/instantiate_remove.d.mts +10 -0
- package/node_modules/typebox/build/type/engine/optional/instantiate_remove.mjs +14 -0
- package/node_modules/typebox/build/type/engine/parameters/instantiate.d.mts +3 -4
- package/node_modules/typebox/build/type/engine/parameters/instantiate.mjs +2 -1
- package/node_modules/typebox/build/type/engine/partial/from_dependent.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/partial/from_dependent.mjs +8 -0
- package/node_modules/typebox/build/type/engine/partial/from_intersect.d.mts +1 -1
- package/node_modules/typebox/build/type/engine/partial/from_intersect.mjs +3 -2
- package/node_modules/typebox/build/type/engine/partial/from_object.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/partial/from_object.mjs +2 -2
- package/node_modules/typebox/build/type/engine/partial/from_type.d.mts +3 -1
- package/node_modules/typebox/build/type/engine/partial/from_type.mjs +7 -4
- package/node_modules/typebox/build/type/engine/priority/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/priority/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/priority/priority.d.mts +20 -0
- package/node_modules/typebox/build/type/engine/priority/priority.mjs +28 -0
- package/node_modules/typebox/build/type/engine/readonly/instantiate_add.d.mts +10 -0
- package/node_modules/typebox/build/type/engine/readonly/instantiate_add.mjs +14 -0
- package/node_modules/typebox/build/type/engine/readonly/instantiate_remove.d.mts +10 -0
- package/node_modules/typebox/build/type/engine/readonly/instantiate_remove.mjs +14 -0
- package/node_modules/typebox/build/type/engine/readonly_object/from_array.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/readonly_object/from_array.mjs +2 -2
- package/node_modules/typebox/build/type/engine/readonly_object/from_dependent.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/readonly_object/from_dependent.mjs +8 -0
- package/node_modules/typebox/build/type/engine/readonly_object/from_intersect.d.mts +1 -1
- package/node_modules/typebox/build/type/engine/readonly_object/from_intersect.mjs +3 -2
- package/node_modules/typebox/build/type/engine/readonly_object/from_object.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/readonly_object/from_object.mjs +2 -2
- package/node_modules/typebox/build/type/engine/readonly_object/from_tuple.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/readonly_object/from_tuple.mjs +2 -2
- package/node_modules/typebox/build/type/engine/readonly_object/from_type.d.mts +3 -1
- package/node_modules/typebox/build/type/engine/readonly_object/from_type.mjs +8 -5
- package/node_modules/typebox/build/type/engine/record/from_key_enum.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/record/from_key_enum.mjs +2 -2
- package/node_modules/typebox/build/type/engine/record/from_key_template_literal.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/record/from_key_template_literal.mjs +2 -2
- package/node_modules/typebox/build/type/engine/ref/instantiate.d.mts +3 -3
- package/node_modules/typebox/build/type/engine/ref/instantiate.mjs +6 -6
- package/node_modules/typebox/build/type/engine/required/from_dependent.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/required/from_dependent.mjs +8 -0
- package/node_modules/typebox/build/type/engine/required/from_intersect.d.mts +1 -1
- package/node_modules/typebox/build/type/engine/required/from_intersect.mjs +3 -2
- package/node_modules/typebox/build/type/engine/required/from_object.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/required/from_object.mjs +2 -2
- package/node_modules/typebox/build/type/engine/required/from_type.d.mts +3 -1
- package/node_modules/typebox/build/type/engine/required/from_type.mjs +7 -4
- package/node_modules/typebox/build/type/engine/template_literal/decode.mjs +3 -3
- package/node_modules/typebox/build/type/engine/template_literal/encode.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/template_literal/encode.mjs +6 -6
- package/node_modules/typebox/build/type/engine/template_literal/is_finite.mjs +1 -1
- package/node_modules/typebox/build/type/engine/template_literal/is_pattern.mjs +1 -0
- package/node_modules/typebox/build/type/engine/this/expand_this.d.mts +1 -4
- package/node_modules/typebox/build/type/engine/this/expand_this.mjs +7 -13
- package/node_modules/typebox/build/type/engine/with/instantiate.d.mts +8 -0
- package/node_modules/typebox/build/type/engine/{options → with}/instantiate.mjs +5 -5
- package/node_modules/typebox/build/type/extends/dependent.d.mts +6 -0
- package/node_modules/typebox/build/type/extends/dependent.mjs +6 -0
- package/node_modules/typebox/build/type/extends/enum.d.mts +4 -4
- package/node_modules/typebox/build/type/extends/enum.mjs +3 -2
- package/node_modules/typebox/build/type/extends/extends_left.d.mts +5 -7
- package/node_modules/typebox/build/type/extends/extends_left.mjs +24 -27
- package/node_modules/typebox/build/type/extends/extends_right.d.mts +7 -5
- package/node_modules/typebox/build/type/extends/extends_right.mjs +20 -15
- package/node_modules/typebox/build/type/extends/inference.mjs +1 -1
- package/node_modules/typebox/build/type/extends/object.d.mts +8 -1
- package/node_modules/typebox/build/type/extends/object.mjs +25 -3
- package/node_modules/typebox/build/type/extends/parameters.mjs +2 -2
- package/node_modules/typebox/build/type/extends/record.d.mts +13 -0
- package/node_modules/typebox/build/type/extends/record.mjs +23 -0
- package/node_modules/typebox/build/type/extends/template_literal.d.mts +3 -3
- package/node_modules/typebox/build/type/extends/template_literal.mjs +3 -3
- package/node_modules/typebox/build/type/extends/tuple.d.mts +3 -6
- package/node_modules/typebox/build/type/extends/tuple.mjs +6 -5
- package/node_modules/typebox/build/type/extends/union.mjs +2 -2
- package/node_modules/typebox/build/type/script/mapping.d.mts +84 -99
- package/node_modules/typebox/build/type/script/mapping.mjs +81 -85
- package/node_modules/typebox/build/type/script/parser.d.mts +40 -40
- package/node_modules/typebox/build/type/script/parser.mjs +22 -22
- package/node_modules/typebox/build/type/script/script.d.mts +3 -4
- package/node_modules/typebox/build/type/script/script.mjs +3 -2
- package/node_modules/typebox/build/type/script/token/internal/guard.d.mts +1 -1
- package/node_modules/typebox/build/type/script/token/internal/guard.mjs +1 -1
- package/node_modules/typebox/build/type/script/token/internal/take.mjs +1 -1
- package/node_modules/typebox/build/type/script/token/until.mjs +2 -2
- package/node_modules/typebox/build/type/types/_codec.d.mts +12 -12
- package/node_modules/typebox/build/type/types/_codec.mjs +0 -1
- package/node_modules/typebox/build/type/types/_immutable.d.mts +2 -9
- package/node_modules/typebox/build/type/types/_immutable.mjs +2 -10
- package/node_modules/typebox/build/type/types/_optional.d.mts +2 -9
- package/node_modules/typebox/build/type/types/_optional.mjs +2 -11
- package/node_modules/typebox/build/type/types/_readonly.d.mts +2 -9
- package/node_modules/typebox/build/type/types/_readonly.mjs +2 -10
- package/node_modules/typebox/build/type/types/_refine.d.mts +8 -10
- package/node_modules/typebox/build/type/types/_refine.mjs +1 -2
- package/node_modules/typebox/build/type/types/call.d.mts +3 -3
- package/node_modules/typebox/build/type/types/call.mjs +3 -2
- package/node_modules/typebox/build/type/types/deferred.d.mts +1 -0
- package/node_modules/typebox/build/type/types/deferred.mjs +1 -1
- package/node_modules/typebox/build/type/types/dependent.d.mts +17 -0
- package/node_modules/typebox/build/type/types/dependent.mjs +24 -0
- package/node_modules/typebox/build/type/types/enum.d.mts +3 -1
- package/node_modules/typebox/build/type/types/enum.mjs +5 -0
- package/node_modules/typebox/build/type/types/index.d.mts +1 -4
- package/node_modules/typebox/build/type/types/index.mjs +1 -4
- package/node_modules/typebox/build/type/types/number.d.mts +1 -1
- package/node_modules/typebox/build/type/types/number.mjs +1 -1
- package/node_modules/typebox/build/type/types/record.d.mts +13 -7
- package/node_modules/typebox/build/type/types/record.mjs +15 -9
- package/node_modules/typebox/build/type/types/static.d.mts +2 -5
- package/node_modules/typebox/build/typebox.d.mts +4 -8
- package/node_modules/typebox/build/typebox.mjs +4 -8
- package/node_modules/typebox/build/value/clean/clean.mjs +4 -2
- package/node_modules/typebox/build/value/clean/from_intersect.mjs +2 -2
- package/node_modules/typebox/build/value/clean/from_type.mjs +8 -10
- package/node_modules/typebox/build/value/clean/from_union.d.mts +1 -1
- package/node_modules/typebox/build/value/clean/from_union.mjs +1 -2
- package/node_modules/typebox/build/value/clone/clone.mjs +2 -73
- package/node_modules/typebox/build/value/codec/decode.mjs +4 -2
- package/node_modules/typebox/build/value/codec/encode.mjs +4 -2
- package/node_modules/typebox/build/value/codec/from_array.mjs +1 -4
- package/node_modules/typebox/build/value/codec/from_object.mjs +1 -4
- package/node_modules/typebox/build/value/codec/from_record.mjs +2 -7
- package/node_modules/typebox/build/value/codec/from_tuple.mjs +1 -4
- package/node_modules/typebox/build/value/codec/from_union.mjs +2 -3
- package/node_modules/typebox/build/value/convert/from_enum.mjs +3 -4
- package/node_modules/typebox/build/value/convert/from_template_literal.d.mts +1 -1
- package/node_modules/typebox/build/value/convert/from_template_literal.mjs +2 -3
- package/node_modules/typebox/build/value/convert/from_type.mjs +19 -21
- package/node_modules/typebox/build/value/create/from_enum.mjs +2 -2
- package/node_modules/typebox/build/value/create/from_type.mjs +23 -31
- package/node_modules/typebox/build/value/default/from_object.mjs +1 -1
- package/node_modules/typebox/build/value/default/from_type.mjs +8 -10
- package/node_modules/typebox/build/value/index.d.mts +0 -1
- package/node_modules/typebox/build/value/index.mjs +0 -1
- package/node_modules/typebox/build/value/repair/from_enum.mjs +2 -3
- package/node_modules/typebox/build/value/repair/from_type.mjs +24 -22
- package/node_modules/typebox/build/value/shared/union_priority_sort.d.mts +6 -2
- package/node_modules/typebox/build/value/shared/union_priority_sort.mjs +62 -26
- package/node_modules/typebox/build/value/value.d.mts +0 -1
- package/node_modules/typebox/build/value/value.mjs +0 -1
- package/node_modules/typebox/package.json +25 -25
- package/node_modules/typebox/readme.md +97 -80
- package/npm-shrinkwrap.json +6 -6
- package/package.json +5 -5
- package/node_modules/typebox/build/schema/engine/_guard.d.mts +0 -6
- package/node_modules/typebox/build/schema/engine/_guard.mjs +0 -26
- package/node_modules/typebox/build/schema/types/_guard.d.mts +0 -10
- package/node_modules/typebox/build/schema/types/_guard.mjs +0 -16
- package/node_modules/typebox/build/type/action/_optional.d.mts +0 -19
- package/node_modules/typebox/build/type/action/_optional.mjs +0 -40
- package/node_modules/typebox/build/type/action/_readonly.d.mts +0 -19
- package/node_modules/typebox/build/type/action/_readonly.mjs +0 -40
- package/node_modules/typebox/build/type/action/awaited.d.mts +0 -15
- package/node_modules/typebox/build/type/action/awaited.mjs +0 -15
- package/node_modules/typebox/build/type/action/options.d.mts +0 -11
- package/node_modules/typebox/build/type/action/options.mjs +0 -11
- package/node_modules/typebox/build/type/engine/awaited/instantiate.d.mts +0 -11
- package/node_modules/typebox/build/type/engine/awaited/instantiate.mjs +0 -20
- package/node_modules/typebox/build/type/engine/enum/enum_to_union.d.mts +0 -14
- package/node_modules/typebox/build/type/engine/enum/enum_to_union.mjs +0 -24
- package/node_modules/typebox/build/type/engine/options/index.d.mts +0 -1
- package/node_modules/typebox/build/type/engine/options/index.mjs +0 -1
- package/node_modules/typebox/build/type/engine/options/instantiate.d.mts +0 -8
- package/node_modules/typebox/build/type/extends/async_iterator.d.mts +0 -7
- package/node_modules/typebox/build/type/extends/async_iterator.mjs +0 -9
- package/node_modules/typebox/build/type/extends/iterator.d.mts +0 -7
- package/node_modules/typebox/build/type/extends/iterator.mjs +0 -9
- package/node_modules/typebox/build/type/extends/promise.d.mts +0 -7
- package/node_modules/typebox/build/type/extends/promise.mjs +0 -9
- package/node_modules/typebox/build/type/types/async_iterator.d.mts +0 -20
- package/node_modules/typebox/build/type/types/async_iterator.mjs +0 -28
- package/node_modules/typebox/build/type/types/base.d.mts +0 -50
- package/node_modules/typebox/build/type/types/base.mjs +0 -84
- package/node_modules/typebox/build/type/types/iterator.d.mts +0 -20
- package/node_modules/typebox/build/type/types/iterator.mjs +0 -28
- package/node_modules/typebox/build/type/types/promise.d.mts +0 -21
- package/node_modules/typebox/build/type/types/promise.mjs +0 -29
- package/node_modules/typebox/build/value/clean/from_base.d.mts +0 -2
- package/node_modules/typebox/build/value/clean/from_base.mjs +0 -4
- package/node_modules/typebox/build/value/convert/from_base.d.mts +0 -2
- package/node_modules/typebox/build/value/convert/from_base.mjs +0 -4
- package/node_modules/typebox/build/value/create/from_async_iterator.d.mts +0 -2
- package/node_modules/typebox/build/value/create/from_async_iterator.mjs +0 -5
- package/node_modules/typebox/build/value/create/from_base.d.mts +0 -2
- package/node_modules/typebox/build/value/create/from_base.mjs +0 -4
- package/node_modules/typebox/build/value/create/from_iterator.d.mts +0 -2
- package/node_modules/typebox/build/value/create/from_iterator.mjs +0 -5
- package/node_modules/typebox/build/value/create/from_promise.d.mts +0 -2
- package/node_modules/typebox/build/value/create/from_promise.mjs +0 -5
- package/node_modules/typebox/build/value/default/from_base.d.mts +0 -2
- package/node_modules/typebox/build/value/default/from_base.mjs +0 -5
- package/node_modules/typebox/build/value/mutate/error.d.mts +0 -3
- package/node_modules/typebox/build/value/mutate/error.mjs +0 -6
- package/node_modules/typebox/build/value/mutate/from_array.d.mts +0 -2
- package/node_modules/typebox/build/value/mutate/from_array.mjs +0 -16
- package/node_modules/typebox/build/value/mutate/from_object.d.mts +0 -2
- package/node_modules/typebox/build/value/mutate/from_object.mjs +0 -40
- package/node_modules/typebox/build/value/mutate/from_unknown.d.mts +0 -2
- package/node_modules/typebox/build/value/mutate/from_unknown.mjs +0 -7
- package/node_modules/typebox/build/value/mutate/from_value.d.mts +0 -2
- package/node_modules/typebox/build/value/mutate/from_value.mjs +0 -12
- package/node_modules/typebox/build/value/mutate/index.d.mts +0 -1
- package/node_modules/typebox/build/value/mutate/index.mjs +0 -1
- package/node_modules/typebox/build/value/mutate/mutate.d.mts +0 -11
- package/node_modules/typebox/build/value/mutate/mutate.mjs +0 -41
- package/node_modules/typebox/build/value/repair/from_base.d.mts +0 -2
- package/node_modules/typebox/build/value/repair/from_base.mjs +0 -8
- /package/node_modules/typebox/build/type/engine/{awaited → with}/index.d.mts +0 -0
- /package/node_modules/typebox/build/type/engine/{awaited → with}/index.mjs +0 -0
|
@@ -50,7 +50,7 @@ type T = Type.Static<typeof T> // type T = {
|
|
|
50
50
|
|
|
51
51
|
[Documentation](https://sinclairzx81.github.io/typebox/)
|
|
52
52
|
|
|
53
|
-
TypeBox is a runtime type system that creates in-memory JSON Schema objects that infer as TypeScript types. The schematics produced by this library are designed to match the static type checking rules of the TypeScript compiler. TypeBox offers a unified type
|
|
53
|
+
TypeBox is a runtime type system that creates in-memory JSON Schema objects that infer as TypeScript types. The schematics produced by this library are designed to match the static type checking rules of the TypeScript compiler. TypeBox offers a unified type that can be statically checked by TypeScript and runtime checked using standard JSON Schema validation.
|
|
54
54
|
|
|
55
55
|
This library is designed to allow JSON Schema to compose similar to how types compose within TypeScript's type system. It can be used as a simple tool to build up complex schematics or integrated into REST and RPC services to help validate data received over the wire.
|
|
56
56
|
|
|
@@ -73,7 +73,7 @@ License: MIT
|
|
|
73
73
|
|
|
74
74
|
TypeBox types are JSON Schema fragments that compose into more complex types. The library offers a set of types used to construct JSON Schema compliant schematics as well as a set of extended types used to model constructs native to the JavaScript language. The schematics produced by TypeBox can be passed directly to any JSON Schema compliant validator.
|
|
75
75
|
|
|
76
|
-
|
|
76
|
+
### Example
|
|
77
77
|
|
|
78
78
|
The following creates a User type and infers with Static.
|
|
79
79
|
|
|
@@ -111,113 +111,130 @@ type User = Type.Static<typeof User> // type User = {
|
|
|
111
111
|
|
|
112
112
|
## Script
|
|
113
113
|
|
|
114
|
-
[Documentation](https://sinclairzx81.github.io/typebox/#/docs/script/overview) | [Example 1](https://www.typescriptlang.org/play
|
|
114
|
+
[Documentation](https://sinclairzx81.github.io/typebox/#/docs/script/overview) | [Example 1](https://www.typescriptlang.org/play/?target=99&module=7#code/JYWwDg9gTgLgBAFQJ5gKZwGZQiOByGFVAIwgA88AoSgehrgFonmXW32POv3b7k0AdAGUAxlGBgYACjwC5eAJS9G3VWvXdqdOADkAhiFQBnMHpGpKIiADsj8ALJ6YACzgBeREWFiJ0gAaUcHCEaHAAaqgiMNAATO5wAN5wZABccNYAriDEqFAANHBIaZnZuXAAvoHBROGR0VAAzPEAogBuegA2GU6oADwRUbFwAGSJcABexVk5UBUAfFUh6AP1ACwt7V09-XXQTaNJAO5TpbPlC35KygAiqGjWACao1vD6hiZmFla28En2xq5yvF+KhvOJJFIknIBI4XBUCn4gosahFYKgyPEElUgpAjMAYMAbGkVtBVnlseloCBOsTdo1yUEghlWrTBlAYlVKkElnAAOKoHCoGBQJCYimtXIE8xGWlosgAbQAugzGcBHsBpScZkrOcjQrDcsBOmLGXADMRgM8YKy1iqgg9gBgMBkjKgbaS7XATJEMh09FB3VBVrruTV-kZXB4saaAOYCwzCop8+NCkWe6kwQ00uAG8SdXWXLT0ABKGReoHQxdQGA6dUJ1ko4ecAjA2DQsEtRgEccFiZbbclnYEEo70oE+NQIC7rYg7YJxhbEDxBJs-dng4XZEbALXc6HPYTIt3G67I6lC4nU+PHYX1ipnWv867W6bj-3Kb7M73C7PGovmavL8TwEZk303bcIzArsMyzDooIEB0nRdUEgJvZ8IObVCnwEGC8zgrCh3NS0Xngl8dwIhdcKNfCBzQgRvREX1-VIos4CEGAnA1OAAElrAwXJnnMShnWsKJ6zgKBnieKApHeZw0hBYQOKlXolggDAcwBOYFESKo5O7D8j1-aV5QABkVRdl3rAQtyCfSD1TJBh0HEzzIEO8oGpODbLgezDKc4zjDMizQJ8-SqIfRDnVdGy9J3CK4KIq1Yrs+Kejw+i0EYv0oFi8ogA) | [Example 2](https://www.typescriptlang.org/play/?target=99&module=7#code/JYWwDg9gTgLgBAFQJ5gKZwGZQiOByGFVAIwgA88AoSgehrgFonmXW32POv3b7k0AdACpejbuImTu1OnAByAQxCoAzmAUBjVJQB2S1eq1wAsgpgALOAG9KcOKjKRYcDRB0r4ANVQaY0AExwALyIRAIA8sQAVj4wABRWcGQAXKGCcgCuIMSoUHEAlAA0cEip-KgCmdm5BXAAvvm29o7Q8K7uXrHQAMzBaRUAogBuCgA2GWaoceUCAJI6MLkqsXEA2t6+AcUzkTG+CXAAXmVhVTl5+fX5ALr5jXYOTm1uHnAbflAALH0zw2MTi2mYXmiygy326y6UG62zCuxWiQA7id0llzrUGrdGnUZPQACKoNA6AAmqAW8n0ak02nar28sAcPzh0QRTUgKmAMGAblSpgsAne0E+hSaOmgIDGvLM5gFUJhTQyQyl-MFUH8lAalFp8AA4qgcKgYFAkEzBPD9jY7ENclytCoURUAIJQKAKJBxemLMhFJrAEnAO0OgTO13umZnGp3DWNbUmSZQYBjU0Vc3xS1wJTEYBkmDKmWq4VNYnADAYDLLPOyzZfEV2NQ+DKjBRQSsF6Nal7wYyqSwhHYsi1NADm+uURtKcD1BvHtbgEtBidGytyi-bogAShkFqB0OvUBhRrFuTpKN2VDKwNg0LBsyoBCPp8aBJeINeuaoBNab3aBJzUCA7xfN9b2fCAOS5NxnyvG0QLIU8eyg18YI-B8xyfIDkLvL9bQ-P8AMQ4CPzFKAJVGAjMIEOCzwvaCbxQ0dDXQ2j3ywmCfzwwDmJAxVyLou8qIQjC+IEecVzGXiWIEYtS3LCohMkgTzwkkDRITcT5JAzNswWZSP0UmikOE1TF10u96w0Rtm1MyjcTgABlGAzADOB5gwXIyS0Sgyx0XxjzgKAyVJPJlHPIMHKcjQAB5CDQCAMBMHsAD5LnTEKZVQxikE-NjVFWAAGa5QPA48bLsNL7wY8dsu-XKCoEYjSNKucEIyqrsIDWrCp4uCyoQ4zxOkstlia8r+rIrScxGvr4xM8zLKgGy6iAA) | [Challenge](test/typescript/readme.md)
|
|
115
115
|
|
|
116
|
-
|
|
116
|
+
TypeBox includes a syntax engine that can transform TypeScript declarations into JSON Schema. The engine is a full syntactic frontend to Type.* and supports many advanced type-level constructs such as Conditional, Mapped, Indexed, Infer, Generics, Distributed types and more. This feature is implemented symmetrically at runtime and statically via TypeScript Template Literal types.
|
|
117
117
|
|
|
118
|
-
|
|
118
|
+
Syntax highlighting is available via the [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=sinclairzx81.typebox-script)
|
|
119
119
|
|
|
120
|
-
The following uses the Script function to parse TypeScript interfaces into JSON Schema.
|
|
121
120
|
|
|
122
|
-
|
|
123
|
-
import Type from 'typebox'
|
|
121
|
+
### Example
|
|
124
122
|
|
|
125
|
-
|
|
123
|
+
The following uses Script to parse TypeScript declarations into JSON Schema.
|
|
126
124
|
|
|
127
|
-
|
|
125
|
+
```typescript
|
|
126
|
+
// Module
|
|
127
|
+
const Math = Type.Script(`
|
|
128
|
+
type Vector2 = { x: number, y: number }
|
|
129
|
+
type Vector3 = Evaluate<Vector2 & { z: number }>
|
|
130
|
+
type Vector4 = Evaluate<Vector3 & { w: number }>
|
|
131
|
+
`)
|
|
128
132
|
|
|
129
|
-
|
|
130
|
-
|
|
133
|
+
// Dependent Module
|
|
134
|
+
const { Mesh } = Type.Script({ ...Math }, `
|
|
135
|
+
type Vertex = {
|
|
136
|
+
position: Vector4,
|
|
137
|
+
normal: Vector3,
|
|
138
|
+
uv: Vector2
|
|
131
139
|
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
140
|
+
type Geometry = {
|
|
141
|
+
vertices: Vertex[],
|
|
142
|
+
indices: number[]
|
|
143
|
+
}
|
|
144
|
+
type Material = {
|
|
145
|
+
ambient: Vector4,
|
|
146
|
+
diffuse: Vector4,
|
|
147
|
+
specular: Vector4
|
|
148
|
+
}
|
|
149
|
+
type Mesh = {
|
|
150
|
+
geometry: Geometry,
|
|
151
|
+
material: Material
|
|
136
152
|
}
|
|
137
|
-
|
|
138
|
-
type UserUpdate = Evaluate<
|
|
139
|
-
Pick<User, keyof Entity> &
|
|
140
|
-
Partial<Omit<User, keyof Entity>>
|
|
141
|
-
>
|
|
142
|
-
|
|
143
153
|
`)
|
|
144
154
|
|
|
145
|
-
//
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
// type: 'object',
|
|
163
|
-
// properties: {
|
|
164
|
-
// id: { type: 'string' },
|
|
165
|
-
// name: { type: 'string' },
|
|
166
|
-
// email: { type: 'string' }
|
|
167
|
-
// },
|
|
168
|
-
// required: ['id']
|
|
169
|
-
// }
|
|
170
|
-
|
|
171
|
-
// Static
|
|
172
|
-
|
|
173
|
-
type User = Type.Static<typeof User> // type User = {
|
|
174
|
-
// id: string,
|
|
175
|
-
// name: string,
|
|
176
|
-
// email: string
|
|
177
|
-
// }
|
|
178
|
-
|
|
179
|
-
type UserUpdate = Type.Static<typeof UserUpdate> // type UserUpdate = {
|
|
180
|
-
// id: string,
|
|
181
|
-
// name?: string,
|
|
182
|
-
// email?: string
|
|
183
|
-
// }
|
|
184
|
-
|
|
185
|
-
|
|
155
|
+
// Runtime Reflection
|
|
156
|
+
Mesh.properties.geometry.properties.vertices.items.properties.position.properties.x
|
|
157
|
+
Mesh.properties.geometry.properties.vertices.items.properties.normal.properties.x
|
|
158
|
+
Mesh.properties.geometry.properties.vertices.items.properties.uv.properties.x
|
|
159
|
+
Mesh.properties.material.properties.diffuse.properties.x
|
|
160
|
+
Mesh.properties.material.properties.ambient.properties.x
|
|
161
|
+
Mesh.properties.material.properties.specular.properties.x
|
|
162
|
+
|
|
163
|
+
// Static Inference
|
|
164
|
+
function render(mesh: Type.Static<typeof Mesh>) {
|
|
165
|
+
mesh.geometry.vertices[0].position.x
|
|
166
|
+
mesh.geometry.vertices[0].normal.x
|
|
167
|
+
mesh.geometry.vertices[0].uv.x
|
|
168
|
+
mesh.material.diffuse.x
|
|
169
|
+
mesh.material.ambient.x
|
|
170
|
+
mesh.material.specular.x
|
|
171
|
+
}
|
|
186
172
|
```
|
|
187
173
|
|
|
188
174
|
<a name="Schema"></a>
|
|
189
175
|
|
|
190
176
|
## Schema
|
|
191
177
|
|
|
192
|
-
[Documentation](https://sinclairzx81.github.io/typebox/#/docs/schema/overview) | [Example 1](https://www.typescriptlang.org/play
|
|
178
|
+
[Documentation](https://sinclairzx81.github.io/typebox/#/docs/schema/overview) | [Example 1](https://www.typescriptlang.org/play/#code/JYWwDg9gTgLgBAZQMYAsCmICGcBmUIhwDkMAnmGgEYQAeA9AM6oaZEBQbddcAtH-wMFDhI0WPESenbgGECYYABs003pPUbNW-hyQQAdg3gBVBmihwAvImZYAdHPBK0ACgDebOHDIUAXMQhKACs0JBgiABpPODB8ClhgNAZ-Dy8vYAATFO9yNH8iIyhgfQBzIjgAXyi0uH1MEDy4Nxy-YkLissrqtJYlbJ9Ggpgi0sjcaCwYfN7FcoroquioNABHAFdgZay4AG1oryJMsf3iOobjmqIZ9i8AXTYKgEoOLjVtd4+P1QAFTCgzVSfIHAyS6AxGOBrMwWaymcx2X7-VzNGqotHouCvPSGeBQ8wpaKZfIANgArDgAIyYABMlAAzEgACwZUloYk4ADsmAAHJQAJxIAAMGQpYwx6Ne6W27VK3TOgzxUDF4pVqq8ktq9UaMpK3Rm+UVAAEMgRMMU7HoQOU1SqNfq4DqHo8bS7XajXhUrHA7D6gA) | [Example 2](https://www.typescriptlang.org/play/?#code/JYWwDg9gTgLgBAZQMYAsCmICGcBmUIhwDkMAnmGgEYQAeA9AM6oaZEBQokscAKuWrnyES-ajXZs6dOAFo58hYqXKVqteo0zJ0gMIEwwADZptszeYuWr8tmyQQAdg3gBVBmihwAvImZYAdHrgRmgAFHwU-gDylABWaEgwoQDebHBwwAAmAFy8-P4IMFDADgDmoQCUADRpcA6YIGi5EWgFRSXl1bUsRs35hcVlKbjQWDC5RD2GRHAAvhVs8wum1qtr61pScAAKmFDuKxtHx6q29k7wAK7unj5uHv67+2HJ6W-vH5-vW+fOcNceXKpdJZCYANgArDgAIyYABMlAAzEgACyZCFoME4ADsmAAHJQAJxIAAMmWhRCqX2pcC2IJycGcg1KNXS9UaEwBUEpNN5fO+0jZDSajPaZVZcCmnJuAAFMgRMCV-PYQDN+by6ZKsL1RczFhV1YajR8trNvHB-JagA)
|
|
193
179
|
|
|
194
|
-
TypeBox includes a high-performance
|
|
180
|
+
TypeBox includes a high-performance JIT compiler that supports JSON Schema Draft 3 through to 2020-12. It is designed to be a lightweight industry-grade alternative to Ajv and offers improved compilation and validation performance. It also provides automatic fallback to dynamic validation in JIT restricted environments such as Cloudflare Workers.
|
|
195
181
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
The following uses the Schema submodule to compile a TypeBox type.
|
|
182
|
+
The compiler is available via optional sub module import.
|
|
199
183
|
|
|
200
184
|
```typescript
|
|
201
185
|
import Schema from 'typebox/schema'
|
|
186
|
+
```
|
|
202
187
|
|
|
203
|
-
|
|
188
|
+
### Compile
|
|
204
189
|
|
|
205
|
-
|
|
206
|
-
id: Type.String(), // id: Type.TString;
|
|
207
|
-
name: Type.String(), // name: Type.TString;
|
|
208
|
-
email: Type.String({ format: 'email' }) // email: Type.TString;
|
|
209
|
-
})) // }>, { ... }>
|
|
190
|
+
The compiler accepts JSON Schema and returns Validator instances.
|
|
210
191
|
|
|
211
|
-
|
|
192
|
+
```typescript
|
|
193
|
+
const Vector = Schema.Compile(Type.Object({ // const Vector: Validator<TObject<{
|
|
194
|
+
x: Type.Number(), // x: TNumber
|
|
195
|
+
y: Type.Number(), // y: TNumber
|
|
196
|
+
z: Type.Number() // z: TNumber
|
|
197
|
+
})) // }>>
|
|
198
|
+
```
|
|
199
|
+
With JSON Schema
|
|
200
|
+
```typescript
|
|
201
|
+
const Vector = Schema.Compile({ // const Vector: Validator<{
|
|
202
|
+
type: 'object', // type: "object";
|
|
203
|
+
required: ['x', 'y', 'z'], // required: ["x", "y", "z"];
|
|
204
|
+
properties: { // properties: { ... };
|
|
205
|
+
x: { type: 'number' }, // }, { ... }>
|
|
206
|
+
y: { type: 'number' },
|
|
207
|
+
z: { type: 'number' }
|
|
208
|
+
}
|
|
209
|
+
})
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
### Validate
|
|
212
213
|
|
|
213
|
-
|
|
214
|
-
id: '65f1a2b3c4d5e6f7a8b9c0d1', // id: string,
|
|
215
|
-
name: 'user', // name: string,
|
|
216
|
-
email: 'user@domain.com' // email: string
|
|
217
|
-
}) // } = ...
|
|
214
|
+
Validator instances provide functions to Check and Parse values.
|
|
218
215
|
|
|
216
|
+
```typescript
|
|
217
|
+
const Vector = Schema.Compile(Type.Script(`{
|
|
218
|
+
x: number
|
|
219
|
+
y: number
|
|
220
|
+
z: number
|
|
221
|
+
}`))
|
|
222
|
+
|
|
223
|
+
const valid = Vector.Check({ // const valid: boolean
|
|
224
|
+
x: 1,
|
|
225
|
+
y: 0,
|
|
226
|
+
z: 0
|
|
227
|
+
})
|
|
228
|
+
|
|
229
|
+
const value = Vector.Parse({ // const value: {
|
|
230
|
+
x: 1, // x: number
|
|
231
|
+
y: 0, // y: number
|
|
232
|
+
z: 0 // z: number
|
|
233
|
+
}) // }
|
|
219
234
|
```
|
|
220
235
|
|
|
236
|
+
|
|
237
|
+
|
|
221
238
|
### Coverage
|
|
222
239
|
|
|
223
240
|
The following table shows specification coverage implemented by TypeBox.
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/firecrawl-plugin",
|
|
3
|
-
"version": "2026.7.1-beta.
|
|
3
|
+
"version": "2026.7.1-beta.5",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@openclaw/firecrawl-plugin",
|
|
9
|
-
"version": "2026.7.1-beta.
|
|
9
|
+
"version": "2026.7.1-beta.5",
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"typebox": "1.
|
|
11
|
+
"typebox": "1.3.3"
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"node_modules/typebox": {
|
|
15
|
-
"version": "1.
|
|
16
|
-
"resolved": "https://registry.npmjs.org/typebox/-/typebox-1.
|
|
17
|
-
"integrity": "sha512-
|
|
15
|
+
"version": "1.3.3",
|
|
16
|
+
"resolved": "https://registry.npmjs.org/typebox/-/typebox-1.3.3.tgz",
|
|
17
|
+
"integrity": "sha512-URXGUE31PJDQC+PtRMJeLdF4kmmOdFoVPikPCtV2oOIhUpNpppEdIz7W8bH8cFYPYHdDpaRvqwdegMTmHliudg==",
|
|
18
18
|
"license": "MIT"
|
|
19
19
|
}
|
|
20
20
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/firecrawl-plugin",
|
|
3
|
-
"version": "2026.7.1-beta.
|
|
3
|
+
"version": "2026.7.1-beta.5",
|
|
4
4
|
"description": "OpenClaw Firecrawl plugin.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
},
|
|
9
9
|
"type": "module",
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"typebox": "1.
|
|
11
|
+
"typebox": "1.3.3"
|
|
12
12
|
},
|
|
13
13
|
"openclaw": {
|
|
14
14
|
"extensions": [
|
|
@@ -21,10 +21,10 @@
|
|
|
21
21
|
"minHostVersion": ">=2026.6.8"
|
|
22
22
|
},
|
|
23
23
|
"compat": {
|
|
24
|
-
"pluginApi": ">=2026.7.1-beta.
|
|
24
|
+
"pluginApi": ">=2026.7.1-beta.5"
|
|
25
25
|
},
|
|
26
26
|
"build": {
|
|
27
|
-
"openclawVersion": "2026.7.1-beta.
|
|
27
|
+
"openclawVersion": "2026.7.1-beta.5",
|
|
28
28
|
"bundledDist": false
|
|
29
29
|
},
|
|
30
30
|
"release": {
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"README.md"
|
|
43
43
|
],
|
|
44
44
|
"peerDependencies": {
|
|
45
|
-
"openclaw": ">=2026.7.1-beta.
|
|
45
|
+
"openclaw": ">=2026.7.1-beta.5"
|
|
46
46
|
},
|
|
47
47
|
"peerDependenciesMeta": {
|
|
48
48
|
"openclaw": {
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import * as Schema from '../types/index.mjs';
|
|
2
|
-
import { Stack } from './_stack.mjs';
|
|
3
|
-
import { BuildContext, CheckContext, ErrorContext } from './_context.mjs';
|
|
4
|
-
export declare function BuildGuard(_stack: Stack, _context: BuildContext, schema: Schema.XGuard, value: string): string;
|
|
5
|
-
export declare function CheckGuard(_stack: Stack, _context: CheckContext, schema: Schema.XGuard, value: unknown): boolean;
|
|
6
|
-
export declare function ErrorGuard(_stack: Stack, context: ErrorContext, schemaPath: string, instancePath: string, schema: Schema.XGuard, value: unknown): boolean;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
// deno-fmt-ignore-file
|
|
2
|
-
import * as Externals from './_externals.mjs';
|
|
3
|
-
import { EmitGuard as E } from '../../guard/index.mjs';
|
|
4
|
-
// ------------------------------------------------------------------
|
|
5
|
-
// Build
|
|
6
|
-
// ------------------------------------------------------------------
|
|
7
|
-
export function BuildGuard(_stack, _context, schema, value) {
|
|
8
|
-
return E.Call(E.Member(E.Member(Externals.CreateVariable(schema), '~guard'), 'check'), [value]);
|
|
9
|
-
}
|
|
10
|
-
// ------------------------------------------------------------------
|
|
11
|
-
// Check
|
|
12
|
-
// ------------------------------------------------------------------
|
|
13
|
-
export function CheckGuard(_stack, _context, schema, value) {
|
|
14
|
-
return schema['~guard'].check(value);
|
|
15
|
-
}
|
|
16
|
-
// ------------------------------------------------------------------
|
|
17
|
-
// Error
|
|
18
|
-
// ------------------------------------------------------------------
|
|
19
|
-
export function ErrorGuard(_stack, context, schemaPath, instancePath, schema, value) {
|
|
20
|
-
return schema['~guard'].check(value) || context.AddError({
|
|
21
|
-
keyword: '~guard',
|
|
22
|
-
schemaPath,
|
|
23
|
-
instancePath,
|
|
24
|
-
params: { errors: schema['~guard'].errors(value) },
|
|
25
|
-
});
|
|
26
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { XSchemaObject } from './schema.mjs';
|
|
2
|
-
export interface XGuardInterface<Value extends unknown = unknown> {
|
|
3
|
-
check(value: unknown): value is Value;
|
|
4
|
-
errors(value: unknown): object[];
|
|
5
|
-
}
|
|
6
|
-
export interface XGuard<Value extends unknown = unknown> {
|
|
7
|
-
'~guard': XGuardInterface<Value>;
|
|
8
|
-
}
|
|
9
|
-
export declare function IsGuardInterface(value: unknown): value is XGuardInterface;
|
|
10
|
-
export declare function IsGuard(value: XSchemaObject): value is XGuard;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
// deno-fmt-ignore-file
|
|
2
|
-
import { Guard } from '../../guard/index.mjs';
|
|
3
|
-
// ------------------------------------------------------------------
|
|
4
|
-
// Guard
|
|
5
|
-
// ------------------------------------------------------------------
|
|
6
|
-
export function IsGuardInterface(value) {
|
|
7
|
-
return Guard.IsObject(value)
|
|
8
|
-
&& Guard.HasPropertyKey(value, 'check')
|
|
9
|
-
&& Guard.HasPropertyKey(value, 'errors')
|
|
10
|
-
&& Guard.IsFunction(value.check)
|
|
11
|
-
&& Guard.IsFunction(value.errors);
|
|
12
|
-
}
|
|
13
|
-
export function IsGuard(value) {
|
|
14
|
-
return Guard.HasPropertyKey(value, '~guard')
|
|
15
|
-
&& IsGuardInterface(value['~guard']);
|
|
16
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { type TSchema } from '../types/schema.mjs';
|
|
2
|
-
/** Represents a operation to apply Optional to a property */
|
|
3
|
-
export interface TOptionalAddAction<Type extends TSchema = TSchema> extends TSchema {
|
|
4
|
-
'~kind': 'OptionalAddAction';
|
|
5
|
-
type: Type;
|
|
6
|
-
}
|
|
7
|
-
/** Creates an OptionalAddAction. */
|
|
8
|
-
export declare function OptionalAddAction<Type extends TSchema>(type: Type): TOptionalAddAction<Type>;
|
|
9
|
-
/** Returns true if this value is a OptionalAddAction. */
|
|
10
|
-
export declare function IsOptionalAddAction(value: unknown): value is TOptionalAddAction;
|
|
11
|
-
/** Represents a operation to remove Optional from a property */
|
|
12
|
-
export interface TOptionalRemoveAction<Type extends TSchema = TSchema> extends TSchema {
|
|
13
|
-
'~kind': 'OptionalRemoveAction';
|
|
14
|
-
type: Type;
|
|
15
|
-
}
|
|
16
|
-
/** Creates a OptionalRemoveAction. */
|
|
17
|
-
export declare function OptionalRemoveAction<Type extends TSchema>(type: Type): TOptionalRemoveAction<Type>;
|
|
18
|
-
/** Returns true if this value is a OptionalRemoveAction. */
|
|
19
|
-
export declare function IsOptionalRemoveAction(value: unknown): value is TOptionalRemoveAction;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
// deno-fmt-ignore-file
|
|
2
|
-
import { Memory } from '../../system/memory/index.mjs';
|
|
3
|
-
import { Guard } from '../../guard/index.mjs';
|
|
4
|
-
import { IsSchema } from '../types/schema.mjs';
|
|
5
|
-
// ------------------------------------------------------------------
|
|
6
|
-
// Action
|
|
7
|
-
// ------------------------------------------------------------------
|
|
8
|
-
/** Creates an OptionalAddAction. */
|
|
9
|
-
export function OptionalAddAction(type) {
|
|
10
|
-
return Memory.Create({ ['~kind']: 'OptionalAddAction' }, { type }, {});
|
|
11
|
-
}
|
|
12
|
-
// ------------------------------------------------------------------
|
|
13
|
-
// Guard
|
|
14
|
-
// ------------------------------------------------------------------
|
|
15
|
-
/** Returns true if this value is a OptionalAddAction. */
|
|
16
|
-
export function IsOptionalAddAction(value) {
|
|
17
|
-
return Guard.IsObject(value)
|
|
18
|
-
&& Guard.HasPropertyKey(value, '~kind')
|
|
19
|
-
&& Guard.HasPropertyKey(value, 'type')
|
|
20
|
-
&& Guard.IsEqual(value['~kind'], 'OptionalAddAction')
|
|
21
|
-
&& IsSchema(value.type);
|
|
22
|
-
}
|
|
23
|
-
// ------------------------------------------------------------------
|
|
24
|
-
// Factory
|
|
25
|
-
// ------------------------------------------------------------------
|
|
26
|
-
/** Creates a OptionalRemoveAction. */
|
|
27
|
-
export function OptionalRemoveAction(type) {
|
|
28
|
-
return Memory.Create({ ['~kind']: 'OptionalRemoveAction' }, { type }, {});
|
|
29
|
-
}
|
|
30
|
-
// ------------------------------------------------------------------
|
|
31
|
-
// Guard
|
|
32
|
-
// ------------------------------------------------------------------
|
|
33
|
-
/** Returns true if this value is a OptionalRemoveAction. */
|
|
34
|
-
export function IsOptionalRemoveAction(value) {
|
|
35
|
-
return Guard.IsObject(value)
|
|
36
|
-
&& Guard.HasPropertyKey(value, '~kind')
|
|
37
|
-
&& Guard.HasPropertyKey(value, 'type')
|
|
38
|
-
&& Guard.IsEqual(value['~kind'], 'OptionalRemoveAction')
|
|
39
|
-
&& IsSchema(value.type);
|
|
40
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { type TSchema } from '../types/schema.mjs';
|
|
2
|
-
/** Represents an operation to apply Readonly to a property. */
|
|
3
|
-
export interface TReadonlyAddAction<Type extends TSchema = TSchema> extends TSchema {
|
|
4
|
-
'~kind': 'ReadonlyAddAction';
|
|
5
|
-
type: Type;
|
|
6
|
-
}
|
|
7
|
-
/** Creates a ReadonlyAddAction. */
|
|
8
|
-
export declare function ReadonlyAddAction<Type extends TSchema>(type: Type): TReadonlyAddAction<Type>;
|
|
9
|
-
/** Returns true if this value is a ReadonlyAddAction. */
|
|
10
|
-
export declare function IsReadonlyAddAction(value: unknown): value is TReadonlyAddAction;
|
|
11
|
-
/** Represents an action to remove Readonly from a property. */
|
|
12
|
-
export interface TReadonlyRemoveAction<Type extends TSchema = TSchema> extends TSchema {
|
|
13
|
-
'~kind': 'ReadonlyRemoveAction';
|
|
14
|
-
type: Type;
|
|
15
|
-
}
|
|
16
|
-
/** Creates a ReadonlyRemoveAction. */
|
|
17
|
-
export declare function ReadonlyRemoveAction<Type extends TSchema>(type: Type): TReadonlyRemoveAction<Type>;
|
|
18
|
-
/** Returns true if this value is a ReadonlyRemoveAction. */
|
|
19
|
-
export declare function IsReadonlyRemoveAction(value: unknown): value is TReadonlyRemoveAction;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
// deno-fmt-ignore-file
|
|
2
|
-
import { Memory } from '../../system/memory/index.mjs';
|
|
3
|
-
import { Guard } from '../../guard/index.mjs';
|
|
4
|
-
import { IsSchema } from '../types/schema.mjs';
|
|
5
|
-
// ------------------------------------------------------------------
|
|
6
|
-
// Action
|
|
7
|
-
// ------------------------------------------------------------------
|
|
8
|
-
/** Creates a ReadonlyAddAction. */
|
|
9
|
-
export function ReadonlyAddAction(type) {
|
|
10
|
-
return Memory.Create({ ['~kind']: 'ReadonlyAddAction' }, { type }, {});
|
|
11
|
-
}
|
|
12
|
-
// ------------------------------------------------------------------
|
|
13
|
-
// Guard
|
|
14
|
-
// ------------------------------------------------------------------
|
|
15
|
-
/** Returns true if this value is a ReadonlyAddAction. */
|
|
16
|
-
export function IsReadonlyAddAction(value) {
|
|
17
|
-
return Guard.IsObject(value)
|
|
18
|
-
&& Guard.HasPropertyKey(value, '~kind')
|
|
19
|
-
&& Guard.HasPropertyKey(value, 'type')
|
|
20
|
-
&& Guard.IsEqual(value['~kind'], 'ReadonlyAddAction')
|
|
21
|
-
&& IsSchema(value.type);
|
|
22
|
-
}
|
|
23
|
-
// ------------------------------------------------------------------
|
|
24
|
-
// Factory
|
|
25
|
-
// ------------------------------------------------------------------
|
|
26
|
-
/** Creates a ReadonlyRemoveAction. */
|
|
27
|
-
export function ReadonlyRemoveAction(type) {
|
|
28
|
-
return Memory.Create({ ['~kind']: 'ReadonlyRemoveAction' }, { type }, {});
|
|
29
|
-
}
|
|
30
|
-
// ------------------------------------------------------------------
|
|
31
|
-
// Guard
|
|
32
|
-
// ------------------------------------------------------------------
|
|
33
|
-
/** Returns true if this value is a ReadonlyRemoveAction. */
|
|
34
|
-
export function IsReadonlyRemoveAction(value) {
|
|
35
|
-
return Guard.IsObject(value)
|
|
36
|
-
&& Guard.HasPropertyKey(value, '~kind')
|
|
37
|
-
&& Guard.HasPropertyKey(value, 'type')
|
|
38
|
-
&& Guard.IsEqual(value['~kind'], 'ReadonlyRemoveAction')
|
|
39
|
-
&& IsSchema(value.type);
|
|
40
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { type TSchema, type TSchemaOptions } from '../types/schema.mjs';
|
|
2
|
-
import { type TDeferred } from '../types/deferred.mjs';
|
|
3
|
-
import { type TAwaitedAction } from '../engine/awaited/instantiate.mjs';
|
|
4
|
-
/** Creates a deferred Awaited action. */
|
|
5
|
-
export type TAwaitedDeferred<Type extends TSchema> = (TDeferred<'Awaited', [Type]>);
|
|
6
|
-
/** Creates a deferred Awaited action. */
|
|
7
|
-
export declare function AwaitedDeferred<Type extends TSchema>(type: Type, options?: TSchemaOptions): TAwaitedDeferred<Type>;
|
|
8
|
-
/** Applies an Awaited action to a type. */
|
|
9
|
-
export type TAwaited<Type extends TSchema> = (TAwaitedAction<Type>);
|
|
10
|
-
/**
|
|
11
|
-
* Applies an Awaited action to a type.
|
|
12
|
-
*
|
|
13
|
-
* @deprecated This action is being removed in the next version of TypeBox.
|
|
14
|
-
*/
|
|
15
|
-
export declare function Awaited<Type extends TSchema>(type: Type, options?: TSchemaOptions): TAwaited<Type>;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
// deno-fmt-ignore-file
|
|
2
|
-
import { Deferred } from '../types/deferred.mjs';
|
|
3
|
-
import { AwaitedAction } from '../engine/awaited/instantiate.mjs';
|
|
4
|
-
/** Creates a deferred Awaited action. */
|
|
5
|
-
export function AwaitedDeferred(type, options = {}) {
|
|
6
|
-
return Deferred('Awaited', [type], options);
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* Applies an Awaited action to a type.
|
|
10
|
-
*
|
|
11
|
-
* @deprecated This action is being removed in the next version of TypeBox.
|
|
12
|
-
*/
|
|
13
|
-
export function Awaited(type, options = {}) {
|
|
14
|
-
return AwaitedAction(type, options);
|
|
15
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { type TSchema } from '../types/schema.mjs';
|
|
2
|
-
import { type TDeferred } from '../types/deferred.mjs';
|
|
3
|
-
import { type TOptionsAction } from '../engine/options/instantiate.mjs';
|
|
4
|
-
/** Creates a deferred Options action. */
|
|
5
|
-
export type TOptionsDeferred<Type extends TSchema, Options extends TSchema> = (TDeferred<'Options', [Type, Options]>);
|
|
6
|
-
/** Creates a deferred Options action. */
|
|
7
|
-
export declare function OptionsDeferred<Type extends TSchema, Options extends TSchema>(type: Type, options: Options): TOptionsDeferred<Type, Options>;
|
|
8
|
-
/** Applies an immediate Options action to the given type. */
|
|
9
|
-
export type TOptions<Type extends TSchema, Options extends TSchema> = (Type & Options);
|
|
10
|
-
/** Applies an immediate Options action to the given type. */
|
|
11
|
-
export declare function Options<Type extends TSchema, const Options extends TSchema>(type: Type, options: Options): TOptionsAction<Type, Options>;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
// deno-fmt-ignore-file
|
|
2
|
-
import { Deferred } from '../types/deferred.mjs';
|
|
3
|
-
import { OptionsAction } from '../engine/options/instantiate.mjs';
|
|
4
|
-
/** Creates a deferred Options action. */
|
|
5
|
-
export function OptionsDeferred(type, options) {
|
|
6
|
-
return Deferred('Options', [type, options], {});
|
|
7
|
-
}
|
|
8
|
-
/** Applies an immediate Options action to the given type. */
|
|
9
|
-
export function Options(type, options) {
|
|
10
|
-
return OptionsAction(type, options);
|
|
11
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { type TSchema, type TSchemaOptions } from '../../types/schema.mjs';
|
|
2
|
-
import { type TProperties } from '../../types/properties.mjs';
|
|
3
|
-
import { type TPromise } from '../../types/promise.mjs';
|
|
4
|
-
import { type TAwaitedDeferred } from '../../action/awaited.mjs';
|
|
5
|
-
import { type TState, type TInstantiateType, type TCanInstantiate } from '../instantiate.mjs';
|
|
6
|
-
type TAwaitedOperation<Type extends TSchema> = (Type extends TPromise<infer Type extends TSchema> ? TAwaitedOperation<Type> : Type);
|
|
7
|
-
export type TAwaitedAction<Type extends TSchema, Result extends TSchema = TCanInstantiate<[Type]> extends true ? TAwaitedOperation<Type> : TAwaitedDeferred<Type>> = Result;
|
|
8
|
-
export declare function AwaitedAction<Type extends TSchema>(type: Type, options: TSchemaOptions): TAwaitedAction<Type>;
|
|
9
|
-
export type TAwaitedInstantiate<Context extends TProperties, State extends TState, Type extends TSchema, InstantiateType extends TSchema = TInstantiateType<Context, State, Type>> = TAwaitedAction<InstantiateType>;
|
|
10
|
-
export declare function AwaitedInstantiate<Context extends TProperties, State extends TState, Type extends TSchema>(context: Context, state: State, type: Type, options: TSchemaOptions): TAwaitedInstantiate<Context, State, Type>;
|
|
11
|
-
export {};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
// deno-fmt-ignore-file
|
|
2
|
-
import { Memory } from '../../../system/memory/index.mjs';
|
|
3
|
-
import { IsPromise } from '../../types/promise.mjs';
|
|
4
|
-
import { AwaitedDeferred } from '../../action/awaited.mjs';
|
|
5
|
-
import { InstantiateType, CanInstantiate } from '../instantiate.mjs';
|
|
6
|
-
function AwaitedOperation(type) {
|
|
7
|
-
return (IsPromise(type)
|
|
8
|
-
? AwaitedOperation(type.item)
|
|
9
|
-
: type);
|
|
10
|
-
}
|
|
11
|
-
export function AwaitedAction(type, options) {
|
|
12
|
-
const result = CanInstantiate([type])
|
|
13
|
-
? Memory.Update(AwaitedOperation(type), {}, options)
|
|
14
|
-
: AwaitedDeferred(type, options);
|
|
15
|
-
return result;
|
|
16
|
-
}
|
|
17
|
-
export function AwaitedInstantiate(context, state, type, options) {
|
|
18
|
-
const instantiatedType = InstantiateType(context, state, type);
|
|
19
|
-
return AwaitedAction(instantiatedType, options);
|
|
20
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { type TSchema } from '../../types/schema.mjs';
|
|
2
|
-
import { type TEnum, type TEnumValue } from '../../types/enum.mjs';
|
|
3
|
-
import { type TUnion } from '../../types/union.mjs';
|
|
4
|
-
import { type TLiteral } from '../../types/literal.mjs';
|
|
5
|
-
import { type TNull } from '../../types/null.mjs';
|
|
6
|
-
import { type TNever } from '../../types/never.mjs';
|
|
7
|
-
type TFromEnumValue<Value extends TEnumValue, Result extends TSchema = Value extends string | number ? TLiteral<Value> : Value extends null ? TNull : TNever> = Result;
|
|
8
|
-
export type TEnumValuesToVariants<Values extends TEnumValue[], Result extends TSchema[] = []> = (Values extends [infer Left extends TEnumValue, ...infer Right extends TEnumValue[]] ? TEnumValuesToVariants<Right, [...Result, TFromEnumValue<Left>]> : Result);
|
|
9
|
-
export declare function EnumValuesToVariants<Values extends TEnumValue[]>(values: [...Values]): TEnumValuesToVariants<Values>;
|
|
10
|
-
export type TEnumValuesToUnion<Values extends TEnumValue[], Variants extends TSchema[] = TEnumValuesToVariants<Values>, Results extends TSchema = TUnion<Variants>> = Results;
|
|
11
|
-
export declare function EnumValuesToUnion<Values extends TEnumValue[]>(values: [...Values]): TEnumValuesToUnion<Values>;
|
|
12
|
-
export type TEnumToUnion<Type extends TEnum, Result extends TSchema = TEnumValuesToUnion<Type['enum']>> = Result;
|
|
13
|
-
export declare function EnumToUnion<Type extends TEnum>(type: Type): TEnumToUnion<Type>;
|
|
14
|
-
export {};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
// deno-fmt-ignore-file
|
|
2
|
-
import { Guard } from '../../../guard/index.mjs';
|
|
3
|
-
import { Union } from '../../types/union.mjs';
|
|
4
|
-
import { Literal } from '../../types/literal.mjs';
|
|
5
|
-
import { Null } from '../../types/null.mjs';
|
|
6
|
-
import { Never } from '../../types/never.mjs';
|
|
7
|
-
function FromEnumValue(value) {
|
|
8
|
-
return (Guard.IsString(value) || Guard.IsNumber(value) ? Literal(value) :
|
|
9
|
-
Guard.IsNull(value) ? Null() :
|
|
10
|
-
Never());
|
|
11
|
-
}
|
|
12
|
-
export function EnumValuesToVariants(values) {
|
|
13
|
-
const result = values.map(value => FromEnumValue(value));
|
|
14
|
-
return result;
|
|
15
|
-
}
|
|
16
|
-
export function EnumValuesToUnion(values) {
|
|
17
|
-
const variants = EnumValuesToVariants(values);
|
|
18
|
-
const result = Union(variants);
|
|
19
|
-
return result;
|
|
20
|
-
}
|
|
21
|
-
export function EnumToUnion(type) {
|
|
22
|
-
const result = EnumValuesToUnion(type.enum);
|
|
23
|
-
return result;
|
|
24
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './instantiate.mjs';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './instantiate.mjs';
|