├── .github ├── CODEOWNERS ├── dependabot.yml └── workflows │ ├── auto-merge.yml │ ├── ci.yml │ └── release.yml ├── .gitignore ├── .markdownlint.yaml ├── .prettierrc ├── CHANGELOG.md ├── CONTRIBUTING.md ├── LICENSE.txt ├── README.md ├── UPGRADE.md ├── jest.config.js ├── jest.setup.js ├── lib ├── accounts.ts ├── billing.ts ├── certificates.ts ├── contacts.ts ├── domains.ts ├── fetcher │ ├── fetch-fetcher.ts │ ├── fetcher.ts │ └── https-fetcher.ts ├── identity.ts ├── main.ts ├── oauth.ts ├── paginate.ts ├── registrar.ts ├── secondary_dns.ts ├── services.ts ├── templates.ts ├── tlds.ts ├── types.ts ├── vanity_name_servers.ts ├── webhooks.ts └── zones.ts ├── package.json ├── test ├── accounts.spec.ts ├── billing.spec.ts ├── certificates.spec.ts ├── client.spec.ts ├── contacts.spec.ts ├── domain_delegation_signer_records.spec.ts ├── domain_dnssec.spec.ts ├── domain_email_forwards.spec.ts ├── domain_pushes.spec.ts ├── domain_services.spec.ts ├── domains.spec.ts ├── fixtures.http │ ├── acceptPush │ │ └── success.http │ ├── accounts │ │ ├── success-account.http │ │ └── success-user.http │ ├── activateZoneService │ │ └── success.http │ ├── addCollaborator │ │ ├── invite-success.http │ │ └── success.http │ ├── appliedServices │ │ └── success.http │ ├── applyService │ │ └── success.http │ ├── applyTemplate │ │ └── success.http │ ├── authorizeDomainTransferOut │ │ └── success.http │ ├── badgateway.http │ ├── cancelDomainTransfer │ │ └── success.http │ ├── changeDomainDelegation │ │ └── success.http │ ├── changeDomainDelegationFromVanity │ │ └── success.http │ ├── changeDomainDelegationToVanity │ │ └── success.http │ ├── checkDomain │ │ └── success.http │ ├── checkDomainPremiumPrice │ │ ├── error_400_not_a_premium_domain.http │ │ ├── error_400_tld_not_supported.http │ │ └── success.http │ ├── checkRegistrantChange │ │ └── success.http │ ├── checkZoneDistribution │ │ ├── error.http │ │ ├── failure.http │ │ └── success.http │ ├── checkZoneRecordDistribution │ │ ├── error.http │ │ ├── failure.http │ │ └── success.http │ ├── createContact │ │ ├── created.http │ │ └── error-validation-errors.http │ ├── createDelegationSignerRecord │ │ ├── created.http │ │ └── validation-error.http │ ├── createDomain │ │ └── created.http │ ├── createEmailForward │ │ └── created.http │ ├── createPrimaryServer │ │ └── created.http │ ├── createRegistrantChange │ │ └── success.http │ ├── createSecondaryZone │ │ └── created.http │ ├── createTemplate │ │ └── created.http │ ├── createTemplateRecord │ │ └── created.http │ ├── createWebhook │ │ └── created.http │ ├── createZoneRecord │ │ ├── created-apex.http │ │ └── created.http │ ├── deactivateZoneService │ │ └── success.http │ ├── deleteContact │ │ ├── error-contact-in-use.http │ │ └── success.http │ ├── deleteDelegationSignerRecord │ │ └── success.http │ ├── deleteDomain │ │ └── success.http │ ├── deleteEmailForward │ │ └── success.http │ ├── deleteRegistrantChange │ │ └── success.http │ ├── deleteTemplate │ │ └── success.http │ ├── deleteTemplateRecord │ │ └── success.http │ ├── deleteWebhook │ │ └── success.http │ ├── deleteZoneRecord │ │ └── success.http │ ├── disableDnssec │ │ ├── not-enabled.http │ │ └── success.http │ ├── disableDomainAutoRenewal │ │ └── success.http │ ├── disableDomainTransferLock │ │ └── success.http │ ├── disableVanityNameServers │ │ └── success.http │ ├── disableWhoisPrivacy │ │ └── success.http │ ├── downloadCertificate │ │ └── success.http │ ├── enableDnssec │ │ └── success.http │ ├── enableDomainAutoRenewal │ │ └── success.http │ ├── enableDomainTransferLock │ │ └── success.http │ ├── enableVanityNameServers │ │ └── success.http │ ├── enableWhoisPrivacy │ │ ├── created.http │ │ └── success.http │ ├── getCertificate │ │ └── success.http │ ├── getCertificatePrivateKey │ │ └── success.http │ ├── getContact │ │ └── success.http │ ├── getDelegationSignerRecord │ │ └── success.http │ ├── getDnssec │ │ └── success.http │ ├── getDomain │ │ └── success.http │ ├── getDomainDelegation │ │ ├── success-empty.http │ │ └── success.http │ ├── getDomainPremiumPrice │ │ ├── failure.http │ │ └── success.http │ ├── getDomainPrices │ │ ├── failure.http │ │ └── success.http │ ├── getDomainTransfer │ │ └── success.http │ ├── getDomainTransferLock │ │ └── success.http │ ├── getEmailForward │ │ └── success.http │ ├── getPrimaryServer │ │ └── success.http │ ├── getRegistrantChange │ │ └── success.http │ ├── getService │ │ └── success.http │ ├── getTemplate │ │ └── success.http │ ├── getTemplateRecord │ │ └── success.http │ ├── getTld │ │ └── success.http │ ├── getTldExtendedAttributes │ │ ├── success-attributes.http │ │ ├── success-noattributes.http │ │ └── success.http │ ├── getWebhook │ │ └── success.http │ ├── getWhoisPrivacy │ │ └── success.http │ ├── getZone │ │ └── success.http │ ├── getZoneFile │ │ └── success.http │ ├── getZoneRecord │ │ └── success.http │ ├── initiatePush │ │ └── success.http │ ├── issueLetsencryptCertificate │ │ └── success.http │ ├── issueRenewalLetsencryptCertificate │ │ └── success.http │ ├── linkPrimaryServer │ │ └── success.http │ ├── listAccounts │ │ ├── success-account.http │ │ └── success-user.http │ ├── listCertificates │ │ └── success.http │ ├── listCharges │ │ ├── fail-400-bad-filter.http │ │ ├── fail-403.http │ │ └── success.http │ ├── listCollaborators │ │ └── success.http │ ├── listContacts │ │ └── success.http │ ├── listDelegationSignerRecords │ │ └── success.http │ ├── listDomains │ │ └── success.http │ ├── listEmailForwards │ │ └── success.http │ ├── listPrimaryServers │ │ └── success.http │ ├── listPushes │ │ └── success.http │ ├── listRegistrantChanges │ │ └── success.http │ ├── listServices │ │ └── success.http │ ├── listTemplateRecords │ │ └── success.http │ ├── listTemplates │ │ └── success.http │ ├── listTlds │ │ └── success.http │ ├── listWebhooks │ │ └── success.http │ ├── listZoneRecords │ │ └── success.http │ ├── listZones │ │ └── success.http │ ├── method-not-allowed.http │ ├── notfound-certificate.http │ ├── notfound-collaborator.http │ ├── notfound-contact.http │ ├── notfound-delegationSignerRecord.http │ ├── notfound-domain.http │ ├── notfound-domainpush.http │ ├── notfound-emailforward.http │ ├── notfound-record.http │ ├── notfound-template.http │ ├── notfound-webhook.http │ ├── notfound-whoisprivacy.http │ ├── notfound-zone.http │ ├── oauthAccessToken │ │ ├── error-invalid-request.http │ │ └── success.http │ ├── pages-1of3.http │ ├── pages-2of3.http │ ├── pages-3of3.http │ ├── purchaseLetsencryptCertificate │ │ └── success.http │ ├── purchaseRenewalLetsencryptCertificate │ │ └── success.http │ ├── registerDomain │ │ └── success.http │ ├── rejectPush │ │ └── success.http │ ├── removeCollaborator │ │ └── success.http │ ├── renewDomain │ │ ├── error-tooearly.http │ │ └── success.http │ ├── renewWhoisPrivacy │ │ ├── success.http │ │ ├── whois-privacy-duplicated-order.http │ │ └── whois-privacy-not-found.http │ ├── response.http │ ├── success-with-malformed-json.http │ ├── transferDomain │ │ ├── error-indnsimple.http │ │ ├── error-missing-authcode.http │ │ └── success.http │ ├── unapplyService │ │ └── success.http │ ├── unlinkPrimaryServer │ │ └── success.http │ ├── updateContact │ │ └── success.http │ ├── updateTemplate │ │ └── success.http │ ├── updateZoneRecord │ │ └── success.http │ ├── validation-error.http │ └── whoami │ │ ├── success-account.http │ │ ├── success-user.http │ │ └── success.http ├── identity.spec.ts ├── oauth.spec.ts ├── registrar.spec.ts ├── registrar_auto_renewal.spec.ts ├── registrar_domain_delegation.spec.ts ├── registrar_domain_transfer_lock.spec.ts ├── registrar_registrant.spec.ts ├── registrar_whois_privacy.spec.ts ├── services.spec.ts ├── templates.spec.ts ├── tlds.spec.ts ├── util.ts ├── vanity_name_servers.spec.ts ├── webhooks.spec.ts ├── zone_records.spec.ts └── zones.spec.ts └── tsconfig.json /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @dnsimple/external-integrations 2 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | --- 2 | version: 2 3 | updates: 4 | - package-ecosystem: npm 5 | directory: / 6 | schedule: 7 | interval: monthly 8 | open-pull-requests-limit: 10 9 | labels: 10 | - task 11 | - dependencies 12 | ignore: 13 | # We pin @types/node to our minimum supported Node.js version. 14 | - dependency-name: '@types/node' 15 | # We only bump this when we want to use newer TypeScript language features in our codebase for development. This does not impact end users as the distributed package contains compiled JavaScript, not TypeScript. 16 | - dependency-name: 'typescript' 17 | 18 | - package-ecosystem: "github-actions" 19 | directory: "/" 20 | schedule: 21 | interval: "daily" 22 | time: '12:00' 23 | open-pull-requests-limit: 10 24 | labels: 25 | - task 26 | - dependencies 27 | - automerge 28 | -------------------------------------------------------------------------------- /.github/workflows/auto-merge.yml: -------------------------------------------------------------------------------- 1 | name: Auto-merge 2 | 3 | on: 4 | pull_request: 5 | types: 6 | - labeled 7 | - synchronize 8 | - opened 9 | 10 | jobs: 11 | auto-merge: 12 | name: 'Auto-merge' 13 | runs-on: ubuntu-latest 14 | permissions: write-all 15 | 16 | if: github.event.pull_request.user.login == 'dependabot[bot]' && contains(github.event.pull_request.labels.*.name, 'automerge') 17 | steps: 18 | - name: Wait for tests to succeed 19 | uses: lewagon/wait-on-check-action@v1.3.4 20 | timeout-minutes: 15 21 | with: 22 | ref: ${{ github.ref }} 23 | running-workflow-name: 'Auto-merge' 24 | repo-token: ${{ secrets.GITHUB_TOKEN }} 25 | wait-interval: 10 26 | allowed-conclusions: success 27 | - uses: juliangruber/merge-pull-request-action@v1 28 | with: 29 | github-token: "${{ secrets.GITHUB_TOKEN }}" 30 | number: ${{ github.event.number }} 31 | method: squash 32 | repo: dnsimple/dnsimple-node 33 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: 4 | push: 5 | branches: [ main ] 6 | pull_request: 7 | workflow_dispatch: 8 | 9 | concurrency: 10 | group: ${{ github.workflow }}-${{ github.ref }} 11 | cancel-in-progress: true 12 | 13 | jobs: 14 | markdownlint-cli: 15 | name: Lint markdown 16 | runs-on: ubuntu-latest 17 | steps: 18 | - name: Checkout Code 19 | uses: actions/checkout@v4 20 | - name: Run markdownlint-cli 21 | uses: nosborn/github-action-markdown-cli@v3.5.0 22 | with: 23 | files: . 24 | config_file: ".markdownlint.yaml" 25 | 26 | test: 27 | needs: [markdownlint-cli] 28 | runs-on: ubuntu-latest 29 | name: Node.js ${{ matrix.node-version }} 30 | strategy: 31 | matrix: 32 | node-version: [20.x, 22.x, 24.x] 33 | 34 | steps: 35 | - uses: actions/checkout@v4 36 | - uses: actions/setup-node@v4 37 | with: 38 | node-version: ${{ matrix.node-version }} 39 | - run: npm i 40 | - run: npm run clean 41 | - run: npm test 42 | - run: npm run format-check 43 | - run: npm run build 44 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: Release 2 | 3 | on: 4 | push: 5 | tags: 6 | - v*.*.* 7 | 8 | jobs: 9 | publish: 10 | name: Publish Client 11 | runs-on: ubuntu-latest 12 | steps: 13 | - name: Wait for tests to succeed 14 | uses: lewagon/wait-on-check-action@v1.3.4 15 | with: 16 | ref: 'refs/heads/main' 17 | running-workflow-name: 'Publish Client' 18 | repo-token: ${{ secrets.GITHUB_TOKEN }} 19 | wait-interval: 10 20 | allowed-conclusions: success 21 | - name: Checkout Code 22 | uses: actions/checkout@v4 23 | - name: Set up Node ${{ matrix.node-version }} 24 | uses: actions/setup-node@v4 25 | with: 26 | node-version: ${{ matrix.node-version }} 27 | - run: npm i 28 | - run: npm run build 29 | - uses: JS-DevTools/npm-publish@v3 30 | with: 31 | token: ${{ secrets.NPM_TOKEN }} 32 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /dist/ 2 | /package-lock.json 3 | node_modules/ 4 | npm-debug.log 5 | -------------------------------------------------------------------------------- /.markdownlint.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | default: true 3 | line-length: false 4 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "bracketSpacing": true, 3 | "insertPragma": false, 4 | "proseWrap": "always", 5 | "quoteProps": "as-needed", 6 | "requirePragma": false, 7 | "trailingComma": "es5", 8 | "plugins": ["prettier-plugin-organize-imports"] 9 | } 10 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to DNSimple/node 2 | 3 | ## Getting started 4 | 5 | ### 1. Clone the repository 6 | 7 | Clone the repository and move into it: 8 | 9 | ```shell 10 | git clone git@github.com:dnsimple/dnsimple-node.git 11 | cd dnsimple-node 12 | ``` 13 | 14 | ### 2. Install the dependencies 15 | 16 | ```shell 17 | npm install 18 | ``` 19 | 20 | ### 3. Build and test 21 | 22 | [Run the test suite](#testing) to check everything works as expected. 23 | 24 | ## Releasing 25 | 26 | The following instructions uses `$VERSION` as a placeholder, where `$VERSION` is a `MAJOR.MINOR.BUGFIX` release such as `1.2.0`. 27 | 28 | 1. Run the test suite and ensure all the tests pass. 29 | 30 | 1. Set the version in `package.json`: 31 | 32 | ```json 33 | { 34 | "version": "$VERSION", 35 | } 36 | ``` 37 | 38 | 1. Run the test suite and ensure all the tests pass. 39 | 40 | 1. Finalize the `## main` section in `CHANGELOG.md` assigning the version. 41 | 42 | 1. Commit and push the changes 43 | 44 | ```shell 45 | git commit -a -m "Release $VERSION" 46 | git push origin main 47 | ``` 48 | 49 | 1. Wait for CI to complete. 50 | 51 | 1. Create a signed tag. 52 | 53 | ```shell 54 | git tag -a v$VERSION -s -m "Release $VERSION" 55 | git push origin --tags 56 | ``` 57 | 58 | GitHub actions will take it from here and publish to `npm` 59 | 60 | ## Testing 61 | 62 | To run the test suite: 63 | 64 | ```shell 65 | npm test 66 | ``` 67 | 68 | ## Tests 69 | 70 | Submit unit tests for your changes. You can test your changes on your machine by [running the test suite](#testing). 71 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016-2025 DNSimple Corporation 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /jest.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('ts-jest').JestConfigWithTsJest} */ 2 | module.exports = { 3 | preset: "ts-jest", 4 | testEnvironment: "node", 5 | setupFilesAfterEnv: ["./jest.setup.js"], 6 | testMatch: [`${__dirname}/test/**/*.spec.ts`], 7 | }; 8 | -------------------------------------------------------------------------------- /jest.setup.js: -------------------------------------------------------------------------------- 1 | const fetchMock = require("fetch-mock").default; 2 | 3 | fetchMock.config.overwriteRoutes = true; 4 | 5 | beforeEach(() => fetchMock.mockGlobal()); 6 | afterEach(() => fetchMock.hardReset()); 7 | -------------------------------------------------------------------------------- /lib/accounts.ts: -------------------------------------------------------------------------------- 1 | import type { DNSimple, QueryParams } from "./main"; 2 | import type * as types from "./types"; 3 | 4 | export class Accounts { 5 | constructor(private readonly _client: DNSimple) {} 6 | 7 | /** 8 | * Lists the accounts the current authenticated entity has access to. 9 | * 10 | * GET /accounts 11 | * 12 | * @see https://developer.dnsimple.com/v2/accounts/#listAccounts 13 | * 14 | * @param params Query parameters 15 | */ 16 | listAccounts = (() => { 17 | const method = ( 18 | params: QueryParams & {} = {} 19 | ): Promise<{ data: Array }> => 20 | this._client.request("GET", `/accounts`, null, params); 21 | return method; 22 | })(); 23 | } 24 | -------------------------------------------------------------------------------- /lib/billing.ts: -------------------------------------------------------------------------------- 1 | import type { DNSimple, QueryParams } from "./main"; 2 | import { paginate } from "./paginate"; 3 | import type * as types from "./types"; 4 | 5 | export class Billing { 6 | constructor(private readonly _client: DNSimple) {} 7 | 8 | /** 9 | * Lists the billing charges for the account. 10 | * 11 | * This API is paginated. Call `listCharges.iterateAll(account, params)` to get an asynchronous iterator over individual items across all pages. You can also use `await listCharges.collectAll(account, params)` to quickly retrieve all items across all pages into an array. We suggest using `iterateAll` when possible, as `collectAll` will make all requests at once, which may increase latency and trigger rate limits. 12 | * 13 | * GET /{account}/billing/charges 14 | * 15 | * @see https://developer.dnsimple.com/v2/billing/#listCharges 16 | * 17 | * @param account The account id 18 | * @param params Query parameters 19 | * @param params.start_date Only include results after the given date. 20 | * @param params.end_date Only include results before the given date. 21 | * @param params.sort Sort results. Default sorting is by invoiced ascending. 22 | */ 23 | listCharges = (() => { 24 | const method = ( 25 | account: number, 26 | params: QueryParams & { 27 | start_date?: string; 28 | end_date?: string; 29 | sort?: "invoiced:asc" | "invoiced:desc"; 30 | } = {} 31 | ): Promise<{ data: Array; pagination: types.Pagination }> => 32 | this._client.request("GET", `/${account}/billing/charges`, null, params); 33 | method.iterateAll = ( 34 | account: number, 35 | params: QueryParams & { 36 | start_date?: string; 37 | end_date?: string; 38 | sort?: "invoiced:asc" | "invoiced:desc"; 39 | } = {} 40 | ) => paginate((page) => method(account, { ...params, page } as any)); 41 | method.collectAll = async ( 42 | account: number, 43 | params: QueryParams & { 44 | start_date?: string; 45 | end_date?: string; 46 | sort?: "invoiced:asc" | "invoiced:desc"; 47 | } = {} 48 | ) => { 49 | const items = []; 50 | for await (const item of method.iterateAll(account, params)) { 51 | items.push(item); 52 | } 53 | return items; 54 | }; 55 | return method; 56 | })(); 57 | } 58 | -------------------------------------------------------------------------------- /lib/fetcher/fetch-fetcher.ts: -------------------------------------------------------------------------------- 1 | import { DNSimple, TimeoutError } from "../main"; 2 | import type { Fetcher } from "./fetcher"; 3 | 4 | const fetchFetcher: Fetcher = async (params: { 5 | method: string; 6 | url: string; 7 | headers: { [name: string]: string }; 8 | timeout: number; 9 | body?: string; 10 | }) => { 11 | const abortController = new AbortController(); 12 | setTimeout(() => abortController.abort(), DNSimple.DEFAULT_TIMEOUT); 13 | try { 14 | const response = await fetch(params.url, { 15 | method: params.method, 16 | headers: params.headers, 17 | body: params.body, 18 | signal: abortController.signal, 19 | }); 20 | return { status: response.status, body: await response.text() }; 21 | } catch (error) { 22 | if (abortController && abortController.signal.aborted) 23 | throw new TimeoutError(); 24 | 25 | throw error; 26 | } 27 | }; 28 | 29 | export default fetchFetcher; 30 | -------------------------------------------------------------------------------- /lib/fetcher/fetcher.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * A function that makes an HTTP request. It's responsible for throwing {@link TimeoutError} and aborting the request on {@param params.timeout}. 3 | * It should return the response status and full body as a string. It should not throw on any status, even if 4xx or 5xx. 4 | * It can decide to implement retries as appropriate. The default fetcher currently does not implement any retry strategy. 5 | */ 6 | export type Fetcher = (params: { 7 | method: string; 8 | url: string; 9 | headers: { [name: string]: string }; 10 | body?: string; 11 | timeout: number; 12 | }) => Promise<{ 13 | status: number; 14 | body: string; 15 | }>; 16 | 17 | let fetcherImports: { 18 | fetchFetcher: Fetcher; 19 | httpsFetcher: Fetcher; 20 | }; 21 | let fetcherImportError: Error | undefined; 22 | 23 | try { 24 | fetcherImports = { 25 | fetchFetcher: require("./fetch-fetcher").default, 26 | httpsFetcher: require("./https-fetcher").default, 27 | }; 28 | } catch (error) { 29 | fetcherImportError = error; 30 | } 31 | 32 | export function getRuntimeFetcher(): Fetcher { 33 | if (fetcherImportError) 34 | throw new Error( 35 | `No global \`fetch\` or \`https\` module was found. Please, provide a Fetcher implementation: ${fetcherImportError}` 36 | ); 37 | 38 | return typeof fetch === "undefined" 39 | ? fetcherImports.httpsFetcher 40 | : fetcherImports.fetchFetcher; 41 | } 42 | -------------------------------------------------------------------------------- /lib/fetcher/https-fetcher.ts: -------------------------------------------------------------------------------- 1 | import * as https from "https"; 2 | import { URL } from "url"; 3 | import { TimeoutError } from "../main"; 4 | import type { Fetcher } from "./fetcher"; 5 | 6 | const httpsFetcher: Fetcher = (params: { 7 | method: string; 8 | url: string; 9 | headers: { [name: string]: string }; 10 | timeout: number; 11 | body?: string; 12 | }): Promise<{ status: number; body: string }> => { 13 | return new Promise((resolve, reject) => { 14 | const urlObj = new URL(params.url); 15 | const options: https.RequestOptions = { 16 | method: params.method, 17 | headers: params.headers, 18 | timeout: params.timeout, 19 | }; 20 | 21 | const req = https.request(urlObj, options, (res) => { 22 | const chunks: Buffer[] = []; 23 | res 24 | .on("data", (chunk) => chunks.push(chunk)) 25 | .on("end", () => { 26 | const body = Buffer.concat(chunks).toString("utf-8"); 27 | resolve({ 28 | status: res.statusCode || 500, // Fallback to 500 if statusCode is undefined 29 | body: body, 30 | }); 31 | }); 32 | }); 33 | 34 | req.on("error", (err: { code?: string }) => { 35 | if (err.code === "ECONNRESET") reject(new TimeoutError()); 36 | else reject(err); 37 | }); 38 | 39 | const timeoutId = setTimeout(() => { 40 | req.destroy(); 41 | reject(new TimeoutError()); 42 | }, params.timeout); 43 | 44 | req.on("close", () => clearTimeout(timeoutId)); 45 | 46 | if (params.body) req.write(params.body); 47 | 48 | req.end(); 49 | }); 50 | }; 51 | 52 | export default httpsFetcher; 53 | -------------------------------------------------------------------------------- /lib/identity.ts: -------------------------------------------------------------------------------- 1 | import type { DNSimple, QueryParams } from "./main"; 2 | import type * as types from "./types"; 3 | 4 | export class Identity { 5 | constructor(private readonly _client: DNSimple) {} 6 | 7 | /** 8 | * Retrieves the details about the current authenticated entity used to access the API. 9 | * 10 | * GET /whoami 11 | * 12 | * @see https://developer.dnsimple.com/v2/identity/#whoami 13 | * 14 | * @param params Query parameters 15 | */ 16 | whoami = (() => { 17 | const method = ( 18 | params: QueryParams & {} = {} 19 | ): Promise<{ data: { account: types.Account; user: types.User } }> => 20 | this._client.request("GET", `/whoami`, null, params); 21 | return method; 22 | })(); 23 | } 24 | -------------------------------------------------------------------------------- /lib/oauth.ts: -------------------------------------------------------------------------------- 1 | import { DNSimple, toQueryString } from "./main"; 2 | 3 | /** 4 | * Methods for working with OAuth token exchange. 5 | * 6 | * @see https://developer.dnsimple.com/v2/oauth 7 | */ 8 | export class OAuth { 9 | constructor(private readonly _client: DNSimple) {} 10 | 11 | /** 12 | * Exchange the short-lived authorization code for an access token 13 | * that is used to authenticate API calls. 14 | * 15 | * @see https://developer.dnsimple.com/v2/oauth 16 | * @param attributes 17 | * @param attributes.code The code returned from the authorize URL 18 | * @param attributes.clientId The OAuth application client ID 19 | * @param attributes.clientSecret The OAuth application client secret 20 | * @param attributes.state The random state used when authorizing 21 | * @param attributes.redirectUri A redirect URI 22 | */ 23 | exchangeAuthorizationForToken(attributes: { 24 | code: string; 25 | clientId: string; 26 | clientSecret: string; 27 | state: string; 28 | redirectUri: string; 29 | }) { 30 | return this._client.request( 31 | "POST", 32 | "/oauth/access_token", 33 | { 34 | client_id: attributes.clientId, 35 | client_secret: attributes.clientSecret, 36 | code: attributes.code, 37 | grant_type: "authorization_code", 38 | redirect_uri: attributes.redirectUri, 39 | state: attributes.state, 40 | }, 41 | {} 42 | ); 43 | } 44 | 45 | /** 46 | * Gets the URL to authorize a user for an application via the OAuth2 flow. 47 | * 48 | * @see https://developer.dnsimple.com/v2/oauth/ 49 | * 50 | * @param attributes At minimum the state option is required 51 | * @param attributes.clientId The client ID provided when the application was registered with DNSimple. 52 | * @param attributes.state A random string to protect against CSRF 53 | * @param attributes.redirectUri The URL to redirect to after authorizing 54 | * @param attributes.scope The scope to request during authorization 55 | * @return The URL to redirect the user to for authorization 56 | */ 57 | authorizeUrl(attributes: { 58 | clientId: string; 59 | state: string; 60 | redirectUri?: string; 61 | scope?: string; 62 | }) { 63 | const siteUrl = this._client.baseUrl.replace("api.", ""); 64 | return `${siteUrl}/oauth/authorize?${toQueryString({ 65 | state: attributes.state, 66 | redirect_uri: attributes.redirectUri, 67 | scope: attributes.scope, 68 | client_id: attributes.clientId, 69 | response_type: "code", 70 | })}`; 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /lib/paginate.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Async generator function to assist with paginated APIs. 3 | * Use this to iterate through individual items of a paginated API with ease. 4 | * Provide a callback that makes the request with the provided page number, and this function will take care of calling the API and yielding the individual items, allowing continuous iteration of all items across all pages like a single list. 5 | * 6 | * @example Iterate through all items of a paginated API: 7 | * ``` 8 | * const client = new Dnsimple({}); 9 | * const paginated = paginate(page => client.certificates.listCertificates(1000, "bingo.pizza", { sort: "name:asc", page })); 10 | * for await (const certificate of paginated) { 11 | * console.log("Certificate", certificate.name, "expires at", certificate.expires_at); 12 | * } 13 | * ``` 14 | * 15 | * @example Most paginated API methods also have a helper submethod that will invoke this function automatically with the appropriate arguments: 16 | * ``` 17 | * const client = new Dnsimple({}); 18 | * const paginated = client.certificates.listCertificates.paginate(1000, "bingo.pizza", { sort: "name:asc" }); 19 | * for await (const certificate of paginated) { 20 | * console.log("Certificate", certificate.name, "expires at", certificate.expires_at); 21 | * } 22 | * ``` 23 | */ 24 | export async function* paginate( 25 | fn: (page: number) => Promise<{ 26 | data: ReadonlyArray; 27 | pagination: { 28 | total_pages: number; 29 | }; 30 | }> 31 | ): AsyncGenerator { 32 | let page = 1; 33 | while (true) { 34 | const res = await fn(page); 35 | yield* res.data; 36 | if (page >= res.pagination.total_pages) { 37 | break; 38 | } 39 | page++; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /lib/tlds.ts: -------------------------------------------------------------------------------- 1 | import type { DNSimple, QueryParams } from "./main"; 2 | import { paginate } from "./paginate"; 3 | import type * as types from "./types"; 4 | 5 | export class Tlds { 6 | constructor(private readonly _client: DNSimple) {} 7 | 8 | /** 9 | * Lists TLDs supported for registration or transfer. 10 | * 11 | * This API is paginated. Call `listTlds.iterateAll(params)` to get an asynchronous iterator over individual items across all pages. You can also use `await listTlds.collectAll(params)` to quickly retrieve all items across all pages into an array. We suggest using `iterateAll` when possible, as `collectAll` will make all requests at once, which may increase latency and trigger rate limits. 12 | * 13 | * GET /tlds 14 | * 15 | * @see https://developer.dnsimple.com/v2/tlds/#listTlds 16 | * 17 | * @param params Query parameters 18 | * @param params.sort Sort results. Default sorting is by tld ascending. 19 | */ 20 | listTlds = (() => { 21 | const method = ( 22 | params: QueryParams & { sort?: "tld:asc" | "tld:desc" } = {} 23 | ): Promise<{ data: Array; pagination: types.Pagination }> => 24 | this._client.request("GET", `/tlds`, null, params); 25 | method.iterateAll = ( 26 | params: QueryParams & { sort?: "tld:asc" | "tld:desc" } = {} 27 | ) => paginate((page) => method({ ...params, page } as any)); 28 | method.collectAll = async ( 29 | params: QueryParams & { sort?: "tld:asc" | "tld:desc" } = {} 30 | ) => { 31 | const items = []; 32 | for await (const item of method.iterateAll(params)) { 33 | items.push(item); 34 | } 35 | return items; 36 | }; 37 | return method; 38 | })(); 39 | 40 | /** 41 | * Retrieves the details of a TLD. 42 | * 43 | * GET /tlds/{tld} 44 | * 45 | * @see https://developer.dnsimple.com/v2/tlds/#getTld 46 | * 47 | * @param tld The TLD string 48 | * @param params Query parameters 49 | */ 50 | getTld = (() => { 51 | const method = ( 52 | tld: string, 53 | params: QueryParams & {} = {} 54 | ): Promise<{ data: types.TLD }> => 55 | this._client.request("GET", `/tlds/${tld}`, null, params); 56 | return method; 57 | })(); 58 | 59 | /** 60 | * Lists a TLD extended attributes. 61 | * 62 | * Some TLDs require extended attributes when registering or transferring a domain. This API interface provides information on the extended attributes for any particular TLD. Extended attributes are extra TLD-specific attributes, required by the TLD registry to collect extra information about the registrant or legal agreements. 63 | * 64 | * GET /tlds/{tld}/extended_attributes 65 | * 66 | * @see https://developer.dnsimple.com/v2/tlds/#getTldExtendedAttributes 67 | * 68 | * @param tld The TLD string 69 | * @param params Query parameters 70 | */ 71 | getTldExtendedAttributes = (() => { 72 | const method = ( 73 | tld: string, 74 | params: QueryParams & {} = {} 75 | ): Promise<{ data: Array }> => 76 | this._client.request( 77 | "GET", 78 | `/tlds/${tld}/extended_attributes`, 79 | null, 80 | params 81 | ); 82 | return method; 83 | })(); 84 | } 85 | -------------------------------------------------------------------------------- /lib/vanity_name_servers.ts: -------------------------------------------------------------------------------- 1 | import type { DNSimple, QueryParams } from "./main"; 2 | import type * as types from "./types"; 3 | 4 | export class VanityNameServers { 5 | constructor(private readonly _client: DNSimple) {} 6 | 7 | /** 8 | * Enables Vanity Name Servers for the domain. 9 | * 10 | * This method sets up the appropriate A and AAAA records for the domain to provide vanity name servers, but it does not change the delegation for the domain. To change the delegation for domains to vanity name servers use the endpoints to Delegate to Vanity Name Servers or Dedelegate from Vanity Name Servers. 11 | * 12 | * PUT /{account}/vanity/{domain} 13 | * 14 | * @see https://developer.dnsimple.com/v2/vanity/#enableVanityNameServers 15 | * 16 | * @param account The account id 17 | * @param domain The domain name or id 18 | * @param params Query parameters 19 | */ 20 | enableVanityNameServers = (() => { 21 | const method = ( 22 | account: number, 23 | domain: string, 24 | params: QueryParams & {} = {} 25 | ): Promise<{ data: Array }> => 26 | this._client.request("PUT", `/${account}/vanity/${domain}`, null, params); 27 | return method; 28 | })(); 29 | 30 | /** 31 | * Disables Vanity Name Servers for the domain. 32 | * 33 | * This method removes the A and AAAA records required for the domain to provide vanity name servers, but it does not change the delegation for the domain. To change the delegation for domains to vanity name servers use the endpoints to Delegate to Vanity Name Servers or Dedelegate from Vanity Name Servers. 34 | * 35 | * DELETE /{account}/vanity/{domain} 36 | * 37 | * @see https://developer.dnsimple.com/v2/vanity/#disableVanityNameServers 38 | * 39 | * @param account The account id 40 | * @param domain The domain name or id 41 | * @param params Query parameters 42 | */ 43 | disableVanityNameServers = (() => { 44 | const method = ( 45 | account: number, 46 | domain: string, 47 | params: QueryParams & {} = {} 48 | ): Promise<{}> => 49 | this._client.request( 50 | "DELETE", 51 | `/${account}/vanity/${domain}`, 52 | null, 53 | params 54 | ); 55 | return method; 56 | })(); 57 | } 58 | -------------------------------------------------------------------------------- /lib/webhooks.ts: -------------------------------------------------------------------------------- 1 | import type { DNSimple, QueryParams } from "./main"; 2 | import type * as types from "./types"; 3 | 4 | export class Webhooks { 5 | constructor(private readonly _client: DNSimple) {} 6 | 7 | /** 8 | * List the webhooks in the account. 9 | * 10 | * GET /{account}/webhooks 11 | * 12 | * @see https://developer.dnsimple.com/v2/webhooks/webhooks/#listWebhooks 13 | * 14 | * @param account The account id 15 | * @param params Query parameters 16 | * @param params.sort Sort results. Default sorting is by name ascending. 17 | */ 18 | listWebhooks = (() => { 19 | const method = ( 20 | account: number, 21 | params: QueryParams & { sort?: "id:asc" | "id:desc" } = {} 22 | ): Promise<{ data: Array }> => 23 | this._client.request("GET", `/${account}/webhooks`, null, params); 24 | return method; 25 | })(); 26 | 27 | /** 28 | * Registers a webhook endpoint. 29 | * 30 | * POST /{account}/webhooks 31 | * 32 | * @see https://developer.dnsimple.com/v2/webhooks/webhooks/#createWebhook 33 | * 34 | * @param account The account id 35 | * @param params Query parameters 36 | */ 37 | createWebhook = (() => { 38 | const method = ( 39 | account: number, 40 | data: Partial<{ url: string }>, 41 | params: QueryParams & {} = {} 42 | ): Promise<{ data: types.Webhook }> => 43 | this._client.request("POST", `/${account}/webhooks`, data, params); 44 | return method; 45 | })(); 46 | 47 | /** 48 | * Retrieves the details of a registered webhook. 49 | * 50 | * GET /{account}/webhooks/{webhook} 51 | * 52 | * @see https://developer.dnsimple.com/v2/webhooks/webhooks/#getWebhook 53 | * 54 | * @param account The account id 55 | * @param webhook The webhoook id 56 | * @param params Query parameters 57 | */ 58 | getWebhook = (() => { 59 | const method = ( 60 | account: number, 61 | webhook: number, 62 | params: QueryParams & {} = {} 63 | ): Promise<{ data: types.Webhook }> => 64 | this._client.request( 65 | "GET", 66 | `/${account}/webhooks/${webhook}`, 67 | null, 68 | params 69 | ); 70 | return method; 71 | })(); 72 | 73 | /** 74 | * De-registers a webhook endpoint. 75 | * 76 | * DELETE /{account}/webhooks/{webhook} 77 | * 78 | * @see https://developer.dnsimple.com/v2/webhooks/webhooks/#deleteWebhook 79 | * 80 | * @param account The account id 81 | * @param webhook The webhoook id 82 | * @param params Query parameters 83 | */ 84 | deleteWebhook = (() => { 85 | const method = ( 86 | account: number, 87 | webhook: number, 88 | params: QueryParams & {} = {} 89 | ): Promise<{}> => 90 | this._client.request( 91 | "DELETE", 92 | `/${account}/webhooks/${webhook}`, 93 | null, 94 | params 95 | ); 96 | return method; 97 | })(); 98 | } 99 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "dnsimple", 3 | "version": "10.0.0", 4 | "description": "A Node.JS client for the DNSimple API.", 5 | "keywords": [ 6 | "dnsimple", 7 | "domains", 8 | "dns", 9 | "domain management", 10 | "ssl certificates" 11 | ], 12 | "homepage": "https://github.com/dnsimple/dnsimple-node", 13 | "author": "DNSimple (https://dnsimple.com/)", 14 | "contributors": [ 15 | "Anthony Eden " 16 | ], 17 | "repository": { 18 | "type": "git", 19 | "url": "git://github.com/dnsimple/dnsimple-node.git" 20 | }, 21 | "bugs:": "https://github.com/dnsimple/dnsimple-node/issues", 22 | "engines": { 23 | "node": ">= v20.0.0" 24 | }, 25 | "main": "dist/lib/main.js", 26 | "files": [ 27 | "dist" 28 | ], 29 | "devDependencies": { 30 | "@jest/globals": "^29.7.0", 31 | "@types/jest": "^29.5.13", 32 | "fetch-mock": "^12.5.2", 33 | "jest": "^29.7.0", 34 | "prettier": "3.5.3", 35 | "prettier-plugin-organize-imports": "4.1.0", 36 | "ts-jest": "^29.2.5", 37 | "typescript": "^5.6.3" 38 | }, 39 | "license": "MIT", 40 | "scripts": { 41 | "build": "npm run clean && tsc", 42 | "clean": "rm -rf dist", 43 | "format": "prettier -w '*.{js,json}' '{lib,test}/**/*.ts'", 44 | "format-check": "prettier --check '*.{js,json}' '{lib,test}/**/*.ts'", 45 | "test": "jest" 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /test/accounts.spec.ts: -------------------------------------------------------------------------------- 1 | import fetchMock from "fetch-mock"; 2 | import { createTestClient, responseFromFixture } from "./util"; 3 | 4 | const dnsimple = createTestClient(); 5 | 6 | describe("accounts", () => { 7 | describe("#listAccounts", () => { 8 | it("produces an account list", async () => { 9 | fetchMock.get( 10 | "https://api.dnsimple.com/v2/accounts", 11 | responseFromFixture("listAccounts/success-account.http") 12 | ); 13 | 14 | const result = await dnsimple.accounts.listAccounts(); 15 | 16 | expect(result).toEqual({ 17 | data: [ 18 | { 19 | id: 123, 20 | email: "john@example.com", 21 | plan_identifier: "dnsimple-personal", 22 | created_at: "2011-09-11T17:15:58Z", 23 | updated_at: "2016-06-03T15:02:26Z", 24 | }, 25 | ], 26 | }); 27 | }); 28 | }); 29 | }); 30 | -------------------------------------------------------------------------------- /test/billing.spec.ts: -------------------------------------------------------------------------------- 1 | import fetchMock from "fetch-mock"; 2 | import { ClientError } from "../lib/main"; 3 | import { createTestClient, responseFromFixture } from "./util"; 4 | 5 | const dnsimple = createTestClient(); 6 | 7 | describe("billing", () => { 8 | describe("#listCharges", () => { 9 | const accountId = 1010; 10 | 11 | it("produces a charges list", async () => { 12 | fetchMock.get( 13 | "https://api.dnsimple.com/v2/1010/billing/charges", 14 | responseFromFixture("listCharges/success.http") 15 | ); 16 | 17 | const response = await dnsimple.billing.listCharges(accountId); 18 | 19 | const certificates = response.data; 20 | expect(certificates).toEqual([ 21 | { 22 | invoiced_at: "2023-08-17T05:53:36Z", 23 | total_amount: "14.50", 24 | balance_amount: "0.00", 25 | reference: "1-2", 26 | state: "collected", 27 | items: [ 28 | { 29 | description: "Register bubble-registered.com", 30 | amount: "14.50", 31 | product_id: 1, 32 | product_type: "domain-registration", 33 | product_reference: "bubble-registered.com", 34 | }, 35 | ], 36 | }, 37 | { 38 | invoiced_at: "2023-08-17T05:57:53Z", 39 | total_amount: "14.50", 40 | balance_amount: "0.00", 41 | reference: "2-2", 42 | state: "refunded", 43 | items: [ 44 | { 45 | description: "Register example.com", 46 | amount: "14.50", 47 | product_id: 2, 48 | product_type: "domain-registration", 49 | product_reference: "example.com", 50 | }, 51 | ], 52 | }, 53 | { 54 | invoiced_at: "2023-10-24T07:49:05Z", 55 | total_amount: "1099999.99", 56 | balance_amount: "0.00", 57 | reference: "4-2", 58 | state: "collected", 59 | items: [ 60 | { 61 | description: "Test Line Item 1", 62 | amount: "99999.99", 63 | product_id: null, 64 | product_type: "manual", 65 | product_reference: null, 66 | }, 67 | { 68 | description: "Test Line Item 2", 69 | amount: "1000000.00", 70 | product_id: null, 71 | product_type: "manual", 72 | product_reference: null, 73 | }, 74 | ], 75 | }, 76 | ]); 77 | }); 78 | 79 | it("throws an error on bad filter", async () => { 80 | fetchMock.get( 81 | "https://api.dnsimple.com/v2/1010/billing/charges", 82 | responseFromFixture("listCharges/fail-400-bad-filter.http") 83 | ); 84 | 85 | try { 86 | await dnsimple.billing.listCharges(accountId); 87 | } catch (error) { 88 | expect(error).toBeInstanceOf(ClientError); 89 | const clientError = error as ClientError; 90 | expect(clientError.status).toBe(400); 91 | expect(clientError.data.message).toBe( 92 | "Invalid date format must be ISO8601 (YYYY-MM-DD)" 93 | ); 94 | } 95 | }); 96 | 97 | it("throws an error on missing scope", async () => { 98 | fetchMock.get( 99 | "https://api.dnsimple.com/v2/1010/billing/charges", 100 | responseFromFixture("listCharges/fail-403.http") 101 | ); 102 | 103 | try { 104 | await dnsimple.billing.listCharges(accountId); 105 | } catch (error) { 106 | expect(error).toBeInstanceOf(ClientError); 107 | const clientError = error as ClientError; 108 | expect(clientError.status).toBe(403); 109 | expect(clientError.data.message).toBe( 110 | "Permission Denied. Required Scope: billing:*:read" 111 | ); 112 | } 113 | }); 114 | }); 115 | }); 116 | -------------------------------------------------------------------------------- /test/client.spec.ts: -------------------------------------------------------------------------------- 1 | import fetchMock from "fetch-mock"; 2 | import { ClientError, MethodNotAllowedError } from "../lib/main"; 3 | import { createTestClient, responseFromFixture } from "./util"; 4 | 5 | const dnsimple = createTestClient(); 6 | 7 | describe("response handling", () => { 8 | describe("a 400 error", () => { 9 | it("includes the error message from the server", async () => { 10 | fetchMock.post( 11 | "https://api.dnsimple.com/v2/validation-error", 12 | responseFromFixture("validation-error.http") 13 | ); 14 | 15 | try { 16 | await dnsimple.request("POST", "/validation-error", {}, {}); 17 | } catch (error) { 18 | expect(error).toBeInstanceOf(ClientError); 19 | expect(error.data.errors.email).toEqual( 20 | expect.arrayContaining(["can't be blank"]) 21 | ); 22 | } 23 | }); 24 | }); 25 | 26 | describe("a 200 response with malformed json", () => { 27 | it("produces a JSON parse error", async () => { 28 | fetchMock.get( 29 | "https://api.dnsimple.com/v2/success-with-malformed-json", 30 | responseFromFixture("success-with-malformed-json.http") 31 | ); 32 | 33 | await expect( 34 | dnsimple.request("GET", "/success-with-malformed-json", null, {}) 35 | ).rejects.toThrow(SyntaxError); 36 | }); 37 | }); 38 | 39 | describe("an error response with HTML content", () => { 40 | it("produces a JSON parse error", async () => { 41 | fetchMock.get( 42 | "https://api.dnsimple.com/v2/badgateway", 43 | responseFromFixture("badgateway.http") 44 | ); 45 | 46 | await expect( 47 | dnsimple.request("GET", "/badgateway", null, {}) 48 | ).rejects.toThrow(SyntaxError); 49 | }); 50 | }); 51 | 52 | describe("a 405 error", () => { 53 | it("results in a rejected promise", async () => { 54 | fetchMock.get( 55 | "https://api.dnsimple.com/v2/method-not-allowed", 56 | responseFromFixture("method-not-allowed.http") 57 | ); 58 | 59 | await expect( 60 | dnsimple.request("GET", "/method-not-allowed", null, {}) 61 | ).rejects.toThrow(MethodNotAllowedError); 62 | }); 63 | }); 64 | }); 65 | -------------------------------------------------------------------------------- /test/domain_dnssec.spec.ts: -------------------------------------------------------------------------------- 1 | import fetchMock from "fetch-mock"; 2 | import { createTestClient, responseFromFixture } from "./util"; 3 | 4 | const dnsimple = createTestClient(); 5 | 6 | describe("domains", () => { 7 | describe("#enableDnssec", () => { 8 | const accountId = 1010; 9 | const domainId = "example.com"; 10 | 11 | it("builds the correct request", async () => { 12 | fetchMock.post( 13 | "https://api.dnsimple.com/v2/1010/domains/example.com/dnssec", 14 | responseFromFixture("enableDnssec/success.http") 15 | ); 16 | 17 | await dnsimple.domains.enableDnssec(accountId, domainId); 18 | 19 | expect(fetchMock.callHistory.called()).toBe(true); 20 | }); 21 | 22 | it("produces an response", async () => { 23 | fetchMock.post( 24 | "https://api.dnsimple.com/v2/1010/domains/example.com/dnssec", 25 | responseFromFixture("enableDnssec/success.http") 26 | ); 27 | 28 | const response = await dnsimple.domains.enableDnssec(accountId, domainId); 29 | 30 | expect(response.data.enabled).toBe(true); 31 | }); 32 | }); 33 | 34 | describe("#disableDnssec", () => { 35 | const accountId = 1010; 36 | const domainId = "example.com"; 37 | 38 | it("produces nothing", async () => { 39 | fetchMock.delete( 40 | "https://api.dnsimple.com/v2/1010/domains/example.com/dnssec", 41 | responseFromFixture("disableDnssec/success.http") 42 | ); 43 | 44 | const response = await dnsimple.domains.disableDnssec( 45 | accountId, 46 | domainId 47 | ); 48 | 49 | expect(response).toEqual({}); 50 | }); 51 | }); 52 | 53 | describe("#getDnssec", () => { 54 | const accountId = 1010; 55 | const domainId = "example.com"; 56 | 57 | it("builds the correct request", async () => { 58 | fetchMock.get( 59 | "https://api.dnsimple.com/v2/1010/domains/example.com/dnssec", 60 | responseFromFixture("getDnssec/success.http") 61 | ); 62 | 63 | await dnsimple.domains.getDnssec(accountId, domainId); 64 | 65 | expect(fetchMock.callHistory.called()).toBe(true); 66 | }); 67 | 68 | it("produces an response", async () => { 69 | fetchMock.get( 70 | "https://api.dnsimple.com/v2/1010/domains/example.com/dnssec", 71 | responseFromFixture("getDnssec/success.http") 72 | ); 73 | 74 | const response = await dnsimple.domains.getDnssec(accountId, domainId); 75 | 76 | expect(response.data.enabled).toBe(true); 77 | }); 78 | }); 79 | }); 80 | -------------------------------------------------------------------------------- /test/domain_pushes.spec.ts: -------------------------------------------------------------------------------- 1 | import fetchMock from "fetch-mock"; 2 | import { createTestClient, responseFromFixture } from "./util"; 3 | 4 | const dnsimple = createTestClient(); 5 | 6 | describe("domains", () => { 7 | describe("#initiatePush", () => { 8 | const accountId = 1010; 9 | const domainId = "example.com"; 10 | const attributes = { new_account_email: "jim@example.com" }; 11 | 12 | it("builds the correct request", async () => { 13 | fetchMock.post( 14 | "https://api.dnsimple.com/v2/1010/domains/example.com/pushes", 15 | responseFromFixture("initiatePush/success.http") 16 | ); 17 | 18 | await dnsimple.domains.initiatePush(accountId, domainId, attributes); 19 | 20 | expect(fetchMock.callHistory.lastCall().options.body).toEqual( 21 | JSON.stringify(attributes) 22 | ); 23 | }); 24 | 25 | it("produces a push result", async () => { 26 | fetchMock.post( 27 | "https://api.dnsimple.com/v2/1010/domains/example.com/pushes", 28 | responseFromFixture("initiatePush/success.http") 29 | ); 30 | 31 | const response = await dnsimple.domains.initiatePush( 32 | accountId, 33 | domainId, 34 | attributes 35 | ); 36 | 37 | const push = response.data; 38 | expect(push.id).toBe(1); 39 | expect(push.domain_id).toBe(100); 40 | expect(push.contact_id).toBe(null); 41 | expect(push.account_id).toBe(2020); 42 | expect(push.created_at).toBe("2016-08-11T10:16:03Z"); 43 | expect(push.updated_at).toBe("2016-08-11T10:16:03Z"); 44 | expect(push.accepted_at).toBe(null); 45 | }); 46 | }); 47 | 48 | describe("#listPushes", () => { 49 | const accountId = 1010; 50 | 51 | it("produces an pushes list", async () => { 52 | fetchMock.get( 53 | "https://api.dnsimple.com/v2/1010/pushes", 54 | responseFromFixture("listPushes/success.http") 55 | ); 56 | 57 | const response = await dnsimple.domains.listPushes(accountId); 58 | 59 | expect(response.data.length).toBe(2); 60 | }); 61 | }); 62 | 63 | describe("#acceptPush", () => { 64 | const accountId = 1010; 65 | const pushId = 200; 66 | const attributes = { contact_id: 1 }; 67 | 68 | it("builds the correct request", async () => { 69 | fetchMock.post( 70 | "https://api.dnsimple.com/v2/1010/pushes/200", 71 | responseFromFixture("acceptPush/success.http") 72 | ); 73 | 74 | await dnsimple.domains.acceptPush(accountId, pushId, attributes); 75 | 76 | expect(fetchMock.callHistory.lastCall().options.body).toEqual( 77 | JSON.stringify(attributes) 78 | ); 79 | }); 80 | 81 | it("produces nothing", async () => { 82 | fetchMock.post( 83 | "https://api.dnsimple.com/v2/1010/pushes/200", 84 | responseFromFixture("acceptPush/success.http") 85 | ); 86 | 87 | const response = await dnsimple.domains.acceptPush( 88 | accountId, 89 | pushId, 90 | attributes 91 | ); 92 | 93 | expect(response).toEqual({}); 94 | }); 95 | }); 96 | 97 | describe("#rejectPush", () => { 98 | const accountId = 1010; 99 | const pushId = 200; 100 | 101 | it("builds the correct request", async () => { 102 | fetchMock.delete( 103 | "https://api.dnsimple.com/v2/1010/pushes/200", 104 | responseFromFixture("rejectPush/success.http") 105 | ); 106 | 107 | await dnsimple.domains.rejectPush(accountId, pushId); 108 | 109 | expect(fetchMock.callHistory.called()).toBe(true); 110 | }); 111 | 112 | it("produces nothing", async () => { 113 | fetchMock.delete( 114 | "https://api.dnsimple.com/v2/1010/pushes/200", 115 | responseFromFixture("rejectPush/success.http") 116 | ); 117 | 118 | const response = await dnsimple.domains.rejectPush(accountId, pushId); 119 | 120 | expect(response).toEqual({}); 121 | }); 122 | }); 123 | }); 124 | -------------------------------------------------------------------------------- /test/fixtures.http/acceptPush/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 204 No Content 2 | Server: nginx 3 | Date: Thu, 11 Aug 2016 10:23:46 GMT 4 | Connection: keep-alive 5 | X-RateLimit-Limit: 2400 6 | X-RateLimit-Remaining: 2392 7 | X-RateLimit-Reset: 1470913058 8 | Cache-Control: no-cache 9 | X-Request-Id: 5867ab50-6237-4cf8-b220-51f5ef57debd 10 | X-Runtime: 0.582482 11 | X-Content-Type-Options: nosniff 12 | X-Download-Options: noopen 13 | X-Frame-Options: DENY 14 | X-Permitted-Cross-Domain-Policies: none 15 | X-XSS-Protection: 1; mode=block 16 | Strict-Transport-Security: max-age=31536000 17 | 18 | -------------------------------------------------------------------------------- /test/fixtures.http/accounts/success-account.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: nginx 3 | Date: Tue, 14 Jun 2016 12:02:58 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | X-RateLimit-Limit: 2400 7 | X-RateLimit-Remaining: 2391 8 | X-RateLimit-Reset: 1465908577 9 | ETag: W/"9ef3b4bf1f441a9b1cd6d7041bc181aa" 10 | Cache-Control: max-age=0, private, must-revalidate 11 | X-Request-Id: f705b65b-3589-43ad-97ca-3b2821d49d81 12 | X-Runtime: 0.012661 13 | X-Content-Type-Options: nosniff 14 | X-Download-Options: noopen 15 | X-Frame-Options: DENY 16 | X-Permitted-Cross-Domain-Policies: none 17 | X-XSS-Protection: 1; mode=block 18 | Strict-Transport-Security: max-age=31536000 19 | 20 | {"data":[{"id":123,"email":"john@example.com","plan_identifier":"dnsimple-personal","created_at":"2011-09-11T17:15:58Z","updated_at":"2016-06-03T15:02:26Z"}]} 21 | -------------------------------------------------------------------------------- /test/fixtures.http/accounts/success-user.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: nginx 3 | Date: Tue, 14 Jun 2016 12:05:38 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | X-RateLimit-Limit: 2400 7 | X-RateLimit-Remaining: 2390 8 | X-RateLimit-Reset: 1465908577 9 | ETag: W/"b8dc5b6e94652da599d15d4668b723b5" 10 | Cache-Control: max-age=0, private, must-revalidate 11 | X-Request-Id: 745455ba-3871-440d-b703-1448b9708c14 12 | X-Runtime: 0.014727 13 | X-Content-Type-Options: nosniff 14 | X-Download-Options: noopen 15 | X-Frame-Options: DENY 16 | X-Permitted-Cross-Domain-Policies: none 17 | X-XSS-Protection: 1; mode=block 18 | Strict-Transport-Security: max-age=31536000 19 | 20 | {"data":[{"id":123,"email":"john@example.com","plan_identifier":"dnsimple-personal","created_at":"2011-09-11T17:15:58Z","updated_at":"2016-06-03T15:02:26Z"},{"id":456,"email":"ops@company.com","plan_identifier":"dnsimple-professional","created_at":"2012-03-16T16:02:54Z","updated_at":"2016-06-14T11:23:16Z"}]} 21 | -------------------------------------------------------------------------------- /test/fixtures.http/activateZoneService/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: nginx 3 | Date: Tue, 08 Aug 2023 04:19:23 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | X-RateLimit-Limit: 2400 7 | X-RateLimit-Remaining: 2399 8 | X-RateLimit-Reset: 1691471963 9 | X-WORK-WITH-US: Love automation? So do we! https://dnsimple.com/jobs 10 | ETag: W/"fe6afd982459be33146933235343d51d" 11 | Cache-Control: max-age=0, private, must-revalidate 12 | X-Request-Id: 8e8ac535-9f46-4304-8440-8c68c30427c3 13 | X-Runtime: 0.176579 14 | Strict-Transport-Security: max-age=63072000 15 | 16 | {"data":{"id":1,"account_id":1010,"name":"example.com","reverse":false,"secondary":false,"last_transferred_at":null,"active":true,"created_at":"2015-04-23T07:40:03Z","updated_at":"2015-04-23T07:40:03Z"}} 17 | -------------------------------------------------------------------------------- /test/fixtures.http/addCollaborator/invite-success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 201 Created 2 | Server: nginx 3 | Date: Fri, 07 Oct 2016 08:51:12 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | X-RateLimit-Limit: 2400 7 | X-RateLimit-Remaining: 2398 8 | X-RateLimit-Reset: 1475833772 9 | ETag: W/"3e59e2eafbf1d4b626413a5703309b57" 10 | Cache-Control: max-age=0, private, must-revalidate 11 | X-Request-Id: 9f27e164-2448-4d23-ad67-4ecedaec063e 12 | X-Runtime: 0.387144 13 | X-Content-Type-Options: nosniff 14 | X-Download-Options: noopen 15 | X-Frame-Options: DENY 16 | X-Permitted-Cross-Domain-Policies: none 17 | X-XSS-Protection: 1; mode=block 18 | Strict-Transport-Security: max-age=31536000 19 | 20 | {"data":{"id":101,"domain_id":1,"domain_name":"example.com","user_id":null,"user_email":"invited-user@example.com","invitation":true,"created_at":"2016-10-07T08:51:12Z","updated_at":"2016-10-07T08:51:12Z","accepted_at":null}} 21 | -------------------------------------------------------------------------------- /test/fixtures.http/addCollaborator/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 201 Created 2 | Server: nginx 3 | Date: Fri, 07 Oct 2016 08:53:41 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | X-RateLimit-Limit: 2400 7 | X-RateLimit-Remaining: 2397 8 | X-RateLimit-Reset: 1475833772 9 | ETag: W/"d35fa3da40b4f6586503174563d71bfc" 10 | Cache-Control: max-age=0, private, must-revalidate 11 | X-Request-Id: 42de3144-37c7-4329-88c4-fdc103cb150f 12 | X-Runtime: 0.156436 13 | X-Content-Type-Options: nosniff 14 | X-Download-Options: noopen 15 | X-Frame-Options: DENY 16 | X-Permitted-Cross-Domain-Policies: none 17 | X-XSS-Protection: 1; mode=block 18 | Strict-Transport-Security: max-age=31536000 19 | 20 | {"data":{"id":100,"domain_id":1,"domain_name":"example.com","user_id":999,"user_email":"existing-user@example.com","invitation":false,"created_at":"2016-10-07T08:53:41Z","updated_at":"2016-10-07T08:53:41Z","accepted_at":"2016-10-07T08:53:41Z"}} 21 | -------------------------------------------------------------------------------- /test/fixtures.http/appliedServices/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: nginx 3 | Date: Wed, 15 Jun 2016 11:09:44 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | X-RateLimit-Limit: 2400 7 | X-RateLimit-Remaining: 2398 8 | X-RateLimit-Reset: 1465992405 9 | ETag: W/"f3fb525524e0a0eab452025850afb062" 10 | Cache-Control: max-age=0, private, must-revalidate 11 | X-Request-Id: 03bcc2ff-d1f1-4fc2-bb3f-9218a21c04b7 12 | X-Runtime: 0.065526 13 | X-Content-Type-Options: nosniff 14 | X-Download-Options: noopen 15 | X-Frame-Options: DENY 16 | X-Permitted-Cross-Domain-Policies: none 17 | X-XSS-Protection: 1; mode=block 18 | Strict-Transport-Security: max-age=31536000 19 | 20 | {"data":[{"id":1,"name":"WordPress","sid":"wordpress","description":"Share with the world, your community, or your closest friends.","setup_description":null,"requires_setup":true,"default_subdomain":"blog","created_at":"2013-11-05T18:06:50Z","updated_at":"2016-03-04T09:23:27Z","settings":[{"name":"site","label":"Site","append":null,"description":"Your Wordpress.com subdomain","example":null,"password":false}]}],"pagination":{"current_page":1,"per_page":30,"total_entries":1,"total_pages":1}} -------------------------------------------------------------------------------- /test/fixtures.http/applyService/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 204 No Content 2 | Server: nginx 3 | Date: Sat, 09 Jul 2016 11:12:42 GMT 4 | Connection: keep-alive 5 | X-RateLimit-Limit: 2400 6 | X-RateLimit-Remaining: 2398 7 | X-RateLimit-Reset: 1468066326 8 | Cache-Control: no-cache 9 | X-Request-Id: 30a3a44b-5792-4114-a355-a866603311ce 10 | X-Runtime: 0.087254 11 | X-Content-Type-Options: nosniff 12 | X-Download-Options: noopen 13 | X-Frame-Options: DENY 14 | X-Permitted-Cross-Domain-Policies: none 15 | X-XSS-Protection: 1; mode=block 16 | Strict-Transport-Security: max-age=31536000 17 | 18 | -------------------------------------------------------------------------------- /test/fixtures.http/applyTemplate/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 204 No Content 2 | Server: nginx 3 | Date: Thu, 24 Mar 2016 11:05:38 GMT 4 | Connection: keep-alive 5 | Status: 204 No Content 6 | X-RateLimit-Limit: 2400 7 | X-RateLimit-Remaining: 2397 8 | X-RateLimit-Reset: 1458821049 9 | Cache-Control: no-cache 10 | X-Request-Id: 967713d5-a203-40ee-875c-1df07868b7eb 11 | X-Runtime: 0.147576 12 | Strict-Transport-Security: max-age=31536000 13 | 14 | -------------------------------------------------------------------------------- /test/fixtures.http/authorizeDomainTransferOut/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 204 No Content 2 | Server: nginx 3 | Date: Sun, 21 Feb 2016 13:40:35 GMT 4 | Connection: keep-alive 5 | Status: 204 No Content 6 | X-RateLimit-Limit: 4000 7 | X-RateLimit-Remaining: 3990 8 | X-RateLimit-Reset: 1456063540 9 | Cache-Control: no-cache 10 | X-Request-Id: 9af6ab78-7ea8-4675-89f0-14d124fc7ca2 11 | X-Runtime: 3.038699 12 | Strict-Transport-Security: max-age=31536000 13 | 14 | -------------------------------------------------------------------------------- /test/fixtures.http/badgateway.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 502 Bad Gateway 2 | Server: nginx 3 | Date: Mon, 22 Dec 2014 14:16:12 GMT 4 | Content-Type: text/html 5 | Content-Length: 166 6 | Connection: close 7 | 8 | 9 | 502 Bad Gateway 10 | 11 |

