sdk

Radroots SDK and bindings
git clone https://radroots.dev/git/sdk.git
Log | Files | Refs | README

commit 707b579cb60fbd3de67b4d017fbd25255d1952d8
parent 4ef5340afc69bad33cce19164333eff29b80df8c
Author: triesap <tyson@radroots.org>
Date:   Thu, 11 Jun 2026 06:23:23 -0700

feat(replica-db-schema-bindings): generate schema package

Diffstat:
MCargo.lock | 1+
Mcrates/replica_db_schema_bindings/src/lib.rs | 16++++++++++++++++
Mcrates/xtask/Cargo.toml | 1+
Mcrates/xtask/src/output.rs | 16++++++++++++++++
Apackages/replica-db-schema-bindings/src/generated/sdk-manifest.json | 6++++++
Apackages/replica-db-schema-bindings/src/generated/types.ts | 527+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mpackages/replica-db-schema-bindings/src/index.ts | 2+-
7 files changed, 568 insertions(+), 1 deletion(-)

diff --git a/Cargo.lock b/Cargo.lock @@ -684,6 +684,7 @@ dependencies = [ "radroots_events_bindings", "radroots_events_indexed_bindings", "radroots_identity_bindings", + "radroots_replica_db_schema_bindings", "radroots_types_bindings", "serde_json", ] diff --git a/crates/replica_db_schema_bindings/src/lib.rs b/crates/replica_db_schema_bindings/src/lib.rs @@ -1 +1,17 @@ pub use radroots_replica_db_schema as upstream; + +pub const TYPES_TS: &str = include_str!( + "../../../testdata/baseline/current-radroots-generated/replica-db-schema/types.ts" +); + +#[cfg(test)] +mod tests { + use super::TYPES_TS; + + #[test] + fn preserves_replica_schema_exports() { + assert!(TYPES_TS.contains("export type Farm")); + assert!(TYPES_TS.contains("export type GcsLocation")); + assert!(TYPES_TS.contains("export type IGcsLocationFindManyResolve")); + } +} diff --git a/crates/xtask/Cargo.toml b/crates/xtask/Cargo.toml @@ -17,5 +17,6 @@ radroots_core_bindings = { path = "../core_bindings" } radroots_events_bindings = { path = "../events_bindings" } radroots_events_indexed_bindings = { path = "../events_indexed_bindings" } radroots_identity_bindings = { path = "../identity_bindings" } +radroots_replica_db_schema_bindings = { path = "../replica_db_schema_bindings" } radroots_types_bindings = { path = "../types_bindings" } serde_json = "1" diff --git a/crates/xtask/src/output.rs b/crates/xtask/src/output.rs @@ -85,6 +85,13 @@ pub fn package_outputs() -> Vec<PackageOutput> { kinds_ts: None, }, PackageOutput { + spec: spec_by_key("replica_db_schema"), + types_ts: Some(radroots_replica_db_schema_bindings::TYPES_TS), + types_imports_ts: Some(REPLICA_DB_SCHEMA_TYPES_IMPORTS_TS), + constants_ts: None, + kinds_ts: None, + }, + PackageOutput { spec: spec_by_key("types"), types_ts: Some(radroots_types_bindings::TYPES_TS), types_imports_ts: None, @@ -121,6 +128,14 @@ const EVENTS_TYPES_IMPORTS_TS: &str = r#"import type { "#; +const REPLICA_DB_SCHEMA_TYPES_IMPORTS_TS: &str = r#"import type { + IResult, + IResultList, + IResultPass, +} from "@radroots/types-bindings"; + +"#; + fn render_manifest(spec: PackageSpec) -> String { let mut value = package_manifest(spec); value["generated"] = serde_json::Value::Bool(true); @@ -180,6 +195,7 @@ mod tests { assert!(package_names.contains(&"@radroots/events-bindings")); assert!(package_names.contains(&"@radroots/events-indexed-bindings")); assert!(package_names.contains(&"@radroots/identity-bindings")); + assert!(package_names.contains(&"@radroots/replica-db-schema-bindings")); assert!(package_names.contains(&"@radroots/types-bindings")); } } diff --git a/packages/replica-db-schema-bindings/src/generated/sdk-manifest.json b/packages/replica-db-schema-bindings/src/generated/sdk-manifest.json @@ -0,0 +1,6 @@ +{ + "crate": "radroots_replica_db_schema_bindings", + "generated": true, + "generator": "radroots_sdk_xtask", + "package": "@radroots/replica-db-schema-bindings" +} diff --git a/packages/replica-db-schema-bindings/src/generated/types.ts b/packages/replica-db-schema-bindings/src/generated/types.ts @@ -0,0 +1,527 @@ +// @generated by cargo xtask generate ts +// Do not edit by hand. +import type { + IResult, + IResultList, + IResultPass, +} from "@radroots/types-bindings"; + +export type Farm = { id: string, created_at: string, updated_at: string, d_tag: string, pubkey: string, name: string, about: string | null, website: string | null, picture: string | null, banner: string | null, location_primary: string | null, location_city: string | null, location_region: string | null, location_country: string | null, }; + +export type FarmGcsLocation = { id: string, created_at: string, updated_at: string, farm_id: string, gcs_location_id: string, role: string, }; + +export type FarmGcsLocationQueryBindValues = { id: string, } | { farm_id: string, } | { gcs_location_id: string, }; + +export type FarmMember = { id: string, created_at: string, updated_at: string, farm_id: string, member_pubkey: string, role: string, }; + +export type FarmMemberClaim = { id: string, created_at: string, updated_at: string, member_pubkey: string, farm_pubkey: string, }; + +export type FarmMemberClaimQueryBindValues = { id: string, } | { member_pubkey: string, } | { farm_pubkey: string, }; + +export type FarmMemberQueryBindValues = { id: string, } | { farm_id: string, } | { member_pubkey: string, }; + +export type FarmQueryBindValues = { id: string, } | { d_tag: string, } | { pubkey: string, }; + +export type FarmTag = { id: string, created_at: string, updated_at: string, farm_id: string, tag: string, }; + +export type FarmTagQueryBindValues = { id: string, } | { farm_id: string, } | { tag: string, }; + +export type GcsLocation = { id: string, created_at: string, updated_at: string, d_tag: string, lat: number, lng: number, geohash: string, point: string, polygon: string, accuracy: number | null, altitude: number | null, tag_0: string | null, label: string | null, area: number | null, elevation: number | null, soil: string | null, climate: string | null, gc_id: string | null, gc_name: string | null, gc_admin1_id: string | null, gc_admin1_name: string | null, gc_country_id: string | null, gc_country_name: string | null, }; + +export type GcsLocationFarmArgs = { id: string, }; + +export type GcsLocationFindManyRel = { "on_trade_product": GcsLocationTradeProductArgs } | { "off_trade_product": GcsLocationTradeProductArgs } | { "on_farm": GcsLocationFarmArgs } | { "off_farm": GcsLocationFarmArgs } | { "on_plot": GcsLocationPlotArgs } | { "off_plot": GcsLocationPlotArgs }; + +export type GcsLocationPlotArgs = { id: string, }; + +export type GcsLocationQueryBindValues = { id: string, } | { d_tag: string, } | { geohash: string, }; + +export type GcsLocationTradeProductArgs = { id: string, }; + +export type IFarmCreate = IFarmFields; + +export type IFarmCreateResolve = IResult<Farm>; + +export type IFarmDelete = IFarmFindOne; + +export type IFarmDeleteResolve = IResult<string>; + +export type IFarmFields = { d_tag: string, pubkey: string, name: string, about?: string | null, website?: string | null, picture?: string | null, banner?: string | null, location_primary?: string | null, location_city?: string | null, location_region?: string | null, location_country?: string | null, }; + +export type IFarmFieldsFilter = { id?: string, created_at?: string, updated_at?: string, d_tag?: string, pubkey?: string, name?: string, about?: string, website?: string, picture?: string, banner?: string, location_primary?: string, location_city?: string, location_region?: string, location_country?: string, }; + +export type IFarmFieldsPartial = { d_tag?: string | null, pubkey?: string | null, name?: string | null, about?: string | null, website?: string | null, picture?: string | null, banner?: string | null, location_primary?: string | null, location_city?: string | null, location_region?: string | null, location_country?: string | null, }; + +export type IFarmFindMany = { filter: IFarmFieldsFilter | null, }; + +export type IFarmFindManyResolve = IResultList<Farm>; + +export type IFarmFindOne = IFarmFindOneArgs; + +export type IFarmFindOneArgs = { on: FarmQueryBindValues, }; + +export type IFarmFindOneResolve = IResult<Farm>; + +export type IFarmGcsLocationCreate = IFarmGcsLocationFields; + +export type IFarmGcsLocationCreateResolve = IResult<FarmGcsLocation>; + +export type IFarmGcsLocationDelete = IFarmGcsLocationFindOne; + +export type IFarmGcsLocationDeleteResolve = IResult<string>; + +export type IFarmGcsLocationFields = { farm_id: string, gcs_location_id: string, role: string, }; + +export type IFarmGcsLocationFieldsFilter = { id?: string, created_at?: string, updated_at?: string, farm_id?: string, gcs_location_id?: string, role?: string, }; + +export type IFarmGcsLocationFieldsPartial = { farm_id?: string | null, gcs_location_id?: string | null, role?: string | null, }; + +export type IFarmGcsLocationFindMany = { filter: IFarmGcsLocationFieldsFilter | null, }; + +export type IFarmGcsLocationFindManyResolve = IResultList<FarmGcsLocation>; + +export type IFarmGcsLocationFindOne = IFarmGcsLocationFindOneArgs; + +export type IFarmGcsLocationFindOneArgs = { on: FarmGcsLocationQueryBindValues, }; + +export type IFarmGcsLocationFindOneResolve = IResult<FarmGcsLocation>; + +export type IFarmGcsLocationUpdate = { on: FarmGcsLocationQueryBindValues, fields: IFarmGcsLocationFieldsPartial, }; + +export type IFarmGcsLocationUpdateResolve = IResult<FarmGcsLocation>; + +export type IFarmMemberClaimCreate = IFarmMemberClaimFields; + +export type IFarmMemberClaimCreateResolve = IResult<FarmMemberClaim>; + +export type IFarmMemberClaimDelete = IFarmMemberClaimFindOne; + +export type IFarmMemberClaimDeleteResolve = IResult<string>; + +export type IFarmMemberClaimFields = { member_pubkey: string, farm_pubkey: string, }; + +export type IFarmMemberClaimFieldsFilter = { id?: string, created_at?: string, updated_at?: string, member_pubkey?: string, farm_pubkey?: string, }; + +export type IFarmMemberClaimFieldsPartial = { member_pubkey?: string | null, farm_pubkey?: string | null, }; + +export type IFarmMemberClaimFindMany = { filter: IFarmMemberClaimFieldsFilter | null, }; + +export type IFarmMemberClaimFindManyResolve = IResultList<FarmMemberClaim>; + +export type IFarmMemberClaimFindOne = IFarmMemberClaimFindOneArgs; + +export type IFarmMemberClaimFindOneArgs = { on: FarmMemberClaimQueryBindValues, }; + +export type IFarmMemberClaimFindOneResolve = IResult<FarmMemberClaim>; + +export type IFarmMemberClaimUpdate = { on: FarmMemberClaimQueryBindValues, fields: IFarmMemberClaimFieldsPartial, }; + +export type IFarmMemberClaimUpdateResolve = IResult<FarmMemberClaim>; + +export type IFarmMemberCreate = IFarmMemberFields; + +export type IFarmMemberCreateResolve = IResult<FarmMember>; + +export type IFarmMemberDelete = IFarmMemberFindOne; + +export type IFarmMemberDeleteResolve = IResult<string>; + +export type IFarmMemberFields = { farm_id: string, member_pubkey: string, role: string, }; + +export type IFarmMemberFieldsFilter = { id?: string, created_at?: string, updated_at?: string, farm_id?: string, member_pubkey?: string, role?: string, }; + +export type IFarmMemberFieldsPartial = { farm_id?: string | null, member_pubkey?: string | null, role?: string | null, }; + +export type IFarmMemberFindMany = { filter: IFarmMemberFieldsFilter | null, }; + +export type IFarmMemberFindManyResolve = IResultList<FarmMember>; + +export type IFarmMemberFindOne = IFarmMemberFindOneArgs; + +export type IFarmMemberFindOneArgs = { on: FarmMemberQueryBindValues, }; + +export type IFarmMemberFindOneResolve = IResult<FarmMember>; + +export type IFarmMemberUpdate = { on: FarmMemberQueryBindValues, fields: IFarmMemberFieldsPartial, }; + +export type IFarmMemberUpdateResolve = IResult<FarmMember>; + +export type IFarmTagCreate = IFarmTagFields; + +export type IFarmTagCreateResolve = IResult<FarmTag>; + +export type IFarmTagDelete = IFarmTagFindOne; + +export type IFarmTagDeleteResolve = IResult<string>; + +export type IFarmTagFields = { farm_id: string, tag: string, }; + +export type IFarmTagFieldsFilter = { id?: string, created_at?: string, updated_at?: string, farm_id?: string, tag?: string, }; + +export type IFarmTagFieldsPartial = { farm_id?: string | null, tag?: string | null, }; + +export type IFarmTagFindMany = { filter: IFarmTagFieldsFilter | null, }; + +export type IFarmTagFindManyResolve = IResultList<FarmTag>; + +export type IFarmTagFindOne = IFarmTagFindOneArgs; + +export type IFarmTagFindOneArgs = { on: FarmTagQueryBindValues, }; + +export type IFarmTagFindOneResolve = IResult<FarmTag>; + +export type IFarmTagUpdate = { on: FarmTagQueryBindValues, fields: IFarmTagFieldsPartial, }; + +export type IFarmTagUpdateResolve = IResult<FarmTag>; + +export type IFarmUpdate = { on: FarmQueryBindValues, fields: IFarmFieldsPartial, }; + +export type IFarmUpdateResolve = IResult<Farm>; + +export type IGcsLocationCreate = IGcsLocationFields; + +export type IGcsLocationCreateResolve = IResult<GcsLocation>; + +export type IGcsLocationDelete = IGcsLocationFindOne; + +export type IGcsLocationDeleteResolve = IResult<string>; + +export type IGcsLocationFields = { d_tag: string, lat: number, lng: number, geohash: string, point: string, polygon: string, accuracy?: number | null, altitude?: number | null, tag_0?: string | null, label?: string | null, area?: number | null, elevation?: number | null, soil?: string | null, climate?: string | null, gc_id?: string | null, gc_name?: string | null, gc_admin1_id?: string | null, gc_admin1_name?: string | null, gc_country_id?: string | null, gc_country_name?: string | null, }; + +export type IGcsLocationFieldsFilter = { id?: string, created_at?: string, updated_at?: string, d_tag?: string, lat?: number, lng?: number, geohash?: string, point?: string, polygon?: string, accuracy?: number, altitude?: number, tag_0?: string, label?: string, area?: number, elevation?: number, soil?: string, climate?: string, gc_id?: string, gc_name?: string, gc_admin1_id?: string, gc_admin1_name?: string, gc_country_id?: string, gc_country_name?: string, }; + +export type IGcsLocationFieldsPartial = { d_tag?: string | null, lat?: number | null, lng?: number | null, geohash?: string | null, point?: string | null, polygon?: string | null, accuracy?: number | null, altitude?: number | null, tag_0?: string | null, label?: string | null, area?: number | null, elevation?: number | null, soil?: string | null, climate?: string | null, gc_id?: string | null, gc_name?: string | null, gc_admin1_id?: string | null, gc_admin1_name?: string | null, gc_country_id?: string | null, gc_country_name?: string | null, }; + +export type IGcsLocationFindMany = { filter: IGcsLocationFieldsFilter | null, } | { rel: GcsLocationFindManyRel, }; + +export type IGcsLocationFindManyResolve = IResultList<GcsLocation>; + +export type IGcsLocationFindOne = IGcsLocationFindOneArgs | IGcsLocationFindOneRelArgs; + +export type IGcsLocationFindOneArgs = { on: GcsLocationQueryBindValues, }; + +export type IGcsLocationFindOneRelArgs = { rel: GcsLocationFindManyRel, }; + +export type IGcsLocationFindOneResolve = IResult<GcsLocation>; + +export type IGcsLocationUpdate = { on: GcsLocationQueryBindValues, fields: IGcsLocationFieldsPartial, }; + +export type IGcsLocationUpdateResolve = IResult<GcsLocation>; + +export type ILogErrorCreate = ILogErrorFields; + +export type ILogErrorCreateResolve = IResult<LogError>; + +export type ILogErrorDelete = ILogErrorFindOne; + +export type ILogErrorDeleteResolve = IResult<string>; + +export type ILogErrorFields = { error: string, message: string, stack_trace?: string | null, cause?: string | null, app_system: string, app_version: string, nostr_pubkey: string, data?: string | null, }; + +export type ILogErrorFieldsFilter = { id?: string, created_at?: string, updated_at?: string, error?: string, message?: string, stack_trace?: string, cause?: string, app_system?: string, app_version?: string, nostr_pubkey?: string, data?: string, }; + +export type ILogErrorFieldsPartial = { error?: string | null, message?: string | null, stack_trace?: string | null, cause?: string | null, app_system?: string | null, app_version?: string | null, nostr_pubkey?: string | null, data?: string | null, }; + +export type ILogErrorFindMany = { filter: ILogErrorFieldsFilter | null, }; + +export type ILogErrorFindManyResolve = IResultList<LogError>; + +export type ILogErrorFindOne = ILogErrorFindOneArgs; + +export type ILogErrorFindOneArgs = { on: LogErrorQueryBindValues, }; + +export type ILogErrorFindOneResolve = IResult<LogError>; + +export type ILogErrorUpdate = { on: LogErrorQueryBindValues, fields: ILogErrorFieldsPartial, }; + +export type ILogErrorUpdateResolve = IResult<LogError>; + +export type IMediaImageCreate = IMediaImageFields; + +export type IMediaImageCreateResolve = IResult<MediaImage>; + +export type IMediaImageDelete = IMediaImageFindOne; + +export type IMediaImageDeleteResolve = IResult<string>; + +export type IMediaImageFields = { file_path: string, mime_type: string, res_base: string, res_path: string, label?: string | null, description?: string | null, }; + +export type IMediaImageFieldsFilter = { id?: string, created_at?: string, updated_at?: string, file_path?: string, mime_type?: string, res_base?: string, res_path?: string, label?: string, description?: string, }; + +export type IMediaImageFieldsPartial = { file_path?: string | null, mime_type?: string | null, res_base?: string | null, res_path?: string | null, label?: string | null, description?: string | null, }; + +export type IMediaImageFindMany = { filter: IMediaImageFieldsFilter | null, } | { rel: MediaImageFindManyRel, }; + +export type IMediaImageFindManyResolve = IResultList<MediaImage>; + +export type IMediaImageFindOne = IMediaImageFindOneArgs | IMediaImageFindOneRelArgs; + +export type IMediaImageFindOneArgs = { on: MediaImageQueryBindValues, }; + +export type IMediaImageFindOneRelArgs = { rel: MediaImageFindManyRel, }; + +export type IMediaImageFindOneResolve = IResult<MediaImage>; + +export type IMediaImageUpdate = { on: MediaImageQueryBindValues, fields: IMediaImageFieldsPartial, }; + +export type IMediaImageUpdateResolve = IResult<MediaImage>; + +export type INostrEventStateCreate = INostrEventStateFields; + +export type INostrEventStateCreateResolve = IResult<NostrEventState>; + +export type INostrEventStateDelete = INostrEventStateFindOne; + +export type INostrEventStateDeleteResolve = IResult<string>; + +export type INostrEventStateFields = { key: string, kind: number, pubkey: string, d_tag: string, last_event_id: string, last_created_at: number, content_hash: string, }; + +export type INostrEventStateFieldsFilter = { id?: string, created_at?: string, updated_at?: string, key?: string, kind?: number, pubkey?: string, d_tag?: string, last_event_id?: string, last_created_at?: number, content_hash?: string, }; + +export type INostrEventStateFieldsPartial = { key?: string | null, kind?: number | null, pubkey?: string | null, d_tag?: string | null, last_event_id?: string | null, last_created_at?: number | null, content_hash?: string | null, }; + +export type INostrEventStateFindMany = { filter: INostrEventStateFieldsFilter | null, }; + +export type INostrEventStateFindManyResolve = IResultList<NostrEventState>; + +export type INostrEventStateFindOne = INostrEventStateFindOneArgs; + +export type INostrEventStateFindOneArgs = { on: NostrEventStateQueryBindValues, }; + +export type INostrEventStateFindOneResolve = IResult<NostrEventState>; + +export type INostrEventStateUpdate = { on: NostrEventStateQueryBindValues, fields: INostrEventStateFieldsPartial, }; + +export type INostrEventStateUpdateResolve = IResult<NostrEventState>; + +export type INostrProfileCreate = INostrProfileFields; + +export type INostrProfileCreateResolve = IResult<NostrProfile>; + +export type INostrProfileDelete = INostrProfileFindOne; + +export type INostrProfileDeleteResolve = IResult<string>; + +export type INostrProfileFields = { public_key: string, profile_type: string, name: string, display_name?: string | null, about?: string | null, website?: string | null, picture?: string | null, banner?: string | null, nip05?: string | null, lud06?: string | null, lud16?: string | null, }; + +export type INostrProfileFieldsFilter = { id?: string, created_at?: string, updated_at?: string, public_key?: string, profile_type?: string, name?: string, display_name?: string, about?: string, website?: string, picture?: string, banner?: string, nip05?: string, lud06?: string, lud16?: string, }; + +export type INostrProfileFieldsPartial = { public_key?: string | null, profile_type?: string | null, name?: string | null, display_name?: string | null, about?: string | null, website?: string | null, picture?: string | null, banner?: string | null, nip05?: string | null, lud06?: string | null, lud16?: string | null, }; + +export type INostrProfileFindMany = { filter: INostrProfileFieldsFilter | null, } | { rel: NostrProfileFindManyRel, }; + +export type INostrProfileFindManyResolve = IResultList<NostrProfile>; + +export type INostrProfileFindOne = INostrProfileFindOneArgs | INostrProfileFindOneRelArgs; + +export type INostrProfileFindOneArgs = { on: NostrProfileQueryBindValues, }; + +export type INostrProfileFindOneRelArgs = { rel: NostrProfileFindManyRel, }; + +export type INostrProfileFindOneResolve = IResult<NostrProfile>; + +export type INostrProfileRelayRelation = { nostr_profile: NostrProfileQueryBindValues, nostr_relay: NostrRelayQueryBindValues, }; + +export type INostrProfileRelayResolve = IResultPass; + +export type INostrProfileUpdate = { on: NostrProfileQueryBindValues, fields: INostrProfileFieldsPartial, }; + +export type INostrProfileUpdateResolve = IResult<NostrProfile>; + +export type INostrRelayCreate = INostrRelayFields; + +export type INostrRelayCreateResolve = IResult<NostrRelay>; + +export type INostrRelayDelete = INostrRelayFindOne; + +export type INostrRelayDeleteResolve = IResult<string>; + +export type INostrRelayFields = { url: string, relay_id?: string | null, name?: string | null, description?: string | null, pubkey?: string | null, contact?: string | null, supported_nips?: string | null, software?: string | null, version?: string | null, data?: string | null, }; + +export type INostrRelayFieldsFilter = { id?: string, created_at?: string, updated_at?: string, url?: string, relay_id?: string, name?: string, description?: string, pubkey?: string, contact?: string, supported_nips?: string, software?: string, version?: string, data?: string, }; + +export type INostrRelayFieldsPartial = { url?: string | null, relay_id?: string | null, name?: string | null, description?: string | null, pubkey?: string | null, contact?: string | null, supported_nips?: string | null, software?: string | null, version?: string | null, data?: string | null, }; + +export type INostrRelayFindMany = { filter: INostrRelayFieldsFilter | null, } | { rel: NostrRelayFindManyRel, }; + +export type INostrRelayFindManyResolve = IResultList<NostrRelay>; + +export type INostrRelayFindOne = INostrRelayFindOneArgs | INostrRelayFindOneRelArgs; + +export type INostrRelayFindOneArgs = { on: NostrRelayQueryBindValues, }; + +export type INostrRelayFindOneRelArgs = { rel: NostrRelayFindManyRel, }; + +export type INostrRelayFindOneResolve = IResult<NostrRelay>; + +export type INostrRelayUpdate = { on: NostrRelayQueryBindValues, fields: INostrRelayFieldsPartial, }; + +export type INostrRelayUpdateResolve = IResult<NostrRelay>; + +export type IPlotCreate = IPlotFields; + +export type IPlotCreateResolve = IResult<Plot>; + +export type IPlotDelete = IPlotFindOne; + +export type IPlotDeleteResolve = IResult<string>; + +export type IPlotFields = { d_tag: string, farm_id: string, name: string, about?: string | null, location_primary?: string | null, location_city?: string | null, location_region?: string | null, location_country?: string | null, }; + +export type IPlotFieldsFilter = { id?: string, created_at?: string, updated_at?: string, d_tag?: string, farm_id?: string, name?: string, about?: string, location_primary?: string, location_city?: string, location_region?: string, location_country?: string, }; + +export type IPlotFieldsPartial = { d_tag?: string | null, farm_id?: string | null, name?: string | null, about?: string | null, location_primary?: string | null, location_city?: string | null, location_region?: string | null, location_country?: string | null, }; + +export type IPlotFindMany = { filter: IPlotFieldsFilter | null, }; + +export type IPlotFindManyResolve = IResultList<Plot>; + +export type IPlotFindOne = IPlotFindOneArgs; + +export type IPlotFindOneArgs = { on: PlotQueryBindValues, }; + +export type IPlotFindOneResolve = IResult<Plot>; + +export type IPlotGcsLocationCreate = IPlotGcsLocationFields; + +export type IPlotGcsLocationCreateResolve = IResult<PlotGcsLocation>; + +export type IPlotGcsLocationDelete = IPlotGcsLocationFindOne; + +export type IPlotGcsLocationDeleteResolve = IResult<string>; + +export type IPlotGcsLocationFields = { plot_id: string, gcs_location_id: string, role: string, }; + +export type IPlotGcsLocationFieldsFilter = { id?: string, created_at?: string, updated_at?: string, plot_id?: string, gcs_location_id?: string, role?: string, }; + +export type IPlotGcsLocationFieldsPartial = { plot_id?: string | null, gcs_location_id?: string | null, role?: string | null, }; + +export type IPlotGcsLocationFindMany = { filter: IPlotGcsLocationFieldsFilter | null, }; + +export type IPlotGcsLocationFindManyResolve = IResultList<PlotGcsLocation>; + +export type IPlotGcsLocationFindOne = IPlotGcsLocationFindOneArgs; + +export type IPlotGcsLocationFindOneArgs = { on: PlotGcsLocationQueryBindValues, }; + +export type IPlotGcsLocationFindOneResolve = IResult<PlotGcsLocation>; + +export type IPlotGcsLocationUpdate = { on: PlotGcsLocationQueryBindValues, fields: IPlotGcsLocationFieldsPartial, }; + +export type IPlotGcsLocationUpdateResolve = IResult<PlotGcsLocation>; + +export type IPlotTagCreate = IPlotTagFields; + +export type IPlotTagCreateResolve = IResult<PlotTag>; + +export type IPlotTagDelete = IPlotTagFindOne; + +export type IPlotTagDeleteResolve = IResult<string>; + +export type IPlotTagFields = { plot_id: string, tag: string, }; + +export type IPlotTagFieldsFilter = { id?: string, created_at?: string, updated_at?: string, plot_id?: string, tag?: string, }; + +export type IPlotTagFieldsPartial = { plot_id?: string | null, tag?: string | null, }; + +export type IPlotTagFindMany = { filter: IPlotTagFieldsFilter | null, }; + +export type IPlotTagFindManyResolve = IResultList<PlotTag>; + +export type IPlotTagFindOne = IPlotTagFindOneArgs; + +export type IPlotTagFindOneArgs = { on: PlotTagQueryBindValues, }; + +export type IPlotTagFindOneResolve = IResult<PlotTag>; + +export type IPlotTagUpdate = { on: PlotTagQueryBindValues, fields: IPlotTagFieldsPartial, }; + +export type IPlotTagUpdateResolve = IResult<PlotTag>; + +export type IPlotUpdate = { on: PlotQueryBindValues, fields: IPlotFieldsPartial, }; + +export type IPlotUpdateResolve = IResult<Plot>; + +export type ITradeProductCreate = ITradeProductFields; + +export type ITradeProductCreateResolve = IResult<TradeProduct>; + +export type ITradeProductDelete = ITradeProductFindOne; + +export type ITradeProductDeleteResolve = IResult<string>; + +export type ITradeProductFields = { key: string, category: string, title: string, summary: string, process: string, lot: string, profile: string, year: bigint, qty_amt: number, qty_amt_exact: string, qty_unit: string, qty_label?: string | null, qty_avail?: number | null, price_amt: number, price_amt_exact: string, price_currency: string, price_qty_amt: number, price_qty_amt_exact: string, price_qty_unit: string, listing_addr?: string | null, primary_bin_id?: string | null, verified_primary_bin_id?: string | null, notes?: string | null, }; + +export type ITradeProductFieldsFilter = { id?: string, created_at?: string, updated_at?: string, key?: string, category?: string, title?: string, summary?: string, process?: string, lot?: string, profile?: string, year?: bigint, qty_amt?: number, qty_amt_exact?: string, qty_unit?: string, qty_label?: string, qty_avail?: bigint, price_amt?: number, price_amt_exact?: string, price_currency?: string, price_qty_amt?: number, price_qty_amt_exact?: string, price_qty_unit?: string, listing_addr?: string, primary_bin_id?: string, verified_primary_bin_id?: string, notes?: string, }; + +export type ITradeProductFieldsPartial = { key?: string | null, category?: string | null, title?: string | null, summary?: string | null, process?: string | null, lot?: string | null, profile?: string | null, year?: number | null, qty_amt?: number | null, qty_amt_exact?: string | null, qty_unit?: string | null, qty_label?: string | null, qty_avail?: number | null, price_amt?: number | null, price_amt_exact?: string | null, price_currency?: string | null, price_qty_amt?: number | null, price_qty_amt_exact?: string | null, price_qty_unit?: string | null, listing_addr?: string | null, primary_bin_id?: string | null, verified_primary_bin_id?: string | null, notes?: string | null, }; + +export type ITradeProductFindMany = { filter: ITradeProductFieldsFilter | null, }; + +export type ITradeProductFindManyResolve = IResultList<TradeProduct>; + +export type ITradeProductFindOne = ITradeProductFindOneArgs; + +export type ITradeProductFindOneArgs = { on: TradeProductQueryBindValues, }; + +export type ITradeProductFindOneResolve = IResult<TradeProduct>; + +export type ITradeProductLocationRelation = { trade_product: TradeProductQueryBindValues, gcs_location: GcsLocationQueryBindValues, }; + +export type ITradeProductLocationResolve = IResultPass; + +export type ITradeProductMediaRelation = { trade_product: TradeProductQueryBindValues, media_image: MediaImageQueryBindValues, }; + +export type ITradeProductMediaResolve = IResultPass; + +export type ITradeProductUpdate = { on: TradeProductQueryBindValues, fields: ITradeProductFieldsPartial, }; + +export type ITradeProductUpdateResolve = IResult<TradeProduct>; + +export type LogError = { id: string, created_at: string, updated_at: string, error: string, message: string, stack_trace: string | null, cause: string | null, app_system: string, app_version: string, nostr_pubkey: string, data: string | null, }; + +export type LogErrorQueryBindValues = { id: string, } | { nostr_pubkey: string, }; + +export type MediaImage = { id: string, created_at: string, updated_at: string, file_path: string, mime_type: string, res_base: string, res_path: string, label: string | null, description: string | null, }; + +export type MediaImageFindManyRel = { "on_trade_product": MediaImageTradeProductArgs } | { "off_trade_product": MediaImageTradeProductArgs }; + +export type MediaImageQueryBindValues = { id: string, } | { file_path: string, }; + +export type MediaImageTradeProductArgs = { id: string, }; + +export type NostrEventState = { id: string, created_at: string, updated_at: string, key: string, kind: number, pubkey: string, d_tag: string, last_event_id: string, last_created_at: number, content_hash: string, }; + +export type NostrEventStateQueryBindValues = { id: string, } | { key: string, }; + +export type NostrProfile = { id: string, created_at: string, updated_at: string, public_key: string, profile_type: string, name: string, display_name: string | null, about: string | null, website: string | null, picture: string | null, banner: string | null, nip05: string | null, lud06: string | null, lud16: string | null, }; + +export type NostrProfileFindManyRel = { "on_relay": NostrProfileRelayArgs } | { "off_relay": NostrProfileRelayArgs }; + +export type NostrProfileQueryBindValues = { id: string, } | { public_key: string, }; + +export type NostrProfileRelayArgs = { id: string, }; + +export type NostrRelay = { id: string, created_at: string, updated_at: string, url: string, relay_id: string | null, name: string | null, description: string | null, pubkey: string | null, contact: string | null, supported_nips: string | null, software: string | null, version: string | null, data: string | null, }; + +export type NostrRelayFindManyRel = { "on_profile": NostrRelayProfileArgs } | { "off_profile": NostrRelayProfileArgs }; + +export type NostrRelayProfileArgs = { public_key: string, }; + +export type NostrRelayQueryBindValues = { id: string, } | { url: string, }; + +export type Plot = { id: string, created_at: string, updated_at: string, d_tag: string, farm_id: string, name: string, about: string | null, location_primary: string | null, location_city: string | null, location_region: string | null, location_country: string | null, }; + +export type PlotGcsLocation = { id: string, created_at: string, updated_at: string, plot_id: string, gcs_location_id: string, role: string, }; + +export type PlotGcsLocationQueryBindValues = { id: string, } | { plot_id: string, } | { gcs_location_id: string, }; + +export type PlotQueryBindValues = { id: string, } | { d_tag: string, } | { farm_id: string, }; + +export type PlotTag = { id: string, created_at: string, updated_at: string, plot_id: string, tag: string, }; + +export type PlotTagQueryBindValues = { id: string, } | { plot_id: string, } | { tag: string, }; + +export type TradeProduct = { id: string, created_at: string, updated_at: string, key: string, category: string, title: string, summary: string, process: string, lot: string, profile: string, year: bigint, qty_amt: number, qty_amt_exact: string | null, qty_unit: string, qty_label: string | null, qty_avail: bigint | null, price_amt: number, price_amt_exact: string | null, price_currency: string, price_qty_amt: number, price_qty_amt_exact: string | null, price_qty_unit: string, listing_addr: string | null, primary_bin_id: string | null, verified_primary_bin_id: string | null, notes: string | null, }; + +export type TradeProductQueryBindValues = { id: string, }; diff --git a/packages/replica-db-schema-bindings/src/index.ts b/packages/replica-db-schema-bindings/src/index.ts @@ -1 +1 @@ -export {}; +export * from "./generated/types.js";