Skip to content

Commit

Permalink
chore: update to npm 7, drop cjs support
Browse files Browse the repository at this point in the history
BREAKING CHANGE: drop cjs support, drop node 10 support
  • Loading branch information
Nebulis committed Aug 3, 2021
1 parent 06f3ba0 commit 2a7f7b5
Show file tree
Hide file tree
Showing 11 changed files with 28,077 additions and 4,971 deletions.
16 changes: 0 additions & 16 deletions .babelrc

This file was deleted.

1 change: 0 additions & 1 deletion .npmrc

This file was deleted.

1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
16
3 changes: 0 additions & 3 deletions .prettierrc

This file was deleted.

93 changes: 47 additions & 46 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ A valid OpenAttestation DNS-TXT record looks like:

Validation is run on all retrieved records to ensure they conform to the expected format, and records that fail validation will simply be omitted from the returned results.


To see validation failures run the library with the debug flag turned on, either

In Browser:

`localStorage.debug="dnsprove*"`

In NodeJS:

```sh
DEBUG="dnsprove*" npm run test
```
Expand All @@ -33,90 +33,83 @@ DEBUG="dnsprove*" npm run test

This library uses [runtypes](https://github.com/pelotom/runtypes) for compile time static type checking as well as run time input validation. The generated documentation below is inaccurate for any Runtypes generated types due to documentation generator limitations.


## API

<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

#### Table of Contents

- [RecordTypes](#recordtypes)
- [BlockchainNetwork](#blockchainnetwork)
- [EthereumAddress](#ethereumaddress)
- [EthereumNetworkId](#ethereumnetworkid)
- [OpenAttestationDNSTextRecord](#openattestationdnstextrecord)
- [IDNSRecord](#idnsrecord)
- [IDNSQueryResponse](#idnsqueryresponse)
- [parseOpenAttestationRecord](#parseopenattestationrecord)
- [Parameters](#parameters)
- [isWellFormedOpenAttestationRecord](#iswellformedopenattestationrecord)
- [Parameters](#parameters-1)
- [parseDnsResults](#parsednsresults)
- [Parameters](#parameters-2)
- [getDocumentStoreRecords](#getdocumentstorerecords)
- [Parameters](#parameters-3)
- [Examples](#examples)

### RecordTypes

Type: Static&lt;any>

### BlockchainNetwork
* [OpenAttestationDNSTextRecord](#openattestationdnstextrecord)
* [OpenAttestationDnsDidRecord](#openattestationdnsdidrecord)
* [IDNSRecord](#idnsrecord)
* [IDNSQueryResponse](#idnsqueryresponse)
* [queryDns](#querydns)
* [Parameters](#parameters)
* [parseOpenAttestationRecord](#parseopenattestationrecord)
* [Parameters](#parameters-1)
* [parseDocumentStoreResults](#parsedocumentstoreresults)
* [Parameters](#parameters-2)
* [parseDnsDidResults](#parsednsdidresults)
* [Parameters](#parameters-3)
* [getDocumentStoreRecords](#getdocumentstorerecords)
* [Parameters](#parameters-4)
* [Examples](#examples)
* [getDnsDidRecords](#getdnsdidrecords)
* [Parameters](#parameters-5)

Type: Static&lt;any>

### EthereumAddress
### OpenAttestationDNSTextRecord

Type: Static&lt;any>
### OpenAttestationDnsDidRecord

### EthereumNetworkId
### IDNSRecord

Type: Static&lt;any>
### IDNSQueryResponse

### OpenAttestationDNSTextRecord
### queryDns

Type: Static&lt;any>
#### Parameters

### IDNSRecord
* `domain` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**

### IDNSQueryResponse
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[IDNSQueryResponse](#idnsqueryresponse)>**

### parseOpenAttestationRecord

Parses one openattestation DNS-TXT record and turns it into an OpenAttestationsDNSTextRecord object

#### Parameters

- `record` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** e.g: '"openatts net=ethereum netId=3 addr=0x0c9d5E6C766030cc6f0f49951D275Ad0701F81EC"'
* `record` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** e.g: '"openatts net=ethereum netId=3 addr=0x0c9d5E6C766030cc6f0f49951D275Ad0701F81EC"'

Returns **[OpenAttestationDNSTextRecord](#openattestationdnstextrecord)**
Returns **GenericObject**

### isWellFormedOpenAttestationRecord
### parseDocumentStoreResults

Returns true if the given object passes runtype validation for OpenAttestationDNSTextRecord
Turn on debug log to see exact validation failure messages if necessary
Takes a DNS-TXT Record set and returns openattestation document store records if any

#### Parameters

- `record` **[OpenAttestationDNSTextRecord](#openattestationdnstextrecord)** An object that may conform to the OpenAttestationDNSTextRecord shape
* `recordSet` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[IDNSRecord](#idnsrecord)>** Refer to tests for examples (optional, default `[]`)
* `dnssec` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)**

### parseDnsResults
Returns **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[OpenAttestationDNSTextRecord](#openattestationdnstextrecord)>**

Takes a DNS-TXT Record set and returns openattestation document store records if any
### parseDnsDidResults

#### Parameters

- `recordSet` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)&lt;[IDNSRecord](#idnsrecord)>** Refer to tests for examples (optional, default `[]`)
* `recordSet` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[IDNSRecord](#idnsrecord)>** (optional, default `[]`)
* `dnssec` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)**

Returns **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)&lt;[OpenAttestationDNSTextRecord](#openattestationdnstextrecord)>**
Returns **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[OpenAttestationDnsDidRecord](#openattestationdnsdidrecord)>**

### getDocumentStoreRecords

Queries a given domain and parses the results to retrieve openattestation document store records if any

#### Parameters

- `domain` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** e.g: "example.openattestation.com"
* `domain` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** e.g: "example.openattestation.com"

#### Examples

Expand All @@ -129,7 +122,15 @@ addr: '0x2f60375e8144e16Adf1979936301D8341D58C36C',
dnssec: true } ]
```

Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)&lt;[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)&lt;[OpenAttestationDNSTextRecord](#openattestationdnstextrecord)>>**
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[OpenAttestationDNSTextRecord](#openattestationdnstextrecord)>>**

### getDnsDidRecords

#### Parameters

* `domain` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**

Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[OpenAttestationDnsDidRecord](#openattestationdnsdidrecord)>>**

## License

Expand Down
File renamed without changes.
12 changes: 0 additions & 12 deletions jest.config.js

This file was deleted.

Loading

0 comments on commit 2a7f7b5

Please sign in to comment.