502 Bad Gateway

12 |
nginx
13 | 14 | 15 | -------------------------------------------------------------------------------- /test/fixtures.http/cancelDomainTransfer/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 202 Accepted 2 | Server: nginx 3 | Date: Fri, 05 Jun 2020 18:09:42 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | X-RateLimit-Limit: 2400 7 | X-RateLimit-Remaining: 2394 8 | X-RateLimit-Reset: 1591384034 9 | Cache-Control: no-cache 10 | X-Request-Id: 3cf6dcfa-0bb5-439e-863a-af2ef08bc830 11 | X-Runtime: 0.912731 12 | X-Frame-Options: DENY 13 | X-Content-Type-Options: nosniff 14 | X-XSS-Protection: 1; mode=block 15 | X-Download-Options: noopen 16 | X-Permitted-Cross-Domain-Policies: none 17 | 18 | {"data":{"id":361,"domain_id":182245,"registrant_id":2715,"state":"transferring","auto_renew":false,"whois_privacy":false,"status_description":null,"created_at":"2020-06-05T18:08:00Z","updated_at":"2020-06-05T18:08:04Z"}} 19 | -------------------------------------------------------------------------------- /test/fixtures.http/changeDomainDelegation/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: nginx 3 | Date: Thu, 24 Mar 2016 11:17:01 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | Status: 200 OK 7 | X-RateLimit-Limit: 2400 8 | X-RateLimit-Remaining: 2392 9 | X-RateLimit-Reset: 1458821049 10 | ETag: W/"cb540984f806b12ac437cc1f76092f90" 11 | Cache-Control: max-age=0, private, must-revalidate 12 | X-Request-Id: 0ea7bdd2-63ca-4eef-9c41-4a83d2fe0067 13 | X-Runtime: 2.845860 14 | Strict-Transport-Security: max-age=31536000 15 | 16 | {"data":["ns1.dnsimple.com","ns2.dnsimple.com","ns3.dnsimple.com","ns4.dnsimple.com"]} -------------------------------------------------------------------------------- /test/fixtures.http/changeDomainDelegationFromVanity/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 204 No Content 2 | Server: nginx 3 | Date: Mon, 11 Jul 2016 09:55:23 GMT 4 | Connection: keep-alive 5 | X-RateLimit-Limit: 2400 6 | X-RateLimit-Remaining: 2398 7 | X-RateLimit-Reset: 1468233619 8 | Cache-Control: no-cache 9 | X-Request-Id: 334a5c9c-8205-414c-bca2-db0469ed0b4a 10 | X-Runtime: 0.385941 11 | X-Content-Type-Options: nosniff 12 | X-Download-Options: noopen 13 | X-Frame-Options: DENY 14 | X-Permitted-Cross-Domain-Policies: none 15 | X-XSS-Protection: 1; mode=block 16 | Strict-Transport-Security: max-age=31536000 17 | 18 | -------------------------------------------------------------------------------- /test/fixtures.http/changeDomainDelegationToVanity/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: nginx 3 | Date: Mon, 11 Jul 2016 09:40:19 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | X-RateLimit-Limit: 2400 7 | X-RateLimit-Remaining: 2399 8 | X-RateLimit-Reset: 1468233619 9 | ETag: W/"ca1610ec571d766d1c1eda330b4fe9d6" 10 | Cache-Control: max-age=0, private, must-revalidate 11 | X-Request-Id: 931e4d9b-88ea-4723-b1b4-4b29c49b88b5 12 | X-Runtime: 0.270340 13 | X-Content-Type-Options: nosniff 14 | X-Download-Options: noopen 15 | X-Frame-Options: DENY 16 | X-Permitted-Cross-Domain-Policies: none 17 | X-XSS-Protection: 1; mode=block 18 | Strict-Transport-Security: max-age=31536000 19 | 20 | {"data":[{"id":1,"name":"ns1.example.com","ipv4":"127.0.0.1","ipv6":"::1","created_at":"2016-07-11T09:40:19Z","updated_at":"2016-07-11T09:40:19Z"},{"id":2,"name":"ns2.example.com","ipv4":"127.0.0.1","ipv6":"::1","created_at":"2016-07-11T09:40:19Z","updated_at":"2016-07-11T09:40:19Z"}]} 21 | -------------------------------------------------------------------------------- /test/fixtures.http/checkDomain/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: nginx 3 | Date: Fri, 26 Feb 2016 16:04:05 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | Status: 200 OK 7 | X-RateLimit-Limit: 4000 8 | X-RateLimit-Remaining: 3999 9 | X-RateLimit-Reset: 1456506245 10 | ETag: W/"f3cf8499e935e48401aae26842f712c4" 11 | Cache-Control: max-age=0, private, must-revalidate 12 | X-Request-Id: e3c6fac1-a36d-42c3-8a04-d68f127add18 13 | X-Runtime: 0.605907 14 | Strict-Transport-Security: max-age=31536000 15 | 16 | {"data":{"domain":"ruby.codes","available":true,"premium":true}} -------------------------------------------------------------------------------- /test/fixtures.http/checkDomainPremiumPrice/error_400_not_a_premium_domain.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 400 Bad Request 2 | Server: nginx 3 | Date: Mon, 27 Jul 2020 13:43:02 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | X-RateLimit-Limit: 4800 7 | X-RateLimit-Remaining: 4786 8 | X-RateLimit-Reset: 1595859922 9 | Cache-Control: no-cache 10 | X-Request-Id: 382b409c-0f90-4758-af3b-0bccd31a9d0d 11 | X-Runtime: 1.346405 12 | X-Frame-Options: DENY 13 | X-Content-Type-Options: nosniff 14 | X-XSS-Protection: 1; mode=block 15 | X-Download-Options: noopen 16 | X-Permitted-Cross-Domain-Policies: none 17 | 18 | {"message":"`cocotero.love` is not a premium domain for registration"} 19 | -------------------------------------------------------------------------------- /test/fixtures.http/checkDomainPremiumPrice/error_400_tld_not_supported.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 400 Bad Request 2 | Server: nginx 3 | Date: Mon, 27 Jul 2020 13:41:23 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | X-RateLimit-Limit: 2400 7 | X-RateLimit-Remaining: 2398 8 | X-RateLimit-Reset: 1595860823 9 | Cache-Control: no-cache 10 | X-Request-Id: 6986cca3-4f57-4814-9e81-1c484d61c7ea 11 | X-Runtime: 0.007339 12 | X-Frame-Options: DENY 13 | X-Content-Type-Options: nosniff 14 | X-XSS-Protection: 1; mode=block 15 | X-Download-Options: noopen 16 | X-Permitted-Cross-Domain-Policies: none 17 | 18 | {"message":"TLD .LOVE is not supported"} 19 | -------------------------------------------------------------------------------- /test/fixtures.http/checkDomainPremiumPrice/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: nginx 3 | Date: Mon, 27 Jul 2020 13:58:50 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | X-RateLimit-Limit: 4800 7 | X-RateLimit-Remaining: 4769 8 | X-RateLimit-Reset: 1595859923 9 | ETag: W/"54b4776b898065f2f551fc33465d0936" 10 | Cache-Control: max-age=0, private, must-revalidate 11 | X-Request-Id: 75c5090e-8000-4e95-a516-ffd09383f641 12 | X-Runtime: 2.380524 13 | X-Frame-Options: DENY 14 | X-Content-Type-Options: nosniff 15 | X-XSS-Protection: 1; mode=block 16 | X-Download-Options: noopen 17 | X-Permitted-Cross-Domain-Policies: none 18 | Strict-Transport-Security: max-age=31536000 19 | 20 | {"data":{"premium_price":"2640.00","action":"registration"}} 21 | -------------------------------------------------------------------------------- /test/fixtures.http/checkRegistrantChange/success.http: -------------------------------------------------------------------------------- 1 | HTTP/2 200 2 | server: nginx 3 | date: Tue, 22 Aug 2023 11:09:40 GMT 4 | content-type: application/json; charset=utf-8 5 | x-ratelimit-limit: 2400 6 | x-ratelimit-remaining: 2395 7 | x-ratelimit-reset: 1692705338 8 | x-work-with-us: Love automation? So do we! https://dnsimple.com/jobs 9 | etag: W/"cef1e7d85d0b9bfd25e81b812891d34f" 10 | cache-control: max-age=0, private, must-revalidate 11 | x-request-id: 5b0d8bfb-7b6a-40b5-a079-b640fd817e34 12 | x-runtime: 3.066249 13 | strict-transport-security: max-age=63072000 14 | 15 | {"data":{"domain_id":101,"contact_id":101,"extended_attributes":[],"registry_owner_change":true}} -------------------------------------------------------------------------------- /test/fixtures.http/checkZoneDistribution/error.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 504 Gateway Timeout 2 | Server: nginx 3 | Date: Mon, 30 Oct 2017 09:09:41 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | X-RateLimit-Limit: 2400 7 | X-RateLimit-Remaining: 2399 8 | X-RateLimit-Reset: 1509358181 9 | ETag: W/"10fc650d019e6bffa876f08bce8f3380" 10 | Cache-Control: max-age=0, private, must-revalidate 11 | X-Request-Id: 91f124fc-671d-40fa-877b-0b222692f623 12 | X-Runtime: 0.471005 13 | X-Content-Type-Options: nosniff 14 | X-Download-Options: noopen 15 | X-Frame-Options: DENY 16 | X-Permitted-Cross-Domain-Policies: none 17 | X-XSS-Protection: 1; mode=block 18 | Strict-Transport-Security: max-age=31536000 19 | 20 | {"message":"Could not query zone, connection timed out"} 21 | -------------------------------------------------------------------------------- /test/fixtures.http/checkZoneDistribution/failure.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: nginx 3 | Date: Mon, 30 Oct 2017 09:09:41 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | X-RateLimit-Limit: 2400 7 | X-RateLimit-Remaining: 2399 8 | X-RateLimit-Reset: 1509358181 9 | ETag: W/"10fc650d019e6bffa876f08bce8f3380" 10 | Cache-Control: max-age=0, private, must-revalidate 11 | X-Request-Id: 91f124fc-671d-40fa-877b-0b222692f623 12 | X-Runtime: 0.471005 13 | X-Content-Type-Options: nosniff 14 | X-Download-Options: noopen 15 | X-Frame-Options: DENY 16 | X-Permitted-Cross-Domain-Policies: none 17 | X-XSS-Protection: 1; mode=block 18 | Strict-Transport-Security: max-age=31536000 19 | 20 | {"data":{"distributed":false}} 21 | -------------------------------------------------------------------------------- /test/fixtures.http/checkZoneDistribution/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: nginx 3 | Date: Mon, 30 Oct 2017 09:09:41 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | X-RateLimit-Limit: 2400 7 | X-RateLimit-Remaining: 2399 8 | X-RateLimit-Reset: 1509358181 9 | ETag: W/"10fc650d019e6bffa876f08bce8f3380" 10 | Cache-Control: max-age=0, private, must-revalidate 11 | X-Request-Id: 91f124fc-671d-40fa-877b-0b222692f623 12 | X-Runtime: 0.471005 13 | X-Content-Type-Options: nosniff 14 | X-Download-Options: noopen 15 | X-Frame-Options: DENY 16 | X-Permitted-Cross-Domain-Policies: none 17 | X-XSS-Protection: 1; mode=block 18 | Strict-Transport-Security: max-age=31536000 19 | 20 | {"data":{"distributed":true}} 21 | -------------------------------------------------------------------------------- /test/fixtures.http/checkZoneRecordDistribution/error.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 504 Gateway Timeout 2 | Server: nginx 3 | Date: Mon, 18 Dec 2017 10:54:48 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | X-RateLimit-Limit: 2400 7 | X-RateLimit-Remaining: 2397 8 | X-RateLimit-Reset: 1513597686 9 | ETag: W/"10fc650d019e6bffa876f08bce8f3380" 10 | Cache-Control: max-age=0, private, must-revalidate 11 | X-Request-Id: 74059b13-9262-4e2d-b8ff-a833376dce19 12 | X-Runtime: 0.408180 13 | X-Content-Type-Options: nosniff 14 | X-Download-Options: noopen 15 | X-Frame-Options: DENY 16 | X-Permitted-Cross-Domain-Policies: none 17 | X-XSS-Protection: 1; mode=block 18 | Strict-Transport-Security: max-age=31536000 19 | 20 | {"message":"Could not query zone, connection timed out"} 21 | -------------------------------------------------------------------------------- /test/fixtures.http/checkZoneRecordDistribution/failure.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: nginx 3 | Date: Mon, 18 Dec 2017 10:54:13 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | X-RateLimit-Limit: 2400 7 | X-RateLimit-Remaining: 2398 8 | X-RateLimit-Reset: 1513597686 9 | ETag: W/"10fc650d019e6bffa876f08bce8f3380" 10 | Cache-Control: max-age=0, private, must-revalidate 11 | X-Request-Id: f5a86610-0e22-4047-a27c-350769eaa6d5 12 | X-Runtime: 0.425440 13 | X-Content-Type-Options: nosniff 14 | X-Download-Options: noopen 15 | X-Frame-Options: DENY 16 | X-Permitted-Cross-Domain-Policies: none 17 | X-XSS-Protection: 1; mode=block 18 | Strict-Transport-Security: max-age=31536000 19 | 20 | {"data":{"distributed":false}} 21 | -------------------------------------------------------------------------------- /test/fixtures.http/checkZoneRecordDistribution/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: nginx 3 | Date: Mon, 18 Dec 2017 10:48:06 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | X-RateLimit-Limit: 2400 7 | X-RateLimit-Remaining: 2399 8 | X-RateLimit-Reset: 1513597686 9 | ETag: W/"10fc650d019e6bffa876f08bce8f3380" 10 | Cache-Control: max-age=0, private, must-revalidate 11 | X-Request-Id: 34c69751-ffee-4856-ac28-ead4f3a66e18 12 | X-Runtime: 0.438473 13 | X-Content-Type-Options: nosniff 14 | X-Download-Options: noopen 15 | X-Frame-Options: DENY 16 | X-Permitted-Cross-Domain-Policies: none 17 | X-XSS-Protection: 1; mode=block 18 | Strict-Transport-Security: max-age=31536000 19 | 20 | {"data":{"distributed":true}} 21 | -------------------------------------------------------------------------------- /test/fixtures.http/createContact/created.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 201 Created 2 | Server: nginx 3 | Date: Tue, 19 Jan 2016 20:50:26 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | Status: 201 Created 7 | X-RateLimit-Limit: 4000 8 | X-RateLimit-Remaining: 3997 9 | X-RateLimit-Reset: 1453239045 10 | ETag: W/"165299b0ea3e5c1c80f1ae622146626f" 11 | Cache-Control: max-age=0, private, must-revalidate 12 | X-Request-Id: 9f577b9e-5bc4-4a8f-adfb-09dbb1992b0e 13 | X-Runtime: 0.061482 14 | Strict-Transport-Security: max-age=31536000 15 | 16 | {"data":{"id":1,"account_id":1010,"label":"Default","first_name":"First","last_name":"User","job_title":"CEO","organization_name":"Awesome Company","email":"first@example.com","phone":"+18001234567","fax":"+18011234567","address1":"Italian Street, 10","address2":"","city":"Roma","state_province":"RM","postal_code":"00100","country":"IT","created_at":"2016-01-19T20:50:26Z","updated_at":"2016-01-19T20:50:26Z"}} 17 | -------------------------------------------------------------------------------- /test/fixtures.http/createContact/error-validation-errors.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 400 Bad Request 2 | Server: nginx 3 | Date: Wed, 23 Nov 2016 08:12:57 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | X-RateLimit-Limit: 2400 7 | X-RateLimit-Remaining: 2396 8 | X-RateLimit-Reset: 1479892333 9 | Cache-Control: no-cache 10 | X-Request-Id: 91dcf81b-5df4-4d45-b37e-446f0c422a27 11 | X-Runtime: 0.062556 12 | X-Content-Type-Options: nosniff 13 | X-Download-Options: noopen 14 | X-Frame-Options: DENY 15 | X-Permitted-Cross-Domain-Policies: none 16 | X-XSS-Protection: 1; mode=block 17 | 18 | {"message":"Validation failed","errors":{"address1":["can't be blank"],"city":["can't be blank"],"country":["can't be blank"],"email":["can't be blank","is an invalid email address"],"first_name":["can't be blank"],"last_name":["can't be blank"],"phone":["can't be blank","is probably not a phone number"],"postal_code":["can't be blank"],"state_province":["can't be blank"]}} 19 | -------------------------------------------------------------------------------- /test/fixtures.http/createDelegationSignerRecord/created.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 201 Created 2 | Server: nginx 3 | Date: Fri, 03 Mar 2017 15:24:00 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | X-RateLimit-Limit: 2400 7 | X-RateLimit-Remaining: 2399 8 | X-RateLimit-Reset: 1488558240 9 | ETag: W/"6443c4a27424c31a2a08e941be6319a4" 10 | Cache-Control: max-age=0, private, must-revalidate 11 | X-Request-Id: 44b1448f-c7da-4988-ba5a-5b7f9892b1d2 12 | X-Runtime: 0.351659 13 | X-Content-Type-Options: nosniff 14 | X-Download-Options: noopen 15 | X-Frame-Options: DENY 16 | X-Permitted-Cross-Domain-Policies: none 17 | X-XSS-Protection: 1; mode=block 18 | Strict-Transport-Security: max-age=31536000 19 | 20 | {"data":{"id":2,"domain_id":1010,"algorithm":"13","digest":"684a1f049d7d082b7f98691657da5a65764913df7f065f6f8c36edf62d66ca03","digest_type":"2","keytag":"2371","public_key":null,"created_at":"2017-03-03T15:24:00Z","updated_at":"2017-03-03T15:24:00Z"}} 21 | -------------------------------------------------------------------------------- /test/fixtures.http/createDelegationSignerRecord/validation-error.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 400 Bad Request 2 | Server: nginx 3 | Date: Fri, 03 Mar 2017 15:20:28 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | X-RateLimit-Limit: 2400 7 | X-RateLimit-Remaining: 2395 8 | X-RateLimit-Reset: 1488554574 9 | Cache-Control: no-cache 10 | X-Request-Id: bf652af9-54cd-42c7-8fd3-2f52e2baea4b 11 | X-Runtime: 0.350846 12 | X-Content-Type-Options: nosniff 13 | X-Download-Options: noopen 14 | X-Frame-Options: DENY 15 | X-Permitted-Cross-Domain-Policies: none 16 | X-XSS-Protection: 1; mode=block 17 | 18 | {"message":"Validation failed","errors":{"algorithm":["can't be blank"],"digest":["can't be blank"],"digest_type":["can't be blank"],"keytag":["can't be blank"]}} 19 | -------------------------------------------------------------------------------- /test/fixtures.http/createDomain/created.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 201 Created 2 | Server: nginx 3 | Date: Thu, 04 Jun 2020 19:47:05 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | X-RateLimit-Limit: 2400 7 | X-RateLimit-Remaining: 2378 8 | X-RateLimit-Reset: 1591300248 9 | ETag: W/"399e70627412fa31dba332feca5e8ec1" 10 | Cache-Control: max-age=0, private, must-revalidate 11 | X-Request-Id: ee897eee-36cc-4b7f-be15-f4627f344bf9 12 | X-Runtime: 0.194561 13 | X-Frame-Options: DENY 14 | X-Content-Type-Options: nosniff 15 | X-XSS-Protection: 1; mode=block 16 | X-Download-Options: noopen 17 | X-Permitted-Cross-Domain-Policies: none 18 | Strict-Transport-Security: max-age=31536000 19 | 20 | {"data":{"id":181985,"account_id":1385,"registrant_id":null,"name":"example-beta.com","unicode_name":"example-beta.com","state":"hosted","auto_renew":false,"private_whois":false,"expires_on":null,"expires_at":null,"created_at":"2020-06-04T19:47:05Z","updated_at":"2020-06-04T19:47:05Z"}} 21 | -------------------------------------------------------------------------------- /test/fixtures.http/createEmailForward/created.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 201 Created 2 | Server: nginx 3 | Date: Mon, 25 Jan 2021 13:54:40 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Transfer-Encoding: identity 6 | Connection: keep-alive 7 | X-RateLimit-Limit: 4800 8 | X-RateLimit-Remaining: 4772 9 | X-RateLimit-Reset: 1611583415 10 | ETag: W/"80ad3ad1e115a8123193447fa003f68a" 11 | Cache-Control: max-age=0, private, must-revalidate 12 | X-Request-Id: 1086590f-0e65-4010-8636-031400a662bf 13 | X-Runtime: 0.880228 14 | X-Frame-Options: DENY 15 | X-Content-Type-Options: nosniff 16 | X-XSS-Protection: 1; mode=block 17 | X-Download-Options: noopen 18 | X-Permitted-Cross-Domain-Policies: none 19 | Content-Security-Policy: frame-ancestors 'none' 20 | Strict-Transport-Security: max-age=31536000 21 | 22 | {"data":{"id":41872,"domain_id":235146,"alias_email":"example@dnsimple.xyz","destination_email":"example@example.com","created_at":"2021-01-25T13:54:40Z","updated_at":"2021-01-25T13:54:40Z","from":"example@dnsimple.xyz","to":"example@example.com"}} -------------------------------------------------------------------------------- /test/fixtures.http/createPrimaryServer/created.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 201 Created 2 | Server: nginx 3 | Date: Wed, 17 Mar 2021 23:08:42 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | X-RateLimit-Limit: 2400 7 | X-RateLimit-Remaining: 2388 8 | X-RateLimit-Reset: 1616024599 9 | ETag: W/"ceda02163217bdb9e6850e2c36cbf163" 10 | Cache-Control: max-age=0, private, must-revalidate 11 | X-Request-Id: 24ed1594-6701-475b-b66b-f85f9fe69736 12 | X-Runtime: 0.162800 13 | X-Frame-Options: DENY 14 | X-Content-Type-Options: nosniff 15 | X-XSS-Protection: 1; mode=block 16 | X-Download-Options: noopen 17 | X-Permitted-Cross-Domain-Policies: none 18 | Content-Security-Policy: frame-ancestors 'none' 19 | Strict-Transport-Security: max-age=31536000 20 | 21 | {"data":{"id":4,"account_id":531,"name":"PrimaryProduction","ip":"1.2.3.4","port":53,"linked_secondary_zones":[],"created_at":"2021-03-17T23:08:42Z","updated_at":"2021-03-17T23:08:42Z"}} -------------------------------------------------------------------------------- /test/fixtures.http/createRegistrantChange/success.http: -------------------------------------------------------------------------------- 1 | HTTP/2 202 2 | server: nginx 3 | date: Tue, 22 Aug 2023 11:11:00 GMT 4 | content-type: application/json; charset=utf-8 5 | x-ratelimit-limit: 2400 6 | x-ratelimit-remaining: 2394 7 | x-ratelimit-reset: 1692705339 8 | x-work-with-us: Love automation? So do we! https://dnsimple.com/jobs 9 | cache-control: no-cache 10 | x-request-id: 26bf7ff9-2075-42b0-9431-1778c825b6b0 11 | x-runtime: 3.408950 12 | strict-transport-security: max-age=63072000 13 | 14 | {"data":{"id":101,"account_id":101,"domain_id":101,"contact_id":101,"state":"new","extended_attributes":{},"registry_owner_change":true,"irt_lock_lifted_by":null,"created_at":"2017-02-03T17:43:22Z","updated_at":"2017-02-03T17:43:22Z"}} -------------------------------------------------------------------------------- /test/fixtures.http/createSecondaryZone/created.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 201 Created 2 | Server: nginx 3 | Date: Wed, 17 Mar 2021 23:44:27 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | X-RateLimit-Limit: 2400 7 | X-RateLimit-Remaining: 2398 8 | X-RateLimit-Reset: 1616028241 9 | ETag: W/"9726e9abb694bb7a61777076d14158fd" 10 | Cache-Control: max-age=0, private, must-revalidate 11 | X-Request-Id: 967ead79-85e7-4950-aa70-52da90f9abcc 12 | X-Runtime: 0.294142 13 | X-Frame-Options: DENY 14 | X-Content-Type-Options: nosniff 15 | X-XSS-Protection: 1; mode=block 16 | X-Download-Options: noopen 17 | X-Permitted-Cross-Domain-Policies: none 18 | Content-Security-Policy: frame-ancestors 'none' 19 | Strict-Transport-Security: max-age=31536000 20 | 21 | {"data":{"id":734,"account_id":531,"name":"secondaryexample.com","reverse":false,"secondary":true,"last_transferred_at":null,"created_at":"2021-03-17T23:44:27Z","updated_at":"2021-03-17T23:44:27Z"}} -------------------------------------------------------------------------------- /test/fixtures.http/createTemplate/created.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 201 Created 2 | Server: nginx 3 | Date: Thu, 24 Mar 2016 11:09:16 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | Status: 201 Created 7 | X-RateLimit-Limit: 2400 8 | X-RateLimit-Remaining: 2396 9 | X-RateLimit-Reset: 1458821049 10 | ETag: W/"c0be8a0056ccd8e0ee31a60c51256848" 11 | Cache-Control: max-age=0, private, must-revalidate 12 | X-Request-Id: c4ab6dd9-87d4-4244-8ec8-9187a511b89c 13 | X-Runtime: 0.115316 14 | Strict-Transport-Security: max-age=31536000 15 | 16 | {"data":{"id":1,"account_id":1010,"name":"Beta","sid":"beta","description":"A beta template.","created_at":"2016-03-24T11:09:16Z","updated_at":"2016-03-24T11:09:16Z"}} -------------------------------------------------------------------------------- /test/fixtures.http/createTemplateRecord/created.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 201 Created 2 | Server: nginx 3 | Date: Tue, 03 May 2016 07:51:33 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | Status: 201 Created 7 | X-RateLimit-Limit: 2400 8 | X-RateLimit-Remaining: 2398 9 | X-RateLimit-Reset: 1462265481 10 | ETag: W/"a8518ecf2fd31e6c22b0acccb5cef797" 11 | Cache-Control: max-age=0, private, must-revalidate 12 | X-Request-Id: b2d51e79-b3d2-4abe-9184-155fb5546617 13 | X-Runtime: 0.190813 14 | Strict-Transport-Security: max-age=31536000 15 | 16 | {"data":{"id":300,"template_id":268,"name":"","content":"mx.example.com","ttl":600,"priority":10,"type":"MX","created_at":"2016-05-03T07:51:33Z","updated_at":"2016-05-03T07:51:33Z"}} 17 | -------------------------------------------------------------------------------- /test/fixtures.http/createWebhook/created.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 201 Created 2 | Server: nginx 3 | Date: Mon, 15 Feb 2016 17:04:38 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | Status: 201 Created 7 | X-RateLimit-Limit: 4000 8 | X-RateLimit-Remaining: 3996 9 | X-RateLimit-Reset: 1455559348 10 | ETag: W/"a4b43ee926d18d0839f1eae08e78c66b" 11 | Cache-Control: max-age=0, private, must-revalidate 12 | X-Request-Id: dca89281-416a-4766-9428-d0295f58586e 13 | X-Runtime: 0.175179 14 | Strict-Transport-Security: max-age=31536000 15 | 16 | {"data":{"id":1,"url":"https://webhook.test"}} 17 | -------------------------------------------------------------------------------- /test/fixtures.http/createZoneRecord/created-apex.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 201 Created 2 | Server: nginx 3 | Date: Thu, 07 Jan 2016 17:45:13 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | Status: 201 Created 7 | X-RateLimit-Limit: 4000 8 | X-RateLimit-Remaining: 3990 9 | X-RateLimit-Reset: 1452188712 10 | ETag: W/"a7ddff4ee5dc28bbebf3d416e8bd0f04" 11 | Cache-Control: max-age=0, private, must-revalidate 12 | X-Request-Id: f96f5034-bf0c-4201-9564-493c162e3cb4 13 | X-Runtime: 0.099095 14 | Strict-Transport-Security: max-age=31536000 15 | 16 | {"data":{"id":1,"zone_id":"example.com","parent_id":null,"name":"","content":"127.0.0.1","ttl":600,"priority":null,"type":"A","system_record":false,"regions":["global"],"created_at":"2016-01-07T17:45:13Z","updated_at":"2016-01-07T17:45:13Z"}} -------------------------------------------------------------------------------- /test/fixtures.http/createZoneRecord/created.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 201 Created 2 | Server: nginx 3 | Date: Thu, 07 Jan 2016 17:45:13 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | Status: 201 Created 7 | X-RateLimit-Limit: 4000 8 | X-RateLimit-Remaining: 3990 9 | X-RateLimit-Reset: 1452188712 10 | ETag: W/"a7ddff4ee5dc28bbebf3d416e8bd0f04" 11 | Cache-Control: max-age=0, private, must-revalidate 12 | X-Request-Id: f96f5034-bf0c-4201-9564-493c162e3cb4 13 | X-Runtime: 0.099095 14 | Strict-Transport-Security: max-age=31536000 15 | 16 | {"data":{"id":1,"zone_id":"example.com","parent_id":null,"name":"www","content":"127.0.0.1","ttl":600,"priority":null,"type":"A","system_record":false,"regions":["global"],"created_at":"2016-01-07T17:45:13Z","updated_at":"2016-01-07T17:45:13Z"}} -------------------------------------------------------------------------------- /test/fixtures.http/deactivateZoneService/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: nginx 3 | Date: Tue, 08 Aug 2023 04:19:52 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | X-RateLimit-Limit: 2400 7 | X-RateLimit-Remaining: 2398 8 | X-RateLimit-Reset: 1691471962 9 | X-WORK-WITH-US: Love automation? So do we! https://dnsimple.com/jobs 10 | ETag: W/"5f30a37d01b99bb9e620ef1bbce9a014" 11 | Cache-Control: max-age=0, private, must-revalidate 12 | X-Request-Id: d2f7bba4-4c81-4818-81d2-c9bbe95f104e 13 | X-Runtime: 0.133278 14 | Strict-Transport-Security: max-age=63072000 15 | 16 | {"data":{"id":1,"account_id":1010,"name":"example.com","reverse":false,"secondary":false,"last_transferred_at":null,"active":false,"created_at":"2015-04-23T07:40:03Z","updated_at":"2015-04-23T07:40:03Z"}} 17 | -------------------------------------------------------------------------------- /test/fixtures.http/deleteContact/error-contact-in-use.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 400 Bad Request 2 | Server: nginx 3 | Date: Wed, 11 Apr 2018 10:50:21 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | X-RateLimit-Limit: 2400 7 | X-RateLimit-Remaining: 2397 8 | X-RateLimit-Reset: 1523447401 9 | Cache-Control: no-cache 10 | X-Request-Id: 8d9f3de7-6e42-4a16-82eb-e2434dd58008 11 | X-Runtime: 0.271090 12 | X-Content-Type-Options: nosniff 13 | X-Download-Options: noopen 14 | X-Frame-Options: DENY 15 | X-Permitted-Cross-Domain-Policies: none 16 | X-XSS-Protection: 1; mode=block 17 | 18 | {"message":"The contact cannot be deleted because it's currently in use"} 19 | -------------------------------------------------------------------------------- /test/fixtures.http/deleteContact/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 204 No Content 2 | Server: nginx 3 | Date: Tue, 19 Jan 2016 21:49:42 GMT 4 | Connection: keep-alive 5 | Status: 204 No Content 6 | X-RateLimit-Limit: 4000 7 | X-RateLimit-Remaining: 3999 8 | X-RateLimit-Reset: 1453243782 9 | Cache-Control: no-cache 10 | X-Request-Id: 10c8528b-569b-4152-a89c-fc9c5f94afe9 11 | X-Runtime: 0.029858 12 | Strict-Transport-Security: max-age=31536000 13 | 14 | -------------------------------------------------------------------------------- /test/fixtures.http/deleteDelegationSignerRecord/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 204 No Content 2 | Server: nginx 3 | Date: Fri, 03 Mar 2017 15:25:00 GMT 4 | Connection: keep-alive 5 | X-RateLimit-Limit: 2400 6 | X-RateLimit-Remaining: 2398 7 | X-RateLimit-Reset: 1488558240 8 | Cache-Control: no-cache 9 | X-Request-Id: 50271e09-f056-4413-9eea-87e097d43e8b 10 | X-Runtime: 0.306806 11 | X-Content-Type-Options: nosniff 12 | X-Download-Options: noopen 13 | X-Frame-Options: DENY 14 | X-Permitted-Cross-Domain-Policies: none 15 | X-XSS-Protection: 1; mode=block 16 | Strict-Transport-Security: max-age=31536000 17 | 18 | -------------------------------------------------------------------------------- /test/fixtures.http/deleteDomain/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 204 No Content 2 | Server: nginx 3 | Date: Fri, 18 Dec 2015 16:13:54 GMT 4 | Connection: keep-alive 5 | Strict-Transport-Security: max-age=31536000 6 | X-RateLimit-Limit: 4000 7 | X-RateLimit-Remaining: 3990 8 | X-RateLimit-Reset: 1450455233 9 | Cache-Control: no-cache 10 | X-Request-Id: a2924814-4aff-42cf-9785-9327ce097d0a 11 | X-Runtime: 0.241247 12 | Strict-Transport-Security: max-age=31536000 13 | 14 | -------------------------------------------------------------------------------- /test/fixtures.http/deleteEmailForward/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 204 No Content 2 | Server: nginx 3 | Date: Mon, 25 Jan 2021 13:56:43 GMT 4 | Connection: keep-alive 5 | X-RateLimit-Limit: 4800 6 | X-RateLimit-Remaining: 4765 7 | X-RateLimit-Reset: 1611583416 8 | Cache-Control: no-cache 9 | X-Request-Id: bfaceb73-4fd3-4490-8528-472ec1df3526 10 | X-Runtime: 0.506670 11 | X-Frame-Options: DENY 12 | X-Content-Type-Options: nosniff 13 | X-XSS-Protection: 1; mode=block 14 | X-Download-Options: noopen 15 | X-Permitted-Cross-Domain-Policies: none 16 | Content-Security-Policy: frame-ancestors 'none' 17 | Strict-Transport-Security: max-age=31536000 18 | 19 | -------------------------------------------------------------------------------- /test/fixtures.http/deleteRegistrantChange/success.http: -------------------------------------------------------------------------------- 1 | HTTP/2 201 2 | server: nginx 3 | date: Tue, 22 Aug 2023 11:14:44 GMT 4 | content-type: application/json; charset=utf-8 5 | x-ratelimit-limit: 2400 6 | x-ratelimit-remaining: 2391 7 | x-ratelimit-reset: 1692705338 8 | x-work-with-us: Love automation? So do we! https://dnsimple.com/jobs 9 | cache-control: no-cache 10 | x-request-id: b123e1f0-aa70-4abb-95cf-34f377c83ef4 11 | x-runtime: 0.114839 12 | strict-transport-security: max-age=63072000 13 | 14 | -------------------------------------------------------------------------------- /test/fixtures.http/deleteTemplate/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 204 No Content 2 | Server: nginx 3 | Date: Thu, 24 Mar 2016 11:05:38 GMT 4 | Connection: keep-alive 5 | Status: 204 No Content 6 | X-RateLimit-Limit: 2400 7 | X-RateLimit-Remaining: 2397 8 | X-RateLimit-Reset: 1458821049 9 | Cache-Control: no-cache 10 | X-Request-Id: 967713d5-a203-40ee-875c-1df07868b7eb 11 | X-Runtime: 0.147576 12 | Strict-Transport-Security: max-age=31536000 13 | 14 | -------------------------------------------------------------------------------- /test/fixtures.http/deleteTemplateRecord/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 204 No Content 2 | Server: nginx 3 | Date: Tue, 03 May 2016 08:00:35 GMT 4 | Connection: keep-alive 5 | Status: 204 No Content 6 | X-RateLimit-Limit: 2400 7 | X-RateLimit-Remaining: 2397 8 | X-RateLimit-Reset: 1462265481 9 | Cache-Control: no-cache 10 | X-Request-Id: f0a48944-1c61-41f4-b379-04f8644d883b 11 | X-Runtime: 0.122787 12 | Strict-Transport-Security: max-age=31536000 13 | 14 | -------------------------------------------------------------------------------- /test/fixtures.http/deleteWebhook/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 204 No Content 2 | Server: nginx 3 | Date: Mon, 15 Feb 2016 17:05:39 GMT 4 | Connection: keep-alive 5 | Status: 204 No Content 6 | X-RateLimit-Limit: 4000 7 | X-RateLimit-Remaining: 3993 8 | X-RateLimit-Reset: 1455559348 9 | Cache-Control: no-cache 10 | X-Request-Id: d681e116-4a27-45a6-b571-3f74bfafb1f4 11 | X-Runtime: 0.520613 12 | Strict-Transport-Security: max-age=31536000 13 | 14 | -------------------------------------------------------------------------------- /test/fixtures.http/deleteZoneRecord/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 204 No Content 2 | Server: nginx 3 | Date: Thu, 07 Jan 2016 18:06:28 GMT 4 | Connection: keep-alive 5 | Status: 204 No Content 6 | X-RateLimit-Limit: 4000 7 | X-RateLimit-Remaining: 3987 8 | X-RateLimit-Reset: 1452189987 9 | Cache-Control: no-cache 10 | X-Request-Id: 776cea0f-98ae-4550-9a2e-81f8ab27f82b 11 | X-Runtime: 0.099235 12 | Strict-Transport-Security: max-age=31536000 13 | 14 | -------------------------------------------------------------------------------- /test/fixtures.http/disableDnssec/not-enabled.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 428 Precondition Required 2 | Server: nginx 3 | Date: Fri, 03 Mar 2017 10:00:36 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | X-RateLimit-Limit: 2400 7 | X-RateLimit-Remaining: 2396 8 | X-RateLimit-Reset: 1488538622 9 | Cache-Control: no-cache 10 | X-Request-Id: 8e6cfeba-61f3-4449-9d95-dceaa1be30b0 11 | X-Runtime: 0.033649 12 | X-Content-Type-Options: nosniff 13 | X-Download-Options: noopen 14 | X-Frame-Options: DENY 15 | X-Permitted-Cross-Domain-Policies: none 16 | X-XSS-Protection: 1; mode=block 17 | 18 | {"message":"DNSSEC cannot be disabled because it is not enabled"} 19 | -------------------------------------------------------------------------------- /test/fixtures.http/disableDnssec/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 204 No Content 2 | Server: nginx 3 | Date: Fri, 03 Mar 2017 09:59:48 GMT 4 | Connection: keep-alive 5 | X-RateLimit-Limit: 2400 6 | X-RateLimit-Remaining: 2397 7 | X-RateLimit-Reset: 1488538622 8 | Cache-Control: no-cache 9 | X-Request-Id: d4904f31-9f5a-4616-a398-65915a2ade0f 10 | X-Runtime: 0.150273 11 | X-Content-Type-Options: nosniff 12 | X-Download-Options: noopen 13 | X-Frame-Options: DENY 14 | X-Permitted-Cross-Domain-Policies: none 15 | X-XSS-Protection: 1; mode=block 16 | Strict-Transport-Security: max-age=31536000 17 | 18 | -------------------------------------------------------------------------------- /test/fixtures.http/disableDomainAutoRenewal/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 204 No Content 2 | Server: nginx 3 | Date: Fri, 12 Feb 2016 11:15:46 GMT 4 | Connection: keep-alive 5 | Status: 204 No Content 6 | X-RateLimit-Limit: 4000 7 | X-RateLimit-Remaining: 3996 8 | X-RateLimit-Reset: 1455279163 9 | Cache-Control: no-cache 10 | X-Request-Id: 6a8e83f1-f80c-4dc0-a462-d63c932a59bb 11 | X-Runtime: 0.509466 12 | Strict-Transport-Security: max-age=31536000 13 | 14 | -------------------------------------------------------------------------------- /test/fixtures.http/disableDomainTransferLock/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: nginx 3 | Date: Tue, 15 Aug 2023 09:58:37 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | X-RateLimit-Limit: 2400 7 | X-RateLimit-Remaining: 2398 8 | X-RateLimit-Reset: 1488538623 9 | ETag: W/"fc2368a31a1b6a3afcca33bb37ff6b9d" 10 | Cache-Control: max-age=0, private, must-revalidate 11 | X-Request-Id: 8b0fe49a-c810-4552-84ab-a1cd9b4a7786 12 | X-Runtime: 0.024780 13 | X-Content-Type-Options: nosniff 14 | X-Download-Options: noopen 15 | X-Frame-Options: DENY 16 | X-Permitted-Cross-Domain-Policies: none 17 | X-XSS-Protection: 1; mode=block 18 | Strict-Transport-Security: max-age=31536000 19 | 20 | {"data":{"enabled":false}} 21 | -------------------------------------------------------------------------------- /test/fixtures.http/disableVanityNameServers/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 204 No Content 2 | Server: nginx 3 | Date: Tue, 12 Jul 2016 08:56:00 GMT 4 | Connection: keep-alive 5 | X-RateLimit-Limit: 2400 6 | X-RateLimit-Remaining: 2398 7 | X-RateLimit-Reset: 1468314483 8 | Cache-Control: no-cache 9 | X-Request-Id: 99c3fef2-d875-40fd-961c-194bffd694f1 10 | X-Runtime: 5.983300 11 | X-Content-Type-Options: nosniff 12 | X-Download-Options: noopen 13 | X-Frame-Options: DENY 14 | X-Permitted-Cross-Domain-Policies: none 15 | X-XSS-Protection: 1; mode=block 16 | Strict-Transport-Security: max-age=31536000 17 | 18 | -------------------------------------------------------------------------------- /test/fixtures.http/disableWhoisPrivacy/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: nginx 3 | Date: Sat, 13 Feb 2016 14:36:38 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | Status: 200 OK 7 | X-RateLimit-Limit: 4000 8 | X-RateLimit-Remaining: 3995 9 | X-RateLimit-Reset: 1455377134 10 | ETag: W/"56e3e7f76ba9c84dcab9aef72347edf2" 11 | Cache-Control: max-age=0, private, must-revalidate 12 | X-Request-Id: 4831c4d9-e62e-4710-a999-4ab32a900cea 13 | X-Runtime: 0.988453 14 | Strict-Transport-Security: max-age=31536000 15 | 16 | {"data":{"id":1,"domain_id":2,"expires_on":"2017-02-13","enabled":false,"created_at":"2016-02-13T14:34:50Z","updated_at":"2016-02-13T14:36:38Z"}} 17 | -------------------------------------------------------------------------------- /test/fixtures.http/downloadCertificate/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: nginx 3 | Date: Sat, 11 Jun 2016 18:53:48 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | X-RateLimit-Limit: 2400 7 | X-RateLimit-Remaining: 2396 8 | X-RateLimit-Reset: 1465674527 9 | ETag: W/"11aa44434f1e34a4ff761e23658395de" 10 | Cache-Control: max-age=0, private, must-revalidate 11 | X-Request-Id: ab7d0c2a-1a17-414e-b4e9-ebfd44343e90 12 | X-Runtime: 0.020621 13 | X-Content-Type-Options: nosniff 14 | X-Download-Options: noopen 15 | X-Frame-Options: DENY 16 | X-Permitted-Cross-Domain-Policies: none 17 | X-XSS-Protection: 1; mode=block 18 | Strict-Transport-Security: max-age=31536000 19 | 20 | {"data":{"server":"-----BEGIN CERTIFICATE-----\nMIIE7TCCA9WgAwIBAgITAPpTe4O3vjuQ9L4gLsogi/ukujANBgkqhkiG9w0BAQsF\nADAiMSAwHgYDVQQDDBdGYWtlIExFIEludGVybWVkaWF0ZSBYMTAeFw0xNjA2MTEx\nNzQ4MDBaFw0xNjA5MDkxNzQ4MDBaMBkxFzAVBgNVBAMTDnd3dy53ZXBwb3MubmV0\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtzCcMfWoQRt5AMEY0HUb\n2GaraL1GsWOo6YXdPfe+YDvtnmDw23NcoTX7VSeCgU9M3RKs19AsCJcRNTLJ2dmD\nrAuyCTud9YTAaXQcTOLUhtO8T8+9AFVIva2OmAlKCR5saBW3JaRxW7V2aHEd/d1s\ns1CvNOO7jNppc9NwGSnDHcn3rqNv/U3MaU0gpJJRqsKkvcLU6IHJGgxyQ6AbpwJD\nIqBnzkjHu2IuhGEbRuMjyWLA2qtsjyVlfPotDxUdVouUQpz7dGHUFrLR7ma8QAYu\nOfl1ZMyrc901HGMa7zwbnFWurs3fed7vAosTRZIjnn72/3Wo7L9RiMB+vwr3NX7c\n9QIDAQABo4ICIzCCAh8wDgYDVR0PAQH/BAQDAgWgMB0GA1UdJQQWMBQGCCsGAQUF\nBwMBBggrBgEFBQcDAjAMBgNVHRMBAf8EAjAAMB0GA1UdDgQWBBRh9q/3Zxbk4yA/\nt7j+8xA+rkiZBTAfBgNVHSMEGDAWgBTAzANGuVggzFxycPPhLssgpvVoOjB4Bggr\nBgEFBQcBAQRsMGowMwYIKwYBBQUHMAGGJ2h0dHA6Ly9vY3NwLnN0Zy1pbnQteDEu\nbGV0c2VuY3J5cHQub3JnLzAzBggrBgEFBQcwAoYnaHR0cDovL2NlcnQuc3RnLWlu\ndC14MS5sZXRzZW5jcnlwdC5vcmcvMCUGA1UdEQQeMByCCndlcHBvcy5uZXSCDnd3\ndy53ZXBwb3MubmV0MIH+BgNVHSAEgfYwgfMwCAYGZ4EMAQIBMIHmBgsrBgEEAYLf\nEwEBATCB1jAmBggrBgEFBQcCARYaaHR0cDovL2Nwcy5sZXRzZW5jcnlwdC5vcmcw\ngasGCCsGAQUFBwICMIGeDIGbVGhpcyBDZXJ0aWZpY2F0ZSBtYXkgb25seSBiZSBy\nZWxpZWQgdXBvbiBieSBSZWx5aW5nIFBhcnRpZXMgYW5kIG9ubHkgaW4gYWNjb3Jk\nYW5jZSB3aXRoIHRoZSBDZXJ0aWZpY2F0ZSBQb2xpY3kgZm91bmQgYXQgaHR0cHM6\nLy9sZXRzZW5jcnlwdC5vcmcvcmVwb3NpdG9yeS8wDQYJKoZIhvcNAQELBQADggEB\nAEqMdWrmdIyQxthWsX3iHmM2h/wXwEesD0VIaA+Pq4mjwmKBkoPSmHGQ/O4v8RaK\nB6gl8v+qmvCwwqC1SkBmm+9C2yt/P6WhAiA/DD+WppYgJWfcz2lEKrgufFlHPukB\nDzE0mJDuXm09QTApWlaTZWYfWKY50T5uOT/rs+OwGFFCO/8o7v5AZRAHos6uzjvq\nAtFZj/FEnXXMjSSlQ7YKTXToVpnAYH4e3/UMsi6/O4orkVz82ZfhKwMWHV8dXlRw\ntQaemFWTjGPgSLXJAtQO30DgNJBHX/fJEaHv6Wy8TF3J0wOGpzGbOwaTX8YAmEzC\nlzzjs+clg5MN5rd1g4POJtU=\n-----END CERTIFICATE-----\n","root":null,"chain":["-----BEGIN CERTIFICATE-----\nMIIEqzCCApOgAwIBAgIRAIvhKg5ZRO08VGQx8JdhT+UwDQYJKoZIhvcNAQELBQAw\nGjEYMBYGA1UEAwwPRmFrZSBMRSBSb290IFgxMB4XDTE2MDUyMzIyMDc1OVoXDTM2\nMDUyMzIyMDc1OVowIjEgMB4GA1UEAwwXRmFrZSBMRSBJbnRlcm1lZGlhdGUgWDEw\nggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDtWKySDn7rWZc5ggjz3ZB0\n8jO4xti3uzINfD5sQ7Lj7hzetUT+wQob+iXSZkhnvx+IvdbXF5/yt8aWPpUKnPym\noLxsYiI5gQBLxNDzIec0OIaflWqAr29m7J8+NNtApEN8nZFnf3bhehZW7AxmS1m0\nZnSsdHw0Fw+bgixPg2MQ9k9oefFeqa+7Kqdlz5bbrUYV2volxhDFtnI4Mh8BiWCN\nxDH1Hizq+GKCcHsinDZWurCqder/afJBnQs+SBSL6MVApHt+d35zjBD92fO2Je56\ndhMfzCgOKXeJ340WhW3TjD1zqLZXeaCyUNRnfOmWZV8nEhtHOFbUCU7r/KkjMZO9\nAgMBAAGjgeMwgeAwDgYDVR0PAQH/BAQDAgGGMBIGA1UdEwEB/wQIMAYBAf8CAQAw\nHQYDVR0OBBYEFMDMA0a5WCDMXHJw8+EuyyCm9Wg6MHoGCCsGAQUFBwEBBG4wbDA0\nBggrBgEFBQcwAYYoaHR0cDovL29jc3Auc3RnLXJvb3QteDEubGV0c2VuY3J5cHQu\nb3JnLzA0BggrBgEFBQcwAoYoaHR0cDovL2NlcnQuc3RnLXJvb3QteDEubGV0c2Vu\nY3J5cHQub3JnLzAfBgNVHSMEGDAWgBTBJnSkikSg5vogKNhcI5pFiBh54DANBgkq\nhkiG9w0BAQsFAAOCAgEABYSu4Il+fI0MYU42OTmEj+1HqQ5DvyAeyCA6sGuZdwjF\nUGeVOv3NnLyfofuUOjEbY5irFCDtnv+0ckukUZN9lz4Q2YjWGUpW4TTu3ieTsaC9\nAFvCSgNHJyWSVtWvB5XDxsqawl1KzHzzwr132bF2rtGtazSqVqK9E07sGHMCf+zp\nDQVDVVGtqZPHwX3KqUtefE621b8RI6VCl4oD30Olf8pjuzG4JKBFRFclzLRjo/h7\nIkkfjZ8wDa7faOjVXx6n+eUQ29cIMCzr8/rNWHS9pYGGQKJiY2xmVC9h12H99Xyf\nzWE9vb5zKP3MVG6neX1hSdo7PEAb9fqRhHkqVsqUvJlIRmvXvVKTwNCP3eCjRCCI\nPTAvjV+4ni786iXwwFYNz8l3PmPLCyQXWGohnJ8iBm+5nk7O2ynaPVW0U2W+pt2w\nSVuvdDM5zGv2f9ltNWUiYZHJ1mmO97jSY/6YfdOUH66iRtQtDkHBRdkNBsMbD+Em\n2TgBldtHNSJBfB3pm9FblgOcJ0FSWcUDWJ7vO0+NTXlgrRofRT6pVywzxVo6dND0\nWzYlTWeUVsO40xJqhgUQRER9YLOLxJ0O6C8i0xFxAMKOtSdodMB3RIwt7RFQ0uyt\nn5Z5MqkYhlMI3J1tPRTp1nEt9fyGspBOO05gi148Qasp+3N+svqKomoQglNoAxU=\n-----END CERTIFICATE-----"]}} -------------------------------------------------------------------------------- /test/fixtures.http/enableDnssec/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 201 Created 2 | Server: nginx 3 | Date: Fri, 03 Mar 2017 13:49:58 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | X-RateLimit-Limit: 2400 7 | X-RateLimit-Remaining: 2398 8 | X-RateLimit-Reset: 1488552566 9 | ETag: W/"80f207d402f1a1a4845455aa064c3735" 10 | Cache-Control: max-age=0, private, must-revalidate 11 | X-Request-Id: 49ea1585-3871-4829-90f4-ea2aad994256 12 | X-Runtime: 0.700056 13 | X-Content-Type-Options: nosniff 14 | X-Download-Options: noopen 15 | X-Frame-Options: DENY 16 | X-Permitted-Cross-Domain-Policies: none 17 | X-XSS-Protection: 1; mode=block 18 | Strict-Transport-Security: max-age=31536000 19 | 20 | {"data":{"enabled":true,"created_at":"2017-03-03T13:49:58Z","updated_at":"2017-03-03T13:49:58Z"}} 21 | -------------------------------------------------------------------------------- /test/fixtures.http/enableDomainAutoRenewal/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 204 No Content 2 | Server: nginx 3 | Date: Fri, 12 Feb 2016 11:13:38 GMT 4 | Connection: keep-alive 5 | Status: 204 No Content 6 | X-RateLimit-Limit: 4000 7 | X-RateLimit-Remaining: 3997 8 | X-RateLimit-Reset: 1455279163 9 | Cache-Control: no-cache 10 | X-Request-Id: 46e77cb2-157e-4740-8cd3-f20d4d653c95 11 | X-Runtime: 7.702967 12 | Strict-Transport-Security: max-age=31536000 13 | 14 | -------------------------------------------------------------------------------- /test/fixtures.http/enableDomainTransferLock/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 201 Created 2 | Server: nginx 3 | Date: Tue, 15 Aug 2023 09:58:37 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | X-RateLimit-Limit: 2400 7 | X-RateLimit-Remaining: 2398 8 | X-RateLimit-Reset: 1488538623 9 | ETag: W/"fc2368a31a1b6a3afcca33bb37ff6b9d" 10 | Cache-Control: max-age=0, private, must-revalidate 11 | X-Request-Id: 8b0fe49a-c810-4552-84ab-a1cd9b4a7786 12 | X-Runtime: 0.024780 13 | X-Content-Type-Options: nosniff 14 | X-Download-Options: noopen 15 | X-Frame-Options: DENY 16 | X-Permitted-Cross-Domain-Policies: none 17 | X-XSS-Protection: 1; mode=block 18 | Strict-Transport-Security: max-age=31536000 19 | 20 | {"data":{"enabled":true}} 21 | -------------------------------------------------------------------------------- /test/fixtures.http/enableVanityNameServers/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: nginx 3 | Date: Thu, 14 Jul 2016 13:22:17 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | X-RateLimit-Limit: 2400 7 | X-RateLimit-Remaining: 2399 8 | X-RateLimit-Reset: 1468506137 9 | ETag: W/"ddc2c4431fb922cefbf5706b6d32796e" 10 | Cache-Control: max-age=0, private, must-revalidate 11 | X-Request-Id: 3fd2135a-aeb4-4297-8826-a10705740fbb 12 | X-Runtime: 0.438926 13 | X-Content-Type-Options: nosniff 14 | X-Download-Options: noopen 15 | X-Frame-Options: DENY 16 | X-Permitted-Cross-Domain-Policies: none 17 | X-XSS-Protection: 1; mode=block 18 | Strict-Transport-Security: max-age=31536000 19 | 20 | {"data":[{"id":1,"name":"ns1.example.com","ipv4":"127.0.0.1","ipv6":"::1","created_at":"2016-07-14T13:22:17Z","updated_at":"2016-07-14T13:22:17Z"},{"id":2,"name":"ns2.example.com","ipv4":"127.0.0.1","ipv6":"::1","created_at":"2016-07-14T13:22:17Z","updated_at":"2016-07-14T13:22:17Z"},{"id":3,"name":"ns3.example.com","ipv4":"127.0.0.1","ipv6":"::1","created_at":"2016-07-14T13:22:17Z","updated_at":"2016-07-14T13:22:17Z"},{"id":4,"name":"ns4.example.com","ipv4":"127.0.0.1","ipv6":"::1","created_at":"2016-07-14T13:22:17Z","updated_at":"2016-07-14T13:22:17Z"}]} 21 | -------------------------------------------------------------------------------- /test/fixtures.http/enableWhoisPrivacy/created.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 201 Created 2 | Server: nginx 3 | Date: Sat, 13 Feb 2016 14:34:52 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | Status: 201 Created 7 | X-RateLimit-Limit: 4000 8 | X-RateLimit-Remaining: 3997 9 | X-RateLimit-Reset: 1455377135 10 | ETag: W/"c955cdcda56f131395952576e6ded0b6" 11 | Cache-Control: max-age=0, private, must-revalidate 12 | X-Request-Id: 779eff1a-429c-432a-ad17-617502d62e69 13 | X-Runtime: 2.563855 14 | Strict-Transport-Security: max-age=31536000 15 | 16 | {"data":{"id":1,"domain_id":2,"expires_on":null,"enabled":null,"created_at":"2016-02-13T14:34:50Z","updated_at":"2016-02-13T14:34:50Z"}} 17 | -------------------------------------------------------------------------------- /test/fixtures.http/enableWhoisPrivacy/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: nginx 3 | Date: Sat, 13 Feb 2016 14:36:49 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | Status: 200 OK 7 | X-RateLimit-Limit: 4000 8 | X-RateLimit-Remaining: 3994 9 | X-RateLimit-Reset: 1455377135 10 | ETag: W/"1063ebb3e281ca6e1941874002696cd7" 11 | Cache-Control: max-age=0, private, must-revalidate 12 | X-Request-Id: 34453d13-76ba-4f64-ad94-2d536c61826c 13 | X-Runtime: 1.408974 14 | Strict-Transport-Security: max-age=31536000 15 | 16 | {"data":{"id":1,"domain_id":2,"expires_on":"2017-02-13","enabled":true,"created_at":"2016-02-13T14:34:50Z","updated_at":"2016-02-13T14:36:48Z"}} 17 | -------------------------------------------------------------------------------- /test/fixtures.http/getCertificate/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: nginx 3 | Date: Thu, 18 Jun 2020 19:16:29 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | X-RateLimit-Limit: 4800 7 | X-RateLimit-Remaining: 4797 8 | X-RateLimit-Reset: 1592510057 9 | ETag: W/"9ace4f536d7b618fd4b38efd3cea9d1f" 10 | Cache-Control: max-age=0, private, must-revalidate 11 | X-Request-Id: 83905116-1333-4b07-ace4-d0db9e90c4fa 12 | X-Runtime: 0.012798 13 | X-Frame-Options: DENY 14 | X-Content-Type-Options: nosniff 15 | X-XSS-Protection: 1; mode=block 16 | X-Download-Options: noopen 17 | X-Permitted-Cross-Domain-Policies: none 18 | Strict-Transport-Security: max-age=31536000 19 | 20 | {"data":{"id":101967,"domain_id":289333,"contact_id":2511,"name":"www","common_name":"www.bingo.pizza","years":1,"csr":"-----BEGIN CERTIFICATE REQUEST-----\nMIICmTCCAYECAQAwGjEYMBYGA1UEAwwPd3d3LmJpbmdvLnBpenphMIIBIjANBgkq\nhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAw4+KoZ9IDCK2o5qAQpi+Icu5kksmjQzx\n5o5g4B6XhRxhsfHlK/i3iU5hc8CONjyVv8j82835RNsiKrflnxGa9SH68vbQfcn4\nIpbMz9c+Eqv5h0Euqlc3A4DBzp0unEu5QAUhR6Xu1TZIWDPjhrBOGiszRlLQcp4F\nzy6fD6j5/d/ylpzTp5v54j+Ey31Bz86IaBPtSpHI+Qk87Hs8DVoWxZk/6RlAkyur\nXDGWnPu9n3RMfs9ag5anFhggLIhCNtVN4+0vpgPQ59pqwYo8TfdYzK7WSKeL7geu\nCqVE3bHAqU6dLtgHOZfTkLwGycUh4p9aawuc6fsXHHYDpIL8s3vAvwIDAQABoDow\nOAYJKoZIhvcNAQkOMSswKTAnBgNVHREEIDAeggtiaW5nby5waXp6YYIPd3d3LmJp\nbmdvLnBpenphMA0GCSqGSIb3DQEBCwUAA4IBAQBwOLKv+PO5hSJkgqS6wL/wRqLh\nQ1zbcHRHAjRjnpRz06cDvN3X3aPI+lpKSNFCI0A1oKJG7JNtgxX3Est66cuO8ESQ\nPIb6WWN7/xlVlBCe7ZkjAFgN6JurFdclwCp/NI5wBCwj1yb3Ar5QQMFIZOezIgTI\nAWkQSfCmgkB96d6QlDWgidYDDjcsXugQveOQRPlHr0TsElu47GakxZdJCFZU+WPM\nodQQf5SaqiIK2YaH1dWO//4KpTS9QoTy1+mmAa27apHcmz6X6+G5dvpHZ1qH14V0\nJoMWIK+39HRPq6mDo1UMVet/xFUUrG/H7/tFlYIDVbSpVlpVAFITd/eQkaW/\n-----END CERTIFICATE REQUEST-----\n","state":"issued","auto_renew":false,"alternate_names":[],"authority_identifier":"letsencrypt","created_at":"2020-06-18T18:54:17Z","updated_at":"2020-06-18T19:10:14Z","expires_at":"2020-09-16T18:10:13Z","expires_on":"2020-09-16"}} 21 | -------------------------------------------------------------------------------- /test/fixtures.http/getCertificatePrivateKey/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: nginx 3 | Date: Sat, 11 Jun 2016 18:50:50 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | X-RateLimit-Limit: 2400 7 | X-RateLimit-Remaining: 2397 8 | X-RateLimit-Reset: 1465674527 9 | ETag: W/"e7dc6ca9cd96889839628adf0d96c225" 10 | Cache-Control: max-age=0, private, must-revalidate 11 | X-Request-Id: 0fa852bc-5f6d-49b3-af98-313dd2449ef2 12 | X-Runtime: 0.091833 13 | X-Content-Type-Options: nosniff 14 | X-Download-Options: noopen 15 | X-Frame-Options: DENY 16 | X-Permitted-Cross-Domain-Policies: none 17 | X-XSS-Protection: 1; mode=block 18 | Strict-Transport-Security: max-age=31536000 19 | 20 | {"data":{"private_key":"-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAtzCcMfWoQRt5AMEY0HUb2GaraL1GsWOo6YXdPfe+YDvtnmDw\n23NcoTX7VSeCgU9M3RKs19AsCJcRNTLJ2dmDrAuyCTud9YTAaXQcTOLUhtO8T8+9\nAFVIva2OmAlKCR5saBW3JaRxW7V2aHEd/d1ss1CvNOO7jNppc9NwGSnDHcn3rqNv\n/U3MaU0gpJJRqsKkvcLU6IHJGgxyQ6AbpwJDIqBnzkjHu2IuhGEbRuMjyWLA2qts\njyVlfPotDxUdVouUQpz7dGHUFrLR7ma8QAYuOfl1ZMyrc901HGMa7zwbnFWurs3f\ned7vAosTRZIjnn72/3Wo7L9RiMB+vwr3NX7c9QIDAQABAoIBAEQx32OlzK34GTKT\nr7Yicmw7xEGofIGa1Q2h3Lut13whsxKLif5X0rrcyqRnoeibacS+qXXrJolIG4rP\nTl8/3wmUDQHs5J+6fJqFM+fXZUCP4AFiFzzhgsPBsVyd0KbWYYrZ0qU7s0ttoRe+\nTGjuHgIe3ip1QKNtx2Xr50YmytDydknmro79J5Gfrub1l2iA8SDm1eBrQ4SFaNQ2\nU709pHeSwX8pTihUX2Zy0ifpr0O1wYQjGLneMoG4rrNQJG/z6iUdhYczwwt1kDRQ\n4WkM2sovFOyxbBfoCQ3Gy/eem7OXfjNKUe47DAVLnPkKbqL/3Lo9FD7kcB8K87Ap\nr/vYrl0CgYEA413RAk7571w5dM+VftrdbFZ+Yi1OPhUshlPSehavro8kMGDEG5Ts\n74wEz2X3cfMxauMpMrBk/XnUCZ20AnWQClK73RB5fzPw5XNv473Tt/AFmt7eLOzl\nOcYrhpEHegtsD/ZaljlGtPqsjQAL9Ijhao03m1cGB1+uxI7FgacdckcCgYEAzkKP\n6xu9+WqOol73cnlYPS3sSZssyUF+eqWSzq2YJGRmfr1fbdtHqAS1ZbyC5fZVNZYV\nml1vfXi2LDcU0qS04JazurVyQr2rJZMTlCWVET1vhik7Y87wgCkLwKpbwamPDmlI\n9GY+fLNEa4yfAOOpvpTJpenUScxyKWH2cdYFOOMCgYBhrJnvffINC/d64Pp+BpP8\nyKN+lav5K6t3AWd4H2rVeJS5W7ijiLTIq8QdPNayUyE1o+S8695WrhGTF/aO3+ZD\nKQufikZHiQ7B43d7xL7BVBF0WK3lateGnEVyh7dIjMOdj92Wj4B6mv2pjQ2VvX/p\nAEWVLCtg24/+zL64VgxmXQKBgGosyXj1Zu2ldJcQ28AJxup3YVLilkNje4AXC2No\n6RCSvlAvm5gpcNGE2vvr9lX6YBKdl7FGt8WXBe/sysNEFfgmm45ZKOBCUn+dHk78\nqaeeQHKHdxMBy7utZWdgSqt+ZS299NgaacA3Z9kVIiSLDS4V2VeW7riujXXP/9TJ\nnxaRAoGBAMWXOfNVzfTyrKff6gvDWH+hqNICLyzvkEn2utNY9Q6WwqGuY9fvP/4Z\nXzc48AOBzUr8OeA4sHKJ79sJirOiWHNfD1swtvyVzsFZb6moiNwD3Ce/FzYCa3lQ\nU8blTH/uqpR2pSC6whzJ/lnSdqHUqhyp00000000000000000000\n-----END RSA PRIVATE KEY-----\n"}} 21 | -------------------------------------------------------------------------------- /test/fixtures.http/getContact/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: nginx 3 | Date: Tue, 19 Jan 2016 20:57:38 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | Status: 200 OK 7 | X-RateLimit-Limit: 4000 8 | X-RateLimit-Remaining: 3996 9 | X-RateLimit-Reset: 1453239045 10 | ETag: W/"165299b0ea3e5c1c80f1ae622146626f" 11 | Cache-Control: max-age=0, private, must-revalidate 12 | X-Request-Id: 4c0679ed-5c79-41bf-84cb-0dc2250a07ce 13 | X-Runtime: 0.127802 14 | Strict-Transport-Security: max-age=31536000 15 | 16 | {"data":{"id":1,"account_id":1010,"label":"Default","first_name":"First","last_name":"User","job_title":"CEO","organization_name":"Awesome Company","email":"first@example.com","phone":"+18001234567","fax":"+18011234567","address1":"Italian Street, 10","address2":"","city":"Roma","state_province":"RM","postal_code":"00100","country":"IT","created_at":"2016-01-19T20:50:26Z","updated_at":"2016-01-19T20:50:26Z"}} 17 | -------------------------------------------------------------------------------- /test/fixtures.http/getDelegationSignerRecord/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: nginx 3 | Date: Fri, 03 Mar 2017 13:53:06 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | X-RateLimit-Limit: 2400 7 | X-RateLimit-Remaining: 2396 8 | X-RateLimit-Reset: 1488552566 9 | ETag: W/"0aa4c6cec5adfa60dcf78ed2c3c661dd" 10 | Cache-Control: max-age=0, private, must-revalidate 11 | X-Request-Id: ccf90c89-d463-43c6-ac25-3839169e1afd 12 | X-Runtime: 0.024246 13 | X-Content-Type-Options: nosniff 14 | X-Download-Options: noopen 15 | X-Frame-Options: DENY 16 | X-Permitted-Cross-Domain-Policies: none 17 | X-XSS-Protection: 1; mode=block 18 | Strict-Transport-Security: max-age=31536000 19 | 20 | {"data":{"id":24,"domain_id":1010,"algorithm":"8","digest":"C1F6E04A5A61FBF65BF9DC8294C363CF11C89E802D926BDAB79C55D27BEFA94F","digest_type":"2","keytag":"44620","public_key":null,"created_at":"2017-03-03T13:49:58Z","updated_at":"2017-03-03T13:49:58Z"}} 21 | -------------------------------------------------------------------------------- /test/fixtures.http/getDnssec/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: nginx 3 | Date: Fri, 03 Mar 2017 09:58:37 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | X-RateLimit-Limit: 2400 7 | X-RateLimit-Remaining: 2398 8 | X-RateLimit-Reset: 1488538623 9 | ETag: W/"fc2368a31a1b6a3afcca33bb37ff6b9d" 10 | Cache-Control: max-age=0, private, must-revalidate 11 | X-Request-Id: 8b0fe49a-c810-4552-84ab-a1cd9b4a7786 12 | X-Runtime: 0.024780 13 | X-Content-Type-Options: nosniff 14 | X-Download-Options: noopen 15 | X-Frame-Options: DENY 16 | X-Permitted-Cross-Domain-Policies: none 17 | X-XSS-Protection: 1; mode=block 18 | Strict-Transport-Security: max-age=31536000 19 | 20 | {"data":{"enabled":true,"created_at":"2017-02-03T17:43:22Z","updated_at":"2017-02-03T17:43:22Z"}} 21 | -------------------------------------------------------------------------------- /test/fixtures.http/getDomain/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: nginx 3 | Date: Thu, 04 Jun 2020 19:37:22 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | X-RateLimit-Limit: 2400 7 | X-RateLimit-Remaining: 2379 8 | X-RateLimit-Reset: 1591300247 9 | ETag: W/"ff4a8463ecca39d4869695d66de60043" 10 | Cache-Control: max-age=0, private, must-revalidate 11 | X-Request-Id: 2e8259ab-c933-487e-8f85-d23f1cdf62fa 12 | X-Runtime: 0.019482 13 | X-Frame-Options: DENY 14 | X-Content-Type-Options: nosniff 15 | X-XSS-Protection: 1; mode=block 16 | X-Download-Options: noopen 17 | X-Permitted-Cross-Domain-Policies: none 18 | Strict-Transport-Security: max-age=31536000 19 | 20 | {"data":{"id":181984,"account_id":1385,"registrant_id":2715,"name":"example-alpha.com","unicode_name":"example-alpha.com","state":"registered","auto_renew":false,"private_whois":false,"expires_on":"2021-06-05","expires_at":"2021-06-05T02:15:00Z","created_at":"2020-06-04T19:15:14Z","updated_at":"2020-06-04T19:15:21Z"}} 21 | -------------------------------------------------------------------------------- /test/fixtures.http/getDomainDelegation/success-empty.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: nginx 3 | Date: Thu, 24 Mar 2016 11:13:41 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | Status: 200 OK 7 | X-RateLimit-Limit: 2400 8 | X-RateLimit-Remaining: 2393 9 | X-RateLimit-Reset: 1458821048 10 | ETag: W/"e0234245cb00aa260ccfa99a9a0b235e" 11 | Cache-Control: max-age=0, private, must-revalidate 12 | X-Request-Id: c88385f9-c8f7-435a-9060-0b1a27488b2b 13 | X-Runtime: 0.206440 14 | Strict-Transport-Security: max-age=31536000 15 | 16 | {"data":[]} -------------------------------------------------------------------------------- /test/fixtures.http/getDomainDelegation/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: nginx 3 | Date: Thu, 24 Mar 2016 11:17:18 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | Status: 200 OK 7 | X-RateLimit-Limit: 2400 8 | X-RateLimit-Remaining: 2391 9 | X-RateLimit-Reset: 1458821048 10 | ETag: W/"cb540984f806b12ac437cc1f76092f90" 11 | Cache-Control: max-age=0, private, must-revalidate 12 | X-Request-Id: e53ac7b5-0d26-45bc-9226-09c2d34be293 13 | X-Runtime: 0.192986 14 | Strict-Transport-Security: max-age=31536000 15 | 16 | {"data":["ns1.dnsimple.com","ns2.dnsimple.com","ns3.dnsimple.com","ns4.dnsimple.com"]} -------------------------------------------------------------------------------- /test/fixtures.http/getDomainPremiumPrice/failure.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 400 Bad Request 2 | Server: nginx 3 | Date: Tue, 22 Nov 2016 10:48:27 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | Cache-Control: no-cache 7 | X-Request-Id: 1304138f-0fc7-4845-b9ed-e3803409cb5a 8 | X-Runtime: 1.421413 9 | X-Content-Type-Options: nosniff 10 | X-Download-Options: noopen 11 | X-Frame-Options: DENY 12 | X-Permitted-Cross-Domain-Policies: none 13 | X-XSS-Protection: 1; mode=block 14 | 15 | {"message":"`example.com` is not a premium domain for registration"} 16 | -------------------------------------------------------------------------------- /test/fixtures.http/getDomainPremiumPrice/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: nginx 3 | Date: Tue, 22 Nov 2016 10:46:17 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | X-RateLimit-Limit: 2400 7 | X-RateLimit-Remaining: 2399 8 | X-RateLimit-Reset: 1479815177 9 | ETag: W/"7ed6ab997deeafd985a5782df2d86b04" 10 | Cache-Control: max-age=0, private, must-revalidate 11 | X-Request-Id: 54731b91-cd76-4d08-9481-c0f55f47996d 12 | X-Runtime: 1.013083 13 | X-Content-Type-Options: nosniff 14 | X-Download-Options: noopen 15 | X-Frame-Options: DENY 16 | X-Permitted-Cross-Domain-Policies: none 17 | X-XSS-Protection: 1; mode=block 18 | Strict-Transport-Security: max-age=31536000 19 | 20 | {"data":{"premium_price":"109.00","action":"registration"}} 21 | -------------------------------------------------------------------------------- /test/fixtures.http/getDomainPrices/failure.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 400 Bad Request 2 | Server: nginx 3 | Date: Mon, 08 Mar 2021 14:35:58 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | X-RateLimit-Limit: 2400 7 | X-RateLimit-Remaining: 2396 8 | X-RateLimit-Reset: 1615217645 9 | Cache-Control: no-cache 10 | X-Request-Id: e414a674-63bb-4e54-b714-db5b516bb190 11 | X-Runtime: 0.009579 12 | X-Frame-Options: DENY 13 | X-Content-Type-Options: nosniff 14 | X-XSS-Protection: 1; mode=block 15 | X-Download-Options: noopen 16 | X-Permitted-Cross-Domain-Policies: none 17 | Content-Security-Policy: frame-ancestors 'none' 18 | 19 | {"message":"TLD .PINEAPPLE is not supported"} -------------------------------------------------------------------------------- /test/fixtures.http/getDomainPrices/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: nginx 3 | Date: Mon, 08 Mar 2021 14:35:26 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | X-RateLimit-Limit: 2400 7 | X-RateLimit-Remaining: 2397 8 | X-RateLimit-Reset: 1615217645 9 | ETag: W/"2104f27f2877f429295359cfc409f9f7" 10 | Cache-Control: max-age=0, private, must-revalidate 11 | X-Request-Id: b0d9e000-58a6-4254-af43-8735d26e12d9 12 | X-Runtime: 9.129301 13 | X-Frame-Options: DENY 14 | X-Content-Type-Options: nosniff 15 | X-XSS-Protection: 1; mode=block 16 | X-Download-Options: noopen 17 | X-Permitted-Cross-Domain-Policies: none 18 | Content-Security-Policy: frame-ancestors 'none' 19 | Strict-Transport-Security: max-age=31536000 20 | 21 | {"data":{"domain":"bingo.pizza","premium":true,"registration_price":20.0,"renewal_price":20.0,"transfer_price":20.0}} 22 | -------------------------------------------------------------------------------- /test/fixtures.http/getDomainTransfer/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: nginx 3 | Date: Fri, 05 Jun 2020 18:23:53 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | X-RateLimit-Limit: 2400 7 | X-RateLimit-Remaining: 2392 8 | X-RateLimit-Reset: 1591384034 9 | ETag: W/"80c5827934c13b1ca87a587d96e7d1e8" 10 | Cache-Control: max-age=0, private, must-revalidate 11 | X-Request-Id: 9f4959ee-06a9-488c-906e-27a570cafbbf 12 | X-Runtime: 0.078429 13 | X-Frame-Options: DENY 14 | X-Content-Type-Options: nosniff 15 | X-XSS-Protection: 1; mode=block 16 | X-Download-Options: noopen 17 | X-Permitted-Cross-Domain-Policies: none 18 | Strict-Transport-Security: max-age=31536000 19 | 20 | {"data":{"id":361,"domain_id":182245,"registrant_id":2715,"state":"cancelled","auto_renew":false,"whois_privacy":false,"status_description":"Canceled by customer","created_at":"2020-06-05T18:08:00Z","updated_at":"2020-06-05T18:10:01Z"}} 21 | -------------------------------------------------------------------------------- /test/fixtures.http/getDomainTransferLock/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: nginx 3 | Date: Tue, 15 Aug 2023 09:58:37 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | X-RateLimit-Limit: 2400 7 | X-RateLimit-Remaining: 2398 8 | X-RateLimit-Reset: 1488538623 9 | ETag: W/"fc2368a31a1b6a3afcca33bb37ff6b9d" 10 | Cache-Control: max-age=0, private, must-revalidate 11 | X-Request-Id: 8b0fe49a-c810-4552-84ab-a1cd9b4a7786 12 | X-Runtime: 0.024780 13 | X-Content-Type-Options: nosniff 14 | X-Download-Options: noopen 15 | X-Frame-Options: DENY 16 | X-Permitted-Cross-Domain-Policies: none 17 | X-XSS-Protection: 1; mode=block 18 | Strict-Transport-Security: max-age=31536000 19 | 20 | {"data":{"enabled":true}} 21 | -------------------------------------------------------------------------------- /test/fixtures.http/getEmailForward/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: nginx 3 | Date: Mon, 25 Jan 2021 13:56:24 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Transfer-Encoding: identity 6 | Connection: keep-alive 7 | X-RateLimit-Limit: 4800 8 | X-RateLimit-Remaining: 4766 9 | X-RateLimit-Reset: 1611583416 10 | ETag: W/"80ad3ad1e115a8123193447fa003f68a" 11 | Cache-Control: max-age=0, private, must-revalidate 12 | X-Request-Id: 8f3a9517-f623-4d14-be2b-3f332a4d7873 13 | X-Runtime: 0.010653 14 | X-Frame-Options: DENY 15 | X-Content-Type-Options: nosniff 16 | X-XSS-Protection: 1; mode=block 17 | X-Download-Options: noopen 18 | X-Permitted-Cross-Domain-Policies: none 19 | Content-Security-Policy: frame-ancestors 'none' 20 | Strict-Transport-Security: max-age=31536000 21 | 22 | {"data":{"id":41872,"domain_id":235146,"alias_email":"example@dnsimple.xyz","destination_email":"example@example.com","created_at":"2021-01-25T13:54:40Z","updated_at":"2021-01-25T13:54:40Z","from":"example@dnsimple.xyz","to":"example@example.com"}} -------------------------------------------------------------------------------- /test/fixtures.http/getPrimaryServer/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: nginx 3 | Date: Wed, 17 Mar 2021 23:18:40 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | X-RateLimit-Limit: 2400 7 | X-RateLimit-Remaining: 2386 8 | X-RateLimit-Reset: 1616024599 9 | ETag: W/"ceda02163217bdb9e6850e2c36cbf163" 10 | Cache-Control: max-age=0, private, must-revalidate 11 | X-Request-Id: 259fc436-7146-4e6b-98fa-3c43f541482b 12 | X-Runtime: 0.033067 13 | X-Frame-Options: DENY 14 | X-Content-Type-Options: nosniff 15 | X-XSS-Protection: 1; mode=block 16 | X-Download-Options: noopen 17 | X-Permitted-Cross-Domain-Policies: none 18 | Content-Security-Policy: frame-ancestors 'none' 19 | Strict-Transport-Security: max-age=31536000 20 | 21 | {"data":{"id":4,"account_id":531,"name":"PrimaryProduction","ip":"1.2.3.4","port":53,"linked_secondary_zones":[],"created_at":"2021-03-17T23:08:42Z","updated_at":"2021-03-17T23:08:42Z"}} -------------------------------------------------------------------------------- /test/fixtures.http/getRegistrantChange/success.http: -------------------------------------------------------------------------------- 1 | HTTP/2 200 2 | server: nginx 3 | date: Tue, 22 Aug 2023 11:13:58 GMT 4 | content-type: application/json; charset=utf-8 5 | x-ratelimit-limit: 2400 6 | x-ratelimit-remaining: 2392 7 | x-ratelimit-reset: 1692705338 8 | x-work-with-us: Love automation? So do we! https://dnsimple.com/jobs 9 | etag: W/"76c5d4c7579b754b94a42ac7fa37a901" 10 | cache-control: max-age=0, private, must-revalidate 11 | x-request-id: e910cd08-3f9c-4da4-9986-50dbe9c3bc55 12 | x-runtime: 0.022006 13 | strict-transport-security: max-age=63072000 14 | 15 | {"data":{"id":101,"account_id":101,"domain_id":101,"contact_id":101,"state":"new","extended_attributes":{},"registry_owner_change":true,"irt_lock_lifted_by":null,"created_at":"2017-02-03T17:43:22Z","updated_at":"2017-02-03T17:43:22Z"}} -------------------------------------------------------------------------------- /test/fixtures.http/getService/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: nginx 3 | Date: Fri, 15 Apr 2016 14:50:13 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | Status: 200 OK 7 | X-RateLimit-Limit: 2400 8 | X-RateLimit-Remaining: 2394 9 | X-RateLimit-Reset: 1460735221 10 | ETag: W/"be453ad05df875577d40dbfbb479239a" 11 | Cache-Control: max-age=0, private, must-revalidate 12 | X-Request-Id: 741b849f-dba6-4d0b-a68c-f47fe1aa3a54 13 | X-Runtime: 0.140632 14 | Strict-Transport-Security: max-age=31536000 15 | 16 | {"data":{"id":1,"name":"Service 1","sid":"service1","description":"First service example.","setup_description":null,"requires_setup":true,"default_subdomain":null,"created_at":"2014-02-14T19:15:19Z","updated_at":"2016-03-04T09:23:27Z","settings":[{"name":"username","label":"Service 1 Account Username","append":".service1.com","description":"Your Service 1 username is used to connect services to your account.","example":"username","password":false}]}} 17 | -------------------------------------------------------------------------------- /test/fixtures.http/getTemplate/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: nginx 3 | Date: Tue, 22 Mar 2016 11:14:57 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | Status: 200 OK 7 | X-RateLimit-Limit: 2400 8 | X-RateLimit-Remaining: 2394 9 | X-RateLimit-Reset: 1458648490 10 | ETag: W/"6a2c0c6789d853473765a5fc5662da2e" 11 | Cache-Control: max-age=0, private, must-revalidate 12 | X-Request-Id: 3401ffd6-730f-42c0-856c-3b270ca4b35f 13 | X-Runtime: 0.938420 14 | Strict-Transport-Security: max-age=31536000 15 | 16 | {"data":{"id":1,"account_id":1010,"name":"Alpha","sid":"alpha","description":"An alpha template.","created_at":"2016-03-22T11:08:58Z","updated_at":"2016-03-22T11:08:58Z"}} -------------------------------------------------------------------------------- /test/fixtures.http/getTemplateRecord/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: nginx 3 | Date: Tue, 03 May 2016 08:04:20 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | Status: 200 OK 7 | X-RateLimit-Limit: 2400 8 | X-RateLimit-Remaining: 2394 9 | X-RateLimit-Reset: 1462265481 10 | ETag: W/"743142eab9fecf3edb41e9b3f30a903f" 11 | Cache-Control: max-age=0, private, must-revalidate 12 | X-Request-Id: 6484e900-7255-4194-9ff8-ae5650ebd765 13 | X-Runtime: 0.138017 14 | Strict-Transport-Security: max-age=31536000 15 | 16 | {"data":{"id":301,"template_id":268,"name":"","content":"mx.example.com","ttl":600,"priority":10,"type":"MX","created_at":"2016-05-03T08:03:26Z","updated_at":"2016-05-03T08:03:26Z"}} 17 | -------------------------------------------------------------------------------- /test/fixtures.http/getTld/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: nginx 3 | Date: Fri, 23 Sep 2016 09:06:13 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | X-RateLimit-Limit: 2400 7 | X-RateLimit-Remaining: 2396 8 | X-RateLimit-Reset: 1474622397 9 | ETag: W/"8e3d87c11204e76362765aea4c0916e0" 10 | Cache-Control: max-age=0, private, must-revalidate 11 | X-Request-Id: 426d0884-2583-45d8-8ab6-0e36050ba6dc 12 | X-Runtime: 0.011580 13 | X-Content-Type-Options: nosniff 14 | X-Download-Options: noopen 15 | X-Frame-Options: DENY 16 | X-Permitted-Cross-Domain-Policies: none 17 | X-XSS-Protection: 1; mode=block 18 | Strict-Transport-Security: max-age=31536000 19 | 20 | {"data":{"tld":"com","tld_type":1,"whois_privacy":true,"auto_renew_only":false,"idn":true,"minimum_registration":1,"registration_enabled":true,"renewal_enabled":true,"transfer_enabled":true,"dnssec_interface_type":"ds"}} 21 | -------------------------------------------------------------------------------- /test/fixtures.http/getTldExtendedAttributes/success-attributes.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: nginx 3 | Date: Sun, 28 Feb 2016 13:19:01 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | Status: 200 OK 7 | X-RateLimit-Limit: 4000 8 | X-RateLimit-Remaining: 3997 9 | X-RateLimit-Reset: 1456669059 10 | ETag: W/"8fbf2767d4a37fb8a504dff8709c9f2a" 11 | Cache-Control: max-age=0, private, must-revalidate 12 | X-Request-Id: 46f26f07-a46e-40d6-8d74-f41e75069b8a 13 | X-Runtime: 0.527156 14 | Strict-Transport-Security: max-age=31536000 15 | 16 | {"data":[{"name":"uk_legal_type","description":"Legal type of registrant contact","required":false,"options":[{"title":"UK Individual","value":"IND","description":"UK Individual (our default value)"},{"title":"Non-UK Individual (representing self)","value":"FIND","description":"Non-UK Individual (representing self)"},{"title":"UK Limited Company","value":"LTD","description":"UK Limited Company"},{"title":"UK Public Limited Company","value":"PLC","description":"UK Public Limited Company"},{"title":"UK Partnership","value":"PTNR","description":"UK Partnership"},{"title":"UK LLP","value":"LLP","description":"UK Limited Liability Partnership"},{"title":"UK Sole Trader","value":"STRA","description":"UK Sole Trader"},{"title":"UK Registered Charity","value":"RCHAR","description":"UK Registered Charity"},{"title":"UK Industrial/Provident Registered Company","value":"IP","description":"UK Industrial/Provident Registered Company"},{"title":"UK School","value":"SCH","description":"UK School"},{"title":"Other Foreign","value":"FOTHER","description":"Other foreign organizations"},{"title":"UK Government Body","value":"GOV","description":"UK Government Body"},{"title":"UK Corporation by Royal Charter","value":"CRC","description":"UK Corporation by Royal Charter"},{"title":"UK Statutory Body","value":"STAT","description":"UK Statutory Body"},{"title":"UK Entity (other)","value":"OTHER","description":"UK Entity (other)"},{"title":"Non-UK Corporation","value":"FCORP","description":"Non-UK Corporation"},{"title":"Non-UK Organization (other)","value":"FOTHER","description":"Non-UK Organization"}]},{"name":"uk_reg_co_no","description":"Company identification number","required":false,"options":[]},{"name":"registered_for","description":"Company or person domain is registered for (this must be accurate and CANNOT BE CHANGED)","required":true,"options":[]},{"name":"uk_reg_opt_out","description":"Hide registrant data in Nominet WHOIS","required":false,"options":[{"title":"No","value":"n","description":"Do not hide the registrant contact information in Nominet's WHOIS."},{"title":"Yes","value":"y","description":"Hide the registrant contact information in Nominet's WHOIS (only available to individuals)."}]}]} -------------------------------------------------------------------------------- /test/fixtures.http/getTldExtendedAttributes/success-noattributes.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: nginx 3 | Date: Sun, 28 Feb 2016 13:19:18 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | Status: 200 OK 7 | X-RateLimit-Limit: 4000 8 | X-RateLimit-Remaining: 3996 9 | X-RateLimit-Reset: 1456669058 10 | ETag: W/"e0234245cb00aa260ccfa99a9a0b235e" 11 | Cache-Control: max-age=0, private, must-revalidate 12 | X-Request-Id: 414e9bf2-4681-4769-a3e0-ed9b8905edcc 13 | X-Runtime: 0.459391 14 | Strict-Transport-Security: max-age=31536000 15 | 16 | {"data":[]} -------------------------------------------------------------------------------- /test/fixtures.http/getTldExtendedAttributes/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: nginx 3 | Date: Sun, 28 Feb 2016 13:19:01 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | Status: 200 OK 7 | X-RateLimit-Limit: 4000 8 | X-RateLimit-Remaining: 3997 9 | X-RateLimit-Reset: 1456669059 10 | ETag: W/"8fbf2767d4a37fb8a504dff8709c9f2a" 11 | Cache-Control: max-age=0, private, must-revalidate 12 | X-Request-Id: 46f26f07-a46e-40d6-8d74-f41e75069b8a 13 | X-Runtime: 0.527156 14 | Strict-Transport-Security: max-age=31536000 15 | 16 | {"data":[{"name":"uk_legal_type","description":"Legal type of registrant contact","required":false,"options":[{"title":"UK Individual","value":"IND","description":"UK Individual (our default value)"},{"title":"Non-UK Individual (representing self)","value":"FIND","description":"Non-UK Individual (representing self)"},{"title":"UK Limited Company","value":"LTD","description":"UK Limited Company"},{"title":"UK Public Limited Company","value":"PLC","description":"UK Public Limited Company"},{"title":"UK Partnership","value":"PTNR","description":"UK Partnership"},{"title":"UK LLP","value":"LLP","description":"UK Limited Liability Partnership"},{"title":"UK Sole Trader","value":"STRA","description":"UK Sole Trader"},{"title":"UK Registered Charity","value":"RCHAR","description":"UK Registered Charity"},{"title":"UK Industrial/Provident Registered Company","value":"IP","description":"UK Industrial/Provident Registered Company"},{"title":"UK School","value":"SCH","description":"UK School"},{"title":"Other Foreign","value":"FOTHER","description":"Other foreign organizations"},{"title":"UK Government Body","value":"GOV","description":"UK Government Body"},{"title":"UK Corporation by Royal Charter","value":"CRC","description":"UK Corporation by Royal Charter"},{"title":"UK Statutory Body","value":"STAT","description":"UK Statutory Body"},{"title":"UK Entity (other)","value":"OTHER","description":"UK Entity (other)"},{"title":"Non-UK Corporation","value":"FCORP","description":"Non-UK Corporation"},{"title":"Non-UK Organization (other)","value":"FOTHER","description":"Non-UK Organization"}]},{"name":"uk_reg_co_no","description":"Company identification number","required":false,"options":[]},{"name":"registered_for","description":"Company or person domain is registered for (this must be accurate and CANNOT BE CHANGED)","required":true,"options":[]},{"name":"uk_reg_opt_out","description":"Hide registrant data in Nominet WHOIS","required":false,"options":[{"title":"No","value":"n","description":"Do not hide the registrant contact information in Nominet's WHOIS."},{"title":"Yes","value":"y","description":"Hide the registrant contact information in Nominet's WHOIS (only available to individuals)."}]}]} -------------------------------------------------------------------------------- /test/fixtures.http/getWebhook/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: nginx 3 | Date: Mon, 15 Feb 2016 17:06:09 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | Status: 200 OK 7 | X-RateLimit-Limit: 4000 8 | X-RateLimit-Remaining: 3992 9 | X-RateLimit-Reset: 1455559348 10 | ETag: W/"cbb707ff6fc185d71f5a8df3110f1379" 11 | Cache-Control: max-age=0, private, must-revalidate 12 | X-Request-Id: 0109ea48-b7f0-4f78-a970-6866653b83eb 13 | X-Runtime: 0.087618 14 | Strict-Transport-Security: max-age=31536000 15 | 16 | {"data":{"id":1,"url":"https://webhook.test"}} 17 | -------------------------------------------------------------------------------- /test/fixtures.http/getWhoisPrivacy/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: nginx 3 | Date: Sat, 13 Feb 2016 14:35:37 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | Status: 200 OK 7 | X-RateLimit-Limit: 4000 8 | X-RateLimit-Remaining: 3996 9 | X-RateLimit-Reset: 1455377135 10 | ETag: W/"10be37d45cd224b2178b8a2f86c466ea" 11 | Cache-Control: max-age=0, private, must-revalidate 12 | X-Request-Id: 78afe010-0f54-4d39-9ed3-08c67d545a35 13 | X-Runtime: 0.031770 14 | Strict-Transport-Security: max-age=31536000 15 | 16 | {"data":{"id":1,"domain_id":2,"expires_on":"2017-02-13","enabled":true,"created_at":"2016-02-13T14:34:50Z","updated_at":"2016-02-13T14:34:52Z"}} 17 | -------------------------------------------------------------------------------- /test/fixtures.http/getZone/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: nginx 3 | Date: Fri, 22 Jan 2016 16:54:14 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | Status: 200 OK 7 | X-RateLimit-Limit: 4000 8 | X-RateLimit-Remaining: 3995 9 | X-RateLimit-Reset: 1453484046 10 | ETag: W/"2161245abd349a34cba32a970e6424ba" 11 | Cache-Control: max-age=0, private, must-revalidate 12 | X-Request-Id: 93182033-a215-484e-a107-5235fa48001c 13 | X-Runtime: 0.177942 14 | Strict-Transport-Security: max-age=31536000 15 | 16 | {"data":{"id":1,"account_id":1010,"name":"example-alpha.com","reverse":false,"secondary":false,"last_transferred_at":null,"active":true,"created_at":"2015-04-23T07:40:03Z","updated_at":"2015-04-23T07:40:03Z"}} 17 | -------------------------------------------------------------------------------- /test/fixtures.http/getZoneFile/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: nginx 3 | Date: Wed, 20 Jul 2016 09:04:24 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | X-RateLimit-Limit: 2400 7 | X-RateLimit-Remaining: 2398 8 | X-RateLimit-Reset: 1469008918 9 | ETag: W/"85eb7f1ef577371eadf7d5b05203a60e" 10 | Cache-Control: max-age=0, private, must-revalidate 11 | X-Request-Id: eb3c7bc0-882d-4bb4-873d-aa4d4a3ddc81 12 | X-Runtime: 0.021226 13 | X-Content-Type-Options: nosniff 14 | X-Download-Options: noopen 15 | X-Frame-Options: DENY 16 | X-Permitted-Cross-Domain-Policies: none 17 | X-XSS-Protection: 1; mode=block 18 | Strict-Transport-Security: max-age=31536000 19 | 20 | {"data":{"zone":"$ORIGIN example.com.\n$TTL 1h\nexample.com. 3600 IN SOA ns1.dnsimple.com. admin.dnsimple.com. 1453132552 86400 7200 604800 300\nexample.com. 3600 IN NS ns1.dnsimple.com.\nexample.com. 3600 IN NS ns2.dnsimple.com.\nexample.com. 3600 IN NS ns3.dnsimple.com.\nexample.com. 3600 IN NS ns4.dnsimple.com.\n"}} 21 | -------------------------------------------------------------------------------- /test/fixtures.http/getZoneRecord/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: nginx 3 | Date: Wed, 05 Oct 2016 09:53:54 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | X-RateLimit-Limit: 2400 7 | X-RateLimit-Remaining: 2394 8 | X-RateLimit-Reset: 1475662530 9 | ETag: W/"d4d22097268cd23fab63ef3e9982b5c1" 10 | Cache-Control: max-age=0, private, must-revalidate 11 | X-Request-Id: 8a07b24d-6f59-4012-9f53-6cae893f0372 12 | X-Runtime: 0.051822 13 | X-Content-Type-Options: nosniff 14 | X-Download-Options: noopen 15 | X-Frame-Options: DENY 16 | X-Permitted-Cross-Domain-Policies: none 17 | X-XSS-Protection: 1; mode=block 18 | Strict-Transport-Security: max-age=31536000 19 | 20 | {"data":{"id":5,"zone_id":"example.com","parent_id":null,"name":"","content":"mxa.example.com","ttl":600,"priority":10,"type":"MX","regions":["SV1", "IAD"],"system_record":false,"created_at":"2016-10-05T09:51:35Z","updated_at":"2016-10-05T09:51:35Z"}} 21 | -------------------------------------------------------------------------------- /test/fixtures.http/initiatePush/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 201 Created 2 | Server: nginx 3 | Date: Thu, 11 Aug 2016 10:16:03 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | X-RateLimit-Limit: 2400 7 | X-RateLimit-Remaining: 2395 8 | X-RateLimit-Reset: 1470913058 9 | ETag: W/"fbbdec6f757e014f6f0b2159090aed80" 10 | Cache-Control: max-age=0, private, must-revalidate 11 | X-Request-Id: 3c3f4bee-3e06-4998-8946-02d4fae26fa4 12 | X-Runtime: 0.601397 13 | X-Content-Type-Options: nosniff 14 | X-Download-Options: noopen 15 | X-Frame-Options: DENY 16 | X-Permitted-Cross-Domain-Policies: none 17 | X-XSS-Protection: 1; mode=block 18 | Strict-Transport-Security: max-age=31536000 19 | 20 | {"data":{"id":1,"domain_id":100,"contact_id":null,"account_id":2020,"created_at":"2016-08-11T10:16:03Z","updated_at":"2016-08-11T10:16:03Z","accepted_at":null}} 21 | -------------------------------------------------------------------------------- /test/fixtures.http/issueLetsencryptCertificate/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 202 Accepted 2 | Server: nginx 3 | Date: Thu, 18 Jun 2020 18:56:21 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | X-RateLimit-Limit: 4800 7 | X-RateLimit-Remaining: 4798 8 | X-RateLimit-Reset: 1592510057 9 | Cache-Control: no-cache 10 | X-Request-Id: 1d6bdd7c-a88e-4ac2-9d12-36699a32b006 11 | X-Runtime: 0.884870 12 | X-Frame-Options: DENY 13 | X-Content-Type-Options: nosniff 14 | X-XSS-Protection: 1; mode=block 15 | X-Download-Options: noopen 16 | X-Permitted-Cross-Domain-Policies: none 17 | 18 | {"data":{"id":101967,"domain_id":289333,"contact_id":2511,"name":"www","common_name":"www.bingo.pizza","years":1,"csr":null,"state":"requesting","auto_renew":false,"alternate_names":[],"authority_identifier":"letsencrypt","created_at":"2020-06-18T18:54:17Z","updated_at":"2020-06-18T18:56:20Z","expires_at":null,"expires_on":null}} 19 | -------------------------------------------------------------------------------- /test/fixtures.http/issueRenewalLetsencryptCertificate/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 202 Accepted 2 | Server: nginx 3 | Date: Thu, 18 Jun 2020 20:05:26 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | X-RateLimit-Limit: 4800 7 | X-RateLimit-Remaining: 4798 8 | X-RateLimit-Reset: 1592513780 9 | Cache-Control: no-cache 10 | X-Request-Id: a7194bb4-aea4-42c6-846f-cd96f5f3cf5c 11 | X-Runtime: 0.897152 12 | X-Frame-Options: DENY 13 | X-Content-Type-Options: nosniff 14 | X-XSS-Protection: 1; mode=block 15 | X-Download-Options: noopen 16 | X-Permitted-Cross-Domain-Policies: none 17 | 18 | {"data":{"id":101972,"domain_id":289333,"contact_id":2511,"name":"www","common_name":"www.bingo.pizza","years":1,"csr":null,"state":"requesting","auto_renew":false,"alternate_names":[],"authority_identifier":"letsencrypt","created_at":"2020-06-18T19:56:20Z","updated_at":"2020-06-18T20:05:26Z","expires_at":null,"expires_on":null}} 19 | -------------------------------------------------------------------------------- /test/fixtures.http/linkPrimaryServer/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: nginx 3 | Date: Wed, 17 Mar 2021 23:29:51 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | X-RateLimit-Limit: 2400 7 | X-RateLimit-Remaining: 2384 8 | X-RateLimit-Reset: 1616024598 9 | ETag: W/"911f7a8bf729e066d3d0aedce7eaab4e" 10 | Cache-Control: max-age=0, private, must-revalidate 11 | X-Request-Id: 104a8bbe-a4a7-41b1-9d51-499596f5b228 12 | X-Runtime: 0.249251 13 | X-Frame-Options: DENY 14 | X-Content-Type-Options: nosniff 15 | X-XSS-Protection: 1; mode=block 16 | X-Download-Options: noopen 17 | X-Permitted-Cross-Domain-Policies: none 18 | Content-Security-Policy: frame-ancestors 'none' 19 | Strict-Transport-Security: max-age=31536000 20 | 21 | {"data":{"id":4,"account_id":531,"name":"PrimaryProduction","ip":"1.2.3.4","port":53,"linked_secondary_zones":["secondaryzone.com"],"created_at":"2021-03-17T23:08:42Z","updated_at":"2021-03-17T23:08:42Z"}} -------------------------------------------------------------------------------- /test/fixtures.http/listAccounts/success-account.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: nginx 3 | Date: Tue, 14 Jun 2016 12:02:58 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | X-RateLimit-Limit: 2400 7 | X-RateLimit-Remaining: 2391 8 | X-RateLimit-Reset: 1465908577 9 | ETag: W/"9ef3b4bf1f441a9b1cd6d7041bc181aa" 10 | Cache-Control: max-age=0, private, must-revalidate 11 | X-Request-Id: f705b65b-3589-43ad-97ca-3b2821d49d81 12 | X-Runtime: 0.012661 13 | X-Content-Type-Options: nosniff 14 | X-Download-Options: noopen 15 | X-Frame-Options: DENY 16 | X-Permitted-Cross-Domain-Policies: none 17 | X-XSS-Protection: 1; mode=block 18 | Strict-Transport-Security: max-age=31536000 19 | 20 | {"data":[{"id":123,"email":"john@example.com","plan_identifier":"dnsimple-personal","created_at":"2011-09-11T17:15:58Z","updated_at":"2016-06-03T15:02:26Z"}]} 21 | -------------------------------------------------------------------------------- /test/fixtures.http/listAccounts/success-user.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: nginx 3 | Date: Tue, 14 Jun 2016 12:05:38 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | X-RateLimit-Limit: 2400 7 | X-RateLimit-Remaining: 2390 8 | X-RateLimit-Reset: 1465908577 9 | ETag: W/"b8dc5b6e94652da599d15d4668b723b5" 10 | Cache-Control: max-age=0, private, must-revalidate 11 | X-Request-Id: 745455ba-3871-440d-b703-1448b9708c14 12 | X-Runtime: 0.014727 13 | X-Content-Type-Options: nosniff 14 | X-Download-Options: noopen 15 | X-Frame-Options: DENY 16 | X-Permitted-Cross-Domain-Policies: none 17 | X-XSS-Protection: 1; mode=block 18 | Strict-Transport-Security: max-age=31536000 19 | 20 | {"data":[{"id":123,"email":"john@example.com","plan_identifier":"dnsimple-personal","created_at":"2011-09-11T17:15:58Z","updated_at":"2016-06-03T15:02:26Z"},{"id":456,"email":"ops@company.com","plan_identifier":"dnsimple-professional","created_at":"2012-03-16T16:02:54Z","updated_at":"2016-06-14T11:23:16Z"}]} 21 | -------------------------------------------------------------------------------- /test/fixtures.http/listCertificates/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: nginx 3 | Date: Thu, 18 Jun 2020 20:35:23 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | X-RateLimit-Limit: 4800 7 | X-RateLimit-Remaining: 4797 8 | X-RateLimit-Reset: 1592513780 9 | ETag: W/"29d46b533190f5693be4f1133adf99c0" 10 | Cache-Control: max-age=0, private, must-revalidate 11 | X-Request-Id: 6f25214b-8e5a-4095-8e44-d7998b05aa8d 12 | X-Runtime: 0.026239 13 | X-Frame-Options: DENY 14 | X-Content-Type-Options: nosniff 15 | X-XSS-Protection: 1; mode=block 16 | X-Download-Options: noopen 17 | X-Permitted-Cross-Domain-Policies: none 18 | Strict-Transport-Security: max-age=31536000 19 | 20 | {"data":[{"id":101973,"domain_id":14279,"contact_id":11435,"name":"www2","common_name":"www2.dnsimple.us","years":1,"csr":"-----BEGIN CERTIFICATE REQUEST-----\nMIICYDCCAUgCAQAwGzEZMBcGA1UEAwwQd3d3Mi5kbnNpbXBsZS51czCCASIwDQYJ\nKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMjXrephLTu7OKVQ6F3LhmLkL6NL3ier\n1qaWPtJBbkBuzJIn8gmSG+6xGmywB6GKvP2IVkPQhPBpfc8wsTd26rbSBHnRIQal\ntk+W4aQZyIeXFARY+cRvpjeAtmpX0vwZkDMoEyhFomBfGxVfx6tSqdGlR88/x0By\ny5u7+xwkY+4jMt+wZi+wpXsScumB6DAC1PTYRvNFQy7Gcjqrc3EdzPsn3c9kLCNO\n3GCPJoWmT5Rtyd7FxjJiSIf7BDOi12BnblpSLwGvtu6Wrl+u9LJLj8zeCACwUiQG\nuvnP2lAl2YacNAgpql6C2eEnFjIub7Ul1QMUImQSDVy5dMd/UGQrOb0CAwEAAaAA\nMA0GCSqGSIb3DQEBCwUAA4IBAQA8oVxOrZCGeSFmKpNV4oilzPOepTVSWxXa19T7\nzD/azh6j6RBLZPpG4TFbpvjecum+1V7Y8ypIcwhRtlh5/zSbfJkjJsdCdZU9XZat\nT5YkOaxuCUCDajpRiyyKhHvrloTPKPXe5ygCq/Q23xm//VrXKArLSWVB9qWS6gDV\nk0y3/mIlTQ3mTgfYQySc3MPXvIgUoqmB8Ajfq1n3hSLgb1/OoKNfeVEWsON116cq\nbXvl63+XzPubj6KWZXZH/jhrs53fuLq3xyeeuOaPrn+2VceBVt4DCC9n0JS5wepl\nHDoVxtWTTNeJdP5xFB5V1KI+D4FEFBUGnQABEvajpU3vljh3\n-----END CERTIFICATE REQUEST-----\n","state":"issued","auto_renew":false,"alternate_names":[],"authority_identifier":"letsencrypt","created_at":"2020-06-18T20:15:09Z","updated_at":"2020-06-18T20:30:08Z","expires_at":"2020-09-16T19:30:07Z","expires_on":"2020-09-16"},{"id":101969,"domain_id":14279,"contact_id":11435,"name":"www","common_name":"www.dnsimple.us","years":1,"csr":"-----BEGIN CERTIFICATE REQUEST-----\nMIICmTCCAYECAQAwGjEYMBYGA1UEAwwPd3d3LmRuc2ltcGxlLnVzMIIBIjANBgkq\nhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4rVs1z42xmPj6KdE++D182/wyMH1GG4p\nESK99FQbMimjOvYcidFTySKpSvEv5Dhmj5fb79vogBuCZQetm5Es37Gboc+D02SO\n48uE8LisuYhx1yBKryXSYnVaWz9oxEuVLtf+aq/Yt1HTu3/zzMWKPRN79OmYgWnl\n03ISfDmgzxqViYPIAObge8nB5TzlQbDV9W9eQWs12IYg4pfI+b+c9VrnMYjdz2Lk\nEhIYThIQRSi5IfNbDu8YiG87V0bTtzeT6lq2Lh3+IkyhBkF10xaivnwac1MfK/25\ntZg2PYCzG56Bf3xTtjo5P0Eb7LlBZLlwLs3hXvlU0eV2LAWm38v3wwIDAQABoDow\nOAYJKoZIhvcNAQkOMSswKTAnBgNVHREEIDAeggtkbnNpbXBsZS51c4IPd3d3LmRu\nc2ltcGxlLnVzMA0GCSqGSIb3DQEBCwUAA4IBAQBiYQ5/Dp2JML1UgYmUNqfOfKKV\nZS9HiX1OcR6bkHHIEzDV1iqDdZ/0Uqr7p6rmLkVIaDWUdano2jtMEIRGC1c8q9bH\nRlzubdyYXbBGE+iGho5crzu5Hwit3Z3J2C6f28NvfqN5Ume3jLr90qbG+1HULsUF\nR3tCKTzvvs4QAKXbo+eEafDNFToGzd0cxpesdlzu3zDu5rHfLz862QifmWZzN6JS\nj1/Q+TedS5EknTaOwGjm1od0zuD3YRJ+XzGq1G8MbuxYWXqaGQRo0TzZlYW6Ax1C\n9utnEQ5Uc+z9ejjZSv03p1VzO7bV7AOz3F40M3IfM8qQ4YMeXbGWJ98jrWDe\n-----END CERTIFICATE REQUEST-----\n","state":"issued","auto_renew":false,"alternate_names":[],"authority_identifier":"letsencrypt","created_at":"2020-06-18T19:22:51Z","updated_at":"2020-06-18T19:40:13Z","expires_at":"2020-09-16T18:40:12Z","expires_on":"2020-09-16"}],"pagination":{"current_page":1,"per_page":30,"total_entries":2,"total_pages":1}} 21 | -------------------------------------------------------------------------------- /test/fixtures.http/listCharges/fail-400-bad-filter.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 400 Bad Request 2 | Date: Tue, 24 Oct 2023 08:13:01 GMT 3 | Connection: close 4 | X-RateLimit-Limit: 2400 5 | X-RateLimit-Remaining: 2392 6 | X-RateLimit-Reset: 1698136677 7 | Content-Type: application/json; charset=utf-8 8 | X-WORK-WITH-US: Love automation? So do we! https://dnsimple.com/jobs 9 | Cache-Control: no-cache 10 | X-Request-Id: bdfbf3a7-d9dc-4018-9732-61502be989a3 11 | X-Runtime: 0.455303 12 | Transfer-Encoding: chunked 13 | 14 | {"message":"Invalid date format must be ISO8601 (YYYY-MM-DD)"} 15 | -------------------------------------------------------------------------------- /test/fixtures.http/listCharges/fail-403.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 403 Forbidden 2 | Date: Tue, 24 Oct 2023 09:49:29 GMT 3 | Connection: close 4 | X-RateLimit-Limit: 2400 5 | X-RateLimit-Remaining: 2398 6 | X-RateLimit-Reset: 1698143967 7 | Content-Type: application/json; charset=utf-8 8 | X-WORK-WITH-US: Love automation? So do we! https://dnsimple.com/jobs 9 | Cache-Control: no-cache 10 | X-Request-Id: 5554e2d3-2652-4ca7-8c5e-92b4c35f28d6 11 | X-Runtime: 0.035309 12 | Transfer-Encoding: chunked 13 | 14 | {"message":"Permission Denied. Required Scope: billing:*:read"} 15 | -------------------------------------------------------------------------------- /test/fixtures.http/listCharges/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Date: Tue, 24 Oct 2023 09:52:55 GMT 3 | Connection: close 4 | X-RateLimit-Limit: 2400 5 | X-RateLimit-Remaining: 2397 6 | X-RateLimit-Reset: 1698143967 7 | Content-Type: application/json; charset=utf-8 8 | X-WORK-WITH-US: Love automation? So do we! https://dnsimple.com/jobs 9 | Cache-Control: no-store, must-revalidate, private, max-age=0 10 | X-Request-Id: a57a87c8-626a-4361-9fb8-b55ca9be8e5d 11 | X-Runtime: 0.060526 12 | Transfer-Encoding: chunked 13 | 14 | {"data":[{"invoiced_at":"2023-08-17T05:53:36Z","total_amount":"14.50","balance_amount":"0.00","reference":"1-2","state":"collected","items":[{"description":"Register bubble-registered.com","amount":"14.50","product_id":1,"product_type":"domain-registration","product_reference":"bubble-registered.com"}]},{"invoiced_at":"2023-08-17T05:57:53Z","total_amount":"14.50","balance_amount":"0.00","reference":"2-2","state":"refunded","items":[{"description":"Register example.com","amount":"14.50","product_id":2,"product_type":"domain-registration","product_reference":"example.com"}]},{"invoiced_at":"2023-10-24T07:49:05Z","total_amount":"1099999.99","balance_amount":"0.00","reference":"4-2","state":"collected","items":[{"description":"Test Line Item 1","amount":"99999.99","product_id":null,"product_type":"manual","product_reference":null},{"description":"Test Line Item 2","amount":"1000000.00","product_id":null,"product_type":"manual","product_reference":null}]}],"pagination":{"current_page":1,"per_page":30,"total_entries":3,"total_pages":1}} 15 | -------------------------------------------------------------------------------- /test/fixtures.http/listCollaborators/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: nginx 3 | Date: Fri, 07 Oct 2016 08:58:05 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | X-RateLimit-Limit: 2400 7 | X-RateLimit-Remaining: 2396 8 | X-RateLimit-Reset: 1475833772 9 | ETag: W/"6e597053b3cfbbfec6801fcdc2e98466" 10 | Cache-Control: max-age=0, private, must-revalidate 11 | X-Request-Id: ccbbef00-d0a7-442f-9f40-80df8cea868d 12 | X-Runtime: 0.063426 13 | X-Content-Type-Options: nosniff 14 | X-Download-Options: noopen 15 | X-Frame-Options: DENY 16 | X-Permitted-Cross-Domain-Policies: none 17 | X-XSS-Protection: 1; mode=block 18 | Strict-Transport-Security: max-age=31536000 19 | 20 | {"data":[{"id":100,"domain_id":1,"domain_name":"example.com","user_id":999,"user_email":"existing-user@example.com","invitation":false,"created_at":"2016-10-07T08:53:41Z","updated_at":"2016-10-07T08:53:41Z","accepted_at":"2016-10-07T08:53:41Z"},{"id":101,"domain_id":1,"domain_name":"example.com","user_id":null,"user_email":"invited-user@example.com","invitation":true,"created_at":"2016-10-07T08:51:12Z","updated_at":"2016-10-07T08:51:12Z","accepted_at":null}],"pagination":{"current_page":1,"per_page":30,"total_entries":2,"total_pages":1}} 21 | -------------------------------------------------------------------------------- /test/fixtures.http/listContacts/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: nginx 3 | Date: Tue, 19 Jan 2016 18:35:01 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | Status: 200 OK 7 | X-RateLimit-Limit: 4000 8 | X-RateLimit-Remaining: 3998 9 | X-RateLimit-Reset: 1453232080 10 | ETag: W/"42b9dd8efe7dec210d55855cdf2debae" 11 | Cache-Control: max-age=0, private, must-revalidate 12 | X-Request-Id: 7871da61-ecf1-4771-8560-efbcf7f4b961 13 | X-Runtime: 0.067822 14 | Strict-Transport-Security: max-age=31536000 15 | 16 | {"data":[{"id":1,"account_id":1010,"label":"Default","first_name":"First","last_name":"User","job_title":"CEO","organization_name":"Awesome Company","email":"first@example.com","phone":"+18001234567","fax":"+18011234567","address1":"Italian Street, 10","address2":"","city":"Roma","state_province":"RM","postal_code":"00100","country":"IT","created_at":"2013-11-08T17:23:15Z","updated_at":"2015-01-08T21:30:50Z"},{"id":2,"account_id":1010,"label":"","first_name":"Second","last_name":"User","job_title":"","organization_name":"","email":"second@example.com","phone":"+18881234567","fax":"","address1":"French Street","address2":"c/o Someone","city":"Paris","state_province":"XY","postal_code":"00200","country":"FR","created_at":"2014-12-06T15:46:18Z","updated_at":"2014-12-06T15:46:18Z"}],"pagination":{"current_page":1,"per_page":30,"total_entries":2,"total_pages":1}} 17 | -------------------------------------------------------------------------------- /test/fixtures.http/listDelegationSignerRecords/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: nginx 3 | Date: Fri, 03 Mar 2017 13:50:42 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | X-RateLimit-Limit: 2400 7 | X-RateLimit-Remaining: 2397 8 | X-RateLimit-Reset: 1488552565 9 | ETag: W/"33c8bbfc699dba2c259b8ec2596ae40d" 10 | Cache-Control: max-age=0, private, must-revalidate 11 | X-Request-Id: ef8f1fe9-d342-41c4-a7bc-402434c53458 12 | X-Runtime: 0.019866 13 | X-Content-Type-Options: nosniff 14 | X-Download-Options: noopen 15 | X-Frame-Options: DENY 16 | X-Permitted-Cross-Domain-Policies: none 17 | X-XSS-Protection: 1; mode=block 18 | Strict-Transport-Security: max-age=31536000 19 | 20 | {"data":[{"id":24,"domain_id":1010,"algorithm":"8","digest":"C1F6E04A5A61FBF65BF9DC8294C363CF11C89E802D926BDAB79C55D27BEFA94F","digest_type":"2","keytag":"44620","public_key":null,"created_at":"2017-03-03T13:49:58Z","updated_at":"2017-03-03T13:49:58Z"}],"pagination":{"current_page":1,"per_page":30,"total_entries":1,"total_pages":1}} 21 | -------------------------------------------------------------------------------- /test/fixtures.http/listDomains/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: nginx 3 | Date: Thu, 04 Jun 2020 19:54:16 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | X-RateLimit-Limit: 2400 7 | X-RateLimit-Remaining: 2399 8 | X-RateLimit-Reset: 1591304056 9 | ETag: W/"732eac2d85c19810f4e84dbc0eaafb9d" 10 | Cache-Control: max-age=0, private, must-revalidate 11 | X-Request-Id: 458d7b96-bb1a-469a-817e-4fd65c0f1db3 12 | X-Runtime: 0.125593 13 | X-Frame-Options: DENY 14 | X-Content-Type-Options: nosniff 15 | X-XSS-Protection: 1; mode=block 16 | X-Download-Options: noopen 17 | X-Permitted-Cross-Domain-Policies: none 18 | Strict-Transport-Security: max-age=31536000 19 | 20 | {"data":[{"id":181984,"account_id":1385,"registrant_id":2715,"name":"example-alpha.com","unicode_name":"example-alpha.com","state":"registered","auto_renew":false,"private_whois":false,"expires_on":"2021-06-05","expires_at":"2021-06-05T02:15:00Z","created_at":"2020-06-04T19:15:14Z","updated_at":"2020-06-04T19:15:21Z"},{"id":181985,"account_id":1385,"registrant_id":null,"name":"example-beta.com","unicode_name":"example-beta.com","state":"hosted","auto_renew":false,"private_whois":false,"expires_on":null,"expires_at":null,"created_at":"2020-06-04T19:47:05Z","updated_at":"2020-06-04T19:47:05Z"}],"pagination":{"current_page":1,"per_page":30,"total_entries":2,"total_pages":1}} 21 | -------------------------------------------------------------------------------- /test/fixtures.http/listEmailForwards/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: nginx 3 | Date: Fri, 17 May 2024 09:07:28 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | X-RateLimit-Limit: 4800 7 | X-RateLimit-Remaining: 4748 8 | X-RateLimit-Reset: 1715936948 9 | X-WORK-WITH-US: Love automation? So do we! https://dnsimple.com/jobs 10 | ETag: W/"a5eed9a071f03e10fc67001ccc647a94" 11 | Cache-Control: max-age=0, private, must-revalidate 12 | X-Request-Id: e42df983-a8a5-4123-8c74-fb89ab934aba 13 | X-Runtime: 0.025456 14 | Strict-Transport-Security: max-age=63072000 15 | 16 | {"data":[{"id":24809,"domain_id":235146,"alias_email":".*@a-domain.com","destination_email":"jane.smith@example.com","created_at":"2017-05-25T19:23:16Z","updated_at":"2017-05-25T19:23:16Z","from":".*@a-domain.com","to":"jane.smith@example.com"}],"pagination":{"current_page":1,"per_page":30,"total_entries":1,"total_pages":1}} 17 | 18 | -------------------------------------------------------------------------------- /test/fixtures.http/listPrimaryServers/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: nginx 3 | Date: Wed, 17 Mar 2021 22:45:37 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | X-RateLimit-Limit: 2400 7 | X-RateLimit-Remaining: 2394 8 | X-RateLimit-Reset: 1616024598 9 | ETag: W/"1a8276fb3483d6954afe139480753c5b" 10 | Cache-Control: max-age=0, private, must-revalidate 11 | X-Request-Id: 411f7b7c-3ebb-4b6a-a986-5ffd8dcd4144 12 | X-Runtime: 0.159587 13 | X-Frame-Options: DENY 14 | X-Content-Type-Options: nosniff 15 | X-XSS-Protection: 1; mode=block 16 | X-Download-Options: noopen 17 | X-Permitted-Cross-Domain-Policies: none 18 | Content-Security-Policy: frame-ancestors 'none' 19 | Strict-Transport-Security: max-age=31536000 20 | 21 | {"data":[{"id":1,"account_id":531,"name":"Primary","ip":"1.1.1.1","port":4567,"linked_secondary_zones":[],"created_at":"2021-03-05T18:02:23Z","updated_at":"2021-03-05T18:02:23Z"},{"id":2,"account_id":531,"name":"Primary Production","ip":"1.1.1.1","port":4567,"linked_secondary_zones":["secondaryzone.com"],"created_at":"2021-03-16T20:33:34Z","updated_at":"2021-03-16T20:33:34Z"}],"pagination":{"current_page":1,"per_page":30,"total_entries":2,"total_pages":1}} -------------------------------------------------------------------------------- /test/fixtures.http/listPushes/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: nginx 3 | Date: Thu, 11 Aug 2016 10:19:54 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | X-RateLimit-Limit: 2400 7 | X-RateLimit-Remaining: 2393 8 | X-RateLimit-Reset: 1470913058 9 | ETag: W/"fd29a0a43fb53ae2e5186232361fa4b9" 10 | Cache-Control: max-age=0, private, must-revalidate 11 | X-Request-Id: 12611d3b-aee5-49e3-a8bf-bd7899b1e797 12 | X-Runtime: 0.045678 13 | X-Content-Type-Options: nosniff 14 | X-Download-Options: noopen 15 | X-Frame-Options: DENY 16 | X-Permitted-Cross-Domain-Policies: none 17 | X-XSS-Protection: 1; mode=block 18 | Strict-Transport-Security: max-age=31536000 19 | 20 | {"data":[{"id":1,"domain_id":100,"contact_id":null,"account_id":2020,"created_at":"2016-08-11T10:16:03Z","updated_at":"2016-08-11T10:16:03Z","accepted_at":null},{"id":2,"domain_id":101,"contact_id":null,"account_id":2020,"created_at":"2016-08-11T10:18:48Z","updated_at":"2016-08-11T10:18:48Z","accepted_at":null}],"pagination":{"current_page":1,"per_page":30,"total_entries":2,"total_pages":1}} 21 | -------------------------------------------------------------------------------- /test/fixtures.http/listRegistrantChanges/success.http: -------------------------------------------------------------------------------- 1 | HTTP/2 200 2 | server: nginx 3 | date: Tue, 22 Aug 2023 11:12:49 GMT 4 | content-type: application/json; charset=utf-8 5 | x-ratelimit-limit: 2400 6 | x-ratelimit-remaining: 2393 7 | x-ratelimit-reset: 1692705338 8 | x-work-with-us: Love automation? So do we! https://dnsimple.com/jobs 9 | etag: W/"0049703ea058b06346df4c0e169eac29" 10 | cache-control: max-age=0, private, must-revalidate 11 | x-request-id: fd0334ce-414a-4872-8889-e548e0b1410c 12 | x-runtime: 0.030759 13 | strict-transport-security: max-age=63072000 14 | 15 | {"data":[{"id":101,"account_id":101,"domain_id":101,"contact_id":101,"state":"new","extended_attributes":{},"registry_owner_change":true,"irt_lock_lifted_by":null,"created_at":"2017-02-03T17:43:22Z","updated_at":"2017-02-03T17:43:22Z"}],"pagination":{"current_page":1,"per_page":30,"total_entries":1,"total_pages":1}} -------------------------------------------------------------------------------- /test/fixtures.http/listServices/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: nginx 3 | Date: Sat, 10 Dec 2016 22:37:13 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | X-RateLimit-Limit: 2400 7 | X-RateLimit-Remaining: 2399 8 | X-RateLimit-Reset: 1481413033 9 | ETag: W/"65425ab4559f111f28bc952f3b672d48" 10 | Cache-Control: max-age=0, private, must-revalidate 11 | X-Request-Id: 9a5dadcb-8e90-4fe9-ad60-be13ba3d3970 12 | X-Runtime: 0.263229 13 | X-Content-Type-Options: nosniff 14 | X-Download-Options: noopen 15 | X-Frame-Options: DENY 16 | X-Permitted-Cross-Domain-Policies: none 17 | X-XSS-Protection: 1; mode=block 18 | Strict-Transport-Security: max-age=31536000 19 | 20 | {"data":[{"id":1,"name":"Service 1","sid":"service1","description":"First service example.","setup_description":null,"requires_setup":false,"default_subdomain":null,"created_at":"2014-02-14T19:15:19Z","updated_at":"2016-03-04T09:23:27Z","settings":[]},{"id":2,"name":"Service 2","sid":"service2","description":"Second service example.","setup_description":null,"requires_setup":true,"default_subdomain":null,"created_at":"2014-02-14T19:15:19Z","updated_at":"2016-03-04T09:23:27Z","settings":[{"name":"username","label":"Service 2 Account Username","append":".service2.com","description":"Your Service2 username is used to connect services to your account.","example":"username","password":false}]}],"pagination":{"current_page":1,"per_page":30,"total_entries":2,"total_pages":1}} -------------------------------------------------------------------------------- /test/fixtures.http/listTemplateRecords/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: nginx 3 | Date: Tue, 03 May 2016 08:07:17 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | Status: 200 OK 7 | X-RateLimit-Limit: 2400 8 | X-RateLimit-Remaining: 2391 9 | X-RateLimit-Reset: 1462265481 10 | ETag: W/"3e53584bcf1ce7c7ee4c0bdf734224fa" 11 | Cache-Control: max-age=0, private, must-revalidate 12 | X-Request-Id: 79c25a93-0660-4479-a71f-201c26309e00 13 | X-Runtime: 0.252889 14 | Strict-Transport-Security: max-age=31536000 15 | 16 | {"data":[{"id":296,"template_id":268,"name":"","content":"192.168.1.1","ttl":3600,"priority":null,"type":"A","created_at":"2016-04-26T08:23:54Z","updated_at":"2016-04-26T08:23:54Z"},{"id":298,"template_id":268,"name":"www","content":"{{domain}}","ttl":3600,"priority":null,"type":"CNAME","created_at":"2016-04-26T08:25:11Z","updated_at":"2016-04-26T08:25:11Z"}],"pagination":{"current_page":1,"per_page":30,"total_entries":2,"total_pages":1}} 17 | -------------------------------------------------------------------------------- /test/fixtures.http/listTemplates/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: nginx 3 | Date: Tue, 22 Mar 2016 11:11:50 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | Status: 200 OK 7 | X-RateLimit-Limit: 2400 8 | X-RateLimit-Remaining: 2396 9 | X-RateLimit-Reset: 1458648490 10 | ETag: W/"2d1c99cff82eace0e995d901b465bbde" 11 | Cache-Control: max-age=0, private, must-revalidate 12 | X-Request-Id: 774e871f-8bda-40d7-bed9-bd907e872987 13 | X-Runtime: 0.193956 14 | Strict-Transport-Security: max-age=31536000 15 | 16 | {"data":[{"id":1,"account_id":1010,"name":"Alpha","sid":"alpha","description":"An alpha template.","created_at":"2016-03-22T11:08:58Z","updated_at":"2016-03-22T11:08:58Z"},{"id":2,"account_id":1010,"name":"Beta","sid":"beta","description":"A beta template.","created_at":"2016-03-22T11:11:26Z","updated_at":"2016-03-22T11:11:26Z"}],"pagination":{"current_page":1,"per_page":30,"total_entries":2,"total_pages":1}} -------------------------------------------------------------------------------- /test/fixtures.http/listTlds/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: nginx 3 | Date: Fri, 23 Sep 2016 08:22:50 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | X-RateLimit-Limit: 2400 7 | X-RateLimit-Remaining: 2397 8 | X-RateLimit-Reset: 1474622397 9 | ETag: W/"06436132982cdf558bc1472b1e15a786" 10 | Cache-Control: max-age=0, private, must-revalidate 11 | X-Request-Id: c78c1f6c-2143-4646-9049-313ccd9e24bd 12 | X-Runtime: 0.012861 13 | X-Content-Type-Options: nosniff 14 | X-Download-Options: noopen 15 | X-Frame-Options: DENY 16 | X-Permitted-Cross-Domain-Policies: none 17 | X-XSS-Protection: 1; mode=block 18 | Strict-Transport-Security: max-age=31536000 19 | 20 | {"data":[{"tld":"ac","tld_type":2,"whois_privacy":false,"auto_renew_only":true,"idn":false,"minimum_registration":1,"registration_enabled":true,"renewal_enabled":true,"transfer_enabled":false,"dnssec_interface_type":"ds"},{"tld":"academy","tld_type":3,"whois_privacy":true,"auto_renew_only":false,"idn":true,"minimum_registration":1,"registration_enabled":true,"renewal_enabled":true,"transfer_enabled":true,"dnssec_interface_type":"key"}],"pagination":{"current_page":1,"per_page":2,"total_entries":195,"total_pages":98}} 21 | -------------------------------------------------------------------------------- /test/fixtures.http/listWebhooks/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: nginx 3 | Date: Mon, 15 Feb 2016 17:06:21 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | Status: 200 OK 7 | X-RateLimit-Limit: 4000 8 | X-RateLimit-Remaining: 3991 9 | X-RateLimit-Reset: 1455559348 10 | ETag: W/"01f1ea26e8e06d8d969bf06678bf7d12" 11 | Cache-Control: max-age=0, private, must-revalidate 12 | X-Request-Id: bc611cd0-d1a9-48d0-b450-c9c86f0d0dcf 13 | X-Runtime: 0.104174 14 | Strict-Transport-Security: max-age=31536000 15 | 16 | {"data":[{"id":1,"url":"https://webhook.test"},{"id":2,"url":"https://another.test"}]} 17 | -------------------------------------------------------------------------------- /test/fixtures.http/listZoneRecords/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: nginx 3 | Date: Wed, 05 Oct 2016 09:27:02 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | X-RateLimit-Limit: 2400 7 | X-RateLimit-Remaining: 2397 8 | X-RateLimit-Reset: 1475662531 9 | ETag: W/"4a6291c6424d22726fb7087cfdf99ab9" 10 | Cache-Control: max-age=0, private, must-revalidate 11 | X-Request-Id: 8a2279ac-709e-42ac-8964-95a5534acfb9 12 | X-Runtime: 0.271719 13 | X-Content-Type-Options: nosniff 14 | X-Download-Options: noopen 15 | X-Frame-Options: DENY 16 | X-Permitted-Cross-Domain-Policies: none 17 | X-XSS-Protection: 1; mode=block 18 | Strict-Transport-Security: max-age=31536000 19 | 20 | {"data":[{"id":1,"zone_id":"example.com","parent_id":null,"name":"","content":"ns1.dnsimple.com admin.dnsimple.com 1458642070 86400 7200 604800 300","ttl":3600,"priority":null,"type":"SOA","regions":["global"],"system_record":true,"created_at":"2016-03-22T10:20:53Z","updated_at":"2016-10-05T09:26:38Z"},{"id":69061,"zone_id":"example.com","parent_id":null,"name":"","content":"ns1.dnsimple.com","ttl":3600,"priority":null,"type":"NS","regions":["global"],"system_record":true,"created_at":"2016-03-22T10:20:53Z","updated_at":"2016-03-22T10:20:53Z"},{"id":2,"zone_id":"example.com","parent_id":null,"name":"","content":"ns2.dnsimple.com","ttl":3600,"priority":null,"type":"NS","regions":["global"],"system_record":true,"created_at":"2016-03-22T10:20:53Z","updated_at":"2016-03-22T10:20:53Z"},{"id":3,"zone_id":"example.com","parent_id":null,"name":"","content":"ns3.dnsimple.com","ttl":3600,"priority":null,"type":"NS","regions":["global"],"system_record":true,"created_at":"2016-03-22T10:20:53Z","updated_at":"2016-03-22T10:20:53Z"},{"id":4,"zone_id":"example.com","parent_id":null,"name":"","content":"ns4.dnsimple.com","ttl":3600,"priority":null,"type":"NS","regions":["global"],"system_record":true,"created_at":"2016-03-22T10:20:53Z","updated_at":"2016-03-22T10:20:53Z"}],"pagination":{"current_page":1,"per_page":30,"total_entries":5,"total_pages":1}} 21 | -------------------------------------------------------------------------------- /test/fixtures.http/listZones/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: nginx 3 | Date: Fri, 22 Jan 2016 16:54:24 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | Status: 200 OK 7 | X-RateLimit-Limit: 4000 8 | X-RateLimit-Remaining: 3994 9 | X-RateLimit-Reset: 1453484045 10 | ETag: W/"485e03204e1853519bd637be743f2b25" 11 | Cache-Control: max-age=0, private, must-revalidate 12 | X-Request-Id: 01be9fa5-3a00-4d51-a927-f17587cb67ec 13 | X-Runtime: 0.037083 14 | Strict-Transport-Security: max-age=31536000 15 | 16 | {"data":[{"id":1,"account_id":1010,"name":"example-alpha.com","reverse":false,"secondary":false,"last_transferred_at":null,"active":true,"created_at":"2015-04-23T07:40:03Z","updated_at":"2015-04-23T07:40:03Z"},{"id":2,"account_id":1010,"name":"example-beta.com","reverse":false,"secondary":false,"last_transferred_at":null,"active":true,"created_at":"2015-04-23T07:40:03Z","updated_at":"2015-04-23T07:40:03Z"}],"pagination":{"current_page":1,"per_page":30,"total_entries":2,"total_pages":1}} 17 | -------------------------------------------------------------------------------- /test/fixtures.http/method-not-allowed.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 405 Method Not Allowed 2 | Server: nginx 3 | Date: Fri, 15 Apr 2016 14:15:04 GMT 4 | Connection: keep-alive 5 | Status: 405 Method Not Allowed 6 | Allow: DELETE, GET, HEAD, PATCH, POST 7 | Cache-Control: no-cache 8 | X-Request-Id: 64c0a5e1-4cbb-4287-98a7-93085a77ac55 9 | X-Runtime: 0.050104 10 | 11 | -------------------------------------------------------------------------------- /test/fixtures.http/notfound-certificate.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 404 Not Found 2 | Server: nginx 3 | Date: Tue, 19 Jul 2016 08:56:34 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | Cache-Control: no-cache 7 | X-Request-Id: 9a51fa7e-cc9b-498b-bf8d-ee3b2819c0c6 8 | X-Runtime: 0.040469 9 | X-Content-Type-Options: nosniff 10 | X-Download-Options: noopen 11 | X-Frame-Options: DENY 12 | X-Permitted-Cross-Domain-Policies: none 13 | X-XSS-Protection: 1; mode=block 14 | 15 | {"message":"Certificate `0` not found"} 16 | -------------------------------------------------------------------------------- /test/fixtures.http/notfound-collaborator.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 404 Not Found 2 | Server: nginx 3 | Date: Mon, 21 Nov 2016 09:32:48 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | Cache-Control: no-cache 7 | X-Request-Id: 3e76b10b-412c-42ef-87d1-f8ff327df997 8 | X-Runtime: 0.030250 9 | X-Content-Type-Options: nosniff 10 | X-Download-Options: noopen 11 | X-Frame-Options: DENY 12 | X-Permitted-Cross-Domain-Policies: none 13 | X-XSS-Protection: 1; mode=block 14 | 15 | {"message":"Membership `0` not found"} 16 | -------------------------------------------------------------------------------- /test/fixtures.http/notfound-contact.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 404 Not Found 2 | Server: nginx 3 | Date: Tue, 19 Jan 2016 21:04:48 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | Status: 404 Not Found 7 | Cache-Control: no-cache 8 | X-Request-Id: a57d4e23-3155-477e-8469-e897b27c03e5 9 | X-Runtime: 0.014159 10 | 11 | {"message":"Contact `0` not found"} -------------------------------------------------------------------------------- /test/fixtures.http/notfound-delegationSignerRecord.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 404 Not Found 2 | Server: nginx 3 | Date: Thu, 04 Feb 2016 14:44:56 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | Status: 404 Not Found 7 | Cache-Control: no-cache 8 | X-Request-Id: 50eea494-cc14-4db0-bc11-306aa525bbfd 9 | X-Runtime: 0.028036 10 | 11 | {"message":"Delegation signer record `0` not found"} 12 | -------------------------------------------------------------------------------- /test/fixtures.http/notfound-domain.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 404 Not Found 2 | Server: nginx 3 | Date: Wed, 16 Dec 2015 22:07:20 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | Strict-Transport-Security: max-age=31536000 7 | Cache-Control: no-cache 8 | X-Request-Id: bc587ea7-bcd5-4c10-a940-a9b4c8339824 9 | X-Runtime: 0.059966 10 | 11 | {"message":"Domain `0` not found"} -------------------------------------------------------------------------------- /test/fixtures.http/notfound-domainpush.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 404 Not Found 2 | Server: nginx 3 | Date: Thu, 04 Feb 2016 14:44:56 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | Status: 404 Not Found 7 | Cache-Control: no-cache 8 | X-Request-Id: 50eea494-cc14-4db0-bc11-306aa525bbfd 9 | X-Runtime: 0.028036 10 | 11 | {"message":"Domain push `0` not found"} 12 | -------------------------------------------------------------------------------- /test/fixtures.http/notfound-emailforward.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 404 Not Found 2 | Server: nginx 3 | Date: Thu, 04 Feb 2016 14:44:56 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | Status: 404 Not Found 7 | Cache-Control: no-cache 8 | X-Request-Id: 50eea494-cc14-4db0-bc11-306aa525bbfd 9 | X-Runtime: 0.028036 10 | 11 | {"message":"Email forward `0` not found"} 12 | -------------------------------------------------------------------------------- /test/fixtures.http/notfound-record.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 404 Not Found 2 | Server: nginx 3 | Date: Fri, 22 Jan 2016 16:46:07 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | Status: 404 Not Found 7 | Cache-Control: no-cache 8 | X-Request-Id: 35af0fd2-d020-4f70-861e-b6a42a190bf6 9 | X-Runtime: 0.018847 10 | 11 | {"message":"Record `0` not found"} -------------------------------------------------------------------------------- /test/fixtures.http/notfound-template.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 404 Not Found 2 | Server: nginx 3 | Date: Wed, 04 May 2016 09:35:45 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | Status: 404 Not Found 7 | Cache-Control: no-cache 8 | X-Request-Id: 8d380d93-b974-4d51-82a3-5b10bce4167a 9 | X-Runtime: 0.071884 10 | 11 | {"message":"Template `beta` not found"} -------------------------------------------------------------------------------- /test/fixtures.http/notfound-webhook.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 404 Not Found 2 | Server: nginx 3 | Date: Thu, 03 Mar 2016 11:55:29 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | Status: 404 Not Found 7 | Cache-Control: no-cache 8 | X-Request-Id: 4f154fa2-3ce9-4bdd-88a3-42ccc8dbc087 9 | X-Runtime: 0.012159 10 | 11 | {"message":"Webhook `0` not found"} 12 | -------------------------------------------------------------------------------- /test/fixtures.http/notfound-whoisprivacy.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 404 Not Found 2 | Server: nginx 3 | Date: Sat, 13 Feb 2016 14:34:32 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | Status: 404 Not Found 7 | Cache-Control: no-cache 8 | X-Request-Id: d5ce788e-bd8d-4edb-bcd6-50a1deacd595 9 | X-Runtime: 0.031090 10 | 11 | {"message":"Whois privacy for example-1455121347.com not found"} -------------------------------------------------------------------------------- /test/fixtures.http/notfound-zone.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 404 Not Found 2 | Server: nginx 3 | Date: Fri, 22 Jan 2016 16:46:02 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | Status: 404 Not Found 7 | Cache-Control: no-cache 8 | X-Request-Id: 9c19bef5-6902-421c-9f91-dec3bae26102 9 | X-Runtime: 0.014705 10 | 11 | {"message":"Zone `0` not found"} -------------------------------------------------------------------------------- /test/fixtures.http/oauthAccessToken/error-invalid-request.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 400 Bad Request 2 | Server: nginx 3 | Date: Mon, 08 Feb 2016 21:24:19 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | X-RateLimit-Limit: 30 7 | X-RateLimit-Remaining: 29 8 | X-RateLimit-Reset: 1454970259 9 | ETag: W/"def417b4ade951f8148bb6a4fa3fcf5a" 10 | Cache-Control: max-age=0, private, must-revalidate 11 | X-Request-Id: e8c544cf-fcc3-4762-a200-60c0320a2575 12 | X-Runtime: 0.105600 13 | Strict-Transport-Security: max-age=31536000 14 | 15 | {"error":"invalid_request","error_description":"Invalid \"state\": value doesn't match the \"state\" in the authorization request"} 16 | -------------------------------------------------------------------------------- /test/fixtures.http/oauthAccessToken/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: nginx 3 | Date: Mon, 08 Feb 2016 21:24:19 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | Status: 200 OK 7 | X-RateLimit-Limit: 30 8 | X-RateLimit-Remaining: 29 9 | X-RateLimit-Reset: 1454970259 10 | ETag: W/"def417b4ade951f8148bb6a4fa3fcf5a" 11 | Cache-Control: max-age=0, private, must-revalidate 12 | X-Request-Id: e8c544cf-fcc3-4762-a200-60c0320a2575 13 | X-Runtime: 0.105600 14 | Strict-Transport-Security: max-age=31536000 15 | 16 | {"access_token":"zKQ7OLqF5N1gylcJweA9WodA000BUNJD","token_type":"Bearer","scope":null,"account_id":1} 17 | -------------------------------------------------------------------------------- /test/fixtures.http/pages-1of3.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: nginx 3 | Date: Wed, 16 Dec 2015 13:36:11 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | X-RateLimit-Limit: 4000 7 | X-RateLimit-Remaining: 3997 8 | X-RateLimit-Reset: 1450272970 9 | ETag: W/"2679531e6cce6cd326f255255d7a0005" 10 | Cache-Control: max-age=0, private, must-revalidate 11 | X-Request-Id: a87f1b44-150a-4ed0-b7da-9301fa1465b0 12 | X-Runtime: 0.093714 13 | Strict-Transport-Security: max-age=31536000 14 | 15 | {"data":[{"id":1},{"id":2}],"pagination":{"current_page":1,"per_page":2,"total_entries":5,"total_pages":3}} -------------------------------------------------------------------------------- /test/fixtures.http/pages-2of3.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: nginx 3 | Date: Wed, 16 Dec 2015 13:36:11 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | X-RateLimit-Limit: 4000 7 | X-RateLimit-Remaining: 3997 8 | X-RateLimit-Reset: 1450272970 9 | ETag: W/"2679531e6cce6cd326f255255d7a0005" 10 | Cache-Control: max-age=0, private, must-revalidate 11 | X-Request-Id: a87f1b44-150a-4ed0-b7da-9301fa1465b0 12 | X-Runtime: 0.093714 13 | Strict-Transport-Security: max-age=31536000 14 | 15 | {"data":[{"id":3},{"id":4}],"pagination":{"current_page":2,"per_page":2,"total_entries":5,"total_pages":3}} -------------------------------------------------------------------------------- /test/fixtures.http/pages-3of3.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: nginx 3 | Date: Wed, 16 Dec 2015 13:36:11 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | X-RateLimit-Limit: 4000 7 | X-RateLimit-Remaining: 3997 8 | X-RateLimit-Reset: 1450272970 9 | ETag: W/"2679531e6cce6cd326f255255d7a0005" 10 | Cache-Control: max-age=0, private, must-revalidate 11 | X-Request-Id: a87f1b44-150a-4ed0-b7da-9301fa1465b0 12 | X-Runtime: 0.093714 13 | Strict-Transport-Security: max-age=31536000 14 | 15 | {"data":[{"id":5}],"pagination":{"current_page":3,"per_page":2,"total_entries":5,"total_pages":3}} -------------------------------------------------------------------------------- /test/fixtures.http/purchaseLetsencryptCertificate/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 201 Created 2 | Server: nginx 3 | Date: Thu, 18 Jun 2020 18:54:17 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | X-RateLimit-Limit: 4800 7 | X-RateLimit-Remaining: 4799 8 | X-RateLimit-Reset: 1592510057 9 | ETag: W/"36ffdd6505ed488a3aeeaace031c5869" 10 | Cache-Control: max-age=0, private, must-revalidate 11 | X-Request-Id: 4e99c95d-6d19-48ea-8d63-e68432631c90 12 | X-Runtime: 0.098745 13 | X-Frame-Options: DENY 14 | X-Content-Type-Options: nosniff 15 | X-XSS-Protection: 1; mode=block 16 | X-Download-Options: noopen 17 | X-Permitted-Cross-Domain-Policies: none 18 | Strict-Transport-Security: max-age=31536000 19 | 20 | {"data":{"id":101967,"certificate_id":101967,"state":"new","auto_renew":false,"created_at":"2020-06-18T18:54:17Z","updated_at":"2020-06-18T18:54:17Z"}} 21 | -------------------------------------------------------------------------------- /test/fixtures.http/purchaseRenewalLetsencryptCertificate/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 201 Created 2 | Server: nginx 3 | Date: Thu, 18 Jun 2020 19:56:20 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | X-RateLimit-Limit: 4800 7 | X-RateLimit-Remaining: 4799 8 | X-RateLimit-Reset: 1592513780 9 | ETag: W/"84dd908f85153590082766bd8d1f1056" 10 | Cache-Control: max-age=0, private, must-revalidate 11 | X-Request-Id: f43f4d80-a7eb-43d3-b1ec-95eba413894e 12 | X-Runtime: 0.091216 13 | X-Frame-Options: DENY 14 | X-Content-Type-Options: nosniff 15 | X-XSS-Protection: 1; mode=block 16 | X-Download-Options: noopen 17 | X-Permitted-Cross-Domain-Policies: none 18 | Strict-Transport-Security: max-age=31536000 19 | 20 | {"data":{"id":65082,"old_certificate_id":101967,"new_certificate_id":101972,"state":"new","auto_renew":false,"created_at":"2020-06-18T19:56:20Z","updated_at":"2020-06-18T19:56:20Z"}} 21 | -------------------------------------------------------------------------------- /test/fixtures.http/registerDomain/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 201 Created 2 | Server: nginx 3 | Date: Fri, 09 Dec 2016 19:35:38 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | X-RateLimit-Limit: 2400 7 | X-RateLimit-Remaining: 2396 8 | X-RateLimit-Reset: 1481315246 9 | ETag: W/"440b25022ab55cd8e84be64356bfd7d9" 10 | Cache-Control: max-age=0, private, must-revalidate 11 | X-Request-Id: aac22ee4-31d7-4d71-ad3d-d0004f5cf370 12 | X-Runtime: 11.906207 13 | X-Content-Type-Options: nosniff 14 | X-Download-Options: noopen 15 | X-Frame-Options: DENY 16 | X-Permitted-Cross-Domain-Policies: none 17 | X-XSS-Protection: 1; mode=block 18 | Strict-Transport-Security: max-age=31536000 19 | 20 | {"data":{"id":1,"domain_id":999,"registrant_id":2,"period":1,"state":"new","auto_renew":false,"whois_privacy":false,"created_at":"2016-12-09T19:35:31Z","updated_at":"2016-12-09T19:35:31Z"}} 21 | -------------------------------------------------------------------------------- /test/fixtures.http/rejectPush/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 204 No Content 2 | Server: nginx 3 | Date: Thu, 11 Aug 2016 10:24:54 GMT 4 | Connection: keep-alive 5 | X-RateLimit-Limit: 2400 6 | X-RateLimit-Remaining: 2391 7 | X-RateLimit-Reset: 1470913059 8 | Cache-Control: no-cache 9 | X-Request-Id: c0258478-1392-49b2-9b94-67b173acae12 10 | X-Runtime: 0.174739 11 | X-Content-Type-Options: nosniff 12 | X-Download-Options: noopen 13 | X-Frame-Options: DENY 14 | X-Permitted-Cross-Domain-Policies: none 15 | X-XSS-Protection: 1; mode=block 16 | Strict-Transport-Security: max-age=31536000 17 | 18 | -------------------------------------------------------------------------------- /test/fixtures.http/removeCollaborator/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 204 No Content 2 | Server: nginx 3 | Date: Fri, 07 Oct 2016 09:08:51 GMT 4 | Connection: keep-alive 5 | X-RateLimit-Limit: 2400 6 | X-RateLimit-Remaining: 2395 7 | X-RateLimit-Reset: 1475833773 8 | Cache-Control: no-cache 9 | X-Request-Id: 732cdd0a-9ae5-4853-93ef-3511652b687a 10 | X-Runtime: 0.098437 11 | X-Content-Type-Options: nosniff 12 | X-Download-Options: noopen 13 | X-Frame-Options: DENY 14 | X-Permitted-Cross-Domain-Policies: none 15 | X-XSS-Protection: 1; mode=block 16 | Strict-Transport-Security: max-age=31536000 17 | 18 | -------------------------------------------------------------------------------- /test/fixtures.http/renewDomain/error-tooearly.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 400 Bad Request 2 | Server: nginx 3 | Date: Mon, 15 Feb 2016 15:06:35 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | Status: 400 Bad Request 7 | X-RateLimit-Limit: 4000 8 | X-RateLimit-Remaining: 3998 9 | X-RateLimit-Reset: 1455552316 10 | Cache-Control: no-cache 11 | X-Request-Id: 0c1507d3-4c03-4ba3-b2bd-b0cabf021ed8 12 | X-Runtime: 0.256476 13 | 14 | {"message":"example.com may not be renewed at this time","errors":{}} 15 | -------------------------------------------------------------------------------- /test/fixtures.http/renewDomain/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 201 Created 2 | Server: nginx 3 | Date: Fri, 09 Dec 2016 19:46:57 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | X-RateLimit-Limit: 2400 7 | X-RateLimit-Remaining: 2394 8 | X-RateLimit-Reset: 1481315245 9 | ETag: W/"179d85ea8a26a3d5dc76e42de2d7918e" 10 | Cache-Control: max-age=0, private, must-revalidate 11 | X-Request-Id: ba6f2707-5df0-4ffa-b91b-51d4460bab8e 12 | X-Runtime: 13.571302 13 | X-Content-Type-Options: nosniff 14 | X-Download-Options: noopen 15 | X-Frame-Options: DENY 16 | X-Permitted-Cross-Domain-Policies: none 17 | X-XSS-Protection: 1; mode=block 18 | Strict-Transport-Security: max-age=31536000 19 | 20 | {"data":{"id":1,"domain_id":999,"period":1,"state":"new","created_at":"2016-12-09T19:46:45Z","updated_at":"2016-12-09T19:46:45Z"}} 21 | -------------------------------------------------------------------------------- /test/fixtures.http/renewWhoisPrivacy/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 201 Created 2 | Server: nginx 3 | Date: Thu, 10 Jan 2019 12:12:50 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | X-RateLimit-Limit: 2400 7 | X-RateLimit-Remaining: 2398 8 | X-RateLimit-Reset: 1547125899 9 | ETag: W/"e5bf5d90a6c95e5f1443dcbaf2cc27c6" 10 | Cache-Control: max-age=0, private, must-revalidate 11 | X-Request-Id: 6e80e830-21ae-46ea-9191-98811884808a 12 | X-Runtime: 1.459325 13 | X-Frame-Options: DENY 14 | X-Content-Type-Options: nosniff 15 | X-XSS-Protection: 1; mode=block 16 | X-Download-Options: noopen 17 | X-Permitted-Cross-Domain-Policies: none 18 | Strict-Transport-Security: max-age=31536000 19 | 20 | {"data":{"id":1,"domain_id":100,"whois_privacy_id":999,"state":"new","expires_on":"2020-01-10","enabled":true,"created_at":"2019-01-10T12:12:48Z","updated_at":"2019-01-10T12:12:48Z"}} -------------------------------------------------------------------------------- /test/fixtures.http/renewWhoisPrivacy/whois-privacy-duplicated-order.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 400 Bad Request 2 | Server: nginx 3 | Date: Thu, 10 Jan 2019 12:13:21 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | X-RateLimit-Limit: 2400 7 | X-RateLimit-Remaining: 2397 8 | X-RateLimit-Reset: 1547125899 9 | Cache-Control: no-cache 10 | X-Request-Id: 16cc92bb-fe38-434b-b483-602d77ac77d3 11 | X-Runtime: 0.122201 12 | X-Frame-Options: DENY 13 | X-Content-Type-Options: nosniff 14 | X-XSS-Protection: 1; mode=block 15 | X-Download-Options: noopen 16 | X-Permitted-Cross-Domain-Policies: none 17 | 18 | {"message":"The whois privacy for example.com has just been renewed, a new renewal cannot be started at this time"} -------------------------------------------------------------------------------- /test/fixtures.http/renewWhoisPrivacy/whois-privacy-not-found.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 400 Bad Request 2 | Server: nginx 3 | Date: Thu, 10 Jan 2019 12:11:39 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | X-RateLimit-Limit: 2400 7 | X-RateLimit-Remaining: 2399 8 | X-RateLimit-Reset: 1547125899 9 | Cache-Control: no-cache 10 | X-Request-Id: 2727b7c4-97af-4e22-9c7f-bd84e20f2dc1 11 | X-Runtime: 0.139925 12 | X-Frame-Options: DENY 13 | X-Content-Type-Options: nosniff 14 | X-XSS-Protection: 1; mode=block 15 | X-Download-Options: noopen 16 | X-Permitted-Cross-Domain-Policies: none 17 | 18 | {"message":"WHOIS privacy not found for example.com"} -------------------------------------------------------------------------------- /test/fixtures.http/response.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: nginx 3 | Date: Fri, 18 Dec 2015 15:19:37 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | X-RateLimit-Limit: 4000 7 | X-RateLimit-Remaining: 3991 8 | X-RateLimit-Reset: 1450451976 9 | ETag: W/"5ea6326bc1a8e83e5c156c564f2559f0" 10 | Cache-Control: max-age=0, private, must-revalidate 11 | X-Request-Id: 15a7f3a5-7ee5-4e36-ac5a-8c21c2e1fffd 12 | X-Runtime: 0.141588 13 | Strict-Transport-Security: max-age=31536000 14 | 15 | {"data":{"user":null,"account":null}} -------------------------------------------------------------------------------- /test/fixtures.http/success-with-malformed-json.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: nginx 3 | Date: Mon, 22 Dec 2014 14:16:12 GMT 4 | Content-Type: text/html 5 | Connection: close 6 | 7 | 8 | 200 OK 9 | 10 |

