Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions dist/api/APIListScreenshots.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { Screenshot } from './models/Screenshot';
import { CollectionBasicQueryParams, NoData } from './models/HTTP';
import APIList from './APIList';
import APIResourceDeviceSessionCommon from './APIResourceDeviceSessionCommon';
export declare class APIListScreenshots extends APIList<Screenshot, CollectionBasicQueryParams, NoData> {
constructor(parent: APIResourceDeviceSessionCommon);
}
export default APIListScreenshots;
9 changes: 9 additions & 0 deletions dist/api/APIListTestCaseRuns.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { SessionQueryParams } from './models/DeviceSession';
import { NoData, NoQueryParams } from './models/HTTP';
import APIList from './APIList';
import APIResourceDeviceSessionCommon from './APIResourceDeviceSessionCommon';
import { TestCaseRun } from './models/TestCaseRun';
export declare class APIListTestCaseRuns extends APIList<TestCaseRun, SessionQueryParams | NoQueryParams, NoData> {
constructor(parent: APIResourceDeviceSessionCommon);
}
export default APIListTestCaseRuns;
8 changes: 8 additions & 0 deletions dist/api/APIListTestRunDeviceSessions.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { DeviceSession } from './models/DeviceSession';
import { CollectionBasicQueryParams, NoData } from './models/HTTP';
import APIList from './APIList';
import APIResourceRunCommon from './APIResourceRunCommon';
export declare class APIListTestRunDeviceSessions extends APIList<DeviceSession, CollectionBasicQueryParams, NoData> {
constructor(parent: APIResourceRunCommon);
}
export default APIListTestRunDeviceSessions;
10 changes: 5 additions & 5 deletions dist/api/APIResourceDeviceSessionCommon.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@ import { APIResource } from './APIResource';
import { InputFileset } from './class/InputFileset';
import { OutputFileset } from './class/OutputFileset';
import { DeviceSessionCommon } from './interface/DeviceSessionCommon';
import { DeviceSession, DeviceSessionCommand, DeviceSessionStep, SessionQueryParams, SessionRunStepQueryParams, SessionStepQueryParams } from './models/DeviceSession';
import { DeviceSession, DeviceSessionCommand, DeviceSessionStep, SessionRunStepQueryParams, SessionStepQueryParams } from './models/DeviceSession';
import { CollectionBasicQueryParams, NoQueryParams } from './models/HTTP';
import { Screenshot } from './models/Screenshot';
import { TestCaseRun } from './models/TestCaseRun';
import APIListScreenshots from './APIListScreenshots';
import APIListTestCaseRuns from './APIListTestCaseRuns';
export declare class APIResourceDeviceSessionCommon extends APIResource<DeviceSession> implements DeviceSessionCommon {
constructor(parent: APIEntity<any> | API, id: number);
commands(): APIList<DeviceSessionCommand, import("./models/HTTP").CollectionQueryParams, any>;
input(): InputFileset;
output(): OutputFileset;
release(): APIResource<DeviceSession, NoQueryParams, void>;
screenshots(): APIList<Screenshot, SessionQueryParams | SessionRunStepQueryParams | SessionStepQueryParams, void>;
screenshots(): APIListScreenshots;
screenshot(id: number): APIResource<any, import("./models/HTTP").QueryParams, import("./models/HTTP").QueryParams>;
steps(): APIList<DeviceSessionStep, SessionRunStepQueryParams | SessionStepQueryParams | CollectionBasicQueryParams, void>;
step(id: number | 'current'): APIResource<DeviceSessionStep, NoQueryParams, void>;
currentStep(): APIResource<DeviceSessionStep, NoQueryParams, void>;
testCaseRuns(): APIList<TestCaseRun, SessionQueryParams | NoQueryParams, void>;
testCaseRuns(): APIListTestCaseRuns;
connections(): APIList<any, import("./models/HTTP").CollectionQueryParams, any>;
logs(): APIResource<any, import("./models/HTTP").QueryParams, import("./models/HTTP").QueryParams>;
clusterLogs(): APIResource<any, import("./models/HTTP").QueryParams, import("./models/HTTP").QueryParams>;
Expand Down
5 changes: 3 additions & 2 deletions dist/api/APIResourceRunCommon.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,18 @@ import { APIEntity } from './APIEntity';
import { APIList } from './APIList';
import { APIResource } from './APIResource';
import { AdminTestRun } from './models/AdminTestRun';
import { DeviceSession, DeviceSessionStep, TestRunDeviceSessionQueryParams } from './models/DeviceSession';
import { DeviceSessionStep } from './models/DeviceSession';
import { CollectionBasicQueryParams, NoQueryParams } from './models/HTTP';
import { RunData, RunQueryParam, TestRun, TestRunData } from './models/TestRun';
import { TestRunDataAvailability, TestRunDataAvailabilityQueryParams } from './models/TestRunDataAvailability';
import { UserFile } from './models/UserFile';
import APIListTestRunDeviceSessions from './APIListTestRunDeviceSessions';
export declare class APIResourceRunCommon extends APIResource<TestRun, RunQueryParam, TestRunData | RunData> {
constructor(parent: APIEntity<any> | API, id: number);
abort(): APIResource<TestRun | AdminTestRun, NoQueryParams, RunData>;
buildLogsZip(ids?: Array<number>): APIResource<UserFile, import("./models/UserFile").BuildLogsData, import("./models/UserFile").BuildLogsData>;
dataAvailability(): APIResource<TestRunDataAvailability, TestRunDataAvailabilityQueryParams, void>;
deviceSessions(): APIList<DeviceSession, CollectionBasicQueryParams | TestRunDeviceSessionQueryParams, void>;
deviceSessions(): APIListTestRunDeviceSessions;
filesZip(ids?: Array<number>): APIResource<UserFile, import("./models/UserFile").BuildLogsData, import("./models/UserFile").BuildLogsData>;
logsZip(ids?: Array<number>): APIResource<UserFile, import("./models/UserFile").BuildLogsData, import("./models/UserFile").BuildLogsData>;
performanceZip(ids?: Array<number>): APIResource<UserFile, import("./models/UserFile").BuildLogsData, import("./models/UserFile").BuildLogsData>;
Expand Down
4 changes: 4 additions & 0 deletions dist/api/lists.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { APIListCleanupConfigurations as OriginAPIListCleanupConfigurations } fr
import { APIListDevices as OriginAPIListDevices } from './APIListDevices';
import { APIListFiles as OriginAPIListFiles } from './APIListFiles';
import { APIListOutputFiles as OriginAPIListOutputFiles } from './APIListOutputFiles';
import { APIListScreenshots as OriginAPIListScreenshots } from './APIListScreenshots';
import { APIListTestRunDeviceSessions as OriginAPIListTestRunDeviceSessions } from './APIListTestRunDeviceSessions';
import { APIListNotifications as OriginAPIListNotifications } from './APIListNotifications';
import { APIListProperties as OriginAPIListProperties } from './APIListProperties';
import { APIListRuns as OriginAPIListRuns } from './APIListRuns';
Expand All @@ -14,6 +16,8 @@ export type APIListCleanupConfigurations = InstanceType<typeof OriginAPIListClea
export type APIListDevices = InstanceType<typeof OriginAPIListDevices>;
export type APIListFiles = InstanceType<typeof OriginAPIListFiles>;
export type APIListOutputFiles = InstanceType<typeof OriginAPIListOutputFiles>;
export type APIListScreenshots = InstanceType<typeof OriginAPIListScreenshots>;
export type APIListTestRunDeviceSessions = InstanceType<typeof OriginAPIListTestRunDeviceSessions>;
export type APIListNotifications = InstanceType<typeof OriginAPIListNotifications>;
export type APIListProperties = InstanceType<typeof OriginAPIListProperties>;
export type APIListRuns = InstanceType<typeof OriginAPIListRuns>;
Expand Down
3 changes: 0 additions & 3 deletions dist/api/models/DeviceSession.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,6 @@ export interface SessionRunStepQueryParams extends CollectionBasicQueryParams {
export interface SessionStepQueryParams extends SessionRunStepQueryParams {
projectId: number;
}
export interface TestRunDeviceSessionQueryParams extends CollectionBasicQueryParams {
projectId: number;
}
export declare enum SessionReleaseReason {
INACTIVITY = "INACTIVITY",
TIMEOUT = "TIMEOUT",
Expand Down
31 changes: 26 additions & 5 deletions dist/bitbar-cloud-api-client.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/bitbar-cloud-api-client.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/bitbar-cloud-api-client.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/bitbar-cloud-api-client.min.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bitbar/cloud-api-client",
"version": "1.5.13",
"version": "1.5.14",
"description": "Bitbar Cloud API Client for JavaScript",
"main": "dist/bitbar-cloud-api-client.min.js",
"types": "dist/index.d.ts",
Expand Down
32 changes: 32 additions & 0 deletions src/api/APIListScreenshots.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import API from '../API';
import APIListScreenshots from './APIListScreenshots';
import APIList from './APIList';
import APIResourceDeviceSessionCommon from './APIResourceDeviceSessionCommon';


describe('APIListScreenshots', () => {
const cloudUrl = 'https://cloud.bitbar.com';
let api: API;
let service: APIListScreenshots;
let resourceDeviceSessionCommon: APIResourceDeviceSessionCommon;
const baseId = 1;

beforeEach(() => {
api = new API({
baseURL: '',
cloudUrl
});
resourceDeviceSessionCommon = new APIResourceDeviceSessionCommon(api, baseId);
service = new APIListScreenshots(resourceDeviceSessionCommon);
});

describe('Instance', () => {
it('Is created properly', () => {
expect(service).toBeDefined();
expect(service).toBeInstanceOf(APIList);
expect(service.root).toBeDefined();
expect(service.root).toBeInstanceOf(API);
expect(service.last).toEqual('screenshots');
});
});
});
18 changes: 18 additions & 0 deletions src/api/APIListScreenshots.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import {Screenshot} from './models/Screenshot';
import {CollectionBasicQueryParams, NoData} from './models/HTTP';
import APIList from './APIList';
import APIResourceDeviceSessionCommon from './APIResourceDeviceSessionCommon';


export class APIListScreenshots extends APIList<Screenshot, CollectionBasicQueryParams, NoData> {

/**
* screenshots
*/
constructor(parent: APIResourceDeviceSessionCommon) {
super(parent);
this.push('screenshots');
}
}

export default APIListScreenshots
32 changes: 32 additions & 0 deletions src/api/APIListTestCaseRuns.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import API from '../API';
import APIList from './APIList';
import APIListTestCaseRuns from './APIListTestCaseRuns';
import APIResourceDeviceSessionCommon from './APIResourceDeviceSessionCommon';


describe('APIListTestCaseRuns', () => {
const cloudUrl = 'https://cloud.bitbar.com';
let api: API;
let service: APIListTestCaseRuns;
let resourceDeviceSessionCommon: APIResourceDeviceSessionCommon;
const baseId = 1;

beforeEach(() => {
api = new API({
baseURL: '',
cloudUrl
});
resourceDeviceSessionCommon = new APIResourceDeviceSessionCommon(api, baseId);
service = new APIListTestCaseRuns(resourceDeviceSessionCommon);
});

describe('Instance', () => {
it('Is created properly', () => {
expect(service).toBeDefined();
expect(service).toBeInstanceOf(APIList);
expect(service.root).toBeDefined();
expect(service.root).toBeInstanceOf(API);
expect(service.last).toEqual('test-case-runs');
});
});
});
19 changes: 19 additions & 0 deletions src/api/APIListTestCaseRuns.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import {SessionQueryParams} from './models/DeviceSession';
import {NoData, NoQueryParams} from './models/HTTP';
import APIList from './APIList';
import APIResourceDeviceSessionCommon from './APIResourceDeviceSessionCommon';
import {TestCaseRun} from './models/TestCaseRun';


export class APIListTestCaseRuns extends APIList<TestCaseRun, SessionQueryParams | NoQueryParams, NoData> {

/**
* /test-case-runs
*/
constructor(parent: APIResourceDeviceSessionCommon) {
super(parent);
this.push('test-case-runs');
}
}

export default APIListTestCaseRuns
26 changes: 26 additions & 0 deletions src/api/APIListTestRunDeviceSessions.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import APIListTestRunDeviceSessions from './APIListTestRunDeviceSessions';
import API from '../API';
import APIResourceRunCommon from './APIResourceRunCommon';


describe('APIListTestRunDeviceSessions', () => {
const cloudUrl = 'https://cloud.bitbar.com';
let service: APIListTestRunDeviceSessions;
let api: API;
const baseId = 1;
const baseUrl = `/runs/${baseId}`;

beforeEach(() => {
api = new API({
baseURL: '',
cloudUrl
});
const parent = new APIResourceRunCommon(api, baseId);

service = new APIListTestRunDeviceSessions(parent);
});

it('should initialize proper endpoint path', () => {
expect(service.toUrl()).toEqual(`${baseUrl}/device-sessions`);
});
});
18 changes: 18 additions & 0 deletions src/api/APIListTestRunDeviceSessions.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import {DeviceSession} from './models/DeviceSession';
import {CollectionBasicQueryParams, NoData} from './models/HTTP';
import APIList from './APIList';
import APIResourceRunCommon from './APIResourceRunCommon';


export class APIListTestRunDeviceSessions extends APIList<DeviceSession, CollectionBasicQueryParams, NoData> {

/**
* device-sessions
*/
constructor(parent: APIResourceRunCommon) {
super(parent);
this.push('device-sessions');
}
}

export default APIListTestRunDeviceSessions
9 changes: 4 additions & 5 deletions src/api/APIResourceDeviceSessionCommon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@ import {
DeviceSession,
DeviceSessionCommand,
DeviceSessionStep,
SessionQueryParams,
SessionRunStepQueryParams,
SessionStepQueryParams
} from './models/DeviceSession';
import {CollectionBasicQueryParams, NoData, NoQueryParams} from './models/HTTP';
import {Screenshot} from './models/Screenshot';
import {TestCaseRun} from './models/TestCaseRun';
import APIListScreenshots from './APIListScreenshots';
import APIListTestCaseRuns from './APIListTestCaseRuns';

export class APIResourceDeviceSessionCommon extends APIResource<DeviceSession> implements DeviceSessionCommon {

Expand Down Expand Up @@ -53,7 +52,7 @@ export class APIResourceDeviceSessionCommon extends APIResource<DeviceSession> i

// /device-sessions/{id}/screenshots
screenshots() {
return new APIList<Screenshot, SessionQueryParams | SessionRunStepQueryParams | SessionStepQueryParams, NoData>(this).push('screenshots');
return new APIListScreenshots(this);
}

// /device-sessions/{id}/screenshots/{id}
Expand Down Expand Up @@ -86,7 +85,7 @@ export class APIResourceDeviceSessionCommon extends APIResource<DeviceSession> i

// /device-sessions/{id}/test-case-runs
testCaseRuns() {
return new APIList<TestCaseRun, SessionQueryParams | NoQueryParams, NoData>(this).push('test-case-runs');
return new APIListTestCaseRuns(this);
}

// /device-sessions/{id}/connections
Expand Down
Loading