structured-outputs 0.1.0-beta.2 → 0.1.0-beta.21
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +77 -6
- package/esm/ResponseFormat.d.ts +18 -11
- package/esm/ResponseFormat.d.ts.map +1 -1
- package/esm/ResponseFormat.js +57 -5
- package/esm/ResponseFormat.js.map +1 -1
- package/esm/Tool.d.ts +13 -0
- package/esm/Tool.d.ts.map +1 -0
- package/esm/Tool.js +17 -0
- package/esm/Tool.js.map +1 -0
- package/esm/_dnt.polyfills.d.ts +12 -0
- package/esm/_dnt.polyfills.d.ts.map +1 -0
- package/esm/_dnt.polyfills.js +16 -0
- package/esm/_dnt.polyfills.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/_utils.d.ts +6 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/_utils.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/_utils.js +19 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/_utils.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/aggregate_groups.d.ts +41 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/aggregate_groups.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/aggregate_groups.js +51 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/aggregate_groups.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/associate_by.d.ts +37 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/associate_by.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/associate_by.js +45 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/associate_by.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/associate_with.d.ts +33 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/associate_with.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/associate_with.js +41 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/associate_with.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/chunk.d.ts +38 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/chunk.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/chunk.js +51 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/chunk.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/deep_merge.d.ts +322 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/deep_merge.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/deep_merge.js +96 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/deep_merge.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/distinct.d.ts +23 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/distinct.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/distinct.js +28 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/distinct.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/distinct_by.d.ts +26 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/distinct_by.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/distinct_by.js +39 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/distinct_by.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/drop_last_while.d.ts +26 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/drop_last_while.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/drop_last_while.js +33 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/drop_last_while.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/drop_while.d.ts +25 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/drop_while.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/drop_while.js +34 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/drop_while.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/filter_entries.d.ts +32 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/filter_entries.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/filter_entries.js +43 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/filter_entries.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/filter_keys.d.ts +36 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/filter_keys.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/filter_keys.js +46 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/filter_keys.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/filter_values.d.ts +35 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/filter_values.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/filter_values.js +46 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/filter_values.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/find_single.d.ts +31 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/find_single.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/find_single.js +45 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/find_single.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/first_not_nullish_of.d.ts +32 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/first_not_nullish_of.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/first_not_nullish_of.js +42 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/first_not_nullish_of.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/includes_value.d.ts +29 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/includes_value.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/includes_value.js +39 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/includes_value.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/intersect.d.ts +25 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/intersect.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/intersect.js +36 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/intersect.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/invert.d.ts +29 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/invert.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/invert.js +29 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/invert.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/invert_by.d.ts +34 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/invert_by.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/invert_by.js +46 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/invert_by.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/join_to_string.d.ts +75 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/join_to_string.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/join_to_string.js +59 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/join_to_string.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/map_entries.d.ts +37 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/map_entries.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/map_entries.js +47 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/map_entries.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/map_keys.d.ts +33 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/map_keys.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/map_keys.js +42 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/map_keys.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/map_not_nullish.d.ts +32 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/map_not_nullish.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/map_not_nullish.js +43 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/map_not_nullish.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/map_values.d.ts +71 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/map_values.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/map_values.js +13 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/map_values.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/max_by.d.ts +117 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/max_by.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/max_by.js +15 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/max_by.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/max_of.d.ts +61 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/max_of.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/max_of.js +17 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/max_of.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/max_with.d.ts +29 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/max_with.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/max_with.js +41 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/max_with.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/min_by.d.ts +115 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/min_by.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/min_by.js +15 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/min_by.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/min_of.d.ts +61 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/min_of.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/min_of.js +17 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/min_of.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/min_with.d.ts +25 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/min_with.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/min_with.js +37 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/min_with.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/mod.d.ts +73 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/mod.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/mod.js +75 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/mod.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/omit.d.ts +24 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/omit.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/omit.js +29 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/omit.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/partition.d.ts +60 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/partition.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/partition.js +16 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/partition.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/partition_entries.d.ts +39 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/partition_entries.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/partition_entries.js +54 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/partition_entries.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/permutations.d.ts +27 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/permutations.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/permutations.js +58 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/permutations.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/pick.d.ts +25 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/pick.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/pick.js +33 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/pick.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/reduce_groups.d.ts +35 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/reduce_groups.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/reduce_groups.js +40 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/reduce_groups.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/running_reduce.d.ts +27 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/running_reduce.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/running_reduce.js +32 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/running_reduce.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/sample.d.ts +24 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/sample.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/sample.js +35 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/sample.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/sliding_windows.d.ts +66 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/sliding_windows.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/sliding_windows.js +57 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/sliding_windows.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/sort_by.d.ts +161 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/sort_by.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/sort_by.js +30 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/sort_by.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/sum_of.d.ts +29 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/sum_of.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/sum_of.js +37 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/sum_of.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/take_last_while.d.ts +27 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/take_last_while.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/take_last_while.js +34 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/take_last_while.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/take_while.d.ts +30 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/take_while.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/take_while.js +39 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/take_while.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/union.d.ts +24 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/union.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/union.js +34 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/union.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/unzip.d.ts +32 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/unzip.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/unzip.js +46 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/unzip.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/without_all.d.ts +23 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/without_all.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/without_all.js +28 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/without_all.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/zip.d.ts +34 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/zip.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/zip.js +43 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/zip.js.map +1 -0
- package/esm/mod.d.ts +3 -14
- package/esm/mod.d.ts.map +1 -1
- package/esm/mod.js +3 -10
- package/esm/mod.js.map +1 -1
- package/esm/oai.d.ts +5 -0
- package/esm/oai.d.ts.map +1 -0
- package/esm/oai.js +2 -0
- package/esm/oai.js.map +1 -0
- package/esm/types/Ref.d.ts +4 -0
- package/esm/types/Ref.d.ts.map +1 -0
- package/esm/types/Ref.js +11 -0
- package/esm/types/Ref.js.map +1 -0
- package/esm/types/RootTy.d.ts +8 -0
- package/esm/types/RootTy.d.ts.map +1 -0
- package/esm/types/RootTy.js +19 -0
- package/esm/types/RootTy.js.map +1 -0
- package/esm/types/Ty.d.ts +27 -0
- package/esm/types/Ty.d.ts.map +1 -0
- package/esm/types/Ty.js +17 -0
- package/esm/types/Ty.js.map +1 -0
- package/esm/types/array.d.ts +3 -0
- package/esm/types/array.d.ts.map +1 -0
- package/esm/types/array.js +9 -0
- package/esm/types/array.js.map +1 -0
- package/esm/types/constant.d.ts +3 -0
- package/esm/types/constant.d.ts.map +1 -0
- package/esm/types/constant.js +8 -0
- package/esm/types/constant.js.map +1 -0
- package/esm/types/constantUnion.d.ts +3 -0
- package/esm/types/constantUnion.d.ts.map +1 -0
- package/esm/types/constantUnion.js +25 -0
- package/esm/types/constantUnion.js.map +1 -0
- package/esm/types/leaves.d.ts +6 -0
- package/esm/types/leaves.d.ts.map +1 -0
- package/esm/types/leaves.js +18 -0
- package/esm/types/leaves.js.map +1 -0
- package/esm/types/mod.d.ts +11 -0
- package/esm/types/mod.d.ts.map +1 -0
- package/esm/types/mod.js +11 -0
- package/esm/types/mod.js.map +1 -0
- package/esm/types/object.d.ts +6 -0
- package/esm/types/object.d.ts.map +1 -0
- package/esm/{object.js → types/object.js} +4 -4
- package/esm/types/object.js.map +1 -0
- package/esm/types/std/Option.d.ts +7 -0
- package/esm/types/std/Option.d.ts.map +1 -0
- package/esm/types/std/Option.js +9 -0
- package/esm/types/std/Option.js.map +1 -0
- package/esm/types/std/Wrapper.d.ts +7 -0
- package/esm/types/std/Wrapper.d.ts.map +1 -0
- package/esm/types/std/Wrapper.js +5 -0
- package/esm/types/std/Wrapper.js.map +1 -0
- package/esm/types/std/mod.d.ts +3 -0
- package/esm/types/std/mod.d.ts.map +1 -0
- package/esm/types/std/mod.js +3 -0
- package/esm/types/std/mod.js.map +1 -0
- package/esm/types/taggedUnion.d.ts +8 -0
- package/esm/types/taggedUnion.d.ts.map +1 -0
- package/esm/types/taggedUnion.js +20 -0
- package/esm/types/taggedUnion.js.map +1 -0
- package/esm/util/phantoms.d.ts +2 -0
- package/esm/util/phantoms.d.ts.map +1 -0
- package/esm/util/phantoms.js +4 -0
- package/esm/util/phantoms.js.map +1 -0
- package/esm/util/recombineTaggedTemplateArgs.d.ts +2 -0
- package/esm/util/recombineTaggedTemplateArgs.d.ts.map +1 -0
- package/esm/util/recombineTaggedTemplateArgs.js +4 -0
- package/esm/util/recombineTaggedTemplateArgs.js.map +1 -0
- package/package.json +7 -9
- package/src/ResponseFormat.ts +80 -22
- package/src/Tool.ts +38 -0
- package/src/_dnt.polyfills.ts +27 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/_utils.ts +26 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/aggregate_groups.ts +62 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/associate_by.ts +50 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/associate_with.ts +46 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/chunk.ts +56 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/deep_merge.ts +578 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/distinct.ts +29 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/distinct_by.ts +42 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/drop_last_while.ts +36 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/drop_while.ts +39 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/filter_entries.ts +48 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/filter_keys.ts +51 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/filter_values.ts +51 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/find_single.ts +48 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/first_not_nullish_of.ts +47 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/includes_value.ts +45 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/intersect.ts +35 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/invert.ts +38 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/invert_by.ts +56 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/join_to_string.ts +109 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/map_entries.ts +53 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/map_keys.ts +47 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/map_not_nullish.ts +49 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/map_values.ts +96 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/max_by.ts +153 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/max_of.ts +90 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/max_with.ts +46 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/min_by.ts +151 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/min_of.ts +90 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/min_with.ts +42 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/mod.ts +76 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/omit.ts +34 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/partition.ts +85 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/partition_entries.ts +58 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/permutations.ts +66 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/pick.ts +34 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/reduce_groups.ts +45 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/running_reduce.ts +38 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/sample.ts +36 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/sliding_windows.ts +86 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/sort_by.ts +219 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/sum_of.ts +42 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/take_last_while.ts +37 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/take_while.ts +44 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/union.ts +36 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/unzip.ts +50 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/without_all.ts +28 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/zip.ts +49 -0
- package/src/mod.ts +3 -18
- package/src/oai.ts +5 -0
- package/src/types/Ref.ts +16 -0
- package/src/types/RootTy.ts +40 -0
- package/src/types/Ty.ts +57 -0
- package/src/types/array.ts +9 -0
- package/src/types/constant.ts +8 -0
- package/src/types/constantUnion.ts +27 -0
- package/src/types/leaves.ts +21 -0
- package/src/types/mod.ts +10 -0
- package/src/types/object.ts +15 -0
- package/src/types/std/Option.ts +15 -0
- package/src/types/std/Wrapper.ts +8 -0
- package/src/types/std/mod.ts +2 -0
- package/src/types/taggedUnion.ts +28 -0
- package/src/util/phantoms.ts +3 -0
- package/src/util/recombineTaggedTemplateArgs.ts +6 -0
- package/esm/F.d.ts +0 -13
- package/esm/F.d.ts.map +0 -1
- package/esm/F.js +0 -10
- package/esm/F.js.map +0 -1
- package/esm/_base.d.ts +0 -13
- package/esm/_base.d.ts.map +0 -1
- package/esm/_base.js +0 -40
- package/esm/_base.js.map +0 -1
- package/esm/array.d.ts +0 -4
- package/esm/array.d.ts.map +0 -1
- package/esm/array.js +0 -9
- package/esm/array.js.map +0 -1
- package/esm/common.d.ts +0 -6
- package/esm/common.d.ts.map +0 -1
- package/esm/common.js +0 -2
- package/esm/common.js.map +0 -1
- package/esm/literal.d.ts +0 -4
- package/esm/literal.d.ts.map +0 -1
- package/esm/literal.js +0 -8
- package/esm/literal.js.map +0 -1
- package/esm/number.d.ts +0 -4
- package/esm/number.d.ts.map +0 -1
- package/esm/number.js +0 -8
- package/esm/number.js.map +0 -1
- package/esm/object.d.ts +0 -7
- package/esm/object.d.ts.map +0 -1
- package/esm/object.js.map +0 -1
- package/esm/schema.d.ts +0 -4
- package/esm/schema.d.ts.map +0 -1
- package/esm/schema.js +0 -9
- package/esm/schema.js.map +0 -1
- package/esm/string.d.ts +0 -4
- package/esm/string.d.ts.map +0 -1
- package/esm/string.js +0 -8
- package/esm/string.js.map +0 -1
- package/esm/union.d.ts +0 -6
- package/esm/union.d.ts.map +0 -1
- package/esm/union.js +0 -8
- package/esm/union.js.map +0 -1
- package/src/F.ts +0 -27
- package/src/_base.ts +0 -25
- package/src/array.ts +0 -11
- package/src/common.ts +0 -6
- package/src/literal.ts +0 -10
- package/src/number.ts +0 -10
- package/src/object.ts +0 -17
- package/src/schema.ts +0 -10
- package/src/string.ts +0 -10
- package/src/union.ts +0 -12
@@ -0,0 +1,27 @@
|
|
1
|
+
import { partition } from "../deps/jsr.io/@std/collections/1.0.9/mod.js"
|
2
|
+
import { Ty } from "./Ty.js"
|
3
|
+
|
4
|
+
export function constantUnion<M extends Array<number | string>>(
|
5
|
+
...members: M
|
6
|
+
): Ty<M[number], never> {
|
7
|
+
const [strings, numbers] = partition(members, (v) => typeof v === "string")
|
8
|
+
return Ty((description) => {
|
9
|
+
return {
|
10
|
+
anyOf: [
|
11
|
+
...strings.length
|
12
|
+
? [{
|
13
|
+
type: "string",
|
14
|
+
enum: strings,
|
15
|
+
}]
|
16
|
+
: [],
|
17
|
+
...numbers.length
|
18
|
+
? [{
|
19
|
+
type: "number",
|
20
|
+
enum: numbers,
|
21
|
+
}]
|
22
|
+
: [],
|
23
|
+
],
|
24
|
+
description,
|
25
|
+
}
|
26
|
+
})
|
27
|
+
}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
import { Ty } from "./Ty.js"
|
2
|
+
|
3
|
+
export const none: Ty<null, never> = Ty((description) => ({
|
4
|
+
type: "null",
|
5
|
+
description,
|
6
|
+
}))
|
7
|
+
|
8
|
+
export const boolean: Ty<boolean, never> = Ty((description) => ({
|
9
|
+
type: "boolean",
|
10
|
+
description,
|
11
|
+
}))
|
12
|
+
|
13
|
+
export const number: Ty<number, never> = Ty((description) => ({
|
14
|
+
type: "number",
|
15
|
+
description,
|
16
|
+
}))
|
17
|
+
|
18
|
+
export const string: Ty<string, never> = Ty((description) => ({
|
19
|
+
type: "string",
|
20
|
+
description,
|
21
|
+
}))
|
package/src/types/mod.ts
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
export * from "./array.js"
|
2
|
+
export * from "./leaves.js"
|
3
|
+
export * from "./constant.js"
|
4
|
+
export * from "./constantUnion.js"
|
5
|
+
export * from "./std/mod.js"
|
6
|
+
export * from "./object.js"
|
7
|
+
export * from "./Ref.js"
|
8
|
+
export * from "./taggedUnion.js"
|
9
|
+
export * from "./Ty.js"
|
10
|
+
export * from "./RootTy.js"
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import { RootTy } from "./RootTy.js"
|
2
|
+
import type { Ty } from "./Ty.js"
|
3
|
+
|
4
|
+
export function object<F extends Record<string, Ty>>(fields: F): RootTy<
|
5
|
+
{ [K in keyof F]: F[K][Ty.T] },
|
6
|
+
F[keyof F][Ty.P]
|
7
|
+
> {
|
8
|
+
return RootTy((description, ref) => ({
|
9
|
+
type: "object",
|
10
|
+
description,
|
11
|
+
properties: Object.fromEntries(Object.entries(fields).map(([k, v]) => [k, ref(v)])),
|
12
|
+
additionalProperties: false,
|
13
|
+
required: Object.keys(fields),
|
14
|
+
}))
|
15
|
+
}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import { none } from "../leaves.js"
|
2
|
+
import { taggedUnion } from "../taggedUnion.js"
|
3
|
+
import type { Ty } from "../Ty.js"
|
4
|
+
|
5
|
+
export function option<S extends Ty>(Some: S): ReturnType<
|
6
|
+
typeof taggedUnion<{
|
7
|
+
Some: S
|
8
|
+
None: Ty<null, never>
|
9
|
+
}>
|
10
|
+
> {
|
11
|
+
return taggedUnion({
|
12
|
+
Some,
|
13
|
+
None: none,
|
14
|
+
})`An option of specified \`some\` type.`
|
15
|
+
}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import type { Ty } from "../mod.js"
|
2
|
+
import { object } from "../object.js"
|
3
|
+
|
4
|
+
export type Wrapper<X extends Ty = Ty> = ReturnType<typeof Wrapper<X>>
|
5
|
+
|
6
|
+
export function Wrapper<X extends Ty>(value: X): ReturnType<typeof object<{ value: X }>> {
|
7
|
+
return object({ value })
|
8
|
+
}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import { Ty } from "./Ty.js"
|
2
|
+
|
3
|
+
export function taggedUnion<M extends Record<string, Ty>>(members: M): Ty<
|
4
|
+
{
|
5
|
+
[K in keyof M]: {
|
6
|
+
type: K
|
7
|
+
value: M[K][Ty.T]
|
8
|
+
}
|
9
|
+
}[keyof M],
|
10
|
+
M[keyof M][Ty.P]
|
11
|
+
> {
|
12
|
+
return Ty((description, ref) => ({
|
13
|
+
description,
|
14
|
+
discriminator: "type",
|
15
|
+
anyOf: Object.entries(members).map(([k, v]) => ({
|
16
|
+
type: "object",
|
17
|
+
properties: {
|
18
|
+
type: {
|
19
|
+
type: "string",
|
20
|
+
const: k,
|
21
|
+
},
|
22
|
+
value: ref(v),
|
23
|
+
},
|
24
|
+
required: ["type", "value"],
|
25
|
+
additionalProperties: false,
|
26
|
+
})),
|
27
|
+
}))
|
28
|
+
}
|
package/esm/F.d.ts
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
import type { Ty } from "./_base.js";
|
2
|
-
import type { ValidRootKey } from "./common.js";
|
3
|
-
export type F = {
|
4
|
-
type: "function";
|
5
|
-
/** The name of the function. */
|
6
|
-
name: string;
|
7
|
-
/** The description of the function. */
|
8
|
-
description: string;
|
9
|
-
/** Parameters of the function in JSON Schema. */
|
10
|
-
parameters: unknown;
|
11
|
-
};
|
12
|
-
export declare function F<M extends Record<string, Ty>>(name: string, description: string, models: M, rootKey: ValidRootKey<M>): F;
|
13
|
-
//# sourceMappingURL=F.d.ts.map
|
package/esm/F.d.ts.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"F.d.ts","sourceRoot":"","sources":["../src/F.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,YAAY,CAAA;AACpC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAG/C,MAAM,MAAM,CAAC,GAAG;IACd,IAAI,EAAE,UAAU,CAAA;IAChB,gCAAgC;IAChC,IAAI,EAAE,MAAM,CAAA;IACZ,uCAAuC;IACvC,WAAW,EAAE,MAAM,CAAA;IACnB,iDAAiD;IACjD,UAAU,EAAE,OAAO,CAAA;CACpB,CAAA;AAED,wBAAgB,CAAC,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC,EAC5C,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,CAAC,EACT,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,GACvB,CAAC,CAOH"}
|
package/esm/F.js
DELETED
package/esm/F.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"F.js","sourceRoot":"","sources":["../src/F.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAYpC,MAAM,UAAU,CAAC,CACf,IAAY,EACZ,WAAmB,EACnB,MAAS,EACT,OAAwB;IAExB,OAAO;QACL,IAAI,EAAE,UAAU;QAChB,IAAI;QACJ,WAAW;QACX,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;KACpC,CAAA;AACH,CAAC"}
|
package/esm/_base.d.ts
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
export interface Ty<N = any> {
|
2
|
-
new (): N;
|
3
|
-
schema(ctx: Context): Record<string, unknown>;
|
4
|
-
}
|
5
|
-
export declare function make<Ty_ extends Ty>(schema: (ctx: Context) => unknown): Ty_;
|
6
|
-
export declare class Context {
|
7
|
-
readonly root: Ty;
|
8
|
-
readonly models?: Record<string, Ty> | undefined;
|
9
|
-
defs: Map<Ty, string>;
|
10
|
-
constructor(root: Ty, models?: Record<string, Ty> | undefined);
|
11
|
-
ref(value: Ty): Record<string, unknown>;
|
12
|
-
}
|
13
|
-
//# sourceMappingURL=_base.d.ts.map
|
package/esm/_base.d.ts.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"_base.d.ts","sourceRoot":"","sources":["../src/_base.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,EAAE,CAAC,CAAC,GAAG,GAAG;IACzB,QAAO,CAAC,CAAA;IACR,MAAM,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAC9C;AAED,wBAAgB,IAAI,CAAC,GAAG,SAAS,EAAE,EAAE,MAAM,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,OAAO,GAG/D,GAAG,CACT;AAED,qBAAa,OAAO;IAGhB,QAAQ,CAAC,IAAI,EAAE,EAAE;IACjB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC;IAHtC,IAAI,EAAE,GAAG,CAAC,EAAE,EAAE,MAAM,CAAC,CAAA;gBAEV,IAAI,EAAE,EAAE,EACR,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC,YAAA;IAKtC,GAAG,CAAC,KAAK,EAAE,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CAIxC"}
|
package/esm/_base.js
DELETED
@@ -1,40 +0,0 @@
|
|
1
|
-
export function make(schema) {
|
2
|
-
var _a;
|
3
|
-
return _a = class Ty {
|
4
|
-
},
|
5
|
-
Object.defineProperty(_a, "schema", {
|
6
|
-
enumerable: true,
|
7
|
-
configurable: true,
|
8
|
-
writable: true,
|
9
|
-
value: schema
|
10
|
-
}),
|
11
|
-
_a;
|
12
|
-
}
|
13
|
-
export class Context {
|
14
|
-
constructor(root, models) {
|
15
|
-
Object.defineProperty(this, "root", {
|
16
|
-
enumerable: true,
|
17
|
-
configurable: true,
|
18
|
-
writable: true,
|
19
|
-
value: root
|
20
|
-
});
|
21
|
-
Object.defineProperty(this, "models", {
|
22
|
-
enumerable: true,
|
23
|
-
configurable: true,
|
24
|
-
writable: true,
|
25
|
-
value: models
|
26
|
-
});
|
27
|
-
Object.defineProperty(this, "defs", {
|
28
|
-
enumerable: true,
|
29
|
-
configurable: true,
|
30
|
-
writable: true,
|
31
|
-
value: void 0
|
32
|
-
});
|
33
|
-
this.defs = new Map(models ? Object.entries(models).map(([k, v]) => [v, k]) : []);
|
34
|
-
}
|
35
|
-
ref(value) {
|
36
|
-
const key = this.defs.get(value);
|
37
|
-
return key ? { $ref: `#/$defs/${key}` } : value.schema(this);
|
38
|
-
}
|
39
|
-
}
|
40
|
-
//# sourceMappingURL=_base.js.map
|
package/esm/_base.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"_base.js","sourceRoot":"","sources":["../src/_base.ts"],"names":[],"mappings":"AAKA,MAAM,UAAU,IAAI,CAAiB,MAAiC;;IACpE,OAAO,KAAA,MAAM,EAAE;SAEd;QADQ;;;;mBAAS,MAAM;UAAA;UAChB,CAAA;AACV,CAAC;AAED,MAAM,OAAO,OAAO;IAElB,YACW,IAAQ,EACR,MAA2B;QADpC;;;;mBAAS,IAAI;WAAI;QACjB;;;;mBAAS,MAAM;WAAqB;QAHtC;;;;;WAAqB;QAKnB,IAAI,CAAC,IAAI,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAA;IACnF,CAAC;IAED,GAAG,CAAC,KAAS;QACX,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;QAChC,OAAO,GAAG,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,WAAW,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;IAC9D,CAAC;CACF"}
|
package/esm/array.d.ts
DELETED
package/esm/array.d.ts.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"array.d.ts","sourceRoot":"","sources":["../src/array.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,EAAE,EAAE,MAAM,YAAY,CAAA;AAE1C,wBAAgB,KAAK,CAAC,CAAC,SAAS,EAAE,EAAE,WAAW,EAAE,MAAM,GAAG,SAAS,EAAE,OAAO,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAM3F;AAED,MAAM,MAAM,OAAO,CAAC,CAAC,SAAS,EAAE,GAAG,GAAG,IAAI,EAAE,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA"}
|
package/esm/array.js
DELETED
package/esm/array.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"array.js","sourceRoot":"","sources":["../src/array.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAW,MAAM,YAAY,CAAA;AAE1C,MAAM,UAAU,KAAK,CAAe,WAA+B,EAAE,OAAU;IAC7E,OAAO,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;QACpB,IAAI,EAAE,OAAO;QACb,WAAW;QACX,KAAK,EAAE,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC;KACxB,CAAC,CAAC,CAAA;AACL,CAAC"}
|
package/esm/common.d.ts
DELETED
package/esm/common.d.ts.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../src/common.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,YAAY,CAAA;AACpC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAE3C,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,MAAM;KAC5D,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,KAAK;CAClE,CAAA"}
|
package/esm/common.js
DELETED
package/esm/common.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"common.js","sourceRoot":"","sources":["../src/common.ts"],"names":[],"mappings":""}
|
package/esm/literal.d.ts
DELETED
package/esm/literal.d.ts.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"literal.d.ts","sourceRoot":"","sources":["../src/literal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,EAAE,EAAE,MAAM,YAAY,CAAA;AAE1C,wBAAgB,OAAO,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,SAAS,EAAE,KAAK,EAAE,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,CAK1G;AAED,MAAM,MAAM,SAAS,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,GAAG,IAAI,EAAE,CAAC,CAAC,CAAC,CAAA"}
|
package/esm/literal.js
DELETED
package/esm/literal.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"literal.js","sourceRoot":"","sources":["../src/literal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAW,MAAM,YAAY,CAAA;AAE1C,MAAM,UAAU,OAAO,CAA4B,WAA+B,EAAE,KAAQ;IAC1F,OAAO,IAAI,CAAe,GAAG,EAAE,CAAC,CAAC;QAC/B,KAAK,EAAE,KAAK;QACZ,WAAW;KACZ,CAAC,CAAC,CAAA;AACL,CAAC"}
|
package/esm/number.d.ts
DELETED
package/esm/number.d.ts.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"number.d.ts","sourceRoot":"","sources":["../src/number.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,EAAE,EAAE,MAAM,YAAY,CAAA;AAE1C,wBAAgB,MAAM,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,QAAQ,CAKrD;AAED,MAAM,MAAM,QAAQ,GAAG,EAAE,CAAC,MAAM,CAAC,CAAA"}
|
package/esm/number.js
DELETED
package/esm/number.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"number.js","sourceRoot":"","sources":["../src/number.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAW,MAAM,YAAY,CAAA;AAE1C,MAAM,UAAU,MAAM,CAAC,WAAoB;IACzC,OAAO,IAAI,CAAW,GAAG,EAAE,CAAC,CAAC;QAC3B,IAAI,EAAE,QAAQ;QACd,WAAW;KACZ,CAAC,CAAC,CAAA;AACL,CAAC"}
|
package/esm/object.d.ts
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
import { type Ty } from "./_base.js";
|
2
|
-
export declare function object<F extends ObjectTyFields>(description: string | undefined, fields: F): ObjectTy<F>;
|
3
|
-
export type ObjectTyFields = Record<string, Ty>;
|
4
|
-
export type ObjectTy<F extends ObjectTyFields = any> = Ty<{
|
5
|
-
[K in keyof F]: F[K] extends Ty ? InstanceType<F[K]> : F[K];
|
6
|
-
}>;
|
7
|
-
//# sourceMappingURL=object.d.ts.map
|
package/esm/object.d.ts.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"object.d.ts","sourceRoot":"","sources":["../src/object.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,EAAE,EAAE,MAAM,YAAY,CAAA;AAE1C,wBAAgB,MAAM,CAAC,CAAC,SAAS,cAAc,EAAE,WAAW,EAAE,MAAM,GAAG,SAAS,EAAE,MAAM,EAAE,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAQxG;AAED,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC,CAAA;AAE/C,MAAM,MAAM,QAAQ,CAAC,CAAC,SAAS,cAAc,GAAG,GAAG,IAAI,EAAE,CACvD;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAE,CAChE,CAAA"}
|
package/esm/object.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"object.js","sourceRoot":"","sources":["../src/object.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAW,MAAM,YAAY,CAAA;AAE1C,MAAM,UAAU,MAAM,CAA2B,WAA+B,EAAE,MAAS;IACzF,OAAO,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;QACpB,IAAI,EAAE,QAAQ;QACd,WAAW;QACX,UAAU,EAAE,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACvF,oBAAoB,EAAE,KAAK;QAC3B,QAAQ,EAAE,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC;KAC9B,CAAC,CAAC,CAAA;AACL,CAAC"}
|
package/esm/schema.d.ts
DELETED
package/esm/schema.d.ts.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,KAAK,EAAE,EAAE,MAAM,YAAY,CAAA;AAC7C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAE/C,wBAAgB,MAAM,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAMjH"}
|
package/esm/schema.js
DELETED
@@ -1,9 +0,0 @@
|
|
1
|
-
import { Context } from "./_base.js";
|
2
|
-
export function schema(models, rootKey) {
|
3
|
-
const root = models[rootKey];
|
4
|
-
const ctx = new Context(root, models);
|
5
|
-
return Object.assign(root.schema(ctx), {
|
6
|
-
$defs: Object.fromEntries(Object.entries(models).map(([k, v]) => [k, v.schema(ctx)])),
|
7
|
-
});
|
8
|
-
}
|
9
|
-
//# sourceMappingURL=schema.js.map
|
package/esm/schema.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAW,MAAM,YAAY,CAAA;AAG7C,MAAM,UAAU,MAAM,CAA+B,MAAS,EAAE,OAAwB;IACtF,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,CAAE,CAAA;IAC7B,MAAM,GAAG,GAAG,IAAI,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA;IACrC,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE;QACrC,KAAK,EAAE,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;KACtF,CAAC,CAAA;AACJ,CAAC"}
|
package/esm/string.d.ts
DELETED
package/esm/string.d.ts.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"string.d.ts","sourceRoot":"","sources":["../src/string.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,EAAE,EAAE,MAAM,YAAY,CAAA;AAE1C,wBAAgB,MAAM,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,QAAQ,CAKrD;AAED,MAAM,MAAM,QAAQ,GAAG,EAAE,CAAC,MAAM,CAAC,CAAA"}
|
package/esm/string.js
DELETED
package/esm/string.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"string.js","sourceRoot":"","sources":["../src/string.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAW,MAAM,YAAY,CAAA;AAE1C,MAAM,UAAU,MAAM,CAAC,WAAoB;IACzC,OAAO,IAAI,CAAW,GAAG,EAAE,CAAC,CAAC;QAC3B,IAAI,EAAE,QAAQ;QACd,WAAW;KACZ,CAAC,CAAC,CAAA;AACL,CAAC"}
|
package/esm/union.d.ts
DELETED
@@ -1,6 +0,0 @@
|
|
1
|
-
import { type Ty } from "./_base.js";
|
2
|
-
export declare function union<M extends Ty[]>(description: string | undefined, members: [...M]): UnionTy<M>;
|
3
|
-
export type UnionTy<M extends Ty[]> = Ty<{
|
4
|
-
[K in keyof M]: M[K] extends Ty ? InstanceType<M[K]> : M[K];
|
5
|
-
}[number]>;
|
6
|
-
//# sourceMappingURL=union.d.ts.map
|
package/esm/union.d.ts.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"union.d.ts","sourceRoot":"","sources":["../src/union.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,EAAE,EAAE,MAAM,YAAY,CAAA;AAE1C,wBAAgB,KAAK,CAAC,CAAC,SAAS,EAAE,EAAE,EAAE,WAAW,EAAE,MAAM,GAAG,SAAS,EAAE,OAAO,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAKlG;AAED,MAAM,MAAM,OAAO,CAAC,CAAC,SAAS,EAAE,EAAE,IAAI,EAAE,CACtC;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAE,CAAC,MAAM,CAAC,CACxE,CAAA"}
|
package/esm/union.js
DELETED
package/esm/union.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"union.js","sourceRoot":"","sources":["../src/union.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAW,MAAM,YAAY,CAAA;AAE1C,MAAM,UAAU,KAAK,CAAiB,WAA+B,EAAE,OAAe;IACpF,OAAO,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;QACpB,WAAW;QACX,KAAK,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;KAChD,CAAC,CAAC,CAAA;AACL,CAAC"}
|
package/src/F.ts
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
import type { Ty } from "./_base.js"
|
2
|
-
import type { ValidRootKey } from "./common.js"
|
3
|
-
import { schema } from "./schema.js"
|
4
|
-
|
5
|
-
export type F = {
|
6
|
-
type: "function"
|
7
|
-
/** The name of the function. */
|
8
|
-
name: string
|
9
|
-
/** The description of the function. */
|
10
|
-
description: string
|
11
|
-
/** Parameters of the function in JSON Schema. */
|
12
|
-
parameters: unknown
|
13
|
-
}
|
14
|
-
|
15
|
-
export function F<M extends Record<string, Ty>>(
|
16
|
-
name: string,
|
17
|
-
description: string,
|
18
|
-
models: M,
|
19
|
-
rootKey: ValidRootKey<M>,
|
20
|
-
): F {
|
21
|
-
return {
|
22
|
-
type: "function",
|
23
|
-
name,
|
24
|
-
description,
|
25
|
-
parameters: schema(models, rootKey),
|
26
|
-
}
|
27
|
-
}
|
package/src/_base.ts
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
export interface Ty<N = any> {
|
2
|
-
new(): N
|
3
|
-
schema(ctx: Context): Record<string, unknown>
|
4
|
-
}
|
5
|
-
|
6
|
-
export function make<Ty_ extends Ty>(schema: (ctx: Context) => unknown) {
|
7
|
-
return class Ty {
|
8
|
-
static schema = schema
|
9
|
-
} as Ty_
|
10
|
-
}
|
11
|
-
|
12
|
-
export class Context {
|
13
|
-
defs: Map<Ty, string>
|
14
|
-
constructor(
|
15
|
-
readonly root: Ty,
|
16
|
-
readonly models?: Record<string, Ty>,
|
17
|
-
) {
|
18
|
-
this.defs = new Map(models ? Object.entries(models).map(([k, v]) => [v, k]) : [])
|
19
|
-
}
|
20
|
-
|
21
|
-
ref(value: Ty): Record<string, unknown> {
|
22
|
-
const key = this.defs.get(value)
|
23
|
-
return key ? { $ref: `#/$defs/${key}` } : value.schema(this)
|
24
|
-
}
|
25
|
-
}
|
package/src/array.ts
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
import { make, type Ty } from "./_base.js"
|
2
|
-
|
3
|
-
export function array<E extends Ty>(description: string | undefined, element: E): ArrayTy<E> {
|
4
|
-
return make((ctx) => ({
|
5
|
-
type: "array",
|
6
|
-
description,
|
7
|
-
items: ctx.ref(element),
|
8
|
-
}))
|
9
|
-
}
|
10
|
-
|
11
|
-
export type ArrayTy<E extends Ty = any> = Ty<Array<InstanceType<E>>>
|
package/src/common.ts
DELETED
package/src/literal.ts
DELETED
@@ -1,10 +0,0 @@
|
|
1
|
-
import { make, type Ty } from "./_base.js"
|
2
|
-
|
3
|
-
export function literal<V extends number | string>(description: string | undefined, value: V): LiteralTy<V> {
|
4
|
-
return make<LiteralTy<V>>(() => ({
|
5
|
-
const: value,
|
6
|
-
description,
|
7
|
-
}))
|
8
|
-
}
|
9
|
-
|
10
|
-
export type LiteralTy<V extends number | string = any> = Ty<V>
|
package/src/number.ts
DELETED
package/src/object.ts
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
import { make, type Ty } from "./_base.js"
|
2
|
-
|
3
|
-
export function object<F extends ObjectTyFields>(description: string | undefined, fields: F): ObjectTy<F> {
|
4
|
-
return make((ctx) => ({
|
5
|
-
type: "object",
|
6
|
-
description,
|
7
|
-
properties: Object.fromEntries(Object.entries(fields).map(([k, v]) => [k, ctx.ref(v)])),
|
8
|
-
additionalProperties: false,
|
9
|
-
required: Object.keys(fields),
|
10
|
-
}))
|
11
|
-
}
|
12
|
-
|
13
|
-
export type ObjectTyFields = Record<string, Ty>
|
14
|
-
|
15
|
-
export type ObjectTy<F extends ObjectTyFields = any> = Ty<
|
16
|
-
{ [K in keyof F]: F[K] extends Ty ? InstanceType<F[K]> : F[K] }
|
17
|
-
>
|
package/src/schema.ts
DELETED
@@ -1,10 +0,0 @@
|
|
1
|
-
import { Context, type Ty } from "./_base.js"
|
2
|
-
import type { ValidRootKey } from "./common.js"
|
3
|
-
|
4
|
-
export function schema<M extends Record<string, Ty>>(models: M, rootKey: ValidRootKey<M>): Record<string, unknown> {
|
5
|
-
const root = models[rootKey]!
|
6
|
-
const ctx = new Context(root, models)
|
7
|
-
return Object.assign(root.schema(ctx), {
|
8
|
-
$defs: Object.fromEntries(Object.entries(models).map(([k, v]) => [k, v.schema(ctx)])),
|
9
|
-
})
|
10
|
-
}
|
package/src/string.ts
DELETED
package/src/union.ts
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
import { make, type Ty } from "./_base.js"
|
2
|
-
|
3
|
-
export function union<M extends Ty[]>(description: string | undefined, members: [...M]): UnionTy<M> {
|
4
|
-
return make((ctx) => ({
|
5
|
-
description,
|
6
|
-
oneOf: members.map((member) => ctx.ref(member)),
|
7
|
-
}))
|
8
|
-
}
|
9
|
-
|
10
|
-
export type UnionTy<M extends Ty[]> = Ty<
|
11
|
-
{ [K in keyof M]: M[K] extends Ty ? InstanceType<M[K]> : M[K] }[number]
|
12
|
-
>
|