From cc6bee26a4dd054c97e1a25060a98099800adfba Mon Sep 17 00:00:00 2001 From: Daniel Chambers Date: Thu, 12 Dec 2024 16:02:04 +1100 Subject: [PATCH] Update to NDC Spec v0.2.0-rc.2 --- Cargo.lock | 4 +- rust-toolchain.toml | 4 ++ src/schema/schema.generated.json | 101 +++++++++++++++++++++++++------ src/schema/schema.generated.ts | 24 ++++++-- typegen/Cargo.toml | 6 +- 5 files changed, 111 insertions(+), 28 deletions(-) create mode 100644 rust-toolchain.toml diff --git a/Cargo.lock b/Cargo.lock index 097a1a3..1a74494 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "android-tzdata" @@ -239,7 +239,7 @@ checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" [[package]] name = "ndc-models" version = "0.2.0" -source = "git+http://github.com/hasura/ndc-spec.git?tag=v0.2.0-rc.1#1bcec88a5f20b005cf3883d289e7b18c1a6111b2" +source = "git+http://github.com/hasura/ndc-spec.git?tag=v0.2.0-rc.2#2fad1c699df79890dbb3877d1035ffd8bd0abfc2" dependencies = [ "indexmap 2.2.6", "ref-cast", diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 index 0000000..1375f17 --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1,4 @@ +[toolchain] +channel = "1.83.0" +profile = "default" # see https://rust-lang.github.io/rustup/concepts/profiles.html +components = ["llvm-tools-preview", "rust-analyzer", "rust-src"] # see https://rust-lang.github.io/rustup/concepts/components.html diff --git a/src/schema/schema.generated.json b/src/schema/schema.generated.json index d4dff84..ed50873 100644 --- a/src/schema/schema.generated.json +++ b/src/schema/schema.generated.json @@ -1111,6 +1111,90 @@ } } }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "contains" + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "contains_insensitive" + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "starts_with" + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "starts_with_insensitive" + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "ends_with" + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "ends_with_insensitive" + ] + } + } + }, { "type": "object", "required": [ @@ -1416,23 +1500,6 @@ "AggregateCapabilitiesSchemaInfo": { "title": "Aggregate Capabilities Schema Info", "type": "object", - "properties": { - "filter_by": { - "description": "Schema information relevant to the aggregates.filter_by capability", - "anyOf": [ - { - "$ref": "#/definitions/AggregateFilterByCapabilitiesSchemaInfo" - }, - { - "type": "null" - } - ] - } - } - }, - "AggregateFilterByCapabilitiesSchemaInfo": { - "title": "Aggregate Filter By Capabilities Schema Info", - "type": "object", "required": [ "count_scalar_type" ], diff --git a/src/schema/schema.generated.ts b/src/schema/schema.generated.ts index a85ac24..8e1fe6d 100644 --- a/src/schema/schema.generated.ts +++ b/src/schema/schema.generated.ts @@ -152,6 +152,24 @@ export type ComparisonOperatorDefinition = | { type: "greater_than_or_equal"; } + | { + type: "contains"; + } + | { + type: "contains_insensitive"; + } + | { + type: "starts_with"; + } + | { + type: "starts_with_insensitive"; + } + | { + type: "ends_with"; + } + | { + type: "ends_with_insensitive"; + } | { type: "custom"; /** @@ -902,12 +920,6 @@ export interface QueryCapabilitiesSchemaInfo { aggregates?: AggregateCapabilitiesSchemaInfo | null; } export interface AggregateCapabilitiesSchemaInfo { - /** - * Schema information relevant to the aggregates.filter_by capability - */ - filter_by?: AggregateFilterByCapabilitiesSchemaInfo | null; -} -export interface AggregateFilterByCapabilitiesSchemaInfo { /** * The scalar type which should be used for the return type of count (star_count and column_count) operations. */ diff --git a/typegen/Cargo.toml b/typegen/Cargo.toml index 0a00770..0b437ae 100644 --- a/typegen/Cargo.toml +++ b/typegen/Cargo.toml @@ -6,8 +6,8 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -ndc-models = { git = "http://github.com/hasura/ndc-spec.git", tag = "v0.2.0-rc.1" } -schemars = "0.8.15" +ndc-models = { git = "http://github.com/hasura/ndc-spec.git", tag = "v0.2.0-rc.2" } +schemars = "^0.8" serde = "^1.0" -serde_json = "1.0.107" +serde_json = "^1.0" serde_derive = "^1.0"