200 OK

11 |
nginx
12 | 13 | 14 | -------------------------------------------------------------------------------- /test/fixtures.http/transferDomain/error-indnsimple.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 400 Bad Request 2 | Server: nginx 3 | Date: Sun, 21 Feb 2016 13:11:54 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | Status: 400 Bad Request 7 | X-RateLimit-Limit: 4000 8 | X-RateLimit-Remaining: 3996 9 | X-RateLimit-Reset: 1456063541 10 | Cache-Control: no-cache 11 | X-Request-Id: 15d2e302-e835-4dda-9652-03d8962280ae 12 | X-Runtime: 0.994068 13 | 14 | {"message":"The domain google.com is already in DNSimple and cannot be added"} -------------------------------------------------------------------------------- /test/fixtures.http/transferDomain/error-missing-authcode.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 400 Bad Request 2 | Server: nginx 3 | Date: Sun, 21 Feb 2016 13:11:11 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | Status: 400 Bad Request 7 | X-RateLimit-Limit: 4000 8 | X-RateLimit-Remaining: 3997 9 | X-RateLimit-Reset: 1456063540 10 | Cache-Control: no-cache 11 | X-Request-Id: d7a0eb63-77eb-4488-bc55-c129ed8fe192 12 | X-Runtime: 11.912567 13 | 14 | {"message":"Validation failed","errors":{"base":["You must provide an authorization code for the domain"]}} -------------------------------------------------------------------------------- /test/fixtures.http/transferDomain/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 201 Created 2 | Server: nginx 3 | Date: Fri, 09 Dec 2016 19:43:43 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | X-RateLimit-Limit: 2400 7 | X-RateLimit-Remaining: 2395 8 | X-RateLimit-Reset: 1481315246 9 | ETag: W/"e58e7ac3ad9e30162c5098f29f208066" 10 | Cache-Control: max-age=0, private, must-revalidate 11 | X-Request-Id: 0d00c622-9fc8-406a-93cb-d2c5d6ecd6b4 12 | X-Runtime: 6.483160 13 | X-Content-Type-Options: nosniff 14 | X-Download-Options: noopen 15 | X-Frame-Options: DENY 16 | X-Permitted-Cross-Domain-Policies: none 17 | X-XSS-Protection: 1; mode=block 18 | Strict-Transport-Security: max-age=31536000 19 | 20 | {"data":{"id":1,"domain_id":999,"registrant_id":2,"state":"transferring","auto_renew":false,"whois_privacy":false,"created_at":"2016-12-09T19:43:41Z","updated_at":"2016-12-09T19:43:43Z"}} 21 | -------------------------------------------------------------------------------- /test/fixtures.http/unapplyService/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 204 No Content 2 | Server: nginx 3 | Date: Sat, 09 Jul 2016 11:13:48 GMT 4 | Connection: keep-alive 5 | X-RateLimit-Limit: 2400 6 | X-RateLimit-Remaining: 2397 7 | X-RateLimit-Reset: 1468066326 8 | Cache-Control: no-cache 9 | X-Request-Id: bb164b01-636a-4d02-acb5-a829afc5ea8c 10 | X-Runtime: 0.070508 11 | X-Content-Type-Options: nosniff 12 | X-Download-Options: noopen 13 | X-Frame-Options: DENY 14 | X-Permitted-Cross-Domain-Policies: none 15 | X-XSS-Protection: 1; mode=block 16 | Strict-Transport-Security: max-age=31536000 17 | 18 | -------------------------------------------------------------------------------- /test/fixtures.http/unlinkPrimaryServer/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: nginx 3 | Date: Wed, 17 Mar 2021 23:36:43 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | X-RateLimit-Limit: 2400 7 | X-RateLimit-Remaining: 2383 8 | X-RateLimit-Reset: 1616024599 9 | ETag: W/"ceda02163217bdb9e6850e2c36cbf163" 10 | Cache-Control: max-age=0, private, must-revalidate 11 | X-Request-Id: 789c6feb-63e1-40d6-b2b6-f569b23a507c 12 | X-Runtime: 0.270968 13 | X-Frame-Options: DENY 14 | X-Content-Type-Options: nosniff 15 | X-XSS-Protection: 1; mode=block 16 | X-Download-Options: noopen 17 | X-Permitted-Cross-Domain-Policies: none 18 | Content-Security-Policy: frame-ancestors 'none' 19 | Strict-Transport-Security: max-age=31536000 20 | 21 | {"data":{"id":4,"account_id":531,"name":"PrimaryProduction","ip":"1.2.3.4","port":53,"linked_secondary_zones":[],"created_at":"2021-03-17T23:08:42Z","updated_at":"2021-03-17T23:08:42Z"}} -------------------------------------------------------------------------------- /test/fixtures.http/updateContact/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: nginx 3 | Date: Tue, 19 Jan 2016 21:28:13 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | Status: 200 OK 7 | X-RateLimit-Limit: 4000 8 | X-RateLimit-Remaining: 3995 9 | X-RateLimit-Reset: 1453239045 10 | ETag: W/"4a798ad8f083076b23d3eed622eefc2d" 11 | Cache-Control: max-age=0, private, must-revalidate 12 | X-Request-Id: c0e1e24f-d22d-4832-a30e-2f4ffc40b029 13 | X-Runtime: 0.053262 14 | Strict-Transport-Security: max-age=31536000 15 | 16 | {"data":{"id":1,"account_id":1010,"label":"Default","first_name":"First","last_name":"User","job_title":"CEO","organization_name":"Awesome Company","email":"first@example.com","phone":"+18001234567","fax":"+18011234567","address1":"Italian Street, 10","address2":"","city":"Roma","state_province":"RM","postal_code":"00100","country":"IT","created_at":"2016-01-19T20:50:26Z","updated_at":"2016-01-19T20:50:26Z"}} 17 | -------------------------------------------------------------------------------- /test/fixtures.http/updateTemplate/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: nginx 3 | Date: Thu, 24 Mar 2016 11:04:55 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | Status: 200 OK 7 | X-RateLimit-Limit: 2400 8 | X-RateLimit-Remaining: 2398 9 | X-RateLimit-Reset: 1458821048 10 | ETag: W/"6a2c0c6789d853473765a5fc5662da2e" 11 | Cache-Control: max-age=0, private, must-revalidate 12 | X-Request-Id: 3a7993e7-8b1e-47ce-a7a8-cc86b02904de 13 | X-Runtime: 0.324954 14 | Strict-Transport-Security: max-age=31536000 15 | 16 | {"data":{"id":1,"account_id":1010,"name":"Alpha","sid":"alpha","description":"An alpha template.","created_at":"2016-03-22T11:08:58Z","updated_at":"2016-03-22T11:08:58Z"}} -------------------------------------------------------------------------------- /test/fixtures.http/updateZoneRecord/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: nginx 3 | Date: Wed, 05 Oct 2016 09:59:48 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | X-RateLimit-Limit: 2400 7 | X-RateLimit-Remaining: 2393 8 | X-RateLimit-Reset: 1475662530 9 | ETag: W/"92c807156882e555af8f7a5b93350e44" 10 | Cache-Control: max-age=0, private, must-revalidate 11 | X-Request-Id: 3b630702-46a9-4449-a320-b7ac903d2127 12 | X-Runtime: 0.405810 13 | X-Content-Type-Options: nosniff 14 | X-Download-Options: noopen 15 | X-Frame-Options: DENY 16 | X-Permitted-Cross-Domain-Policies: none 17 | X-XSS-Protection: 1; mode=block 18 | Strict-Transport-Security: max-age=31536000 19 | 20 | {"data":{"id":5,"zone_id":"example.com","parent_id":null,"name":"","content":"mxb.example.com","ttl":3600,"priority":20,"type":"MX","regions":["global"],"system_record":false,"created_at":"2016-10-05T09:51:35Z","updated_at":"2016-10-05T09:51:35Z"}} 21 | -------------------------------------------------------------------------------- /test/fixtures.http/validation-error.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 400 Bad Request 2 | Server: nginx 3 | Date: Wed, 23 Nov 2016 08:12:57 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | X-RateLimit-Limit: 2400 7 | X-RateLimit-Remaining: 2396 8 | X-RateLimit-Reset: 1479892333 9 | Cache-Control: no-cache 10 | X-Request-Id: 91dcf81b-5df4-4d45-b37e-446f0c422a27 11 | X-Runtime: 0.062556 12 | X-Content-Type-Options: nosniff 13 | X-Download-Options: noopen 14 | X-Frame-Options: DENY 15 | X-Permitted-Cross-Domain-Policies: none 16 | X-XSS-Protection: 1; mode=block 17 | 18 | {"message":"Validation failed","errors":{"address1":["can't be blank"],"city":["can't be blank"],"country":["can't be blank"],"email":["can't be blank","is an invalid email address"],"first_name":["can't be blank"],"last_name":["can't be blank"],"phone":["can't be blank","is probably not a phone number"],"postal_code":["can't be blank"],"state_province":["can't be blank"]}} 19 | -------------------------------------------------------------------------------- /test/fixtures.http/whoami/success-account.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: nginx 3 | Date: Fri, 18 Dec 2015 15:19:37 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | X-RateLimit-Limit: 4000 7 | X-RateLimit-Remaining: 3991 8 | X-RateLimit-Reset: 1450451976 9 | ETag: W/"5ea6326bc1a8e83e5c156c564f2559f0" 10 | Cache-Control: max-age=0, private, must-revalidate 11 | X-Request-Id: 15a7f3a5-7ee5-4e36-ac5a-8c21c2e1fffd 12 | X-Runtime: 0.141588 13 | Strict-Transport-Security: max-age=31536000 14 | 15 | {"data":{"user":null,"account":{"id":1,"email":"example-account@example.com","plan_identifier":"dnsimple-professional","created_at":"2015-09-18T23:04:37Z","updated_at":"2016-06-09T20:03:39Z"}}} 16 | -------------------------------------------------------------------------------- /test/fixtures.http/whoami/success-user.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: nginx 3 | Date: Fri, 18 Dec 2015 15:19:37 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | X-RateLimit-Limit: 4000 7 | X-RateLimit-Remaining: 3991 8 | X-RateLimit-Reset: 1450451976 9 | ETag: W/"5ea6326bc1a8e83e5c156c564f2559f0" 10 | Cache-Control: max-age=0, private, must-revalidate 11 | X-Request-Id: 15a7f3a5-7ee5-4e36-ac5a-8c21c2e1fffd 12 | X-Runtime: 0.141588 13 | Strict-Transport-Security: max-age=31536000 14 | 15 | {"data":{"user":{"id":1,"email":"example-user@example.com","created_at":"2015-09-18T23:04:37Z","updated_at":"2016-06-09T20:03:39Z"},"account":null}} 16 | -------------------------------------------------------------------------------- /test/fixtures.http/whoami/success.http: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: nginx 3 | Date: Fri, 18 Dec 2015 15:19:37 GMT 4 | Content-Type: application/json; charset=utf-8 5 | Connection: keep-alive 6 | X-RateLimit-Limit: 4000 7 | X-RateLimit-Remaining: 3991 8 | X-RateLimit-Reset: 1450451976 9 | ETag: W/"5ea6326bc1a8e83e5c156c564f2559f0" 10 | Cache-Control: max-age=0, private, must-revalidate 11 | X-Request-Id: 15a7f3a5-7ee5-4e36-ac5a-8c21c2e1fffd 12 | X-Runtime: 0.141588 13 | Strict-Transport-Security: max-age=31536000 14 | 15 | {"data":{"user":null,"account":{"id":1,"email":"example-account@example.com","plan_identifier":"dnsimple-professional","created_at":"2015-09-18T23:04:37Z","updated_at":"2016-06-09T20:03:39Z"}}} 16 | -------------------------------------------------------------------------------- /test/identity.spec.ts: -------------------------------------------------------------------------------- 1 | import fetchMock from "fetch-mock"; 2 | import { createTestClient, responseFromFixture } from "./util"; 3 | 4 | const dnsimple = createTestClient(); 5 | 6 | describe("identity", () => { 7 | describe("#whoami when authenticated as account", () => { 8 | it("produces an account", async () => { 9 | fetchMock.get( 10 | "https://api.dnsimple.com/v2/whoami", 11 | responseFromFixture("whoami/success-account.http") 12 | ); 13 | 14 | const response = await dnsimple.identity.whoami(); 15 | 16 | expect(response.data.user).toBe(null); 17 | const account = response.data.account; 18 | expect(account.id).toEqual(1); 19 | expect(account.email).toEqual("example-account@example.com"); 20 | }); 21 | }); 22 | 23 | describe("#whoami when authenticated as user", () => { 24 | it("produces a user", async () => { 25 | fetchMock.get( 26 | "https://api.dnsimple.com/v2/whoami", 27 | responseFromFixture("whoami/success-user.http") 28 | ); 29 | 30 | const response = await dnsimple.identity.whoami(); 31 | 32 | expect(response.data.account).toBe(null); 33 | const user = response.data.user; 34 | expect(user.id).toEqual(1); 35 | expect(user.email).toEqual("example-user@example.com"); 36 | }); 37 | }); 38 | }); 39 | -------------------------------------------------------------------------------- /test/oauth.spec.ts: -------------------------------------------------------------------------------- 1 | import fetchMock from "fetch-mock"; 2 | import { createTestClient, responseFromFixture } from "./util"; 3 | 4 | const dnsimple = createTestClient(); 5 | 6 | describe("oauth", () => { 7 | const clientId = "super-client"; 8 | const clientSecret = "super-secret"; 9 | const code = "super-code"; 10 | const redirectUri = "https://great-app.com/oauth"; 11 | const state = "mysecretstate"; 12 | 13 | describe("#exchangeAuthorizationForToken", () => { 14 | it("builds the correct request", async () => { 15 | let expectedPayload = { 16 | client_id: clientId, 17 | client_secret: clientSecret, 18 | code, 19 | grant_type: "authorization_code", 20 | redirect_uri: redirectUri, 21 | state, 22 | }; 23 | fetchMock.post( 24 | "https://api.dnsimple.com/v2/oauth/access_token", 25 | responseFromFixture("oauthAccessToken/success.http") 26 | ); 27 | 28 | await dnsimple.oauth.exchangeAuthorizationForToken({ 29 | code, 30 | clientId, 31 | clientSecret, 32 | redirectUri, 33 | state, 34 | }); 35 | 36 | expect(fetchMock.callHistory.lastCall().options.body).toEqual( 37 | JSON.stringify(expectedPayload) 38 | ); 39 | }); 40 | 41 | it("returns the oauth token", async () => { 42 | fetchMock.post( 43 | "https://api.dnsimple.com/v2/oauth/access_token", 44 | responseFromFixture("oauthAccessToken/success.http") 45 | ); 46 | 47 | const response = await dnsimple.oauth.exchangeAuthorizationForToken({ 48 | code, 49 | clientId, 50 | clientSecret, 51 | redirectUri, 52 | state, 53 | }); 54 | 55 | expect(response.access_token).toBe("zKQ7OLqF5N1gylcJweA9WodA000BUNJD"); 56 | expect(response.token_type).toBe("Bearer"); 57 | expect(response.account_id).toBe(1); 58 | }); 59 | 60 | describe("when state and redirect_uri are provided", () => { 61 | const state = "super-state"; 62 | const redirectUri = "super-redirect-uri"; 63 | 64 | it("builds the correct request", async () => { 65 | let expectedPayload = { 66 | client_id: clientId, 67 | client_secret: clientSecret, 68 | code, 69 | grant_type: "authorization_code", 70 | redirect_uri: redirectUri, 71 | state, 72 | }; 73 | fetchMock.post( 74 | "https://api.dnsimple.com/v2/oauth/access_token", 75 | responseFromFixture("oauthAccessToken/success.http") 76 | ); 77 | 78 | await dnsimple.oauth.exchangeAuthorizationForToken({ 79 | code, 80 | clientId, 81 | clientSecret, 82 | state, 83 | redirectUri, 84 | }); 85 | 86 | expect(fetchMock.callHistory.lastCall().options.body).toEqual( 87 | JSON.stringify(expectedPayload) 88 | ); 89 | }); 90 | }); 91 | }); 92 | 93 | describe("#authorizeUrl", () => { 94 | it("builds the correct url", () => { 95 | const authorizeUrl = new URL( 96 | dnsimple.oauth.authorizeUrl({ 97 | clientId: "great-app", 98 | redirectUri, 99 | state, 100 | }) 101 | ); 102 | const expectedUrl = new URL( 103 | "https://dnsimple.com/oauth/authorize?client_id=great-app&redirect_uri=https://great-app.com/oauth&response_type=code&state=mysecretstate" 104 | ); 105 | 106 | const searchParamsToObj = (params: URLSearchParams) => { 107 | const obj: { [name: string]: any } = {}; 108 | params.forEach((val, key) => { 109 | obj[key] = val; 110 | }); 111 | return obj; 112 | }; 113 | 114 | expect(authorizeUrl.protocol).toBe(expectedUrl.protocol); 115 | expect(authorizeUrl.host).toBe(expectedUrl.host); 116 | expect(searchParamsToObj(authorizeUrl.searchParams)).toEqual( 117 | searchParamsToObj(expectedUrl.searchParams) 118 | ); 119 | }); 120 | }); 121 | }); 122 | -------------------------------------------------------------------------------- /test/registrar_auto_renewal.spec.ts: -------------------------------------------------------------------------------- 1 | import fetchMock from "fetch-mock"; 2 | import { NotFoundError } from "../lib/main"; 3 | import { createTestClient, responseFromFixture } from "./util"; 4 | 5 | const dnsimple = createTestClient(); 6 | 7 | describe("registrar auto renewal", () => { 8 | const accountId = 1010; 9 | const domainId = "example.com"; 10 | 11 | describe("#enableDomainAutoRenewal", () => { 12 | it("produces an empty result", async () => { 13 | fetchMock.put( 14 | "https://api.dnsimple.com/v2/1010/registrar/domains/example.com/auto_renewal", 15 | responseFromFixture("enableDomainAutoRenewal/success.http") 16 | ); 17 | 18 | const response = await dnsimple.registrar.enableDomainAutoRenewal( 19 | accountId, 20 | domainId 21 | ); 22 | 23 | expect(response).toEqual({}); 24 | }); 25 | 26 | describe("when the domain does not exist", () => { 27 | it("results in an error", async () => { 28 | fetchMock.put( 29 | "https://api.dnsimple.com/v2/1010/registrar/domains/example.com/auto_renewal", 30 | responseFromFixture("notfound-domain.http") 31 | ); 32 | 33 | await expect( 34 | dnsimple.registrar.enableDomainAutoRenewal(accountId, domainId) 35 | ).rejects.toThrow(NotFoundError); 36 | }); 37 | }); 38 | }); 39 | 40 | describe("#disableDomainAutoRenewal", () => { 41 | it("produces an empty result", async () => { 42 | fetchMock.delete( 43 | "https://api.dnsimple.com/v2/1010/registrar/domains/example.com/auto_renewal", 44 | responseFromFixture("disableDomainAutoRenewal/success.http") 45 | ); 46 | 47 | const response = await dnsimple.registrar.disableDomainAutoRenewal( 48 | accountId, 49 | domainId 50 | ); 51 | 52 | expect(response).toEqual({}); 53 | }); 54 | 55 | describe("when the domain does not exist", () => { 56 | it("results in an error", async () => { 57 | fetchMock.delete( 58 | "https://api.dnsimple.com/v2/1010/registrar/domains/example.com/auto_renewal", 59 | responseFromFixture("notfound-domain.http") 60 | ); 61 | 62 | await expect( 63 | dnsimple.registrar.disableDomainAutoRenewal(accountId, domainId) 64 | ).rejects.toThrow(NotFoundError); 65 | }); 66 | }); 67 | }); 68 | }); 69 | -------------------------------------------------------------------------------- /test/registrar_domain_delegation.spec.ts: -------------------------------------------------------------------------------- 1 | import fetchMock from "fetch-mock"; 2 | import { createTestClient, responseFromFixture } from "./util"; 3 | 4 | const dnsimple = createTestClient(); 5 | 6 | describe("domain delegation", () => { 7 | const accountId = 1010; 8 | const domainId = "example.com"; 9 | 10 | describe("#getDomainDelegation", () => { 11 | it("produces a name server list", async () => { 12 | fetchMock.get( 13 | "https://api.dnsimple.com/v2/1010/registrar/domains/example.com/delegation", 14 | responseFromFixture("getDomainDelegation/success.http") 15 | ); 16 | 17 | const response = await dnsimple.registrar.getDomainDelegation( 18 | accountId, 19 | domainId 20 | ); 21 | 22 | expect(response.data).toEqual([ 23 | "ns1.dnsimple.com", 24 | "ns2.dnsimple.com", 25 | "ns3.dnsimple.com", 26 | "ns4.dnsimple.com", 27 | ]); 28 | }); 29 | }); 30 | 31 | describe("#changeDomainDelegation", () => { 32 | const attributes = [ 33 | "ns1.dnsimple.com", 34 | "ns2.dnsimple.com", 35 | "ns3.dnsimple.com", 36 | "ns4.dnsimple.com", 37 | ]; 38 | 39 | it("produces a name server list", async () => { 40 | fetchMock.put( 41 | "https://api.dnsimple.com/v2/1010/registrar/domains/example.com/delegation", 42 | responseFromFixture("changeDomainDelegation/success.http") 43 | ); 44 | 45 | const response = await dnsimple.registrar.changeDomainDelegation( 46 | accountId, 47 | domainId, 48 | attributes 49 | ); 50 | 51 | expect(response.data).toEqual([ 52 | "ns1.dnsimple.com", 53 | "ns2.dnsimple.com", 54 | "ns3.dnsimple.com", 55 | "ns4.dnsimple.com", 56 | ]); 57 | }); 58 | }); 59 | 60 | describe("#changeDomainDelegationToVanity", () => { 61 | const attributes = ["ns1.example.com", "ns2.example.com"]; 62 | 63 | it("produces a name server list", async () => { 64 | fetchMock.put( 65 | "https://api.dnsimple.com/v2/1010/registrar/domains/example.com/delegation/vanity", 66 | responseFromFixture("changeDomainDelegationToVanity/success.http") 67 | ); 68 | 69 | const response = await dnsimple.registrar.changeDomainDelegationToVanity( 70 | accountId, 71 | domainId, 72 | attributes 73 | ); 74 | 75 | expect(response.data.length).toBe(2); 76 | }); 77 | }); 78 | 79 | describe("#changeDomainDelegationFromVanity", () => { 80 | it("produces nothing", async () => { 81 | fetchMock.delete( 82 | "https://api.dnsimple.com/v2/1010/registrar/domains/example.com/delegation/vanity", 83 | responseFromFixture("changeDomainDelegationFromVanity/success.http") 84 | ); 85 | 86 | const response = 87 | await dnsimple.registrar.changeDomainDelegationFromVanity( 88 | accountId, 89 | domainId 90 | ); 91 | 92 | expect(response).toEqual({}); 93 | }); 94 | }); 95 | }); 96 | -------------------------------------------------------------------------------- /test/registrar_domain_transfer_lock.spec.ts: -------------------------------------------------------------------------------- 1 | import fetchMock from "fetch-mock"; 2 | import { createTestClient, responseFromFixture } from "./util"; 3 | 4 | const dnsimple = createTestClient(); 5 | 6 | describe("domain transfer lock", () => { 7 | const accountId = 1010; 8 | 9 | describe("#getDomainTransferLock", () => { 10 | it("produces a transfer lock", async () => { 11 | fetchMock.get( 12 | "https://api.dnsimple.com/v2/1010/registrar/domains/101/transfer_lock", 13 | responseFromFixture("getDomainTransferLock/success.http") 14 | ); 15 | 16 | const response = await dnsimple.registrar.getDomainTransferLock( 17 | accountId, 18 | "101" 19 | ); 20 | 21 | expect(response.data).toEqual({ 22 | enabled: true, 23 | }); 24 | }); 25 | }); 26 | 27 | describe("#enableDomainTransferLock", () => { 28 | it("produces a transfer lock", async () => { 29 | fetchMock.post( 30 | "https://api.dnsimple.com/v2/1010/registrar/domains/101/transfer_lock", 31 | responseFromFixture("enableDomainTransferLock/success.http") 32 | ); 33 | 34 | const response = await dnsimple.registrar.enableDomainTransferLock( 35 | accountId, 36 | "101" 37 | ); 38 | 39 | expect(response.data).toEqual({ 40 | enabled: true, 41 | }); 42 | }); 43 | }); 44 | 45 | describe("#disableDomainTransferLock", () => { 46 | it("produces a transfer lock", async () => { 47 | fetchMock.delete( 48 | "https://api.dnsimple.com/v2/1010/registrar/domains/101/transfer_lock", 49 | responseFromFixture("disableDomainTransferLock/success.http") 50 | ); 51 | 52 | const response = await dnsimple.registrar.disableDomainTransferLock( 53 | accountId, 54 | "101" 55 | ); 56 | 57 | expect(response.data).toEqual({ 58 | enabled: false, 59 | }); 60 | }); 61 | }); 62 | }); 63 | -------------------------------------------------------------------------------- /test/registrar_registrant.spec.ts: -------------------------------------------------------------------------------- 1 | import fetchMock from "fetch-mock"; 2 | import { createTestClient, responseFromFixture } from "./util"; 3 | 4 | const dnsimple = createTestClient(); 5 | 6 | describe("registrant", () => { 7 | const accountId = 1010; 8 | 9 | describe("#checkRegistrantChange", () => { 10 | it("produces a registrant change", async () => { 11 | fetchMock.post( 12 | "https://api.dnsimple.com/v2/1010/registrar/registrant_changes/check", 13 | responseFromFixture("checkRegistrantChange/success.http") 14 | ); 15 | 16 | const response = await dnsimple.registrar.checkRegistrantChange( 17 | accountId, 18 | { 19 | contact_id: 101, 20 | domain_id: 101, 21 | } 22 | ); 23 | 24 | const data = response.data; 25 | expect(data.domain_id).toBe(101); 26 | expect(data.contact_id).toBe(101); 27 | expect(data.extended_attributes).toEqual([]); 28 | expect(data.registry_owner_change).toBe(true); 29 | }); 30 | }); 31 | 32 | describe("#createRegistrantChange", () => { 33 | it("produces a registrant change", async () => { 34 | fetchMock.post( 35 | "https://api.dnsimple.com/v2/1010/registrar/registrant_changes", 36 | responseFromFixture("createRegistrantChange/success.http") 37 | ); 38 | 39 | const response = await dnsimple.registrar.createRegistrantChange( 40 | accountId, 41 | { 42 | contact_id: 101, 43 | domain_id: 101, 44 | extended_attributes: {}, 45 | } 46 | ); 47 | 48 | const data = response.data; 49 | expect(data.id).toBe(101); 50 | expect(data.account_id).toBe(101); 51 | expect(data.domain_id).toBe(101); 52 | expect(data.contact_id).toBe(101); 53 | expect(data.state).toBe("new"); 54 | expect(data.extended_attributes).toEqual({}); 55 | expect(data.registry_owner_change).toBe(true); 56 | expect(data.irt_lock_lifted_by).toBe(null); 57 | expect(data.created_at).toBe("2017-02-03T17:43:22Z"); 58 | expect(data.created_at).toBe("2017-02-03T17:43:22Z"); 59 | }); 60 | }); 61 | 62 | describe("#deleteRegistrantChange", () => { 63 | it("deletes the registrant change", async () => { 64 | fetchMock.delete( 65 | "https://api.dnsimple.com/v2/1010/registrar/registrant_changes/101", 66 | responseFromFixture("deleteRegistrantChange/success.http") 67 | ); 68 | 69 | await dnsimple.registrar.deleteRegistrantChange(accountId, 101); 70 | 71 | expect(fetchMock.callHistory.called()).toBe(true); 72 | }); 73 | }); 74 | 75 | describe("#getRegistrantChange", () => { 76 | it("returns the registrant change", async () => { 77 | fetchMock.get( 78 | "https://api.dnsimple.com/v2/1010/registrar/registrant_changes/101", 79 | responseFromFixture("getRegistrantChange/success.http") 80 | ); 81 | 82 | const response = await dnsimple.registrar.getRegistrantChange( 83 | accountId, 84 | 101 85 | ); 86 | 87 | expect(response.data).toEqual({ 88 | id: 101, 89 | account_id: 101, 90 | domain_id: 101, 91 | contact_id: 101, 92 | state: "new", 93 | extended_attributes: {}, 94 | registry_owner_change: true, 95 | irt_lock_lifted_by: null, 96 | created_at: "2017-02-03T17:43:22Z", 97 | updated_at: "2017-02-03T17:43:22Z", 98 | }); 99 | }); 100 | }); 101 | }); 102 | -------------------------------------------------------------------------------- /test/registrar_whois_privacy.spec.ts: -------------------------------------------------------------------------------- 1 | import fetchMock from "fetch-mock"; 2 | import { createTestClient, responseFromFixture } from "./util"; 3 | 4 | const dnsimple = createTestClient(); 5 | 6 | describe("whois privacy", () => { 7 | const accountId = 1010; 8 | const domainId = "example.com"; 9 | 10 | describe("#getWhoisPrivacy", () => { 11 | it("produces a whois privacy", async () => { 12 | fetchMock.get( 13 | "https://api.dnsimple.com/v2/1010/registrar/domains/example.com/whois_privacy", 14 | responseFromFixture("getWhoisPrivacy/success.http") 15 | ); 16 | 17 | const response = await dnsimple.registrar.getWhoisPrivacy( 18 | accountId, 19 | domainId 20 | ); 21 | 22 | const whoisPrivacy = response.data; 23 | expect(whoisPrivacy.id).toBe(1); 24 | expect(whoisPrivacy.domain_id).toBe(2); 25 | expect(whoisPrivacy.expires_on).toBe("2017-02-13"); 26 | expect(whoisPrivacy.enabled).toBe(true); 27 | expect(whoisPrivacy.created_at).toBe("2016-02-13T14:34:50Z"); 28 | expect(whoisPrivacy.updated_at).toBe("2016-02-13T14:34:52Z"); 29 | }); 30 | }); 31 | 32 | describe("#enableWhoisPrivacy", () => { 33 | describe("when whois privacy is already purchased", () => { 34 | it("produces a whois privacy", async () => { 35 | fetchMock.put( 36 | "https://api.dnsimple.com/v2/1010/registrar/domains/example.com/whois_privacy", 37 | responseFromFixture("enableWhoisPrivacy/success.http") 38 | ); 39 | 40 | const response = await dnsimple.registrar.enableWhoisPrivacy( 41 | accountId, 42 | domainId 43 | ); 44 | 45 | const whoisPrivacy = response.data; 46 | expect(whoisPrivacy.id).toBe(1); 47 | expect(whoisPrivacy.domain_id).toBe(2); 48 | }); 49 | }); 50 | 51 | describe("when whois privacy is newly purchased", () => { 52 | it("produces a whois privacy", async () => { 53 | fetchMock.put( 54 | "https://api.dnsimple.com/v2/1010/registrar/domains/example.com/whois_privacy", 55 | responseFromFixture("enableWhoisPrivacy/created.http") 56 | ); 57 | 58 | const response = await dnsimple.registrar.enableWhoisPrivacy( 59 | accountId, 60 | domainId 61 | ); 62 | 63 | const whoisPrivacy = response.data; 64 | expect(whoisPrivacy.id).toBe(1); 65 | expect(whoisPrivacy.domain_id).toBe(2); 66 | }); 67 | }); 68 | }); 69 | 70 | describe("#disableWhoisPrivacy", () => { 71 | it("produces a whois privacy", async () => { 72 | fetchMock.delete( 73 | "https://api.dnsimple.com/v2/1010/registrar/domains/example.com/whois_privacy", 74 | responseFromFixture("disableWhoisPrivacy/success.http") 75 | ); 76 | 77 | const response = await dnsimple.registrar.disableWhoisPrivacy( 78 | accountId, 79 | domainId 80 | ); 81 | 82 | const whoisPrivacy = response.data; 83 | expect(whoisPrivacy.id).toBe(1); 84 | expect(whoisPrivacy.domain_id).toBe(2); 85 | }); 86 | }); 87 | 88 | describe("#renewWhoisPrivacy", () => { 89 | it("produces a whois privacy renewal", async () => { 90 | fetchMock.post( 91 | "https://api.dnsimple.com/v2/1010/registrar/domains/example.com/whois_privacy/renewals", 92 | responseFromFixture("renewWhoisPrivacy/success.http") 93 | ); 94 | 95 | const response = await dnsimple.registrar.renewWhoisPrivacy( 96 | accountId, 97 | domainId 98 | ); 99 | 100 | const whoisPrivacyRenewal = response.data; 101 | expect(whoisPrivacyRenewal.id).toBe(1); 102 | expect(whoisPrivacyRenewal.domain_id).toBe(100); 103 | expect(whoisPrivacyRenewal.whois_privacy_id).toBe(999); 104 | expect(whoisPrivacyRenewal.state).toBe("new"); 105 | expect(whoisPrivacyRenewal.enabled).toBe(true); 106 | }); 107 | }); 108 | }); 109 | -------------------------------------------------------------------------------- /test/services.spec.ts: -------------------------------------------------------------------------------- 1 | import fetchMock from "fetch-mock"; 2 | import { createTestClient, responseFromFixture } from "./util"; 3 | 4 | const dnsimple = createTestClient(); 5 | 6 | describe("services", () => { 7 | describe("#listServices", () => { 8 | it("supports pagination", async () => { 9 | fetchMock.get( 10 | "https://api.dnsimple.com/v2/services?page=1", 11 | responseFromFixture("listServices/success.http") 12 | ); 13 | 14 | await dnsimple.services.listServices({ page: 1 }); 15 | 16 | expect(fetchMock.callHistory.called()).toBe(true); 17 | }); 18 | 19 | it("supports extra request options", async () => { 20 | fetchMock.get( 21 | "https://api.dnsimple.com/v2/services?foo=bar", 22 | responseFromFixture("listServices/success.http") 23 | ); 24 | 25 | await dnsimple.services.listServices({ foo: "bar" }); 26 | 27 | expect(fetchMock.callHistory.called()).toBe(true); 28 | }); 29 | 30 | it("supports sorting", async () => { 31 | fetchMock.get( 32 | "https://api.dnsimple.com/v2/services?sort=sid%3Aasc", 33 | responseFromFixture("listServices/success.http") 34 | ); 35 | 36 | await dnsimple.services.listServices({ sort: "sid:asc" }); 37 | 38 | expect(fetchMock.callHistory.called()).toBe(true); 39 | }); 40 | 41 | it("produces a service list", async () => { 42 | fetchMock.get( 43 | "https://api.dnsimple.com/v2/services", 44 | responseFromFixture("listServices/success.http") 45 | ); 46 | 47 | const response = await dnsimple.services.listServices(); 48 | 49 | const services = response.data; 50 | expect(services.length).toBe(2); 51 | expect(services[0].name).toBe("Service 1"); 52 | expect(services[0].sid).toBe("service1"); 53 | }); 54 | 55 | it("exposes the pagination info", async () => { 56 | fetchMock.get( 57 | "https://api.dnsimple.com/v2/services", 58 | responseFromFixture("listServices/success.http") 59 | ); 60 | 61 | const response = await dnsimple.services.listServices(); 62 | 63 | const pagination = response.pagination; 64 | expect(pagination).not.toBe(null); 65 | expect(pagination.current_page).toBe(1); 66 | }); 67 | }); 68 | 69 | describe("#listServices.collectAll", () => { 70 | it("produces a complete list", async () => { 71 | fetchMock.get( 72 | "https://api.dnsimple.com/v2/services?page=1", 73 | responseFromFixture("pages-1of3.http") 74 | ); 75 | 76 | fetchMock.get( 77 | "https://api.dnsimple.com/v2/services?page=2", 78 | responseFromFixture("pages-2of3.http") 79 | ); 80 | 81 | fetchMock.get( 82 | "https://api.dnsimple.com/v2/services?page=3", 83 | responseFromFixture("pages-3of3.http") 84 | ); 85 | 86 | const items = await dnsimple.services.listServices.collectAll(); 87 | 88 | expect(items.length).toBe(5); 89 | expect(items[0].id).toBe(1); 90 | expect(items[4].id).toBe(5); 91 | }); 92 | }); 93 | 94 | describe("#getService", () => { 95 | const serviceId = "1"; 96 | 97 | it("produces a service", async () => { 98 | fetchMock.get( 99 | "https://api.dnsimple.com/v2/services/1", 100 | responseFromFixture("getService/success.http") 101 | ); 102 | 103 | const response = await dnsimple.services.getService(serviceId); 104 | 105 | expect(response.data.id).toBe(1); 106 | }); 107 | }); 108 | }); 109 | -------------------------------------------------------------------------------- /test/util.ts: -------------------------------------------------------------------------------- 1 | import { readFileSync } from "fs"; 2 | import fetchFetcher from "../lib/fetcher/fetch-fetcher"; 3 | import { DNSimple } from "../lib/main"; 4 | 5 | function hasJsonContent(lines: string[]) { 6 | for (let line of lines) { 7 | const [key, value] = line.split(/:\s/); 8 | if ( 9 | key.toLowerCase() === "content-type" && 10 | value.includes("application/json") 11 | ) 12 | return true; 13 | } 14 | return false; 15 | } 16 | 17 | function parseStatusCode(lines: string[]) { 18 | return parseInt(lines[0].split(/\s+/)[1], 10); 19 | } 20 | 21 | function parseBody(lines: string[]) { 22 | const separatorLineIndex = lines.findIndex((line) => line.trim() === ""); 23 | 24 | const rawBody = lines 25 | .slice(separatorLineIndex + 1) 26 | .join("\n") 27 | .trim(); 28 | 29 | if (hasJsonContent(lines) && rawBody !== "") return JSON.parse(rawBody); 30 | 31 | return rawBody; 32 | } 33 | 34 | export function createTestClient() { 35 | return new DNSimple({ 36 | accessToken: process.env["TOKEN"] ?? "bogus", 37 | fetcher: fetchFetcher, 38 | }); 39 | } 40 | 41 | export function responseFromFixture(path: string): { 42 | status: number; 43 | body?: string[]; 44 | } { 45 | const data = readFileSync(`${__dirname}/fixtures.http/${path}`, "utf-8"); 46 | const lines = data.split(/\r?\n/); 47 | 48 | const status = parseStatusCode(lines); 49 | if (status === 204) return { status: 204 }; 50 | 51 | return { status: status, body: parseBody(lines) }; 52 | } 53 | -------------------------------------------------------------------------------- /test/vanity_name_servers.spec.ts: -------------------------------------------------------------------------------- 1 | import fetchMock from "fetch-mock"; 2 | import { createTestClient, responseFromFixture } from "./util"; 3 | 4 | const dnsimple = createTestClient(); 5 | 6 | describe("vanity name servers", () => { 7 | const accountId = 1010; 8 | const domainId = "example.com"; 9 | 10 | describe("#enableVanityNameServers", () => { 11 | it("produces a list of name servers", async () => { 12 | fetchMock.put( 13 | "https://api.dnsimple.com/v2/1010/vanity/example.com", 14 | responseFromFixture("enableVanityNameServers/success.http") 15 | ); 16 | 17 | const response = await dnsimple.vanityNameServers.enableVanityNameServers( 18 | accountId, 19 | domainId 20 | ); 21 | 22 | const vanityNameServers = response.data; 23 | expect(vanityNameServers.length).toBe(4); 24 | expect(vanityNameServers[0].id).toBe(1); 25 | expect(vanityNameServers[0].ipv4).toBe("127.0.0.1"); 26 | expect(vanityNameServers[0].ipv6).toBe("::1"); 27 | expect(vanityNameServers[0].created_at).toBe("2016-07-14T13:22:17Z"); 28 | expect(vanityNameServers[0].updated_at).toBe("2016-07-14T13:22:17Z"); 29 | }); 30 | }); 31 | 32 | describe("#disableVanityNameServers", () => { 33 | it("produces nothing", async () => { 34 | fetchMock.delete( 35 | "https://api.dnsimple.com/v2/1010/vanity/example.com", 36 | responseFromFixture("disableVanityNameServers/success.http") 37 | ); 38 | 39 | const response = 40 | await dnsimple.vanityNameServers.disableVanityNameServers( 41 | accountId, 42 | domainId 43 | ); 44 | 45 | expect(response).toEqual({}); 46 | }); 47 | }); 48 | }); 49 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "include": ["lib/**/*.ts"], 3 | "exclude": ["**/*.spec.ts"], 4 | "compilerOptions": { 5 | "allowJs": false, 6 | "allowSyntheticDefaultImports": false, 7 | "alwaysStrict": true, 8 | "declaration": true, 9 | "esModuleInterop": false, 10 | "exactOptionalPropertyTypes": false, 11 | "forceConsistentCasingInFileNames": true, 12 | "isolatedModules": true, 13 | "lib": ["ESNext", "DOM"], 14 | "module": "CommonJS", 15 | "noFallthroughCasesInSwitch": true, 16 | "noImplicitAny": true, 17 | "noImplicitOverride": true, 18 | "noImplicitReturns": true, 19 | "noImplicitThis": true, 20 | "noPropertyAccessFromIndexSignature": true, 21 | "noUncheckedIndexedAccess": false, 22 | "noUnusedLocals": true, 23 | "noUnusedParameters": false, 24 | "outDir": "dist", 25 | "resolveJsonModule": true, 26 | "strict": true, 27 | "target": "ES6", 28 | "useUnknownInCatchVariables": false 29 | } 30 | } 31 | --------------------------------------------------------------------------------