@xyo-network/xns-record-payload-plugins 3.6.1 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/index.mjs.map +1 -1
- package/dist/neutral/index.mjs.map +1 -1
- package/dist/node/index.mjs.map +1 -1
- package/dist/types/DNS/Witness/Payload/Request.d.ts +4 -10
- package/dist/types/DNS/Witness/Payload/Request.d.ts.map +1 -1
- package/dist/types/DNS/Witness/Payload/Response.d.ts +4 -10
- package/dist/types/DNS/Witness/Payload/Response.d.ts.map +1 -1
- package/dist/types/DNS/types/ResourceRecord.d.ts.map +1 -1
- package/dist/types/DNS/types/ResponseCodes.d.ts.map +1 -1
- package/dist/types/Domain/Domain.d.ts +4 -10
- package/dist/types/Domain/Domain.d.ts.map +1 -1
- package/dist/types/Domain/DomainLease.d.ts +4 -10
- package/dist/types/Domain/DomainLease.d.ts.map +1 -1
- package/dist/types/DomainRegistration/DomainRegistration.d.ts +4 -10
- package/dist/types/DomainRegistration/DomainRegistration.d.ts.map +1 -1
- package/dist/types/DomainRegistration/DomainRegistrationLease.d.ts +4 -10
- package/dist/types/DomainRegistration/DomainRegistrationLease.d.ts.map +1 -1
- package/dist/types/diviner/DomainLeaseEstimateDiviner/ErrorDetails/ErrorCodes.d.ts.map +1 -1
- package/package.json +21 -21
- package/src/DNS/types/ResourceRecord.ts +97 -97
- package/src/DNS/types/ResponseCodes.ts +15 -15
- package/src/diviner/DomainLeaseEstimateDiviner/ErrorDetails/ErrorCodes.ts +2 -2
package/dist/node/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Address/Payload.ts","../../src/diviner/DomainLeaseEstimateDiviner/Schema.ts","../../src/diviner/DomainLeaseEstimateDiviner/ErrorDetails/ErrorCodes.ts","../../src/diviner/DomainLeaseEstimateDiviner/ErrorDetails/Payload.ts","../../src/diviner/lib/parseEstimatesFromArray.ts","../../src/DomainRegistration/DomainRegistration.ts","../../src/Domain/Domain.ts","../../src/Domain/DomainLease.ts","../../src/DomainRegistration/DomainRegistrationLease.ts","../../src/DNS/types/OperationCodes.ts","../../src/DNS/types/ResponseCodes.ts","../../src/DNS/types/Header.ts","../../src/DNS/types/ResourceRecord.ts","../../src/DNS/types/Request.ts","../../src/DNS/Witness/Schema.ts","../../src/DNS/Witness/Config.ts","../../src/DNS/Witness/Payload/Request.ts","../../src/DNS/Witness/Payload/Response.ts","../../src/Duration/validation/validateBoundWitness.ts","../../src/Duration/validation/validateBoundWitnessAndDuration.ts","../../src/Duration/validation/validateDuration.ts","../../src/Duration/validation/validateBoundWitnessWithDuration.ts","../../src/Hash/Payload.ts"],"sourcesContent":["import type { Address } from '@xylabs/hex'\nimport type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nimport type { DomainFields } from '../Domain/index.ts'\n\nexport type AddressRecordSchema = 'network.xyo.ns.record.address'\nexport const AddressRecordSchema: AddressRecordSchema = 'network.xyo.ns.record.address'\n\nexport interface AddressRecordFields extends DomainFields {\n /**\n * The address the record points to\n */\n address: Address[]\n}\n\n/**\n * An address record points a domain to an address\n */\nexport type AddressRecord = Payload<AddressRecordFields, AddressRecordSchema>\n\nexport const isAddressRecord = isPayloadOfSchemaType<AddressRecord>(AddressRecordSchema)\n","export const DomainLeaseEstimateDivinerValidationErrorDetailsSchema\n = 'network.xyo.diviner.ns.domain.registration.lease.estimate.validation.error.details' as const\n\nexport type DomainLeaseEstimateDivinerValidationErrorDetailsSchema = typeof DomainLeaseEstimateDivinerValidationErrorDetailsSchema\n","import { DomainLeaseEstimateDivinerValidationErrorDetailsSchema } from '../Schema.ts'\nimport type { DomainLeaseEstimateDivinerValidationErrorDetails, ErrorDetailsDictionary } from './Payload.ts'\n\n// export type DomainLeaseEstimateDivinerErrorDetailsDictionaryErrorCode = keyof typeof DomainLeaseEstimateDivinerErrorDetailsDictionary\nexport type DomainLeaseEstimateDivinerErrorDetailsDictionaryErrorCode = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8\n\nexport const DomainLeaseEstimateDivinerErrorDetailsDictionary: Readonly<\n Readonly<Record<DomainLeaseEstimateDivinerErrorDetailsDictionaryErrorCode, DomainLeaseEstimateDivinerValidationErrorDetails>> &\n ErrorDetailsDictionary\n> = {\n 0: {\n code: '0', schema: DomainLeaseEstimateDivinerValidationErrorDetailsSchema, title: 'Success',\n },\n 1: {\n code: '1', schema: DomainLeaseEstimateDivinerValidationErrorDetailsSchema, title: 'Invalid casing',\n },\n 2: {\n code: '2', schema: DomainLeaseEstimateDivinerValidationErrorDetailsSchema, title: 'Invalid coin signature',\n },\n 3: {\n code: '3', schema: DomainLeaseEstimateDivinerValidationErrorDetailsSchema, title: 'Invalid length',\n },\n 4: {\n code: '4', schema: DomainLeaseEstimateDivinerValidationErrorDetailsSchema, title: 'Invalid name',\n },\n 5: {\n code: '5', schema: DomainLeaseEstimateDivinerValidationErrorDetailsSchema, title: 'Reserved fragment',\n },\n 6: {\n code: '6', schema: DomainLeaseEstimateDivinerValidationErrorDetailsSchema, title: 'Reserved name',\n },\n 7: {\n code: '7', schema: DomainLeaseEstimateDivinerValidationErrorDetailsSchema, title: 'Reserved string',\n },\n 8: {\n code: '8', schema: DomainLeaseEstimateDivinerValidationErrorDetailsSchema, title: 'Invalid TLD',\n },\n} as const\n","import type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType, isPayloadOfSchemaTypeWithSources } from '@xyo-network/payload-model'\n\nimport { DomainLeaseEstimateDivinerValidationErrorDetailsSchema } from '../Schema.ts'\n\nexport interface ErrorDetails<TErrorCode extends string | undefined = string | undefined> {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [key: string]: any // Index signature for any other additional properties\n /**\n * A string code indicating the error type.\n */\n code: TErrorCode\n /**\n * A human-readable explanation specific to this occurrence of the problem\n */\n detail?: string\n /**\n * A short, human-readable summary of the problem type.\n */\n title?: string\n}\n\nexport type ErrorDetailsDictionary<T extends number = number> = {\n readonly [K in T]: ErrorDetails<`${K}`>\n}\n\n/**\n * A payment authorization token payload\n */\nexport type DomainLeaseEstimateDivinerValidationErrorDetails<TErrorCode extends string | undefined = string> = Payload<\n ErrorDetails<TErrorCode>,\n DomainLeaseEstimateDivinerValidationErrorDetailsSchema\n>\n\n/**\n * Identity function for DomainLeaseEstimateDivinerValidationErrorDetails payload\n */\nexport const isDomainLeaseEstimateDivinerValidationErrorDetails = isPayloadOfSchemaType<DomainLeaseEstimateDivinerValidationErrorDetails>(\n DomainLeaseEstimateDivinerValidationErrorDetailsSchema,\n)\n\n/**\n * Identity function for DomainLeaseEstimateDivinerValidationErrorDetails payload with sources\n */\nexport const isDomainLeaseEstimateDivinerValidationErrorDetailsWithSources\n = isPayloadOfSchemaTypeWithSources<DomainLeaseEstimateDivinerValidationErrorDetails>(DomainLeaseEstimateDivinerValidationErrorDetailsSchema)\n","import { findAs } from '@xylabs/array'\nimport { exists } from '@xylabs/exists'\nimport type { BoundWitness } from '@xyo-network/boundwitness-model'\nimport { isBoundWitness } from '@xyo-network/boundwitness-model'\nimport type { HashLeaseEstimate } from '@xyo-network/diviner-hash-lease'\nimport { asHashLeaseEstimate, HashLeaseEstimateSchema } from '@xyo-network/diviner-hash-lease'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport type { Payload, WithSources } from '@xyo-network/payload-model'\n\nimport type { DomainRegistrationLease } from '../../DomainRegistration/index.ts'\nimport { asDomainRegistrationLeaseWithSources, DomainRegistrationLeaseSchema } from '../../DomainRegistration/index.ts'\n\nexport type Estimate = [\n BoundWitness,\n WithSources<HashLeaseEstimate>,\n WithSources<DomainRegistrationLease>,\n]\n\n/**\n * Parses a generic array of payloads into estimates\n * @param payloads An array of payloads\n * @returns Parsed estimates\n */\nexport const parseEstimatesFromArray = async (payloads?: Payload[]): Promise<Estimate[]> => {\n if (!payloads) return []\n const bws = payloads\n // Find all bound witnesses\n .filter(isBoundWitness)\n // that have the required estimate payloads\n .filter(hasEstimatePayloads) ?? []\n if (bws.length === 0) return []\n const hashMap = await PayloadBuilder.toAllHashMap(payloads)\n return bws.map<Estimate | undefined>((bw) => {\n const hashLeaseEstimate = getPayloadBySchemaFromBoundWitness<WithSources<HashLeaseEstimate>>(\n bw,\n HashLeaseEstimateSchema,\n hashMap,\n asHashLeaseEstimate,\n )\n if (!hashLeaseEstimate) return\n const domainLease = getPayloadBySchemaFromBoundWitness<WithSources<DomainRegistrationLease>>(\n bw,\n DomainRegistrationLeaseSchema,\n hashMap,\n asDomainRegistrationLeaseWithSources,\n )\n if (!domainLease) return\n return [bw, hashLeaseEstimate, domainLease]\n }).filter(exists)\n}\n\n/**\n * Tests if a BoundWitness has the required estimate payloads\n * @param bw The BoundWitness to check for estimate payloads\n * @returns True if the BoundWitness has the required estimate payloads, false otherwise\n */\nconst hasEstimatePayloads = (bw: BoundWitness): boolean => {\n return bw.payload_schemas.includes(DomainRegistrationLeaseSchema)\n && bw.payload_schemas.includes(HashLeaseEstimateSchema)\n}\n\n/**\n * Finds the first instance of a payload in a BoundWitness by schema\n * @param bw The BoundWitness to extract the payload from\n * @param schema The schema of the payload to extract\n * @param hashMap The hashmap of the payloads\n * @param identity An identity function to check if the payload is of the correct type\n * @returns The payload if it exists or undefined\n */\nconst getPayloadBySchemaFromBoundWitness = <T extends Payload = Payload>(\n bw: BoundWitness,\n schema: string,\n hashMap: Awaited<ReturnType<typeof PayloadBuilder.toHashMap>>,\n identity: (payload: Payload) => T,\n): T | undefined => {\n const schemaIndex = bw.payload_schemas.indexOf(schema)\n if (schemaIndex === -1) return\n const hash = bw.payload_hashes[schemaIndex]\n return findAs([hashMap[hash]], identity)\n}\n","import type { Address } from '@xylabs/hex'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { Payload, WithSources } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType, isPayloadOfSchemaTypeWithSources } from '@xyo-network/payload-model'\n\nimport type { DomainFields } from '../Domain/index.ts'\nimport { DomainSchema } from '../Domain/index.ts'\n\nexport const DomainRegistrationSchema = `${DomainSchema}.registration` as const\nexport type DomainRegistrationSchema = typeof DomainRegistrationSchema\n\nexport interface DomainRegistrationFields extends DomainFields {\n /**\n * The registrant of the domain\n */\n registrant: Address[]\n /**\n * The registrar of the domain\n */\n registrar: Address[]\n}\n\n/**\n * Delegation of a domain to a registrar by a registrant\n */\nexport type DomainRegistration = Payload<DomainRegistrationFields, DomainRegistrationSchema>\n\n/**\n * Identity function for DomainRegistration payload\n */\nexport const isDomainRegistration = isPayloadOfSchemaType<DomainRegistration>(DomainRegistrationSchema)\nexport const asDomainRegistration = AsObjectFactory.create<DomainRegistration>(isDomainRegistration)\nexport const asOptionalDomainRegistration = AsObjectFactory.createOptional<DomainRegistration>(isDomainRegistration)\n\n/**\n * Identity function for DomainRegistration payload with sources\n */\nexport const isDomainRegistrationWithSources = isPayloadOfSchemaTypeWithSources<WithSources<DomainRegistration>>(DomainRegistrationSchema)\nexport const asDomainRegistrationWithSources = AsObjectFactory.create<WithSources<DomainRegistration>>(isDomainRegistrationWithSources)\nexport const asOptionalDomainRegistrationWithSources = AsObjectFactory.createOptional<WithSources<DomainRegistration>>(isDomainRegistrationWithSources)\n","import { AsObjectFactory } from '@xylabs/object'\nimport type { Payload, WithSources } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType, isPayloadOfSchemaTypeWithSources } from '@xyo-network/payload-model'\n\nexport type DomainSchema = 'network.xyo.ns.domain'\nexport const DomainSchema: DomainSchema = 'network.xyo.ns.domain'\n\n/**\n * The supported TLDs for XNS\n */\nexport type TopLevelDomain = 'xyo'\n\n/**\n * The fields for a domain record\n */\nexport interface DomainFields {\n /**\n * The XNS domain of the record\n */\n domain: string\n\n /**\n * The Top-Level Domain of the domain\n */\n tld: TopLevelDomain\n}\n\n/**\n * A domain record is a record of a domain\n */\nexport type Domain = Payload<DomainFields, DomainSchema>\n\n/**\n * Identity function for Domain payload\n */\nexport const isDomain = isPayloadOfSchemaType<Domain>(DomainSchema)\nexport const asDomain = AsObjectFactory.create<Domain>(isDomain)\nexport const asOptionalDomain = AsObjectFactory.createOptional<Domain>(isDomain)\n\n/**\n * Identity function for Domain payload with sources\n */\nexport const isDomainWithSources = isPayloadOfSchemaTypeWithSources<WithSources<Domain>>(DomainSchema)\nexport const asDomainWithSources = AsObjectFactory.create<WithSources<Domain>>(isDomainWithSources)\nexport const asOptionalDomainWithSources = AsObjectFactory.createOptional<WithSources<Domain>>(isDomainWithSources)\n","import { AsObjectFactory } from '@xylabs/object'\nimport type { Payload, WithSources } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType, isPayloadOfSchemaTypeWithSources } from '@xyo-network/payload-model'\n\nimport type { DurationFields } from '../Duration/index.ts'\nimport type { DomainFields } from './Domain.ts'\n\nexport type DomainLeaseSchema = 'network.xyo.ns.domain.lease'\nexport const DomainLeaseSchema: DomainLeaseSchema = 'network.xyo.ns.domain.lease'\n\n/**\n * A domain is leased for a duration\n */\nexport interface DomainLeaseFields extends DomainFields, DurationFields {}\n\n/**\n * A domain lease is a record of a domain and the duration it is leased for\n */\nexport type DomainLease = Payload<DomainLeaseFields, DomainLeaseSchema>\n\n/**\n * Identity function for DomainLease payload\n */\nexport const isDomainLease = isPayloadOfSchemaType<DomainLease>(DomainLeaseSchema)\nexport const asDomainLease = AsObjectFactory.create<DomainLease>(isDomainLease)\nexport const asOptionalDomainLease = AsObjectFactory.createOptional<DomainLease>(isDomainLease)\n\n/**\n * Identity function for DomainLease payload with sources\n */\nexport const isDomainLeaseWithSources = isPayloadOfSchemaTypeWithSources<WithSources<DomainLease>>(DomainLeaseSchema)\nexport const asDomainLeaseWithSources = AsObjectFactory.create<WithSources<DomainLease>>(isDomainLeaseWithSources)\nexport const asOptionalDomainLeaseWithSources = AsObjectFactory.createOptional<WithSources<DomainLease>>(isDomainLeaseWithSources)\n","import { AsObjectFactory } from '@xylabs/object'\nimport type { Payload, WithSources } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType, isPayloadOfSchemaTypeWithSources } from '@xyo-network/payload-model'\n\nimport type { DurationFields } from '../Duration/index.ts'\nimport type { DomainRegistrationFields } from './DomainRegistration.ts'\nimport { DomainRegistrationSchema } from './DomainRegistration.ts'\n\nexport const DomainRegistrationLeaseSchema = `${DomainRegistrationSchema}.lease` as const\nexport type DomainRegistrationLeaseSchema = typeof DomainRegistrationLeaseSchema\n\nexport interface DomainRegistrationLeaseFields extends DomainRegistrationFields, DurationFields {}\n\n/**\n * Temporal delegation of a domain to a registrar by a registrant\n */\nexport type DomainRegistrationLease = Payload<DomainRegistrationLeaseFields, DomainRegistrationLeaseSchema>\n\n/**\n * Identity function for DomainRegistrationLease payload\n */\nexport const isDomainRegistrationLease = isPayloadOfSchemaType<DomainRegistrationLease>(DomainRegistrationLeaseSchema)\nexport const asDomainRegistrationLease = AsObjectFactory.create<DomainRegistrationLease>(isDomainRegistrationLease)\nexport const asOptionalDomainRegistrationLease = AsObjectFactory.createOptional<DomainRegistrationLease>(isDomainRegistrationLease)\n\n/**\n * Identity function for DomainRegistrationLease payload with sources\n */\nexport const isDomainRegistrationLeaseWithSources = isPayloadOfSchemaTypeWithSources<WithSources<DomainRegistrationLease>>(DomainRegistrationLeaseSchema)\nexport const asDomainRegistrationLeaseWithSources = AsObjectFactory.create<WithSources<DomainRegistrationLease>>(isDomainRegistrationLeaseWithSources)\nexport const asOptionalDomainRegistrationLeaseWithSources = AsObjectFactory\n .createOptional<WithSources<DomainRegistrationLease>>(isDomainRegistrationLeaseWithSources)\n\n/**\n * @deprecated Use isDomainRegistrationLeaseWithSources instead\n */\nexport const isDomainRegistrationLeaseSources = isDomainRegistrationLeaseWithSources\n","export type DNSQueryOpcode = 0 | 1 | 2 | 4 | 5 | 6 // Supported opcodes as numeric values\n\n// Optional: Add a more descriptive union type for the opcodes.\nexport type DNSQueryOpcodeName = 'QUERY' | 'IQUERY' | 'STATUS' | 'NOTIFY' | 'UPDATE' | 'DSO'\n\nexport const DNSQueryOpcodes: Record<DNSQueryOpcodeName, DNSQueryOpcode> = {\n QUERY: 0,\n IQUERY: 1,\n STATUS: 2,\n NOTIFY: 4,\n UPDATE: 5,\n DSO: 6,\n}\n","export type DNSRcode = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 16 | 17 | 18\n\nexport type DNSRcodeName =\n | 'NOERROR'\n | 'FORMERR'\n | 'SERVFAIL'\n | 'NXDOMAIN'\n | 'NOTIMP'\n | 'REFUSED'\n | 'YXDOMAIN'\n | 'YXRRSET'\n | 'NXRRSET'\n | 'NOTAUTH'\n | 'NOTZONE'\n | 'BADSIG'\n | 'BADKEY'\n | 'BADTIME'\n\nexport const DNSRcodes: Readonly<Record<DNSRcodeName, DNSRcode>> = {\n NOERROR: 0,\n FORMERR: 1,\n SERVFAIL: 2,\n NXDOMAIN: 3,\n NOTIMP: 4,\n REFUSED: 5,\n YXDOMAIN: 6,\n YXRRSET: 7,\n NXRRSET: 8,\n NOTAUTH: 9,\n NOTZONE: 10,\n BADSIG: 16,\n BADKEY: 17,\n BADTIME: 18,\n}\n","/* eslint-disable @typescript-eslint/member-ordering */\n\n// An attempt to match compatibility with the RFC 8427 (Representing DNS Messages in JSON)\n// https://www.rfc-editor.org/rfc/rfc8427\n// and Google/CloudFlare's DNS over HTTPS (DoH) standard\n// https://developers.cloudflare.com/1.1.1.1/encryption/dns-over-https/make-api-requests/dns-json/\n\nimport type { DNSQueryOpcode } from './OperationCodes.ts'\nimport { DNSQueryOpcodes } from './OperationCodes.ts'\nimport type { DNSRcode } from './ResponseCodes.ts'\nimport { DNSRcodes } from './ResponseCodes.ts'\n\n// NOTE: The RFC says `Boolean` but uses 0/1 for the values. DNS over HTTPS (DoH) uses `true`/`false`.\nexport type NumericBoolean = 0 | 1 | true | false\nexport type NumericBooleanFalsy = 0 | false\nexport type NumericBooleanTruthy = 1 | true\n\nexport interface DNSHeader {\n /**\n * Transaction ID, typically a random number. Integer whose value is 0 to 65535\n */\n ID?: number\n /**\n * Query/Response Flag (0 = Query, 1 = Response)\n */\n QR?: NumericBoolean\n /**\n * Operation Code (0 for standard query)\n */\n Opcode?: DNSQueryOpcode\n /**\n * Authoritative Answer (set in response)\n */\n AA?: NumericBoolean\n /**\n * Truncated Flag\n */\n TC?: NumericBoolean // Truncation\n /**\n * Recursion Desired\n */\n RD?: NumericBoolean // Recursion Desired (set in query)\n /**\n * Response Code (0 for no error, non-0 for errors)\n */\n RCODE?: DNSRcode\n /**\n * Number of questions in the query (usually 1)\n */\n QDCOUNT?: number\n /**\n * Number of answer records in the response\n */\n ANCOUNT?: number\n /**\n * Number of authority records in the response\n */\n NSCOUNT?: number\n /**\n * Number of additional records in the response\n */\n ARCOUNT?: number\n}\n\nexport interface DNSRequestHeader extends DNSHeader {\n QR: NumericBooleanFalsy // Query/Response Flag (0 = Query)\n Opcode: DNSQueryOpcode // Operation Code (0 for standard query)\n AA: NumericBooleanFalsy // Authoritative Answer (0 in query)\n TC: NumericBooleanFalsy // Truncation (0 for non-truncated)\n RCODE: typeof DNSRcodes.NOERROR // Response Code (always 0 in query)\n ANCOUNT: 0 // Number of answer records (always 0 in query)\n NSCOUNT: 0 // Number of authority records (always 0 in query)\n ARCOUNT: 0 // Number of additional records (always 0 in query)\n}\n\nexport const StandardRequestHeader: Readonly<DNSRequestHeader> = {\n ID: 0,\n QR: 0, // Query/Response Flag (0 = Query)\n Opcode: DNSQueryOpcodes.QUERY, // Operation Code (0 for standard query)\n AA: 0, // Authoritative Answer (0 in query)\n TC: 0, // Truncation (0 for non-truncated)\n RD: 1, // Recursion Desired (1 if recursion is requested)\n RCODE: DNSRcodes.NOERROR, // Response Code (always 0 in query)\n QDCOUNT: 1,\n ANCOUNT: 0,\n NSCOUNT: 0,\n ARCOUNT: 0,\n}\n\nexport interface DNSResponseHeader extends DNSHeader {\n QR: NumericBooleanTruthy // Query/Response Flag (1 = Response)\n Opcode: DNSQueryOpcode // Operation Code (0 for standard query)\n AA: NumericBoolean // Authoritative Answer (1 if the response is authoritative)\n TC: NumericBoolean // Truncation (1 if the message is truncated)\n RA: NumericBoolean // Recursion Available (1 if the server supports recursion)\n}\n","// https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-4\n\nexport type DNSResourceRecordType =\n | 'A'\n | 'NS'\n | 'MD'\n | 'MF'\n | 'CNAME'\n | 'SOA'\n | 'MB'\n | 'MG'\n | 'MR'\n | 'NULL'\n | 'WKS'\n | 'PTR'\n | 'HINFO'\n | 'MINFO'\n | 'MX'\n | 'TXT'\n | 'RP'\n | 'AFSDB'\n | 'X25'\n | 'ISDN'\n | 'RT'\n | 'NSAP'\n | 'NSAP-PTR'\n | 'SIG'\n | 'KEY'\n | 'PX'\n | 'GPOS'\n | 'AAAA'\n | 'LOC'\n | 'NXT'\n | 'EID'\n | 'NIMLOC'\n | 'SRV'\n | 'ATMA'\n | 'NAPTR'\n | 'KX'\n | 'CERT'\n | 'A6'\n | 'DNAME'\n | 'SINK'\n | 'OPT'\n | 'APL'\n | 'DS'\n | 'SSHFP'\n | 'IPSECKEY'\n | 'RRSIG'\n | 'NSEC'\n | 'DNSKEY'\n | 'DHCID'\n | 'NSEC3'\n | 'NSEC3PARAM'\n | 'TLSA'\n | 'SMIMEA'\n | 'HIP'\n | 'NINFO'\n | 'RKEY'\n | 'TALINK'\n | 'CDS'\n | 'CDNSKEY'\n | 'OPENPGPKEY'\n | 'CSYNC'\n | 'ZONEMD'\n | 'SVCB'\n | 'HTTPS'\n | 'SPF'\n | 'UINFO'\n | 'UID'\n | 'GID'\n | 'UNSPEC'\n | 'NID'\n | 'L32'\n | 'L64'\n | 'LP'\n | 'EUI48'\n | 'EUI64'\n | 'NXNAME'\n | 'TKEY'\n | 'TSIG'\n | 'IXFR'\n | 'AXFR'\n | 'MAILB'\n | 'MAILA'\n | '*'\n | 'URI'\n | 'CAA'\n | 'AVC'\n | 'DOA'\n | 'AMTRELAY'\n | 'RESINFO'\n | 'WALLET'\n | 'CLA'\n | 'IPN'\n | 'TA'\n | 'DLV'\n // NOTE: Custom types here\n | 'XYOA'\n | 'XYOH'\n\nexport const DNSResourceRecordTypes: Readonly<Record<DNSResourceRecordType, number>> = {\n 'A': 1, // a host address\n 'NS': 2, // an authoritative name server\n 'MD': 3, // a mail destination (OBSOLETE - use MX)\n 'MF': 4, // a mail forwarder (OBSOLETE - use MX)\n 'CNAME': 5, // the canonical name for an alias\n 'SOA': 6, // marks the start of a zone of authority\n 'MB': 7, // a mailbox domain name (EXPERIMENTAL)\n 'MG': 8, // a mail group member (EXPERIMENTAL)\n 'MR': 9, // a mail rename domain name (EXPERIMENTAL)\n 'NULL': 10, // a null RR (EXPERIMENTAL)\n 'WKS': 11, // a well known service description\n 'PTR': 12, // a domain name pointer\n 'HINFO': 13, // host information\n 'MINFO': 14, // mailbox or mail list information\n 'MX': 15, // mail exchange\n 'TXT': 16, // text strings\n 'RP': 17, // for Responsible Person\n 'AFSDB': 18, // for AFS Data Base location\n 'X25': 19, // for X.25 PSDN address\n 'ISDN': 20, // for ISDN address\n 'RT': 21, // for Route Through\n 'NSAP': 22, // for NSAP address, NSAP style A record (DEPRECATED)\n 'NSAP-PTR': 23, // for domain name pointer, NSAP style (DEPRECATED)\n 'SIG': 24, // for security signature\n 'KEY': 25, // for security key\n 'PX': 26, // X.400 mail mapping information\n 'GPOS': 27, // Geographical Position\n 'AAAA': 28, // IP6 Address\n 'LOC': 29, // Location Information\n 'NXT': 30, // Next Domain (OBSOLETE)\n 'EID': 31, // Endpoint Identifier\n 'NIMLOC': 32, // Nimrod Locator\n 'SRV': 33, // Server Selection\n 'ATMA': 34, // ATM Address\n 'NAPTR': 35, // Naming Authority Pointer\n 'KX': 36, // Key Exchanger\n 'CERT': 37, // CERT\n 'A6': 38, // A6 (OBSOLETE - use AAAA)\n 'DNAME': 39, // DNAME\n 'SINK': 40, // SINK\n 'OPT': 41, // OPT\n 'APL': 42, // APL\n 'DS': 43, // Delegation Signer\n 'SSHFP': 44, // SSH Key Fingerprint\n 'IPSECKEY': 45, // IPSECKEY\n 'RRSIG': 46, // RRSIG\n 'NSEC': 47, // NSEC\n 'DNSKEY': 48, // DNSKEY\n 'DHCID': 49, // DHCID\n 'NSEC3': 50, // NSEC3\n 'NSEC3PARAM': 51, // NSEC3PARAM\n 'TLSA': 52, // TLSA\n 'SMIMEA': 53, // S/MIME cert association\n 'HIP': 55, // Host Identity Protocol\n 'NINFO': 56, // NINFO\n 'RKEY': 57, // RKEY\n 'TALINK': 58, // Trust Anchor LINK\n 'CDS': 59, // Child DS\n 'CDNSKEY': 60, // DNSKEY(s) the Child wants reflected in DS\n 'OPENPGPKEY': 61, // OpenPGP Key\n 'CSYNC': 62, // Child-To-Parent Synchronization\n 'ZONEMD': 63, // Message Digest Over Zone Data\n 'SVCB': 64, // General-purpose service binding\n 'HTTPS': 65, // SVCB-compatible type for use with HTTP\n 'SPF': 99,\n 'UINFO': 100,\n 'UID': 101,\n 'GID': 102,\n 'UNSPEC': 103,\n 'NID': 104,\n 'L32': 105,\n 'L64': 106,\n 'LP': 107,\n 'EUI48': 108, // an EUI-48 address\n 'EUI64': 109, // an EUI-64 address\n 'NXNAME': 128, // NXDOMAIN indicator for Compact Denial of Existence\n 'TKEY': 249, // Transaction Key\n 'TSIG': 250, // Transaction Signature\n 'IXFR': 251, // incremental transfer\n 'AXFR': 252, // transfer of an entire zone\n 'MAILB': 253, // mailbox-related RRs (MB, MG or MR)\n 'MAILA': 254, // mail agent RRs (OBSOLETE - see MX)\n '*': 255, // A request for some or all records the server has available\n 'URI': 256, // URI\n 'CAA': 257, // Certification Authority Restriction\n 'AVC': 258, // Application Visibility and Control\n 'DOA': 259, // Digital Object Architecture\n 'AMTRELAY': 260, // Automatic Multicast Tunneling Relay\n 'RESINFO': 261, // Resolver Information as Key/Value Pairs\n 'WALLET': 262, // Public wallet address\n 'CLA': 263, // BP Convergence Layer Adapter\n 'IPN': 264, // BP Node Number\n 'TA': 32_768, // DNSSEC Trust Authorities\n 'DLV': 32_769, // DNSSEC Lookaside Validation (OBSOLETE)\n\n // NOTE: Custom types here chosen within the Private Use Range\n // https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-4\n // https://www.rfc-editor.org/rfc/rfc5226\n // as, per the RFC, the Private Use Range is reserved\n // \"For private or local use only, with the type and\n // purpose defined by the local site. No attempt is made to\n // prevent multiple sites from using the same value in\n // different (and incompatible) ways. There is no need for\n // IANA to review such assignments (since IANA does not record\n // them) and assignments are not generally useful for broad\n // interoperability. It is the responsibility of the sites\n // making use of the Private Use range to ensure that no\n // conflicts occur (within the intended scope of use).\"\n // If we want to apply for a custom reserved code later\n // on, once the usage is proven enough we can absolutely\n // do that.\n 'XYOA': 65_432, // XYO Address\n 'XYOH': 65_433, // XYO Hash\n}\n\nexport type DNSResourceRecordTypeValue = (typeof DNSResourceRecordTypes)[keyof typeof DNSResourceRecordTypes]\n\nexport const findDNSResourceRecordTypesByValue = (value: DNSResourceRecordTypeValue): DNSResourceRecordType | undefined => {\n // Iterate through the keys of the record\n for (const key in DNSResourceRecordTypes) {\n const resourceRecordType = key as DNSResourceRecordType\n if (DNSResourceRecordTypes[resourceRecordType] === value) {\n return resourceRecordType // Return the key if the value matches\n }\n }\n return undefined // Return undefined if no matching value is found\n}\n","/* eslint-disable @typescript-eslint/member-ordering */\nimport type { DNSRequestHeader } from './Header.ts'\nimport { StandardRequestHeader } from './Header.ts'\nimport type { DNSResourceRecordTypeValue } from './ResourceRecord.ts'\nimport { DNSResourceRecordTypes } from './ResourceRecord.ts'\n\nexport interface DNSQuestion {\n name: string // The domain name that was queried\n type: DNSResourceRecordTypeValue // The record type (e.g., 1 for A record)\n class?: number // Query Class (typically 1 for IN - Internet)\n}\n\nexport interface DNSRequestFields extends DNSRequestHeader {\n Question: DNSQuestion[]\n}\n\n/**\n * Helper for generating a DNS request for a given domain and record type\n * @param domain The domain to query\n * @param type The record type to query\n * @returns A DNS request\n */\nexport const getRequestFor = (domain: string, type: DNSResourceRecordTypeValue = DNSResourceRecordTypes.A): DNSRequestFields => {\n return {\n ...StandardRequestHeader,\n ID: getRandomId(),\n Question: [{\n name: domain, type, class: 1,\n }],\n }\n}\n\n/**\n * Used to generate a random ID for a DNS request\n * @returns A random number between 0 and 65,535\n */\nexport const getRandomId = (): number => {\n return Math.floor(Math.random() * 65_536) // Math.random() generates a number between 0 and 1, multiply by 65536 to get the range 0-65535\n}\n","export type DNSSchema = 'network.xyo.dns'\nexport const DNSSchema: DNSSchema = 'network.xyo.dns'\n","import type { ModuleIdentifier } from '@xyo-network/module-model'\nimport type { WitnessConfig } from '@xyo-network/witness-model'\n\nimport type { DNSResourceRecordType } from '../types/index.ts'\nimport { DNSSchema } from './Schema.ts'\n\nexport type DNSWitnessConfigSchema = `${DNSSchema}.witness.config`\nexport const DNSWitnessConfigSchema: DNSWitnessConfigSchema = `${DNSSchema}.witness.config`\n\nexport type DNSWitnessConfig = WitnessConfig<{\n /**\n * The address record index diviner to be used to determine the address record index\n */\n addressRecordIndexDiviner?: ModuleIdentifier\n /**\n * The hash record index diviner to be used to determine the hash record index\n */\n hashRecordIndexDiviner?: ModuleIdentifier\n /**\n * The config schema for the DNS witness\n */\n schema: DNSWitnessConfigSchema\n /**\n * If supplied, the DNS witness will only support the specified resource record types\n */\n supportedResources?: DNSResourceRecordType[]\n}>\n","import { AsObjectFactory } from '@xylabs/object'\nimport type { Payload, WithSources } from '@xyo-network/payload-model'\nimport {\n isPayloadOfSchemaType,\n isPayloadOfSchemaTypeWithSources,\n} from '@xyo-network/payload-model'\n\nimport type { DNSRequestFields, DNSResourceRecordTypeValue } from '../../types/index.ts'\nimport { DNSResourceRecordTypes, getRequestFor } from '../../types/index.ts'\nimport { DNSSchema } from '../Schema.ts'\n\n/**\n * The fields of a DNSRequest payload\n */\nexport type DNSRequest = Payload<DNSRequestFields, DNSSchema>\n\n/**\n * Identity function for determining if an object is a DNSRequest payload\n */\nexport const isDNSRequest = isPayloadOfSchemaType<DNSRequest>(DNSSchema)\nexport const asDNSRequest = AsObjectFactory.create<DNSRequest>(isDNSRequest)\nexport const asOptionalDNSRequest = AsObjectFactory.createOptional<DNSRequest>(isDNSRequest)\n\n/**\n * Identity function for determining if an object is a DNSRequest payload with sources\n */\nexport const isDNSRequestWithSources = isPayloadOfSchemaTypeWithSources<WithSources<DNSRequest>>(DNSSchema)\nexport const asDNSRequestWithSources = AsObjectFactory.create<WithSources<DNSRequest>>(isDNSRequestWithSources)\nexport const asOptionalDNSRequestWithSources = AsObjectFactory.createOptional<WithSources<DNSRequest>>(isDNSRequestWithSources)\n\n/**\n * Helper for generating a DNSRequest payload for a given domain and record type\n * @param domain The domain to query\n * @param type The record type to query\n * @returns A DNSRequest payload\n */\nexport const getDnsRequestFor = (domain: string, type: DNSResourceRecordTypeValue = DNSResourceRecordTypes.A): DNSRequest => {\n return { ...getRequestFor(domain, type), schema: DNSSchema }\n}\n","import { AsObjectFactory } from '@xylabs/object'\nimport type { PayloadWithSources, WithSources } from '@xyo-network/payload-model'\nimport {\n isPayloadOfSchemaType,\n isPayloadOfSchemaTypeWithSources,\n} from '@xyo-network/payload-model'\n\nimport type { DNSResponseFields } from '../../types/index.ts'\nimport { DNSSchema } from '../Schema.ts'\n\n/**\n * The fields of a DNSResponse payload\n */\nexport type DNSResponse = PayloadWithSources<DNSResponseFields, DNSSchema>\n\n/**\n * Identity function for determining if an object is a DNSResponse payload\n */\nexport const isDNSResponse = isPayloadOfSchemaType<DNSResponse>(DNSSchema)\nexport const asDNSResponse = AsObjectFactory.create<DNSResponse>(isDNSResponse)\nexport const asOptionalDNSResponse = AsObjectFactory.createOptional<DNSResponse>(isDNSResponse)\n\n/**\n * Identity function for determining if an object is a DNSResponse payload with sources\n */\nexport const isDNSResponseWithSources = isPayloadOfSchemaTypeWithSources<DNSResponse>(DNSSchema)\nexport const asDNSResponseWithSources = AsObjectFactory.create<WithSources<DNSResponse>>(isDNSResponseWithSources)\nexport const asOptionalDNSResponseWithSources = AsObjectFactory.createOptional<WithSources<DNSResponse>>(isDNSResponseWithSources)\n","import type { BoundWitness } from '@xyo-network/boundwitness-model'\nimport { BoundWitnessValidator } from '@xyo-network/boundwitness-validator'\n\n// BW Validations\nexport const validateBoundWitness = async (recordBw: BoundWitness, requiredSchemas: string[] = []): Promise<boolean> => {\n // If the BW does not include all of the required schemas\n if (!requiredSchemas.every(requiredSchema => recordBw.payload_schemas.includes(requiredSchema))) return false\n // If the BW is valid (does not include any errors)\n const validator = new BoundWitnessValidator(recordBw)\n const errors = await validator.validate()\n return errors.length === 0\n}\n","import type { BoundWitness } from '@xyo-network/boundwitness-model'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport type { Payload } from '@xyo-network/payload-model'\n\nimport type { DurationFields } from '../Duration.ts'\n\n// BW & Record Validations\nexport const validateBoundWitnessAndDuration = async (recordBw: BoundWitness, recordPayload: Payload<DurationFields>): Promise<boolean> => {\n if (!(await recordIsInBoundWitness(recordBw, recordPayload))) return false\n return (recordIsTemporallyValidToBoundWitness(recordBw, recordPayload))\n}\n\nconst recordIsInBoundWitness = async (recordBw: BoundWitness, recordPayload: Payload): Promise<boolean> => {\n const hash = await PayloadBuilder.dataHash(recordPayload)\n return recordBw.payload_hashes.includes(hash)\n}\n\n// TODO: Use sequence for this?\nconst recordIsTemporallyValidToBoundWitness = (_recordBw: BoundWitness, _recordPayload: Payload<DurationFields>): boolean => {\n /* const { timestamp } = recordBw\n const { exp } = recordPayload\n return exp > timestamp */\n return true\n}\n","import type { Payload } from '@xyo-network/payload-model'\n\nimport type { DurationFields } from '../Duration.ts'\n\n// Record Validations\nexport const validateDuration = (recordPayload: Payload<DurationFields>): boolean => {\n // if (!isValidAddress(recordPayload)) return false\n return isWithinDelegatedTimeframe(recordPayload)\n}\n\nexport const isWithinDelegatedTimeframe = (recordPayload: Payload<DurationFields>, now = Date.now()): boolean => {\n // nbf < now < exp\n return recordPayload.nbf < now && now < recordPayload.exp\n}\n","import type { BoundWitness } from '@xyo-network/boundwitness-model'\nimport type { Payload } from '@xyo-network/payload-model'\n\nimport type { DurationFields } from '../Duration.ts'\nimport { validateBoundWitness } from './validateBoundWitness.ts'\nimport { validateBoundWitnessAndDuration } from './validateBoundWitnessAndDuration.ts'\nimport { validateDuration } from './validateDuration.ts'\n\nexport const validateBoundWitnessWithDuration = async (recordBw: BoundWitness, recordPayload: Payload<DurationFields>): Promise<boolean> => {\n // Validate the BW\n if (!(await validateBoundWitness(recordBw, [recordPayload.schema]))) return false\n // Validate the record\n if (!validateDuration(recordPayload)) return false\n // Validate the record relative to the BW\n return (await validateBoundWitnessAndDuration(recordBw, recordPayload))\n}\n","import type { Hash } from '@xylabs/hex'\nimport type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nimport type { DomainFields } from '../Domain/index.ts'\n\nexport type HashRecordSchema = 'network.xyo.ns.record.hash'\nexport const HashRecordSchema: HashRecordSchema = 'network.xyo.ns.record.hash'\n\nexport interface HashRecordFields extends DomainFields {\n /**\n * The hash the record points to\n */\n hash: Hash[]\n}\n\n/**\n * An hash record points a domain to an hash\n */\nexport type HashRecord = Payload<HashRecordFields, HashRecordSchema>\n\nexport const isHashRecord = isPayloadOfSchemaType<HashRecord>(HashRecordSchema)\n"],"mappings":";AAEA,SAAS,6BAA6B;AAK/B,IAAM,sBAA2C;AAcjD,IAAM,kBAAkB,sBAAqC,mBAAmB;;;ACrBhF,IAAM,yDACT;;;ACKG,IAAM,mDAGT;AAAA,EACF,GAAG;AAAA,IACD,MAAM;AAAA,IAAK,QAAQ;AAAA,IAAwD,OAAO;AAAA,EACpF;AAAA,EACA,GAAG;AAAA,IACD,MAAM;AAAA,IAAK,QAAQ;AAAA,IAAwD,OAAO;AAAA,EACpF;AAAA,EACA,GAAG;AAAA,IACD,MAAM;AAAA,IAAK,QAAQ;AAAA,IAAwD,OAAO;AAAA,EACpF;AAAA,EACA,GAAG;AAAA,IACD,MAAM;AAAA,IAAK,QAAQ;AAAA,IAAwD,O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,IAAM,uBAAuB,OAAO,UAAwB,kBAA4B,CAAC,MAAwB;AAEtH,MAAI,CAAC,gBAAgB,MAAM,oBAAkB,SAAS,gBAAgB,SAAS,cAAc,CAAC,EAAG,QAAO;AAExG,QAAM,YAAY,IAAI,sBAAsB,QAAQ;AACpD,QAAM,SAAS,MAAM,UAAU,SAAS;AACxC,SAAO,OAAO,WAAW;AAC3B;;;ACVA,SAAS,kBAAAE,uBAAsB;AAMxB,IAAM,kCAAkC,OAAO,UAAwB,kBAA6D;AACzI,MAAI,CAAE,MAAM,uBAAuB,UAAU,aAAa,EAAI,QAAO;AACrE,SAAQ,sCAAsC,UAAU,aAAa;AACvE;AAEA,IAAM,yBAAyB,OAAO,UAAwB,kBAA6C;AACzG,QAAM,OAAO,MAAMA,gBAAe,SAAS,aAAa;AACxD,SAAO,SAAS,eAAe,SAAS,IAAI;AAC9C;AAGA,IAAM,wCAAwC,CAAC,WAAyB,mBAAqD;AAI3H,SAAO;AACT;;;AClBO,IAAM,mBAAmB,CAAC,kBAAoD;AAEnF,SAAO,2BAA2B,aAAa;AACjD;AAEO,IAAM,6BAA6B,CAAC,eAAwC,MAAM,KAAK,IAAI,MAAe;AAE/G,SAAO,cAAc,MAAM,OAAO,MAAM,cAAc;AACxD;;;ACLO,IAAM,mCAAmC,OAAO,UAAwB,kBAA6D;AAE1I,MAAI,CAAE,MAAM,qBAAqB,UAAU,CAAC,cAAc,MAAM,CAAC,EAAI,QAAO;AAE5E,MAAI,CAAC,iBAAiB,aAAa,EAAG,QAAO;AAE7C,SAAQ,MAAM,gCAAgC,UAAU,aAAa;AACvE;;;ACbA,SAAS,yBAAAC,8BAA6B;AAK/B,IAAM,mBAAqC;AAc3C,IAAM,eAAeA,uBAAkC,gBAAgB;","names":["isPayloadOfSchemaType","isPayloadOfSchemaType","AsObjectFactory","isPayloadOfSchemaType","isPayloadOfSchemaTypeWithSources","isPayloadOfSchemaType","isPayloadOfSchemaTypeWithSources","AsObjectFactory","isPayloadOfSchemaType","isPayloadOfSchemaTypeWithSources","isPayloadOfSchemaType","AsObjectFactory","isPayloadOfSchemaTypeWithSources","AsObjectFactory","isPayloadOfSchemaType","isPayloadOfSchemaTypeWithSources","isPayloadOfSchemaType","AsObjectFactory","isPayloadOfSchemaTypeWithSources","AsObjectFactory","isPayloadOfSchemaType","isPayloadOfSchemaTypeWithSources","isPayloadOfSchemaType","AsObjectFactory","isPayloadOfSchemaTypeWithSources","AsObjectFactory","isPayloadOfSchemaType","isPayloadOfSchemaTypeWithSources","isPayloadOfSchemaType","AsObjectFactory","isPayloadOfSchemaTypeWithSources","PayloadBuilder","isPayloadOfSchemaType"]}
|
|
1
|
+
{"version":3,"sources":["../../src/Address/Payload.ts","../../src/diviner/DomainLeaseEstimateDiviner/Schema.ts","../../src/diviner/DomainLeaseEstimateDiviner/ErrorDetails/ErrorCodes.ts","../../src/diviner/DomainLeaseEstimateDiviner/ErrorDetails/Payload.ts","../../src/diviner/lib/parseEstimatesFromArray.ts","../../src/DomainRegistration/DomainRegistration.ts","../../src/Domain/Domain.ts","../../src/Domain/DomainLease.ts","../../src/DomainRegistration/DomainRegistrationLease.ts","../../src/DNS/types/OperationCodes.ts","../../src/DNS/types/ResponseCodes.ts","../../src/DNS/types/Header.ts","../../src/DNS/types/ResourceRecord.ts","../../src/DNS/types/Request.ts","../../src/DNS/Witness/Schema.ts","../../src/DNS/Witness/Config.ts","../../src/DNS/Witness/Payload/Request.ts","../../src/DNS/Witness/Payload/Response.ts","../../src/Duration/validation/validateBoundWitness.ts","../../src/Duration/validation/validateBoundWitnessAndDuration.ts","../../src/Duration/validation/validateDuration.ts","../../src/Duration/validation/validateBoundWitnessWithDuration.ts","../../src/Hash/Payload.ts"],"sourcesContent":["import type { Address } from '@xylabs/hex'\nimport type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nimport type { DomainFields } from '../Domain/index.ts'\n\nexport type AddressRecordSchema = 'network.xyo.ns.record.address'\nexport const AddressRecordSchema: AddressRecordSchema = 'network.xyo.ns.record.address'\n\nexport interface AddressRecordFields extends DomainFields {\n /**\n * The address the record points to\n */\n address: Address[]\n}\n\n/**\n * An address record points a domain to an address\n */\nexport type AddressRecord = Payload<AddressRecordFields, AddressRecordSchema>\n\nexport const isAddressRecord = isPayloadOfSchemaType<AddressRecord>(AddressRecordSchema)\n","export const DomainLeaseEstimateDivinerValidationErrorDetailsSchema\n = 'network.xyo.diviner.ns.domain.registration.lease.estimate.validation.error.details' as const\n\nexport type DomainLeaseEstimateDivinerValidationErrorDetailsSchema = typeof DomainLeaseEstimateDivinerValidationErrorDetailsSchema\n","import { DomainLeaseEstimateDivinerValidationErrorDetailsSchema } from '../Schema.ts'\nimport type { DomainLeaseEstimateDivinerValidationErrorDetails, ErrorDetailsDictionary } from './Payload.ts'\n\n// export type DomainLeaseEstimateDivinerErrorDetailsDictionaryErrorCode = keyof typeof DomainLeaseEstimateDivinerErrorDetailsDictionary\nexport type DomainLeaseEstimateDivinerErrorDetailsDictionaryErrorCode = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8\n\nexport const DomainLeaseEstimateDivinerErrorDetailsDictionary: Readonly<\n Readonly<Record<DomainLeaseEstimateDivinerErrorDetailsDictionaryErrorCode, DomainLeaseEstimateDivinerValidationErrorDetails>>\n & ErrorDetailsDictionary\n> = {\n 0: {\n code: '0', schema: DomainLeaseEstimateDivinerValidationErrorDetailsSchema, title: 'Success',\n },\n 1: {\n code: '1', schema: DomainLeaseEstimateDivinerValidationErrorDetailsSchema, title: 'Invalid casing',\n },\n 2: {\n code: '2', schema: DomainLeaseEstimateDivinerValidationErrorDetailsSchema, title: 'Invalid coin signature',\n },\n 3: {\n code: '3', schema: DomainLeaseEstimateDivinerValidationErrorDetailsSchema, title: 'Invalid length',\n },\n 4: {\n code: '4', schema: DomainLeaseEstimateDivinerValidationErrorDetailsSchema, title: 'Invalid name',\n },\n 5: {\n code: '5', schema: DomainLeaseEstimateDivinerValidationErrorDetailsSchema, title: 'Reserved fragment',\n },\n 6: {\n code: '6', schema: DomainLeaseEstimateDivinerValidationErrorDetailsSchema, title: 'Reserved name',\n },\n 7: {\n code: '7', schema: DomainLeaseEstimateDivinerValidationErrorDetailsSchema, title: 'Reserved string',\n },\n 8: {\n code: '8', schema: DomainLeaseEstimateDivinerValidationErrorDetailsSchema, title: 'Invalid TLD',\n },\n} as const\n","import type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType, isPayloadOfSchemaTypeWithSources } from '@xyo-network/payload-model'\n\nimport { DomainLeaseEstimateDivinerValidationErrorDetailsSchema } from '../Schema.ts'\n\nexport interface ErrorDetails<TErrorCode extends string | undefined = string | undefined> {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [key: string]: any // Index signature for any other additional properties\n /**\n * A string code indicating the error type.\n */\n code: TErrorCode\n /**\n * A human-readable explanation specific to this occurrence of the problem\n */\n detail?: string\n /**\n * A short, human-readable summary of the problem type.\n */\n title?: string\n}\n\nexport type ErrorDetailsDictionary<T extends number = number> = {\n readonly [K in T]: ErrorDetails<`${K}`>\n}\n\n/**\n * A payment authorization token payload\n */\nexport type DomainLeaseEstimateDivinerValidationErrorDetails<TErrorCode extends string | undefined = string> = Payload<\n ErrorDetails<TErrorCode>,\n DomainLeaseEstimateDivinerValidationErrorDetailsSchema\n>\n\n/**\n * Identity function for DomainLeaseEstimateDivinerValidationErrorDetails payload\n */\nexport const isDomainLeaseEstimateDivinerValidationErrorDetails = isPayloadOfSchemaType<DomainLeaseEstimateDivinerValidationErrorDetails>(\n DomainLeaseEstimateDivinerValidationErrorDetailsSchema,\n)\n\n/**\n * Identity function for DomainLeaseEstimateDivinerValidationErrorDetails payload with sources\n */\nexport const isDomainLeaseEstimateDivinerValidationErrorDetailsWithSources\n = isPayloadOfSchemaTypeWithSources<DomainLeaseEstimateDivinerValidationErrorDetails>(DomainLeaseEstimateDivinerValidationErrorDetailsSchema)\n","import { findAs } from '@xylabs/array'\nimport { exists } from '@xylabs/exists'\nimport type { BoundWitness } from '@xyo-network/boundwitness-model'\nimport { isBoundWitness } from '@xyo-network/boundwitness-model'\nimport type { HashLeaseEstimate } from '@xyo-network/diviner-hash-lease'\nimport { asHashLeaseEstimate, HashLeaseEstimateSchema } from '@xyo-network/diviner-hash-lease'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport type { Payload, WithSources } from '@xyo-network/payload-model'\n\nimport type { DomainRegistrationLease } from '../../DomainRegistration/index.ts'\nimport { asDomainRegistrationLeaseWithSources, DomainRegistrationLeaseSchema } from '../../DomainRegistration/index.ts'\n\nexport type Estimate = [\n BoundWitness,\n WithSources<HashLeaseEstimate>,\n WithSources<DomainRegistrationLease>,\n]\n\n/**\n * Parses a generic array of payloads into estimates\n * @param payloads An array of payloads\n * @returns Parsed estimates\n */\nexport const parseEstimatesFromArray = async (payloads?: Payload[]): Promise<Estimate[]> => {\n if (!payloads) return []\n const bws = payloads\n // Find all bound witnesses\n .filter(isBoundWitness)\n // that have the required estimate payloads\n .filter(hasEstimatePayloads) ?? []\n if (bws.length === 0) return []\n const hashMap = await PayloadBuilder.toAllHashMap(payloads)\n return bws.map<Estimate | undefined>((bw) => {\n const hashLeaseEstimate = getPayloadBySchemaFromBoundWitness<WithSources<HashLeaseEstimate>>(\n bw,\n HashLeaseEstimateSchema,\n hashMap,\n asHashLeaseEstimate,\n )\n if (!hashLeaseEstimate) return\n const domainLease = getPayloadBySchemaFromBoundWitness<WithSources<DomainRegistrationLease>>(\n bw,\n DomainRegistrationLeaseSchema,\n hashMap,\n asDomainRegistrationLeaseWithSources,\n )\n if (!domainLease) return\n return [bw, hashLeaseEstimate, domainLease]\n }).filter(exists)\n}\n\n/**\n * Tests if a BoundWitness has the required estimate payloads\n * @param bw The BoundWitness to check for estimate payloads\n * @returns True if the BoundWitness has the required estimate payloads, false otherwise\n */\nconst hasEstimatePayloads = (bw: BoundWitness): boolean => {\n return bw.payload_schemas.includes(DomainRegistrationLeaseSchema)\n && bw.payload_schemas.includes(HashLeaseEstimateSchema)\n}\n\n/**\n * Finds the first instance of a payload in a BoundWitness by schema\n * @param bw The BoundWitness to extract the payload from\n * @param schema The schema of the payload to extract\n * @param hashMap The hashmap of the payloads\n * @param identity An identity function to check if the payload is of the correct type\n * @returns The payload if it exists or undefined\n */\nconst getPayloadBySchemaFromBoundWitness = <T extends Payload = Payload>(\n bw: BoundWitness,\n schema: string,\n hashMap: Awaited<ReturnType<typeof PayloadBuilder.toHashMap>>,\n identity: (payload: Payload) => T,\n): T | undefined => {\n const schemaIndex = bw.payload_schemas.indexOf(schema)\n if (schemaIndex === -1) return\n const hash = bw.payload_hashes[schemaIndex]\n return findAs([hashMap[hash]], identity)\n}\n","import type { Address } from '@xylabs/hex'\nimport { AsObjectFactory } from '@xylabs/object'\nimport type { Payload, WithSources } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType, isPayloadOfSchemaTypeWithSources } from '@xyo-network/payload-model'\n\nimport type { DomainFields } from '../Domain/index.ts'\nimport { DomainSchema } from '../Domain/index.ts'\n\nexport const DomainRegistrationSchema = `${DomainSchema}.registration` as const\nexport type DomainRegistrationSchema = typeof DomainRegistrationSchema\n\nexport interface DomainRegistrationFields extends DomainFields {\n /**\n * The registrant of the domain\n */\n registrant: Address[]\n /**\n * The registrar of the domain\n */\n registrar: Address[]\n}\n\n/**\n * Delegation of a domain to a registrar by a registrant\n */\nexport type DomainRegistration = Payload<DomainRegistrationFields, DomainRegistrationSchema>\n\n/**\n * Identity function for DomainRegistration payload\n */\nexport const isDomainRegistration = isPayloadOfSchemaType<DomainRegistration>(DomainRegistrationSchema)\nexport const asDomainRegistration = AsObjectFactory.create<DomainRegistration>(isDomainRegistration)\nexport const asOptionalDomainRegistration = AsObjectFactory.createOptional<DomainRegistration>(isDomainRegistration)\n\n/**\n * Identity function for DomainRegistration payload with sources\n */\nexport const isDomainRegistrationWithSources = isPayloadOfSchemaTypeWithSources<WithSources<DomainRegistration>>(DomainRegistrationSchema)\nexport const asDomainRegistrationWithSources = AsObjectFactory.create<WithSources<DomainRegistration>>(isDomainRegistrationWithSources)\nexport const asOptionalDomainRegistrationWithSources = AsObjectFactory.createOptional<WithSources<DomainRegistration>>(isDomainRegistrationWithSources)\n","import { AsObjectFactory } from '@xylabs/object'\nimport type { Payload, WithSources } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType, isPayloadOfSchemaTypeWithSources } from '@xyo-network/payload-model'\n\nexport type DomainSchema = 'network.xyo.ns.domain'\nexport const DomainSchema: DomainSchema = 'network.xyo.ns.domain'\n\n/**\n * The supported TLDs for XNS\n */\nexport type TopLevelDomain = 'xyo'\n\n/**\n * The fields for a domain record\n */\nexport interface DomainFields {\n /**\n * The XNS domain of the record\n */\n domain: string\n\n /**\n * The Top-Level Domain of the domain\n */\n tld: TopLevelDomain\n}\n\n/**\n * A domain record is a record of a domain\n */\nexport type Domain = Payload<DomainFields, DomainSchema>\n\n/**\n * Identity function for Domain payload\n */\nexport const isDomain = isPayloadOfSchemaType<Domain>(DomainSchema)\nexport const asDomain = AsObjectFactory.create<Domain>(isDomain)\nexport const asOptionalDomain = AsObjectFactory.createOptional<Domain>(isDomain)\n\n/**\n * Identity function for Domain payload with sources\n */\nexport const isDomainWithSources = isPayloadOfSchemaTypeWithSources<WithSources<Domain>>(DomainSchema)\nexport const asDomainWithSources = AsObjectFactory.create<WithSources<Domain>>(isDomainWithSources)\nexport const asOptionalDomainWithSources = AsObjectFactory.createOptional<WithSources<Domain>>(isDomainWithSources)\n","import { AsObjectFactory } from '@xylabs/object'\nimport type { Payload, WithSources } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType, isPayloadOfSchemaTypeWithSources } from '@xyo-network/payload-model'\n\nimport type { DurationFields } from '../Duration/index.ts'\nimport type { DomainFields } from './Domain.ts'\n\nexport type DomainLeaseSchema = 'network.xyo.ns.domain.lease'\nexport const DomainLeaseSchema: DomainLeaseSchema = 'network.xyo.ns.domain.lease'\n\n/**\n * A domain is leased for a duration\n */\nexport interface DomainLeaseFields extends DomainFields, DurationFields {}\n\n/**\n * A domain lease is a record of a domain and the duration it is leased for\n */\nexport type DomainLease = Payload<DomainLeaseFields, DomainLeaseSchema>\n\n/**\n * Identity function for DomainLease payload\n */\nexport const isDomainLease = isPayloadOfSchemaType<DomainLease>(DomainLeaseSchema)\nexport const asDomainLease = AsObjectFactory.create<DomainLease>(isDomainLease)\nexport const asOptionalDomainLease = AsObjectFactory.createOptional<DomainLease>(isDomainLease)\n\n/**\n * Identity function for DomainLease payload with sources\n */\nexport const isDomainLeaseWithSources = isPayloadOfSchemaTypeWithSources<WithSources<DomainLease>>(DomainLeaseSchema)\nexport const asDomainLeaseWithSources = AsObjectFactory.create<WithSources<DomainLease>>(isDomainLeaseWithSources)\nexport const asOptionalDomainLeaseWithSources = AsObjectFactory.createOptional<WithSources<DomainLease>>(isDomainLeaseWithSources)\n","import { AsObjectFactory } from '@xylabs/object'\nimport type { Payload, WithSources } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType, isPayloadOfSchemaTypeWithSources } from '@xyo-network/payload-model'\n\nimport type { DurationFields } from '../Duration/index.ts'\nimport type { DomainRegistrationFields } from './DomainRegistration.ts'\nimport { DomainRegistrationSchema } from './DomainRegistration.ts'\n\nexport const DomainRegistrationLeaseSchema = `${DomainRegistrationSchema}.lease` as const\nexport type DomainRegistrationLeaseSchema = typeof DomainRegistrationLeaseSchema\n\nexport interface DomainRegistrationLeaseFields extends DomainRegistrationFields, DurationFields {}\n\n/**\n * Temporal delegation of a domain to a registrar by a registrant\n */\nexport type DomainRegistrationLease = Payload<DomainRegistrationLeaseFields, DomainRegistrationLeaseSchema>\n\n/**\n * Identity function for DomainRegistrationLease payload\n */\nexport const isDomainRegistrationLease = isPayloadOfSchemaType<DomainRegistrationLease>(DomainRegistrationLeaseSchema)\nexport const asDomainRegistrationLease = AsObjectFactory.create<DomainRegistrationLease>(isDomainRegistrationLease)\nexport const asOptionalDomainRegistrationLease = AsObjectFactory.createOptional<DomainRegistrationLease>(isDomainRegistrationLease)\n\n/**\n * Identity function for DomainRegistrationLease payload with sources\n */\nexport const isDomainRegistrationLeaseWithSources = isPayloadOfSchemaTypeWithSources<WithSources<DomainRegistrationLease>>(DomainRegistrationLeaseSchema)\nexport const asDomainRegistrationLeaseWithSources = AsObjectFactory.create<WithSources<DomainRegistrationLease>>(isDomainRegistrationLeaseWithSources)\nexport const asOptionalDomainRegistrationLeaseWithSources = AsObjectFactory\n .createOptional<WithSources<DomainRegistrationLease>>(isDomainRegistrationLeaseWithSources)\n\n/**\n * @deprecated Use isDomainRegistrationLeaseWithSources instead\n */\nexport const isDomainRegistrationLeaseSources = isDomainRegistrationLeaseWithSources\n","export type DNSQueryOpcode = 0 | 1 | 2 | 4 | 5 | 6 // Supported opcodes as numeric values\n\n// Optional: Add a more descriptive union type for the opcodes.\nexport type DNSQueryOpcodeName = 'QUERY' | 'IQUERY' | 'STATUS' | 'NOTIFY' | 'UPDATE' | 'DSO'\n\nexport const DNSQueryOpcodes: Record<DNSQueryOpcodeName, DNSQueryOpcode> = {\n QUERY: 0,\n IQUERY: 1,\n STATUS: 2,\n NOTIFY: 4,\n UPDATE: 5,\n DSO: 6,\n}\n","export type DNSRcode = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 16 | 17 | 18\n\nexport type DNSRcodeName\n = | 'NOERROR'\n | 'FORMERR'\n | 'SERVFAIL'\n | 'NXDOMAIN'\n | 'NOTIMP'\n | 'REFUSED'\n | 'YXDOMAIN'\n | 'YXRRSET'\n | 'NXRRSET'\n | 'NOTAUTH'\n | 'NOTZONE'\n | 'BADSIG'\n | 'BADKEY'\n | 'BADTIME'\n\nexport const DNSRcodes: Readonly<Record<DNSRcodeName, DNSRcode>> = {\n NOERROR: 0,\n FORMERR: 1,\n SERVFAIL: 2,\n NXDOMAIN: 3,\n NOTIMP: 4,\n REFUSED: 5,\n YXDOMAIN: 6,\n YXRRSET: 7,\n NXRRSET: 8,\n NOTAUTH: 9,\n NOTZONE: 10,\n BADSIG: 16,\n BADKEY: 17,\n BADTIME: 18,\n}\n","/* eslint-disable @typescript-eslint/member-ordering */\n\n// An attempt to match compatibility with the RFC 8427 (Representing DNS Messages in JSON)\n// https://www.rfc-editor.org/rfc/rfc8427\n// and Google/CloudFlare's DNS over HTTPS (DoH) standard\n// https://developers.cloudflare.com/1.1.1.1/encryption/dns-over-https/make-api-requests/dns-json/\n\nimport type { DNSQueryOpcode } from './OperationCodes.ts'\nimport { DNSQueryOpcodes } from './OperationCodes.ts'\nimport type { DNSRcode } from './ResponseCodes.ts'\nimport { DNSRcodes } from './ResponseCodes.ts'\n\n// NOTE: The RFC says `Boolean` but uses 0/1 for the values. DNS over HTTPS (DoH) uses `true`/`false`.\nexport type NumericBoolean = 0 | 1 | true | false\nexport type NumericBooleanFalsy = 0 | false\nexport type NumericBooleanTruthy = 1 | true\n\nexport interface DNSHeader {\n /**\n * Transaction ID, typically a random number. Integer whose value is 0 to 65535\n */\n ID?: number\n /**\n * Query/Response Flag (0 = Query, 1 = Response)\n */\n QR?: NumericBoolean\n /**\n * Operation Code (0 for standard query)\n */\n Opcode?: DNSQueryOpcode\n /**\n * Authoritative Answer (set in response)\n */\n AA?: NumericBoolean\n /**\n * Truncated Flag\n */\n TC?: NumericBoolean // Truncation\n /**\n * Recursion Desired\n */\n RD?: NumericBoolean // Recursion Desired (set in query)\n /**\n * Response Code (0 for no error, non-0 for errors)\n */\n RCODE?: DNSRcode\n /**\n * Number of questions in the query (usually 1)\n */\n QDCOUNT?: number\n /**\n * Number of answer records in the response\n */\n ANCOUNT?: number\n /**\n * Number of authority records in the response\n */\n NSCOUNT?: number\n /**\n * Number of additional records in the response\n */\n ARCOUNT?: number\n}\n\nexport interface DNSRequestHeader extends DNSHeader {\n QR: NumericBooleanFalsy // Query/Response Flag (0 = Query)\n Opcode: DNSQueryOpcode // Operation Code (0 for standard query)\n AA: NumericBooleanFalsy // Authoritative Answer (0 in query)\n TC: NumericBooleanFalsy // Truncation (0 for non-truncated)\n RCODE: typeof DNSRcodes.NOERROR // Response Code (always 0 in query)\n ANCOUNT: 0 // Number of answer records (always 0 in query)\n NSCOUNT: 0 // Number of authority records (always 0 in query)\n ARCOUNT: 0 // Number of additional records (always 0 in query)\n}\n\nexport const StandardRequestHeader: Readonly<DNSRequestHeader> = {\n ID: 0,\n QR: 0, // Query/Response Flag (0 = Query)\n Opcode: DNSQueryOpcodes.QUERY, // Operation Code (0 for standard query)\n AA: 0, // Authoritative Answer (0 in query)\n TC: 0, // Truncation (0 for non-truncated)\n RD: 1, // Recursion Desired (1 if recursion is requested)\n RCODE: DNSRcodes.NOERROR, // Response Code (always 0 in query)\n QDCOUNT: 1,\n ANCOUNT: 0,\n NSCOUNT: 0,\n ARCOUNT: 0,\n}\n\nexport interface DNSResponseHeader extends DNSHeader {\n QR: NumericBooleanTruthy // Query/Response Flag (1 = Response)\n Opcode: DNSQueryOpcode // Operation Code (0 for standard query)\n AA: NumericBoolean // Authoritative Answer (1 if the response is authoritative)\n TC: NumericBoolean // Truncation (1 if the message is truncated)\n RA: NumericBoolean // Recursion Available (1 if the server supports recursion)\n}\n","// https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-4\n\nexport type DNSResourceRecordType\n = | 'A'\n | 'NS'\n | 'MD'\n | 'MF'\n | 'CNAME'\n | 'SOA'\n | 'MB'\n | 'MG'\n | 'MR'\n | 'NULL'\n | 'WKS'\n | 'PTR'\n | 'HINFO'\n | 'MINFO'\n | 'MX'\n | 'TXT'\n | 'RP'\n | 'AFSDB'\n | 'X25'\n | 'ISDN'\n | 'RT'\n | 'NSAP'\n | 'NSAP-PTR'\n | 'SIG'\n | 'KEY'\n | 'PX'\n | 'GPOS'\n | 'AAAA'\n | 'LOC'\n | 'NXT'\n | 'EID'\n | 'NIMLOC'\n | 'SRV'\n | 'ATMA'\n | 'NAPTR'\n | 'KX'\n | 'CERT'\n | 'A6'\n | 'DNAME'\n | 'SINK'\n | 'OPT'\n | 'APL'\n | 'DS'\n | 'SSHFP'\n | 'IPSECKEY'\n | 'RRSIG'\n | 'NSEC'\n | 'DNSKEY'\n | 'DHCID'\n | 'NSEC3'\n | 'NSEC3PARAM'\n | 'TLSA'\n | 'SMIMEA'\n | 'HIP'\n | 'NINFO'\n | 'RKEY'\n | 'TALINK'\n | 'CDS'\n | 'CDNSKEY'\n | 'OPENPGPKEY'\n | 'CSYNC'\n | 'ZONEMD'\n | 'SVCB'\n | 'HTTPS'\n | 'SPF'\n | 'UINFO'\n | 'UID'\n | 'GID'\n | 'UNSPEC'\n | 'NID'\n | 'L32'\n | 'L64'\n | 'LP'\n | 'EUI48'\n | 'EUI64'\n | 'NXNAME'\n | 'TKEY'\n | 'TSIG'\n | 'IXFR'\n | 'AXFR'\n | 'MAILB'\n | 'MAILA'\n | '*'\n | 'URI'\n | 'CAA'\n | 'AVC'\n | 'DOA'\n | 'AMTRELAY'\n | 'RESINFO'\n | 'WALLET'\n | 'CLA'\n | 'IPN'\n | 'TA'\n | 'DLV'\n // NOTE: Custom types here\n | 'XYOA'\n | 'XYOH'\n\nexport const DNSResourceRecordTypes: Readonly<Record<DNSResourceRecordType, number>> = {\n 'A': 1, // a host address\n 'NS': 2, // an authoritative name server\n 'MD': 3, // a mail destination (OBSOLETE - use MX)\n 'MF': 4, // a mail forwarder (OBSOLETE - use MX)\n 'CNAME': 5, // the canonical name for an alias\n 'SOA': 6, // marks the start of a zone of authority\n 'MB': 7, // a mailbox domain name (EXPERIMENTAL)\n 'MG': 8, // a mail group member (EXPERIMENTAL)\n 'MR': 9, // a mail rename domain name (EXPERIMENTAL)\n 'NULL': 10, // a null RR (EXPERIMENTAL)\n 'WKS': 11, // a well known service description\n 'PTR': 12, // a domain name pointer\n 'HINFO': 13, // host information\n 'MINFO': 14, // mailbox or mail list information\n 'MX': 15, // mail exchange\n 'TXT': 16, // text strings\n 'RP': 17, // for Responsible Person\n 'AFSDB': 18, // for AFS Data Base location\n 'X25': 19, // for X.25 PSDN address\n 'ISDN': 20, // for ISDN address\n 'RT': 21, // for Route Through\n 'NSAP': 22, // for NSAP address, NSAP style A record (DEPRECATED)\n 'NSAP-PTR': 23, // for domain name pointer, NSAP style (DEPRECATED)\n 'SIG': 24, // for security signature\n 'KEY': 25, // for security key\n 'PX': 26, // X.400 mail mapping information\n 'GPOS': 27, // Geographical Position\n 'AAAA': 28, // IP6 Address\n 'LOC': 29, // Location Information\n 'NXT': 30, // Next Domain (OBSOLETE)\n 'EID': 31, // Endpoint Identifier\n 'NIMLOC': 32, // Nimrod Locator\n 'SRV': 33, // Server Selection\n 'ATMA': 34, // ATM Address\n 'NAPTR': 35, // Naming Authority Pointer\n 'KX': 36, // Key Exchanger\n 'CERT': 37, // CERT\n 'A6': 38, // A6 (OBSOLETE - use AAAA)\n 'DNAME': 39, // DNAME\n 'SINK': 40, // SINK\n 'OPT': 41, // OPT\n 'APL': 42, // APL\n 'DS': 43, // Delegation Signer\n 'SSHFP': 44, // SSH Key Fingerprint\n 'IPSECKEY': 45, // IPSECKEY\n 'RRSIG': 46, // RRSIG\n 'NSEC': 47, // NSEC\n 'DNSKEY': 48, // DNSKEY\n 'DHCID': 49, // DHCID\n 'NSEC3': 50, // NSEC3\n 'NSEC3PARAM': 51, // NSEC3PARAM\n 'TLSA': 52, // TLSA\n 'SMIMEA': 53, // S/MIME cert association\n 'HIP': 55, // Host Identity Protocol\n 'NINFO': 56, // NINFO\n 'RKEY': 57, // RKEY\n 'TALINK': 58, // Trust Anchor LINK\n 'CDS': 59, // Child DS\n 'CDNSKEY': 60, // DNSKEY(s) the Child wants reflected in DS\n 'OPENPGPKEY': 61, // OpenPGP Key\n 'CSYNC': 62, // Child-To-Parent Synchronization\n 'ZONEMD': 63, // Message Digest Over Zone Data\n 'SVCB': 64, // General-purpose service binding\n 'HTTPS': 65, // SVCB-compatible type for use with HTTP\n 'SPF': 99,\n 'UINFO': 100,\n 'UID': 101,\n 'GID': 102,\n 'UNSPEC': 103,\n 'NID': 104,\n 'L32': 105,\n 'L64': 106,\n 'LP': 107,\n 'EUI48': 108, // an EUI-48 address\n 'EUI64': 109, // an EUI-64 address\n 'NXNAME': 128, // NXDOMAIN indicator for Compact Denial of Existence\n 'TKEY': 249, // Transaction Key\n 'TSIG': 250, // Transaction Signature\n 'IXFR': 251, // incremental transfer\n 'AXFR': 252, // transfer of an entire zone\n 'MAILB': 253, // mailbox-related RRs (MB, MG or MR)\n 'MAILA': 254, // mail agent RRs (OBSOLETE - see MX)\n '*': 255, // A request for some or all records the server has available\n 'URI': 256, // URI\n 'CAA': 257, // Certification Authority Restriction\n 'AVC': 258, // Application Visibility and Control\n 'DOA': 259, // Digital Object Architecture\n 'AMTRELAY': 260, // Automatic Multicast Tunneling Relay\n 'RESINFO': 261, // Resolver Information as Key/Value Pairs\n 'WALLET': 262, // Public wallet address\n 'CLA': 263, // BP Convergence Layer Adapter\n 'IPN': 264, // BP Node Number\n 'TA': 32_768, // DNSSEC Trust Authorities\n 'DLV': 32_769, // DNSSEC Lookaside Validation (OBSOLETE)\n\n // NOTE: Custom types here chosen within the Private Use Range\n // https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-4\n // https://www.rfc-editor.org/rfc/rfc5226\n // as, per the RFC, the Private Use Range is reserved\n // \"For private or local use only, with the type and\n // purpose defined by the local site. No attempt is made to\n // prevent multiple sites from using the same value in\n // different (and incompatible) ways. There is no need for\n // IANA to review such assignments (since IANA does not record\n // them) and assignments are not generally useful for broad\n // interoperability. It is the responsibility of the sites\n // making use of the Private Use range to ensure that no\n // conflicts occur (within the intended scope of use).\"\n // If we want to apply for a custom reserved code later\n // on, once the usage is proven enough we can absolutely\n // do that.\n 'XYOA': 65_432, // XYO Address\n 'XYOH': 65_433, // XYO Hash\n}\n\nexport type DNSResourceRecordTypeValue = (typeof DNSResourceRecordTypes)[keyof typeof DNSResourceRecordTypes]\n\nexport const findDNSResourceRecordTypesByValue = (value: DNSResourceRecordTypeValue): DNSResourceRecordType | undefined => {\n // Iterate through the keys of the record\n for (const key in DNSResourceRecordTypes) {\n const resourceRecordType = key as DNSResourceRecordType\n if (DNSResourceRecordTypes[resourceRecordType] === value) {\n return resourceRecordType // Return the key if the value matches\n }\n }\n return undefined // Return undefined if no matching value is found\n}\n","/* eslint-disable @typescript-eslint/member-ordering */\nimport type { DNSRequestHeader } from './Header.ts'\nimport { StandardRequestHeader } from './Header.ts'\nimport type { DNSResourceRecordTypeValue } from './ResourceRecord.ts'\nimport { DNSResourceRecordTypes } from './ResourceRecord.ts'\n\nexport interface DNSQuestion {\n name: string // The domain name that was queried\n type: DNSResourceRecordTypeValue // The record type (e.g., 1 for A record)\n class?: number // Query Class (typically 1 for IN - Internet)\n}\n\nexport interface DNSRequestFields extends DNSRequestHeader {\n Question: DNSQuestion[]\n}\n\n/**\n * Helper for generating a DNS request for a given domain and record type\n * @param domain The domain to query\n * @param type The record type to query\n * @returns A DNS request\n */\nexport const getRequestFor = (domain: string, type: DNSResourceRecordTypeValue = DNSResourceRecordTypes.A): DNSRequestFields => {\n return {\n ...StandardRequestHeader,\n ID: getRandomId(),\n Question: [{\n name: domain, type, class: 1,\n }],\n }\n}\n\n/**\n * Used to generate a random ID for a DNS request\n * @returns A random number between 0 and 65,535\n */\nexport const getRandomId = (): number => {\n return Math.floor(Math.random() * 65_536) // Math.random() generates a number between 0 and 1, multiply by 65536 to get the range 0-65535\n}\n","export type DNSSchema = 'network.xyo.dns'\nexport const DNSSchema: DNSSchema = 'network.xyo.dns'\n","import type { ModuleIdentifier } from '@xyo-network/module-model'\nimport type { WitnessConfig } from '@xyo-network/witness-model'\n\nimport type { DNSResourceRecordType } from '../types/index.ts'\nimport { DNSSchema } from './Schema.ts'\n\nexport type DNSWitnessConfigSchema = `${DNSSchema}.witness.config`\nexport const DNSWitnessConfigSchema: DNSWitnessConfigSchema = `${DNSSchema}.witness.config`\n\nexport type DNSWitnessConfig = WitnessConfig<{\n /**\n * The address record index diviner to be used to determine the address record index\n */\n addressRecordIndexDiviner?: ModuleIdentifier\n /**\n * The hash record index diviner to be used to determine the hash record index\n */\n hashRecordIndexDiviner?: ModuleIdentifier\n /**\n * The config schema for the DNS witness\n */\n schema: DNSWitnessConfigSchema\n /**\n * If supplied, the DNS witness will only support the specified resource record types\n */\n supportedResources?: DNSResourceRecordType[]\n}>\n","import { AsObjectFactory } from '@xylabs/object'\nimport type { Payload, WithSources } from '@xyo-network/payload-model'\nimport {\n isPayloadOfSchemaType,\n isPayloadOfSchemaTypeWithSources,\n} from '@xyo-network/payload-model'\n\nimport type { DNSRequestFields, DNSResourceRecordTypeValue } from '../../types/index.ts'\nimport { DNSResourceRecordTypes, getRequestFor } from '../../types/index.ts'\nimport { DNSSchema } from '../Schema.ts'\n\n/**\n * The fields of a DNSRequest payload\n */\nexport type DNSRequest = Payload<DNSRequestFields, DNSSchema>\n\n/**\n * Identity function for determining if an object is a DNSRequest payload\n */\nexport const isDNSRequest = isPayloadOfSchemaType<DNSRequest>(DNSSchema)\nexport const asDNSRequest = AsObjectFactory.create<DNSRequest>(isDNSRequest)\nexport const asOptionalDNSRequest = AsObjectFactory.createOptional<DNSRequest>(isDNSRequest)\n\n/**\n * Identity function for determining if an object is a DNSRequest payload with sources\n */\nexport const isDNSRequestWithSources = isPayloadOfSchemaTypeWithSources<WithSources<DNSRequest>>(DNSSchema)\nexport const asDNSRequestWithSources = AsObjectFactory.create<WithSources<DNSRequest>>(isDNSRequestWithSources)\nexport const asOptionalDNSRequestWithSources = AsObjectFactory.createOptional<WithSources<DNSRequest>>(isDNSRequestWithSources)\n\n/**\n * Helper for generating a DNSRequest payload for a given domain and record type\n * @param domain The domain to query\n * @param type The record type to query\n * @returns A DNSRequest payload\n */\nexport const getDnsRequestFor = (domain: string, type: DNSResourceRecordTypeValue = DNSResourceRecordTypes.A): DNSRequest => {\n return { ...getRequestFor(domain, type), schema: DNSSchema }\n}\n","import { AsObjectFactory } from '@xylabs/object'\nimport type { PayloadWithSources, WithSources } from '@xyo-network/payload-model'\nimport {\n isPayloadOfSchemaType,\n isPayloadOfSchemaTypeWithSources,\n} from '@xyo-network/payload-model'\n\nimport type { DNSResponseFields } from '../../types/index.ts'\nimport { DNSSchema } from '../Schema.ts'\n\n/**\n * The fields of a DNSResponse payload\n */\nexport type DNSResponse = PayloadWithSources<DNSResponseFields, DNSSchema>\n\n/**\n * Identity function for determining if an object is a DNSResponse payload\n */\nexport const isDNSResponse = isPayloadOfSchemaType<DNSResponse>(DNSSchema)\nexport const asDNSResponse = AsObjectFactory.create<DNSResponse>(isDNSResponse)\nexport const asOptionalDNSResponse = AsObjectFactory.createOptional<DNSResponse>(isDNSResponse)\n\n/**\n * Identity function for determining if an object is a DNSResponse payload with sources\n */\nexport const isDNSResponseWithSources = isPayloadOfSchemaTypeWithSources<DNSResponse>(DNSSchema)\nexport const asDNSResponseWithSources = AsObjectFactory.create<WithSources<DNSResponse>>(isDNSResponseWithSources)\nexport const asOptionalDNSResponseWithSources = AsObjectFactory.createOptional<WithSources<DNSResponse>>(isDNSResponseWithSources)\n","import type { BoundWitness } from '@xyo-network/boundwitness-model'\nimport { BoundWitnessValidator } from '@xyo-network/boundwitness-validator'\n\n// BW Validations\nexport const validateBoundWitness = async (recordBw: BoundWitness, requiredSchemas: string[] = []): Promise<boolean> => {\n // If the BW does not include all of the required schemas\n if (!requiredSchemas.every(requiredSchema => recordBw.payload_schemas.includes(requiredSchema))) return false\n // If the BW is valid (does not include any errors)\n const validator = new BoundWitnessValidator(recordBw)\n const errors = await validator.validate()\n return errors.length === 0\n}\n","import type { BoundWitness } from '@xyo-network/boundwitness-model'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport type { Payload } from '@xyo-network/payload-model'\n\nimport type { DurationFields } from '../Duration.ts'\n\n// BW & Record Validations\nexport const validateBoundWitnessAndDuration = async (recordBw: BoundWitness, recordPayload: Payload<DurationFields>): Promise<boolean> => {\n if (!(await recordIsInBoundWitness(recordBw, recordPayload))) return false\n return (recordIsTemporallyValidToBoundWitness(recordBw, recordPayload))\n}\n\nconst recordIsInBoundWitness = async (recordBw: BoundWitness, recordPayload: Payload): Promise<boolean> => {\n const hash = await PayloadBuilder.dataHash(recordPayload)\n return recordBw.payload_hashes.includes(hash)\n}\n\n// TODO: Use sequence for this?\nconst recordIsTemporallyValidToBoundWitness = (_recordBw: BoundWitness, _recordPayload: Payload<DurationFields>): boolean => {\n /* const { timestamp } = recordBw\n const { exp } = recordPayload\n return exp > timestamp */\n return true\n}\n","import type { Payload } from '@xyo-network/payload-model'\n\nimport type { DurationFields } from '../Duration.ts'\n\n// Record Validations\nexport const validateDuration = (recordPayload: Payload<DurationFields>): boolean => {\n // if (!isValidAddress(recordPayload)) return false\n return isWithinDelegatedTimeframe(recordPayload)\n}\n\nexport const isWithinDelegatedTimeframe = (recordPayload: Payload<DurationFields>, now = Date.now()): boolean => {\n // nbf < now < exp\n return recordPayload.nbf < now && now < recordPayload.exp\n}\n","import type { BoundWitness } from '@xyo-network/boundwitness-model'\nimport type { Payload } from '@xyo-network/payload-model'\n\nimport type { DurationFields } from '../Duration.ts'\nimport { validateBoundWitness } from './validateBoundWitness.ts'\nimport { validateBoundWitnessAndDuration } from './validateBoundWitnessAndDuration.ts'\nimport { validateDuration } from './validateDuration.ts'\n\nexport const validateBoundWitnessWithDuration = async (recordBw: BoundWitness, recordPayload: Payload<DurationFields>): Promise<boolean> => {\n // Validate the BW\n if (!(await validateBoundWitness(recordBw, [recordPayload.schema]))) return false\n // Validate the record\n if (!validateDuration(recordPayload)) return false\n // Validate the record relative to the BW\n return (await validateBoundWitnessAndDuration(recordBw, recordPayload))\n}\n","import type { Hash } from '@xylabs/hex'\nimport type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nimport type { DomainFields } from '../Domain/index.ts'\n\nexport type HashRecordSchema = 'network.xyo.ns.record.hash'\nexport const HashRecordSchema: HashRecordSchema = 'network.xyo.ns.record.hash'\n\nexport interface HashRecordFields extends DomainFields {\n /**\n * The hash the record points to\n */\n hash: Hash[]\n}\n\n/**\n * An hash record points a domain to an hash\n */\nexport type HashRecord = Payload<HashRecordFields, HashRecordSchema>\n\nexport const isHashRecord = isPayloadOfSchemaType<HashRecord>(HashRecordSchema)\n"],"mappings":";AAEA,SAAS,6BAA6B;AAK/B,IAAM,sBAA2C;AAcjD,IAAM,kBAAkB,sBAAqC,mBAAmB;;;ACrBhF,IAAM,yDACT;;;ACKG,IAAM,mDAGT;AAAA,EACF,GAAG;AAAA,IACD,MAAM;AAAA,IAAK,QAAQ;AAAA,IAAwD,OAAO;AAAA,EACpF;AAAA,EACA,GAAG;AAAA,IACD,MAAM;AAAA,IAAK,QAAQ;AAAA,IAAwD,OAAO;AAAA,EACpF;AAAA,EACA,GAAG;AAAA,IACD,MAAM;AAAA,IAAK,QAAQ;AAAA,IAAwD,OAAO;AAAA,EACpF;AAAA,EACA,GAAG;AAAA,IACD,MAAM;AAAA,IAAK,QAAQ;AAAA,IAAwD,OAAO;AAAA,EACpF;AAAA,EACA,GAAG;AAAA,IACD,MAAM;AAAA,IAAK,QAAQ;AAAA,IAAwD,OAAO;AAAA,EACpF;AAAA,EACA,GAAG;AAAA,IACD,MAAM;AAAA,IAAK,QAAQ;AAAA,IAAwD,OAAO;AAAA,EACpF;AAAA,EACA,GAAG;AAAA,IACD,MAAM;AAAA,IAAK,QAAQ;AAAA,IAAwD,OAAO;AAAA,EACpF;AAAA,EACA,GAAG;AAAA,IACD,MAAM;AAAA,IAAK,QAAQ;AAAA,IAAwD,OAAO;AAAA,EACpF;AAAA,EACA,GAAG;AAAA,IACD,MAAM;AAAA,IAAK,QAAQ;AAAA,IAAwD,OAAO;AAAA,EACpF;AACF;;;ACpCA,SAAS,yBAAAA,wBAAuB,wCAAwC;AAoCjE,IAAM,qDAAqDC;AAAA,EAChE;AACF;AAKO,IAAM,gEACT,iCAAmF,sDAAsD;;;AC7C7I,SAAS,cAAc;AACvB,SAAS,cAAc;AAEv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;;AClBO,IAAM,mBAAmB,CAAC,kBAAoD;AAEnF,SAAO,2BAA2B,aAAa;AACjD;AAEO,IAAM,6BAA6B,CAAC,eAAwC,MAAM,KAAK,IAAI,MAAe;AAE/G,SAAO,cAAc,MAAM,OAAO,MAAM,cAAc;AACxD;;;ACLO,IAAM,mCAAmC,OAAO,UAAwB,kBAA6D;AAE1I,MAAI,CAAE,MAAM,qBAAqB,UAAU,CAAC,cAAc,MAAM,CAAC,EAAI,QAAO;AAE5E,MAAI,CAAC,iBAAiB,aAAa,EAAG,QAAO;AAE7C,SAAQ,MAAM,gCAAgC,UAAU,aAAa;AACvE;;;ACbA,SAAS,yBAAAC,8BAA6B;AAK/B,IAAM,mBAAqC;AAc3C,IAAM,eAAeA,uBAAkC,gBAAgB;","names":["isPayloadOfSchemaType","isPayloadOfSchemaType","AsObjectFactory","isPayloadOfSchemaType","isPayloadOfSchemaTypeWithSources","isPayloadOfSchemaType","isPayloadOfSchemaTypeWithSources","AsObjectFactory","isPayloadOfSchemaType","isPayloadOfSchemaTypeWithSources","isPayloadOfSchemaType","AsObjectFactory","isPayloadOfSchemaTypeWithSources","AsObjectFactory","isPayloadOfSchemaType","isPayloadOfSchemaTypeWithSources","isPayloadOfSchemaType","AsObjectFactory","isPayloadOfSchemaTypeWithSources","AsObjectFactory","isPayloadOfSchemaType","isPayloadOfSchemaTypeWithSources","isPayloadOfSchemaType","AsObjectFactory","isPayloadOfSchemaTypeWithSources","AsObjectFactory","isPayloadOfSchemaType","isPayloadOfSchemaTypeWithSources","isPayloadOfSchemaType","AsObjectFactory","isPayloadOfSchemaTypeWithSources","PayloadBuilder","isPayloadOfSchemaType"]}
|
|
@@ -9,20 +9,14 @@ export type DNSRequest = Payload<DNSRequestFields, DNSSchema>;
|
|
|
9
9
|
* Identity function for determining if an object is a DNSRequest payload
|
|
10
10
|
*/
|
|
11
11
|
export declare const isDNSRequest: (x?: unknown | null) => x is DNSRequest;
|
|
12
|
-
export declare const asDNSRequest:
|
|
13
|
-
|
|
14
|
-
<TType extends DNSRequest>(value: import(".store/@xylabs-promise-npm-4.11.2-66516e0826/package").AnyNonPromise, assert: import("@xylabs/object").StringOrAlertFunction<DNSRequest>, config?: import("@xylabs/object").TypeCheckConfig): TType;
|
|
15
|
-
};
|
|
16
|
-
export declare const asOptionalDNSRequest: <TType extends DNSRequest>(value: import(".store/@xylabs-promise-npm-4.11.2-66516e0826/package").AnyNonPromise) => TType | undefined;
|
|
12
|
+
export declare const asDNSRequest: import("@xylabs/object").AsTypeFunction<DNSRequest>;
|
|
13
|
+
export declare const asOptionalDNSRequest: (value: import(".store/@xylabs-promise-npm-4.12.31-6620a7e715/package").AnyNonPromise) => DNSRequest | undefined;
|
|
17
14
|
/**
|
|
18
15
|
* Identity function for determining if an object is a DNSRequest payload with sources
|
|
19
16
|
*/
|
|
20
17
|
export declare const isDNSRequestWithSources: (x?: unknown | null) => x is WithSources<WithSources<DNSRequest>>;
|
|
21
|
-
export declare const asDNSRequestWithSources:
|
|
22
|
-
|
|
23
|
-
<TType extends WithSources<DNSRequest>>(value: import(".store/@xylabs-promise-npm-4.11.2-66516e0826/package").AnyNonPromise, assert: import("@xylabs/object").StringOrAlertFunction<WithSources<DNSRequest>>, config?: import("@xylabs/object").TypeCheckConfig): TType;
|
|
24
|
-
};
|
|
25
|
-
export declare const asOptionalDNSRequestWithSources: <TType extends WithSources<DNSRequest>>(value: import(".store/@xylabs-promise-npm-4.11.2-66516e0826/package").AnyNonPromise) => TType | undefined;
|
|
18
|
+
export declare const asDNSRequestWithSources: import("@xylabs/object").AsTypeFunction<WithSources<DNSRequest>>;
|
|
19
|
+
export declare const asOptionalDNSRequestWithSources: (value: import(".store/@xylabs-promise-npm-4.12.31-6620a7e715/package").AnyNonPromise) => WithSources<DNSRequest> | undefined;
|
|
26
20
|
/**
|
|
27
21
|
* Helper for generating a DNSRequest payload for a given domain and record type
|
|
28
22
|
* @param domain The domain to query
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Request.d.ts","sourceRoot":"","sources":["../../../../../src/DNS/Witness/Payload/Request.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAMtE,OAAO,KAAK,EAAE,gBAAgB,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAA;AAExF,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAExC;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,OAAO,CAAC,gBAAgB,EAAE,SAAS,CAAC,CAAA;AAE7D;;GAEG;AACH,eAAO,MAAM,YAAY,yCAA+C,CAAA;AACxE,eAAO,MAAM,YAAY
|
|
1
|
+
{"version":3,"file":"Request.d.ts","sourceRoot":"","sources":["../../../../../src/DNS/Witness/Payload/Request.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAMtE,OAAO,KAAK,EAAE,gBAAgB,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAA;AAExF,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAExC;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,OAAO,CAAC,gBAAgB,EAAE,SAAS,CAAC,CAAA;AAE7D;;GAEG;AACH,eAAO,MAAM,YAAY,yCAA+C,CAAA;AACxE,eAAO,MAAM,YAAY,qDAAmD,CAAA;AAC5E,eAAO,MAAM,oBAAoB,kHAA2D,CAAA;AAE5F;;GAEG;AACH,eAAO,MAAM,uBAAuB,mEAAuE,CAAA;AAC3G,eAAO,MAAM,uBAAuB,kEAA2E,CAAA;AAC/G,eAAO,MAAM,+BAA+B,+HAAmF,CAAA;AAE/H;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,GAAI,QAAQ,MAAM,EAAE,OAAM,0BAAqD,KAAG,UAE9G,CAAA"}
|
|
@@ -9,18 +9,12 @@ export type DNSResponse = PayloadWithSources<DNSResponseFields, DNSSchema>;
|
|
|
9
9
|
* Identity function for determining if an object is a DNSResponse payload
|
|
10
10
|
*/
|
|
11
11
|
export declare const isDNSResponse: (x?: unknown | null) => x is DNSResponse;
|
|
12
|
-
export declare const asDNSResponse:
|
|
13
|
-
|
|
14
|
-
<TType extends DNSResponse>(value: import(".store/@xylabs-promise-npm-4.11.2-66516e0826/package").AnyNonPromise, assert: import("@xylabs/object").StringOrAlertFunction<DNSResponse>, config?: import("@xylabs/object").TypeCheckConfig): TType;
|
|
15
|
-
};
|
|
16
|
-
export declare const asOptionalDNSResponse: <TType extends DNSResponse>(value: import(".store/@xylabs-promise-npm-4.11.2-66516e0826/package").AnyNonPromise) => TType | undefined;
|
|
12
|
+
export declare const asDNSResponse: import("@xylabs/object").AsTypeFunction<DNSResponse>;
|
|
13
|
+
export declare const asOptionalDNSResponse: (value: import(".store/@xylabs-promise-npm-4.12.31-6620a7e715/package").AnyNonPromise) => DNSResponse | undefined;
|
|
17
14
|
/**
|
|
18
15
|
* Identity function for determining if an object is a DNSResponse payload with sources
|
|
19
16
|
*/
|
|
20
17
|
export declare const isDNSResponseWithSources: (x?: unknown | null) => x is WithSources<DNSResponse>;
|
|
21
|
-
export declare const asDNSResponseWithSources:
|
|
22
|
-
|
|
23
|
-
<TType extends WithSources<DNSResponse>>(value: import(".store/@xylabs-promise-npm-4.11.2-66516e0826/package").AnyNonPromise, assert: import("@xylabs/object").StringOrAlertFunction<WithSources<DNSResponse>>, config?: import("@xylabs/object").TypeCheckConfig): TType;
|
|
24
|
-
};
|
|
25
|
-
export declare const asOptionalDNSResponseWithSources: <TType extends WithSources<DNSResponse>>(value: import(".store/@xylabs-promise-npm-4.11.2-66516e0826/package").AnyNonPromise) => TType | undefined;
|
|
18
|
+
export declare const asDNSResponseWithSources: import("@xylabs/object").AsTypeFunction<WithSources<DNSResponse>>;
|
|
19
|
+
export declare const asOptionalDNSResponseWithSources: (value: import(".store/@xylabs-promise-npm-4.12.31-6620a7e715/package").AnyNonPromise) => WithSources<DNSResponse> | undefined;
|
|
26
20
|
//# sourceMappingURL=Response.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Response.d.ts","sourceRoot":"","sources":["../../../../../src/DNS/Witness/Payload/Response.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAMjF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAExC;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,kBAAkB,CAAC,iBAAiB,EAAE,SAAS,CAAC,CAAA;AAE1E;;GAEG;AACH,eAAO,MAAM,aAAa,0CAAgD,CAAA;AAC1E,eAAO,MAAM,aAAa
|
|
1
|
+
{"version":3,"file":"Response.d.ts","sourceRoot":"","sources":["../../../../../src/DNS/Witness/Payload/Response.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAMjF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAExC;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,kBAAkB,CAAC,iBAAiB,EAAE,SAAS,CAAC,CAAA;AAE1E;;GAEG;AACH,eAAO,MAAM,aAAa,0CAAgD,CAAA;AAC1E,eAAO,MAAM,aAAa,sDAAqD,CAAA;AAC/E,eAAO,MAAM,qBAAqB,mHAA6D,CAAA;AAE/F;;GAEG;AACH,eAAO,MAAM,wBAAwB,uDAA2D,CAAA;AAChG,eAAO,MAAM,wBAAwB,mEAA6E,CAAA;AAClH,eAAO,MAAM,gCAAgC,gIAAqF,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResourceRecord.d.ts","sourceRoot":"","sources":["../../../../src/DNS/types/ResourceRecord.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,qBAAqB,
|
|
1
|
+
{"version":3,"file":"ResourceRecord.d.ts","sourceRoot":"","sources":["../../../../src/DNS/types/ResourceRecord.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,qBAAqB,GAC3B,GAAG,GACH,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,OAAO,GACP,KAAK,GACL,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,MAAM,GACN,KAAK,GACL,KAAK,GACL,OAAO,GACP,OAAO,GACP,IAAI,GACJ,KAAK,GACL,IAAI,GACJ,OAAO,GACP,KAAK,GACL,MAAM,GACN,IAAI,GACJ,MAAM,GACN,UAAU,GACV,KAAK,GACL,KAAK,GACL,IAAI,GACJ,MAAM,GACN,MAAM,GACN,KAAK,GACL,KAAK,GACL,KAAK,GACL,QAAQ,GACR,KAAK,GACL,MAAM,GACN,OAAO,GACP,IAAI,GACJ,MAAM,GACN,IAAI,GACJ,OAAO,GACP,MAAM,GACN,KAAK,GACL,KAAK,GACL,IAAI,GACJ,OAAO,GACP,UAAU,GACV,OAAO,GACP,MAAM,GACN,QAAQ,GACR,OAAO,GACP,OAAO,GACP,YAAY,GACZ,MAAM,GACN,QAAQ,GACR,KAAK,GACL,OAAO,GACP,MAAM,GACN,QAAQ,GACR,KAAK,GACL,SAAS,GACT,YAAY,GACZ,OAAO,GACP,QAAQ,GACR,MAAM,GACN,OAAO,GACP,KAAK,GACL,OAAO,GACP,KAAK,GACL,KAAK,GACL,QAAQ,GACR,KAAK,GACL,KAAK,GACL,KAAK,GACL,IAAI,GACJ,OAAO,GACP,OAAO,GACP,QAAQ,GACR,MAAM,GACN,MAAM,GACN,MAAM,GACN,MAAM,GACN,OAAO,GACP,OAAO,GACP,GAAG,GACH,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,UAAU,GACV,SAAS,GACT,QAAQ,GACR,KAAK,GACL,KAAK,GACL,IAAI,GACJ,KAAK,GAEL,MAAM,GACN,MAAM,CAAA;AAEZ,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,MAAM,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAkHlF,CAAA;AAED,MAAM,MAAM,0BAA0B,GAAG,CAAC,OAAO,sBAAsB,CAAC,CAAC,MAAM,OAAO,sBAAsB,CAAC,CAAA;AAE7G,eAAO,MAAM,iCAAiC,GAAI,OAAO,0BAA0B,KAAG,qBAAqB,GAAG,SAS7G,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResponseCodes.d.ts","sourceRoot":"","sources":["../../../../src/DNS/types/ResponseCodes.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAA;AAEhF,MAAM,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"ResponseCodes.d.ts","sourceRoot":"","sources":["../../../../src/DNS/types/ResponseCodes.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAA;AAEhF,MAAM,MAAM,YAAY,GAClB,SAAS,GACT,SAAS,GACT,UAAU,GACV,UAAU,GACV,QAAQ,GACR,SAAS,GACT,UAAU,GACV,SAAS,GACT,SAAS,GACT,SAAS,GACT,SAAS,GACT,QAAQ,GACR,QAAQ,GACR,SAAS,CAAA;AAEf,eAAO,MAAM,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,YAAY,EAAE,QAAQ,CAAC,CAe9D,CAAA"}
|
|
@@ -26,18 +26,12 @@ export type Domain = Payload<DomainFields, DomainSchema>;
|
|
|
26
26
|
* Identity function for Domain payload
|
|
27
27
|
*/
|
|
28
28
|
export declare const isDomain: (x?: unknown | null) => x is Domain;
|
|
29
|
-
export declare const asDomain:
|
|
30
|
-
|
|
31
|
-
<TType extends Domain>(value: import(".store/@xylabs-promise-npm-4.11.2-66516e0826/package").AnyNonPromise, assert: import("@xylabs/object").StringOrAlertFunction<Domain>, config?: import("@xylabs/object").TypeCheckConfig): TType;
|
|
32
|
-
};
|
|
33
|
-
export declare const asOptionalDomain: <TType extends Domain>(value: import(".store/@xylabs-promise-npm-4.11.2-66516e0826/package").AnyNonPromise) => TType | undefined;
|
|
29
|
+
export declare const asDomain: import("@xylabs/object").AsTypeFunction<Domain>;
|
|
30
|
+
export declare const asOptionalDomain: (value: import(".store/@xylabs-promise-npm-4.12.31-6620a7e715/package").AnyNonPromise) => Domain | undefined;
|
|
34
31
|
/**
|
|
35
32
|
* Identity function for Domain payload with sources
|
|
36
33
|
*/
|
|
37
34
|
export declare const isDomainWithSources: (x?: unknown | null) => x is WithSources<WithSources<Domain>>;
|
|
38
|
-
export declare const asDomainWithSources:
|
|
39
|
-
|
|
40
|
-
<TType extends WithSources<Domain>>(value: import(".store/@xylabs-promise-npm-4.11.2-66516e0826/package").AnyNonPromise, assert: import("@xylabs/object").StringOrAlertFunction<WithSources<Domain>>, config?: import("@xylabs/object").TypeCheckConfig): TType;
|
|
41
|
-
};
|
|
42
|
-
export declare const asOptionalDomainWithSources: <TType extends WithSources<Domain>>(value: import(".store/@xylabs-promise-npm-4.11.2-66516e0826/package").AnyNonPromise) => TType | undefined;
|
|
35
|
+
export declare const asDomainWithSources: import("@xylabs/object").AsTypeFunction<WithSources<Domain>>;
|
|
36
|
+
export declare const asOptionalDomainWithSources: (value: import(".store/@xylabs-promise-npm-4.12.31-6620a7e715/package").AnyNonPromise) => WithSources<Domain> | undefined;
|
|
43
37
|
//# sourceMappingURL=Domain.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Domain.d.ts","sourceRoot":"","sources":["../../../src/Domain/Domain.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAGtE,MAAM,MAAM,YAAY,GAAG,uBAAuB,CAAA;AAClD,eAAO,MAAM,YAAY,EAAE,YAAsC,CAAA;AAEjE;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,KAAK,CAAA;AAElC;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,MAAM,EAAE,MAAM,CAAA;IAEd;;OAEG;IACH,GAAG,EAAE,cAAc,CAAA;CACpB;AAED;;GAEG;AACH,MAAM,MAAM,MAAM,GAAG,OAAO,CAAC,YAAY,EAAE,YAAY,CAAC,CAAA;AAExD;;GAEG;AACH,eAAO,MAAM,QAAQ,qCAA8C,CAAA;AACnE,eAAO,MAAM,QAAQ
|
|
1
|
+
{"version":3,"file":"Domain.d.ts","sourceRoot":"","sources":["../../../src/Domain/Domain.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAGtE,MAAM,MAAM,YAAY,GAAG,uBAAuB,CAAA;AAClD,eAAO,MAAM,YAAY,EAAE,YAAsC,CAAA;AAEjE;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,KAAK,CAAA;AAElC;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,MAAM,EAAE,MAAM,CAAA;IAEd;;OAEG;IACH,GAAG,EAAE,cAAc,CAAA;CACpB;AAED;;GAEG;AACH,MAAM,MAAM,MAAM,GAAG,OAAO,CAAC,YAAY,EAAE,YAAY,CAAC,CAAA;AAExD;;GAEG;AACH,eAAO,MAAM,QAAQ,qCAA8C,CAAA;AACnE,eAAO,MAAM,QAAQ,iDAA2C,CAAA;AAChE,eAAO,MAAM,gBAAgB,8GAAmD,CAAA;AAEhF;;GAEG;AACH,eAAO,MAAM,mBAAmB,+DAAsE,CAAA;AACtG,eAAO,MAAM,mBAAmB,8DAAmE,CAAA;AACnG,eAAO,MAAM,2BAA2B,2HAA2E,CAAA"}
|
|
@@ -16,18 +16,12 @@ export type DomainLease = Payload<DomainLeaseFields, DomainLeaseSchema>;
|
|
|
16
16
|
* Identity function for DomainLease payload
|
|
17
17
|
*/
|
|
18
18
|
export declare const isDomainLease: (x?: unknown | null) => x is DomainLease;
|
|
19
|
-
export declare const asDomainLease:
|
|
20
|
-
|
|
21
|
-
<TType extends DomainLease>(value: import(".store/@xylabs-promise-npm-4.11.2-66516e0826/package").AnyNonPromise, assert: import("@xylabs/object").StringOrAlertFunction<DomainLease>, config?: import("@xylabs/object").TypeCheckConfig): TType;
|
|
22
|
-
};
|
|
23
|
-
export declare const asOptionalDomainLease: <TType extends DomainLease>(value: import(".store/@xylabs-promise-npm-4.11.2-66516e0826/package").AnyNonPromise) => TType | undefined;
|
|
19
|
+
export declare const asDomainLease: import("@xylabs/object").AsTypeFunction<DomainLease>;
|
|
20
|
+
export declare const asOptionalDomainLease: (value: import(".store/@xylabs-promise-npm-4.12.31-6620a7e715/package").AnyNonPromise) => DomainLease | undefined;
|
|
24
21
|
/**
|
|
25
22
|
* Identity function for DomainLease payload with sources
|
|
26
23
|
*/
|
|
27
24
|
export declare const isDomainLeaseWithSources: (x?: unknown | null) => x is WithSources<WithSources<DomainLease>>;
|
|
28
|
-
export declare const asDomainLeaseWithSources:
|
|
29
|
-
|
|
30
|
-
<TType extends WithSources<DomainLease>>(value: import(".store/@xylabs-promise-npm-4.11.2-66516e0826/package").AnyNonPromise, assert: import("@xylabs/object").StringOrAlertFunction<WithSources<DomainLease>>, config?: import("@xylabs/object").TypeCheckConfig): TType;
|
|
31
|
-
};
|
|
32
|
-
export declare const asOptionalDomainLeaseWithSources: <TType extends WithSources<DomainLease>>(value: import(".store/@xylabs-promise-npm-4.11.2-66516e0826/package").AnyNonPromise) => TType | undefined;
|
|
25
|
+
export declare const asDomainLeaseWithSources: import("@xylabs/object").AsTypeFunction<WithSources<DomainLease>>;
|
|
26
|
+
export declare const asOptionalDomainLeaseWithSources: (value: import(".store/@xylabs-promise-npm-4.12.31-6620a7e715/package").AnyNonPromise) => WithSources<DomainLease> | undefined;
|
|
33
27
|
//# sourceMappingURL=DomainLease.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DomainLease.d.ts","sourceRoot":"","sources":["../../../src/Domain/DomainLease.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAGtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAE/C,MAAM,MAAM,iBAAiB,GAAG,6BAA6B,CAAA;AAC7D,eAAO,MAAM,iBAAiB,EAAE,iBAAiD,CAAA;AAEjF;;GAEG;AACH,MAAM,WAAW,iBAAkB,SAAQ,YAAY,EAAE,cAAc;CAAG;AAE1E;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,OAAO,CAAC,iBAAiB,EAAE,iBAAiB,CAAC,CAAA;AAEvE;;GAEG;AACH,eAAO,MAAM,aAAa,0CAAwD,CAAA;AAClF,eAAO,MAAM,aAAa
|
|
1
|
+
{"version":3,"file":"DomainLease.d.ts","sourceRoot":"","sources":["../../../src/Domain/DomainLease.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAGtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAE/C,MAAM,MAAM,iBAAiB,GAAG,6BAA6B,CAAA;AAC7D,eAAO,MAAM,iBAAiB,EAAE,iBAAiD,CAAA;AAEjF;;GAEG;AACH,MAAM,WAAW,iBAAkB,SAAQ,YAAY,EAAE,cAAc;CAAG;AAE1E;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,OAAO,CAAC,iBAAiB,EAAE,iBAAiB,CAAC,CAAA;AAEvE;;GAEG;AACH,eAAO,MAAM,aAAa,0CAAwD,CAAA;AAClF,eAAO,MAAM,aAAa,sDAAqD,CAAA;AAC/E,eAAO,MAAM,qBAAqB,mHAA6D,CAAA;AAE/F;;GAEG;AACH,eAAO,MAAM,wBAAwB,oEAAgF,CAAA;AACrH,eAAO,MAAM,wBAAwB,mEAA6E,CAAA;AAClH,eAAO,MAAM,gCAAgC,gIAAqF,CAAA"}
|
|
@@ -21,18 +21,12 @@ export type DomainRegistration = Payload<DomainRegistrationFields, DomainRegistr
|
|
|
21
21
|
* Identity function for DomainRegistration payload
|
|
22
22
|
*/
|
|
23
23
|
export declare const isDomainRegistration: (x?: unknown | null) => x is DomainRegistration;
|
|
24
|
-
export declare const asDomainRegistration:
|
|
25
|
-
|
|
26
|
-
<TType extends DomainRegistration>(value: import(".store/@xylabs-promise-npm-4.11.2-66516e0826/package").AnyNonPromise, assert: import("@xylabs/object").StringOrAlertFunction<DomainRegistration>, config?: import("@xylabs/object").TypeCheckConfig): TType;
|
|
27
|
-
};
|
|
28
|
-
export declare const asOptionalDomainRegistration: <TType extends DomainRegistration>(value: import(".store/@xylabs-promise-npm-4.11.2-66516e0826/package").AnyNonPromise) => TType | undefined;
|
|
24
|
+
export declare const asDomainRegistration: import("@xylabs/object").AsTypeFunction<DomainRegistration>;
|
|
25
|
+
export declare const asOptionalDomainRegistration: (value: import(".store/@xylabs-promise-npm-4.12.31-6620a7e715/package").AnyNonPromise) => DomainRegistration | undefined;
|
|
29
26
|
/**
|
|
30
27
|
* Identity function for DomainRegistration payload with sources
|
|
31
28
|
*/
|
|
32
29
|
export declare const isDomainRegistrationWithSources: (x?: unknown | null) => x is WithSources<WithSources<DomainRegistration>>;
|
|
33
|
-
export declare const asDomainRegistrationWithSources:
|
|
34
|
-
|
|
35
|
-
<TType extends WithSources<DomainRegistration>>(value: import(".store/@xylabs-promise-npm-4.11.2-66516e0826/package").AnyNonPromise, assert: import("@xylabs/object").StringOrAlertFunction<WithSources<DomainRegistration>>, config?: import("@xylabs/object").TypeCheckConfig): TType;
|
|
36
|
-
};
|
|
37
|
-
export declare const asOptionalDomainRegistrationWithSources: <TType extends WithSources<DomainRegistration>>(value: import(".store/@xylabs-promise-npm-4.11.2-66516e0826/package").AnyNonPromise) => TType | undefined;
|
|
30
|
+
export declare const asDomainRegistrationWithSources: import("@xylabs/object").AsTypeFunction<WithSources<DomainRegistration>>;
|
|
31
|
+
export declare const asOptionalDomainRegistrationWithSources: (value: import(".store/@xylabs-promise-npm-4.12.31-6620a7e715/package").AnyNonPromise) => WithSources<DomainRegistration> | undefined;
|
|
38
32
|
//# sourceMappingURL=DomainRegistration.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DomainRegistration.d.ts","sourceRoot":"","sources":["../../../src/DomainRegistration/DomainRegistration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAE1C,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAGtE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAGtD,eAAO,MAAM,wBAAwB,sCAA0C,CAAA;AAC/E,MAAM,MAAM,wBAAwB,GAAG,OAAO,wBAAwB,CAAA;AAEtE,MAAM,WAAW,wBAAyB,SAAQ,YAAY;IAC5D;;OAEG;IACH,UAAU,EAAE,OAAO,EAAE,CAAA;IACrB;;OAEG;IACH,SAAS,EAAE,OAAO,EAAE,CAAA;CACrB;AAED;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,OAAO,CAAC,wBAAwB,EAAE,wBAAwB,CAAC,CAAA;AAE5F;;GAEG;AACH,eAAO,MAAM,oBAAoB,iDAAsE,CAAA;AACvG,eAAO,MAAM,oBAAoB
|
|
1
|
+
{"version":3,"file":"DomainRegistration.d.ts","sourceRoot":"","sources":["../../../src/DomainRegistration/DomainRegistration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAE1C,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAGtE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAGtD,eAAO,MAAM,wBAAwB,sCAA0C,CAAA;AAC/E,MAAM,MAAM,wBAAwB,GAAG,OAAO,wBAAwB,CAAA;AAEtE,MAAM,WAAW,wBAAyB,SAAQ,YAAY;IAC5D;;OAEG;IACH,UAAU,EAAE,OAAO,EAAE,CAAA;IACrB;;OAEG;IACH,SAAS,EAAE,OAAO,EAAE,CAAA;CACrB;AAED;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,OAAO,CAAC,wBAAwB,EAAE,wBAAwB,CAAC,CAAA;AAE5F;;GAEG;AACH,eAAO,MAAM,oBAAoB,iDAAsE,CAAA;AACvG,eAAO,MAAM,oBAAoB,6DAAmE,CAAA;AACpG,eAAO,MAAM,4BAA4B,0HAA2E,CAAA;AAEpH;;GAEG;AACH,eAAO,MAAM,+BAA+B,2EAA8F,CAAA;AAC1I,eAAO,MAAM,+BAA+B,0EAA2F,CAAA;AACvI,eAAO,MAAM,uCAAuC,uIAAmG,CAAA"}
|
|
@@ -13,20 +13,14 @@ export type DomainRegistrationLease = Payload<DomainRegistrationLeaseFields, Dom
|
|
|
13
13
|
* Identity function for DomainRegistrationLease payload
|
|
14
14
|
*/
|
|
15
15
|
export declare const isDomainRegistrationLease: (x?: unknown | null) => x is DomainRegistrationLease;
|
|
16
|
-
export declare const asDomainRegistrationLease:
|
|
17
|
-
|
|
18
|
-
<TType extends DomainRegistrationLease>(value: import(".store/@xylabs-promise-npm-4.11.2-66516e0826/package").AnyNonPromise, assert: import("@xylabs/object").StringOrAlertFunction<DomainRegistrationLease>, config?: import("@xylabs/object").TypeCheckConfig): TType;
|
|
19
|
-
};
|
|
20
|
-
export declare const asOptionalDomainRegistrationLease: <TType extends DomainRegistrationLease>(value: import(".store/@xylabs-promise-npm-4.11.2-66516e0826/package").AnyNonPromise) => TType | undefined;
|
|
16
|
+
export declare const asDomainRegistrationLease: import("@xylabs/object").AsTypeFunction<DomainRegistrationLease>;
|
|
17
|
+
export declare const asOptionalDomainRegistrationLease: (value: import(".store/@xylabs-promise-npm-4.12.31-6620a7e715/package").AnyNonPromise) => DomainRegistrationLease | undefined;
|
|
21
18
|
/**
|
|
22
19
|
* Identity function for DomainRegistrationLease payload with sources
|
|
23
20
|
*/
|
|
24
21
|
export declare const isDomainRegistrationLeaseWithSources: (x?: unknown | null) => x is WithSources<WithSources<DomainRegistrationLease>>;
|
|
25
|
-
export declare const asDomainRegistrationLeaseWithSources:
|
|
26
|
-
|
|
27
|
-
<TType extends WithSources<DomainRegistrationLease>>(value: import(".store/@xylabs-promise-npm-4.11.2-66516e0826/package").AnyNonPromise, assert: import("@xylabs/object").StringOrAlertFunction<WithSources<DomainRegistrationLease>>, config?: import("@xylabs/object").TypeCheckConfig): TType;
|
|
28
|
-
};
|
|
29
|
-
export declare const asOptionalDomainRegistrationLeaseWithSources: <TType extends WithSources<DomainRegistrationLease>>(value: import(".store/@xylabs-promise-npm-4.11.2-66516e0826/package").AnyNonPromise) => TType | undefined;
|
|
22
|
+
export declare const asDomainRegistrationLeaseWithSources: import("@xylabs/object").AsTypeFunction<WithSources<DomainRegistrationLease>>;
|
|
23
|
+
export declare const asOptionalDomainRegistrationLeaseWithSources: (value: import(".store/@xylabs-promise-npm-4.12.31-6620a7e715/package").AnyNonPromise) => WithSources<DomainRegistrationLease> | undefined;
|
|
30
24
|
/**
|
|
31
25
|
* @deprecated Use isDomainRegistrationLeaseWithSources instead
|
|
32
26
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DomainRegistrationLease.d.ts","sourceRoot":"","sources":["../../../src/DomainRegistration/DomainRegistrationLease.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAGtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAA;AAGvE,eAAO,MAAM,6BAA6B,4CAA+C,CAAA;AACzF,MAAM,MAAM,6BAA6B,GAAG,OAAO,6BAA6B,CAAA;AAEhF,MAAM,WAAW,6BAA8B,SAAQ,wBAAwB,EAAE,cAAc;CAAG;AAElG;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG,OAAO,CAAC,6BAA6B,EAAE,6BAA6B,CAAC,CAAA;AAE3G;;GAEG;AACH,eAAO,MAAM,yBAAyB,sDAAgF,CAAA;AACtH,eAAO,MAAM,yBAAyB
|
|
1
|
+
{"version":3,"file":"DomainRegistrationLease.d.ts","sourceRoot":"","sources":["../../../src/DomainRegistration/DomainRegistrationLease.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAGtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAA;AAGvE,eAAO,MAAM,6BAA6B,4CAA+C,CAAA;AACzF,MAAM,MAAM,6BAA6B,GAAG,OAAO,6BAA6B,CAAA;AAEhF,MAAM,WAAW,6BAA8B,SAAQ,wBAAwB,EAAE,cAAc;CAAG;AAElG;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG,OAAO,CAAC,6BAA6B,EAAE,6BAA6B,CAAC,CAAA;AAE3G;;GAEG;AACH,eAAO,MAAM,yBAAyB,sDAAgF,CAAA;AACtH,eAAO,MAAM,yBAAyB,kEAA6E,CAAA;AACnH,eAAO,MAAM,iCAAiC,+HAAqF,CAAA;AAEnI;;GAEG;AACH,eAAO,MAAM,oCAAoC,gFAAwG,CAAA;AACzJ,eAAO,MAAM,oCAAoC,+EAAqG,CAAA;AACtJ,eAAO,MAAM,4CAA4C,4IACoC,CAAA;AAE7F;;GAEG;AACH,eAAO,MAAM,gCAAgC,gFAAuC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorCodes.d.ts","sourceRoot":"","sources":["../../../../../src/diviner/DomainLeaseEstimateDiviner/ErrorDetails/ErrorCodes.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gDAAgD,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAA;AAG5G,MAAM,MAAM,yDAAyD,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;AAErG,eAAO,MAAM,gDAAgD,EAAE,QAAQ,CACrE,QAAQ,CAAC,MAAM,CAAC,yDAAyD,EAAE,gDAAgD,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"ErrorCodes.d.ts","sourceRoot":"","sources":["../../../../../src/diviner/DomainLeaseEstimateDiviner/ErrorDetails/ErrorCodes.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gDAAgD,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAA;AAG5G,MAAM,MAAM,yDAAyD,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;AAErG,eAAO,MAAM,gDAAgD,EAAE,QAAQ,CACrE,QAAQ,CAAC,MAAM,CAAC,yDAAyD,EAAE,gDAAgD,CAAC,CAAC,GAC3H,sBAAsB,CA6BhB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xyo-network/xns-record-payload-plugins",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"description": "Typescript/Javascript Plugins for XYO Platform",
|
|
5
5
|
"homepage": "https://xyo.network",
|
|
6
6
|
"bugs": {
|
|
@@ -29,29 +29,29 @@
|
|
|
29
29
|
"module": "dist/neutral/index.mjs",
|
|
30
30
|
"types": "dist/types/index.d.ts",
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@xylabs/array": "^4.
|
|
33
|
-
"@xylabs/exists": "^4.
|
|
34
|
-
"@xylabs/hex": "^4.
|
|
35
|
-
"@xylabs/object": "^4.
|
|
36
|
-
"@xyo-network/boundwitness-model": "^
|
|
37
|
-
"@xyo-network/boundwitness-validator": "^
|
|
38
|
-
"@xyo-network/diviner-hash-lease": "^
|
|
39
|
-
"@xyo-network/module-model": "^
|
|
40
|
-
"@xyo-network/payload-builder": "^
|
|
41
|
-
"@xyo-network/payload-model": "^
|
|
42
|
-
"@xyo-network/witness-model": "^
|
|
32
|
+
"@xylabs/array": "^4.12.31",
|
|
33
|
+
"@xylabs/exists": "^4.12.31",
|
|
34
|
+
"@xylabs/hex": "^4.12.31",
|
|
35
|
+
"@xylabs/object": "^4.12.31",
|
|
36
|
+
"@xyo-network/boundwitness-model": "^4.0.1",
|
|
37
|
+
"@xyo-network/boundwitness-validator": "^4.0.1",
|
|
38
|
+
"@xyo-network/diviner-hash-lease": "^4.0.1",
|
|
39
|
+
"@xyo-network/module-model": "^4.0.1",
|
|
40
|
+
"@xyo-network/payload-builder": "^4.0.1",
|
|
41
|
+
"@xyo-network/payload-model": "^4.0.1",
|
|
42
|
+
"@xyo-network/witness-model": "^4.0.1"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@xylabs/ts-scripts-yarn3": "^6.5.
|
|
46
|
-
"@xylabs/tsconfig": "^6.5.
|
|
47
|
-
"@xylabs/vitest-extended": "^4.
|
|
48
|
-
"@xylabs/vitest-matchers": "^4.
|
|
49
|
-
"@xyo-network/boundwitness-builder": "^
|
|
50
|
-
"@xyo-network/wallet": "^
|
|
51
|
-
"@xyo-network/wallet-model": "^
|
|
52
|
-
"knip": "^5.
|
|
45
|
+
"@xylabs/ts-scripts-yarn3": "^6.5.12",
|
|
46
|
+
"@xylabs/tsconfig": "^6.5.12",
|
|
47
|
+
"@xylabs/vitest-extended": "^4.12.31",
|
|
48
|
+
"@xylabs/vitest-matchers": "^4.12.31",
|
|
49
|
+
"@xyo-network/boundwitness-builder": "^4.0.1",
|
|
50
|
+
"@xyo-network/wallet": "^4.0.1",
|
|
51
|
+
"@xyo-network/wallet-model": "^4.0.1",
|
|
52
|
+
"knip": "^5.61.3",
|
|
53
53
|
"typescript": "^5.8.3",
|
|
54
|
-
"vitest": "^3.
|
|
54
|
+
"vitest": "^3.2.4"
|
|
55
55
|
},
|
|
56
56
|
"publishConfig": {
|
|
57
57
|
"access": "public"
|