This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Schema } from "@effect/schema" | |
| import * as Model from "./Model.js" | |
| import { DateTime } from "effect" | |
| export const GroupId = Schema.Number.pipe(Schema.brand("GroupId")) | |
| export class Group extends Model.Class<Group>("Group")({ | |
| id: Model.PrimaryKey(GroupId), | |
| name: Schema.NonEmptyTrimmedString, | |
| createdAt: Model.CreatedAt, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import * as Http from "@effect/platform/HttpClient" | |
| Http.request.post("https://accounts.spotify.com/api/token").pipe( | |
| Http.request.basicAuth(clientId, clientSecret) | |
| Http.request.urlParamsBody({ | |
| grant_type: "refresh_token", | |
| refresh_token: refreshToken, | |
| client_id: clientId, | |
| }), | |
| Http.client.fetchOk, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import * as Http from "@effect/platform/HttpClient" | |
| import { Schema } from "@effect/schema" | |
| import { Array, Config, Context, Data, Effect, Layer, flow } from "effect" | |
| import { Inngest as Inngest_ } from "inngest" | |
| class InngestRun extends Schema.Class<InngestRun>("InngestRun")({ | |
| run_id: Schema.String, | |
| status: Schema.Literal("Running", "Completed", "Failed", "Cancelled"), | |
| }) { | |
| static decodeArray = Http.response.schemaBodyJsonScoped( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import * as Http from "@effect/platform/HttpClient" | |
| import { Context, Effect, Layer, pipe } from "effect" | |
| const headers = { | |
| Accept: | |
| "application/graphql-response+json; charset=utf-8, application/json; charset=utf-8", | |
| "Content-Type": "application/json", | |
| } | |
| export class GraphQLClient extends Context.Tag("graphql-codegen/GraphQLClient")< |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ee |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import type { Duration, Scope } from "effect" | |
| import { Effect, SynchronizedRef } from "effect" | |
| export const make = (limit: number, window: Duration.DurationInput): Effect.Effect< | |
| <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>, | |
| never, | |
| Scope.Scope | |
| > => | |
| Effect.gen(function*(_) { | |
| const scope = yield* _(Effect.scope) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Schema, TreeFormatter } from "@effect/schema" | |
| import { | |
| Cause, | |
| Context, | |
| Data, | |
| Effect, | |
| Either, | |
| Layer, | |
| Option, | |
| PrimaryKey, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import * as Context from "effect/Context" | |
| import * as Effect from "effect/Effect" | |
| import * as Exit from "effect/Exit" | |
| import * as Layer from "effect/Layer" | |
| import * as Runtime from "effect/Runtime" | |
| import * as Scope from "effect/Scope" | |
| export interface RuntimeClass<R> extends AsyncDisposable { | |
| readonly close: () => Promise<void> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { | |
| Chunk, | |
| Deferred, | |
| Duration, | |
| Effect, | |
| Queue, | |
| Ref, | |
| Request, | |
| RequestResolver, | |
| } from "effect" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { httpApp, response, router } from "@effect-http/core" | |
| import { decodeParams } from "@effect-http/core/schema" | |
| import { serve } from "@effect-http/node" | |
| import { pipe } from "@effect/data/Function" | |
| import * as Effect from "@effect/io/Effect" | |
| import * as Schema from "@effect/schema/Schema" | |
| import * as Http from "http" | |
| const app = pipe( | |
| router |