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

Commit 5b471db

Browse files
committed
Updated API to comply with contact message service v0.6.0
1 parent a7919fc commit 5b471db

File tree

4 files changed

+23
-5
lines changed

4 files changed

+23
-5
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
2+
# 0.4.0
3+
- Updated API to comply with contact message service v0.6.0
4+
15
# 0.3.0
26

37
- Contact client is now able to retrieve multiple contact messages

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.3.0",
3+
"version": "0.4.0",
44
"description": "NodeJS client for portfolio API",
55
"main": "./dist/index.js",
66
"types": "./dist/index.d.ts",

src/apis/contact/client.ts

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { PortfolioResponse } from "../../common/response";
1010
import {
1111
ContactMessage,
1212
ContactMessageCollection,
13+
ContactMessageFormPublished,
1314
Reason,
1415
Sender,
1516
} from "./models";
@@ -41,6 +42,10 @@ export type GetContactMessagesRequest = RequestWithParameters<
4142

4243
export type ContactMessageResponse = PortfolioResponse<ContactMessage>;
4344

45+
export type ContactMessageCreatedResponse = PortfolioResponse<
46+
ContactMessageFormPublished
47+
>;
48+
4449
export type ContactMessagesResponse = PortfolioResponse<
4550
ContactMessageCollection
4651
>;
@@ -60,13 +65,17 @@ export class ContactClient extends BaseClient {
6065
*/
6166
createMessage(
6267
request: CreateContactMessageRequest
63-
): Promise<AxiosResponse<ContactMessageResponse>> {
68+
): Promise<AxiosResponse<ContactMessageCreatedResponse>> {
6469
const config = this.config.merge(request as PortfolioRequest);
6570
const url = `${config.host}/contact/mail`;
6671

67-
return this.axiosInstance.post<ContactMessageResponse>(url, request.body, {
68-
headers: config.headers,
69-
});
72+
return this.axiosInstance.post<ContactMessageCreatedResponse>(
73+
url,
74+
request.body,
75+
{
76+
headers: config.headers,
77+
}
78+
);
7079
}
7180

7281
/**

src/apis/contact/models.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ export interface ContactMessageCollection {
1818
contactMessages: ContactMessage[];
1919
}
2020

21+
export interface ContactMessageFormPublished {
22+
contactMessageId: string;
23+
snsMessageId: string;
24+
}
25+
2126
export enum Reason {
2227
// TODO: In future API releases, case will not matter
2328
Business = "business",

0 commit comments

Comments
 (0)