Skip to content
This repository was archived by the owner on Feb 18, 2021. It is now read-only.

Commit 73b910b

Browse files
committed
Removed API version from header
1 parent a13310f commit 73b910b

File tree

7 files changed

+11
-15
lines changed

7 files changed

+11
-15
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1+
# 0.4.1
2+
3+
- Removed api version header
14

25
# 0.4.0
6+
37
- Updated API to comply with contact message service v0.6.0
48

59
# 0.3.0

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@jsextonn/portfolio-api-client",
3-
"version": "0.4.0",
3+
"version": "0.4.1",
44
"description": "NodeJS client for portfolio API",
55
"main": "./dist/index.js",
66
"types": "./dist/index.d.ts",

src/common/client.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ export type Headers = { [headerName: string]: any };
66
export interface ClientConfig {
77
host: string;
88
jwt?: string;
9-
version?: string;
109
}
1110

1211
export class ClientConfigWrapper {
@@ -27,7 +26,6 @@ export class ClientConfigWrapper {
2726
get headers(): Headers {
2827
return {
2928
Authorization: `Bearer ${this.config.jwt}`,
30-
"X-PORTFOLIO-VERSION": this.config.version,
3129
};
3230
}
3331

@@ -38,10 +36,6 @@ export class ClientConfigWrapper {
3836
get jwt(): string | undefined {
3937
return this.config.jwt;
4038
}
41-
42-
get version(): string | undefined {
43-
return this.config.version;
44-
}
4539
}
4640

4741
export abstract class BaseClient {

src/common/request.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
*/
66
export interface PortfolioRequest {
77
jwt?: string;
8-
version?: string;
98
}
109

1110
export interface RequestWithParameters<T> extends PortfolioRequest {

src/common/response.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,16 @@ export interface PortfolioResponse<T = any> {
77
export interface Meta {
88
message: string;
99
errorDetails: ErrorDetail[];
10+
paginationDetails: PaginationDetails;
1011
schemas: { [schemaName: string]: any };
1112
}
1213

1314
export interface ErrorDetail {
1415
description: string;
1516
fieldName: string;
1617
}
18+
19+
export interface PaginationDetails {
20+
page: number;
21+
limit: number;
22+
}

test/client.test.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,4 @@ describe("client config wrapper", () => {
6565
const headers = configWrapper.headers;
6666
expect(headers["Authorization"]).toEqual(`Bearer ${config.jwt}`);
6767
});
68-
69-
it("should correctly attach version to custom header", () => {
70-
const headers = configWrapper.headers;
71-
expect(headers["X-PORTFOLIO-VERSION"]).toEqual(config.version);
72-
});
7368
});

test/contact.test.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ jest.mock("axios");
1111
describe("message service", () => {
1212
const config: ClientConfig = {
1313
host: "123",
14-
version: "v1.0",
1514
jwt: "123.jwt.abc",
1615
};
1716

@@ -29,7 +28,6 @@ describe("message service", () => {
2928

3029
it("should have expected config", () => {
3130
expect(client.config.host).toBe(config.host);
32-
expect(client.config.version).toBe(config.version);
3331
expect(client.config.jwt).toBe(config.jwt);
3432
});
3533

0 commit comments

Comments
 (0)