diff --git a/src/ts/@overflow/app/router/index.tsx b/src/ts/@overflow/app/router/index.tsx
index 70ee64a..e5afd67 100644
--- a/src/ts/@overflow/app/router/index.tsx
+++ b/src/ts/@overflow/app/router/index.tsx
@@ -5,11 +5,124 @@ import Signin from '../views/member/Signin';
const routes = (
+
-
-
+
);
export default routes;
+
+const _routes = [
+ {
+ path: '/signin',
+ component: Signin,
+ },
+ {
+ path: '/signup',
+ component: Signup,
+ },
+ {
+ path: '/forgot_password',
+ component: ForgotPassword,
+ },
+ {
+ path: '/email_confirm',
+ component: EmailConfirm,
+ },
+ {
+ path: '/',
+ component: Home,
+ routes: [
+ {
+ path: '/monitoring',
+ component: Monitoring,
+ routes: [
+ {
+ path: '/probe',
+ component: Probe,
+ routes: [
+ {
+ path: '/list',
+ component: Probe,
+ },
+ {
+ path: '/noauth',
+ component: NoAuthProbe,
+ },
+ {
+ path: '/setup',
+ component: ProbeSetup,
+ },
+ ],
+ },
+ {
+ path: '/sensor',
+ component: Sensor,
+ },
+ ],
+ },
+ {
+ path: '/infrastructure',
+ component: ,
+ routes: [
+ {
+ path: '/maps',
+ component: InfrastructureMaps,
+ },
+ {
+ path: '/targets',
+ component: Targets,
+ },
+ ],
+ },
+ {
+ path: '/dashboard',
+ component: Dashboard,
+ },
+ {
+ path: '/metrics',
+ component: Metrics,
+ },
+ {
+ path: '/alerts',
+ component: Alerts,
+ },
+ {
+ path: '/history',
+ component: History,
+ },
+ {
+ path: '/settings',
+ component: Settings,
+ },
+ {
+ path: '/notifications',
+ component: Notifications,
+ },
+ {
+ path: '/account',
+ component: ,
+ routes: [
+ {
+ path: '/signout',
+ component: Signout,
+ },
+ {
+ path: '/profile',
+ component: Profile,
+ },
+ {
+ path: '/preferences',
+ component: Preferences,
+ },
+ {
+ path: '/help',
+ component: Help,
+ },
+ ],
+ },
+ ],
+ },
+];
diff --git a/src/ts/@overflow/domain/redux/action/domain_member_regist.ts b/src/ts/@overflow/app/views/Home.tsx
similarity index 100%
rename from src/ts/@overflow/domain/redux/action/domain_member_regist.ts
rename to src/ts/@overflow/app/views/Home.tsx
diff --git a/src/ts/@overflow/domain/redux/action/domain_regist.ts b/src/ts/@overflow/app/views/alert/Alert.tsx
similarity index 100%
rename from src/ts/@overflow/domain/redux/action/domain_regist.ts
rename to src/ts/@overflow/app/views/alert/Alert.tsx
diff --git a/src/ts/@overflow/domain/redux/payload/DomainMemberRegistPayload.ts b/src/ts/@overflow/app/views/dashboard/Dashboard.tsx
similarity index 100%
rename from src/ts/@overflow/domain/redux/payload/DomainMemberRegistPayload.ts
rename to src/ts/@overflow/app/views/dashboard/Dashboard.tsx
diff --git a/src/ts/@overflow/domain/redux/payload/DomainRegistPayload.ts b/src/ts/@overflow/app/views/help/Help.tsx
similarity index 100%
rename from src/ts/@overflow/domain/redux/payload/DomainRegistPayload.ts
rename to src/ts/@overflow/app/views/help/Help.tsx
diff --git a/src/ts/@overflow/domain/redux/reducer/domain_member_regist.ts b/src/ts/@overflow/app/views/history/History.tsx
similarity index 100%
rename from src/ts/@overflow/domain/redux/reducer/domain_member_regist.ts
rename to src/ts/@overflow/app/views/history/History.tsx
diff --git a/src/ts/@overflow/domain/redux/reducer/domain_regist.ts b/src/ts/@overflow/app/views/infrastructure/maps/Maps.tsx
similarity index 100%
rename from src/ts/@overflow/domain/redux/reducer/domain_regist.ts
rename to src/ts/@overflow/app/views/infrastructure/maps/Maps.tsx
diff --git a/src/ts/@overflow/domain/redux/saga/domain_member_regist.ts b/src/ts/@overflow/app/views/infrastructure/target/List.tsx
similarity index 100%
rename from src/ts/@overflow/domain/redux/saga/domain_member_regist.ts
rename to src/ts/@overflow/app/views/infrastructure/target/List.tsx
diff --git a/src/ts/@overflow/domain/redux/saga/domain_regist.ts b/src/ts/@overflow/app/views/member/EmailConfirm.tsx
similarity index 100%
rename from src/ts/@overflow/domain/redux/saga/domain_regist.ts
rename to src/ts/@overflow/app/views/member/EmailConfirm.tsx
diff --git a/src/ts/@overflow/domain/redux/state/domain_member_regist.ts b/src/ts/@overflow/app/views/member/ForgotPassword.tsx
similarity index 100%
rename from src/ts/@overflow/domain/redux/state/domain_member_regist.ts
rename to src/ts/@overflow/app/views/member/ForgotPassword.tsx
diff --git a/src/ts/@overflow/domain/redux/state/domain_regist.ts b/src/ts/@overflow/app/views/member/Signout.tsx
similarity index 100%
rename from src/ts/@overflow/domain/redux/state/domain_regist.ts
rename to src/ts/@overflow/app/views/member/Signout.tsx
diff --git a/src/ts/@overflow/app/views/member/Signup.tsx b/src/ts/@overflow/app/views/member/Signup.tsx
new file mode 100644
index 0000000..e69de29
diff --git a/src/ts/@overflow/app/views/metric/Metric.tsx b/src/ts/@overflow/app/views/metric/Metric.tsx
new file mode 100644
index 0000000..e69de29
diff --git a/src/ts/@overflow/app/views/monitoring/probe/List.tsx b/src/ts/@overflow/app/views/monitoring/probe/List.tsx
new file mode 100644
index 0000000..e69de29
diff --git a/src/ts/@overflow/app/views/monitoring/probe/NoAuth.tsx b/src/ts/@overflow/app/views/monitoring/probe/NoAuth.tsx
new file mode 100644
index 0000000..e69de29
diff --git a/src/ts/@overflow/app/views/monitoring/probe/Setup.tsx b/src/ts/@overflow/app/views/monitoring/probe/Setup.tsx
new file mode 100644
index 0000000..e69de29
diff --git a/src/ts/@overflow/app/views/monitoring/sensor/List.tsx b/src/ts/@overflow/app/views/monitoring/sensor/List.tsx
new file mode 100644
index 0000000..e69de29
diff --git a/src/ts/@overflow/app/views/notification/Notification.tsx b/src/ts/@overflow/app/views/notification/Notification.tsx
new file mode 100644
index 0000000..e69de29
diff --git a/src/ts/@overflow/app/views/setting/Setting.tsx b/src/ts/@overflow/app/views/setting/Setting.tsx
new file mode 100644
index 0000000..e69de29
diff --git a/src/ts/@overflow/commons/api/Client.ts b/src/ts/@overflow/commons/api/Client.ts
index de07fea..1d70be4 100644
--- a/src/ts/@overflow/commons/api/Client.ts
+++ b/src/ts/@overflow/commons/api/Client.ts
@@ -1,13 +1,256 @@
+export type OnConnectFunc = () => void;
+export type OnWebsocketDisconnectFunc = () => void;
+export type OnWebsocketNativeMessageFunc = (websocketMessage: string) => void;
+export type OnMessageFunc = (message: any) => void;
+
+enum MessageType {
+ STRING = 1,
+ INT,
+ BOOLEAN,
+ JSON,
+}
+
class Client {
- private wss: WebSocket;
+ private conn: WebSocket;
+ private isReady: boolean;
+ // events listeners
+ private connectListeners: OnConnectFunc[] = [];
+ private disconnectListeners: OnWebsocketDisconnectFunc[] = [];
+ private nativeMessageListeners: OnWebsocketNativeMessageFunc[] = [];
+ private messageListeners: { [event: string]: OnMessageFunc[] } = {};
+
+ constructor(endpoint: string, protocols?: string[]) {
+ // if (!window.WebSocket) {
+ // return;
+ // }
+
+ if (endpoint.indexOf('ws') === -1) {
+ endpoint = 'ws://' + endpoint;
+ }
+
+ if (protocols != null && protocols.length > 0) {
+ this.conn = new WebSocket(endpoint, protocols);
+ } else {
+ this.conn = new WebSocket(endpoint);
+ }
+
+ this.conn.onopen = ((evt: Event): any => {
+ this.fireConnect();
+ this.isReady = true;
+ return null;
+ });
+
+ this.conn.onclose = ((evt: Event): any => {
+ this.fireDisconnect();
+ return null;
+ });
+
+ this.conn.onmessage = ((evt: MessageEvent) => {
+ this.messageReceivedFromConn(evt);
+ });
+
+ this.conn.onerror = ((evt: MessageEvent) => {
+ this.errorReceivedFromConn(evt);
+ });
+ }
+
+ public OnConnect(fn: OnConnectFunc): void {
+ if (this.isReady) {
+ fn();
+ }
+ this.connectListeners.push(fn);
+ }
+ public OnDisconnect(fn: OnWebsocketDisconnectFunc): void {
+ this.disconnectListeners.push(fn);
+ }
+ public OnMessage(cb: OnWebsocketNativeMessageFunc): void {
+ this.nativeMessageListeners.push(cb);
+ }
+ public On(event: string, cb: OnMessageFunc): void {
+ if (this.messageListeners[event] == null || this.messageListeners[event] === undefined) {
+ this.messageListeners[event] = [];
+ }
+ this.messageListeners[event].push(cb);
+ }
+
+ //
+
+ // Ws Actions
+ public Disconnect(): void {
+ this.conn.close();
+ }
+
+ // EmitMessage sends a native websocket message
+ public EmitMessage(websocketMessage: string): void {
+ this.conn.send(websocketMessage);
+ }
+
+ protected fireConnect(): void {
+ for (let i = 0; i < this.connectListeners.length; i++) {
+ this.connectListeners[i]();
+ }
+ }
+
+ protected fireDisconnect(): void {
+ for (let i = 0; i < this.disconnectListeners.length; i++) {
+ this.disconnectListeners[i]();
+ }
+ }
+
+ protected fireNativeMessage(websocketMessage: string): void {
+ for (let i = 0; i < this.nativeMessageListeners.length; i++) {
+ this.nativeMessageListeners[i](websocketMessage);
+ }
+ }
+
+ protected fireMessage(event: string, message: any): void {
+ for (let key in this.messageListeners) {
+ if (this.messageListeners.hasOwnProperty(key)) {
+ if (key === event) {
+ for (let i = 0; i < this.messageListeners[key].length; i++) {
+ this.messageListeners[key][i](message);
+ }
+ }
+ }
+ }
+ }
+
+ // utils
+ private isNumber(obj: any): boolean {
+ return !isNaN(obj - 0) && obj !== null && obj !== '' && obj !== false;
+ }
+
+ private isString(obj: any): boolean {
+ return Object.prototype.toString.call(obj) === '[object String]';
+ }
+
+ private isBoolean(obj: any): boolean {
+ return typeof obj === 'boolean' ||
+ (typeof obj === 'object' && typeof obj.valueOf() === 'boolean');
+ }
+
+ private isJSON(obj: any): boolean {
+ return typeof obj === 'object';
+ }
+
+ //
+
+ // messages
+ private _msg(event: string, messageType: MessageType, dataMessage: string): string {
+
+ return websocketMessagePrefix + event + websocketMessageSeparator + String(websocketMessageType) + websocketMessageSeparator + dataMessage;
+ }
+
+ private encodeMessage(event: string, data: any): string {
+ let m = '';
+ let t: MessageType = MessageType.STRING;
+ if (this.isNumber(data)) {
+ t = MessageType.INT;
+ m = data.toString();
+ } else if (this.isBoolean(data)) {
+ t = MessageType.BOOLEAN;
+ m = data.toString();
+ } else if (this.isString(data)) {
+ t = MessageType.STRING;
+ m = data.toString();
+ } else if (this.isJSON(data)) {
+ // propably json-object
+ t = MessageType.JSON;
+ m = JSON.stringify(data);
+ } else {
+ console.log('Invalid, javascript-side should contains an empty second parameter.');
+ }
+
+ return this._msg(event, t, m);
+ }
+
+ private decodeMessage(event: string, websocketMessage: string): T | any {
+ // q-websocket-message;user;4;themarshaledstringfromajsonstruct
+ let skipLen = websocketMessagePrefixLen + websocketMessageSeparatorLen + event.length + 2;
+ if (websocketMessage.length < skipLen + 1) {
+ return null;
+ }
+ let websocketMessageType = parseInt(websocketMessage.charAt(skipLen - 2));
+ let theMessage = websocketMessage.substring(skipLen, websocketMessage.length);
+ if (websocketMessageType === MessageType.INT) {
+ return parseInt(theMessage);
+ } else if (websocketMessageType === MessageType.BOOLEAN) {
+ return Boolean(theMessage);
+ } else if (websocketMessageType === MessageType.STRING) {
+ return theMessage;
+ } else if (websocketMessageType === MessageType.JSON) {
+ return JSON.parse(theMessage);
+ } else {
+ return null; // invalid
+ }
+ }
+
+ private getWebsocketCustomEvent(websocketMessage: string): string {
+ if (websocketMessage.length < websocketMessagePrefixAndSepIdx) {
+ return '';
+ }
+ let s = websocketMessage.substring(websocketMessagePrefixAndSepIdx, websocketMessage.length);
+ let evt = s.substring(0, s.indexOf(websocketMessageSeparator));
+
+ return evt;
+ }
+
+ private getCustomMessage(event: string, websocketMessage: string): string {
+ let eventIdx = websocketMessage.indexOf(event + websocketMessageSeparator);
+ let s = websocketMessage.substring(eventIdx + event.length + websocketMessageSeparator.length + 2, websocketMessage.length);
+ return s;
+ }
+
+ //
+
+ // Ws Events
+
+ // messageReceivedFromConn this is the func which decides
+ // if it's a native websocket message or a custom qws message
+ // if native message then calls the fireNativeMessage
+ // else calls the fireMessage
+ //
+ // remember q gives you the freedom of native websocket messages if you don't want to use this client side at all.
+ private messageReceivedFromConn(evt: MessageEvent): void {
+ // check if qws message
+ let message = evt.data;
+ if (message.indexOf(websocketMessagePrefix) !== -1) {
+ let event = this.getWebsocketCustomEvent(message);
+ if (event !== '') {
+ // it's a custom message
+ this.fireMessage(event, this.getCustomMessage(event, message));
+ return;
+ }
+ }
+
+ // it's a native websocket message
+ this.fireNativeMessage(message);
+ }
+
+ // errorReceivedFromConn this is the func which decides
+ // if it's a native websocket message or a custom qws message
+ // if native message then calls the fireNativeMessage
+ // else calls the fireMessage
+ //
+ // remember q gives you the freedom of native websocket messages if you don't want to use this client side at all.
+ private errorReceivedFromConn(evt: MessageEvent): void {
+ // check if qws message
+ let message = evt.data;
+ if (message.indexOf(websocketMessagePrefix) !== -1) {
+ let event = this.getWebsocketCustomEvent(message);
+ if (event !== '') {
+ // it's a custom message
+ this.fireMessage(event, this.getCustomMessage(event, message));
+ return;
+ }
+ }
+
+ // it's a native websocket message
+ this.fireNativeMessage(message);
+ }
}
-export interface Protocol {
- serviceName: string;
- methodName: string;
- params?: string[];
-}
export default Client;
diff --git a/src/ts/@overflow/domain/redux/action/member_regist.ts b/src/ts/@overflow/domain/redux/action/member_regist.ts
new file mode 100644
index 0000000..2fb6a9f
--- /dev/null
+++ b/src/ts/@overflow/domain/redux/action/member_regist.ts
@@ -0,0 +1,41 @@
+import Action from '@overflow/commons/redux/Action';
+import DomainMember from '@overflow/domain/api/model/DomainMember';
+
+import MemberRegistPayload from '../payload/MemberRegistPayload';
+
+// Action Type
+export type REQUEST = '@overflow/domain/member_regist/REQUEST';
+export type REQUEST_SUCCESS = '@overflow/domain/member_regist/REQUEST_SUCCESS';
+export type REQUEST_FAILURE = '@overflow/domain/member_regist/REQUEST_FAILURE';
+
+export const REQUEST: REQUEST = '@overflow/domain/member_regist/REQUEST';
+export const REQUEST_SUCCESS: REQUEST_SUCCESS = '@overflow/domain/member_regist/REQUEST_SUCCESS';
+export const REQUEST_FAILURE: REQUEST_FAILURE = '@overflow/domain/member_regist/REQUEST_FAILURE';
+
+// Action Creater
+export type request = (domain: DomainMember) => Action;
+export type requestSuccess = () => Action;
+export type requestFailure = (error: Error) => Action;
+
+export const request: request = (domainMember: DomainMember): Action => {
+ return {
+ type: REQUEST,
+ payload: {
+ domainMember: domainMember,
+ },
+ };
+};
+
+export const requestSuccess: requestSuccess = (): Action => {
+ return {
+ type: REQUEST_SUCCESS,
+ payload: null,
+ };
+};
+
+export const requestFailure: requestFailure = (error: Error): Action => {
+ return {
+ type: REQUEST_FAILURE,
+ error: error,
+ };
+};
diff --git a/src/ts/@overflow/domain/redux/action/regist.ts b/src/ts/@overflow/domain/redux/action/regist.ts
new file mode 100644
index 0000000..980613f
--- /dev/null
+++ b/src/ts/@overflow/domain/redux/action/regist.ts
@@ -0,0 +1,41 @@
+import Action from '@overflow/commons/redux/Action';
+import Domain from '@overflow/domain/api/model/Domain';
+
+import RegistPayload from '../payload/RegistPayload';
+
+// Action Type
+export type REQUEST = '@overflow/domain/regist/REQUEST';
+export type REQUEST_SUCCESS = '@overflow/domain/regist/REQUEST_SUCCESS';
+export type REQUEST_FAILURE = '@overflow/domain/regist/REQUEST_FAILURE';
+
+export const REQUEST: REQUEST = '@overflow/domain/regist/REQUEST';
+export const REQUEST_SUCCESS: REQUEST_SUCCESS = '@overflow/domain/regist/REQUEST_SUCCESS';
+export const REQUEST_FAILURE: REQUEST_FAILURE = '@overflow/domain/regist/REQUEST_FAILURE';
+
+// Action Creater
+export type request = (domain: Domain) => Action;
+export type requestSuccess = () => Action;
+export type requestFailure = (error: Error) => Action;
+
+export const request: request = (domain: Domain): Action => {
+ return {
+ type: REQUEST,
+ payload: {
+ domain: domain,
+ },
+ };
+};
+
+export const requestSuccess: requestSuccess = (): Action => {
+ return {
+ type: REQUEST_SUCCESS,
+ payload: null,
+ };
+};
+
+export const requestFailure: requestFailure = (error: Error): Action => {
+ return {
+ type: REQUEST_FAILURE,
+ error: error,
+ };
+};
diff --git a/src/ts/@overflow/domain/redux/payload/MemberRegistPayload.ts b/src/ts/@overflow/domain/redux/payload/MemberRegistPayload.ts
new file mode 100644
index 0000000..f5f79f9
--- /dev/null
+++ b/src/ts/@overflow/domain/redux/payload/MemberRegistPayload.ts
@@ -0,0 +1,7 @@
+import DomainMember from '../../api/model/DomainMember';
+
+interface MemberRegistPayload {
+ domainMember: DomainMember;
+}
+
+export default MemberRegistPayload;
diff --git a/src/ts/@overflow/domain/redux/payload/RegistPayload.ts b/src/ts/@overflow/domain/redux/payload/RegistPayload.ts
new file mode 100644
index 0000000..613c6da
--- /dev/null
+++ b/src/ts/@overflow/domain/redux/payload/RegistPayload.ts
@@ -0,0 +1,6 @@
+import Domain from '../../api/model/Domain';
+interface RegistPayload {
+ domain: Domain;
+}
+
+export default RegistPayload;
diff --git a/src/ts/@overflow/domain/redux/reducer/member_regist.ts b/src/ts/@overflow/domain/redux/reducer/member_regist.ts
new file mode 100644
index 0000000..e69de29
diff --git a/src/ts/@overflow/domain/redux/reducer/regist.ts b/src/ts/@overflow/domain/redux/reducer/regist.ts
new file mode 100644
index 0000000..e69de29
diff --git a/src/ts/@overflow/domain/redux/saga/member_regist.ts b/src/ts/@overflow/domain/redux/saga/member_regist.ts
new file mode 100644
index 0000000..493d6c7
--- /dev/null
+++ b/src/ts/@overflow/domain/redux/saga/member_regist.ts
@@ -0,0 +1,39 @@
+import { SagaIterator } from 'redux-saga';
+import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects';
+
+
+import AppContext from '@overflow/commons/context';
+import Action from '@overflow/commons/redux/Action';
+
+import DomainMember from '../../api/model/DomainMember';
+import DomainMemberService from '../../api/service/DomainMemberService';
+import * as MemberRegistActions from '../action/member_regist';
+import MemberRegistPayload from '../payload/MemberRegistPayload';
+
+function* regist(action: Action): SagaIterator {
+ try {
+ const dm = action.payload.domainMember;
+ // yield put({
+ // type: types.SENDING_REQUEST,
+ // payload: {sendingRequest: true},
+ // });
+
+ yield call(AppContext.getService().regist, dm);
+
+ // if (responseBody.token === undefined) {
+ // throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
+ // }
+ yield put(MemberRegistActions.requestSuccess());
+ } catch (e) {
+ yield put(MemberRegistActions.requestFailure(e));
+ } finally {
+ // yield put({
+ // type: types.SENDING_REQUEST,
+ // payload: {sendingRequest: false},
+ // });
+ }
+}
+
+export function* watchDomainMemberRegist(): SagaIterator {
+ yield takeLatest(MemberRegistActions.REQUEST, regist);
+}
diff --git a/src/ts/@overflow/domain/redux/saga/regist.ts b/src/ts/@overflow/domain/redux/saga/regist.ts
new file mode 100644
index 0000000..6916d4d
--- /dev/null
+++ b/src/ts/@overflow/domain/redux/saga/regist.ts
@@ -0,0 +1,39 @@
+import { SagaIterator } from 'redux-saga';
+import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects';
+
+
+import AppContext from '@overflow/commons/context';
+import Action from '@overflow/commons/redux/Action';
+
+import Domain from '../../api/model/Domain';
+import DomainService from '../../api/service/DomainService';
+import * as RegistActions from '../action/regist';
+import RegistPayload from '../payload/RegistPayload';
+
+function* regist(action: Action): SagaIterator {
+ try {
+ const dm = action.payload.domain;
+ // yield put({
+ // type: types.SENDING_REQUEST,
+ // payload: {sendingRequest: true},
+ // });
+
+ yield call(AppContext.getService().regist, dm);
+
+ // if (responseBody.token === undefined) {
+ // throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
+ // }
+ yield put(RegistActions.requestSuccess());
+ } catch (e) {
+ yield put(RegistActions.requestFailure(e));
+ } finally {
+ // yield put({
+ // type: types.SENDING_REQUEST,
+ // payload: {sendingRequest: false},
+ // });
+ }
+}
+
+export function* watchDomainRegist(): SagaIterator {
+ yield takeLatest(RegistActions.REQUEST, regist);
+}
diff --git a/src/ts/@overflow/domain/redux/state/member_regist.ts b/src/ts/@overflow/domain/redux/state/member_regist.ts
new file mode 100644
index 0000000..e69de29
diff --git a/src/ts/@overflow/domain/redux/state/regist.ts b/src/ts/@overflow/domain/redux/state/regist.ts
new file mode 100644
index 0000000..e69de29
diff --git a/src/ts/@overflow/email/redux/action/modify.ts b/src/ts/@overflow/email/redux/action/modify.ts
index 4062be4..55c322d 100644
--- a/src/ts/@overflow/email/redux/action/modify.ts
+++ b/src/ts/@overflow/email/redux/action/modify.ts
@@ -1,3 +1,45 @@
/**
* Created by geek on 17. 7. 4.
*/
+import Action from '@overflow/commons/redux/Action';
+import EmailAuth from '@overflow/email/api/model/EmailAuth';
+
+import ModifyPayload from '../payload/ModifyPayload';
+
+// Action Type
+export type REQUEST = '@overflow/email/modify/REQUEST';
+export type REQUEST_SUCCESS = '@overflow/email/modify/REQUEST_SUCCESS';
+export type REQUEST_FAILURE = '@overflow/email/modify/REQUEST_FAILURE';
+
+export const REQUEST: REQUEST = '@overflow/email/modify/REQUEST';
+export const REQUEST_SUCCESS: REQUEST_SUCCESS = '@overflow/email/modify/REQUEST_SUCCESS';
+export const REQUEST_FAILURE: REQUEST_FAILURE = '@overflow/email/modify/REQUEST_FAILURE';
+
+// Action Creater
+export type request = (emailAuth:EmailAuth) => Action;
+export type requestSuccess = (emailAuth: EmailAuth) => Action;
+export type requestFailure = (error: Error) => Action;
+
+export const request: request = (emailAuth:EmailAuth): Action => {
+ return {
+ type: REQUEST,
+ payload: {
+ emailAuth: emailAuth,
+ },
+ };
+};
+
+export const requestSuccess: requestSuccess = (emailAuth: EmailAuth): Action => {
+ return {
+ type: REQUEST_SUCCESS,
+ payload: emailAuth,
+ };
+};
+
+export const requestFailure: requestFailure = (error: Error): Action => {
+ return {
+ type: REQUEST_FAILURE,
+ error: error,
+ };
+};
+
diff --git a/src/ts/@overflow/email/redux/action/read.ts b/src/ts/@overflow/email/redux/action/read.ts
index 4062be4..6eb24ff 100644
--- a/src/ts/@overflow/email/redux/action/read.ts
+++ b/src/ts/@overflow/email/redux/action/read.ts
@@ -1,3 +1,42 @@
-/**
- * Created by geek on 17. 7. 4.
- */
+import Action from '@overflow/commons/redux/Action';
+import EmailAuth from '@overflow/email/api/model/EmailAuth';
+
+import ReadPayload from '../payload/ReadPayload';
+
+// Action Type
+export type REQUEST = '@overflow/email/read/REQUEST';
+export type REQUEST_SUCCESS = '@overflow/email/read/REQUEST_SUCCESS';
+export type REQUEST_FAILURE = '@overflow/email/read/REQUEST_FAILURE';
+
+export const REQUEST: REQUEST = '@overflow/email/read/REQUEST';
+export const REQUEST_SUCCESS: REQUEST_SUCCESS = '@overflow/email/read/REQUEST_SUCCESS';
+export const REQUEST_FAILURE: REQUEST_FAILURE = '@overflow/email/read/REQUEST_FAILURE';
+
+// Action Creater
+export type request = (id: number) => Action;
+export type requestSuccess = (emailAuth: EmailAuth) => Action;
+export type requestFailure = (error: Error) => Action;
+
+export const request: request = (id: number): Action => {
+ return {
+ type: REQUEST,
+ payload: {
+ id: id,
+ },
+ };
+};
+
+export const requestSuccess: requestSuccess = (emailAuth: EmailAuth): Action => {
+ return {
+ type: REQUEST_SUCCESS,
+ payload: emailAuth,
+ };
+};
+
+export const requestFailure: requestFailure = (error: Error): Action => {
+ return {
+ type: REQUEST_FAILURE,
+ error: error,
+ };
+};
+
diff --git a/src/ts/@overflow/email/redux/action/read_by_auth_key.ts b/src/ts/@overflow/email/redux/action/read_by_auth_key.ts
index 4062be4..732d805 100644
--- a/src/ts/@overflow/email/redux/action/read_by_auth_key.ts
+++ b/src/ts/@overflow/email/redux/action/read_by_auth_key.ts
@@ -1,3 +1,41 @@
-/**
- * Created by geek on 17. 7. 4.
- */
+import Action from '@overflow/commons/redux/Action';
+import EmailAuth from '@overflow/email/api/model/EmailAuth';
+
+import ReadByAuthKeyPayload from '../payload/ReadByAuthKeyPayload';
+
+// Action Type
+export type REQUEST = '@overflow/email/read_by_auth_key/REQUEST';
+export type REQUEST_SUCCESS = '@overflow/email/read_by_auth_key/REQUEST_SUCCESS';
+export type REQUEST_FAILURE = '@overflow/email/read_by_auth_key/REQUEST_FAILURE';
+
+export const REQUEST: REQUEST = '@overflow/email/read_by_auth_key/REQUEST';
+export const REQUEST_SUCCESS: REQUEST_SUCCESS = '@overflow/email/read_by_auth_key/REQUEST_SUCCESS';
+export const REQUEST_FAILURE: REQUEST_FAILURE = '@overflow/email/read_by_auth_key/REQUEST_FAILURE';
+
+// Action Creater
+export type request = (authKey: string) => Action;
+export type requestSuccess = (emailAuth: EmailAuth) => Action;
+export type requestFailure = (error: Error) => Action;
+
+export const request: request = (authKey: string): Action => {
+ return {
+ type: REQUEST,
+ payload: {
+ authKey: authKey,
+ },
+ };
+};
+
+export const requestSuccess: requestSuccess = (emailAuth: EmailAuth): Action => {
+ return {
+ type: REQUEST_SUCCESS,
+ payload: emailAuth,
+ };
+};
+
+export const requestFailure: requestFailure = (error: Error): Action => {
+ return {
+ type: REQUEST_FAILURE,
+ error: error,
+ };
+};
diff --git a/src/ts/@overflow/email/redux/action/read_by_member.ts b/src/ts/@overflow/email/redux/action/read_by_member.ts
index 4062be4..005823f 100644
--- a/src/ts/@overflow/email/redux/action/read_by_member.ts
+++ b/src/ts/@overflow/email/redux/action/read_by_member.ts
@@ -1,3 +1,41 @@
-/**
- * Created by geek on 17. 7. 4.
- */
+import Action from '@overflow/commons/redux/Action';
+import EmailAuth from '@overflow/email/api/model/EmailAuth';
+
+import ReadByMemberPayload from '../payload/ReadByMemberPayload';
+
+// Action Type
+export type REQUEST = '@overflow/email/read_by_member/REQUEST';
+export type REQUEST_SUCCESS = '@overflow/email/read_by_member/REQUEST_SUCCESS';
+export type REQUEST_FAILURE = '@overflow/email/read_by_member/REQUEST_FAILURE';
+
+export const REQUEST: REQUEST = '@overflow/email/read_by_member/REQUEST';
+export const REQUEST_SUCCESS: REQUEST_SUCCESS = '@overflow/email/read_by_member/REQUEST_SUCCESS';
+export const REQUEST_FAILURE: REQUEST_FAILURE = '@overflow/email/read_by_member/REQUEST_FAILURE';
+
+// Action Creater
+export type request = (memberId: number) => Action;
+export type requestSuccess = (emailAuths: EmailAuth[]) => Action;
+export type requestFailure = (error: Error) => Action;
+
+export const request: request = (memberId: number): Action => {
+ return {
+ type: REQUEST,
+ payload: {
+ memberId: memberId,
+ },
+ };
+};
+
+export const requestSuccess: requestSuccess = (emailAuths: EmailAuth[]): Action => {
+ return {
+ type: REQUEST_SUCCESS,
+ payload: emailAuths,
+ };
+};
+
+export const requestFailure: requestFailure = (error: Error): Action => {
+ return {
+ type: REQUEST_FAILURE,
+ error: error,
+ };
+};
diff --git a/src/ts/@overflow/email/redux/action/send_email_by_member.ts b/src/ts/@overflow/email/redux/action/send_email_by_member.ts
index e69de29..3719ef7 100644
--- a/src/ts/@overflow/email/redux/action/send_email_by_member.ts
+++ b/src/ts/@overflow/email/redux/action/send_email_by_member.ts
@@ -0,0 +1,43 @@
+import Action from '@overflow/commons/redux/Action';
+import EmailAuth from '@overflow/email/api/model/EmailAuth';
+
+import SendEmailPayload from '../payload/SendEmailByMemberPayload';
+
+// Action Type
+export type REQUEST = '@overflow/email/send_email_by_member/REQUEST';
+export type REQUEST_SUCCESS = '@overflow/email/send_email_by_member/REQUEST_SUCCESS';
+export type REQUEST_FAILURE = '@overflow/email/send_email_by_member/REQUEST_FAILURE';
+
+export const REQUEST: REQUEST = '@overflow/email/send_email_by_member/REQUEST';
+export const REQUEST_SUCCESS: REQUEST_SUCCESS = '@overflow/email/send_email_by_member/REQUEST_SUCCESS';
+export const REQUEST_FAILURE: REQUEST_FAILURE = '@overflow/email/send_email_by_member/REQUEST_FAILURE';
+
+// Action Creater
+export type request = (memberId: number, email: string) => Action;
+export type requestSuccess = (emailAuth: EmailAuth) => Action;
+export type requestFailure = (error: Error) => Action;
+
+export const request: request = (memberId: number, email: string): Action => {
+ return {
+ type: REQUEST,
+ payload: {
+ memberId: memberId,
+ email: email,
+ },
+ };
+};
+
+export const requestSuccess: requestSuccess = (emailAuth: EmailAuth): Action => {
+ return {
+ type: REQUEST_SUCCESS,
+ payload: emailAuth,
+ };
+};
+
+export const requestFailure: requestFailure = (error: Error): Action => {
+ return {
+ type: REQUEST_FAILURE,
+ error: error,
+ };
+};
+
diff --git a/src/ts/@overflow/email/redux/payload/ModifyPayload.ts b/src/ts/@overflow/email/redux/payload/ModifyPayload.ts
index 4062be4..abb9ca2 100644
--- a/src/ts/@overflow/email/redux/payload/ModifyPayload.ts
+++ b/src/ts/@overflow/email/redux/payload/ModifyPayload.ts
@@ -1,3 +1,7 @@
-/**
- * Created by geek on 17. 7. 4.
- */
+import EmailAuth from '../../api/model/EmailAuth';
+
+interface ModifyPayload {
+ emailAuth: EmailAuth;
+}
+
+export default ModifyPayload;
diff --git a/src/ts/@overflow/email/redux/payload/ReadByAuthKeyPayload.ts b/src/ts/@overflow/email/redux/payload/ReadByAuthKeyPayload.ts
index 4062be4..0d0c644 100644
--- a/src/ts/@overflow/email/redux/payload/ReadByAuthKeyPayload.ts
+++ b/src/ts/@overflow/email/redux/payload/ReadByAuthKeyPayload.ts
@@ -1,3 +1,5 @@
-/**
- * Created by geek on 17. 7. 4.
- */
+interface ReadByAuthKeyPayload {
+ authKey: string;
+}
+
+export default ReadByAuthKeyPayload;
diff --git a/src/ts/@overflow/email/redux/payload/ReadByMemberPayload.ts b/src/ts/@overflow/email/redux/payload/ReadByMemberPayload.ts
index 4062be4..31a436b 100644
--- a/src/ts/@overflow/email/redux/payload/ReadByMemberPayload.ts
+++ b/src/ts/@overflow/email/redux/payload/ReadByMemberPayload.ts
@@ -1,3 +1,5 @@
-/**
- * Created by geek on 17. 7. 4.
- */
+interface ReadByMemberPayload {
+ memberId: number;
+}
+
+export default ReadByMemberPayload;
diff --git a/src/ts/@overflow/email/redux/payload/ReadPayload.ts b/src/ts/@overflow/email/redux/payload/ReadPayload.ts
index 4062be4..ea66cb2 100644
--- a/src/ts/@overflow/email/redux/payload/ReadPayload.ts
+++ b/src/ts/@overflow/email/redux/payload/ReadPayload.ts
@@ -1,3 +1,9 @@
/**
* Created by geek on 17. 7. 4.
*/
+
+interface ReadPayload {
+ id: number;
+}
+
+export default ReadPayload;
diff --git a/src/ts/@overflow/email/redux/payload/SendEmailByMemberPayload.ts b/src/ts/@overflow/email/redux/payload/SendEmailByMemberPayload.ts
index e69de29..fe8af1b 100644
--- a/src/ts/@overflow/email/redux/payload/SendEmailByMemberPayload.ts
+++ b/src/ts/@overflow/email/redux/payload/SendEmailByMemberPayload.ts
@@ -0,0 +1,6 @@
+interface SendEmailByMemberPayload {
+ memberId: number;
+ email: string;
+}
+
+export default SendEmailByMemberPayload;
diff --git a/src/ts/@overflow/email/redux/saga/modify.ts b/src/ts/@overflow/email/redux/saga/modify.ts
index 4062be4..3d7bc05 100644
--- a/src/ts/@overflow/email/redux/saga/modify.ts
+++ b/src/ts/@overflow/email/redux/saga/modify.ts
@@ -1,3 +1,44 @@
/**
* Created by geek on 17. 7. 4.
*/
+
+import { SagaIterator } from 'redux-saga';
+import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects';
+
+
+import AppContext from '@overflow/commons/context';
+import Action from '@overflow/commons/redux/Action';
+
+import EmailAuth from '@overflow/email/api/model/EmailAuth';
+
+import EmailAuthService from '@overflow/email/api/service/EmailAuthService';
+import * as ModifyAction from '../action/modify';
+import ModifyPayload from '../payload/ModifyPayload';
+
+function* modify(action: Action): SagaIterator {
+ try {
+ const ea = action.payload.emailAuth;
+ // yield put({
+ // type: types.SENDING_REQUEST,
+ // payload: {sendingRequest: true},
+ // });
+
+ const emailAuth = yield call(AppContext.getService().modify, ea);
+
+ // if (responseBody.token === undefined) {
+ // throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
+ // }
+ yield put(ModifyAction.requestSuccess(emailAuth));
+ } catch (e) {
+ yield put(ModifyAction.requestFailure(e));
+ } finally {
+ // yield put({
+ // type: types.SENDING_REQUEST,
+ // payload: {sendingRequest: false},
+ // });
+ }
+}
+
+export function* watchEmailModify(): SagaIterator {
+ yield takeLatest(ModifyAction.REQUEST, modify);
+}
diff --git a/src/ts/@overflow/email/redux/saga/read.ts b/src/ts/@overflow/email/redux/saga/read.ts
index 4062be4..9efad75 100644
--- a/src/ts/@overflow/email/redux/saga/read.ts
+++ b/src/ts/@overflow/email/redux/saga/read.ts
@@ -1,3 +1,40 @@
-/**
- * Created by geek on 17. 7. 4.
- */
+import { SagaIterator } from 'redux-saga';
+import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects';
+
+
+import AppContext from '@overflow/commons/context';
+import Action from '@overflow/commons/redux/Action';
+
+import EmailAuth from '@overflow/email/api/model/EmailAuth';
+
+import EmailAuthService from '@overflow/email/api/service/EmailAuthService';
+import * as ReadAction from '../action/read';
+import ReadPayload from '../payload/ReadPayload';
+
+function* read(action: Action): SagaIterator {
+ try {
+ const id = action.payload.id;
+ // yield put({
+ // type: types.SENDING_REQUEST,
+ // payload: {sendingRequest: true},
+ // });
+
+ const emailAuth = yield call(AppContext.getService().read, id);
+
+ // if (responseBody.token === undefined) {
+ // throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
+ // }
+ yield put(ReadAction.requestSuccess(emailAuth));
+ } catch (e) {
+ yield put(ReadAction.requestFailure(e));
+ } finally {
+ // yield put({
+ // type: types.SENDING_REQUEST,
+ // payload: {sendingRequest: false},
+ // });
+ }
+}
+
+export function* watchEmailRead(): SagaIterator {
+ yield takeLatest(ReadAction.REQUEST, read);
+}
diff --git a/src/ts/@overflow/email/redux/saga/read_by_auth_key.ts b/src/ts/@overflow/email/redux/saga/read_by_auth_key.ts
index 4062be4..aaaef5b 100644
--- a/src/ts/@overflow/email/redux/saga/read_by_auth_key.ts
+++ b/src/ts/@overflow/email/redux/saga/read_by_auth_key.ts
@@ -1,3 +1,40 @@
-/**
- * Created by geek on 17. 7. 4.
- */
+import { SagaIterator } from 'redux-saga';
+import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects';
+
+
+import AppContext from '@overflow/commons/context';
+import Action from '@overflow/commons/redux/Action';
+
+import EmailAuth from '@overflow/email/api/model/EmailAuth';
+
+import EmailAuthService from '@overflow/email/api/service/EmailAuthService';
+import * as ReadByAuthKeyAction from '../action/read_by_auth_key';
+import ReadByAuthKeyPayload from '../payload/ReadByAuthKeyPayload';
+
+function* readByAuthKey(action: Action): SagaIterator {
+ try {
+ const authKey = action.payload.authKey;
+ // yield put({
+ // type: types.SENDING_REQUEST,
+ // payload: {sendingRequest: true},
+ // });
+
+ const emailAuth = yield call(AppContext.getService().readByAuthKey, authKey);
+
+ // if (responseBody.token === undefined) {
+ // throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
+ // }
+ yield put(ReadByAuthKeyAction.requestSuccess(emailAuth));
+ } catch (e) {
+ yield put(ReadByAuthKeyAction.requestFailure(e));
+ } finally {
+ // yield put({
+ // type: types.SENDING_REQUEST,
+ // payload: {sendingRequest: false},
+ // });
+ }
+}
+
+export function* watchReadByAuthKey(): SagaIterator {
+ yield takeLatest(ReadByAuthKeyAction.REQUEST, readByAuthKey);
+}
diff --git a/src/ts/@overflow/email/redux/saga/read_by_member.ts b/src/ts/@overflow/email/redux/saga/read_by_member.ts
index 4062be4..749b0b7 100644
--- a/src/ts/@overflow/email/redux/saga/read_by_member.ts
+++ b/src/ts/@overflow/email/redux/saga/read_by_member.ts
@@ -1,3 +1,40 @@
-/**
- * Created by geek on 17. 7. 4.
- */
+import { SagaIterator } from 'redux-saga';
+import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects';
+
+
+import AppContext from '@overflow/commons/context';
+import Action from '@overflow/commons/redux/Action';
+
+import EmailAuth from '@overflow/email/api/model/EmailAuth';
+
+import EmailAuthService from '@overflow/email/api/service/EmailAuthService';
+import * as ReadByMemberAction from '../action/read_by_member';
+import ReadByMemberPayload from '../payload/ReadByMemberPayload';
+
+function* readByMember(action: Action): SagaIterator {
+ try {
+ const id = action.payload.memberId;
+ // yield put({
+ // type: types.SENDING_REQUEST,
+ // payload: {sendingRequest: true},
+ // });
+
+ const emailAuths = yield call(AppContext.getService().readByMember, id);
+
+ // if (responseBody.token === undefined) {
+ // throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
+ // }
+ yield put(ReadByMemberAction.requestSuccess(emailAuths));
+ } catch (e) {
+ yield put(ReadByMemberAction.requestFailure(e));
+ } finally {
+ // yield put({
+ // type: types.SENDING_REQUEST,
+ // payload: {sendingRequest: false},
+ // });
+ }
+}
+
+export function* watchReadByMember(): SagaIterator {
+ yield takeLatest(ReadByMemberAction.REQUEST, readByMember);
+}
diff --git a/src/ts/@overflow/email/redux/saga/send_email_by_member.ts b/src/ts/@overflow/email/redux/saga/send_email_by_member.ts
index e69de29..dbc71a9 100644
--- a/src/ts/@overflow/email/redux/saga/send_email_by_member.ts
+++ b/src/ts/@overflow/email/redux/saga/send_email_by_member.ts
@@ -0,0 +1,40 @@
+import { SagaIterator } from 'redux-saga';
+import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects';
+
+
+import AppContext from '@overflow/commons/context';
+import Action from '@overflow/commons/redux/Action';
+
+import EmailAuth from '@overflow/email/api/model/EmailAuth';
+
+import EmailAuthService from '@overflow/email/api/service/EmailAuthService';
+import * as SendEmailAction from '../action/send_email_by_member';
+import SendEmailPayload from '../payload/SendEmailByMemberPayload';
+
+function* sendEmail(action: Action): SagaIterator {
+ try {
+ const {memberId, email} = action.payload;
+ // yield put({
+ // type: types.SENDING_REQUEST,
+ // payload: {sendingRequest: true},
+ // });
+
+ const emailAuth = yield call(AppContext.getService().sendEmailByMember, memberId, email);
+
+ // if (responseBody.token === undefined) {
+ // throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
+ // }
+ yield put(SendEmailAction.requestSuccess(emailAuth));
+ } catch (e) {
+ yield put(SendEmailAction.requestFailure(e));
+ } finally {
+ // yield put({
+ // type: types.SENDING_REQUEST,
+ // payload: {sendingRequest: false},
+ // });
+ }
+}
+
+export function* watchSendEmail(): SagaIterator {
+ yield takeLatest(SendEmailAction.REQUEST, sendEmail);
+}
diff --git a/src/ts/@overflow/help/react/Help.tsx b/src/ts/@overflow/help/react/Help.tsx
new file mode 100644
index 0000000..e69de29
diff --git a/src/ts/@overflow/help/react/components/Help.tsx b/src/ts/@overflow/help/react/components/Help.tsx
new file mode 100644
index 0000000..e69de29
diff --git a/src/ts/@overflow/member/api/service/MemberService.ts b/src/ts/@overflow/member/api/service/MemberService.ts
index 7d9f71f..0a20dbc 100644
--- a/src/ts/@overflow/member/api/service/MemberService.ts
+++ b/src/ts/@overflow/member/api/service/MemberService.ts
@@ -36,6 +36,9 @@ export class MemberService extends Service {
return null;
}
+ public modify(member: Member): Member {
+ return null;
+ }
}
export default MemberService;
diff --git a/src/ts/@overflow/member/redux/action/modify.ts b/src/ts/@overflow/member/redux/action/modify.ts
index 5c15c15..e5a70d9 100644
--- a/src/ts/@overflow/member/redux/action/modify.ts
+++ b/src/ts/@overflow/member/redux/action/modify.ts
@@ -1,3 +1,41 @@
-/**
- * Created by geek on 17. 7. 3.
- */
+import Action from '@overflow/commons/redux/Action';
+import Member from '@overflow/member/api/model/Member';
+
+import ModifyPayload from '../payload/ModifyPayload';
+
+// Action Type
+export type REQUEST = '@overflow/member/modify/REQUEST';
+export type REQUEST_SUCCESS = '@overflow/member/modify/REQUEST_SUCCESS';
+export type REQUEST_FAILURE = '@overflow/member/modify/REQUEST_FAILURE';
+
+export const REQUEST: REQUEST = '@overflow/member/modify/REQUEST';
+export const REQUEST_SUCCESS: REQUEST_SUCCESS = '@overflow/member/modify/REQUEST_SUCCESS';
+export const REQUEST_FAILURE: REQUEST_FAILURE = '@overflow/member/modify/REQUEST_FAILURE';
+
+// Action Creater
+export type request = (member: Member) => Action;
+export type requestSuccess = (member: Member) => Action;
+export type requestFailure = (error: Error) => Action;
+
+export const request: request = (member: Member): Action => {
+ return {
+ type: REQUEST,
+ payload: {
+ member: member,
+ },
+ };
+};
+
+export const requestSuccess: requestSuccess = (member: Member): Action => {
+ return {
+ type: REQUEST_SUCCESS,
+ payload: member,
+ };
+};
+
+export const requestFailure: requestFailure = (error: Error): Action => {
+ return {
+ type: REQUEST_FAILURE,
+ error: error,
+ };
+};
diff --git a/src/ts/@overflow/member/redux/action/read.ts b/src/ts/@overflow/member/redux/action/read.ts
index 5c15c15..e6ede60 100644
--- a/src/ts/@overflow/member/redux/action/read.ts
+++ b/src/ts/@overflow/member/redux/action/read.ts
@@ -1,3 +1,41 @@
-/**
- * Created by geek on 17. 7. 3.
- */
+import Action from '@overflow/commons/redux/Action';
+import Member from '@overflow/member/api/model/Member';
+
+import ReadPayload from '../payload/ReadPayload';
+
+// Action Type
+export type REQUEST = '@overflow/member/read/REQUEST';
+export type REQUEST_SUCCESS = '@overflow/member/read/REQUEST_SUCCESS';
+export type REQUEST_FAILURE = '@overflow/member/read/REQUEST_FAILURE';
+
+export const REQUEST: REQUEST = '@overflow/member/read/REQUEST';
+export const REQUEST_SUCCESS: REQUEST_SUCCESS = '@overflow/member/read/REQUEST_SUCCESS';
+export const REQUEST_FAILURE: REQUEST_FAILURE = '@overflow/member/read/REQUEST_FAILURE';
+
+// Action Creater
+export type request = (id: number) => Action;
+export type requestSuccess = (member: Member) => Action;
+export type requestFailure = (error: Error) => Action;
+
+export const request: request = (id: number): Action => {
+ return {
+ type: REQUEST,
+ payload: {
+ id: id,
+ },
+ };
+};
+
+export const requestSuccess: requestSuccess = (member: Member): Action => {
+ return {
+ type: REQUEST_SUCCESS,
+ payload: member,
+ };
+};
+
+export const requestFailure: requestFailure = (error: Error): Action => {
+ return {
+ type: REQUEST_FAILURE,
+ error: error,
+ };
+};
diff --git a/src/ts/@overflow/member/redux/payload/ModifyPayload.ts b/src/ts/@overflow/member/redux/payload/ModifyPayload.ts
index 5c15c15..e237815 100644
--- a/src/ts/@overflow/member/redux/payload/ModifyPayload.ts
+++ b/src/ts/@overflow/member/redux/payload/ModifyPayload.ts
@@ -1,3 +1,6 @@
-/**
- * Created by geek on 17. 7. 3.
- */
+import Member from '../../api/model/Member';
+interface ModifyPayload {
+ member: Member;
+}
+
+export default ModifyPayload;
diff --git a/src/ts/@overflow/member/redux/payload/ReadPayload.ts b/src/ts/@overflow/member/redux/payload/ReadPayload.ts
index 5c15c15..dc4df99 100644
--- a/src/ts/@overflow/member/redux/payload/ReadPayload.ts
+++ b/src/ts/@overflow/member/redux/payload/ReadPayload.ts
@@ -1,3 +1,5 @@
-/**
- * Created by geek on 17. 7. 3.
- */
+interface ReadPayload {
+ id: number;
+}
+
+export default ReadPayload;
diff --git a/src/ts/@overflow/member/redux/saga/modify.ts b/src/ts/@overflow/member/redux/saga/modify.ts
index 5c15c15..1905bb4 100644
--- a/src/ts/@overflow/member/redux/saga/modify.ts
+++ b/src/ts/@overflow/member/redux/saga/modify.ts
@@ -1,3 +1,39 @@
-/**
- * Created by geek on 17. 7. 3.
- */
+import { SagaIterator } from 'redux-saga';
+import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects';
+
+
+import AppContext from '@overflow/commons/context';
+import Action from '@overflow/commons/redux/Action';
+
+import Member from '../../api/model/Member';
+import MemberService from '../../api/service/MemberService';
+import * as ModifyActions from '../action/modify';
+import ModifyPayload from '../payload/ModifyPayload';
+
+function* modify(action: Action): SagaIterator {
+ try {
+ const tempMember = action.payload.member;
+ // yield put({
+ // type: types.SENDING_REQUEST,
+ // payload: {sendingRequest: true},
+ // });
+
+ const member = yield call(AppContext.getService().modify, tempMember);
+
+ // if (responseBody.token === undefined) {
+ // throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
+ // }
+ yield put(ModifyActions.requestSuccess(member));
+ } catch (e) {
+ yield put(ModifyActions.requestFailure(e));
+ } finally {
+ // yield put({
+ // type: types.SENDING_REQUEST,
+ // payload: {sendingRequest: false},
+ // });
+ }
+}
+
+export function* watchMemberModify(): SagaIterator {
+ yield takeLatest(ModifyActions.REQUEST, modify);
+}
diff --git a/src/ts/@overflow/member/redux/saga/read.ts b/src/ts/@overflow/member/redux/saga/read.ts
index 5c15c15..c81ddd3 100644
--- a/src/ts/@overflow/member/redux/saga/read.ts
+++ b/src/ts/@overflow/member/redux/saga/read.ts
@@ -1,3 +1,39 @@
-/**
- * Created by geek on 17. 7. 3.
- */
+import { SagaIterator } from 'redux-saga';
+import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects';
+
+
+import AppContext from '@overflow/commons/context';
+import Action from '@overflow/commons/redux/Action';
+
+import Member from '../../api/model/Member';
+import MemberService from '../../api/service/MemberService';
+import * as ReadActions from '../action/read';
+import ReadPayload from '../payload/ReadPayload';
+
+function* read(action: Action): SagaIterator {
+ try {
+ const id = action.payload.id;
+ // yield put({
+ // type: types.SENDING_REQUEST,
+ // payload: {sendingRequest: true},
+ // });
+
+ const member = yield call(AppContext.getService().read, id);
+
+ // if (responseBody.token === undefined) {
+ // throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
+ // }
+ yield put(ReadActions.requestSuccess(member));
+ } catch (e) {
+ yield put(ReadActions.requestFailure(e));
+ } finally {
+ // yield put({
+ // type: types.SENDING_REQUEST,
+ // payload: {sendingRequest: false},
+ // });
+ }
+}
+
+export function* watchMemberRead(): SagaIterator {
+ yield takeLatest(ReadActions.REQUEST, read);
+}