diff --git a/package-lock.json b/package-lock.json index e96feaf..5c7aedb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,8 +5,8 @@ "packages": { "": { "dependencies": { - "@effect/platform": "^0.57.4", - "@effect/platform-node": "^0.51.13", + "@effect/platform": "^0.58.19", + "@effect/platform-node": "^0.53.18", "@effect/schema": "^0.68.1", "@js-temporal/polyfill": "^0.4.4", "@observablehq/framework": "^1.9.0", @@ -339,7 +339,6 @@ }, "node_modules/@clack/prompts/node_modules/is-unicode-supported": { "version": "1.3.0", - "extraneous": true, "inBundle": true, "license": "MIT", "engines": { @@ -580,45 +579,45 @@ } }, "node_modules/@effect/platform": { - "version": "0.57.4", - "resolved": "https://registry.npmjs.org/@effect/platform/-/platform-0.57.4.tgz", - "integrity": "sha512-2ulqg18wJx0pBbVph/PNcFWas85gzPZACNCDvT6Ysl/sWbdmXaOqeHS7ytIlYYRRMGenagv7XOR7UFOAf4xOig==", + "version": "0.58.19", + "resolved": "https://registry.npmjs.org/@effect/platform/-/platform-0.58.19.tgz", + "integrity": "sha512-Yb+Xd2X6/TiN2l5Ipc1m3hP8NcDt3BXby7vtn0lwN06CYZlwwMCGYNEhJKXU8wWRh+HZkFt3awxWF8FDXA8YRA==", "dependencies": { - "find-my-way-ts": "^0.1.2", - "multipasta": "^0.2.1", + "find-my-way-ts": "^0.1.4", + "multipasta": "^0.2.2", "path-browserify": "^1.0.1" }, "peerDependencies": { - "@effect/schema": "^0.68.1", - "effect": "^3.3.5" + "@effect/schema": "^0.68.16", + "effect": "^3.4.6" } }, "node_modules/@effect/platform-node": { - "version": "0.51.13", - "resolved": "https://registry.npmjs.org/@effect/platform-node/-/platform-node-0.51.13.tgz", - "integrity": "sha512-egcxOzmgwTEy+2DTvZ7SaVUKdQXVZrf7rTQFkPi0P6ummzGobW5gIMTHsDhEDrWdglNcS1QDGjFYrUbPTRLb7w==", + "version": "0.53.18", + "resolved": "https://registry.npmjs.org/@effect/platform-node/-/platform-node-0.53.18.tgz", + "integrity": "sha512-BkvcZcLKgP3BZX1QuaZpHHF6ffslSycs8qC2MepOouY2fcnm03h2AynPq2uJojlA9hSJ+2UEwsO8ZyrNUHzzbg==", "dependencies": { - "@effect/platform-node-shared": "^0.6.13", + "@effect/platform-node-shared": "^0.8.18", "mime": "^3.0.0", - "undici": "^6.18.0", - "ws": "^8.17.0" + "undici": "^6.19.2", + "ws": "^8.17.1" }, "peerDependencies": { - "@effect/platform": "^0.57.4", - "effect": "^3.3.5" + "@effect/platform": "^0.58.19", + "effect": "^3.4.6" } }, "node_modules/@effect/platform-node-shared": { - "version": "0.6.13", - "resolved": "https://registry.npmjs.org/@effect/platform-node-shared/-/platform-node-shared-0.6.13.tgz", - "integrity": "sha512-dfpWAuMUwOPYx222hiT0sTpPFhx4eK4/UmV0l+7fbtg7lZsJzProhUgTF2awKNm0KRMFh3YMWWr3o0ruRtdrLA==", + "version": "0.8.18", + "resolved": "https://registry.npmjs.org/@effect/platform-node-shared/-/platform-node-shared-0.8.18.tgz", + "integrity": "sha512-AWZSAiur3KszSDG4ZOI7TLCCAlas5tXw/Po7XBRCar9un9tKV/w/Wg3NA9PJbJyjIhgD0/Qd7OJYcP12P7H/Hg==", "dependencies": { "@parcel/watcher": "^2.4.1", - "multipasta": "^0.2.1" + "multipasta": "^0.2.2" }, "peerDependencies": { - "@effect/platform": "^0.57.4", - "effect": "^3.3.5" + "@effect/platform": "^0.58.19", + "effect": "^3.4.6" } }, "node_modules/@effect/platform-node/node_modules/mime": { @@ -633,14 +632,14 @@ } }, "node_modules/@effect/schema": { - "version": "0.68.1", - "resolved": "https://registry.npmjs.org/@effect/schema/-/schema-0.68.1.tgz", - "integrity": "sha512-wUxqHyNmwsjjUgborcBcOHAv5k1BFq9S43NGMcvDeAQOBB2ad5+bLbWxl0zAFj7Hq3V2laTj45UD9L5YQGmg/w==", + "version": "0.68.16", + "resolved": "https://registry.npmjs.org/@effect/schema/-/schema-0.68.16.tgz", + "integrity": "sha512-IvvGbl/bb6aIFRe7809M7bAHDodxJN0FcOItbjp/xrZ5GlcfShABCC25R5lIYD2HlUbtVwOEiCdiCay39ezhLA==", "dependencies": { - "fast-check": "^3.17.2" + "fast-check": "^3.19.0" }, "peerDependencies": { - "effect": "^3.3.5" + "effect": "^3.4.6" } }, "node_modules/@esbuild/aix-ppc64": { @@ -3301,9 +3300,9 @@ "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" }, "node_modules/effect": { - "version": "3.3.5", - "resolved": "https://registry.npmjs.org/effect/-/effect-3.3.5.tgz", - "integrity": "sha512-ehDpb+3zRTYsCqDWY32rT4oxtG0BJ797+HSog+FPjiWKjNxnPgpslUIQha8CoxqFZln2ZeBRv00tzGIhUAQKsw==" + "version": "3.4.6", + "resolved": "https://registry.npmjs.org/effect/-/effect-3.4.6.tgz", + "integrity": "sha512-xmtAJVMBDPzuYWmOPHHYhT9OHUNvKTq9eMjvKKQQLdsNym+/Zarlh+39Y9bMSZ8c+yMrP8YCdLNl7B3cpzRrnA==" }, "node_modules/emoji-regex": { "version": "10.3.0", @@ -4196,9 +4195,9 @@ } }, "node_modules/find-my-way-ts": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/find-my-way-ts/-/find-my-way-ts-0.1.2.tgz", - "integrity": "sha512-AWsH49RGcyayzzxSAkwQKC1bToY5ForAfNreix88slo7wijg1wwTtCPvUUoVm/qhIY3UVSHBKApw8mOGPxsvSg==", + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/find-my-way-ts/-/find-my-way-ts-0.1.4.tgz", + "integrity": "sha512-naNl2YZ8m9LlYtPZathQBjXQQ8069uYBFq8We6w9AEGddJErVh0JZw8jd/C/2W9Ib3BjTnu+YN0/rR+ytWxNdw==", "dependencies": { "fast-querystring": "^1.0.0" } @@ -5618,9 +5617,9 @@ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, "node_modules/multipasta": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/multipasta/-/multipasta-0.2.1.tgz", - "integrity": "sha512-0NR15o5iewJFMsZ4jN6cztCd4izTLZPyHUfBrakbg/x70B8zplPE6qumbs+A7LmhGtQMzpN/K8MOOdifMgAKFA==" + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/multipasta/-/multipasta-0.2.2.tgz", + "integrity": "sha512-KKGdmXIJUmt9BV45LsbUdMnju8eCNSyF9KpbyqK2E3wQXjpPQOg52/Hc+nsmBacmEkNxLVT5h1y3ZgEXB4prXg==" }, "node_modules/mvdan-sh": { "version": "0.10.1", diff --git a/package.json b/package.json index 95d21a3..f56a4ba 100644 --- a/package.json +++ b/package.json @@ -2,8 +2,8 @@ "type": "module", "private": true, "dependencies": { - "@effect/platform": "^0.57.4", - "@effect/platform-node": "^0.51.13", + "@effect/platform": "^0.58.19", + "@effect/platform-node": "^0.53.18", "@effect/schema": "^0.68.1", "@js-temporal/polyfill": "^0.4.4", "@observablehq/framework": "^1.9.0", diff --git a/src/data/openalex-domains.json.ts b/src/data/openalex-domains.json.ts index 0f4f01a..46b89fe 100644 --- a/src/data/openalex-domains.json.ts +++ b/src/data/openalex-domains.json.ts @@ -1,4 +1,4 @@ -import { HttpClient, Terminal } from '@effect/platform' +import { HttpClient, HttpClientRequest, HttpClientResponse, Terminal } from '@effect/platform' import { NodeTerminal } from '@effect/platform-node' import { Schema } from '@effect/schema' import { Effect, Record } from 'effect' @@ -19,11 +19,12 @@ const DomainNames = Schema.Record(DomainIdSchema, Schema.String) const program = Effect.gen(function* () { const terminal = yield* Terminal.Terminal - const request = HttpClient.request.get('https://api.openalex.org/domains?per-page=200') + const request = HttpClientRequest.get('https://api.openalex.org/domains?per-page=200') - const data = yield* HttpClient.client - .fetchOk(request) - .pipe(Effect.andThen(HttpClient.response.schemaBodyJson(Domains)), Effect.scoped) + const data = yield* HttpClient.fetchOk(request).pipe( + Effect.andThen(HttpClientResponse.schemaBodyJson(Domains)), + Effect.scoped, + ) const transformedData = Record.fromIterableWith(data.results, domain => [domain.id, domain.display_name]) diff --git a/src/data/openalex-fields.json.ts b/src/data/openalex-fields.json.ts index c6330dd..0eb3743 100644 --- a/src/data/openalex-fields.json.ts +++ b/src/data/openalex-fields.json.ts @@ -1,4 +1,4 @@ -import { HttpClient, Terminal } from '@effect/platform' +import { HttpClient, HttpClientRequest, HttpClientResponse, Terminal } from '@effect/platform' import { NodeTerminal } from '@effect/platform-node' import { Schema } from '@effect/schema' import { Effect, Record } from 'effect' @@ -22,11 +22,12 @@ const FieldNames = Schema.Record(FieldIdSchema, Schema.Struct({ name: Schema.Str const program = Effect.gen(function* () { const terminal = yield* Terminal.Terminal - const request = HttpClient.request.get('https://api.openalex.org/fields?per-page=200') + const request = HttpClientRequest.get('https://api.openalex.org/fields?per-page=200') - const data = yield* HttpClient.client - .fetchOk(request) - .pipe(Effect.andThen(HttpClient.response.schemaBodyJson(Fields)), Effect.scoped) + const data = yield* HttpClient.fetchOk(request).pipe( + Effect.andThen(HttpClientResponse.schemaBodyJson(Fields)), + Effect.scoped, + ) const transformedData = Record.fromIterableWith(data.results, field => [ field.id, diff --git a/src/data/openalex-subfields.json.ts b/src/data/openalex-subfields.json.ts index 3d037f0..fe2839c 100644 --- a/src/data/openalex-subfields.json.ts +++ b/src/data/openalex-subfields.json.ts @@ -1,4 +1,4 @@ -import { HttpClient, Terminal } from '@effect/platform' +import { HttpClient, HttpClientRequest, HttpClientResponse, Terminal } from '@effect/platform' import { NodeTerminal } from '@effect/platform-node' import { Schema } from '@effect/schema' import { Effect, Record } from 'effect' @@ -22,17 +22,19 @@ const SubfieldNames = Schema.Record(SubfieldIdSchema, Schema.Struct({ name: Sche const program = Effect.gen(function* () { const terminal = yield* Terminal.Terminal - const request1 = HttpClient.request.get('https://api.openalex.org/subfields?per-page=200') + const request1 = HttpClientRequest.get('https://api.openalex.org/subfields?per-page=200') - const data = yield* HttpClient.client - .fetchOk(request1) - .pipe(Effect.andThen(HttpClient.response.schemaBodyJson(Subfields)), Effect.scoped) + const data = yield* HttpClient.fetchOk(request1).pipe( + Effect.andThen(HttpClientResponse.schemaBodyJson(Subfields)), + Effect.scoped, + ) - const request2 = HttpClient.request.get('https://api.openalex.org/subfields?per-page=200&page=2') + const request2 = HttpClientRequest.get('https://api.openalex.org/subfields?per-page=200&page=2') - const data2 = yield* HttpClient.client - .fetchOk(request2) - .pipe(Effect.andThen(HttpClient.response.schemaBodyJson(Subfields)), Effect.scoped) + const data2 = yield* HttpClient.fetchOk(request2).pipe( + Effect.andThen(HttpClientResponse.schemaBodyJson(Subfields)), + Effect.scoped, + ) const transformedData = Record.fromIterableWith([...data.results, ...data2.results], subfield => [ subfield.id, diff --git a/src/data/requests.json.ts b/src/data/requests.json.ts index f96237c..2b605b0 100644 --- a/src/data/requests.json.ts +++ b/src/data/requests.json.ts @@ -1,4 +1,4 @@ -import { HttpClient, Terminal } from '@effect/platform' +import { HttpClient, HttpClientRequest, HttpClientResponse, Terminal } from '@effect/platform' import { NodeTerminal } from '@effect/platform-node' import { Schema } from '@effect/schema' import { Effect } from 'effect' @@ -23,11 +23,12 @@ const Requests = Schema.Array( const program = Effect.gen(function* () { const terminal = yield* Terminal.Terminal - const request = HttpClient.request.get('https://coar-notify.prereview.org/requests') + const request = HttpClientRequest.get('https://coar-notify.prereview.org/requests') - const data = yield* HttpClient.client - .fetchOk(request) - .pipe(Effect.andThen(HttpClient.response.schemaBodyJson(Requests)), Effect.scoped) + const data = yield* HttpClient.fetchOk(request).pipe( + Effect.andThen(HttpClientResponse.schemaBodyJson(Requests)), + Effect.scoped, + ) const encoded = yield* Schema.encode(Schema.parseJson(Requests))(data) diff --git a/src/data/reviews.json.ts b/src/data/reviews.json.ts index 817d096..3cf5be2 100644 --- a/src/data/reviews.json.ts +++ b/src/data/reviews.json.ts @@ -1,4 +1,4 @@ -import { HttpClient, Terminal } from '@effect/platform' +import { HttpClient, HttpClientRequest, HttpClientResponse, Terminal } from '@effect/platform' import { NodeTerminal } from '@effect/platform-node' import { Schema } from '@effect/schema' import { Config, Effect, Redacted } from 'effect' @@ -20,14 +20,15 @@ const program = Effect.gen(function* () { const terminal = yield* Terminal.Terminal const token = yield* Config.redacted('PREREVIEW_REVIEWS_DATA_TOKEN') - const request = HttpClient.request.bearerToken( - HttpClient.request.get('https://prereview.org/reviews-data'), + const request = HttpClientRequest.bearerToken( + HttpClientRequest.get('https://prereview.org/reviews-data'), Redacted.value(token), ) - const data = yield* HttpClient.client - .fetchOk(request) - .pipe(Effect.andThen(HttpClient.response.schemaBodyJson(Reviews)), Effect.scoped) + const data = yield* HttpClient.fetchOk(request).pipe( + Effect.andThen(HttpClientResponse.schemaBodyJson(Reviews)), + Effect.scoped, + ) const encoded = yield* Schema.encode(Schema.parseJson(Reviews))(data)