Skip to content

Conversation

@matlin
Copy link

@matlin matlin commented Sep 29, 2025

Overview

This brings in some of the changes we used at Aspen Cloud to run Triplit Cloud. We used these changes (in our own fork) in production to deploy, update, and manage applications and machines on Fly.

Changes

  • Make fetch responses over REST and GraphQL more uniform and structured
  • Update types to better reflect Fly's latest API
  • Fix some issues relating to machine leases

Copy link

@sweatybridge sweatybridge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apart from regenerating types and new gql client methods, this PR adds the following functionality

  1. supports fly-machine-lease-nonce header in updateMachine
  2. supports deleteLease operation

Did I miss anything?

async getAppDetailed(
app_name: GetAppRequest
): Promise<APIResponse<AppDetailedResponse>> {
const response = await this.client.safeGqlPost<string, { app: any }>({

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we avoid typing app: any in calls to safeGqlPost? Always define the interface types returned from graphql api call.

async listMachines(app_name: ListMachineRequest): Promise<MachineResponse[]> {
async listMachines(
app_name: ListMachineRequest
): Promise<APIResponse<MachineResponse[]>> {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the reason for wrapping errors in the response object instead of throwing? This would be a breaking change for existing users of this library which I'd like to avoid.

A few other options

  1. create another wrapper class
  2. bump the major version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants