1.10.0 • Published 10 months ago

testing-farm v1.10.0

Weekly downloads
-
License
GPLv3
Repository
github
Last release
10 months ago

Testing Farm

npm version Tests Linters CodeQL codecov

Typesafe access to Testing Farm's REST API.

API

Creating the API instance

import TestingFarmAPI from "testing-farm";

const api = new TestingFarmAPI("https://api.dev.testing-farm.io/v0.1", "api-key");

// Passing api key in data - not recommended
const api = new TestingFarmAPI("https://api.dev.testing-farm.io/v0.1");

await api.about();

!WARNING

Passing the API key in request body is deprecated and not recommended. It is better to pass it in the constructor. This way the API key will be passed in the request header as part of Authorization header.

List a Test Requests

documentation of - GET /requests

const queryParams = { /* https://api.dev.testing-farm.io/redoc#operation/get_test_requests_v0_1_requests_get */ }

const requests: Requests[] = await api.requests(queryParams);
const requests: unknown = await api.requests(queryParams, false);

Request a New Test

documentation of - POST /requests

const request = { /* https://api.dev.testing-farm.io/redoc#operation/request_a_new_test_v0_1_requests_post */ }

const response: NewRequestResponse = await api.newRequest(request);
const response: unknown = await api.newRequest(request, false);
const response: unknown = await api.unsafeNewRequest(request /* unknown type */);

Test Request Details

documentation of - GET /requests/{request_id}

const details: Request = await api.requestDetails('test-id');
const details: unknown = await api.requestDetails('test-id', false);

Cancel a Test Request

documentation of - DELETE /requests/{request_id}

const response: CancelRequestResponse = await cancelRequest('test-id');
const response: unknown = await cancelRequest('test-id', false);

Composes Public Ranch

documentation of - GET /composes

const composes: Composes = await api.composes();
const composes: unknown = await api.composes(false);

Composes

documentation of - GET /composes/{ranch}

const composes: Composes = await api.ranchComposes('public');
const composes: unknown = await api.ranchComposes('public', false);

About Testing Farm

documentation of - GET /about

const about: About = await api.about();
const about: unknown = await api.about(false);
1.9.2

10 months ago

1.10.0

10 months ago

1.9.1

1 year ago

1.9.0

1 year ago

1.8.0

1 year ago

1.7.0

1 year ago

1.6.3

1 year ago

1.6.2

1 year ago

1.6.1

1 year ago

1.6.0

1 year ago

1.5.1

2 years ago

1.5.0

2 years ago

1.4.2

2 years ago

1.4.1

2 years ago

1.4.0

2 years ago

1.3.2

2 years ago

1.2.3

2 years ago

1.2.2

2 years ago

1.2.1

2 years ago

1.2.0

2 years ago

1.1.0

2 years ago

1.0.0

2 years ago

0.1.0

2 years ago