types.ts (18077B)
1 // @generated by cargo xtask generate ts 2 // Do not edit by hand. 3 import type { Decimal, Discount, Money, Quantity, QuantityPrice, Unit } from "@radroots/core-bindings"; 4 5 export type JobFeedbackStatus = "payment_required" | "processing" | "error" | "success" | "partial"; 6 7 export type JobInputType = "url" | "event" | "job" | "text"; 8 9 export type JobPaymentRequest = { amount_sat: number, bolt11?: string | null, }; 10 11 export type RadrootsAccountClaim = { username: string, pubkey: string, nip05?: string | null, }; 12 13 export type RadrootsAddressableRef = { kind: number, pubkey: string, d_tag: string, relays: Array<string>, }; 14 15 export type RadrootsAppData = { d_tag: string, content: string, }; 16 17 export type RadrootsCommercialDomain = "trade:listing"; 18 19 export type RadrootsContributionAttestation = { schema: string, schema_version: number, contributor_pubkey: string, contribution_type: string, subject_refs: Array<RadrootsEventRef>, summary: string, evidence_refs: Array<RadrootsEventRef>, }; 20 21 export type RadrootsCoop = { d_tag: string, name: string, about?: string | null, website?: string | null, picture?: string | null, banner?: string | null, location?: RadrootsCoopLocation | null, tags?: Array<string> | null, }; 22 23 export type RadrootsCoopLocation = { primary?: string | null, city?: string | null, region?: string | null, country?: string | null, gcs: RadrootsGcsLocation, }; 24 25 export type RadrootsCoopRef = { pubkey: string, d_tag: string, }; 26 27 export type RadrootsDocument = { d_tag: string, doc_type: string, title: string, version: string, summary?: string | null, effective_at?: number | null, body_markdown?: string | null, subject: RadrootsDocumentSubject, tags?: Array<string> | null, }; 28 29 export type RadrootsDocumentSubject = { pubkey: string, address?: string | null, }; 30 31 export type RadrootsEventEnvelopeDto = { id: string, author: string, created_at: number, kind: number, tags: Array<Array<string>>, content: string, sig: string, }; 32 33 export type RadrootsEventPtr = { id: string, relays?: string | null, }; 34 35 export type RadrootsEventRef = { id: string, author: string, kind: number, d_tag?: string | null, relays?: Array<string> | null, }; 36 37 export type RadrootsEvidenceBounty = { schema: string, schema_version: number, d_tag: string, title: string, summary?: string | null, topics: Array<string>, target_refs: Array<RadrootsEventRef>, reward_note?: string | null, closes_at?: string | null, }; 38 39 export type RadrootsFarm = { d_tag: string, name: string, about?: string | null, website?: string | null, picture?: string | null, banner?: string | null, location?: RadrootsFarmPublicLocation | null, tags?: Array<string> | null, }; 40 41 export type RadrootsFarmPublicLocation = { primary: string, city?: string | null, region?: string | null, country?: string | null, geohash: string, }; 42 43 export type RadrootsFarmRef = { pubkey: string, d_tag: string, }; 44 45 export type RadrootsFollow = { list: Array<RadrootsFollowProfile>, }; 46 47 export type RadrootsFollowProfile = { published_at: number, public_key: string, relay_url?: string | null, contact_name?: string | null, }; 48 49 export type RadrootsGcsLocation = { lat: number, lng: number, geohash: string, point: RadrootsGeoJsonPoint, polygon: RadrootsGeoJsonPolygon, 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, }; 50 51 export type RadrootsGeoChat = { geohash: string, content: string, nickname?: string | null, teleported: boolean, }; 52 53 export type RadrootsGeoJsonPoint = { type: string, coordinates: [number, number], }; 54 55 export type RadrootsGeoJsonPolygon = { type: string, coordinates: Array<Array<[number, number]>>, }; 56 57 export type RadrootsGiftWrap = { recipient: RadrootsGiftWrapRecipient, content: string, expiration?: number | null, }; 58 59 export type RadrootsGiftWrapRecipient = { public_key: string, relay_url?: string | null, }; 60 61 export type RadrootsJobFeedback = { kind: number, status: JobFeedbackStatus, extra_info?: string | null, request_event: RadrootsEventPtr, customer_pubkey?: string | null, payment?: JobPaymentRequest | null, content?: string | null, encrypted: boolean, }; 62 63 export type RadrootsJobInput = { data: string, input_type: JobInputType, relay?: string | null, marker?: string | null, }; 64 65 export type RadrootsJobParam = { key: string, value: string, }; 66 67 export type RadrootsJobRequest = { kind: number, inputs: Array<RadrootsJobInput>, output?: string | null, params: Array<RadrootsJobParam>, bid_sat?: number | null, relays: Array<string>, providers: Array<string>, topics: Array<string>, encrypted: boolean, }; 68 69 export type RadrootsJobResult = { kind: number, request_event: RadrootsEventPtr, request_json?: string | null, inputs: Array<RadrootsJobInput>, customer_pubkey?: string | null, payment?: JobPaymentRequest | null, content?: string | null, encrypted: boolean, }; 70 71 export type RadrootsKnowledgeChangeProposal = { schema: string, schema_version: number, target: RadrootsEventRef, proposal_type: string, summary: string, rationale?: string | null, evidence_refs: Array<RadrootsEventRef>, supersedes: Array<RadrootsEventRef>, }; 72 73 export type RadrootsKnowledgeCitationSpan = { source_ref: RadrootsEventRef, artifact_ref?: RadrootsEventRef | null, page_start?: number | null, page_end?: number | null, section_path: Array<string>, quote_hash?: string | null, chunk_id?: string | null, }; 74 75 export type RadrootsKnowledgeClaim = { schema: string, schema_version: number, claim_type: string, text: string, citation_spans: Array<RadrootsKnowledgeCitationSpan>, topics: Array<string>, applies_to: Array<string>, author_asserted_confidence?: string | null, supersedes: Array<RadrootsEventRef>, }; 76 77 export type RadrootsKnowledgeFieldContext = { location_precision: RadrootsKnowledgeLocationPrecision, public_location?: RadrootsKnowledgeLocation | null, private_location_ref?: RadrootsEventRef | null, topics: Array<string>, context_tags: Array<string>, }; 78 79 export type RadrootsKnowledgeFieldReport = { schema: string, schema_version: number, report_type: string, title: string, summary?: string | null, context: RadrootsKnowledgeFieldContext, observations: Array<RadrootsKnowledgeObservation>, artifact_refs: Array<RadrootsEventRef>, related_refs: Array<RadrootsEventRef>, limitations: Array<string>, }; 80 81 export type RadrootsKnowledgeLocation = { label?: string | null, region?: string | null, locality?: string | null, geohash?: string | null, }; 82 83 export type RadrootsKnowledgeLocationPrecision = "none" | "region" | "locality" | "coarse_geohash" | "exact_public" | "exact_private_reference"; 84 85 export type RadrootsKnowledgeNodeRef = { node_type: string, event_ref?: RadrootsEventRef | null, address_ref?: RadrootsAddressableRef | null, external_id?: string | null, label?: string | null, }; 86 87 export type RadrootsKnowledgeObservation = { observation_type: string, text: string, observed_at?: string | null, values: Array<RadrootsKnowledgeObservationValue>, }; 88 89 export type RadrootsKnowledgeObservationValue = { key: string, value: string, unit?: string | null, }; 90 91 export type RadrootsKnowledgeRelation = { schema: string, schema_version: number, subject: RadrootsKnowledgeNodeRef, predicate: string, object: RadrootsKnowledgeNodeRef, support_refs: Array<RadrootsEventRef>, author_asserted_confidence?: string | null, supersedes: Array<RadrootsEventRef>, }; 92 93 export type RadrootsKnowledgeReview = { schema: string, schema_version: number, target: RadrootsKnowledgeReviewTarget, reviewer_role: string, verdict: string, scores: Array<RadrootsKnowledgeReviewScore>, notes?: string | null, evidence_refs: Array<RadrootsEventRef>, }; 94 95 export type RadrootsKnowledgeReviewScope = "specific_version" | "addressable_coordinate_at_published_at" | "policy_latest"; 96 97 export type RadrootsKnowledgeReviewScore = { dimension: string, value: string, note?: string | null, }; 98 99 export type RadrootsKnowledgeReviewTarget = { event_id: string, author_pubkey: string, kind: number, address?: string | null, relays: Array<string>, review_scope: RadrootsKnowledgeReviewScope, }; 100 101 export type RadrootsKnowledgeSource = { schema: string, schema_version: number, d_tag: string, title: string, source_type: string, authors: Array<string>, publisher?: string | null, publication_year?: number | null, edition?: string | null, canonical_url?: string | null, artifact_refs: Array<RadrootsEventRef>, author_asserted_rights?: RadrootsRightsAssertion | null, topics: Array<string>, summary?: string | null, }; 102 103 export type RadrootsList = { content: string, entries: Array<RadrootsListEntry>, }; 104 105 export type RadrootsListEntry = { tag: string, values: Array<string>, }; 106 107 export type RadrootsListSet = { d_tag: string, content: string, entries: Array<RadrootsListEntry>, title?: string | null, description?: string | null, image?: string | null, }; 108 109 export type RadrootsMessage = { recipients: Array<RadrootsMessageRecipient>, content: string, reply_to?: RadrootsEventPtr | null, subject?: string | null, }; 110 111 export type RadrootsMessageFile = { recipients: Array<RadrootsMessageRecipient>, file_url: string, reply_to?: RadrootsEventPtr | null, subject?: string | null, file_type: string, encryption_algorithm: string, decryption_key: string, decryption_nonce: string, encrypted_hash: string, original_hash?: string | null, size?: string | null, dimensions?: RadrootsMessageFileDimensions | null, blurhash?: string | null, thumb?: string | null, fallbacks: Array<string>, }; 112 113 export type RadrootsMessageFileDimensions = { w: number, h: number, }; 114 115 export type RadrootsMessageRecipient = { public_key: string, relay_url?: string | null, }; 116 117 export type RadrootsNip01EventWireDto = { id: string, pubkey: string, created_at: number, kind: number, tags: Array<Array<string>>, content: string, sig: string, extra: { [key: string]: unknown }, }; 118 119 export type RadrootsOperationalListing = { d_tag: string, published_at?: string | null, farm?: RadrootsFarmRef, product: RadrootsOperationalListingProduct, primary_bin_id: string, bins: Array<RadrootsOperationalListingBin>, resource_area?: RadrootsResourceAreaRef | null, plot?: RadrootsPlotRef | null, discounts?: Array<Discount> | null, inventory_available?: Decimal | null, availability?: RadrootsOperationalListingAvailability | null, delivery_method?: RadrootsOperationalListingDeliveryMethod | null, location?: RadrootsOperationalListingPublicLocation | null, images?: Array<RadrootsOperationalListingImage> | null, }; 120 121 export type RadrootsOperationalListingAvailability = { kind: "window", amount: { start?: string | null, end?: string | null, }, } | { kind: "status", amount: { status: RadrootsOperationalListingStatus, }, }; 122 123 export type RadrootsOperationalListingBin = { bin_id: string, quantity: Quantity, price_per_canonical_unit: QuantityPrice, display_amount?: Decimal | null, display_unit?: Unit | null, display_label?: string | null, display_price?: Money | null, display_price_unit?: Unit | null, }; 124 125 export type RadrootsOperationalListingDeliveryMethod = { kind: "pickup", } | { kind: "local_delivery", } | { kind: "shipping", } | { kind: "other", amount: { method: string, }, }; 126 127 export type RadrootsOperationalListingImage = { url: string, size?: RadrootsOperationalListingImageSize | null, }; 128 129 export type RadrootsOperationalListingImageSize = { w: number, h: number, }; 130 131 export type RadrootsOperationalListingParseError = { InvalidKind: number, } | { MissingTag: string, } | { InvalidTag: string, } | { InvalidNumber: string, } | "InvalidUnit" | "InvalidCurrency" | { InvalidJson: string, } | { InvalidDiscount: string, }; 132 133 export type RadrootsOperationalListingProduct = { key: string, title: string, category: string, summary?: string | null, process?: string | null, lot?: string | null, location?: string | null, profile?: string | null, year?: string | null, }; 134 135 export type RadrootsOperationalListingProductTagKeys = readonly ["key", "title", "category", "summary", "process", "lot", "location", "profile", "year"]; 136 137 export type RadrootsOperationalListingPublicLocation = { primary: string, city?: string | null, region?: string | null, country?: string | null, geohash: string, }; 138 139 export type RadrootsOperationalListingStatus = { kind: "active", } | { kind: "sold", } | { kind: "other", amount: { value: string, }, }; 140 141 export type RadrootsOperationalListingValidationError = { kind: "invalid_kind", amount: { kind: number, }, } | { kind: "invalid_profile", } | { kind: "missing_listing_id", } | { kind: "listing_event_not_found", amount: { listing_addr: string, }, } | { kind: "listing_event_fetch_failed", amount: { listing_addr: string, }, } | { kind: "parse_error", amount: { error: RadrootsOperationalListingParseError, }, } | { kind: "invalid_seller", } | { kind: "missing_farm_profile", } | { kind: "missing_farm_record", } | { kind: "missing_title", } | { kind: "missing_description", } | { kind: "missing_product_type", } | { kind: "missing_bins", } | { kind: "missing_primary_bin", } | { kind: "invalid_bin", } | { kind: "missing_price", } | { kind: "invalid_price", } | { kind: "missing_inventory", } | { kind: "invalid_inventory", } | { kind: "missing_availability", } | { kind: "missing_location", } | { kind: "missing_location_locality", } | { kind: "missing_location_geohash", } | { kind: "invalid_location_geohash", } | { kind: "missing_delivery_method", }; 142 143 export type RadrootsPlot = { d_tag: string, farm: RadrootsFarmRef, name: string, about?: string | null, location?: RadrootsPlotLocation | null, tags?: Array<string> | null, }; 144 145 export type RadrootsPlotLocation = { primary?: string | null, city?: string | null, region?: string | null, country?: string | null, gcs: RadrootsGcsLocation, }; 146 147 export type RadrootsPlotRef = { pubkey: string, d_tag: string, }; 148 149 export type RadrootsPost = { content: string, farm?: RadrootsSocialFarmAnchor | null, address_refs?: Array<RadrootsSocialTarget> | null, location?: RadrootsSocialLocation | null, topics?: Array<string> | null, quote_refs?: Array<RadrootsSocialTarget> | null, media?: Array<RadrootsSocialMediaMetadata> | null, }; 150 151 export type RadrootsProfileType = "individual" | "farm" | "coop" | "any" | "radrootsd"; 152 153 export type RadrootsReaction = { target: RadrootsSocialTarget, content: string, }; 154 155 export type RadrootsRelayDocument = { name?: string | null, description?: string | null, pubkey?: string | null, contact?: string | null, supported_nips?: Array<number> | null, software?: string | null, version?: string | null, }; 156 157 export type RadrootsResourceArea = { d_tag: string, name: string, about?: string | null, location: RadrootsResourceAreaLocation, tags?: Array<string> | null, }; 158 159 export type RadrootsResourceAreaLocation = { primary?: string | null, city?: string | null, region?: string | null, country?: string | null, gcs: RadrootsGcsLocation, }; 160 161 export type RadrootsResourceAreaRef = { pubkey: string, d_tag: string, }; 162 163 export type RadrootsResourceHarvestCap = { d_tag: string, resource_area: RadrootsResourceAreaRef, product: RadrootsResourceHarvestProduct, start: string, end: string, cap_quantity: Quantity, display_amount?: Decimal | null, display_unit?: Unit | null, display_label?: string | null, tags?: Array<string> | null, }; 164 165 export type RadrootsResourceHarvestProduct = { key: string, category?: string | null, }; 166 167 export type RadrootsRightsAssertion = { assertion: string, holder?: string | null, license?: string | null, url?: string | null, }; 168 169 export type RadrootsSeal = { content: string, }; 170 171 export type RadrootsSignedEventDto = { state: RadrootsSignedEventVerificationStateDto, envelope: RadrootsEventEnvelopeDto, wire: RadrootsNip01EventWireDto, raw_json: string, }; 172 173 export type RadrootsSignedEventVerificationStateDto = "id_verified"; 174 175 export type RadrootsSocialFarmAnchor = { farm: RadrootsFarmRef, relays?: Array<string> | null, }; 176 177 export type RadrootsSocialLocation = { name?: string | null, geohash?: string | null, }; 178 179 export type RadrootsSocialMediaDimensions = { width: number, height: number, }; 180 181 export type RadrootsSocialMediaMetadata = { url?: string | null, mime_type?: string | null, sha256?: string | null, original_sha256?: string | null, size?: string | null, dimensions?: RadrootsSocialMediaDimensions | null, blurhash?: string | null, thumbnails?: Array<RadrootsSocialMediaThumbnail> | null, image?: string | null, summary?: string | null, alt?: string | null, fallback?: string | null, magnet?: string | null, content_hashes?: Array<string> | null, services?: Array<string> | null, imeta?: Array<Array<string>> | null, }; 182 183 export type RadrootsSocialMediaThumbnail = { url: string, dimensions?: RadrootsSocialMediaDimensions | null, }; 184 185 export type RadrootsSocialTarget = { kind: "event", id: string, author?: string | null, event_kind?: number | null, relays?: Array<string> | null, } | { kind: "address", address: string, author?: string | null, event_kind?: number | null, relays?: Array<string> | null, } | { kind: "external", id: string, external_kind: string, hint?: string | null, }; 186 187 export type RadrootsVerifiedSignedEventDto = { state: RadrootsVerifiedSignedEventVerificationStateDto, signed_event: RadrootsSignedEventDto, }; 188 189 export type RadrootsVerifiedSignedEventVerificationStateDto = "signature_verified"; 190 191 export type RadrootsWikiArticle = { d_tag: string, title?: string | null, content_djot: string, summary?: string | null, topics: Array<string>, references: Array<RadrootsEventRef>, forked_from: Array<RadrootsWikiArticleVersionRef>, deferred_to?: RadrootsWikiArticleVersionRef | null, }; 192 193 export type RadrootsWikiArticleVersionRef = { event_id: string, address_ref: RadrootsAddressableRef, }; 194 195 export type RadrootsWikiMergeRequest = { target_article: RadrootsAddressableRef, destination_pubkey: string, base_version_event_id?: string | null, source_version_event_id: string, explanation?: string | null, }; 196 197 export type RadrootsWikiRedirect = { d_tag: string, target: RadrootsAddressableRef, };