Skip to content

Commit 608b0be

Browse files
Merge pull request #472 from marisuch/master
Added endpoint admin/accounts/accountId/preferences
2 parents d93174f + 3bfa731 commit 608b0be

11 files changed

+3185
-2658
lines changed

dist/api/APIAdminResourceAccount.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@ import { Account } from './models/Account';
55
import { NoData, NoQueryParams } from './models/HTTP';
66
import { Role, RoleParams } from './models/Role';
77
import { AccountService } from './models/AccountService';
8+
import { AccountPreferences } from './models/AccountPreference';
89
export declare class APIAdminResourceAccount extends APIResource<Account, NoQueryParams, NoData> {
910
constructor(parent: APIAdminResource, id: number);
1011
roles(): APIList<Role, RoleParams, void>;
1112
role(id: number): APIResource<Role, RoleParams, void>;
1213
accountServices(): APIList<AccountService, import("./models/HTTP").CollectionQueryParams, any>;
14+
preferences(): APIResource<AccountPreferences, NoQueryParams, Partial<Omit<AccountPreferences, "id">>>;
1315
}
1416
export default APIAdminResourceAccount;
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
export declare type AccountPreferences = {
22
allowedFileExtensions: Array<string>;
33
id: number;
4+
defaultTestTimeout: number;
5+
testTimeout: number;
46
};
7+
export declare type AccountPreferencesData = Partial<Omit<AccountPreferences, 'id'>>;

dist/bitbar-cloud-api-client.js

Lines changed: 5 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/bitbar-cloud-api-client.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/bitbar-cloud-api-client.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/bitbar-cloud-api-client.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 3152 additions & 2651 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@bitbar/cloud-api-client",
3-
"version": "1.2.0",
3+
"version": "1.2.1",
44
"description": "Bitbar Cloud API Client for JavaScript",
55
"main": "dist/bitbar-cloud-api-client.min.js",
66
"types": "dist/index.d.ts",

src/api/APIAdminResourceAccount.spec.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,12 @@ describe('APIAdminResourceAccount', () => {
5555
});
5656
});
5757

58+
describe('@preferences', () => {
59+
it('should initialize proper endpoint path', () => {
60+
const call = service.preferences();
61+
expect(call).toBeInstanceOf(APIResource);
62+
expect(call.toUrl()).toEqual('/admin/accounts/1/preferences');
63+
});
64+
});
65+
5866
});

src/api/APIAdminResourceAccount.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {Account} from './models/Account';
55
import {NoData, NoQueryParams} from './models/HTTP';
66
import {Role, RoleParams} from './models/Role';
77
import {AccountService} from './models/AccountService';
8+
import {AccountPreferences, AccountPreferencesData} from './models/AccountPreference';
89

910

1011
export class APIAdminResourceAccount extends APIResource<Account, NoQueryParams, NoData> {
@@ -36,6 +37,11 @@ export class APIAdminResourceAccount extends APIResource<Account, NoQueryParams,
3637
return new APIList<AccountService>(this).push('account-services');
3738
}
3839

40+
// /accounts/{id}/preferences
41+
preferences() {
42+
return new APIResource<AccountPreferences, NoQueryParams, AccountPreferencesData>(this).push('preferences');
43+
}
44+
3945
}
4046

4147
export default APIAdminResourceAccount

src/api/models/AccountPreference.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
export type AccountPreferences = {
22
allowedFileExtensions: Array<string>;
33
id: number;
4+
defaultTestTimeout: number;
5+
testTimeout: number
46
}
7+
8+
export type AccountPreferencesData = Partial<Omit<AccountPreferences, 'id'>>

0 commit comments

Comments
 (0)