diff --git a/src/ts/@overflow/apikey/redux/saga/read.ts b/src/ts/@overflow/apikey/redux/saga/read.ts index 3d1ecb9..62f2fb8 100644 --- a/src/ts/@overflow/apikey/redux/saga/read.ts +++ b/src/ts/@overflow/apikey/redux/saga/read.ts @@ -34,6 +34,6 @@ function* read(action: Action): SagaIterator { } } -export function* watchSignin(): SagaIterator { +export function* watchRead(): SagaIterator { yield takeLatest(ReadActions.REQUEST, read); } diff --git a/src/ts/@overflow/apikey/redux/saga/regist.ts b/src/ts/@overflow/apikey/redux/saga/regist.ts index 33fec61..742cae4 100644 --- a/src/ts/@overflow/apikey/redux/saga/regist.ts +++ b/src/ts/@overflow/apikey/redux/saga/regist.ts @@ -34,6 +34,6 @@ function* regist(action: Action): SagaIterator { } } -export function* watchSignin(): SagaIterator { +export function* watchRegist(): SagaIterator { yield takeLatest(RegistActions.REQUEST, regist); } diff --git a/src/ts/@overflow/infra/redux/action/host_read.ts b/src/ts/@overflow/infra/redux/action/host_read.ts index e69de29..697d305 100644 --- a/src/ts/@overflow/infra/redux/action/host_read.ts +++ b/src/ts/@overflow/infra/redux/action/host_read.ts @@ -0,0 +1,43 @@ +import Action from '@overflow/commons/redux/Action'; +import InfraHost from '../..//api/model/InfraHost'; + +import HostReadPayload from '../payload/HostReadPayload'; + +// Action Type +export type REQUEST = '@overflow/infraHost/read/REQUEST'; +export type REQUEST_SUCCESS = '@overflow/infraHost/read/REQUEST_SUCCESS'; +export type REQUEST_FAILURE = '@overflow/infraHost/read/REQUEST_FAILURE'; + +export const REQUEST: REQUEST = '@overflow/infraHost/read/REQUEST'; +export const REQUEST_SUCCESS: REQUEST_SUCCESS = '@overflow/infraHost/read/REQUEST_SUCCESS'; +export const REQUEST_FAILURE: REQUEST_FAILURE = '@overflow/infraHost/read/REQUEST_FAILURE'; + +// Action Creater +export type request = (id: number) => Action; +export type requestSuccess = (infraHost: InfraHost) => Action; +export type requestFailure = (error: Error) => Action; + + + +export const request: request = (id: number): Action => { + return { + type: REQUEST, + payload: { + id:id, + }, + }; +}; + +export const requestSuccess: requestSuccess = (infraHost: InfraHost): Action => { + return { + type: REQUEST_SUCCESS, + payload: infraHost, + }; +}; + +export const requestFailure: requestFailure = (error: Error): Action => { + return { + type: REQUEST_FAILURE, + error: error, + }; +}; diff --git a/src/ts/@overflow/infra/redux/action/machine_read.ts b/src/ts/@overflow/infra/redux/action/machine_read.ts index e69de29..6f47f3d 100644 --- a/src/ts/@overflow/infra/redux/action/machine_read.ts +++ b/src/ts/@overflow/infra/redux/action/machine_read.ts @@ -0,0 +1,43 @@ +import Action from '@overflow/commons/redux/Action'; +import InfraMachine from '../..//api/model/InfraMachine'; + +import MachineReadPayload from '../payload/MachineReadPayload'; + +// Action Type +export type REQUEST = '@overflow/infraMachine/read/REQUEST'; +export type REQUEST_SUCCESS = '@overflow/infraMachine/read/REQUEST_SUCCESS'; +export type REQUEST_FAILURE = '@overflow/infraMachine/read/REQUEST_FAILURE'; + +export const REQUEST: REQUEST = '@overflow/infraMachine/read/REQUEST'; +export const REQUEST_SUCCESS: REQUEST_SUCCESS = '@overflow/infraMachine/read/REQUEST_SUCCESS'; +export const REQUEST_FAILURE: REQUEST_FAILURE = '@overflow/infraMachine/read/REQUEST_FAILURE'; + +// Action Creater +export type request = (id: number) => Action; +export type requestSuccess = (infraMachine: InfraMachine) => Action; +export type requestFailure = (error: Error) => Action; + + + +export const request: request = (id: number): Action => { + return { + type: REQUEST, + payload: { + id:id, + }, + }; +}; + +export const requestSuccess: requestSuccess = (infraMachine: InfraMachine): Action => { + return { + type: REQUEST_SUCCESS, + payload: infraMachine, + }; +}; + +export const requestFailure: requestFailure = (error: Error): Action => { + return { + type: REQUEST_FAILURE, + error: error, + }; +}; diff --git a/src/ts/@overflow/infra/redux/action/os_application_read.ts b/src/ts/@overflow/infra/redux/action/os_application_read.ts index e69de29..9a73e2f 100644 --- a/src/ts/@overflow/infra/redux/action/os_application_read.ts +++ b/src/ts/@overflow/infra/redux/action/os_application_read.ts @@ -0,0 +1,43 @@ +import Action from '@overflow/commons/redux/Action'; +import InfraOSApplication from '../..//api/model/InfraOSApplication'; + +import OSApplicationReadPayload from '../payload/OSApplicationReadPayload'; + +// Action Type +export type REQUEST = '@overflow/infraMachine/read/REQUEST'; +export type REQUEST_SUCCESS = '@overflow/infraMachine/read/REQUEST_SUCCESS'; +export type REQUEST_FAILURE = '@overflow/infraMachine/read/REQUEST_FAILURE'; + +export const REQUEST: REQUEST = '@overflow/infraMachine/read/REQUEST'; +export const REQUEST_SUCCESS: REQUEST_SUCCESS = '@overflow/infraMachine/read/REQUEST_SUCCESS'; +export const REQUEST_FAILURE: REQUEST_FAILURE = '@overflow/infraMachine/read/REQUEST_FAILURE'; + +// Action Creater +export type request = (id: number) => Action; +export type requestSuccess = (infraOSApplication: InfraOSApplication) => Action; +export type requestFailure = (error: Error) => Action; + + + +export const request: request = (id: number): Action => { + return { + type: REQUEST, + payload: { + id:id, + }, + }; +}; + +export const requestSuccess: requestSuccess = (infraOSApplication: InfraOSApplication): Action => { + return { + type: REQUEST_SUCCESS, + payload: infraOSApplication, + }; +}; + +export const requestFailure: requestFailure = (error: Error): Action => { + return { + type: REQUEST_FAILURE, + error: error, + }; +}; diff --git a/src/ts/@overflow/infra/redux/action/os_daemon_read.ts b/src/ts/@overflow/infra/redux/action/os_daemon_read.ts index e69de29..bb9bedd 100644 --- a/src/ts/@overflow/infra/redux/action/os_daemon_read.ts +++ b/src/ts/@overflow/infra/redux/action/os_daemon_read.ts @@ -0,0 +1,43 @@ +import Action from '@overflow/commons/redux/Action'; +import InfraOSDaemon from '../..//api/model/InfraOSDaemon'; + +import OSDaemonReadPayload from '../payload/OSDaemonReadPayload'; + +// Action Type +export type REQUEST = '@overflow/infraMachine/read/REQUEST'; +export type REQUEST_SUCCESS = '@overflow/infraMachine/read/REQUEST_SUCCESS'; +export type REQUEST_FAILURE = '@overflow/infraMachine/read/REQUEST_FAILURE'; + +export const REQUEST: REQUEST = '@overflow/infraMachine/read/REQUEST'; +export const REQUEST_SUCCESS: REQUEST_SUCCESS = '@overflow/infraMachine/read/REQUEST_SUCCESS'; +export const REQUEST_FAILURE: REQUEST_FAILURE = '@overflow/infraMachine/read/REQUEST_FAILURE'; + +// Action Creater +export type request = (id: number) => Action; +export type requestSuccess = (infraOSDaemon: InfraOSDaemon) => Action; +export type requestFailure = (error: Error) => Action; + + + +export const request: request = (id: number): Action => { + return { + type: REQUEST, + payload: { + id:id, + }, + }; +}; + +export const requestSuccess: requestSuccess = (infraOSDaemon: InfraOSDaemon): Action => { + return { + type: REQUEST_SUCCESS, + payload: infraOSDaemon, + }; +}; + +export const requestFailure: requestFailure = (error: Error): Action => { + return { + type: REQUEST_FAILURE, + error: error, + }; +}; diff --git a/src/ts/@overflow/infra/redux/action/os_port_read.ts b/src/ts/@overflow/infra/redux/action/os_port_read.ts index e69de29..061617a 100644 --- a/src/ts/@overflow/infra/redux/action/os_port_read.ts +++ b/src/ts/@overflow/infra/redux/action/os_port_read.ts @@ -0,0 +1,43 @@ +import Action from '@overflow/commons/redux/Action'; +import InfraOSPort from '../..//api/model/InfraOSPort'; + +import OSPortReadPayload from '../payload/OSPortReadPayload'; + +// Action Type +export type REQUEST = '@overflow/infraMachine/read/REQUEST'; +export type REQUEST_SUCCESS = '@overflow/infraMachine/read/REQUEST_SUCCESS'; +export type REQUEST_FAILURE = '@overflow/infraMachine/read/REQUEST_FAILURE'; + +export const REQUEST: REQUEST = '@overflow/infraMachine/read/REQUEST'; +export const REQUEST_SUCCESS: REQUEST_SUCCESS = '@overflow/infraMachine/read/REQUEST_SUCCESS'; +export const REQUEST_FAILURE: REQUEST_FAILURE = '@overflow/infraMachine/read/REQUEST_FAILURE'; + +// Action Creater +export type request = (id: number) => Action; +export type requestSuccess = (infraOSPort: InfraOSPort) => Action; +export type requestFailure = (error: Error) => Action; + + + +export const request: request = (id: number): Action => { + return { + type: REQUEST, + payload: { + id:id, + }, + }; +}; + +export const requestSuccess: requestSuccess = (infraOSPort: InfraOSPort): Action => { + return { + type: REQUEST_SUCCESS, + payload: infraOSPort, + }; +}; + +export const requestFailure: requestFailure = (error: Error): Action => { + return { + type: REQUEST_FAILURE, + error: error, + }; +}; diff --git a/src/ts/@overflow/infra/redux/action/os_read.ts b/src/ts/@overflow/infra/redux/action/os_read.ts index e69de29..a8b86d7 100644 --- a/src/ts/@overflow/infra/redux/action/os_read.ts +++ b/src/ts/@overflow/infra/redux/action/os_read.ts @@ -0,0 +1,43 @@ +import Action from '@overflow/commons/redux/Action'; +import InfraOS from '../..//api/model/InfraOS'; + +import OSReadPayload from '../payload/OSReadPayload'; + +// Action Type +export type REQUEST = '@overflow/infraMachine/read/REQUEST'; +export type REQUEST_SUCCESS = '@overflow/infraMachine/read/REQUEST_SUCCESS'; +export type REQUEST_FAILURE = '@overflow/infraMachine/read/REQUEST_FAILURE'; + +export const REQUEST: REQUEST = '@overflow/infraMachine/read/REQUEST'; +export const REQUEST_SUCCESS: REQUEST_SUCCESS = '@overflow/infraMachine/read/REQUEST_SUCCESS'; +export const REQUEST_FAILURE: REQUEST_FAILURE = '@overflow/infraMachine/read/REQUEST_FAILURE'; + +// Action Creater +export type request = (id: number) => Action; +export type requestSuccess = (infraOS: InfraOS) => Action; +export type requestFailure = (error: Error) => Action; + + + +export const request: request = (id: number): Action => { + return { + type: REQUEST, + payload: { + id:id, + }, + }; +}; + +export const requestSuccess: requestSuccess = (infraOS: InfraOS): Action => { + return { + type: REQUEST_SUCCESS, + payload: infraOS, + }; +}; + +export const requestFailure: requestFailure = (error: Error): Action => { + return { + type: REQUEST_FAILURE, + error: error, + }; +}; diff --git a/src/ts/@overflow/infra/redux/action/read.ts b/src/ts/@overflow/infra/redux/action/read.ts index e69de29..d7ab685 100644 --- a/src/ts/@overflow/infra/redux/action/read.ts +++ b/src/ts/@overflow/infra/redux/action/read.ts @@ -0,0 +1,43 @@ +import Action from '@overflow/commons/redux/Action'; +import Infra from '../..//api/model/Infra'; + +import ReadPayload from '../payload/ReadPayload'; + +// Action Type +export type REQUEST = '@overflow/infraMachine/read/REQUEST'; +export type REQUEST_SUCCESS = '@overflow/infraMachine/read/REQUEST_SUCCESS'; +export type REQUEST_FAILURE = '@overflow/infraMachine/read/REQUEST_FAILURE'; + +export const REQUEST: REQUEST = '@overflow/infraMachine/read/REQUEST'; +export const REQUEST_SUCCESS: REQUEST_SUCCESS = '@overflow/infraMachine/read/REQUEST_SUCCESS'; +export const REQUEST_FAILURE: REQUEST_FAILURE = '@overflow/infraMachine/read/REQUEST_FAILURE'; + +// Action Creater +export type request = (id: number) => Action; +export type requestSuccess = (infra: Infra) => Action; +export type requestFailure = (error: Error) => Action; + + + +export const request: request = (id: number): Action => { + return { + type: REQUEST, + payload: { + id:id, + }, + }; +}; + +export const requestSuccess: requestSuccess = (infra: Infra): Action => { + return { + type: REQUEST_SUCCESS, + payload: infra, + }; +}; + +export const requestFailure: requestFailure = (error: Error): Action => { + return { + type: REQUEST_FAILURE, + error: error, + }; +}; diff --git a/src/ts/@overflow/infra/redux/action/service_read.ts b/src/ts/@overflow/infra/redux/action/service_read.ts index e69de29..1a2a529 100644 --- a/src/ts/@overflow/infra/redux/action/service_read.ts +++ b/src/ts/@overflow/infra/redux/action/service_read.ts @@ -0,0 +1,43 @@ +import Action from '@overflow/commons/redux/Action'; +import InfraService from '../..//api/model/InfraService'; + +import ServiceReadPayload from '../payload/ServiceReadPayload'; + +// Action Type +export type REQUEST = '@overflow/infraMachine/read/REQUEST'; +export type REQUEST_SUCCESS = '@overflow/infraMachine/read/REQUEST_SUCCESS'; +export type REQUEST_FAILURE = '@overflow/infraMachine/read/REQUEST_FAILURE'; + +export const REQUEST: REQUEST = '@overflow/infraMachine/read/REQUEST'; +export const REQUEST_SUCCESS: REQUEST_SUCCESS = '@overflow/infraMachine/read/REQUEST_SUCCESS'; +export const REQUEST_FAILURE: REQUEST_FAILURE = '@overflow/infraMachine/read/REQUEST_FAILURE'; + +// Action Creater +export type request = (id: number) => Action; +export type requestSuccess = (infraService: InfraService) => Action; +export type requestFailure = (error: Error) => Action; + + + +export const request: request = (id: number): Action => { + return { + type: REQUEST, + payload: { + id:id, + }, + }; +}; + +export const requestSuccess: requestSuccess = (infraService: InfraService): Action => { + return { + type: REQUEST_SUCCESS, + payload: infraService, + }; +}; + +export const requestFailure: requestFailure = (error: Error): Action => { + return { + type: REQUEST_FAILURE, + error: error, + }; +}; diff --git a/src/ts/@overflow/infra/redux/saga/host_read.ts b/src/ts/@overflow/infra/redux/saga/host_read.ts index e69de29..314d41b 100644 --- a/src/ts/@overflow/infra/redux/saga/host_read.ts +++ b/src/ts/@overflow/infra/redux/saga/host_read.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 InfraHost from '../../api/model/InfraHost'; +import InfraHostService from '../../api/service/InfraHostService'; +import * as ReadActions from '../action/host_read'; +import HostReadPayload from '../payload/HostReadPayload'; + +function* read(action: Action): SagaIterator { + try { + const {id} = action.payload; + // yield put({ + // type: types.SENDING_REQUEST, + // payload: {sendingRequest: true}, + // }); + + const retApikey = 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(retApikey)); + } catch (e) { + yield put(ReadActions.requestFailure(e)); + } finally { + // yield put({ + // type: types.SENDING_REQUEST, + // payload: {sendingRequest: false}, + // }); + } +} + +export function* watchHostRead(): SagaIterator { + yield takeLatest(ReadActions.REQUEST, read); +} diff --git a/src/ts/@overflow/infra/redux/saga/host_regist.ts b/src/ts/@overflow/infra/redux/saga/host_regist.ts new file mode 100644 index 0000000..b83d88c --- /dev/null +++ b/src/ts/@overflow/infra/redux/saga/host_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 InfraHost from '../../api/model/InfraHost'; +import InfraHostService from '../../api/service/InfraHostService'; +import * as RegistActions from '../action/host_regist'; +import HostRegistPayload from '../payload/HostRegistPayload'; + +function* regist(action: Action): SagaIterator { + try { + const {infraHost} = action.payload; + // yield put({ + // type: types.SENDING_REQUEST, + // payload: {sendingRequest: true}, + // }); + + const retApikey = yield call(AppContext.getService().regist, infraHost); + + // if (responseBody.token === undefined) { + // throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE); + // } + yield put(RegistActions.requestSuccess(retApikey)); + } catch (e) { + yield put(RegistActions.requestFailure(e)); + } finally { + // yield put({ + // type: types.SENDING_REQUEST, + // payload: {sendingRequest: false}, + // }); + } +} + +export function* watchHostRegist(): SagaIterator { + yield takeLatest(RegistActions.REQUEST, regist); +} diff --git a/src/ts/@overflow/infra/redux/saga/infra_host_regist.ts b/src/ts/@overflow/infra/redux/saga/infra_host_regist.ts deleted file mode 100644 index e69de29..0000000 diff --git a/src/ts/@overflow/infra/redux/saga/infra_machine_regist.ts b/src/ts/@overflow/infra/redux/saga/infra_machine_regist.ts deleted file mode 100644 index e69de29..0000000 diff --git a/src/ts/@overflow/infra/redux/saga/infra_os_application_regist.ts b/src/ts/@overflow/infra/redux/saga/infra_os_application_regist.ts deleted file mode 100644 index e69de29..0000000 diff --git a/src/ts/@overflow/infra/redux/saga/infra_os_daemon_regist.ts b/src/ts/@overflow/infra/redux/saga/infra_os_daemon_regist.ts deleted file mode 100644 index e69de29..0000000 diff --git a/src/ts/@overflow/infra/redux/saga/infra_os_port_regist.ts b/src/ts/@overflow/infra/redux/saga/infra_os_port_regist.ts deleted file mode 100644 index e69de29..0000000 diff --git a/src/ts/@overflow/infra/redux/saga/infra_os_regist.ts b/src/ts/@overflow/infra/redux/saga/infra_os_regist.ts deleted file mode 100644 index e69de29..0000000 diff --git a/src/ts/@overflow/infra/redux/saga/infra_regist.ts b/src/ts/@overflow/infra/redux/saga/infra_regist.ts deleted file mode 100644 index e69de29..0000000 diff --git a/src/ts/@overflow/infra/redux/saga/infra_service_regist.ts b/src/ts/@overflow/infra/redux/saga/infra_service_regist.ts deleted file mode 100644 index e69de29..0000000 diff --git a/src/ts/@overflow/infra/redux/saga/machine_read.ts b/src/ts/@overflow/infra/redux/saga/machine_read.ts index e69de29..e250142 100644 --- a/src/ts/@overflow/infra/redux/saga/machine_read.ts +++ b/src/ts/@overflow/infra/redux/saga/machine_read.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 InfraMachine from '../../api/model/InfraMachine'; +import InfraMachineService from '../../api/service/InfraMachineService'; +import * as ReadActions from '../action/machine_read'; +import MachineReadPayload from '../payload/MachineReadPayload'; + +function* read(action: Action): SagaIterator { + try { + const {id} = action.payload; + // yield put({ + // type: types.SENDING_REQUEST, + // payload: {sendingRequest: true}, + // }); + + const retApikey = 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(retApikey)); + } catch (e) { + yield put(ReadActions.requestFailure(e)); + } finally { + // yield put({ + // type: types.SENDING_REQUEST, + // payload: {sendingRequest: false}, + // }); + } +} + +export function* watchMachineRead(): SagaIterator { + yield takeLatest(ReadActions.REQUEST, read); +} diff --git a/src/ts/@overflow/infra/redux/saga/machine_regist.ts b/src/ts/@overflow/infra/redux/saga/machine_regist.ts new file mode 100644 index 0000000..bc80df8 --- /dev/null +++ b/src/ts/@overflow/infra/redux/saga/machine_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 InfraMachine from '../../api/model/InfraMachine'; +import InfraMachineService from '../../api/service/InfraMachineService'; +import * as RegistActions from '../action/machine_regist'; +import MachineRegistPayload from '../payload/MachineRegistPayload'; + +function* regist(action: Action): SagaIterator { + try { + const {infraMachine} = action.payload; + // yield put({ + // type: types.SENDING_REQUEST, + // payload: {sendingRequest: true}, + // }); + + const retApikey = yield call(AppContext.getService().regist, infraMachine); + + // if (responseBody.token === undefined) { + // throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE); + // } + yield put(RegistActions.requestSuccess(retApikey)); + } catch (e) { + yield put(RegistActions.requestFailure(e)); + } finally { + // yield put({ + // type: types.SENDING_REQUEST, + // payload: {sendingRequest: false}, + // }); + } +} + +export function* watchMachineRegist(): SagaIterator { + yield takeLatest(RegistActions.REQUEST, regist); +} diff --git a/src/ts/@overflow/infra/redux/saga/os_application_read.ts b/src/ts/@overflow/infra/redux/saga/os_application_read.ts index e69de29..638b286 100644 --- a/src/ts/@overflow/infra/redux/saga/os_application_read.ts +++ b/src/ts/@overflow/infra/redux/saga/os_application_read.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 InfraOSApplication from '../../api/model/InfraOSApplication'; +import InfraOSApplicationService from '../../api/service/InfraOSApplicationService'; +import * as ReadActions from '../action/os_application_read'; +import OSApplicationReadPayload from '../payload/OSApplicationReadPayload'; + +function* read(action: Action): SagaIterator { + try { + const {id} = action.payload; + // yield put({ + // type: types.SENDING_REQUEST, + // payload: {sendingRequest: true}, + // }); + + const retApikey = 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(retApikey)); + } catch (e) { + yield put(ReadActions.requestFailure(e)); + } finally { + // yield put({ + // type: types.SENDING_REQUEST, + // payload: {sendingRequest: false}, + // }); + } +} + +export function* watchOSApplicationRead(): SagaIterator { + yield takeLatest(ReadActions.REQUEST, read); +} diff --git a/src/ts/@overflow/infra/redux/saga/os_application_regist.ts b/src/ts/@overflow/infra/redux/saga/os_application_regist.ts new file mode 100644 index 0000000..50af81c --- /dev/null +++ b/src/ts/@overflow/infra/redux/saga/os_application_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 InfraOSApplication from '../../api/model/InfraOSApplication'; +import InfraOSApplicationService from '../../api/service/InfraOSApplicationService'; +import * as RegistActions from '../action/os_application_regist'; +import OSApplicationRegistPayload from '../payload/OSApplicationRegistPayload'; + +function* regist(action: Action): SagaIterator { + try { + const {infraOSApplication} = action.payload; + // yield put({ + // type: types.SENDING_REQUEST, + // payload: {sendingRequest: true}, + // }); + + const retApikey = yield call(AppContext.getService().regist, infraOSApplication); + + // if (responseBody.token === undefined) { + // throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE); + // } + yield put(RegistActions.requestSuccess(retApikey)); + } catch (e) { + yield put(RegistActions.requestFailure(e)); + } finally { + // yield put({ + // type: types.SENDING_REQUEST, + // payload: {sendingRequest: false}, + // }); + } +} + +export function* watchOSApplicationRegist(): SagaIterator { + yield takeLatest(RegistActions.REQUEST, regist); +} diff --git a/src/ts/@overflow/infra/redux/saga/os_daemon_read.ts b/src/ts/@overflow/infra/redux/saga/os_daemon_read.ts index e69de29..e8b0813 100644 --- a/src/ts/@overflow/infra/redux/saga/os_daemon_read.ts +++ b/src/ts/@overflow/infra/redux/saga/os_daemon_read.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 InfraOSDaemon from '../../api/model/InfraOSDaemon'; +import InfraOSDaemonService from '../../api/service/InfraOSDaemonService'; +import * as ReadActions from '../action/os_daemon_read'; +import OSDaemonReadPayload from '../payload/OSDaemonReadPayload'; + +function* read(action: Action): SagaIterator { + try { + const {id} = action.payload; + // yield put({ + // type: types.SENDING_REQUEST, + // payload: {sendingRequest: true}, + // }); + + const retApikey = 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(retApikey)); + } catch (e) { + yield put(ReadActions.requestFailure(e)); + } finally { + // yield put({ + // type: types.SENDING_REQUEST, + // payload: {sendingRequest: false}, + // }); + } +} + +export function* watchOSDaemonRead(): SagaIterator { + yield takeLatest(ReadActions.REQUEST, read); +} diff --git a/src/ts/@overflow/infra/redux/saga/os_daemon_regist.ts b/src/ts/@overflow/infra/redux/saga/os_daemon_regist.ts new file mode 100644 index 0000000..3f2afbc --- /dev/null +++ b/src/ts/@overflow/infra/redux/saga/os_daemon_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 InfraOSDaemon from '../../api/model/InfraOSDaemon'; +import InfraOSDaemonService from '../../api/service/InfraOSDaemonService'; +import * as RegistActions from '../action/os_daemon_regist'; +import OSDaemonRegistPayload from '../payload/OSDaemonRegistPayload'; + +function* regist(action: Action): SagaIterator { + try { + const {infraOSDaemon} = action.payload; + // yield put({ + // type: types.SENDING_REQUEST, + // payload: {sendingRequest: true}, + // }); + + const retApikey = yield call(AppContext.getService().regist, infraOSDaemon); + + // if (responseBody.token === undefined) { + // throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE); + // } + yield put(RegistActions.requestSuccess(retApikey)); + } catch (e) { + yield put(RegistActions.requestFailure(e)); + } finally { + // yield put({ + // type: types.SENDING_REQUEST, + // payload: {sendingRequest: false}, + // }); + } +} + +export function* watchOSDaemonRegist(): SagaIterator { + yield takeLatest(RegistActions.REQUEST, regist); +} diff --git a/src/ts/@overflow/infra/redux/saga/os_port_read.ts b/src/ts/@overflow/infra/redux/saga/os_port_read.ts index e69de29..d7a5ea3 100644 --- a/src/ts/@overflow/infra/redux/saga/os_port_read.ts +++ b/src/ts/@overflow/infra/redux/saga/os_port_read.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 InfraOSPort from '../../api/model/InfraOSPort'; +import InfraOSPortService from '../../api/service/InfraOSPortService'; +import * as ReadActions from '../action/os_port_read'; +import OSPortReadPayload from '../payload/OSPortReadPayload'; + +function* read(action: Action): SagaIterator { + try { + const {id} = action.payload; + // yield put({ + // type: types.SENDING_REQUEST, + // payload: {sendingRequest: true}, + // }); + + const retApikey = 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(retApikey)); + } catch (e) { + yield put(ReadActions.requestFailure(e)); + } finally { + // yield put({ + // type: types.SENDING_REQUEST, + // payload: {sendingRequest: false}, + // }); + } +} + +export function* watchOSPortRead(): SagaIterator { + yield takeLatest(ReadActions.REQUEST, read); +} diff --git a/src/ts/@overflow/infra/redux/saga/os_port_regist.ts b/src/ts/@overflow/infra/redux/saga/os_port_regist.ts new file mode 100644 index 0000000..27df76b --- /dev/null +++ b/src/ts/@overflow/infra/redux/saga/os_port_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 InfraOSPort from '../../api/model/InfraOSPort'; +import InfraOSPortService from '../../api/service/InfraOSPortService'; +import * as RegistActions from '../action/os_port_regist'; +import OSPortRegistPayload from '../payload/OSPortRegistPayload'; + +function* regist(action: Action): SagaIterator { + try { + const {infraOSPort} = action.payload; + // yield put({ + // type: types.SENDING_REQUEST, + // payload: {sendingRequest: true}, + // }); + + const retApikey = yield call(AppContext.getService().regist, infraOSPort); + + // if (responseBody.token === undefined) { + // throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE); + // } + yield put(RegistActions.requestSuccess(retApikey)); + } catch (e) { + yield put(RegistActions.requestFailure(e)); + } finally { + // yield put({ + // type: types.SENDING_REQUEST, + // payload: {sendingRequest: false}, + // }); + } +} + +export function* watchOSPortRegist(): SagaIterator { + yield takeLatest(RegistActions.REQUEST, regist); +} diff --git a/src/ts/@overflow/infra/redux/saga/os_read.ts b/src/ts/@overflow/infra/redux/saga/os_read.ts index e69de29..59a821e 100644 --- a/src/ts/@overflow/infra/redux/saga/os_read.ts +++ b/src/ts/@overflow/infra/redux/saga/os_read.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 InfraOS from '../../api/model/InfraOS'; +import InfraOSService from '../../api/service/InfraOSService'; +import * as ReadActions from '../action/os_read'; +import OSReadPayload from '../payload/OSReadPayload'; + +function* read(action: Action): SagaIterator { + try { + const {id} = action.payload; + // yield put({ + // type: types.SENDING_REQUEST, + // payload: {sendingRequest: true}, + // }); + + const retApikey = 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(retApikey)); + } catch (e) { + yield put(ReadActions.requestFailure(e)); + } finally { + // yield put({ + // type: types.SENDING_REQUEST, + // payload: {sendingRequest: false}, + // }); + } +} + +export function* watchOSRead(): SagaIterator { + yield takeLatest(ReadActions.REQUEST, read); +} diff --git a/src/ts/@overflow/infra/redux/saga/os_regist.ts b/src/ts/@overflow/infra/redux/saga/os_regist.ts new file mode 100644 index 0000000..7b6b524 --- /dev/null +++ b/src/ts/@overflow/infra/redux/saga/os_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 InfraOS from '../../api/model/InfraOS'; +import InfraOSService from '../../api/service/InfraOSService'; +import * as RegistActions from '../action/os_regist'; +import OSRegistPayload from '../payload/OSRegistPayload'; + +function* regist(action: Action): SagaIterator { + try { + const {infraOS} = action.payload; + // yield put({ + // type: types.SENDING_REQUEST, + // payload: {sendingRequest: true}, + // }); + + const retApikey = yield call(AppContext.getService().regist, infraOS); + + // if (responseBody.token === undefined) { + // throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE); + // } + yield put(RegistActions.requestSuccess(retApikey)); + } catch (e) { + yield put(RegistActions.requestFailure(e)); + } finally { + // yield put({ + // type: types.SENDING_REQUEST, + // payload: {sendingRequest: false}, + // }); + } +} + +export function* watchOSRegist(): SagaIterator { + yield takeLatest(RegistActions.REQUEST, regist); +} diff --git a/src/ts/@overflow/infra/redux/saga/read.ts b/src/ts/@overflow/infra/redux/saga/read.ts index e69de29..db9fe61 100644 --- a/src/ts/@overflow/infra/redux/saga/read.ts +++ b/src/ts/@overflow/infra/redux/saga/read.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 Infra from '../../api/model/Infra'; +import InfraService from '../../api/service/InfraService'; +import * as ReadActions from '../action/os_read'; +import ReadPayload from '../payload/ReadPayload'; + +function* read(action: Action): SagaIterator { + try { + const {id} = action.payload; + // yield put({ + // type: types.SENDING_REQUEST, + // payload: {sendingRequest: true}, + // }); + + const retApikey = 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(retApikey)); + } catch (e) { + yield put(ReadActions.requestFailure(e)); + } finally { + // yield put({ + // type: types.SENDING_REQUEST, + // payload: {sendingRequest: false}, + // }); + } +} + +export function* watchRead(): SagaIterator { + yield takeLatest(ReadActions.REQUEST, read); +} diff --git a/src/ts/@overflow/infra/redux/saga/regist.ts b/src/ts/@overflow/infra/redux/saga/regist.ts new file mode 100644 index 0000000..a4ad6ac --- /dev/null +++ b/src/ts/@overflow/infra/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 Infra from '../../api/model/Infra'; +import InfraService from '../../api/service/InfraService'; +import * as RegistActions from '../action/os_regist'; +import RegistPayload from '../payload/RegistPayload'; + +function* regist(action: Action): SagaIterator { + try { + const {infra} = action.payload; + // yield put({ + // type: types.SENDING_REQUEST, + // payload: {sendingRequest: true}, + // }); + + const retApikey = yield call(AppContext.getService().regist, infra); + + // if (responseBody.token === undefined) { + // throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE); + // } + yield put(RegistActions.requestSuccess(retApikey)); + } catch (e) { + yield put(RegistActions.requestFailure(e)); + } finally { + // yield put({ + // type: types.SENDING_REQUEST, + // payload: {sendingRequest: false}, + // }); + } +} + +export function* watchRegist(): SagaIterator { + yield takeLatest(RegistActions.REQUEST, regist); +} diff --git a/src/ts/@overflow/infra/redux/saga/service_read.ts b/src/ts/@overflow/infra/redux/saga/service_read.ts index e69de29..fc6a12d 100644 --- a/src/ts/@overflow/infra/redux/saga/service_read.ts +++ b/src/ts/@overflow/infra/redux/saga/service_read.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 InfraService from '../../api/model/InfraService'; +import InfraServiceService from '../../api/service/InfraServiceService'; +import * as ReadActions from '../action/service_read'; +import ServiceReadPayload from '../payload/ServiceReadPayload'; + +function* read(action: Action): SagaIterator { + try { + const {id} = action.payload; + // yield put({ + // type: types.SENDING_REQUEST, + // payload: {sendingRequest: true}, + // }); + + const retApikey = 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(retApikey)); + } catch (e) { + yield put(ReadActions.requestFailure(e)); + } finally { + // yield put({ + // type: types.SENDING_REQUEST, + // payload: {sendingRequest: false}, + // }); + } +} + +export function* watchServiceRead(): SagaIterator { + yield takeLatest(ReadActions.REQUEST, read); +} diff --git a/src/ts/@overflow/infra/redux/saga/service_regist.ts b/src/ts/@overflow/infra/redux/saga/service_regist.ts new file mode 100644 index 0000000..05bf4a4 --- /dev/null +++ b/src/ts/@overflow/infra/redux/saga/service_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 InfraService from '../../api/model/InfraService'; +import InfraServiceService from '../../api/service/InfraServiceService'; +import * as RegistActions from '../action/service_regist'; +import ServiceRegistPayload from '../payload/ServiceRegistPayload'; + +function* regist(action: Action): SagaIterator { + try { + const {infraService} = action.payload; + // yield put({ + // type: types.SENDING_REQUEST, + // payload: {sendingRequest: true}, + // }); + + const retApikey = yield call(AppContext.getService().regist, infraService); + + // if (responseBody.token === undefined) { + // throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE); + // } + yield put(RegistActions.requestSuccess(retApikey)); + } catch (e) { + yield put(RegistActions.requestFailure(e)); + } finally { + // yield put({ + // type: types.SENDING_REQUEST, + // payload: {sendingRequest: false}, + // }); + } +} + +export function* watchServiceRegist(): SagaIterator { + yield takeLatest(RegistActions.REQUEST, regist); +}