Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .oxlintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"!scratchpad/**/*",
// TODO: This should be in a nested .oxlintrc.json, but it does not work
// See related issue: https://github.com/oxc-project/oxc/issues/13204
"packages/amp/src/Protobuf/**/*"
"packages/amp/src/protobuf/**/*"
],
"jsPlugins": [
"@amp/oxc/oxlint"
Expand Down
7 changes: 7 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,18 @@
devShells = forAllSystems (pkgs: {
default = pkgs.mkShell {
packages = with pkgs; [
# JavaScript / TypeScript
bun
deno
corepack
nodejs_24
python3

# Justfile
just

# Blockchain
foundry
];
};
});
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,20 @@
"@effect/platform": "^0.94.2",
"@effect/platform-node": "^0.104.1",
"@effect/vitest": "^0.27.0",
"@types/node": "^25.0.10",
"@typescript/native-preview": "7.0.0-dev.20260122.4",
"@types/node": "^25.1.0",
"@typescript/native-preview": "7.0.0-dev.20260130.1",
"@vitest/coverage-v8": "^4.0.18",
"@vitest/ui": "^4.0.18",
"babel-plugin-annotate-pure-calls": "^0.5.0",
"dprint": "^0.51.1",
"effect": "^3.19.15",
"glob": "^13.0.0",
"globals": "^17.1.0",
"globals": "^17.2.0",
"madge": "^8.0.0",
"oxlint": "^1.41.0",
"oxlint": "^1.42.0",
"ts-patch": "^3.3.0",
"typescript": "^5.9.3",
"vite-tsconfig-paths": "^6.0.4",
"vite-tsconfig-paths": "^6.0.5",
"vitest": "^4.0.18",
"vitest-mock-express": "^2.2.0"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/amp/buf.gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ inputs:

plugins:
- local: protoc-gen-es
out: src/Protobuf
out: src/protobuf
opt:
- target=ts
- import_extension=ts
9 changes: 5 additions & 4 deletions packages/amp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@
"coverage": "vitest --coverage"
},
"peerDependencies": {
"@bufbuild/protobuf": "^2.10.1",
"@bufbuild/protobuf": "^2.11.0",
"@connectrpc/connect": "^2.1.1",
"@connectrpc/connect-node": "^2.1.1",
"@effect/platform": "^0.94.0",
"effect": "^3.19.11"
"@effect/platform": "^0.94.2",
"effect": "^3.19.15"
},
"devDependencies": {
"@bufbuild/buf": "^1.64.0",
Expand All @@ -59,6 +59,7 @@
},
"dependencies": {
"jiti": "^2.6.1",
"viem": "^2.44.4"
"jose": "^6.1.3",
"viem": "^2.45.1"
}
}
2 changes: 1 addition & 1 deletion packages/amp/src/admin/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import * as HttpApiError from "@effect/platform/HttpApiError"
import * as HttpApiGroup from "@effect/platform/HttpApiGroup"
import * as HttpApiSchema from "@effect/platform/HttpApiSchema"
import * as Schema from "effect/Schema"
import * as Models from "../Models.ts"
import * as Models from "../models.ts"
import * as Domain from "./domain.ts"
import * as Error from "./error.ts"

Expand Down
2 changes: 1 addition & 1 deletion packages/amp/src/admin/domain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* and responses.
*/
import * as Schema from "effect/Schema"
import * as Models from "../Models.ts"
import * as Models from "../models.ts"

// =============================================================================
// Dataset Request/Response Schemas
Expand Down
9 changes: 6 additions & 3 deletions packages/amp/src/admin/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import * as Effect from "effect/Effect"
import { constUndefined } from "effect/Function"
import * as Layer from "effect/Layer"
import * as Option from "effect/Option"
import * as Auth from "../Auth.ts"
import type * as Models from "../Models.ts"
import * as Auth from "../auth/service.ts"
import type * as Models from "../models.ts"
import * as Api from "./api.ts"
import type * as Domain from "./domain.ts"

Expand Down Expand Up @@ -263,7 +263,10 @@ const make = Effect.fnUntraced(function*(options: MakeOptions) {
onSome: (auth) =>
HttpClient.mapRequestEffect(
Effect.fnUntraced(function*(request) {
const authInfo = yield* auth.getCachedAuthInfo
const authInfo = yield* auth.getCachedAuthInfo.pipe(
// Treat cache errors as "no auth available"
Effect.catchAll(() => Effect.succeed(Option.none()))
)
if (Option.isNone(authInfo)) return request
const token = authInfo.value.accessToken
return HttpClientRequest.bearerToken(request, token)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ import * as Predicate from "effect/Predicate"
import * as Redacted from "effect/Redacted"
import * as Schema from "effect/Schema"
import * as Stream from "effect/Stream"
import { Auth } from "./Auth.ts"
import { Auth } from "./auth/service.ts"
import { decodeRecordBatch, DictionaryRegistry } from "./internal/arrow-flight-ipc/Decoder.ts"
import { recordBatchToJson } from "./internal/arrow-flight-ipc/Json.ts"
import { parseRecordBatch } from "./internal/arrow-flight-ipc/RecordBatch.ts"
import { type ArrowSchema, getMessageType, MessageHeaderType, parseSchema } from "./internal/arrow-flight-ipc/Schema.ts"
import type { AuthInfo, BlockRange, RecordBatchMetadata } from "./Models.ts"
import { RecordBatchMetadataFromUint8Array } from "./Models.ts"
import { FlightDescriptor_DescriptorType, FlightDescriptorSchema, FlightService } from "./Protobuf/Flight_pb.ts"
import { CommandStatementQuerySchema } from "./Protobuf/FlightSql_pb.ts"
import type { AuthInfo, BlockRange, RecordBatchMetadata } from "./models.ts"
import { RecordBatchMetadataFromUint8Array } from "./models.ts"
import { FlightDescriptor_DescriptorType, FlightDescriptorSchema, FlightService } from "./protobuf/Flight_pb.ts"
import { CommandStatementQuerySchema } from "./protobuf/FlightSql_pb.ts"

// =============================================================================
// Connect RPC Transport
Expand Down Expand Up @@ -212,7 +212,7 @@ export class ParseSchemaError extends Schema.TaggedError<ParseSchemaError>(
* is successfully executed.
*/
export interface QueryResult<A> {
readonly data: A
readonly data: ReadonlyArray<A>
readonly metadata: RecordBatchMetadata
}

Expand All @@ -239,7 +239,7 @@ export interface QueryOptions {
export type ExtractQueryResult<Options extends QueryOptions> = Options extends {
readonly schema: Schema.Schema<infer _A, infer _I, infer _R>
} ? QueryResult<_A>
: Record<string, unknown>
: QueryResult<Record<string, unknown>>

// =============================================================================
// Arrow Flight Service
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { createGrpcTransport, type GrpcTransportOptions } from "@connectrpc/connect-node"
import * as Effect from "effect/Effect"
import * as Layer from "effect/Layer"
import { Interceptors, Transport } from "../ArrowFlight.ts"
import { Interceptors, Transport } from "../arrow-flight.ts"

/**
* Create a `Transport` for the gRPC protocol using the Node.js `http2` module.
Expand Down
Loading
Loading