Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update to npm 7, drop cjs support #20

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions .babelrc

This file was deleted.

19 changes: 7 additions & 12 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
{
"parser": "babel-eslint",
"extends": [
"airbnb-base",
"plugin:prettier/recommended"
],
"parser": "@typescript-eslint/parser",
"extends": ["plugin:@typescript-eslint/recommended", "plugin:prettier/recommended", "plugin:jest/recommended"],
"plugins": ["prettier", "@typescript-eslint"],
"env": {
"jest": true
},
Expand Down Expand Up @@ -33,22 +31,19 @@
"@typescript-eslint"
],
"rules": {
"no-undef": "off",
"no-unused-vars": "off",
"no-restricted-globals": "off",
"no-useless-constructor": "off",
"import/prefer-default-export": "off",
"@typescript-eslint/no-useless-constructor": "error",
"import/extensions": "off",
"no-redeclare": "off",
"@typescript-eslint/no-redeclare": [
"error"
],
"no-shadow": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-useless-constructor": "error",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-shadow": [
"error"
]
}
}
]
}
}
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