From 91f86ed037aaabc56941509aa693effdf2335a72 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 16 Apr 2024 09:49:50 +0000 Subject: [PATCH] Bump the effect group with 3 updates (#147) * Bump the effect group with 3 updates Bumps the effect group with 3 updates: [@effect/platform](https://github.com/effect-ts/effect/tree/HEAD/packages/platform), [@effect/schema](https://github.com/effect-ts/effect/tree/HEAD/packages/schema) and [effect](https://github.com/effect-ts/effect/tree/HEAD/packages/effect). Updates `@effect/platform` from 0.48.21 to 0.48.29 - [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/platform@0.48.29/packages/platform) Updates `@effect/schema` from 0.64.15 to 0.65.0 - [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/schema@0.65.0/packages/schema) Updates `effect` from 2.4.15 to 2.4.19 - [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/effect@2.4.19/packages/effect) --- updated-dependencies: - dependency-name: "@effect/platform" dependency-type: direct:production update-type: version-update:semver-patch dependency-group: effect - dependency-name: "@effect/schema" dependency-type: direct:production update-type: version-update:semver-minor dependency-group: effect - dependency-name: effect dependency-type: direct:production update-type: version-update:semver-patch dependency-group: effect ... Signed-off-by: dependabot[bot] * Match changes --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Chris Wilkinson --- package-lock.json | 46 +++++++++++++----------- package.json | 6 ++-- src/Doi.ts | 2 +- src/Orcid.ts | 90 ++++++++++++++++++++++++----------------------- src/OrcidId.ts | 2 +- src/Redis.ts | 2 +- src/Temporal.ts | 14 ++++---- src/Url.ts | 14 ++++---- src/Users.ts | 2 +- src/Zenodo.ts | 28 +++++++-------- 10 files changed, 105 insertions(+), 101 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8b9d55d..b1b7802 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,12 +5,12 @@ "packages": { "": { "dependencies": { - "@effect/platform": "^0.48.21", - "@effect/schema": "^0.64.5", + "@effect/platform": "^0.48.29", + "@effect/schema": "^0.65.0", "@js-temporal/polyfill": "^0.4.4", "chalk": "^5.3.0", "doi-regex": "^0.1.13", - "effect": "2.4.15", + "effect": "2.4.19", "ioredis": "^5.3.2", "orcid-utils": "^1.2.2" }, @@ -329,26 +329,26 @@ } }, "node_modules/@effect/platform": { - "version": "0.48.21", - "resolved": "https://registry.npmjs.org/@effect/platform/-/platform-0.48.21.tgz", - "integrity": "sha512-0wDnhQWLPPw8YZJGmqikzmxFdqqroQpzYQMXdjVH5CujBASL01hPuH2Ix/mIcMmwgc9EKVOcLrze1wc5nkmxKg==", + "version": "0.48.29", + "resolved": "https://registry.npmjs.org/@effect/platform/-/platform-0.48.29.tgz", + "integrity": "sha512-vLggES/7inE2BA1OCMjrLPPgp57k3RrZDeWybN55u82jmNeo2rJMQJ7z4QTTdM6r3Y/WLniEMoMmWhtLWo00IA==", "dependencies": { "find-my-way-ts": "^0.1.1", - "isomorphic-ws": "^5.0.0", + "isows": "^1.0.4", "multipasta": "^0.2.0", "path-browserify": "^1.0.1" }, "peerDependencies": { - "@effect/schema": "^0.64.15", - "effect": "2.4.15" + "@effect/schema": "^0.65.0", + "effect": "2.4.19" } }, "node_modules/@effect/schema": { - "version": "0.64.15", - "resolved": "https://registry.npmjs.org/@effect/schema/-/schema-0.64.15.tgz", - "integrity": "sha512-d9Ye0lZRmiEyUghK6PYAz1qPE7ZuVeZhpqo1FmbAVFC1kMDeRRPg9+0yW6iAccF5SPApeKM/cWbbnNj2ZsWx9g==", + "version": "0.65.0", + "resolved": "https://registry.npmjs.org/@effect/schema/-/schema-0.65.0.tgz", + "integrity": "sha512-YWj13tEfXisJwMeOK+h6obPuVsMSnNi8FQ6zzOpJ1HdnGZJsOaKeOKqZ5uQxYcnfOR39Q5vePat4yLWkszmHrA==", "peerDependencies": { - "effect": "2.4.15", + "effect": "2.4.19", "fast-check": "^3.13.2" } }, @@ -2025,9 +2025,9 @@ } }, "node_modules/effect": { - "version": "2.4.15", - "resolved": "https://registry.npmjs.org/effect/-/effect-2.4.15.tgz", - "integrity": "sha512-fwOeADUSbmlvbNpAlUlNhuCPHN08VKt53YbtSzNe9aZK3CclVJdq2gPgo1TCaGQsJpPf42xw7QrrTBQiH94few==" + "version": "2.4.19", + "resolved": "https://registry.npmjs.org/effect/-/effect-2.4.19.tgz", + "integrity": "sha512-z/rn878Po3n522g/AYUDHD1SsZaZdvRxlTCLQ8xl8H6xA82nBwwooD1mdn/73Uywmp7d84oay3w3528r0Uyd0w==" }, "node_modules/enhanced-resolve": { "version": "5.15.0", @@ -3422,10 +3422,16 @@ "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", "dev": true }, - "node_modules/isomorphic-ws": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/isomorphic-ws/-/isomorphic-ws-5.0.0.tgz", - "integrity": "sha512-muId7Zzn9ywDsyXgTIafTry2sV3nySZeUDe6YedVd1Hvuuep5AsIlqK+XefWpYTyJG5e503F2xIuT2lcU6rCSw==", + "node_modules/isows": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/isows/-/isows-1.0.4.tgz", + "integrity": "sha512-hEzjY+x9u9hPmBom9IIAqdJCwNLax+xrPb51vEPpERoFlIxgmZcHzsT5jKG06nvInKOBGvReAVz80Umed5CczQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/wagmi-dev" + } + ], "peerDependencies": { "ws": "*" } diff --git a/package.json b/package.json index 22b8cdc..e28d1ff 100644 --- a/package.json +++ b/package.json @@ -28,12 +28,12 @@ "vitest": "^1.5.0" }, "dependencies": { - "@effect/platform": "^0.48.21", - "@effect/schema": "^0.64.5", + "@effect/platform": "^0.48.29", + "@effect/schema": "^0.65.0", "@js-temporal/polyfill": "^0.4.4", "chalk": "^5.3.0", "doi-regex": "^0.1.13", - "effect": "2.4.15", + "effect": "2.4.19", "ioredis": "^5.3.2", "orcid-utils": "^1.2.2" } diff --git a/src/Doi.ts b/src/Doi.ts index 0eb31bc..44c9455 100644 --- a/src/Doi.ts +++ b/src/Doi.ts @@ -9,7 +9,7 @@ export const isDoi: Predicate.Refinement = (u): u is Doi => export const Doi = Brand.refined(isDoi, s => Brand.error(`Expected ${s} to be a DOI`)) -export const DoiSchema = Schema.string.pipe(Schema.fromBrand(Doi)) +export const DoiSchema = Schema.String.pipe(Schema.fromBrand(Doi)) export const toUrl: (doi: Doi) => URL = doi => { const url = new URL('https://doi.org') diff --git a/src/Orcid.ts b/src/Orcid.ts index 1d9267c..9516e8e 100644 --- a/src/Orcid.ts +++ b/src/Orcid.ts @@ -80,28 +80,28 @@ export const deletePeerReview = ({ yield* _(HttpClient.request.del(`${orcid}/peer-review/${id}`), client, Effect.scoped) }) -const PrereviewGroupSchema = Schema.struct({ - 'external-ids': Schema.struct({ - 'external-id': Schema.tuple( - Schema.struct({ - 'external-id-type': Schema.literal('peer-review'), - 'external-id-value': Schema.literal('orcid-generated:prereview'), +const PrereviewGroupSchema = Schema.Struct({ + 'external-ids': Schema.Struct({ + 'external-id': Schema.Tuple( + Schema.Struct({ + 'external-id-type': Schema.Literal('peer-review'), + 'external-id-value': Schema.Literal('orcid-generated:prereview'), }), ), }), - 'peer-review-group': Schema.array( - Schema.struct({ - 'external-ids': Schema.struct({ - 'external-id': Schema.tuple( - Schema.struct({ - 'external-id-type': Schema.literal('doi'), + 'peer-review-group': Schema.Array( + Schema.Struct({ + 'external-ids': Schema.Struct({ + 'external-id': Schema.Tuple( + Schema.Struct({ + 'external-id-type': Schema.Literal('doi'), 'external-id-value': DoiSchema, }), ), }), - 'peer-review-summary': Schema.tuple( - Schema.struct({ - 'put-code': Schema.number, + 'peer-review-summary': Schema.Tuple( + Schema.Struct({ + 'put-code': Schema.Number, }), ), }), @@ -110,56 +110,58 @@ const PrereviewGroupSchema = Schema.struct({ export type PrereviewGroupSchema = Schema.Schema.Type -const OtherPeerReviewGroupSchema = Schema.struct({ - 'external-ids': Schema.struct({ - 'external-id': Schema.tuple( - Schema.struct({ - 'external-id-value': Schema.string, +const OtherPeerReviewGroupSchema = Schema.Struct({ + 'external-ids': Schema.Struct({ + 'external-id': Schema.Tuple( + Schema.Struct({ + 'external-id-value': Schema.String, }), ), }), }) -const PeerReviewsSchema = Schema.struct({ - group: Schema.array(Schema.union(PrereviewGroupSchema, OtherPeerReviewGroupSchema)), +const PeerReviewsSchema = Schema.Struct({ + group: Schema.Array(Schema.Union(PrereviewGroupSchema, OtherPeerReviewGroupSchema)), }) -const NewPeerReviewSchema = Schema.struct({ - 'reviewer-role': Schema.literal('reviewer'), - 'review-identifiers': Schema.struct({ - 'external-id': Schema.struct({ - 'external-id-type': Schema.literal('doi'), +const NewPeerReviewSchema = Schema.Struct({ + 'reviewer-role': Schema.Literal('reviewer'), + 'review-identifiers': Schema.Struct({ + 'external-id': Schema.Struct({ + 'external-id-type': Schema.Literal('doi'), 'external-id-value': DoiSchema, - 'external-id-relationship': Schema.literal('self'), + 'external-id-relationship': Schema.Literal('self'), }), }), 'review-url': Url.UrlSchema, - 'review-type': Schema.literal('review'), + 'review-type': Schema.Literal('review'), 'review-completion-date': Schema.transform( - Schema.struct({ + Schema.Struct({ year: Schema.NumberFromString, month: Schema.NumberFromString, day: Schema.NumberFromString, }), Temporal.PlainDateFromSelfSchema, - ({ year, month, day }) => Temporal.PlainDate.from({ year, month, day }), - date => ({ year: date.year, month: date.month, day: date.day }), + { + decode: ({ year, month, day }) => Temporal.PlainDate.from({ year, month, day }), + encode: date => ({ year: date.year, month: date.month, day: date.day }), + }, ), - 'review-group-id': Schema.literal('orcid-generated:prereview'), - 'subject-external-identifier': Schema.struct({ - 'external-id-type': Schema.literal('doi'), + 'review-group-id': Schema.Literal('orcid-generated:prereview'), + 'subject-external-identifier': Schema.Struct({ + 'external-id-type': Schema.Literal('doi'), 'external-id-value': DoiSchema, - 'external-id-relationship': Schema.literal('self'), + 'external-id-relationship': Schema.Literal('self'), }), - 'subject-container-name': Schema.optional(Schema.string), - 'subject-type': Schema.optional(Schema.literal('preprint')), - 'subject-name': Schema.optional(Schema.struct({ title: Schema.string })), + 'subject-container-name': Schema.optional(Schema.String), + 'subject-type': Schema.optional(Schema.Literal('preprint')), + 'subject-name': Schema.optional(Schema.Struct({ title: Schema.String })), 'subject-url': Url.UrlSchema, - 'convening-organization': Schema.struct({ - name: Schema.string, - address: Schema.struct({ - city: Schema.string, - country: Schema.string, + 'convening-organization': Schema.Struct({ + name: Schema.String, + address: Schema.Struct({ + city: Schema.String, + country: Schema.String, }), }), }) diff --git a/src/OrcidId.ts b/src/OrcidId.ts index 9a9f8d5..cfa94a8 100644 --- a/src/OrcidId.ts +++ b/src/OrcidId.ts @@ -14,4 +14,4 @@ const isOrcid: Predicate.Refinement = (u): u is OrcidId => { export const OrcidId = Brand.refined(isOrcid, s => Brand.error(`Expected ${s} to be an ORCID iD`)) -export const OrcidIdSchema = Schema.string.pipe(Schema.fromBrand(OrcidId)) +export const OrcidIdSchema = Schema.String.pipe(Schema.fromBrand(OrcidId)) diff --git a/src/Redis.ts b/src/Redis.ts index 82018e5..fcf8b6f 100644 --- a/src/Redis.ts +++ b/src/Redis.ts @@ -50,7 +50,7 @@ export const scanStream = ( return Stream.fromAsyncIterable(redis.scanStream(options), error => new RedisError({ error })) }), - ).pipe(Stream.map(Schema.decodeSync(Schema.array(Schema.string))), Stream.map(Chunk.fromIterable)) + ).pipe(Stream.map(Schema.decodeSync(Schema.Array(Schema.String))), Stream.map(Chunk.fromIterable)) export const get = (key: IoRedis.RedisKey): Effect.Effect, RedisError, Redis> => Effect.gen(function* (_) { diff --git a/src/Temporal.ts b/src/Temporal.ts index 3ff24ce..ba763dc 100644 --- a/src/Temporal.ts +++ b/src/Temporal.ts @@ -10,16 +10,14 @@ export const PlainDateFromSelfSchema = Schema.instanceOf(Temporal.PlainDate) export const PlainDateFromStringSchema = ( self: Schema.Schema, ): Schema.Schema => - Schema.transformOrFail( - self, - PlainDateFromSelfSchema, - (s, _, ast) => + Schema.transformOrFail(self, PlainDateFromSelfSchema, { + decode: (s, _, ast) => ParseResult.try({ try: () => Temporal.PlainDate.from(s), catch: () => new ParseResult.Type(ast, s), }), - plainDate => ParseResult.succeed(plainDate.toString()), - { strict: false }, - ) + encode: plainDate => ParseResult.succeed(plainDate.toString()), + strict: false, + }) -export const PlainDateSchema = PlainDateFromStringSchema(Schema.string) +export const PlainDateSchema = PlainDateFromStringSchema(Schema.String) diff --git a/src/Url.ts b/src/Url.ts index 8d03dba..d2ae4f9 100644 --- a/src/Url.ts +++ b/src/Url.ts @@ -3,16 +3,14 @@ import { ParseResult, Schema } from '@effect/schema' export const UrlFromSelfSchema: Schema.Schema = Schema.instanceOf(URL) export const UrlFromStringSchema = (self: Schema.Schema): Schema.Schema => - Schema.transformOrFail( - self, - UrlFromSelfSchema, - (s, _, ast) => + Schema.transformOrFail(self, UrlFromSelfSchema, { + decode: (s, _, ast) => ParseResult.try({ try: () => new URL(s), catch: () => new ParseResult.Type(ast, s), }), - url => ParseResult.succeed(url.href), - { strict: false }, - ) + encode: url => ParseResult.succeed(url.href), + strict: false, + }) -export const UrlSchema = UrlFromStringSchema(Schema.string) +export const UrlSchema = UrlFromStringSchema(Schema.String) diff --git a/src/Users.ts b/src/Users.ts index e0ad5bf..caf6eed 100644 --- a/src/Users.ts +++ b/src/Users.ts @@ -26,7 +26,7 @@ export const getUsers: Stream.Stream< Stream.map(User), ) -const OrcidTokenSchema = Schema.struct({ value: Schema.struct({ accessToken: Schema.string }) }) +const OrcidTokenSchema = Schema.Struct({ value: Schema.Struct({ accessToken: Schema.String }) }) const getAccessToken = flow( (orcidId: OrcidId.OrcidId) => Effect.flatten(Redis.get(`orcid-token:${orcidId}`)), diff --git a/src/Zenodo.ts b/src/Zenodo.ts index 73f2fed..55f50fa 100644 --- a/src/Zenodo.ts +++ b/src/Zenodo.ts @@ -42,31 +42,31 @@ const getRecords = ( return response.hits }) -const RecordsSchema = Schema.struct({ - hits: Schema.struct({ - hits: Schema.array( - Schema.struct({ +const RecordsSchema = Schema.Struct({ + hits: Schema.Struct({ + hits: Schema.Array( + Schema.Struct({ doi: DoiSchema, - metadata: Schema.struct({ + metadata: Schema.Struct({ publication_date: Temporal.PlainDateSchema, - related_identifiers: Schema.array( - Schema.union( - Schema.struct({ + related_identifiers: Schema.Array( + Schema.Union( + Schema.Struct({ identifier: DoiSchema, - relation: Schema.string, - scheme: Schema.literal('doi'), + relation: Schema.String, + scheme: Schema.Literal('doi'), }), - Schema.struct({ + Schema.Struct({ identifier: Url.UrlSchema, - relation: Schema.string, - scheme: Schema.literal('url'), + relation: Schema.String, + scheme: Schema.Literal('url'), }), ), ), }), }), ), - total: Schema.nonNegative()(Schema.number), + total: Schema.nonNegative()(Schema.Number), }), })