@xyo-network/xns-record-payload-plugins 3.0.4 → 3.0.6

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.
Files changed (140) hide show
  1. package/dist/browser/DNS/Witness/Config.d.ts +12 -0
  2. package/dist/browser/DNS/Witness/Config.d.ts.map +1 -0
  3. package/dist/browser/DNS/Witness/Params.d.ts +5 -0
  4. package/dist/browser/DNS/Witness/Params.d.ts.map +1 -0
  5. package/dist/browser/DNS/Witness/Payload/Payload.d.ts +4 -0
  6. package/dist/browser/DNS/Witness/Payload/Payload.d.ts.map +1 -0
  7. package/dist/browser/DNS/Witness/Payload/Request.d.ts +9 -0
  8. package/dist/browser/DNS/Witness/Payload/Request.d.ts.map +1 -0
  9. package/dist/browser/DNS/Witness/Payload/Response.d.ts +8 -0
  10. package/dist/browser/DNS/Witness/Payload/Response.d.ts.map +1 -0
  11. package/dist/browser/DNS/Witness/Payload/index.d.ts +4 -0
  12. package/dist/browser/DNS/Witness/Payload/index.d.ts.map +1 -0
  13. package/dist/browser/DNS/Witness/Schema.d.ts +3 -0
  14. package/dist/browser/DNS/Witness/Schema.d.ts.map +1 -0
  15. package/dist/browser/DNS/Witness/index.d.ts +5 -0
  16. package/dist/browser/DNS/Witness/index.d.ts.map +1 -0
  17. package/dist/browser/DNS/index.d.ts +3 -0
  18. package/dist/browser/DNS/index.d.ts.map +1 -0
  19. package/dist/browser/DNS/types/Answer.d.ts +5 -0
  20. package/dist/browser/DNS/types/Answer.d.ts.map +1 -0
  21. package/dist/browser/DNS/types/Header.d.ts +38 -0
  22. package/dist/browser/DNS/types/Header.d.ts.map +1 -0
  23. package/dist/browser/DNS/types/OperationCodes.d.ts +4 -0
  24. package/dist/browser/DNS/types/OperationCodes.d.ts.map +1 -0
  25. package/dist/browser/DNS/types/Record.d.ts +8 -0
  26. package/dist/browser/DNS/types/Record.d.ts.map +1 -0
  27. package/dist/browser/DNS/types/Request.d.ts +13 -0
  28. package/dist/browser/DNS/types/Request.d.ts.map +1 -0
  29. package/dist/browser/DNS/types/ResourceRecord.d.ts +5 -0
  30. package/dist/browser/DNS/types/ResourceRecord.d.ts.map +1 -0
  31. package/dist/browser/DNS/types/Response.d.ts +11 -0
  32. package/dist/browser/DNS/types/Response.d.ts.map +1 -0
  33. package/dist/browser/DNS/types/ResponseCodes.d.ts +4 -0
  34. package/dist/browser/DNS/types/ResponseCodes.d.ts.map +1 -0
  35. package/dist/browser/DNS/types/index.d.ts +9 -0
  36. package/dist/browser/DNS/types/index.d.ts.map +1 -0
  37. package/dist/browser/index.d.ts +1 -0
  38. package/dist/browser/index.d.ts.map +1 -1
  39. package/dist/browser/index.mjs +341 -19
  40. package/dist/browser/index.mjs.map +1 -1
  41. package/dist/neutral/DNS/Witness/Config.d.ts +12 -0
  42. package/dist/neutral/DNS/Witness/Config.d.ts.map +1 -0
  43. package/dist/neutral/DNS/Witness/Params.d.ts +5 -0
  44. package/dist/neutral/DNS/Witness/Params.d.ts.map +1 -0
  45. package/dist/neutral/DNS/Witness/Payload/Payload.d.ts +4 -0
  46. package/dist/neutral/DNS/Witness/Payload/Payload.d.ts.map +1 -0
  47. package/dist/neutral/DNS/Witness/Payload/Request.d.ts +9 -0
  48. package/dist/neutral/DNS/Witness/Payload/Request.d.ts.map +1 -0
  49. package/dist/neutral/DNS/Witness/Payload/Response.d.ts +8 -0
  50. package/dist/neutral/DNS/Witness/Payload/Response.d.ts.map +1 -0
  51. package/dist/neutral/DNS/Witness/Payload/index.d.ts +4 -0
  52. package/dist/neutral/DNS/Witness/Payload/index.d.ts.map +1 -0
  53. package/dist/neutral/DNS/Witness/Schema.d.ts +3 -0
  54. package/dist/neutral/DNS/Witness/Schema.d.ts.map +1 -0
  55. package/dist/neutral/DNS/Witness/index.d.ts +5 -0
  56. package/dist/neutral/DNS/Witness/index.d.ts.map +1 -0
  57. package/dist/neutral/DNS/index.d.ts +3 -0
  58. package/dist/neutral/DNS/index.d.ts.map +1 -0
  59. package/dist/neutral/DNS/types/Answer.d.ts +5 -0
  60. package/dist/neutral/DNS/types/Answer.d.ts.map +1 -0
  61. package/dist/neutral/DNS/types/Header.d.ts +38 -0
  62. package/dist/neutral/DNS/types/Header.d.ts.map +1 -0
  63. package/dist/neutral/DNS/types/OperationCodes.d.ts +4 -0
  64. package/dist/neutral/DNS/types/OperationCodes.d.ts.map +1 -0
  65. package/dist/neutral/DNS/types/Record.d.ts +8 -0
  66. package/dist/neutral/DNS/types/Record.d.ts.map +1 -0
  67. package/dist/neutral/DNS/types/Request.d.ts +13 -0
  68. package/dist/neutral/DNS/types/Request.d.ts.map +1 -0
  69. package/dist/neutral/DNS/types/ResourceRecord.d.ts +5 -0
  70. package/dist/neutral/DNS/types/ResourceRecord.d.ts.map +1 -0
  71. package/dist/neutral/DNS/types/Response.d.ts +11 -0
  72. package/dist/neutral/DNS/types/Response.d.ts.map +1 -0
  73. package/dist/neutral/DNS/types/ResponseCodes.d.ts +4 -0
  74. package/dist/neutral/DNS/types/ResponseCodes.d.ts.map +1 -0
  75. package/dist/neutral/DNS/types/index.d.ts +9 -0
  76. package/dist/neutral/DNS/types/index.d.ts.map +1 -0
  77. package/dist/neutral/index.d.ts +1 -0
  78. package/dist/neutral/index.d.ts.map +1 -1
  79. package/dist/neutral/index.mjs +341 -19
  80. package/dist/neutral/index.mjs.map +1 -1
  81. package/dist/node/DNS/Witness/Config.d.ts +12 -0
  82. package/dist/node/DNS/Witness/Config.d.ts.map +1 -0
  83. package/dist/node/DNS/Witness/Params.d.ts +5 -0
  84. package/dist/node/DNS/Witness/Params.d.ts.map +1 -0
  85. package/dist/node/DNS/Witness/Payload/Payload.d.ts +4 -0
  86. package/dist/node/DNS/Witness/Payload/Payload.d.ts.map +1 -0
  87. package/dist/node/DNS/Witness/Payload/Request.d.ts +9 -0
  88. package/dist/node/DNS/Witness/Payload/Request.d.ts.map +1 -0
  89. package/dist/node/DNS/Witness/Payload/Response.d.ts +8 -0
  90. package/dist/node/DNS/Witness/Payload/Response.d.ts.map +1 -0
  91. package/dist/node/DNS/Witness/Payload/index.d.ts +4 -0
  92. package/dist/node/DNS/Witness/Payload/index.d.ts.map +1 -0
  93. package/dist/node/DNS/Witness/Schema.d.ts +3 -0
  94. package/dist/node/DNS/Witness/Schema.d.ts.map +1 -0
  95. package/dist/node/DNS/Witness/index.d.ts +5 -0
  96. package/dist/node/DNS/Witness/index.d.ts.map +1 -0
  97. package/dist/node/DNS/index.d.ts +3 -0
  98. package/dist/node/DNS/index.d.ts.map +1 -0
  99. package/dist/node/DNS/types/Answer.d.ts +5 -0
  100. package/dist/node/DNS/types/Answer.d.ts.map +1 -0
  101. package/dist/node/DNS/types/Header.d.ts +38 -0
  102. package/dist/node/DNS/types/Header.d.ts.map +1 -0
  103. package/dist/node/DNS/types/OperationCodes.d.ts +4 -0
  104. package/dist/node/DNS/types/OperationCodes.d.ts.map +1 -0
  105. package/dist/node/DNS/types/Record.d.ts +8 -0
  106. package/dist/node/DNS/types/Record.d.ts.map +1 -0
  107. package/dist/node/DNS/types/Request.d.ts +13 -0
  108. package/dist/node/DNS/types/Request.d.ts.map +1 -0
  109. package/dist/node/DNS/types/ResourceRecord.d.ts +5 -0
  110. package/dist/node/DNS/types/ResourceRecord.d.ts.map +1 -0
  111. package/dist/node/DNS/types/Response.d.ts +11 -0
  112. package/dist/node/DNS/types/Response.d.ts.map +1 -0
  113. package/dist/node/DNS/types/ResponseCodes.d.ts +4 -0
  114. package/dist/node/DNS/types/ResponseCodes.d.ts.map +1 -0
  115. package/dist/node/DNS/types/index.d.ts +9 -0
  116. package/dist/node/DNS/types/index.d.ts.map +1 -0
  117. package/dist/node/index.d.ts +1 -0
  118. package/dist/node/index.d.ts.map +1 -1
  119. package/dist/node/index.mjs +341 -19
  120. package/dist/node/index.mjs.map +1 -1
  121. package/package.json +10 -8
  122. package/src/DNS/Witness/Config.ts +24 -0
  123. package/src/DNS/Witness/Params.ts +6 -0
  124. package/src/DNS/Witness/Payload/Payload.ts +4 -0
  125. package/src/DNS/Witness/Payload/Request.ts +40 -0
  126. package/src/DNS/Witness/Payload/Response.ts +29 -0
  127. package/src/DNS/Witness/Payload/index.ts +3 -0
  128. package/src/DNS/Witness/Schema.ts +2 -0
  129. package/src/DNS/Witness/index.ts +4 -0
  130. package/src/DNS/index.ts +2 -0
  131. package/src/DNS/types/Answer.ts +5 -0
  132. package/src/DNS/types/Header.ts +95 -0
  133. package/src/DNS/types/OperationCodes.ts +13 -0
  134. package/src/DNS/types/Record.ts +9 -0
  135. package/src/DNS/types/Request.ts +38 -0
  136. package/src/DNS/types/ResourceRecord.ts +229 -0
  137. package/src/DNS/types/Response.ts +12 -0
  138. package/src/DNS/types/ResponseCodes.ts +34 -0
  139. package/src/DNS/types/index.ts +8 -0
  140. package/src/index.ts +1 -0
