NeonN
Neon15mo ago
1 reply
spotty-amber

Possible type problem on the client

    const neonDatabase = await neonApiClient.POST("/projects", {
      body: {
        project: {
          name: newBusinessId,
          pg_version: 17,
          region_id: "aws-us-east-1",
          // Type error here
          default_endpoint_settings: {
            autoscaling_limit_max_cu: 0.25,
            autoscaling_limit_min_cu: 0.25,
          },
        },
      },
    })


Type '{ autoscaling_limit_max_cu: number; autoscaling_limit_min_cu: number; }' is not assignable to type '{ pg_settings?: { [key: string]: string; } | undefined; pgbouncer_settings?: { [key: string]: string; } | undefined; autoscaling_limit_min_cu?: number | undefined; autoscaling_limit_max_cu?: number | undefined; suspend_timeout_seconds?: number | undefined; } & { ...; }'.
Type '{ autoscaling_limit_max_cu: number; autoscaling_limit_min_cu: number; }' is not assignable to type '{ [key: string]: string; }'.
Property 'autoscaling_limit_max_cu' is incompatible with index signature.
Type 'number' is not assignable to type 'string'.ts(2322)
neon-types.ts(1653, 9): The expected type comes from property 'default_endpoint_settings' which is declared here on type '{ settings?: { quota?: { active_time_seconds?: number | undefined; compute_time_seconds?: number | undefined; written_data_bytes?: number | undefined; data_transfer_bytes?: number | undefined; logical_size_bytes?: number | undefined; } | undefined; allowed_ips?: { ...; } | undefined; enable_logical_replication?: boo...'
(property) default_endpoint_settings?: ({
pg_settings?: components["schemas"]["PgSettingsData"];
pgbouncer_settings?: components["schemas"]["PgbouncerSettingsData"];
autoscaling_limit_min_cu?: components["schemas"]["ComputeUnit"];
autoscaling_limit_max_cu?: components["schemas"]["ComputeUnit"];
suspend_timeout_seconds?: components["schemas"]["SuspendTimeoutSeconds"];
} & {
...;
}) | undefined
Was this page helpful?