From 1a1d5526b7da886da245c93472f1a75375129d3a Mon Sep 17 00:00:00 2001 From: Orion Kindel Date: Sat, 23 Nov 2024 13:49:36 -0600 Subject: [PATCH] fix: form bug --- .spec-results | 23 + spago.lock | 2234 +++++++++++++++++---------- spago.yaml | 5 + src/Effect.Aff.HTTP/Form.js | 42 +- src/Effect.Aff.HTTP/Form.purs | 34 +- test/Test.Effect.Aff.HTTP.Form.js | 7 + test/Test.Effect.Aff.HTTP.Form.purs | 32 + test/Test.Main.purs | 12 + 8 files changed, 1558 insertions(+), 831 deletions(-) create mode 100644 .spec-results create mode 100644 test/Test.Effect.Aff.HTTP.Form.js create mode 100644 test/Test.Effect.Aff.HTTP.Form.purs create mode 100644 test/Test.Main.purs diff --git a/.spec-results b/.spec-results new file mode 100644 index 0000000..78e97f2 --- /dev/null +++ b/.spec-results @@ -0,0 +1,23 @@ +[ + [ + "Form fromRaw", + { + "timestamp": "1732391355864.0", + "success": true + } + ], + [ + "Form ok", + { + "timestamp": "1732390464524.0", + "success": true + } + ], + [ + "Form toRaw", + { + "timestamp": "1732391355864.0", + "success": true + } + ] +] \ No newline at end of file diff --git a/spago.lock b/spago.lock index a2b2b6e..bb89a4d 100644 --- a/spago.lock +++ b/spago.lock @@ -1,810 +1,1424 @@ -workspace: - packages: - ezfetch: - path: ./ - dependencies: - - aff: ">=7.1.0 <8.0.0" - - aff-promise: ">=4.0.0 <5.0.0" - - arraybuffer-types: ">=3.0.2 <4.0.0" - - b64: ">=0.0.8 <0.0.9" - - bifunctors: ">=6.0.0 <7.0.0" - - effect: ">=4.0.0 <5.0.0" - - either: ">=6.1.0 <7.0.0" - - exceptions: ">=6.0.0 <7.0.0" - - foldable-traversable: ">=6.0.0 <7.0.0" - - foreign: ">=7.0.0 <8.0.0" - - foreign-object: ">=4.1.0 <5.0.0" - - integers: ">=6.0.0 <7.0.0" - - maybe: ">=6.0.0 <7.0.0" - - newtype: ">=5.0.0 <6.0.0" - - node-buffer: ">=9.0.0 <10.0.0" - - node-streams: ">=9.0.0 <10.0.0" - - nullable: ">=6.0.0 <7.0.0" - - numbers: ">=9.0.1 <10.0.0" - - ordered-collections: ">=3.2.0 <4.0.0" - - prelude: ">=6.0.1 <7.0.0" - - record: ">=4.0.0 <5.0.0" - - simple-json: ">=9.0.0 <10.0.0" - - transformers: ">=6.0.0 <7.0.0" - - tuples: ">=7.0.0 <8.0.0" - - typelevel-prelude: ">=7.0.0 <8.0.0" - - unsafe-coerce: ">=6.0.0 <7.0.0" - - url-immutable: ">=1.0.0 <2.0.0" - - web-file: ">=4.0.0 <5.0.0" - - web-streams: ">=4.0.0 <5.0.0" - test_dependencies: [] - build_plan: - - aff - - aff-promise - - arraybuffer-types - - arrays - - b64 - - bifunctors - - const - - contravariant - - control - - datetime - - distributive - - effect - - either - - encoding - - enums - - exceptions - - exists - - filterable - - foldable-traversable - - foreign - - foreign-object - - functions - - functors - - gen - - identity - - integers - - invariant - - js-promise - - lazy - - lists - - maybe - - media-types - - newtype - - node-buffer - - node-event-emitter - - node-streams - - nonempty - - nullable - - numbers - - ordered-collections - - orders - - parallel - - partial - - prelude - - profunctor - - record - - refs - - safe-coerce - - simple-json - - st - - strings - - stringutils - - tailrec - - transformers - - tuples - - type-equality - - typelevel-prelude - - unfoldable - - unsafe-coerce - - url-immutable - - variant - - web-dom - - web-events - - web-file - - web-streams - extra_packages: {} -packages: - aff: - type: registry - version: 7.1.0 - integrity: sha256-7hOC6uQO9XBAI5FD8F33ChLjFAiZVfd4BJMqlMh7TNU= - dependencies: - - arrays - - bifunctors - - control - - datetime - - effect - - either - - exceptions - - foldable-traversable - - functions - - maybe - - newtype - - parallel - - prelude - - refs - - tailrec - - transformers - - unsafe-coerce - aff-promise: - type: registry - version: 4.0.0 - integrity: sha256-Kq5EupbUpXeUXx4JqGQE7/RTTz/H6idzWhsocwlEFhM= - dependencies: - - aff - - foreign - arraybuffer-types: - type: registry - version: 3.0.2 - integrity: sha256-mQKokysYVkooS4uXbO+yovmV/s8b138Ws3zQvOwIHRA= - dependencies: [] - arrays: - type: registry - version: 7.3.0 - integrity: sha256-tmcklBlc/muUtUfr9RapdCPwnlQeB3aSrC4dK85gQlc= - dependencies: - - bifunctors - - control - - foldable-traversable - - functions - - maybe - - nonempty - - partial - - prelude - - safe-coerce - - st - - tailrec - - tuples - - unfoldable - - unsafe-coerce - b64: - type: registry - version: 0.0.8 - integrity: sha256-3QkOhnewZIqhfn0wIU6Zde6Q/LfrS59kgSOcQQaG0gM= - dependencies: - - arraybuffer-types - - either - - encoding - - enums - - exceptions - - functions - - partial - - prelude - - strings - bifunctors: - type: registry - version: 6.0.0 - integrity: sha256-/gZwC9YhNxZNQpnHa5BIYerCGM2jeX9ukZiEvYxm5Nw= - dependencies: - - const - - either - - newtype - - prelude - - tuples - const: - type: registry - version: 6.0.0 - integrity: sha256-tNrxDW8D8H4jdHE2HiPzpLy08zkzJMmGHdRqt5BQuTc= - dependencies: - - invariant - - newtype - - prelude - contravariant: - type: registry - version: 6.0.0 - integrity: sha256-TP+ooAp3vvmdjfQsQJSichF5B4BPDHp3wAJoWchip6c= - dependencies: - - const - - either - - newtype - - prelude - - tuples - control: - type: registry - version: 6.0.0 - integrity: sha256-sH7Pg9E96JCPF9PIA6oQ8+BjTyO/BH1ZuE/bOcyj4Jk= - dependencies: - - newtype - - prelude - datetime: - type: registry - version: 6.1.0 - integrity: sha256-g/5X5BBegQWLpI9IWD+sY6mcaYpzzlW5lz5NBzaMtyI= - dependencies: - - bifunctors - - control - - either - - enums - - foldable-traversable - - functions - - gen - - integers - - lists - - maybe - - newtype - - numbers - - ordered-collections - - partial - - prelude - - tuples - distributive: - type: registry - version: 6.0.0 - integrity: sha256-HTDdmEnzigMl+02SJB88j+gAXDx9VKsbvR4MJGDPbOQ= - dependencies: - - identity - - newtype - - prelude - - tuples - - type-equality - effect: - type: registry - version: 4.0.0 - integrity: sha256-eBtZu+HZcMa5HilvI6kaDyVX3ji8p0W9MGKy2K4T6+M= - dependencies: - - prelude - either: - type: registry - version: 6.1.0 - integrity: sha256-6hgTPisnMWVwQivOu2PKYcH8uqjEOOqDyaDQVUchTpY= - dependencies: - - control - - invariant - - maybe - - prelude - encoding: - type: registry - version: 0.0.8 - integrity: sha256-n0HhENAax0yr7JFwZXcisx0jJvVf1dFwqd+Q5i2Pr88= - dependencies: - - arraybuffer-types - - either - - exceptions - - functions - - prelude - enums: - type: registry - version: 6.0.1 - integrity: sha256-HWaD73JFLorc4A6trKIRUeDMdzE+GpkJaEOM1nTNkC8= - dependencies: - - control - - either - - gen - - maybe - - newtype - - nonempty - - partial - - prelude - - tuples - - unfoldable - exceptions: - type: registry - version: 6.0.0 - integrity: sha256-y/xTAEIZIARCE+50/u1di0ncebJ+CIwNOLswyOWzMTw= - dependencies: - - effect - - either - - maybe - - prelude - exists: - type: registry - version: 6.0.0 - integrity: sha256-A0JQHpTfo1dNOj9U5/Fd3xndlRSE0g2IQWOGor2yXn8= - dependencies: - - unsafe-coerce - filterable: - type: registry - version: 5.0.0 - integrity: sha256-cCojJHRnTmpY1j1kegI4CFwghdQ2Fm/8dzM8IlC+lng= - dependencies: - - arrays - - either - - foldable-traversable - - identity - - lists - - ordered-collections - foldable-traversable: - type: registry - version: 6.0.0 - integrity: sha256-fLeqRYM4jUrZD5H4WqcwUgzU7XfYkzO4zhgtNc3jcWM= - dependencies: - - bifunctors - - const - - control - - either - - functors - - identity - - maybe - - newtype - - orders - - prelude - - tuples - foreign: - type: registry - version: 7.0.0 - integrity: sha256-1ORiqoS3HW+qfwSZAppHPWy4/6AQysxZ2t29jcdUMNA= - dependencies: - - either - - functions - - identity - - integers - - lists - - maybe - - prelude - - strings - - transformers - foreign-object: - type: registry - version: 4.1.0 - integrity: sha256-q24okj6mT+yGHYQ+ei/pYPj5ih6sTbu7eDv/WU56JVo= - dependencies: - - arrays - - foldable-traversable - - functions - - gen - - lists - - maybe - - prelude - - st - - tailrec - - tuples - - typelevel-prelude - - unfoldable - functions: - type: registry - version: 6.0.0 - integrity: sha256-adMyJNEnhGde2unHHAP79gPtlNjNqzgLB8arEOn9hLI= - dependencies: - - prelude - functors: - type: registry - version: 5.0.0 - integrity: sha256-zfPWWYisbD84MqwpJSZFlvM6v86McM68ob8p9s27ywU= - dependencies: - - bifunctors - - const - - contravariant - - control - - distributive - - either - - invariant - - maybe - - newtype - - prelude - - profunctor - - tuples - - unsafe-coerce - gen: - type: registry - version: 4.0.0 - integrity: sha256-f7yzAXWwr+xnaqEOcvyO3ezKdoes8+WXWdXIHDBCAPI= - dependencies: - - either - - foldable-traversable - - identity - - maybe - - newtype - - nonempty - - prelude - - tailrec - - tuples - - unfoldable - identity: - type: registry - version: 6.0.0 - integrity: sha256-4wY0XZbAksjY6UAg99WkuKyJlQlWAfTi2ssadH0wVMY= - dependencies: - - control - - invariant - - newtype - - prelude - integers: - type: registry - version: 6.0.0 - integrity: sha256-sf+sK26R1hzwl3NhXR7WAu9zCDjQnfoXwcyGoseX158= - dependencies: - - maybe - - numbers - - prelude - invariant: - type: registry - version: 6.0.0 - integrity: sha256-RGWWyYrz0Hs1KjPDA+87Kia67ZFBhfJ5lMGOMCEFoLo= - dependencies: - - control - - prelude - js-promise: - type: registry - version: 1.0.0 - integrity: sha256-kXNo5g9RJgPdrTuKRe5oG2kBIwPp+j5VDPDplqZBJzQ= - dependencies: - - effect - - exceptions - - foldable-traversable - - functions - - maybe - - prelude - lazy: - type: registry - version: 6.0.0 - integrity: sha256-lMsfFOnlqfe4KzRRiW8ot5ge6HtcU3Eyh2XkXcP5IgU= - dependencies: - - control - - foldable-traversable - - invariant - - prelude - lists: - type: registry - version: 7.0.0 - integrity: sha256-EKF15qYqucuXP2lT/xPxhqy58f0FFT6KHdIB/yBOayI= - dependencies: - - bifunctors - - control - - foldable-traversable - - lazy - - maybe - - newtype - - nonempty - - partial - - prelude - - tailrec - - tuples - - unfoldable - maybe: - type: registry - version: 6.0.0 - integrity: sha256-5cCIb0wPwbat2PRkQhUeZO0jcAmf8jCt2qE0wbC3v2Q= - dependencies: - - control - - invariant - - newtype - - prelude - media-types: - type: registry - version: 6.0.0 - integrity: sha256-n/4FoGBasbVSYscGVRSyBunQ6CZbL3jsYL+Lp01mc9k= - dependencies: - - newtype - - prelude - newtype: - type: registry - version: 5.0.0 - integrity: sha256-gdrQu8oGe9eZE6L3wOI8ql/igOg+zEGB5ITh2g+uttw= - dependencies: - - prelude - - safe-coerce - node-buffer: - type: registry - version: 9.0.0 - integrity: sha256-PWE2DJ5ruBLCmeA/fUiuySEFmUJ/VuRfyrnCuVZBlu4= - dependencies: - - arraybuffer-types - - effect - - maybe - - nullable - - st - - unsafe-coerce - node-event-emitter: - type: registry - version: 3.0.0 - integrity: sha256-Qw0MjsT4xRH2j2i4K8JmRjcMKnH5z1Cw39t00q4LE4w= - dependencies: - - effect - - either - - functions - - maybe - - nullable - - prelude - - unsafe-coerce - node-streams: - type: registry - version: 9.0.0 - integrity: sha256-2n6dq7YWleTDmD1Kur/ul7Cn08IvWrScgPf+0PgX2TQ= - dependencies: - - aff - - effect - - either - - exceptions - - node-buffer - - node-event-emitter - - nullable - - prelude - nonempty: - type: registry - version: 7.0.0 - integrity: sha256-54ablJZUHGvvlTJzi3oXyPCuvY6zsrWJuH/dMJ/MFLs= - dependencies: - - control - - foldable-traversable - - maybe - - prelude - - tuples - - unfoldable - nullable: - type: registry - version: 6.0.0 - integrity: sha256-yiGBVl3AD+Guy4kNWWeN+zl1gCiJK+oeIFtZtPCw4+o= - dependencies: - - effect - - functions - - maybe - numbers: - type: registry - version: 9.0.1 - integrity: sha256-/9M6aeMDBdB4cwYDeJvLFprAHZ49EbtKQLIJsneXLIk= - dependencies: - - functions - - maybe - ordered-collections: - type: registry - version: 3.2.0 - integrity: sha256-o9jqsj5rpJmMdoe/zyufWHFjYYFTTsJpgcuCnqCO6PM= - dependencies: - - arrays - - foldable-traversable - - gen - - lists - - maybe - - partial - - prelude - - st - - tailrec - - tuples - - unfoldable - orders: - type: registry - version: 6.0.0 - integrity: sha256-nBA0g3/ai0euH8q9pSbGqk53W2q6agm/dECZTHcoink= - dependencies: - - newtype - - prelude - parallel: - type: registry - version: 6.0.0 - integrity: sha256-VJbkGD0rAKX+NUEeBJbYJ78bEKaZbgow+QwQEfPB6ko= - dependencies: - - control - - effect - - either - - foldable-traversable - - functors - - maybe - - newtype - - prelude - - profunctor - - refs - - transformers - partial: - type: registry - version: 4.0.0 - integrity: sha256-fwXerld6Xw1VkReh8yeQsdtLVrjfGiVuC5bA1Wyo/J4= - dependencies: [] - prelude: - type: registry - version: 6.0.1 - integrity: sha256-o8p6SLYmVPqzXZhQFd2hGAWEwBoXl1swxLG/scpJ0V0= - dependencies: [] - profunctor: - type: registry - version: 6.0.1 - integrity: sha256-E58hSYdJvF2Qjf9dnWLPlJKh2Z2fLfFLkQoYi16vsFk= - dependencies: - - control - - distributive - - either - - exists - - invariant - - newtype - - prelude - - tuples - record: - type: registry - version: 4.0.0 - integrity: sha256-Za5U85bTRJEfGK5Sk4hM41oXy84YQI0I8TL3WUn1Qzg= - dependencies: - - functions - - prelude - - unsafe-coerce - refs: - type: registry - version: 6.0.0 - integrity: sha256-Vgwne7jIbD3ZMoLNNETLT8Litw6lIYo3MfYNdtYWj9s= - dependencies: - - effect - - prelude - safe-coerce: - type: registry - version: 2.0.0 - integrity: sha256-a1ibQkiUcbODbLE/WAq7Ttbbh9ex+x33VCQ7GngKudU= - dependencies: - - unsafe-coerce - simple-json: - type: registry - version: 9.0.0 - integrity: sha256-K3RJaThqsszTd+TEklzZmAdDqvIHWgXIfKqlsoykU1c= - dependencies: - - arrays - - exceptions - - foreign - - foreign-object - - nullable - - prelude - - record - - typelevel-prelude - - variant - st: - type: registry - version: 6.2.0 - integrity: sha256-z9X0WsOUlPwNx9GlCC+YccCyz8MejC8Wb0C4+9fiBRY= - dependencies: - - partial - - prelude - - tailrec - - unsafe-coerce - strings: - type: registry - version: 6.0.1 - integrity: sha256-WssD3DbX4OPzxSdjvRMX0yvc9+pS7n5gyPv5I2Trb7k= - dependencies: - - arrays - - control - - either - - enums - - foldable-traversable - - gen - - integers - - maybe - - newtype - - nonempty - - partial - - prelude - - tailrec - - tuples - - unfoldable - - unsafe-coerce - stringutils: - type: registry - version: 0.0.12 - integrity: sha256-t63QWBlp49U0nRqUcFryKflSJsNKGTQAHKjn24/+ooI= - dependencies: - - arrays - - integers - - maybe - - partial - - prelude - - strings - tailrec: - type: registry - version: 6.1.0 - integrity: sha256-Xx19ECVDRrDWpz9D2GxQHHV89vd61dnXxQm0IcYQHGk= - dependencies: - - bifunctors - - effect - - either - - identity - - maybe - - partial - - prelude - - refs - transformers: - type: registry - version: 6.0.0 - integrity: sha256-Pzw40HjthX77tdPAYzjx43LK3X5Bb7ZspYAp27wksFA= - dependencies: - - control - - distributive - - effect - - either - - exceptions - - foldable-traversable - - identity - - lazy - - maybe - - newtype - - prelude - - tailrec - - tuples - - unfoldable - tuples: - type: registry - version: 7.0.0 - integrity: sha256-1rXgTomes9105BjgXqIw0FL6Fz1lqqUTLWOumhWec1M= - dependencies: - - control - - invariant - - prelude - type-equality: - type: registry - version: 4.0.1 - integrity: sha256-Hs9D6Y71zFi/b+qu5NSbuadUQXe5iv5iWx0226vOHUw= - dependencies: [] - typelevel-prelude: - type: registry - version: 7.0.0 - integrity: sha256-uFF2ph+vHcQpfPuPf2a3ukJDFmLhApmkpTMviHIWgJM= - dependencies: - - prelude - - type-equality - unfoldable: - type: registry - version: 6.0.0 - integrity: sha256-JtikvJdktRap7vr/K4ITlxUX1QexpnqBq0G/InLr6eg= - dependencies: - - foldable-traversable - - maybe - - partial - - prelude - - tuples - unsafe-coerce: - type: registry - version: 6.0.0 - integrity: sha256-IqIYW4Vkevn8sI+6aUwRGvd87tVL36BBeOr0cGAE7t0= - dependencies: [] - url-immutable: - type: registry - version: 1.0.0 - integrity: sha256-6uCg5k4fjrqyTYUYKTmcykXgXCJKsvVpzx+gZJczAx0= - dependencies: - - arrays - - bifunctors - - either - - filterable - - foldable-traversable - - foreign - - integers - - maybe - - newtype - - nullable - - ordered-collections - - partial - - prelude - - simple-json - - strings - - stringutils - - transformers - - tuples - variant: - type: registry - version: 8.0.0 - integrity: sha256-SR//zQDg2dnbB8ZHslcxieUkCeNlbMToapvmh9onTtw= - dependencies: - - enums - - lists - - maybe - - partial - - prelude - - record - - tuples - - unsafe-coerce - web-dom: - type: registry - version: 6.0.0 - integrity: sha256-1kSKWFDI4LupdmpjK01b1MMxDFW7jvatEgPgVmCmSBQ= - dependencies: - - web-events - web-events: - type: registry - version: 4.0.0 - integrity: sha256-YDt8b6u1tzGtnWyNRodne57iO8FNSGPaTCVzBUyUn4k= - dependencies: - - datetime - - enums - - foreign - - nullable - web-file: - type: registry - version: 4.0.0 - integrity: sha256-1h5jPBkvjY71jLEdwVadXCx86/2inNoMBO//Rd3eCSU= - dependencies: - - foreign - - media-types - - web-dom - web-streams: - type: registry - version: 4.0.0 - integrity: sha256-02HgXIk6R+pU9fWOX42krukAI1QkCbLKcCv3b4Jq6WI= - dependencies: - - arraybuffer-types - - effect - - exceptions - - js-promise - - nullable - - prelude - - tuples +{ + "workspace": { + "packages": { + "ezfetch": { + "path": "./", + "core": { + "dependencies": [ + { + "aff": ">=7.1.0 <8.0.0" + }, + { + "aff-promise": ">=4.0.0 <5.0.0" + }, + { + "arraybuffer-types": ">=3.0.2 <4.0.0" + }, + { + "b64": ">=0.0.8 <0.0.9" + }, + { + "bifunctors": ">=6.0.0 <7.0.0" + }, + { + "effect": ">=4.0.0 <5.0.0" + }, + { + "either": ">=6.1.0 <7.0.0" + }, + { + "exceptions": ">=6.0.0 <7.0.0" + }, + { + "foldable-traversable": ">=6.0.0 <7.0.0" + }, + { + "foreign": ">=7.0.0 <8.0.0" + }, + { + "foreign-object": ">=4.1.0 <5.0.0" + }, + { + "integers": ">=6.0.0 <7.0.0" + }, + { + "maybe": ">=6.0.0 <7.0.0" + }, + { + "newtype": ">=5.0.0 <6.0.0" + }, + { + "node-buffer": ">=9.0.0 <10.0.0" + }, + { + "node-streams": ">=9.0.0 <10.0.0" + }, + { + "nullable": ">=6.0.0 <7.0.0" + }, + { + "numbers": ">=9.0.1 <10.0.0" + }, + { + "ordered-collections": ">=3.2.0 <4.0.0" + }, + { + "prelude": ">=6.0.1 <7.0.0" + }, + { + "record": ">=4.0.0 <5.0.0" + }, + { + "simple-json": ">=9.0.0 <10.0.0" + }, + { + "transformers": ">=6.0.0 <7.0.0" + }, + { + "tuples": ">=7.0.0 <8.0.0" + }, + { + "typelevel-prelude": ">=7.0.0 <8.0.0" + }, + { + "unsafe-coerce": ">=6.0.0 <7.0.0" + }, + { + "url-immutable": ">=1.0.0 <2.0.0" + }, + { + "web-file": ">=4.0.0 <5.0.0" + }, + { + "web-streams": ">=4.0.0 <5.0.0" + } + ], + "build_plan": [ + "aff", + "aff-promise", + "arraybuffer-types", + "arrays", + "b64", + "bifunctors", + "const", + "contravariant", + "control", + "datetime", + "distributive", + "effect", + "either", + "encoding", + "enums", + "exceptions", + "exists", + "filterable", + "foldable-traversable", + "foreign", + "foreign-object", + "functions", + "functors", + "gen", + "identity", + "integers", + "invariant", + "js-promise", + "lazy", + "lists", + "maybe", + "media-types", + "newtype", + "node-buffer", + "node-event-emitter", + "node-streams", + "nonempty", + "nullable", + "numbers", + "ordered-collections", + "orders", + "parallel", + "partial", + "prelude", + "profunctor", + "record", + "refs", + "safe-coerce", + "simple-json", + "st", + "strings", + "stringutils", + "tailrec", + "transformers", + "tuples", + "type-equality", + "typelevel-prelude", + "unfoldable", + "unsafe-coerce", + "url-immutable", + "variant", + "web-dom", + "web-events", + "web-file", + "web-streams" + ] + }, + "test": { + "dependencies": [ + "spec", + "spec-node" + ], + "build_plan": [ + "aff", + "ansi", + "argonaut-codecs", + "argonaut-core", + "arraybuffer-types", + "arrays", + "avar", + "bifunctors", + "catenable-lists", + "console", + "const", + "contravariant", + "control", + "datetime", + "distributive", + "effect", + "either", + "enums", + "exceptions", + "exists", + "exitcodes", + "foldable-traversable", + "foreign", + "foreign-object", + "fork", + "free", + "functions", + "functors", + "gen", + "identity", + "integers", + "invariant", + "js-date", + "lazy", + "lists", + "maybe", + "mmorph", + "newtype", + "node-buffer", + "node-event-emitter", + "node-fs", + "node-path", + "node-process", + "node-streams", + "nonempty", + "now", + "nullable", + "numbers", + "open-memoize", + "optparse", + "ordered-collections", + "orders", + "parallel", + "partial", + "pipes", + "posix-types", + "prelude", + "profunctor", + "record", + "refs", + "safe-coerce", + "spec", + "spec-node", + "st", + "strings", + "tailrec", + "transformers", + "tuples", + "type-equality", + "typelevel-prelude", + "unfoldable", + "unsafe-coerce" + ] + } + } + }, + "extra_packages": {} + }, + "packages": { + "aff": { + "type": "registry", + "version": "7.1.0", + "integrity": "sha256-7hOC6uQO9XBAI5FD8F33ChLjFAiZVfd4BJMqlMh7TNU=", + "dependencies": [ + "arrays", + "bifunctors", + "control", + "datetime", + "effect", + "either", + "exceptions", + "foldable-traversable", + "functions", + "maybe", + "newtype", + "parallel", + "prelude", + "refs", + "tailrec", + "transformers", + "unsafe-coerce" + ] + }, + "aff-promise": { + "type": "registry", + "version": "4.0.0", + "integrity": "sha256-Kq5EupbUpXeUXx4JqGQE7/RTTz/H6idzWhsocwlEFhM=", + "dependencies": [ + "aff", + "foreign" + ] + }, + "ansi": { + "type": "registry", + "version": "7.0.0", + "integrity": "sha256-ZMB6HD+q9CXvn9fRCmJ8dvuDrOVHcjombL3oNOerVnE=", + "dependencies": [ + "foldable-traversable", + "lists", + "strings" + ] + }, + "argonaut-codecs": { + "type": "registry", + "version": "9.1.0", + "integrity": "sha256-N6efXByUeg848ompEqJfVvZuZPfdRYDGlTDFn0G0Oh8=", + "dependencies": [ + "argonaut-core", + "arrays", + "effect", + "foreign-object", + "identity", + "integers", + "maybe", + "nonempty", + "ordered-collections", + "prelude", + "record" + ] + }, + "argonaut-core": { + "type": "registry", + "version": "7.0.0", + "integrity": "sha256-RC82GfAjItydxrO24cdX373KHVZiLqybu19b5X8u7B4=", + "dependencies": [ + "arrays", + "control", + "either", + "foreign-object", + "functions", + "gen", + "maybe", + "nonempty", + "prelude", + "strings", + "tailrec" + ] + }, + "arraybuffer-types": { + "type": "registry", + "version": "3.0.2", + "integrity": "sha256-mQKokysYVkooS4uXbO+yovmV/s8b138Ws3zQvOwIHRA=", + "dependencies": [] + }, + "arrays": { + "type": "registry", + "version": "7.3.0", + "integrity": "sha256-tmcklBlc/muUtUfr9RapdCPwnlQeB3aSrC4dK85gQlc=", + "dependencies": [ + "bifunctors", + "control", + "foldable-traversable", + "functions", + "maybe", + "nonempty", + "partial", + "prelude", + "safe-coerce", + "st", + "tailrec", + "tuples", + "unfoldable", + "unsafe-coerce" + ] + }, + "avar": { + "type": "registry", + "version": "5.0.0", + "integrity": "sha256-e7hf0x4hEpcygXP0LtvfvAQ49Bbj2aWtZT3gqM///0A=", + "dependencies": [ + "aff", + "effect", + "either", + "exceptions", + "functions", + "maybe" + ] + }, + "b64": { + "type": "registry", + "version": "0.0.8", + "integrity": "sha256-3QkOhnewZIqhfn0wIU6Zde6Q/LfrS59kgSOcQQaG0gM=", + "dependencies": [ + "arraybuffer-types", + "either", + "encoding", + "enums", + "exceptions", + "functions", + "partial", + "prelude", + "strings" + ] + }, + "bifunctors": { + "type": "registry", + "version": "6.0.0", + "integrity": "sha256-/gZwC9YhNxZNQpnHa5BIYerCGM2jeX9ukZiEvYxm5Nw=", + "dependencies": [ + "const", + "either", + "newtype", + "prelude", + "tuples" + ] + }, + "catenable-lists": { + "type": "registry", + "version": "7.0.0", + "integrity": "sha256-76vYENhwF4BWTBsjeLuErCH2jqVT4M3R1HX+4RwSftA=", + "dependencies": [ + "control", + "foldable-traversable", + "lists", + "maybe", + "prelude", + "tuples", + "unfoldable" + ] + }, + "console": { + "type": "registry", + "version": "6.1.0", + "integrity": "sha256-CxmAzjgyuGDmt9FZW51VhV6rBPwR6o0YeKUzA9rSzcM=", + "dependencies": [ + "effect", + "prelude" + ] + }, + "const": { + "type": "registry", + "version": "6.0.0", + "integrity": "sha256-tNrxDW8D8H4jdHE2HiPzpLy08zkzJMmGHdRqt5BQuTc=", + "dependencies": [ + "invariant", + "newtype", + "prelude" + ] + }, + "contravariant": { + "type": "registry", + "version": "6.0.0", + "integrity": "sha256-TP+ooAp3vvmdjfQsQJSichF5B4BPDHp3wAJoWchip6c=", + "dependencies": [ + "const", + "either", + "newtype", + "prelude", + "tuples" + ] + }, + "control": { + "type": "registry", + "version": "6.0.0", + "integrity": "sha256-sH7Pg9E96JCPF9PIA6oQ8+BjTyO/BH1ZuE/bOcyj4Jk=", + "dependencies": [ + "newtype", + "prelude" + ] + }, + "datetime": { + "type": "registry", + "version": "6.1.0", + "integrity": "sha256-g/5X5BBegQWLpI9IWD+sY6mcaYpzzlW5lz5NBzaMtyI=", + "dependencies": [ + "bifunctors", + "control", + "either", + "enums", + "foldable-traversable", + "functions", + "gen", + "integers", + "lists", + "maybe", + "newtype", + "numbers", + "ordered-collections", + "partial", + "prelude", + "tuples" + ] + }, + "distributive": { + "type": "registry", + "version": "6.0.0", + "integrity": "sha256-HTDdmEnzigMl+02SJB88j+gAXDx9VKsbvR4MJGDPbOQ=", + "dependencies": [ + "identity", + "newtype", + "prelude", + "tuples", + "type-equality" + ] + }, + "effect": { + "type": "registry", + "version": "4.0.0", + "integrity": "sha256-eBtZu+HZcMa5HilvI6kaDyVX3ji8p0W9MGKy2K4T6+M=", + "dependencies": [ + "prelude" + ] + }, + "either": { + "type": "registry", + "version": "6.1.0", + "integrity": "sha256-6hgTPisnMWVwQivOu2PKYcH8uqjEOOqDyaDQVUchTpY=", + "dependencies": [ + "control", + "invariant", + "maybe", + "prelude" + ] + }, + "encoding": { + "type": "registry", + "version": "0.0.8", + "integrity": "sha256-n0HhENAax0yr7JFwZXcisx0jJvVf1dFwqd+Q5i2Pr88=", + "dependencies": [ + "arraybuffer-types", + "either", + "exceptions", + "functions", + "prelude" + ] + }, + "enums": { + "type": "registry", + "version": "6.0.1", + "integrity": "sha256-HWaD73JFLorc4A6trKIRUeDMdzE+GpkJaEOM1nTNkC8=", + "dependencies": [ + "control", + "either", + "gen", + "maybe", + "newtype", + "nonempty", + "partial", + "prelude", + "tuples", + "unfoldable" + ] + }, + "exceptions": { + "type": "registry", + "version": "6.1.0", + "integrity": "sha256-K0T89IHtF3vBY7eSAO7eDOqSb2J9kZGAcDN5+IKsF8E=", + "dependencies": [ + "effect", + "either", + "maybe", + "prelude" + ] + }, + "exists": { + "type": "registry", + "version": "6.0.0", + "integrity": "sha256-A0JQHpTfo1dNOj9U5/Fd3xndlRSE0g2IQWOGor2yXn8=", + "dependencies": [ + "unsafe-coerce" + ] + }, + "exitcodes": { + "type": "registry", + "version": "4.0.0", + "integrity": "sha256-4wxViTbyOoyKJ/WaRGI6+hZmgMKI5Miv16lSwefiLSM=", + "dependencies": [ + "enums" + ] + }, + "filterable": { + "type": "registry", + "version": "5.0.0", + "integrity": "sha256-cCojJHRnTmpY1j1kegI4CFwghdQ2Fm/8dzM8IlC+lng=", + "dependencies": [ + "arrays", + "either", + "foldable-traversable", + "identity", + "lists", + "ordered-collections" + ] + }, + "foldable-traversable": { + "type": "registry", + "version": "6.0.0", + "integrity": "sha256-fLeqRYM4jUrZD5H4WqcwUgzU7XfYkzO4zhgtNc3jcWM=", + "dependencies": [ + "bifunctors", + "const", + "control", + "either", + "functors", + "identity", + "maybe", + "newtype", + "orders", + "prelude", + "tuples" + ] + }, + "foreign": { + "type": "registry", + "version": "7.0.0", + "integrity": "sha256-1ORiqoS3HW+qfwSZAppHPWy4/6AQysxZ2t29jcdUMNA=", + "dependencies": [ + "either", + "functions", + "identity", + "integers", + "lists", + "maybe", + "prelude", + "strings", + "transformers" + ] + }, + "foreign-object": { + "type": "registry", + "version": "4.1.0", + "integrity": "sha256-q24okj6mT+yGHYQ+ei/pYPj5ih6sTbu7eDv/WU56JVo=", + "dependencies": [ + "arrays", + "foldable-traversable", + "functions", + "gen", + "lists", + "maybe", + "prelude", + "st", + "tailrec", + "tuples", + "typelevel-prelude", + "unfoldable" + ] + }, + "fork": { + "type": "registry", + "version": "6.0.0", + "integrity": "sha256-X7u0SuCvFbLbzuNEKLBNuWjmcroqMqit4xEzpQwAP7E=", + "dependencies": [ + "aff" + ] + }, + "free": { + "type": "registry", + "version": "7.1.0", + "integrity": "sha256-JAumgEsGSzJCNLD8AaFvuX7CpqS5yruCngi6yI7+V5k=", + "dependencies": [ + "catenable-lists", + "control", + "distributive", + "either", + "exists", + "foldable-traversable", + "invariant", + "lazy", + "maybe", + "prelude", + "tailrec", + "transformers", + "tuples", + "unsafe-coerce" + ] + }, + "functions": { + "type": "registry", + "version": "6.0.0", + "integrity": "sha256-adMyJNEnhGde2unHHAP79gPtlNjNqzgLB8arEOn9hLI=", + "dependencies": [ + "prelude" + ] + }, + "functors": { + "type": "registry", + "version": "5.0.0", + "integrity": "sha256-zfPWWYisbD84MqwpJSZFlvM6v86McM68ob8p9s27ywU=", + "dependencies": [ + "bifunctors", + "const", + "contravariant", + "control", + "distributive", + "either", + "invariant", + "maybe", + "newtype", + "prelude", + "profunctor", + "tuples", + "unsafe-coerce" + ] + }, + "gen": { + "type": "registry", + "version": "4.0.0", + "integrity": "sha256-f7yzAXWwr+xnaqEOcvyO3ezKdoes8+WXWdXIHDBCAPI=", + "dependencies": [ + "either", + "foldable-traversable", + "identity", + "maybe", + "newtype", + "nonempty", + "prelude", + "tailrec", + "tuples", + "unfoldable" + ] + }, + "identity": { + "type": "registry", + "version": "6.0.0", + "integrity": "sha256-4wY0XZbAksjY6UAg99WkuKyJlQlWAfTi2ssadH0wVMY=", + "dependencies": [ + "control", + "invariant", + "newtype", + "prelude" + ] + }, + "integers": { + "type": "registry", + "version": "6.0.0", + "integrity": "sha256-sf+sK26R1hzwl3NhXR7WAu9zCDjQnfoXwcyGoseX158=", + "dependencies": [ + "maybe", + "numbers", + "prelude" + ] + }, + "invariant": { + "type": "registry", + "version": "6.0.0", + "integrity": "sha256-RGWWyYrz0Hs1KjPDA+87Kia67ZFBhfJ5lMGOMCEFoLo=", + "dependencies": [ + "control", + "prelude" + ] + }, + "js-date": { + "type": "registry", + "version": "8.0.0", + "integrity": "sha256-6TVF4DWg5JL+jRAsoMssYw8rgOVALMUHT1CuNZt8NRo=", + "dependencies": [ + "datetime", + "effect", + "exceptions", + "foreign", + "integers", + "now" + ] + }, + "js-promise": { + "type": "registry", + "version": "1.0.0", + "integrity": "sha256-kXNo5g9RJgPdrTuKRe5oG2kBIwPp+j5VDPDplqZBJzQ=", + "dependencies": [ + "effect", + "exceptions", + "foldable-traversable", + "functions", + "maybe", + "prelude" + ] + }, + "lazy": { + "type": "registry", + "version": "6.0.0", + "integrity": "sha256-lMsfFOnlqfe4KzRRiW8ot5ge6HtcU3Eyh2XkXcP5IgU=", + "dependencies": [ + "control", + "foldable-traversable", + "invariant", + "prelude" + ] + }, + "lists": { + "type": "registry", + "version": "7.0.0", + "integrity": "sha256-EKF15qYqucuXP2lT/xPxhqy58f0FFT6KHdIB/yBOayI=", + "dependencies": [ + "bifunctors", + "control", + "foldable-traversable", + "lazy", + "maybe", + "newtype", + "nonempty", + "partial", + "prelude", + "tailrec", + "tuples", + "unfoldable" + ] + }, + "maybe": { + "type": "registry", + "version": "6.0.0", + "integrity": "sha256-5cCIb0wPwbat2PRkQhUeZO0jcAmf8jCt2qE0wbC3v2Q=", + "dependencies": [ + "control", + "invariant", + "newtype", + "prelude" + ] + }, + "media-types": { + "type": "registry", + "version": "6.0.0", + "integrity": "sha256-n/4FoGBasbVSYscGVRSyBunQ6CZbL3jsYL+Lp01mc9k=", + "dependencies": [ + "newtype", + "prelude" + ] + }, + "mmorph": { + "type": "registry", + "version": "7.0.0", + "integrity": "sha256-urZlZNNqGeQFe5D/ClHlR8QgGBNHTMFPtJ5S5IpflTQ=", + "dependencies": [ + "free", + "functors", + "transformers" + ] + }, + "newtype": { + "type": "registry", + "version": "5.0.0", + "integrity": "sha256-gdrQu8oGe9eZE6L3wOI8ql/igOg+zEGB5ITh2g+uttw=", + "dependencies": [ + "prelude", + "safe-coerce" + ] + }, + "node-buffer": { + "type": "registry", + "version": "9.0.0", + "integrity": "sha256-PWE2DJ5ruBLCmeA/fUiuySEFmUJ/VuRfyrnCuVZBlu4=", + "dependencies": [ + "arraybuffer-types", + "effect", + "maybe", + "nullable", + "st", + "unsafe-coerce" + ] + }, + "node-event-emitter": { + "type": "registry", + "version": "3.0.0", + "integrity": "sha256-Qw0MjsT4xRH2j2i4K8JmRjcMKnH5z1Cw39t00q4LE4w=", + "dependencies": [ + "effect", + "either", + "functions", + "maybe", + "nullable", + "prelude", + "unsafe-coerce" + ] + }, + "node-fs": { + "type": "registry", + "version": "9.2.0", + "integrity": "sha256-Sg0vkXycEzkEerX6hLccz21Ygd9w1+QSk1thotRZPGI=", + "dependencies": [ + "datetime", + "effect", + "either", + "enums", + "exceptions", + "functions", + "integers", + "js-date", + "maybe", + "node-buffer", + "node-path", + "node-streams", + "nullable", + "partial", + "prelude", + "strings", + "unsafe-coerce" + ] + }, + "node-path": { + "type": "registry", + "version": "5.0.0", + "integrity": "sha256-pd82nQ+2l5UThzaxPdKttgDt7xlsgIDLpPG0yxDEdyE=", + "dependencies": [ + "effect" + ] + }, + "node-process": { + "type": "registry", + "version": "11.2.0", + "integrity": "sha256-+2MQDYChjGbVbapCyJtuWYwD41jk+BntF/kcOTKBMVs=", + "dependencies": [ + "effect", + "foreign", + "foreign-object", + "maybe", + "node-event-emitter", + "node-streams", + "posix-types", + "prelude", + "unsafe-coerce" + ] + }, + "node-streams": { + "type": "registry", + "version": "9.0.0", + "integrity": "sha256-2n6dq7YWleTDmD1Kur/ul7Cn08IvWrScgPf+0PgX2TQ=", + "dependencies": [ + "aff", + "effect", + "either", + "exceptions", + "node-buffer", + "node-event-emitter", + "nullable", + "prelude" + ] + }, + "nonempty": { + "type": "registry", + "version": "7.0.0", + "integrity": "sha256-54ablJZUHGvvlTJzi3oXyPCuvY6zsrWJuH/dMJ/MFLs=", + "dependencies": [ + "control", + "foldable-traversable", + "maybe", + "prelude", + "tuples", + "unfoldable" + ] + }, + "now": { + "type": "registry", + "version": "6.0.0", + "integrity": "sha256-xZ7x37ZMREfs6GCDw/h+FaKHV/3sPWmtqBZRGTxybQY=", + "dependencies": [ + "datetime", + "effect" + ] + }, + "nullable": { + "type": "registry", + "version": "6.0.0", + "integrity": "sha256-yiGBVl3AD+Guy4kNWWeN+zl1gCiJK+oeIFtZtPCw4+o=", + "dependencies": [ + "effect", + "functions", + "maybe" + ] + }, + "numbers": { + "type": "registry", + "version": "9.0.1", + "integrity": "sha256-/9M6aeMDBdB4cwYDeJvLFprAHZ49EbtKQLIJsneXLIk=", + "dependencies": [ + "functions", + "maybe" + ] + }, + "open-memoize": { + "type": "registry", + "version": "6.2.0", + "integrity": "sha256-p1m7wF3aHQ80yUvqMs20OTMl496WS6YpKlmI2Nkg9j0=", + "dependencies": [ + "either", + "integers", + "lazy", + "lists", + "maybe", + "partial", + "prelude", + "strings", + "tuples" + ] + }, + "optparse": { + "type": "registry", + "version": "5.0.1", + "integrity": "sha256-cEzEkNW4q0gZlXl4z0zn+H2vs6l2UAp7NPHCsois73k=", + "dependencies": [ + "aff", + "arrays", + "bifunctors", + "console", + "control", + "effect", + "either", + "enums", + "exists", + "exitcodes", + "foldable-traversable", + "free", + "gen", + "integers", + "lazy", + "lists", + "maybe", + "newtype", + "node-buffer", + "node-process", + "node-streams", + "nonempty", + "numbers", + "open-memoize", + "partial", + "prelude", + "strings", + "tailrec", + "transformers", + "tuples" + ] + }, + "ordered-collections": { + "type": "registry", + "version": "3.2.0", + "integrity": "sha256-o9jqsj5rpJmMdoe/zyufWHFjYYFTTsJpgcuCnqCO6PM=", + "dependencies": [ + "arrays", + "foldable-traversable", + "gen", + "lists", + "maybe", + "partial", + "prelude", + "st", + "tailrec", + "tuples", + "unfoldable" + ] + }, + "orders": { + "type": "registry", + "version": "6.0.0", + "integrity": "sha256-nBA0g3/ai0euH8q9pSbGqk53W2q6agm/dECZTHcoink=", + "dependencies": [ + "newtype", + "prelude" + ] + }, + "parallel": { + "type": "registry", + "version": "6.0.0", + "integrity": "sha256-VJbkGD0rAKX+NUEeBJbYJ78bEKaZbgow+QwQEfPB6ko=", + "dependencies": [ + "control", + "effect", + "either", + "foldable-traversable", + "functors", + "maybe", + "newtype", + "prelude", + "profunctor", + "refs", + "transformers" + ] + }, + "partial": { + "type": "registry", + "version": "4.0.0", + "integrity": "sha256-fwXerld6Xw1VkReh8yeQsdtLVrjfGiVuC5bA1Wyo/J4=", + "dependencies": [] + }, + "pipes": { + "type": "registry", + "version": "8.0.0", + "integrity": "sha256-kvfqGM4cPA/wCcBHbp5psouFw5dZGvku2462x7ZBwSY=", + "dependencies": [ + "aff", + "lists", + "mmorph", + "prelude", + "tailrec", + "transformers", + "tuples" + ] + }, + "posix-types": { + "type": "registry", + "version": "6.0.0", + "integrity": "sha256-ZfFz8RR1lee/o/Prccyeut3Q+9tYd08mlR72sIh6GzA=", + "dependencies": [ + "maybe", + "prelude" + ] + }, + "prelude": { + "type": "registry", + "version": "6.0.1", + "integrity": "sha256-o8p6SLYmVPqzXZhQFd2hGAWEwBoXl1swxLG/scpJ0V0=", + "dependencies": [] + }, + "profunctor": { + "type": "registry", + "version": "6.0.1", + "integrity": "sha256-E58hSYdJvF2Qjf9dnWLPlJKh2Z2fLfFLkQoYi16vsFk=", + "dependencies": [ + "control", + "distributive", + "either", + "exists", + "invariant", + "newtype", + "prelude", + "tuples" + ] + }, + "record": { + "type": "registry", + "version": "4.0.0", + "integrity": "sha256-Za5U85bTRJEfGK5Sk4hM41oXy84YQI0I8TL3WUn1Qzg=", + "dependencies": [ + "functions", + "prelude", + "unsafe-coerce" + ] + }, + "refs": { + "type": "registry", + "version": "6.0.0", + "integrity": "sha256-Vgwne7jIbD3ZMoLNNETLT8Litw6lIYo3MfYNdtYWj9s=", + "dependencies": [ + "effect", + "prelude" + ] + }, + "safe-coerce": { + "type": "registry", + "version": "2.0.0", + "integrity": "sha256-a1ibQkiUcbODbLE/WAq7Ttbbh9ex+x33VCQ7GngKudU=", + "dependencies": [ + "unsafe-coerce" + ] + }, + "simple-json": { + "type": "registry", + "version": "9.0.0", + "integrity": "sha256-K3RJaThqsszTd+TEklzZmAdDqvIHWgXIfKqlsoykU1c=", + "dependencies": [ + "arrays", + "exceptions", + "foreign", + "foreign-object", + "nullable", + "prelude", + "record", + "typelevel-prelude", + "variant" + ] + }, + "spec": { + "type": "registry", + "version": "8.1.1", + "integrity": "sha256-EM7UfQIaSgiw13LJ4ZASkfYmmRDKIlec3nYbGKFqGhk=", + "dependencies": [ + "aff", + "ansi", + "arrays", + "avar", + "bifunctors", + "control", + "datetime", + "effect", + "either", + "exceptions", + "foldable-traversable", + "fork", + "identity", + "integers", + "lists", + "maybe", + "newtype", + "now", + "ordered-collections", + "parallel", + "pipes", + "prelude", + "refs", + "strings", + "tailrec", + "transformers", + "tuples" + ] + }, + "spec-node": { + "type": "registry", + "version": "0.0.3", + "integrity": "sha256-Bjzg6l4uOfMN/FV0SKuT1Mm8eMP9sloLGVcY/0MeMnI=", + "dependencies": [ + "aff", + "argonaut-codecs", + "argonaut-core", + "arrays", + "control", + "datetime", + "effect", + "either", + "foldable-traversable", + "identity", + "integers", + "maybe", + "newtype", + "node-buffer", + "node-fs", + "node-process", + "now", + "numbers", + "optparse", + "ordered-collections", + "partial", + "prelude", + "spec", + "strings", + "tuples" + ] + }, + "st": { + "type": "registry", + "version": "6.2.0", + "integrity": "sha256-z9X0WsOUlPwNx9GlCC+YccCyz8MejC8Wb0C4+9fiBRY=", + "dependencies": [ + "partial", + "prelude", + "tailrec", + "unsafe-coerce" + ] + }, + "strings": { + "type": "registry", + "version": "6.0.1", + "integrity": "sha256-WssD3DbX4OPzxSdjvRMX0yvc9+pS7n5gyPv5I2Trb7k=", + "dependencies": [ + "arrays", + "control", + "either", + "enums", + "foldable-traversable", + "gen", + "integers", + "maybe", + "newtype", + "nonempty", + "partial", + "prelude", + "tailrec", + "tuples", + "unfoldable", + "unsafe-coerce" + ] + }, + "stringutils": { + "type": "registry", + "version": "0.0.12", + "integrity": "sha256-t63QWBlp49U0nRqUcFryKflSJsNKGTQAHKjn24/+ooI=", + "dependencies": [ + "arrays", + "integers", + "maybe", + "partial", + "prelude", + "strings" + ] + }, + "tailrec": { + "type": "registry", + "version": "6.1.0", + "integrity": "sha256-Xx19ECVDRrDWpz9D2GxQHHV89vd61dnXxQm0IcYQHGk=", + "dependencies": [ + "bifunctors", + "effect", + "either", + "identity", + "maybe", + "partial", + "prelude", + "refs" + ] + }, + "transformers": { + "type": "registry", + "version": "6.1.0", + "integrity": "sha256-3Bm+Z6tsC/paG888XkywDngJ2JMos+JfOhRlkVfb7gI=", + "dependencies": [ + "control", + "distributive", + "effect", + "either", + "exceptions", + "foldable-traversable", + "identity", + "lazy", + "maybe", + "newtype", + "prelude", + "st", + "tailrec", + "tuples", + "unfoldable" + ] + }, + "tuples": { + "type": "registry", + "version": "7.0.0", + "integrity": "sha256-1rXgTomes9105BjgXqIw0FL6Fz1lqqUTLWOumhWec1M=", + "dependencies": [ + "control", + "invariant", + "prelude" + ] + }, + "type-equality": { + "type": "registry", + "version": "4.0.1", + "integrity": "sha256-Hs9D6Y71zFi/b+qu5NSbuadUQXe5iv5iWx0226vOHUw=", + "dependencies": [] + }, + "typelevel-prelude": { + "type": "registry", + "version": "7.0.0", + "integrity": "sha256-uFF2ph+vHcQpfPuPf2a3ukJDFmLhApmkpTMviHIWgJM=", + "dependencies": [ + "prelude", + "type-equality" + ] + }, + "unfoldable": { + "type": "registry", + "version": "6.0.0", + "integrity": "sha256-JtikvJdktRap7vr/K4ITlxUX1QexpnqBq0G/InLr6eg=", + "dependencies": [ + "foldable-traversable", + "maybe", + "partial", + "prelude", + "tuples" + ] + }, + "unsafe-coerce": { + "type": "registry", + "version": "6.0.0", + "integrity": "sha256-IqIYW4Vkevn8sI+6aUwRGvd87tVL36BBeOr0cGAE7t0=", + "dependencies": [] + }, + "url-immutable": { + "type": "registry", + "version": "1.0.0", + "integrity": "sha256-6uCg5k4fjrqyTYUYKTmcykXgXCJKsvVpzx+gZJczAx0=", + "dependencies": [ + "arrays", + "bifunctors", + "either", + "filterable", + "foldable-traversable", + "foreign", + "integers", + "maybe", + "newtype", + "nullable", + "ordered-collections", + "partial", + "prelude", + "simple-json", + "strings", + "stringutils", + "transformers", + "tuples" + ] + }, + "variant": { + "type": "registry", + "version": "8.0.0", + "integrity": "sha256-SR//zQDg2dnbB8ZHslcxieUkCeNlbMToapvmh9onTtw=", + "dependencies": [ + "enums", + "lists", + "maybe", + "partial", + "prelude", + "record", + "tuples", + "unsafe-coerce" + ] + }, + "web-dom": { + "type": "registry", + "version": "6.0.0", + "integrity": "sha256-1kSKWFDI4LupdmpjK01b1MMxDFW7jvatEgPgVmCmSBQ=", + "dependencies": [ + "web-events" + ] + }, + "web-events": { + "type": "registry", + "version": "4.0.0", + "integrity": "sha256-YDt8b6u1tzGtnWyNRodne57iO8FNSGPaTCVzBUyUn4k=", + "dependencies": [ + "datetime", + "enums", + "foreign", + "nullable" + ] + }, + "web-file": { + "type": "registry", + "version": "4.0.0", + "integrity": "sha256-1h5jPBkvjY71jLEdwVadXCx86/2inNoMBO//Rd3eCSU=", + "dependencies": [ + "foreign", + "media-types", + "web-dom" + ] + }, + "web-streams": { + "type": "registry", + "version": "4.0.0", + "integrity": "sha256-02HgXIk6R+pU9fWOX42krukAI1QkCbLKcCv3b4Jq6WI=", + "dependencies": [ + "arraybuffer-types", + "effect", + "exceptions", + "js-promise", + "nullable", + "prelude", + "tuples" + ] + } + } +} diff --git a/spago.yaml b/spago.yaml index 688ebba..a270e68 100644 --- a/spago.yaml +++ b/spago.yaml @@ -10,6 +10,11 @@ package: location: githubOwner: 'cakekindel' githubRepo: 'purescript-ezfetch' + test: + main: 'Test.Main' + dependencies: + - spec + - spec-node dependencies: - aff: ">=7.1.0 <8.0.0" - aff-promise: ">=4.0.0 <5.0.0" diff --git a/src/Effect.Aff.HTTP/Form.js b/src/Effect.Aff.HTTP/Form.js index 93220d6..7e4aed4 100644 --- a/src/Effect.Aff.HTTP/Form.js +++ b/src/Effect.Aff.HTTP/Form.js @@ -1,4 +1,4 @@ -/** @type {(_: Record>) => () => FormData} */ +/** @type {(_: Record>) => () => FormData} */ export const unsafeMakeFormData = o => () => { const form = new FormData() @@ -11,20 +11,20 @@ export const unsafeMakeFormData = o => () => { return form } -/** @typedef {{filename: string | null, mime: string, buf: ArrayBuffer}} FileRecord */ +/** @typedef {{filename: string, mime: string, buf: ArrayBuffer}} FileRecord */ -/** @type {(_: FileRecord) => () => Blob} */ -export const unsafeMakeBlob = - ({ mime, buf }) => +/** @type {(_: FileRecord) => () => File} */ +export const unsafeMakeFile = + ({ mime, buf, filename }) => () => - new Blob([buf], { type: mime }) + new File([buf], filename, { type: mime }) /** @type {(_: FormData) => () => Promise>>} */ export const unsafeUnmakeFormData = fd => async () => { /** @type {Record>} */ const rec = {} for (const [k, ent_] of fd.entries()) { - /** @type {File | Blob | string} */ + /** @type {File | string} */ const ent = ent_ /** @type {string | FileRecord} */ @@ -35,8 +35,6 @@ export const unsafeUnmakeFormData = fd => async () => { buf: await ent.arrayBuffer(), mime: ent.type, } - } else if (ent instanceof Blob) { - append = { filename: null, buf: await ent.arrayBuffer(), mime: ent.type } } else { append = ent } @@ -54,3 +52,29 @@ export const unsafeUnmakeFormData = fd => async () => { return rec } + +/** @type {(a: ArrayBuffer) => (b: ArrayBuffer) => boolean} */ +export const unsafeEqArrayBuffer = a => b => { + try { + if (a.byteLength !== b.byteLength) return false + const ua = new Uint8Array(a) + const ub = new Uint8Array(b) + let pass = true + for (let i = 0; i < a.byteLength; i++) { + pass = pass && ua[i] === ub[i] + } + + return pass + } catch { + return false + } +} + +/** @type {(a: ArrayBuffer) => string} */ +export const unsafeShowArrayBuffer = a => { + try { + return Buffer.from(a).toString('base64url') + } catch (e) { + return e instanceof Error ? e.toString() : '' + } +} diff --git a/src/Effect.Aff.HTTP/Form.purs b/src/Effect.Aff.HTTP/Form.purs index 8f2f8e7..a751187 100644 --- a/src/Effect.Aff.HTTP/Form.purs +++ b/src/Effect.Aff.HTTP/Form.purs @@ -10,12 +10,12 @@ import Data.ArrayBuffer.Types (ArrayBuffer) import Data.Either (hush) import Data.FoldableWithIndex (foldlWithIndex) import Data.Generic.Rep (class Generic) +import Data.MIME (MIME) +import Data.MIME as MIME import Data.Map (Map) import Data.Map as Map import Data.Maybe (Maybe(..)) import Data.Newtype (class Newtype, unwrap, wrap) -import Data.Nullable (Nullable) -import Data.Nullable as Nullable import Data.Show.Generic (genericShow) import Data.Traversable (for) import Effect (Effect) @@ -25,16 +25,16 @@ import Effect.Exception (error) import Foreign (Foreign, unsafeReadTagged, unsafeToForeign) import Foreign.Object (Object) import Foreign.Object as Object -import Data.MIME (MIME) -import Data.MIME as MIME import Simple.JSON (readImpl, unsafeStringify) import Unsafe.Coerce (unsafeCoerce) -import Web.File.Blob (Blob) +import Web.File.File (File) -type FileRecord = { filename :: Nullable String, mime :: String, buf :: ArrayBuffer } +type FileRecord = { filename :: String, mime :: String, buf :: ArrayBuffer } foreign import data RawFormData :: Type -foreign import unsafeMakeBlob :: FileRecord -> Effect Blob +foreign import unsafeShowArrayBuffer :: ArrayBuffer -> String +foreign import unsafeEqArrayBuffer :: ArrayBuffer -> ArrayBuffer -> Boolean +foreign import unsafeMakeFile :: FileRecord -> Effect File foreign import unsafeMakeFormData :: Object (Array Foreign) -> Effect RawFormData foreign import unsafeUnmakeFormData :: RawFormData -> Effect (Promise (Object (Array Foreign))) @@ -50,16 +50,16 @@ derive newtype instance Ord Filename data Value = ValueString String - | ValueFile (Maybe Filename) ArrayBuffer MIME + | ValueFile Filename ArrayBuffer MIME valueForeign :: Value -> Effect Foreign valueForeign (ValueString s) = pure $ unsafeToForeign s -valueForeign (ValueFile filename buf mime) = unsafeToForeign <$> unsafeMakeBlob { filename: Nullable.toNullable $ unwrap <$> filename, buf, mime: MIME.toString mime } +valueForeign (ValueFile filename buf mime) = unsafeToForeign <$> unsafeMakeFile { filename: unwrap filename, buf, mime: MIME.toString mime } valueFromForeign :: Foreign -> Effect Value valueFromForeign f = do let - file :: Maybe { filename :: Nullable String, buf :: Foreign, mime :: String } + file :: Maybe { filename :: String, buf :: Foreign, mime :: String } file = hush $ runExcept $ readImpl f string = hush $ runExcept $ unsafeReadTagged "String" f @@ -69,7 +69,7 @@ valueFromForeign f = do buf' :: ArrayBuffer buf' = unsafeCoerce buf in - pure $ ValueFile (wrap <$> Nullable.toMaybe filename) buf' (MIME.fromString mime) + pure $ ValueFile (wrap filename) buf' (MIME.fromString mime) Nothing -> do s <- liftMaybe (error $ "invalid form value " <> unsafeStringify f) string pure $ ValueString s @@ -77,12 +77,21 @@ valueFromForeign f = do derive instance Generic Value _ instance Show Value where show (ValueString s) = "(ValueString " <> show s <> ")" - show (ValueFile filename _ mime) = "(ValueFile (" <> show filename <> ") (" <> show mime <> "))" + show (ValueFile filename buf mime) = "(ValueFile (" <> show filename <> ") (ArrayBuffer " <> unsafeShowArrayBuffer buf <> ") (" <> show mime <> "))" + +instance Eq Value where + eq (ValueString a) (ValueString b) = a == b + eq (ValueFile namea bufa mimea) (ValueFile nameb bufb mimeb) + | namea /= nameb = false + | mimea /= mimeb = false + | otherwise = unsafeEqArrayBuffer bufa bufb + eq _ _ = false newtype Form = Form (Map String (Array Value)) derive instance Newtype Form _ derive newtype instance Show Form +derive newtype instance Eq Form fromRaw :: forall m. MonadAff m => RawFormData -> m Form fromRaw f = do @@ -101,3 +110,4 @@ toRawFormData = pure $ Object.insert k vs' o' in liftEffect <<< flip bind unsafeMakeFormData <<< foldlWithIndex collect (pure Object.empty) <<< unwrap + diff --git a/test/Test.Effect.Aff.HTTP.Form.js b/test/Test.Effect.Aff.HTTP.Form.js new file mode 100644 index 0000000..889e8c2 --- /dev/null +++ b/test/Test.Effect.Aff.HTTP.Form.js @@ -0,0 +1,7 @@ +export const dummyForm = () => { + const form = new FormData() + form.set('foo', 'bar') + const hi = Buffer.from('hello, world!', 'utf8') + form.set('baz', new Blob([hi.buffer.slice(hi.byteOffset, hi.byteOffset + hi.byteLength)], {type: 'text/plain'}), 'foo.txt') + return form +} diff --git a/test/Test.Effect.Aff.HTTP.Form.purs b/test/Test.Effect.Aff.HTTP.Form.purs new file mode 100644 index 0000000..ce4632b --- /dev/null +++ b/test/Test.Effect.Aff.HTTP.Form.purs @@ -0,0 +1,32 @@ +module Test.Effect.Aff.HTTP.Form where + +import Prelude + +import Data.MIME as MIME +import Data.Map as Map +import Data.Tuple.Nested ((/\)) +import Effect (Effect) +import Effect.Aff.HTTP.Form (Form(..), RawFormData) +import Effect.Aff.HTTP.Form as Form +import Effect.Class (liftEffect) +import Node.Buffer as Buffer +import Node.Encoding (Encoding(..)) +import Test.Spec (Spec, describe, it) +import Test.Spec.Assertions (shouldEqual) + +foreign import dummyForm :: Effect RawFormData + +spec :: Spec Unit +spec = describe "Form" do + it "fromRaw" do + dummy <- liftEffect dummyForm + f <- Form.fromRaw dummy + buf <- Buffer.fromString "hello, world!" UTF8 >>= Buffer.toArrayBuffer # liftEffect + f `shouldEqual` Form (Map.fromFoldable [ "foo" /\ [ Form.ValueString "bar" ], "baz" /\ [ Form.ValueFile (Form.Filename "foo.txt") buf MIME.Txt ] ]) + it "toRaw" do + expect <- liftEffect dummyForm >>= Form.fromRaw + buf <- Buffer.fromString "hello, world!" UTF8 >>= Buffer.toArrayBuffer # liftEffect + let + f = Form (Map.fromFoldable [ "foo" /\ [ Form.ValueString "bar" ], "baz" /\ [ Form.ValueFile (Form.Filename "foo.txt") buf MIME.Txt ] ]) + actual <- Form.toRawFormData f >>= Form.fromRaw + expect `shouldEqual` actual diff --git a/test/Test.Main.purs b/test/Test.Main.purs new file mode 100644 index 0000000..6c6fd53 --- /dev/null +++ b/test/Test.Main.purs @@ -0,0 +1,12 @@ +module Test.Main where + +import Prelude + +import Effect (Effect) +import Test.Spec.Reporter (specReporter) +import Test.Spec.Runner.Node (runSpecAndExitProcess) +import Test.Effect.Aff.HTTP.Form as Test.Form + +main :: Effect Unit +main = runSpecAndExitProcess [ specReporter ] do + Test.Form.spec