@@ -68,50 +68,356 @@ var isDomainLeaseEstimateDivinerValidationErrorDetails = isPayloadOfSchemaType2(
68
68
  var isDomainLeaseEstimateDivinerValidationErrorDetailsWithSources = isPayloadOfSchemaTypeWithSources(DomainLeaseEstimateDivinerValidationErrorDetailsSchema);
69
69
  var isDomainLeaseEstimateDivinerValidationErrorDetailsWithMeta = isPayloadOfSchemaTypeWithMeta(DomainLeaseEstimateDivinerValidationErrorDetailsSchema);
70
70
 
71
- // src/Domain/Domain.ts
71
+ // src/DNS/types/OperationCodes.ts
72
+ var DNSQueryOpcodes = {
73
+ QUERY: 0,
74
+ IQUERY: 1,
75
+ STATUS: 2,
76
+ NOTIFY: 4,
77
+ UPDATE: 5,
78
+ DSO: 6
79
+ };
80
+
81
+ // src/DNS/types/ResponseCodes.ts
82
+ var DNSRcodes = {
83
+ NOERROR: 0,
84
+ FORMERR: 1,
85
+ SERVFAIL: 2,
86
+ NXDOMAIN: 3,
87
+ NOTIMP: 4,
88
+ REFUSED: 5,
89
+ YXDOMAIN: 6,
90
+ YXRRSET: 7,
91
+ NXRRSET: 8,
92
+ NOTAUTH: 9,
93
+ NOTZONE: 10,
94
+ BADSIG: 16,
95
+ BADKEY: 17,
96
+ BADTIME: 18
97
+ };
98
+
99
+ // src/DNS/types/Header.ts
100
+ var StandardRequestHeader = {
101
+ ID: 0,
102
+ QR: 0,
103
+ // Query/Response Flag (0 = Query)
104
+ Opcode: DNSQueryOpcodes.QUERY,
105
+ // Operation Code (0 for standard query)
106
+ AA: 0,
107
+ // Authoritative Answer (0 in query)
108
+ TC: 0,
109
+ // Truncation (0 for non-truncated)
110
+ RD: 1,
111
+ // Recursion Desired (1 if recursion is requested)
112
+ RCODE: DNSRcodes.NOERROR,
113
+ // Response Code (always 0 in query)
114
+ QDCOUNT: 1,
115
+ ANCOUNT: 0,
116
+ NSCOUNT: 0,
117
+ ARCOUNT: 0
118
+ };
119
+
120
+ // src/DNS/types/ResourceRecord.ts
121
+ var DNSResourceRecordTypes = {
122
+ "A": 1,
123
+ // a host address
124
+ "NS": 2,
125
+ // an authoritative name server
126
+ "MD": 3,
127
+ // a mail destination (OBSOLETE - use MX)
128
+ "MF": 4,
129
+ // a mail forwarder (OBSOLETE - use MX)
130
+ "CNAME": 5,
131
+ // the canonical name for an alias
132
+ "SOA": 6,
133
+ // marks the start of a zone of authority
134
+ "MB": 7,
135
+ // a mailbox domain name (EXPERIMENTAL)
136
+ "MG": 8,
137
+ // a mail group member (EXPERIMENTAL)
138
+ "MR": 9,
139
+ // a mail rename domain name (EXPERIMENTAL)
140
+ "NULL": 10,
141
+ // a null RR (EXPERIMENTAL)
142
+ "WKS": 11,
143
+ // a well known service description
144
+ "PTR": 12,
145
+ // a domain name pointer
146
+ "HINFO": 13,
147
+ // host information
148
+ "MINFO": 14,
149
+ // mailbox or mail list information
150
+ "MX": 15,
151
+ // mail exchange
152
+ "TXT": 16,
153
+ // text strings
154
+ "RP": 17,
155
+ // for Responsible Person
156
+ "AFSDB": 18,
157
+ // for AFS Data Base location
158
+ "X25": 19,
159
+ // for X.25 PSDN address
160
+ "ISDN": 20,
161
+ // for ISDN address
162
+ "RT": 21,
163
+ // for Route Through
164
+ "NSAP": 22,
165
+ // for NSAP address, NSAP style A record (DEPRECATED)
166
+ "NSAP-PTR": 23,
167
+ // for domain name pointer, NSAP style (DEPRECATED)
168
+ "SIG": 24,
169
+ // for security signature
170
+ "KEY": 25,
171
+ // for security key
172
+ "PX": 26,
173
+ // X.400 mail mapping information
174
+ "GPOS": 27,
175
+ // Geographical Position
176
+ "AAAA": 28,
177
+ // IP6 Address
178
+ "LOC": 29,
179
+ // Location Information
180
+ "NXT": 30,
181
+ // Next Domain (OBSOLETE)
182
+ "EID": 31,
183
+ // Endpoint Identifier
184
+ "NIMLOC": 32,
185
+ // Nimrod Locator
186
+ "SRV": 33,
187
+ // Server Selection
188
+ "ATMA": 34,
189
+ // ATM Address
190
+ "NAPTR": 35,
191
+ // Naming Authority Pointer
192
+ "KX": 36,
193
+ // Key Exchanger
194
+ "CERT": 37,
195
+ // CERT
196
+ "A6": 38,
197
+ // A6 (OBSOLETE - use AAAA)
198
+ "DNAME": 39,
199
+ // DNAME
200
+ "SINK": 40,
201
+ // SINK
202
+ "OPT": 41,
203
+ // OPT
204
+ "APL": 42,
205
+ // APL
206
+ "DS": 43,
207
+ // Delegation Signer
208
+ "SSHFP": 44,
209
+ // SSH Key Fingerprint
210
+ "IPSECKEY": 45,
211
+ // IPSECKEY
212
+ "RRSIG": 46,
213
+ // RRSIG
214
+ "NSEC": 47,
215
+ // NSEC
216
+ "DNSKEY": 48,
217
+ // DNSKEY
218
+ "DHCID": 49,
219
+ // DHCID
220
+ "NSEC3": 50,
221
+ // NSEC3
222
+ "NSEC3PARAM": 51,
223
+ // NSEC3PARAM
224
+ "TLSA": 52,
225
+ // TLSA
226
+ "SMIMEA": 53,
227
+ // S/MIME cert association
228
+ "HIP": 55,
229
+ // Host Identity Protocol
230
+ "NINFO": 56,
231
+ // NINFO
232
+ "RKEY": 57,
233
+ // RKEY
234
+ "TALINK": 58,
235
+ // Trust Anchor LINK
236
+ "CDS": 59,
237
+ // Child DS
238
+ "CDNSKEY": 60,
239
+ // DNSKEY(s) the Child wants reflected in DS
240
+ "OPENPGPKEY": 61,
241
+ // OpenPGP Key
242
+ "CSYNC": 62,
243
+ // Child-To-Parent Synchronization
244
+ "ZONEMD": 63,
245
+ // Message Digest Over Zone Data
246
+ "SVCB": 64,
247
+ // General-purpose service binding
248
+ "HTTPS": 65,
249
+ // SVCB-compatible type for use with HTTP
250
+ "SPF": 99,
251
+ "UINFO": 100,
252
+ "UID": 101,
253
+ "GID": 102,
254
+ "UNSPEC": 103,
255
+ "NID": 104,
256
+ "L32": 105,
257
+ "L64": 106,
258
+ "LP": 107,
259
+ "EUI48": 108,
260
+ // an EUI-48 address
261
+ "EUI64": 109,
262
+ // an EUI-64 address
263
+ "NXNAME": 128,
264
+ // NXDOMAIN indicator for Compact Denial of Existence
265
+ "TKEY": 249,
266
+ // Transaction Key
267
+ "TSIG": 250,
268
+ // Transaction Signature
269
+ "IXFR": 251,
270
+ // incremental transfer
271
+ "AXFR": 252,
272
+ // transfer of an entire zone
273
+ "MAILB": 253,
274
+ // mailbox-related RRs (MB, MG or MR)
275
+ "MAILA": 254,
276
+ // mail agent RRs (OBSOLETE - see MX)
277
+ "*": 255,
278
+ // A request for some or all records the server has available
279
+ "URI": 256,
280
+ // URI
281
+ "CAA": 257,
282
+ // Certification Authority Restriction
283
+ "AVC": 258,
284
+ // Application Visibility and Control
285
+ "DOA": 259,
286
+ // Digital Object Architecture
287
+ "AMTRELAY": 260,
288
+ // Automatic Multicast Tunneling Relay
289
+ "RESINFO": 261,
290
+ // Resolver Information as Key/Value Pairs
291
+ "WALLET": 262,
292
+ // Public wallet address
293
+ "CLA": 263,
294
+ // BP Convergence Layer Adapter
295
+ "IPN": 264,
296
+ // BP Node Number
297
+ "TA": 32768,
298
+ // DNSSEC Trust Authorities
299
+ "DLV": 32769,
300
+ // DNSSEC Lookaside Validation (OBSOLETE)
301
+ // NOTE: Custom types here chosen within the Private Use Range
302
+ // https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-4
303
+ // https://www.rfc-editor.org/rfc/rfc5226
304
+ // as, per the RFC, the Private Use Range is reserved
305
+ // "For private or local use only, with the type and
306
+ // purpose defined by the local site. No attempt is made to
307
+ // prevent multiple sites from using the same value in
308
+ // different (and incompatible) ways. There is no need for
309
+ // IANA to review such assignments (since IANA does not record
310
+ // them) and assignments are not generally useful for broad
311
+ // interoperability. It is the responsibility of the sites
312
+ // making use of the Private Use range to ensure that no
313
+ // conflicts occur (within the intended scope of use)."
314
+ // If we want to apply for a custom reserved code later
315
+ // on, once the usage is proven enough we can absolutely
316
+ // do that.
317
+ "XYOA": 65432,
318
+ // XYO Address
319
+ "XYOH": 65433
320
+ // XYO Hash
321
+ };
322
+ var findDNSResourceRecordTypesByValue = (value) => {
323
+ for (const key in DNSResourceRecordTypes) {
324
+ const resourceRecordType = key;
325
+ if (DNSResourceRecordTypes[resourceRecordType] === value) {
326
+ return resourceRecordType;
327
+ }
328
+ }
329
+ return void 0;
330
+ };
331
+
332
+ // src/DNS/types/Request.ts
333
+ var getRequestFor = (domain, type = DNSResourceRecordTypes.A) => {
334
+ return {
335
+ ...StandardRequestHeader,
336
+ ID: getRandomId(),
337
+ Question: [{
338
+ name: domain,
339
+ type,
340
+ class: 1
341
+ }]
342
+ };
343
+ };
344
+ var getRandomId = () => {
345
+ return Math.floor(Math.random() * 65536);
346
+ };
347
+
348
+ // src/DNS/Witness/Schema.ts
349
+ var DNSSchema = "network.xyo.dns";
350
+
351
+ // src/DNS/Witness/Config.ts
352
+ var DNSWitnessConfigSchema = `${DNSSchema}.witness.config`;
353
+
354
+ // src/DNS/Witness/Payload/Request.ts
72
355
  import {
73
356
  isPayloadOfSchemaType as isPayloadOfSchemaType3,
74
357
  isPayloadOfSchemaTypeWithMeta as isPayloadOfSchemaTypeWithMeta2,
75
358
  isPayloadOfSchemaTypeWithSources as isPayloadOfSchemaTypeWithSources2
76
359
  } from "@xyo-network/payload-model";
77
- var DomainSchema = "network.xyo.ns.domain";
78
- var isDomain = isPayloadOfSchemaType3(DomainSchema);
79
- var isDomainWithSources = isPayloadOfSchemaTypeWithSources2(DomainSchema);
80
- var isDomainWithMeta = isPayloadOfSchemaTypeWithMeta2(DomainSchema);
360
+ var isDNSRequest = isPayloadOfSchemaType3(DNSSchema);
361
+ var isDNSRequestWithSources = isPayloadOfSchemaTypeWithSources2(DNSSchema);
362
+ var isDNSRequestWithMeta = isPayloadOfSchemaTypeWithMeta2(DNSSchema);
363
+ var getDnsRequestFor = (domain, type = DNSResourceRecordTypes.A) => {
364
+ return { ...getRequestFor(domain, type), schema: DNSSchema };
365
+ };
81
366
 
82
- // src/Domain/DomainLease.ts
367
+ // src/DNS/Witness/Payload/Response.ts
83
368
  import {
84
369
  isPayloadOfSchemaType as isPayloadOfSchemaType4,
85
370
  isPayloadOfSchemaTypeWithMeta as isPayloadOfSchemaTypeWithMeta3,
86
371
  isPayloadOfSchemaTypeWithSources as isPayloadOfSchemaTypeWithSources3
87
372
  } from "@xyo-network/payload-model";
88
- var DomainLeaseSchema = "network.xyo.ns.domain.lease";
89
- var isDomainLease = isPayloadOfSchemaType4(DomainLeaseSchema);
90
- var isDomainLeaseWithSources = isPayloadOfSchemaTypeWithSources3(DomainLeaseSchema);
91
- var isDomainLeaseWithMeta = isPayloadOfSchemaTypeWithMeta3(DomainLeaseSchema);
373
+ var isDNSResponse = isPayloadOfSchemaType4(DNSSchema);
374
+ var isDNSResponseWithSources = isPayloadOfSchemaTypeWithSources3(DNSSchema);
375
+ var isDNSResponseWithMeta = isPayloadOfSchemaTypeWithMeta3(DNSSchema);
92
376
 
93
- // src/DomainRegistration/DomainRegistration.ts
377
+ // src/Domain/Domain.ts
94
378
  import {
95
379
  isPayloadOfSchemaType as isPayloadOfSchemaType5,
96
380
  isPayloadOfSchemaTypeWithMeta as isPayloadOfSchemaTypeWithMeta4,
97
381
  isPayloadOfSchemaTypeWithSources as isPayloadOfSchemaTypeWithSources4
98
382
  } from "@xyo-network/payload-model";
99
- var DomainRegistrationSchema = `${DomainSchema}.registration`;
100
- var isDomainRegistration = isPayloadOfSchemaType5(DomainRegistrationSchema);
101
- var isDomainRegistrationWithSources = isPayloadOfSchemaTypeWithSources4(DomainRegistrationSchema);
102
- var isDomainRegistrationWithMeta = isPayloadOfSchemaTypeWithMeta4(DomainRegistrationSchema);
383
+ var DomainSchema = "network.xyo.ns.domain";
384
+ var isDomain = isPayloadOfSchemaType5(DomainSchema);
385
+ var isDomainWithSources = isPayloadOfSchemaTypeWithSources4(DomainSchema);
386
+ var isDomainWithMeta = isPayloadOfSchemaTypeWithMeta4(DomainSchema);
103
387
 
104
- // src/DomainRegistration/DomainRegistrationLease.ts
388
+ // src/Domain/DomainLease.ts
105
389
  import {
106
390
  isPayloadOfSchemaType as isPayloadOfSchemaType6,
107
391
  isPayloadOfSchemaTypeWithMeta as isPayloadOfSchemaTypeWithMeta5,
108
392
  isPayloadOfSchemaTypeWithSources as isPayloadOfSchemaTypeWithSources5
109
393
  } from "@xyo-network/payload-model";
394
+ var DomainLeaseSchema = "network.xyo.ns.domain.lease";
395
+ var isDomainLease = isPayloadOfSchemaType6(DomainLeaseSchema);
396
+ var isDomainLeaseWithSources = isPayloadOfSchemaTypeWithSources5(DomainLeaseSchema);
397
+ var isDomainLeaseWithMeta = isPayloadOfSchemaTypeWithMeta5(DomainLeaseSchema);
398
+
399
+ // src/DomainRegistration/DomainRegistration.ts
400
+ import {
401
+ isPayloadOfSchemaType as isPayloadOfSchemaType7,
402
+ isPayloadOfSchemaTypeWithMeta as isPayloadOfSchemaTypeWithMeta6,
403
+ isPayloadOfSchemaTypeWithSources as isPayloadOfSchemaTypeWithSources6
404
+ } from "@xyo-network/payload-model";
405
+ var DomainRegistrationSchema = `${DomainSchema}.registration`;
406
+ var isDomainRegistration = isPayloadOfSchemaType7(DomainRegistrationSchema);
407
+ var isDomainRegistrationWithSources = isPayloadOfSchemaTypeWithSources6(DomainRegistrationSchema);
408
+ var isDomainRegistrationWithMeta = isPayloadOfSchemaTypeWithMeta6(DomainRegistrationSchema);
409
+
410
+ // src/DomainRegistration/DomainRegistrationLease.ts
411
+ import {
412
+ isPayloadOfSchemaType as isPayloadOfSchemaType8,
413
+ isPayloadOfSchemaTypeWithMeta as isPayloadOfSchemaTypeWithMeta7,
414
+ isPayloadOfSchemaTypeWithSources as isPayloadOfSchemaTypeWithSources7
415
+ } from "@xyo-network/payload-model";
110
416
  var DomainRegistrationLeaseSchema = `${DomainRegistrationSchema}.lease`;
111
- var isDomainRegistrationLease = isPayloadOfSchemaType6(DomainRegistrationLeaseSchema);
112
- var isDomainRegistrationLeaseWithSources = isPayloadOfSchemaTypeWithSources5(DomainRegistrationLeaseSchema);
417
+ var isDomainRegistrationLease = isPayloadOfSchemaType8(DomainRegistrationLeaseSchema);
418
+ var isDomainRegistrationLeaseWithSources = isPayloadOfSchemaTypeWithSources7(DomainRegistrationLeaseSchema);
113
419
  var isDomainRegistrationLeaseSources = isDomainRegistrationLeaseWithSources;
114
- var isDomainRegistrationLeaseWithMeta = isPayloadOfSchemaTypeWithMeta5(DomainRegistrationLeaseSchema);
420
+ var isDomainRegistrationLeaseWithMeta = isPayloadOfSchemaTypeWithMeta7(DomainRegistrationLeaseSchema);
115
421
  var isDomainRegistrationLeaseMeta = isDomainRegistrationLeaseWithMeta;
116
422
 
117
423
  // src/Duration/validation/validateBoundWitness.ts
@@ -158,14 +464,30 @@ var validateBoundWitnessWithDuration = async (recordBw, recordPayload) => {
158
464
  };
159
465
  export {
160
466
  AddressRecordSchema,
467
+ DNSQueryOpcodes,
468
+ DNSRcodes,
469
+ DNSResourceRecordTypes,
470
+ DNSSchema,
471
+ DNSWitnessConfigSchema,
161
472
  DomainLeaseEstimateDivinerErrorDetailsDictionary,
162
473
  DomainLeaseEstimateDivinerValidationErrorDetailsSchema,
163
474
  DomainLeaseSchema,
164
475
  DomainRegistrationLeaseSchema,
165
476
  DomainRegistrationSchema,
166
477
  DomainSchema,
478
+ StandardRequestHeader,
479
+ findDNSResourceRecordTypesByValue,
480
+ getDnsRequestFor,
481
+ getRandomId,
482
+ getRequestFor,
167
483
  isAddressRecord,
168
484
  isAddressRecordWithMeta,
485
+ isDNSRequest,
486
+ isDNSRequestWithMeta,
487
+ isDNSRequestWithSources,
488
+ isDNSResponse,
489
+ isDNSResponseWithMeta,
490
+ isDNSResponseWithSources,
169
491
  isDomain,
170
492
  isDomainLease,
171
493
  isDomainLeaseEstimateDivinerValidationErrorDetails,
@@ -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/Domain/Domain.ts","../../src/Domain/DomainLease.ts","../../src/DomainRegistration/DomainRegistration.ts","../../src/DomainRegistration/DomainRegistrationLease.ts","../../src/Duration/validation/validateBoundWitness.ts","../../src/Duration/validation/validateBoundWitnessAndDuration.ts","../../src/Duration/validation/validateDuration.ts","../../src/Duration/validation/validateBoundWitnessWithDuration.ts"],"sourcesContent":["import type { Address } from '@xylabs/hex'\nimport type { Payload, WithMeta } 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)\nexport const isAddressRecordWithMeta = isPayloadOfSchemaType<WithMeta<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 {\n isPayloadOfSchemaType, isPayloadOfSchemaTypeWithMeta, isPayloadOfSchemaTypeWithSources,\n} 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\n/**\n * Identity function for DomainLeaseEstimateDivinerValidationErrorDetails payload with meta\n */\nexport const isDomainLeaseEstimateDivinerValidationErrorDetailsWithMeta\n = isPayloadOfSchemaTypeWithMeta<DomainLeaseEstimateDivinerValidationErrorDetails>(DomainLeaseEstimateDivinerValidationErrorDetailsSchema)\n","import type { Payload } from '@xyo-network/payload-model'\nimport {\n isPayloadOfSchemaType, isPayloadOfSchemaTypeWithMeta, isPayloadOfSchemaTypeWithSources,\n} 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)\n\n/**\n * Identity function for Domain payload with sources\n */\nexport const isDomainWithSources = isPayloadOfSchemaTypeWithSources<Domain>(DomainSchema)\n\n/**\n * Identity function for Domain payload with meta\n */\nexport const isDomainWithMeta = isPayloadOfSchemaTypeWithMeta<Domain>(DomainSchema)\n","import type { Payload } from '@xyo-network/payload-model'\nimport {\n isPayloadOfSchemaType, isPayloadOfSchemaTypeWithMeta, isPayloadOfSchemaTypeWithSources,\n} 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)\n\n/**\n * Identity function for DomainLease payload with sources\n */\nexport const isDomainLeaseWithSources = isPayloadOfSchemaTypeWithSources<DomainLease>(DomainLeaseSchema)\n\n/**\n * Identity function for DomainLease payload with meta\n */\nexport const isDomainLeaseWithMeta = isPayloadOfSchemaTypeWithMeta<DomainLease>(DomainLeaseSchema)\n","import type { Address } from '@xylabs/hex'\nimport type { Payload } from '@xyo-network/payload-model'\nimport {\n isPayloadOfSchemaType, isPayloadOfSchemaTypeWithMeta, isPayloadOfSchemaTypeWithSources,\n} 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)\n\n/**\n * Identity function for DomainRegistration payload with sources\n */\nexport const isDomainRegistrationWithSources = isPayloadOfSchemaTypeWithSources<DomainRegistration>(DomainRegistrationSchema)\n\n/**\n * Identity function for DomainRegistration payload with meta\n */\nexport const isDomainRegistrationWithMeta = isPayloadOfSchemaTypeWithMeta<DomainRegistration>(DomainRegistrationSchema)\n","import type { Payload } from '@xyo-network/payload-model'\nimport {\n isPayloadOfSchemaType, isPayloadOfSchemaTypeWithMeta, isPayloadOfSchemaTypeWithSources,\n} 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)\n\n/**\n * Identity function for DomainRegistrationLease payload with sources\n */\nexport const isDomainRegistrationLeaseWithSources = isPayloadOfSchemaTypeWithSources<DomainRegistrationLease>(DomainRegistrationLeaseSchema)\n/**\n * @deprecated Use isDomainRegistrationLeaseWithSources instead\n */\nexport const isDomainRegistrationLeaseSources = isDomainRegistrationLeaseWithSources\n\n/**\n * Identity function for DomainRegistrationLease payload with meta\n */\nexport const isDomainRegistrationLeaseWithMeta = isPayloadOfSchemaTypeWithMeta<DomainRegistrationLease>(DomainRegistrationLeaseSchema)\n/**\n * @deprecated Use isDomainRegistrationLeaseWithMeta instead\n */\nexport const isDomainRegistrationLeaseMeta = isDomainRegistrationLeaseWithMeta\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 if (!recordIsTemporallyValidToBoundWitness(recordBw, recordPayload)) return false\n return true\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\nconst recordIsTemporallyValidToBoundWitness = (recordBw: BoundWitness, recordPayload: Payload<DurationFields>): boolean => {\n const { timestamp } = recordBw\n const { exp } = recordPayload\n return exp > timestamp\n}\n","// import { isAddress } from '@xylabs/hex'\nimport 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 if (!isWithinDelegatedTimeframe(recordPayload)) return false\n return true\n}\n\n// const isValidAddress = (recordPayload: Payload<DomainLeaseFields>): boolean => {\n// return isAddress(recordPayload.nameserver, { prefix: false })\n// }\n\nconst 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 if (!(await validateBoundWitnessAndDuration(recordBw, recordPayload))) return false\n return true\n}\n"],"mappings":";AAEA,SAAS,6BAA6B;AAK/B,IAAM,sBAA2C;AAcjD,IAAM,kBAAkB,sBAAqC,mBAAmB;AAChF,IAAM,0BAA0B,sBAA+C,mBAAmB;;;ACtBlG,IAAM,yDACT;;;ACKG,IAAM,mDAGT;AAAA,EACF,GAAG;AAAA,IACD,MA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AAEA,IAAM,wCAAwC,CAAC,UAAwB,kBAAoD;AACzH,QAAM,EAAE,UAAU,IAAI;AACtB,QAAM,EAAE,IAAI,IAAI;AAChB,SAAO,MAAM;AACf;;;AChBO,IAAM,mBAAmB,CAAC,kBAAoD;AAEnF,MAAI,CAAC,2BAA2B,aAAa,EAAG,QAAO;AACvD,SAAO;AACT;AAMA,IAAM,6BAA6B,CAAC,eAAwC,MAAM,KAAK,IAAI,MAAe;AAExG,SAAO,cAAc,MAAM,OAAO,MAAM,cAAc;AACxD;;;ACXO,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,MAAI,CAAE,MAAM,gCAAgC,UAAU,aAAa,EAAI,QAAO;AAC9E,SAAO;AACT;","names":["isPayloadOfSchemaType","isPayloadOfSchemaType","isPayloadOfSchemaType","isPayloadOfSchemaTypeWithMeta","isPayloadOfSchemaTypeWithSources","isPayloadOfSchemaType","isPayloadOfSchemaTypeWithMeta","isPayloadOfSchemaTypeWithSources","isPayloadOfSchemaType","isPayloadOfSchemaTypeWithMeta","isPayloadOfSchemaTypeWithSources","isPayloadOfSchemaType","isPayloadOfSchemaTypeWithSources","isPayloadOfSchemaTypeWithMeta","isPayloadOfSchemaType","isPayloadOfSchemaTypeWithMeta","isPayloadOfSchemaTypeWithSources","isPayloadOfSchemaType","isPayloadOfSchemaTypeWithSources","isPayloadOfSchemaTypeWithMeta"]}
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/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/Domain/Domain.ts","../../src/Domain/DomainLease.ts","../../src/DomainRegistration/DomainRegistration.ts","../../src/DomainRegistration/DomainRegistrationLease.ts","../../src/Duration/validation/validateBoundWitness.ts","../../src/Duration/validation/validateBoundWitnessAndDuration.ts","../../src/Duration/validation/validateDuration.ts","../../src/Duration/validation/validateBoundWitnessWithDuration.ts"],"sourcesContent":["import type { Address } from '@xylabs/hex'\nimport type { Payload, WithMeta } 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)\nexport const isAddressRecordWithMeta = isPayloadOfSchemaType<WithMeta<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 {\n isPayloadOfSchemaType, isPayloadOfSchemaTypeWithMeta, isPayloadOfSchemaTypeWithSources,\n} 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\n/**\n * Identity function for DomainLeaseEstimateDivinerValidationErrorDetails payload with meta\n */\nexport const isDomainLeaseEstimateDivinerValidationErrorDetailsWithMeta\n = isPayloadOfSchemaTypeWithMeta<DomainLeaseEstimateDivinerValidationErrorDetails>(DomainLeaseEstimateDivinerValidationErrorDetailsSchema)\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, 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, 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 domain lease registrant diviner to be used to determine the domain lease registrant\n * for XNS domains\n */\n domainLeaseRegistrantDiviner?: 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 type { PayloadWithSources } from '@xyo-network/payload-model'\nimport {\n isPayloadOfSchemaType,\n isPayloadOfSchemaTypeWithMeta,\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 = PayloadWithSources<DNSRequestFields, DNSSchema>\n\n/**\n * Identity function for determining if an object is a DNSRequest payload\n */\nexport const isDNSRequest = isPayloadOfSchemaType<DNSRequest>(DNSSchema)\n\n/**\n * Identity function for determining if an object is a DNSRequest payload with sources\n */\nexport const isDNSRequestWithSources = isPayloadOfSchemaTypeWithSources<DNSRequest>(DNSSchema)\n\n/**\n * Identity function for determining if an object is a DNSRequest payload with meta\n */\nexport const isDNSRequestWithMeta = isPayloadOfSchemaTypeWithMeta<DNSRequest>(DNSSchema)\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 type { PayloadWithSources } from '@xyo-network/payload-model'\nimport {\n isPayloadOfSchemaType,\n isPayloadOfSchemaTypeWithMeta,\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)\n\n/**\n * Identity function for determining if an object is a DNSResponse payload with sources\n */\nexport const isDNSResponseWithSources = isPayloadOfSchemaTypeWithSources<DNSResponse>(DNSSchema)\n\n/**\n * Identity function for determining if an object is a DNSResponse payload with meta\n */\nexport const isDNSResponseWithMeta = isPayloadOfSchemaTypeWithMeta<DNSResponse>(DNSSchema)\n","import type { Payload } from '@xyo-network/payload-model'\nimport {\n isPayloadOfSchemaType, isPayloadOfSchemaTypeWithMeta, isPayloadOfSchemaTypeWithSources,\n} 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)\n\n/**\n * Identity function for Domain payload with sources\n */\nexport const isDomainWithSources = isPayloadOfSchemaTypeWithSources<Domain>(DomainSchema)\n\n/**\n * Identity function for Domain payload with meta\n */\nexport const isDomainWithMeta = isPayloadOfSchemaTypeWithMeta<Domain>(DomainSchema)\n","import type { Payload } from '@xyo-network/payload-model'\nimport {\n isPayloadOfSchemaType, isPayloadOfSchemaTypeWithMeta, isPayloadOfSchemaTypeWithSources,\n} 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)\n\n/**\n * Identity function for DomainLease payload with sources\n */\nexport const isDomainLeaseWithSources = isPayloadOfSchemaTypeWithSources<DomainLease>(DomainLeaseSchema)\n\n/**\n * Identity function for DomainLease payload with meta\n */\nexport const isDomainLeaseWithMeta = isPayloadOfSchemaTypeWithMeta<DomainLease>(DomainLeaseSchema)\n","import type { Address } from '@xylabs/hex'\nimport type { Payload } from '@xyo-network/payload-model'\nimport {\n isPayloadOfSchemaType, isPayloadOfSchemaTypeWithMeta, isPayloadOfSchemaTypeWithSources,\n} 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)\n\n/**\n * Identity function for DomainRegistration payload with sources\n */\nexport const isDomainRegistrationWithSources = isPayloadOfSchemaTypeWithSources<DomainRegistration>(DomainRegistrationSchema)\n\n/**\n * Identity function for DomainRegistration payload with meta\n */\nexport const isDomainRegistrationWithMeta = isPayloadOfSchemaTypeWithMeta<DomainRegistration>(DomainRegistrationSchema)\n","import type { Payload } from '@xyo-network/payload-model'\nimport {\n isPayloadOfSchemaType, isPayloadOfSchemaTypeWithMeta, isPayloadOfSchemaTypeWithSources,\n} 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)\n\n/**\n * Identity function for DomainRegistrationLease payload with sources\n */\nexport const isDomainRegistrationLeaseWithSources = isPayloadOfSchemaTypeWithSources<DomainRegistrationLease>(DomainRegistrationLeaseSchema)\n/**\n * @deprecated Use isDomainRegistrationLeaseWithSources instead\n */\nexport const isDomainRegistrationLeaseSources = isDomainRegistrationLeaseWithSources\n\n/**\n * Identity function for DomainRegistrationLease payload with meta\n */\nexport const isDomainRegistrationLeaseWithMeta = isPayloadOfSchemaTypeWithMeta<DomainRegistrationLease>(DomainRegistrationLeaseSchema)\n/**\n * @deprecated Use isDomainRegistrationLeaseWithMeta instead\n */\nexport const isDomainRegistrationLeaseMeta = isDomainRegistrationLeaseWithMeta\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 if (!recordIsTemporallyValidToBoundWitness(recordBw, recordPayload)) return false\n return true\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\nconst recordIsTemporallyValidToBoundWitness = (recordBw: BoundWitness, recordPayload: Payload<DurationFields>): boolean => {\n const { timestamp } = recordBw\n const { exp } = recordPayload\n return exp > timestamp\n}\n","// import { isAddress } from '@xylabs/hex'\nimport 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 if (!isWithinDelegatedTimeframe(recordPayload)) return false\n return true\n}\n\n// const isValidAddress = (recordPayload: Payload<DomainLeaseFields>): boolean => {\n// return isAddress(recordPayload.nameserver, { prefix: false })\n// }\n\nconst 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 if (!(await validateBoundWitnessAndDuration(recordBw, recordPayload))) return false\n return true\n}\n"],"mappings":";AAEA,SAAS,6BAA6B;AAK/B,IAAM,sBAA2C;AAcjD,IAAM,kBAAkB,sBAAqC,mBAAmB;AAChF,IAAM,0BAA0B,sBAA+C,mBAAmB;;;ACtBlG,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;AAA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kBAAoD;AAEnF,MAAI,CAAC,2BAA2B,aAAa,EAAG,QAAO;AACvD,SAAO;AACT;AAMA,IAAM,6BAA6B,CAAC,eAAwC,MAAM,KAAK,IAAI,MAAe;AAExG,SAAO,cAAc,MAAM,OAAO,MAAM,cAAc;AACxD;;;ACXO,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,MAAI,CAAE,MAAM,gCAAgC,UAAU,aAAa,EAAI,QAAO;AAC9E,SAAO;AACT;","names":["isPayloadOfSchemaType","isPayloadOfSchemaType","isPayloadOfSchemaType","isPayloadOfSchemaTypeWithMeta","isPayloadOfSchemaTypeWithSources","isPayloadOfSchemaType","isPayloadOfSchemaTypeWithSources","isPayloadOfSchemaTypeWithMeta","isPayloadOfSchemaType","isPayloadOfSchemaTypeWithMeta","isPayloadOfSchemaTypeWithSources","isPayloadOfSchemaType","isPayloadOfSchemaTypeWithSources","isPayloadOfSchemaTypeWithMeta","isPayloadOfSchemaType","isPayloadOfSchemaTypeWithMeta","isPayloadOfSchemaTypeWithSources","isPayloadOfSchemaType","isPayloadOfSchemaTypeWithMeta","isPayloadOfSchemaTypeWithSources","isPayloadOfSchemaType","isPayloadOfSchemaTypeWithMeta","isPayloadOfSchemaTypeWithSources","isPayloadOfSchemaType","isPayloadOfSchemaTypeWithSources","isPayloadOfSchemaTypeWithMeta","isPayloadOfSchemaType","isPayloadOfSchemaTypeWithMeta","isPayloadOfSchemaTypeWithSources","isPayloadOfSchemaType","isPayloadOfSchemaTypeWithSources","isPayloadOfSchemaTypeWithMeta"]}
@@ -0,0 +1,12 @@
1
+ import type { ModuleIdentifier } from '@xyo-network/module-model';
2
+ import type { WitnessConfig } from '@xyo-network/witness-model';
3
+ import type { DNSResourceRecordType } from '../types/index.ts';
4
+ import { DNSSchema } from './Schema.ts';
5
+ export type DNSWitnessConfigSchema = `${DNSSchema}.witness.config`;
6
+ export declare const DNSWitnessConfigSchema: DNSWitnessConfigSchema;
7
+ export type DNSWitnessConfig = WitnessConfig<{
8
+ domainLeaseRegistrantDiviner?: ModuleIdentifier;
9
+ schema: DNSWitnessConfigSchema;
10
+ supportedResources?: DNSResourceRecordType[];
11
+ }>;
12
+ //# sourceMappingURL=Config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["../../../../src/DNS/Witness/Config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AACjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAE/D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAA;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAEvC,MAAM,MAAM,sBAAsB,GAAG,GAAG,SAAS,iBAAiB,CAAA;AAClE,eAAO,MAAM,sBAAsB,EAAE,sBAAsD,CAAA;AAE3F,MAAM,MAAM,gBAAgB,GAAG,aAAa,CAAC;IAK3C,4BAA4B,CAAC,EAAE,gBAAgB,CAAA;IAI/C,MAAM,EAAE,sBAAsB,CAAA;IAI9B,kBAAkB,CAAC,EAAE,qBAAqB,EAAE,CAAA;CAC7C,CAAC,CAAA"}
@@ -0,0 +1,5 @@
1
+ import type { AnyConfigSchema } from '@xyo-network/module-model';
2
+ import type { WitnessParams } from '@xyo-network/witness-model';
3
+ import type { DNSWitnessConfig } from './Config.ts';
4
+ export type DNSWitnessParams = WitnessParams<AnyConfigSchema<DNSWitnessConfig>>;
5
+ //# sourceMappingURL=Params.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Params.d.ts","sourceRoot":"","sources":["../../../../src/DNS/Witness/Params.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAChE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAE/D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAEnD,MAAM,MAAM,gBAAgB,GAAG,aAAa,CAAC,eAAe,CAAC,gBAAgB,CAAC,CAAC,CAAA"}
@@ -0,0 +1,4 @@
1
+ import type { DNSRequest } from './Request.ts';
2
+ import type { DNSResponse } from './Response.ts';
3
+ export type DNS = DNSRequest | DNSResponse;
4
+ //# sourceMappingURL=Payload.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Payload.d.ts","sourceRoot":"","sources":["../../../../../src/DNS/Witness/Payload/Payload.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAC9C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAEhD,MAAM,MAAM,GAAG,GAAG,UAAU,GAAG,WAAW,CAAA"}
@@ -0,0 +1,9 @@
1
+ import type { PayloadWithSources } from '@xyo-network/payload-model';
2
+ import type { DNSRequestFields, DNSResourceRecordTypeValue } from '../../types/index.ts';
3
+ import { DNSSchema } from '../Schema.ts';
4
+ export type DNSRequest = PayloadWithSources<DNSRequestFields, DNSSchema>;
5
+ export declare const isDNSRequest: (x?: unknown | null) => x is DNSRequest;
6
+ export declare const isDNSRequestWithSources: (x?: unknown | null) => x is import("@xyo-network/payload-model").WithSources<DNSRequest>;
7
+ export declare const isDNSRequestWithMeta: (x?: unknown | null) => x is import("@xyo-network/payload-model").WithMeta<DNSRequest>;
8
+ export declare const getDnsRequestFor: (domain: string, type?: DNSResourceRecordTypeValue) => DNSRequest;
9
+ //# sourceMappingURL=Request.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Request.d.ts","sourceRoot":"","sources":["../../../../../src/DNS/Witness/Payload/Request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAOpE,OAAO,KAAK,EAAE,gBAAgB,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAA;AAExF,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAKxC,MAAM,MAAM,UAAU,GAAG,kBAAkB,CAAC,gBAAgB,EAAE,SAAS,CAAC,CAAA;AAKxE,eAAO,MAAM,YAAY,yCAA+C,CAAA;AAKxE,eAAO,MAAM,uBAAuB,2FAA0D,CAAA;AAK9F,eAAO,MAAM,oBAAoB,wFAAuD,CAAA;AAQxF,eAAO,MAAM,gBAAgB,WAAY,MAAM,SAAQ,0BAA0B,KAA8B,UAE9G,CAAA"}
@@ -0,0 +1,8 @@
1
+ import type { PayloadWithSources } from '@xyo-network/payload-model';
2
+ import type { DNSResponseFields } from '../../types/index.ts';
3
+ import { DNSSchema } from '../Schema.ts';
4
+ export type DNSResponse = PayloadWithSources<DNSResponseFields, DNSSchema>;
5
+ export declare const isDNSResponse: (x?: unknown | null) => x is DNSResponse;
6
+ export declare const isDNSResponseWithSources: (x?: unknown | null) => x is import("@xyo-network/payload-model").WithSources<DNSResponse>;
7
+ export declare const isDNSResponseWithMeta: (x?: unknown | null) => x is import("@xyo-network/payload-model").WithMeta<DNSResponse>;
8
+ //# sourceMappingURL=Response.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Response.d.ts","sourceRoot":"","sources":["../../../../../src/DNS/Witness/Payload/Response.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAOpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAKxC,MAAM,MAAM,WAAW,GAAG,kBAAkB,CAAC,iBAAiB,EAAE,SAAS,CAAC,CAAA;AAK1E,eAAO,MAAM,aAAa,0CAAgD,CAAA;AAK1E,eAAO,MAAM,wBAAwB,4FAA2D,CAAA;AAKhG,eAAO,MAAM,qBAAqB,yFAAwD,CAAA"}
@@ -0,0 +1,4 @@
1
+ export * from './Payload.ts';
2
+ export * from './Request.ts';
3
+ export * from './Response.ts';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/DNS/Witness/Payload/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,cAAc,CAAA;AAC5B,cAAc,eAAe,CAAA"}
@@ -0,0 +1,3 @@
1
+ export type DNSSchema = 'network.xyo.dns';
2
+ export declare const DNSSchema: DNSSchema;
3
+ //# sourceMappingURL=Schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Schema.d.ts","sourceRoot":"","sources":["../../../../src/DNS/Witness/Schema.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG,iBAAiB,CAAA;AACzC,eAAO,MAAM,SAAS,EAAE,SAA6B,CAAA"}