Skip to content

Commit

Permalink
Bump the effect group across 1 directory with 4 updates (#30)
Browse files Browse the repository at this point in the history
* Bump the effect group across 1 directory with 4 updates

Bumps the effect group with 2 updates in the / directory: [@effect/platform](https://github.com/Effect-TS/effect/tree/HEAD/packages/platform) and [@effect/platform-node](https://github.com/Effect-TS/effect/tree/HEAD/packages/platform-node).


Updates `@effect/platform` from 0.57.4 to 0.58.19
- [Release notes](https://github.com/Effect-TS/effect/releases)
- [Changelog](https://github.com/Effect-TS/effect/blob/main/packages/platform/CHANGELOG.md)
- [Commits](https://github.com/Effect-TS/effect/commits/@effect/[email protected]/packages/platform)

Updates `@effect/platform-node` from 0.51.13 to 0.53.18
- [Release notes](https://github.com/Effect-TS/effect/releases)
- [Changelog](https://github.com/Effect-TS/effect/blob/main/packages/platform-node/CHANGELOG.md)
- [Commits](https://github.com/Effect-TS/effect/commits/@effect/[email protected]/packages/platform-node)

Updates `@effect/schema` from 0.68.1 to 0.68.16
- [Release notes](https://github.com/Effect-TS/effect/releases)
- [Changelog](https://github.com/Effect-TS/effect/blob/main/packages/schema/CHANGELOG.md)
- [Commits](https://github.com/Effect-TS/effect/commits/@effect/[email protected]/packages/schema)

Updates `effect` from 3.3.5 to 3.4.6
- [Release notes](https://github.com/Effect-TS/effect/releases)
- [Changelog](https://github.com/Effect-TS/effect/blob/main/packages/effect/CHANGELOG.md)
- [Commits](https://github.com/Effect-TS/effect/commits/[email protected]/packages/effect)

---
updated-dependencies:
- dependency-name: "@effect/platform"
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: effect
- dependency-name: "@effect/platform-node"
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: effect
- dependency-name: "@effect/schema"
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: effect
- dependency-name: effect
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: effect
...

Signed-off-by: dependabot[bot] <[email protected]>

* Match changes

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Chris Wilkinson <[email protected]>
  • Loading branch information
dependabot[bot] and thewilkybarkid authored Jul 4, 2024
1 parent ef7266d commit 02a3b68
Show file tree
Hide file tree
Showing 7 changed files with 75 additions and 70 deletions.
75 changes: 37 additions & 38 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
11 changes: 6 additions & 5 deletions src/data/openalex-domains.json.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -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])

Expand Down
11 changes: 6 additions & 5 deletions src/data/openalex-fields.json.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -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,
Expand Down
20 changes: 11 additions & 9 deletions src/data/openalex-subfields.json.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -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,
Expand Down
11 changes: 6 additions & 5 deletions src/data/requests.json.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -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)

Expand Down
13 changes: 7 additions & 6 deletions src/data/reviews.json.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -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)

Expand Down

0 comments on commit 02a3b68

Please sign in to comment.