diff --git a/src/ts/@overflow/apikey/redux/saga/read.ts b/src/ts/@overflow/apikey/redux/saga/read.ts index 62f2fb8..5a07b3c 100644 --- a/src/ts/@overflow/apikey/redux/saga/read.ts +++ b/src/ts/@overflow/apikey/redux/saga/read.ts @@ -2,7 +2,7 @@ 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 ApiKey from '../../api/model/ApiKey'; diff --git a/src/ts/@overflow/apikey/redux/saga/regist.ts b/src/ts/@overflow/apikey/redux/saga/regist.ts index 742cae4..ac14979 100644 --- a/src/ts/@overflow/apikey/redux/saga/regist.ts +++ b/src/ts/@overflow/apikey/redux/saga/regist.ts @@ -2,7 +2,7 @@ import { SagaIterator } from 'redux-saga'; import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects'; -import AppContext from '@overflow/commons/context'; +import AppContext from '@overflow/commons/context/AppContext'; import Action from '@overflow/commons/redux/Action'; import ApiKey from '../../api/model/ApiKey'; @@ -17,8 +17,8 @@ function* regist(action: Action): SagaIterator { // type: types.SENDING_REQUEST, // payload: {sendingRequest: true}, // }); - - const retApikey = yield call(AppContext.getService().regist, apiKey); + let apiKeyService: ApiKeyService = AppContext.getInstance().getPouch(ApiKeyService); + const retApikey = yield call({context: apiKeyService, fn: apiKeyService.regist}, apiKey); // if (responseBody.token === undefined) { // throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE); diff --git a/src/ts/@overflow/app/views/infrastructure/target/Detail.tsx b/src/ts/@overflow/app/views/infrastructure/target/Detail.tsx index e04b965..30ff9aa 100644 --- a/src/ts/@overflow/app/views/infrastructure/target/Detail.tsx +++ b/src/ts/@overflow/app/views/infrastructure/target/Detail.tsx @@ -1,18 +1,11 @@ import * as React from 'react'; import { RouteComponentProps } from 'react-router'; import TargetDetailContainer from '@overflow/target/react/TargetDetail'; -import WebSocketRPC from '@overflow/commons/websocket/WebSocketRPC'; -import AppContext from '@overflow/commons/context'; -import inject from '@overflow/commons/context/decorator/inject'; class TargetDetail extends React.Component, object> { - private client: WebSocketRPC; - public constructor(props?: RouteComponentProps, context?: object) { super(props, context); - - let con = AppContext.get(); } public render(): JSX.Element { diff --git a/src/ts/@overflow/app/views/infrastructure/target/List.tsx b/src/ts/@overflow/app/views/infrastructure/target/List.tsx index 7dc7f25..0c24580 100644 --- a/src/ts/@overflow/app/views/infrastructure/target/List.tsx +++ b/src/ts/@overflow/app/views/infrastructure/target/List.tsx @@ -1,18 +1,11 @@ import * as React from 'react'; import { RouteComponentProps } from 'react-router'; import TargetListContainer from '@overflow/target/react/TargetList'; -import WebSocketRPC from '@overflow/commons/websocket/WebSocketRPC'; -import AppContext from '@overflow/commons/context'; -import inject from '@overflow/commons/context/decorator/inject'; class TargetList extends React.Component, object> { - private client: WebSocketRPC; - public constructor(props?: RouteComponentProps, context?: object) { super(props, context); - - let con = AppContext.get(); } public render(): JSX.Element { diff --git a/src/ts/@overflow/app/views/member/SignOut.tsx b/src/ts/@overflow/app/views/member/SignOut.tsx index 4df50b0..31208c4 100644 --- a/src/ts/@overflow/app/views/member/SignOut.tsx +++ b/src/ts/@overflow/app/views/member/SignOut.tsx @@ -1,18 +1,11 @@ import * as React from 'react'; import { RouteComponentProps } from 'react-router'; import SignInContainer from '@overflow/member/react/SignIn'; -import WebSocketRPC from '@overflow/commons/websocket/WebSocketRPC'; -import AppContext from '@overflow/commons/context'; -import inject from '@overflow/commons/context/decorator/inject'; class SignOut extends React.Component, object> { - private client: WebSocketRPC; - public constructor(props?: RouteComponentProps, context?: object) { super(props, context); - - let con = AppContext.get(); } public render(): JSX.Element { @@ -20,10 +13,6 @@ class SignOut extends React.Component, object> { ); } - - private test( c: WebSocketRPC): void { - console.log(''); - } } diff --git a/src/ts/@overflow/app/views/monitoring/probe/Detail.tsx b/src/ts/@overflow/app/views/monitoring/probe/Detail.tsx index f420ee0..cee5105 100644 --- a/src/ts/@overflow/app/views/monitoring/probe/Detail.tsx +++ b/src/ts/@overflow/app/views/monitoring/probe/Detail.tsx @@ -1,18 +1,11 @@ import * as React from 'react'; import { RouteComponentProps } from 'react-router'; import ProbeDetailContainer from '@overflow/probe/react/ProbeDetail'; -import WebSocketRPC from '@overflow/commons/websocket/WebSocketRPC'; -import AppContext from '@overflow/commons/context'; -import inject from '@overflow/commons/context/decorator/inject'; class ProbeDetail extends React.Component, object> { - private client: WebSocketRPC; - public constructor(props?: RouteComponentProps, context?: object) { super(props, context); - - let con = AppContext.get(); } public render(): JSX.Element { diff --git a/src/ts/@overflow/app/views/monitoring/probe/History.tsx b/src/ts/@overflow/app/views/monitoring/probe/History.tsx index 8a00282..ff271a2 100644 --- a/src/ts/@overflow/app/views/monitoring/probe/History.tsx +++ b/src/ts/@overflow/app/views/monitoring/probe/History.tsx @@ -1,17 +1,10 @@ import * as React from 'react'; import { RouteComponentProps } from 'react-router'; -import WebSocketRPC from '@overflow/commons/websocket/WebSocketRPC'; -import AppContext from '@overflow/commons/context'; -import inject from '@overflow/commons/context/decorator/inject'; class ProbeHistory extends React.Component, object> { - private client: WebSocketRPC; - public constructor(props?: RouteComponentProps, context?: object) { super(props, context); - - let con = AppContext.get(); } public render(): JSX.Element { diff --git a/src/ts/@overflow/app/views/monitoring/probe/Host.tsx b/src/ts/@overflow/app/views/monitoring/probe/Host.tsx index 3184f3b..7e8b9d9 100644 --- a/src/ts/@overflow/app/views/monitoring/probe/Host.tsx +++ b/src/ts/@overflow/app/views/monitoring/probe/Host.tsx @@ -1,18 +1,11 @@ import * as React from 'react'; import { RouteComponentProps } from 'react-router'; import ProbeHostContainer from '@overflow/probe/react/ProbeHost'; -import WebSocketRPC from '@overflow/commons/websocket/WebSocketRPC'; -import AppContext from '@overflow/commons/context'; -import inject from '@overflow/commons/context/decorator/inject'; class ProbeHost extends React.Component, object> { - private client: WebSocketRPC; - public constructor(props?: RouteComponentProps, context?: object) { super(props, context); - - let con = AppContext.get(); } public render(): JSX.Element { diff --git a/src/ts/@overflow/app/views/monitoring/probe/List.tsx b/src/ts/@overflow/app/views/monitoring/probe/List.tsx index c3d8575..efffe4b 100644 --- a/src/ts/@overflow/app/views/monitoring/probe/List.tsx +++ b/src/ts/@overflow/app/views/monitoring/probe/List.tsx @@ -1,18 +1,11 @@ import * as React from 'react'; import { RouteComponentProps } from 'react-router'; import ProbeListContainer from '@overflow/probe/react/ProbeList'; -import WebSocketRPC from '@overflow/commons/websocket/WebSocketRPC'; -import AppContext from '@overflow/commons/context'; -import inject from '@overflow/commons/context/decorator/inject'; class ProbeList extends React.Component, object> { - private client: WebSocketRPC; - public constructor(props?: RouteComponentProps, context?: object) { super(props, context); - - let con = AppContext.get(); } public render(): JSX.Element { diff --git a/src/ts/@overflow/app/views/monitoring/probe/NoAuth.tsx b/src/ts/@overflow/app/views/monitoring/probe/NoAuth.tsx index 9705ce3..84b01fc 100644 --- a/src/ts/@overflow/app/views/monitoring/probe/NoAuth.tsx +++ b/src/ts/@overflow/app/views/monitoring/probe/NoAuth.tsx @@ -1,18 +1,11 @@ import * as React from 'react'; import { RouteComponentProps } from 'react-router'; import NoauthProbeListContainer from '@overflow/noauthprobe/react/NoauthProbeList'; -import WebSocketRPC from '@overflow/commons/websocket/WebSocketRPC'; -import AppContext from '@overflow/commons/context'; -import inject from '@overflow/commons/context/decorator/inject'; class ProbeList extends React.Component, object> { - private client: WebSocketRPC; - public constructor(props?: RouteComponentProps, context?: object) { super(props, context); - - let con = AppContext.get(); } public render(): JSX.Element { diff --git a/src/ts/@overflow/app/views/monitoring/probe/Setup.tsx b/src/ts/@overflow/app/views/monitoring/probe/Setup.tsx index 38b4809..26f868d 100644 --- a/src/ts/@overflow/app/views/monitoring/probe/Setup.tsx +++ b/src/ts/@overflow/app/views/monitoring/probe/Setup.tsx @@ -1,18 +1,11 @@ import * as React from 'react'; import { RouteComponentProps } from 'react-router'; import ProbeDownContainer from '@overflow/probe/react/ProbeDown'; -import WebSocketRPC from '@overflow/commons/websocket/WebSocketRPC'; -import AppContext from '@overflow/commons/context'; -import inject from '@overflow/commons/context/decorator/inject'; class ProbeList extends React.Component, object> { - private client: WebSocketRPC; - public constructor(props?: RouteComponentProps, context?: object) { super(props, context); - - let con = AppContext.get(); } public render(): JSX.Element { diff --git a/src/ts/@overflow/app/views/monitoring/sensor/Detail.tsx b/src/ts/@overflow/app/views/monitoring/sensor/Detail.tsx index 9a8d719..07c8a89 100644 --- a/src/ts/@overflow/app/views/monitoring/sensor/Detail.tsx +++ b/src/ts/@overflow/app/views/monitoring/sensor/Detail.tsx @@ -1,18 +1,11 @@ import * as React from 'react'; import { RouteComponentProps } from 'react-router'; import SensorDetailContainer from '@overflow/sensor/react/SensorDetail'; -import WebSocketRPC from '@overflow/commons/websocket/WebSocketRPC'; -import AppContext from '@overflow/commons/context'; -import inject from '@overflow/commons/context/decorator/inject'; class SensorDetail extends React.Component, object> { - private client: WebSocketRPC; - public constructor(props?: RouteComponentProps, context?: object) { super(props, context); - - let con = AppContext.get(); } public render(): JSX.Element { @@ -20,10 +13,6 @@ class SensorDetail extends React.Component, object> ); } - - private test( c: WebSocketRPC): void { - console.log(''); - } } diff --git a/src/ts/@overflow/app/views/monitoring/sensor/DetailInfo.tsx b/src/ts/@overflow/app/views/monitoring/sensor/DetailInfo.tsx index 9e096c4..2a9dae8 100644 --- a/src/ts/@overflow/app/views/monitoring/sensor/DetailInfo.tsx +++ b/src/ts/@overflow/app/views/monitoring/sensor/DetailInfo.tsx @@ -1,18 +1,11 @@ import * as React from 'react'; import { RouteComponentProps } from 'react-router'; import SensorDetailInfoContainer from '@overflow/sensor/react/SensorDetailInfo'; -import WebSocketRPC from '@overflow/commons/websocket/WebSocketRPC'; -import AppContext from '@overflow/commons/context'; -import inject from '@overflow/commons/context/decorator/inject'; class SensorDetailInfo extends React.Component, object> { - private client: WebSocketRPC; - public constructor(props?: RouteComponentProps, context?: object) { super(props, context); - - let con = AppContext.get(); } public render(): JSX.Element { @@ -20,10 +13,6 @@ class SensorDetailInfo extends React.Component, obje ); } - - private test( c: WebSocketRPC): void { - console.log(''); - } } diff --git a/src/ts/@overflow/app/views/monitoring/sensor/DetailItems.tsx b/src/ts/@overflow/app/views/monitoring/sensor/DetailItems.tsx index ced8d1e..b4264d9 100644 --- a/src/ts/@overflow/app/views/monitoring/sensor/DetailItems.tsx +++ b/src/ts/@overflow/app/views/monitoring/sensor/DetailItems.tsx @@ -1,18 +1,11 @@ import * as React from 'react'; import { RouteComponentProps } from 'react-router'; import SensorDetailItemsContainer from '@overflow/sensor/react/SensorDetailItems'; -import WebSocketRPC from '@overflow/commons/websocket/WebSocketRPC'; -import AppContext from '@overflow/commons/context'; -import inject from '@overflow/commons/context/decorator/inject'; class SensorDetailItems extends React.Component, object> { - private client: WebSocketRPC; - public constructor(props?: RouteComponentProps, context?: object) { super(props, context); - - let con = AppContext.get(); } public render(): JSX.Element { @@ -20,10 +13,6 @@ class SensorDetailItems extends React.Component, obj ); } - - private test( c: WebSocketRPC): void { - console.log(''); - } } diff --git a/src/ts/@overflow/app/views/monitoring/sensor/ItemTree.tsx b/src/ts/@overflow/app/views/monitoring/sensor/ItemTree.tsx index 2a26d74..df6157d 100644 --- a/src/ts/@overflow/app/views/monitoring/sensor/ItemTree.tsx +++ b/src/ts/@overflow/app/views/monitoring/sensor/ItemTree.tsx @@ -1,18 +1,11 @@ import * as React from 'react'; import { RouteComponentProps } from 'react-router'; import SensorItemTreeContainer from '@overflow/meta/react/SensorItemTree'; -import WebSocketRPC from '@overflow/commons/websocket/WebSocketRPC'; -import AppContext from '@overflow/commons/context'; -import inject from '@overflow/commons/context/decorator/inject'; class SensorItemTree extends React.Component, object> { - private client: WebSocketRPC; - public constructor(props?: RouteComponentProps, context?: object) { super(props, context); - - let con = AppContext.get(); } public render(): JSX.Element { @@ -20,10 +13,6 @@ class SensorItemTree extends React.Component, object ); } - - private test( c: WebSocketRPC): void { - console.log(''); - } } diff --git a/src/ts/@overflow/app/views/monitoring/sensor/List.tsx b/src/ts/@overflow/app/views/monitoring/sensor/List.tsx index 278ff35..db226ee 100644 --- a/src/ts/@overflow/app/views/monitoring/sensor/List.tsx +++ b/src/ts/@overflow/app/views/monitoring/sensor/List.tsx @@ -1,18 +1,11 @@ import * as React from 'react'; import { RouteComponentProps } from 'react-router'; import SensorListContainer from '@overflow/sensor/react/SensorList'; -import WebSocketRPC from '@overflow/commons/websocket/WebSocketRPC'; -import AppContext from '@overflow/commons/context'; -import inject from '@overflow/commons/context/decorator/inject'; class SensorList extends React.Component, object> { - private client: WebSocketRPC; - public constructor(props?: RouteComponentProps, context?: object) { super(props, context); - - let con = AppContext.get(); } public render(): JSX.Element { @@ -20,10 +13,6 @@ class SensorList extends React.Component, object> { ); } - - private test( c: WebSocketRPC): void { - console.log(''); - } } diff --git a/src/ts/@overflow/app/views/monitoring/sensor/Setup.tsx b/src/ts/@overflow/app/views/monitoring/sensor/Setup.tsx index fc63c31..3c312a2 100644 --- a/src/ts/@overflow/app/views/monitoring/sensor/Setup.tsx +++ b/src/ts/@overflow/app/views/monitoring/sensor/Setup.tsx @@ -1,18 +1,11 @@ import * as React from 'react'; import { RouteComponentProps } from 'react-router'; import SensorSetupContainer from '@overflow/sensor/react/SensorConfiguration'; -import WebSocketRPC from '@overflow/commons/websocket/WebSocketRPC'; -import AppContext from '@overflow/commons/context'; -import inject from '@overflow/commons/context/decorator/inject'; class SensorSetup extends React.Component, object> { - private client: WebSocketRPC; - public constructor(props?: RouteComponentProps, context?: object) { super(props, context); - - let con = AppContext.get(); } public render(): JSX.Element { @@ -20,10 +13,6 @@ class SensorSetup extends React.Component, object> { ); } - - private test(c: WebSocketRPC): void { - console.log(''); - } } diff --git a/src/ts/@overflow/commons/context/constants.ts b/src/ts/@overflow/commons/context/constants.ts deleted file mode 100644 index da82ee6..0000000 --- a/src/ts/@overflow/commons/context/constants.ts +++ /dev/null @@ -1,8 +0,0 @@ -// used to store types to be injected -export const PARAM_TYPES = 'overflow:paramtypes'; - -// used to access design time types -export const DESIGN_PARAM_TYPES = 'design:paramtypes'; - -// The type of the binding at design time -export const INJECT_TAG = '__inject__'; diff --git a/src/ts/@overflow/commons/context/decorator/inject.ts b/src/ts/@overflow/commons/context/decorator/inject.ts deleted file mode 100644 index 4bf8fbd..0000000 --- a/src/ts/@overflow/commons/context/decorator/inject.ts +++ /dev/null @@ -1,41 +0,0 @@ -import * as METADATA from '../constants'; - -export interface Config { - qualifier?: string; - required?: boolean; - type?: any; -} - - -const inject = (config: Config = {}) => { - return (target: Object, propertyKey: string | symbol, parameterIndex?: number): void => { - if (typeof parameterIndex === 'number') { - // tagParameter(target, targetKey, index, metadata); - } else { - let meta: Map; - let propertyType = Reflect.getMetadata('design:type', target, propertyKey); - - if (Reflect.hasOwnMetadata(METADATA.INJECT_TAG, target)) { - meta = Reflect.getMetadata(METADATA.INJECT_TAG, target); - } else { - meta = new Map(); - Reflect.defineMetadata(METADATA.INJECT_TAG, meta, target); - } - if (meta.has(propertyKey)) { - throw new Error('Cannot apply @injectable decorator multiple times.'); - } - if (config.type === undefined) { - config.type = propertyType.prototype; - } - meta.set(propertyKey, config); - if (delete target[propertyKey]) { - // Create new property with getter and setter - Object.defineProperty(target, propertyKey, { - writable: true, - }); - } - } - }; -}; - -export default inject; diff --git a/src/ts/@overflow/commons/context/decorator/injectable.ts b/src/ts/@overflow/commons/context/decorator/injectable.ts deleted file mode 100644 index eac4cef..0000000 --- a/src/ts/@overflow/commons/context/decorator/injectable.ts +++ /dev/null @@ -1,29 +0,0 @@ -import * as METADATA from '../constants'; - -export interface Config { - qualifier?: string; - scope?: Scope; -} - -export enum Scope { - SINGLETON = 1, - PROTOTYPE, -} - -const injectable = (config?: Config) => { - return (target: TFunction): TFunction | void => { - - if (Reflect.hasOwnMetadata(METADATA.PARAM_TYPES, target) === true) { - throw new Error('Cannot apply @injectable decorator multiple times.'); - } - - let types = Reflect.getMetadata(METADATA.DESIGN_PARAM_TYPES, target); - Reflect.defineMetadata(METADATA.PARAM_TYPES, types, target); - - const name = target.name; - - return target; - }; -}; - -export default injectable; diff --git a/src/ts/@overflow/commons/context/index.ts b/src/ts/@overflow/commons/context/index.ts deleted file mode 100644 index b26f9ed..0000000 --- a/src/ts/@overflow/commons/context/index.ts +++ /dev/null @@ -1,78 +0,0 @@ -import * as METADATA from './constants'; -import { Config as InjectConfig } from './decorator/inject'; - -export type ClassConstructor = {new(...args: any[]): T}; - -class AppContext { - private static context: AppContext = null; - private instanceMap: Map; - - private constructor() { - this.instanceMap = new Map(); - } - - public put(instance: any, name?: string): void { - let aaa = Object.getPrototypeOf(instance); - if (typeof name !== 'string') { - if (instance.constructor !== undefined) { - name = instance.constructor.name; - } - } - this.instanceMap.set(aaa, instance); - } - - private setValue(type: Function, target: object): void { - if (type.constructor === Object) { - console.log('Object'); - return; - } - - let meta: Map = Reflect.getMetadata(METADATA.INJECT_TAG, type); - if (undefined !== meta) { - let property: any; - meta.forEach((config, key, map) => { - property = Object.getOwnPropertyDescriptor(type, key); - - let dddd = this.instanceMap.get(config.type); - target[key] = dddd; - console.log(dddd); - }); - } - - - this.setValue(Object.getPrototypeOf(type), target); - } - - public static getService(type: ClassConstructor, ...args: any[]): T { - let clazz: Function = type.prototype; - let instance = Object.create(clazz); - instance.constructor.apply(instance, args); - - AppContext.getContext().setValue(clazz, instance); - return instance; - } - - public static get(): T { - - - return null; - } - - public static put(instance: any, name?: string): void { - AppContext.getContext().put(instance, name); - } - - public static getContext(): AppContext { - if (null === AppContext.context) { - AppContext.context = new AppContext(); - } - return AppContext.context; - } - - public static destroy(): void { - console.log('AppContext has been destroyed.'); - } - -} - -export default AppContext; diff --git a/src/ts/@overflow/commons/platform/index.ts b/src/ts/@overflow/commons/platform/index.ts index 3a85eeb..6be5970 100644 --- a/src/ts/@overflow/commons/platform/index.ts +++ b/src/ts/@overflow/commons/platform/index.ts @@ -1,5 +1,3 @@ -import AppContext from '../context'; - abstract class Platform { public static getAppContainer(containerId: string): Promise { @@ -12,15 +10,6 @@ abstract class Platform { return appContainer; } - public static * getAppContext(): IterableIterator> { - const appContext = yield new Promise(resolve => { - const context = AppContext.getContext(); - resolve(context); - }); - - return appContext; - } - } export default Platform; diff --git a/src/ts/@overflow/domain/redux/saga/member_regist.ts b/src/ts/@overflow/domain/redux/saga/member_regist.ts index cede59f..a1a77a8 100644 --- a/src/ts/@overflow/domain/redux/saga/member_regist.ts +++ b/src/ts/@overflow/domain/redux/saga/member_regist.ts @@ -2,7 +2,7 @@ import { SagaIterator } from 'redux-saga'; import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects'; -import AppContext from '@overflow/commons/context'; +import AppContext from '@overflow/commons/context/AppContext'; import Action from '@overflow/commons/redux/Action'; import DomainMember from '../../api/model/DomainMember'; @@ -17,8 +17,8 @@ function* regist(action: Action): SagaIterator { // type: types.SENDING_REQUEST, // payload: {sendingRequest: true}, // }); - - yield call(AppContext.getService().regist, dm); + let domainMemberService = AppContext.getInstance().getPouch(DomainMemberService); + yield call({context: domainMemberService, fn: domainMemberService.regist}, dm); // if (responseBody.token === undefined) { // throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE); diff --git a/src/ts/@overflow/domain/redux/saga/regist.ts b/src/ts/@overflow/domain/redux/saga/regist.ts index 2e1c80c..32e572d 100644 --- a/src/ts/@overflow/domain/redux/saga/regist.ts +++ b/src/ts/@overflow/domain/redux/saga/regist.ts @@ -2,7 +2,7 @@ import { SagaIterator } from 'redux-saga'; import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects'; -import AppContext from '@overflow/commons/context'; +import AppContext from '@overflow/commons/context/AppContext'; import Action from '@overflow/commons/redux/Action'; import Domain from '../../api/model/Domain'; @@ -17,8 +17,8 @@ function* regist(action: Action): SagaIterator { // type: types.SENDING_REQUEST, // payload: {sendingRequest: true}, // }); - - yield call(AppContext.getService().regist, dm); + let domainService = AppContext.getInstance().getPouch(DomainService); + yield call({context: domainService, fn: domainService.regist}, dm); // if (responseBody.token === undefined) { // throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE); diff --git a/src/ts/@overflow/email/redux/saga/modify.ts b/src/ts/@overflow/email/redux/saga/modify.ts index 3dcf6e8..70de8b0 100644 --- a/src/ts/@overflow/email/redux/saga/modify.ts +++ b/src/ts/@overflow/email/redux/saga/modify.ts @@ -6,7 +6,7 @@ import { SagaIterator } from 'redux-saga'; import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects'; -import AppContext from '@overflow/commons/context'; +import AppContext from '@overflow/commons/context/AppContext'; import Action from '@overflow/commons/redux/Action'; import EmailAuth from '@overflow/email/api/model/EmailAuth'; @@ -22,8 +22,8 @@ function* modify(action: Action): SagaIterator { // type: types.SENDING_REQUEST, // payload: {sendingRequest: true}, // }); - - const emailAuth = yield call(AppContext.getService().modify, ea); + let emailAuthService = AppContext.getInstance().getPouch(EmailAuthService); + const emailAuth = yield call({context: emailAuthService, fn: emailAuthService.modify}, ea); // if (responseBody.token === undefined) { // throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE); diff --git a/src/ts/@overflow/email/redux/saga/read.ts b/src/ts/@overflow/email/redux/saga/read.ts index 742ef99..26f3d51 100644 --- a/src/ts/@overflow/email/redux/saga/read.ts +++ b/src/ts/@overflow/email/redux/saga/read.ts @@ -2,7 +2,7 @@ import { SagaIterator } from 'redux-saga'; import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects'; -import AppContext from '@overflow/commons/context'; +import AppContext from '@overflow/commons/context/AppContext'; import Action from '@overflow/commons/redux/Action'; import EmailAuth from '@overflow/email/api/model/EmailAuth'; @@ -18,8 +18,8 @@ function* read(action: Action): SagaIterator { // type: types.SENDING_REQUEST, // payload: {sendingRequest: true}, // }); - - const emailAuth = yield call(AppContext.getService().read, id); + let emailAuthService = AppContext.getInstance().getPouch(EmailAuthService); + const emailAuth = yield call({context: emailAuthService, fn: emailAuthService.read}, id); // if (responseBody.token === undefined) { // throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE); 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 aaaef5b..c656841 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 @@ -2,7 +2,7 @@ import { SagaIterator } from 'redux-saga'; import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects'; -import AppContext from '@overflow/commons/context'; +import AppContext from '@overflow/commons/context/AppContext'; import Action from '@overflow/commons/redux/Action'; import EmailAuth from '@overflow/email/api/model/EmailAuth'; @@ -18,8 +18,8 @@ function* readByAuthKey(action: Action): SagaIterator { // type: types.SENDING_REQUEST, // payload: {sendingRequest: true}, // }); - - const emailAuth = yield call(AppContext.getService().readByAuthKey, authKey); + let emailAuthService = AppContext.getInstance().getPouch(EmailAuthService); + const emailAuth = yield call({context: emailAuthService, fn: emailAuthService.readByAuthKey}, authKey); // if (responseBody.token === undefined) { // throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE); 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 749b0b7..575e9ef 100644 --- a/src/ts/@overflow/email/redux/saga/read_by_member.ts +++ b/src/ts/@overflow/email/redux/saga/read_by_member.ts @@ -2,7 +2,7 @@ import { SagaIterator } from 'redux-saga'; import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects'; -import AppContext from '@overflow/commons/context'; +import AppContext from '@overflow/commons/context/AppContext'; import Action from '@overflow/commons/redux/Action'; import EmailAuth from '@overflow/email/api/model/EmailAuth'; @@ -18,8 +18,8 @@ function* readByMember(action: Action): SagaIterator { // type: types.SENDING_REQUEST, // payload: {sendingRequest: true}, // }); - - const emailAuths = yield call(AppContext.getService().readByMember, id); + let emailAuthService = AppContext.getInstance().getPouch(EmailAuthService); + const emailAuths = yield call({context: emailAuthService, fn: emailAuthService.readByMember}, id); // if (responseBody.token === undefined) { // throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE); 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 dbc71a9..b69c956 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 @@ -2,7 +2,7 @@ import { SagaIterator } from 'redux-saga'; import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects'; -import AppContext from '@overflow/commons/context'; +import AppContext from '@overflow/commons/context/AppContext'; import Action from '@overflow/commons/redux/Action'; import EmailAuth from '@overflow/email/api/model/EmailAuth'; @@ -18,8 +18,8 @@ function* sendEmail(action: Action): SagaIterator { // type: types.SENDING_REQUEST, // payload: {sendingRequest: true}, // }); - - const emailAuth = yield call(AppContext.getService().sendEmailByMember, memberId, email); + let emailAuthService = AppContext.getInstance().getPouch(EmailAuthService); + const emailAuth = yield call({context: emailAuthService, fn: emailAuthService.sendEmailByMember}, memberId, email); // if (responseBody.token === undefined) { // throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE); diff --git a/src/ts/@overflow/infra/redux/saga/host_read.ts b/src/ts/@overflow/infra/redux/saga/host_read.ts index 314d41b..0ca2b94 100644 --- a/src/ts/@overflow/infra/redux/saga/host_read.ts +++ b/src/ts/@overflow/infra/redux/saga/host_read.ts @@ -2,7 +2,7 @@ import { SagaIterator } from 'redux-saga'; import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects'; -import AppContext from '@overflow/commons/context'; +import AppContext from '@overflow/commons/context/AppContext'; import Action from '@overflow/commons/redux/Action'; import InfraHost from '../../api/model/InfraHost'; @@ -17,8 +17,8 @@ function* read(action: Action): SagaIterator { // type: types.SENDING_REQUEST, // payload: {sendingRequest: true}, // }); - - const retApikey = yield call(AppContext.getService().read, id); + let infraHostService = AppContext.getInstance().getPouch(InfraHostService); + const retApikey = yield call({context: infraHostService, fn: infraHostService.read}, id); // if (responseBody.token === undefined) { // throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE); diff --git a/src/ts/@overflow/infra/redux/saga/host_regist.ts b/src/ts/@overflow/infra/redux/saga/host_regist.ts index b83d88c..bb54fa4 100644 --- a/src/ts/@overflow/infra/redux/saga/host_regist.ts +++ b/src/ts/@overflow/infra/redux/saga/host_regist.ts @@ -2,7 +2,7 @@ import { SagaIterator } from 'redux-saga'; import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects'; -import AppContext from '@overflow/commons/context'; +import AppContext from '@overflow/commons/context/AppContext'; import Action from '@overflow/commons/redux/Action'; import InfraHost from '../../api/model/InfraHost'; @@ -17,8 +17,8 @@ function* regist(action: Action): SagaIterator { // type: types.SENDING_REQUEST, // payload: {sendingRequest: true}, // }); - - const retApikey = yield call(AppContext.getService().regist, infraHost); + let infraHostService = AppContext.getInstance().getPouch(InfraHostService); + const retApikey = yield call({context: infraHostService, fn: infraHostService.regist}, infraHost); // if (responseBody.token === undefined) { // throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE); diff --git a/src/ts/@overflow/infra/redux/saga/machine_read.ts b/src/ts/@overflow/infra/redux/saga/machine_read.ts index e250142..503b52f 100644 --- a/src/ts/@overflow/infra/redux/saga/machine_read.ts +++ b/src/ts/@overflow/infra/redux/saga/machine_read.ts @@ -2,7 +2,7 @@ import { SagaIterator } from 'redux-saga'; import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects'; -import AppContext from '@overflow/commons/context'; +import AppContext from '@overflow/commons/context/AppContext'; import Action from '@overflow/commons/redux/Action'; import InfraMachine from '../../api/model/InfraMachine'; @@ -17,8 +17,8 @@ function* read(action: Action): SagaIterator { // type: types.SENDING_REQUEST, // payload: {sendingRequest: true}, // }); - - const retApikey = yield call(AppContext.getService().read, id); + let infraMachineService = AppContext.getInstance().getPouch(InfraMachineService); + const retApikey = yield call({context: infraMachineService, fn: infraMachineService.read}, id); // if (responseBody.token === undefined) { // throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE); diff --git a/src/ts/@overflow/infra/redux/saga/machine_regist.ts b/src/ts/@overflow/infra/redux/saga/machine_regist.ts index bc80df8..f55baa6 100644 --- a/src/ts/@overflow/infra/redux/saga/machine_regist.ts +++ b/src/ts/@overflow/infra/redux/saga/machine_regist.ts @@ -2,7 +2,7 @@ import { SagaIterator } from 'redux-saga'; import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects'; -import AppContext from '@overflow/commons/context'; +import AppContext from '@overflow/commons/context/AppContext'; import Action from '@overflow/commons/redux/Action'; import InfraMachine from '../../api/model/InfraMachine'; @@ -18,7 +18,8 @@ function* regist(action: Action): SagaIterator { // payload: {sendingRequest: true}, // }); - const retApikey = yield call(AppContext.getService().regist, infraMachine); + let infraMachineService = AppContext.getInstance().getPouch(InfraMachineService); + const retApikey = yield call({context: infraMachineService, fn: infraMachineService.regist}, infraMachine); // if (responseBody.token === undefined) { // throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE); 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 638b286..590a20c 100644 --- a/src/ts/@overflow/infra/redux/saga/os_application_read.ts +++ b/src/ts/@overflow/infra/redux/saga/os_application_read.ts @@ -2,7 +2,7 @@ import { SagaIterator } from 'redux-saga'; import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects'; -import AppContext from '@overflow/commons/context'; +import AppContext from '@overflow/commons/context/AppContext'; import Action from '@overflow/commons/redux/Action'; import InfraOSApplication from '../../api/model/InfraOSApplication'; @@ -17,8 +17,8 @@ function* read(action: Action): SagaIterator { // type: types.SENDING_REQUEST, // payload: {sendingRequest: true}, // }); - - const retApikey = yield call(AppContext.getService().read, id); + let infraOSApplicationService = AppContext.getInstance().getPouch(InfraOSApplicationService); + const retApikey = yield call({context: infraOSApplicationService, fn: infraOSApplicationService.read}, id); // if (responseBody.token === undefined) { // throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE); diff --git a/src/ts/@overflow/infra/redux/saga/os_application_regist.ts b/src/ts/@overflow/infra/redux/saga/os_application_regist.ts index 50af81c..2c8a00d 100644 --- a/src/ts/@overflow/infra/redux/saga/os_application_regist.ts +++ b/src/ts/@overflow/infra/redux/saga/os_application_regist.ts @@ -2,7 +2,7 @@ import { SagaIterator } from 'redux-saga'; import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects'; -import AppContext from '@overflow/commons/context'; +import AppContext from '@overflow/commons/context/AppContext'; import Action from '@overflow/commons/redux/Action'; import InfraOSApplication from '../../api/model/InfraOSApplication'; @@ -17,8 +17,8 @@ function* regist(action: Action): SagaIterator { // type: types.SENDING_REQUEST, // payload: {sendingRequest: true}, // }); - - const retApikey = yield call(AppContext.getService().regist, infraOSApplication); + let infraOSApplicationService = AppContext.getInstance().getPouch(InfraOSApplicationService); + const retApikey = yield call({context: infraOSApplicationService, fn: infraOSApplicationService.regist}, infraOSApplication); // if (responseBody.token === undefined) { // throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE); 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 e8b0813..1ab45a9 100644 --- a/src/ts/@overflow/infra/redux/saga/os_daemon_read.ts +++ b/src/ts/@overflow/infra/redux/saga/os_daemon_read.ts @@ -2,7 +2,7 @@ import { SagaIterator } from 'redux-saga'; import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects'; -import AppContext from '@overflow/commons/context'; +import AppContext from '@overflow/commons/context/AppContext'; import Action from '@overflow/commons/redux/Action'; import InfraOSDaemon from '../../api/model/InfraOSDaemon'; @@ -17,8 +17,8 @@ function* read(action: Action): SagaIterator { // type: types.SENDING_REQUEST, // payload: {sendingRequest: true}, // }); - - const retApikey = yield call(AppContext.getService().read, id); + let infraOSDaemonService = AppContext.getInstance().getPouch(InfraOSDaemonService); + const retApikey = yield call({context: infraOSDaemonService, fn: infraOSDaemonService.read}, id); // if (responseBody.token === undefined) { // throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE); diff --git a/src/ts/@overflow/infra/redux/saga/os_daemon_regist.ts b/src/ts/@overflow/infra/redux/saga/os_daemon_regist.ts index 3f2afbc..ac7067f 100644 --- a/src/ts/@overflow/infra/redux/saga/os_daemon_regist.ts +++ b/src/ts/@overflow/infra/redux/saga/os_daemon_regist.ts @@ -2,7 +2,7 @@ import { SagaIterator } from 'redux-saga'; import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects'; -import AppContext from '@overflow/commons/context'; +import AppContext from '@overflow/commons/context/AppContext'; import Action from '@overflow/commons/redux/Action'; import InfraOSDaemon from '../../api/model/InfraOSDaemon'; @@ -17,8 +17,8 @@ function* regist(action: Action): SagaIterator { // type: types.SENDING_REQUEST, // payload: {sendingRequest: true}, // }); - - const retApikey = yield call(AppContext.getService().regist, infraOSDaemon); + let infraOSDaemonService = AppContext.getInstance().getPouch(InfraOSDaemonService); + const retApikey = yield call({context: infraOSDaemonService, fn: infraOSDaemonService.regist}, infraOSDaemon); // if (responseBody.token === undefined) { // throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE); 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 d7a5ea3..b8f47a2 100644 --- a/src/ts/@overflow/infra/redux/saga/os_port_read.ts +++ b/src/ts/@overflow/infra/redux/saga/os_port_read.ts @@ -2,7 +2,7 @@ import { SagaIterator } from 'redux-saga'; import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects'; -import AppContext from '@overflow/commons/context'; +import AppContext from '@overflow/commons/context/AppContext'; import Action from '@overflow/commons/redux/Action'; import InfraOSPort from '../../api/model/InfraOSPort'; @@ -17,8 +17,8 @@ function* read(action: Action): SagaIterator { // type: types.SENDING_REQUEST, // payload: {sendingRequest: true}, // }); - - const retApikey = yield call(AppContext.getService().read, id); + let infraOSPortService = AppContext.getInstance().getPouch(InfraOSPortService); + const retApikey = yield call({context: infraOSPortService, fn: infraOSPortService.read}, id); // if (responseBody.token === undefined) { // throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE); diff --git a/src/ts/@overflow/infra/redux/saga/os_port_regist.ts b/src/ts/@overflow/infra/redux/saga/os_port_regist.ts index 27df76b..01bc7ee 100644 --- a/src/ts/@overflow/infra/redux/saga/os_port_regist.ts +++ b/src/ts/@overflow/infra/redux/saga/os_port_regist.ts @@ -2,7 +2,7 @@ import { SagaIterator } from 'redux-saga'; import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects'; -import AppContext from '@overflow/commons/context'; +import AppContext from '@overflow/commons/context/AppContext'; import Action from '@overflow/commons/redux/Action'; import InfraOSPort from '../../api/model/InfraOSPort'; @@ -17,8 +17,8 @@ function* regist(action: Action): SagaIterator { // type: types.SENDING_REQUEST, // payload: {sendingRequest: true}, // }); - - const retApikey = yield call(AppContext.getService().regist, infraOSPort); + let infraOSPortService = AppContext.getInstance().getPouch(InfraOSPortService); + const retApikey = yield call({context: infraOSPortService, fn: infraOSPortService.regist}, infraOSPort); // if (responseBody.token === undefined) { // throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE); diff --git a/src/ts/@overflow/infra/redux/saga/os_read.ts b/src/ts/@overflow/infra/redux/saga/os_read.ts index 59a821e..5b30c8b 100644 --- a/src/ts/@overflow/infra/redux/saga/os_read.ts +++ b/src/ts/@overflow/infra/redux/saga/os_read.ts @@ -2,7 +2,7 @@ import { SagaIterator } from 'redux-saga'; import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects'; -import AppContext from '@overflow/commons/context'; +import AppContext from '@overflow/commons/context/AppContext'; import Action from '@overflow/commons/redux/Action'; import InfraOS from '../../api/model/InfraOS'; @@ -17,8 +17,8 @@ function* read(action: Action): SagaIterator { // type: types.SENDING_REQUEST, // payload: {sendingRequest: true}, // }); - - const retApikey = yield call(AppContext.getService().read, id); + let infraOSService = AppContext.getInstance().getPouch(InfraOSService); + const retApikey = yield call({context: infraOSService, fn: infraOSService.read}, id); // if (responseBody.token === undefined) { // throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE); diff --git a/src/ts/@overflow/infra/redux/saga/os_regist.ts b/src/ts/@overflow/infra/redux/saga/os_regist.ts index 7b6b524..3cfd069 100644 --- a/src/ts/@overflow/infra/redux/saga/os_regist.ts +++ b/src/ts/@overflow/infra/redux/saga/os_regist.ts @@ -2,7 +2,7 @@ import { SagaIterator } from 'redux-saga'; import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects'; -import AppContext from '@overflow/commons/context'; +import AppContext from '@overflow/commons/context/AppContext'; import Action from '@overflow/commons/redux/Action'; import InfraOS from '../../api/model/InfraOS'; @@ -17,8 +17,8 @@ function* regist(action: Action): SagaIterator { // type: types.SENDING_REQUEST, // payload: {sendingRequest: true}, // }); - - const retApikey = yield call(AppContext.getService().regist, infraOS); + let infraOSService = AppContext.getInstance().getPouch(InfraOSService); + const retApikey = yield call({context: infraOSService, fn: infraOSService.regist}, infraOS); // if (responseBody.token === undefined) { // throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE); diff --git a/src/ts/@overflow/infra/redux/saga/read.ts b/src/ts/@overflow/infra/redux/saga/read.ts index db9fe61..d93e47d 100644 --- a/src/ts/@overflow/infra/redux/saga/read.ts +++ b/src/ts/@overflow/infra/redux/saga/read.ts @@ -2,7 +2,7 @@ import { SagaIterator } from 'redux-saga'; import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects'; -import AppContext from '@overflow/commons/context'; +import AppContext from '@overflow/commons/context/AppContext'; import Action from '@overflow/commons/redux/Action'; import Infra from '../../api/model/Infra'; @@ -17,8 +17,8 @@ function* read(action: Action): SagaIterator { // type: types.SENDING_REQUEST, // payload: {sendingRequest: true}, // }); - - const retApikey = yield call(AppContext.getService().read, id); + let infraService = AppContext.getInstance().getPouch(InfraService); + const retApikey = yield call({context: infraService, fn: infraService.read}, id); // if (responseBody.token === undefined) { // throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE); diff --git a/src/ts/@overflow/infra/redux/saga/regist.ts b/src/ts/@overflow/infra/redux/saga/regist.ts index a4ad6ac..b22fa04 100644 --- a/src/ts/@overflow/infra/redux/saga/regist.ts +++ b/src/ts/@overflow/infra/redux/saga/regist.ts @@ -2,7 +2,7 @@ import { SagaIterator } from 'redux-saga'; import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects'; -import AppContext from '@overflow/commons/context'; +import AppContext from '@overflow/commons/context/AppContext'; import Action from '@overflow/commons/redux/Action'; import Infra from '../../api/model/Infra'; @@ -17,8 +17,8 @@ function* regist(action: Action): SagaIterator { // type: types.SENDING_REQUEST, // payload: {sendingRequest: true}, // }); - - const retApikey = yield call(AppContext.getService().regist, infra); + let infraService = AppContext.getInstance().getPouch(InfraService); + const retApikey = yield call({context: infraService, fn: infraService.regist}, infra); // if (responseBody.token === undefined) { // throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE); diff --git a/src/ts/@overflow/infra/redux/saga/service_read.ts b/src/ts/@overflow/infra/redux/saga/service_read.ts index fc6a12d..82591b9 100644 --- a/src/ts/@overflow/infra/redux/saga/service_read.ts +++ b/src/ts/@overflow/infra/redux/saga/service_read.ts @@ -2,7 +2,7 @@ import { SagaIterator } from 'redux-saga'; import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects'; -import AppContext from '@overflow/commons/context'; +import AppContext from '@overflow/commons/context/AppContext'; import Action from '@overflow/commons/redux/Action'; import InfraService from '../../api/model/InfraService'; @@ -17,8 +17,8 @@ function* read(action: Action): SagaIterator { // type: types.SENDING_REQUEST, // payload: {sendingRequest: true}, // }); - - const retApikey = yield call(AppContext.getService().read, id); + let infraServiceService = AppContext.getInstance().getPouch(InfraServiceService); + const retApikey = yield call({context: infraServiceService, fn: infraServiceService.read}, id); // if (responseBody.token === undefined) { // throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE); diff --git a/src/ts/@overflow/infra/redux/saga/service_regist.ts b/src/ts/@overflow/infra/redux/saga/service_regist.ts index 05bf4a4..368c919 100644 --- a/src/ts/@overflow/infra/redux/saga/service_regist.ts +++ b/src/ts/@overflow/infra/redux/saga/service_regist.ts @@ -2,7 +2,7 @@ import { SagaIterator } from 'redux-saga'; import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects'; -import AppContext from '@overflow/commons/context'; +import AppContext from '@overflow/commons/context/AppContext'; import Action from '@overflow/commons/redux/Action'; import InfraService from '../../api/model/InfraService'; @@ -17,8 +17,8 @@ function* regist(action: Action): SagaIterator { // type: types.SENDING_REQUEST, // payload: {sendingRequest: true}, // }); - - const retApikey = yield call(AppContext.getService().regist, infraService); + let infraServiceService = AppContext.getInstance().getPouch(InfraServiceService); + const retApikey = yield call({context: infraServiceService, fn: infraServiceService.regist}, infraService); // if (responseBody.token === undefined) { // throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE); diff --git a/src/ts/@overflow/member/api/service/MemberService.ts b/src/ts/@overflow/member/api/service/MemberService.ts index f81bbbf..25b351c 100644 --- a/src/ts/@overflow/member/api/service/MemberService.ts +++ b/src/ts/@overflow/member/api/service/MemberService.ts @@ -1,7 +1,7 @@ import Service from '@overflow/commons/api/Service'; import Member from '../model/Member'; import Injectable from '@overflow/commons/context/pouches/decorator/Injectable'; -import inject from '@overflow/commons/context/decorator/inject'; +import inject from '@overflow/commons/context/pouches/decorator/Injectable'; diff --git a/src/ts/@overflow/member/redux/saga/modify.ts b/src/ts/@overflow/member/redux/saga/modify.ts index d3dfa4d..4249666 100644 --- a/src/ts/@overflow/member/redux/saga/modify.ts +++ b/src/ts/@overflow/member/redux/saga/modify.ts @@ -2,7 +2,7 @@ import { SagaIterator } from 'redux-saga'; import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects'; -import AppContext from '@overflow/commons/context'; +import AppContext from '@overflow/commons/context/AppContext'; import Action from '@overflow/commons/redux/Action'; import Member from '../../api/model/Member'; @@ -17,8 +17,8 @@ function* modify(action: Action): SagaIterator { // type: types.SENDING_REQUEST, // payload: {sendingRequest: true}, // }); - - const member = yield call(AppContext.getService().modify, tempMember); + let memberService = AppContext.getInstance().getPouch(MemberService); + const member = yield call({context: memberService, fn: memberService.modify}, tempMember); // if (responseBody.token === undefined) { // throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE); diff --git a/src/ts/@overflow/member/redux/saga/read.ts b/src/ts/@overflow/member/redux/saga/read.ts index 10d31be..fc66893 100644 --- a/src/ts/@overflow/member/redux/saga/read.ts +++ b/src/ts/@overflow/member/redux/saga/read.ts @@ -2,7 +2,7 @@ import { SagaIterator } from 'redux-saga'; import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects'; -import AppContext from '@overflow/commons/context'; +import AppContext from '@overflow/commons/context/AppContext'; import Action from '@overflow/commons/redux/Action'; import Member from '../../api/model/Member'; @@ -17,8 +17,8 @@ function* read(action: Action): SagaIterator { // type: types.SENDING_REQUEST, // payload: {sendingRequest: true}, // }); - - const member = yield call(AppContext.getService().read, id); + let memberService = AppContext.getInstance().getPouch(MemberService); + const member = yield call({context: memberService, fn: memberService.read}, id); // if (responseBody.token === undefined) { // throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE); diff --git a/src/ts/@overflow/noauthprobe/redux/saga/read.ts b/src/ts/@overflow/noauthprobe/redux/saga/read.ts index 2532740..a05aa76 100644 --- a/src/ts/@overflow/noauthprobe/redux/saga/read.ts +++ b/src/ts/@overflow/noauthprobe/redux/saga/read.ts @@ -2,7 +2,7 @@ import { SagaIterator } from 'redux-saga'; import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects'; -import AppContext from '@overflow/commons/context'; +import AppContext from '@overflow/commons/context/AppContext'; import Action from '@overflow/commons/redux/Action'; import NoAuthProbe from '../../api/model/NoAuthProbe'; @@ -17,8 +17,8 @@ function* read(action: Action): SagaIterator { // type: types.SENDING_REQUEST, // payload: {sendingRequest: true}, // }); - - const retApikey = yield call(AppContext.getService().read, id); + let noAuthProbeService = AppContext.getInstance().getPouch(NoAuthProbeService); + const retApikey = yield call({context: noAuthProbeService, fn: noAuthProbeService.read}, id); // if (responseBody.token === undefined) { // throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE); diff --git a/src/ts/@overflow/noauthprobe/redux/saga/read_all_by_domain.ts b/src/ts/@overflow/noauthprobe/redux/saga/read_all_by_domain.ts index 0647623..2d4c86e 100644 --- a/src/ts/@overflow/noauthprobe/redux/saga/read_all_by_domain.ts +++ b/src/ts/@overflow/noauthprobe/redux/saga/read_all_by_domain.ts @@ -2,7 +2,7 @@ import { SagaIterator } from 'redux-saga'; import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects'; -import AppContext from '@overflow/commons/context'; +import AppContext from '@overflow/commons/context/AppContext'; import Action from '@overflow/commons/redux/Action'; import NoAuthProbe from '../../api/model/NoAuthProbe'; @@ -17,8 +17,8 @@ function* readAllByDomain(action: Action): SagaIterator // type: types.SENDING_REQUEST, // payload: {sendingRequest: true}, // }); - - const noauthProbeList = yield call(AppContext.getService().readAllByDomain, domain); + let noAuthProbeService = AppContext.getInstance().getPouch(NoAuthProbeService); + const noauthProbeList = yield call({context: noAuthProbeService, fn: noAuthProbeService.readAllByDomain}, domain); // if (responseBody.token === undefined) { // throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE); diff --git a/src/ts/@overflow/noauthprobe/redux/saga/regist.ts b/src/ts/@overflow/noauthprobe/redux/saga/regist.ts index f4fde00..fbbf66c 100644 --- a/src/ts/@overflow/noauthprobe/redux/saga/regist.ts +++ b/src/ts/@overflow/noauthprobe/redux/saga/regist.ts @@ -2,7 +2,7 @@ import { SagaIterator } from 'redux-saga'; import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects'; -import AppContext from '@overflow/commons/context'; +import AppContext from '@overflow/commons/context/AppContext'; import Action from '@overflow/commons/redux/Action'; import NoAuthProbe from '../../api/model/NoAuthProbe'; @@ -17,8 +17,8 @@ function* regist(action: Action): SagaIterator { // type: types.SENDING_REQUEST, // payload: {sendingRequest: true}, // }); - - const retApikey = yield call(AppContext.getService().regist, noAuthProbe); + let noAuthProbeService = AppContext.getInstance().getPouch(NoAuthProbeService); + const retApikey = yield call({context: noAuthProbeService, fn: noAuthProbeService.regist}, noAuthProbe); // if (responseBody.token === undefined) { // throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE); diff --git a/src/ts/@overflow/probe/redux/saga/read_all_by_domain.ts b/src/ts/@overflow/probe/redux/saga/read_all_by_domain.ts index 6520fa6..af789c9 100644 --- a/src/ts/@overflow/probe/redux/saga/read_all_by_domain.ts +++ b/src/ts/@overflow/probe/redux/saga/read_all_by_domain.ts @@ -1,7 +1,7 @@ import { SagaIterator } from 'redux-saga'; import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects'; import { SagaWatcher } from '@overflow/commons/redux-saga'; -import AppContext from '@overflow/commons/context'; +import AppContext from '@overflow/commons/context/AppContext'; import Action from '@overflow/commons/redux/Action'; import ProbeService from '../../api/service/ProbeService'; import * as ReadAllByDomainActions from '../action/read_all_by_domain'; @@ -11,9 +11,8 @@ function* readAllByDomain(action: Action): SagaIterator try { const { domain } = action.payload; - let service = AppContext.getService(ProbeService); - - const ret = yield call({context: service, fn: service.readAllByDomain}, domain); + let probeService = AppContext.getInstance().getPouch(ProbeService); + const ret = yield call({context: probeService, fn: probeService.readAllByDomain}, domain); yield put(ReadAllByDomainActions.requestSuccess(ret)); } catch (e) { diff --git a/src/ts/@overflow/probe/redux/saga/read_by_probekey.ts b/src/ts/@overflow/probe/redux/saga/read_by_probekey.ts index cc3a5e8..c59ea9c 100644 --- a/src/ts/@overflow/probe/redux/saga/read_by_probekey.ts +++ b/src/ts/@overflow/probe/redux/saga/read_by_probekey.ts @@ -1,7 +1,7 @@ import { SagaIterator } from 'redux-saga'; import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects'; -import AppContext from '@overflow/commons/context'; +import AppContext from '@overflow/commons/context/AppContext'; import Action from '@overflow/commons/redux/Action'; import Probe from '../../api/model/Probe'; @@ -16,8 +16,8 @@ function* readByProbeKey(action: Action): SagaIterator { // type: types.SENDING_REQUEST, // payload: {sendingRequest: true}, // }); - - const ret = yield call(AppContext.getService().readByProbeKey, probeKey); + let probeService = AppContext.getInstance().getPouch(ProbeService); + const ret = yield call({context: probeService, fn: probeService.readByProbeKey}, probeKey); // if (responseBody.token === undefined) { // throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE); diff --git a/src/ts/@overflow/probe/redux/saga/regist.ts b/src/ts/@overflow/probe/redux/saga/regist.ts index c865c89..001db2d 100644 --- a/src/ts/@overflow/probe/redux/saga/regist.ts +++ b/src/ts/@overflow/probe/redux/saga/regist.ts @@ -1,7 +1,7 @@ import { SagaIterator } from 'redux-saga'; import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects'; -import AppContext from '@overflow/commons/context'; +import AppContext from '@overflow/commons/context/AppContext'; import Action from '@overflow/commons/redux/Action'; import Probe from '../../api/model/Probe'; @@ -16,8 +16,8 @@ function* regist(action: Action): SagaIterator { // type: types.SENDING_REQUEST, // payload: {sendingRequest: true}, // }); - - const ret = yield call(AppContext.getService().regist, probe); + let probeService = AppContext.getInstance().getPouch(ProbeService); + const ret = yield call({context: probeService, fn: probeService.regist}, probe); // if (responseBody.token === undefined) { // throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE); diff --git a/src/ts/@overflow/probe/redux/saga/task_read_all_by_probe.ts b/src/ts/@overflow/probe/redux/saga/task_read_all_by_probe.ts index 9d69c97..32135f0 100644 --- a/src/ts/@overflow/probe/redux/saga/task_read_all_by_probe.ts +++ b/src/ts/@overflow/probe/redux/saga/task_read_all_by_probe.ts @@ -1,7 +1,7 @@ import { SagaIterator } from 'redux-saga'; import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects'; -import AppContext from '@overflow/commons/context'; +import AppContext from '@overflow/commons/context/AppContext'; import Action from '@overflow/commons/redux/Action'; import ProbeTaskService from '../../api/service/ProbeTaskService'; @@ -15,8 +15,8 @@ function* readAllTaskByProbe(action: Action): SagaIte // type: types.SENDING_REQUEST, // payload: {sendingRequest: true}, // }); - - const ret = yield call(AppContext.getService().readAllByProbe, probe); + let probeTaskService = AppContext.getInstance().getPouch(ProbeTaskService); + const ret = yield call({context: probeTaskService, fn: probeTaskService.readAllByProbe}, probe); // if (responseBody.token === undefined) { // throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE); diff --git a/src/ts/@overflow/probe/redux/saga/task_regist.ts b/src/ts/@overflow/probe/redux/saga/task_regist.ts index b6ddd72..84ff7a4 100644 --- a/src/ts/@overflow/probe/redux/saga/task_regist.ts +++ b/src/ts/@overflow/probe/redux/saga/task_regist.ts @@ -1,7 +1,7 @@ import { SagaIterator } from 'redux-saga'; import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects'; -import AppContext from '@overflow/commons/context'; +import AppContext from '@overflow/commons/context/AppContext'; import Action from '@overflow/commons/redux/Action'; import ProbeTask from '../../api/model/ProbeTask'; @@ -16,8 +16,8 @@ function* registTask(action: Action): SagaIterator { // type: types.SENDING_REQUEST, // payload: {sendingRequest: true}, // }); - - const ret = yield call(AppContext.getService().regist, probeTask); + let probeTaskService = AppContext.getInstance().getPouch(ProbeTaskService); + const ret = yield call({context: probeTaskService, fn: probeTaskService.regist}, probeTask); // if (responseBody.token === undefined) { // throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE); diff --git a/src/ts/@overflow/sensor/api/service/SensorItemService.ts b/src/ts/@overflow/sensor/api/service/SensorItemService.ts index 6f23aa5..1e8b238 100644 --- a/src/ts/@overflow/sensor/api/service/SensorItemService.ts +++ b/src/ts/@overflow/sensor/api/service/SensorItemService.ts @@ -16,7 +16,7 @@ export class SensorItemService extends Service { return null; } - public read(id:string): Promise { + public read(id:number): Promise { return null; } diff --git a/src/ts/@overflow/sensor/redux/saga/item_read.ts b/src/ts/@overflow/sensor/redux/saga/item_read.ts index 5c3f38d..f949634 100644 --- a/src/ts/@overflow/sensor/redux/saga/item_read.ts +++ b/src/ts/@overflow/sensor/redux/saga/item_read.ts @@ -1,7 +1,7 @@ import { SagaIterator } from 'redux-saga'; import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects'; -import AppContext from '@overflow/commons/context'; +import AppContext from '@overflow/commons/context/AppContext'; import Action from '@overflow/commons/redux/Action'; import SensorItem from '../../api/model/SensorItem'; @@ -16,8 +16,8 @@ function* readItem(action: Action): SagaIterator { // type: types.SENDING_REQUEST, // payload: {sendingRequest: true}, // }); - - const ret = yield call(AppContext.getService().read, id); + let sensorItemService = AppContext.getInstance().getPouch(SensorItemService); + const ret = yield call({context: sensorItemService, fn: sensorItemService.read}, id); // if (responseBody.token === undefined) { // throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE); diff --git a/src/ts/@overflow/sensor/redux/saga/item_read_by_sensor.ts b/src/ts/@overflow/sensor/redux/saga/item_read_by_sensor.ts index 2bee7e1..78a4c45 100644 --- a/src/ts/@overflow/sensor/redux/saga/item_read_by_sensor.ts +++ b/src/ts/@overflow/sensor/redux/saga/item_read_by_sensor.ts @@ -1,7 +1,7 @@ import { SagaIterator } from 'redux-saga'; import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects'; -import AppContext from '@overflow/commons/context'; +import AppContext from '@overflow/commons/context/AppContext'; import Action from '@overflow/commons/redux/Action'; import SensorItem from '../../api/model/SensorItem'; @@ -16,8 +16,8 @@ function* readAllItemBySensor(action: Action) // type: types.SENDING_REQUEST, // payload: {sendingRequest: true}, // }); - - const ret = yield call(AppContext.getService().readAllBySensor, sensor); + let sensorItemService = AppContext.getInstance().getPouch(SensorItemService); + const ret = yield call({context: sensorItemService, fn: sensorItemService.readAllBySensor}, sensor); // if (responseBody.token === undefined) { // throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE); diff --git a/src/ts/@overflow/sensor/redux/saga/item_regist.ts b/src/ts/@overflow/sensor/redux/saga/item_regist.ts index f1f6603..d485bb6 100644 --- a/src/ts/@overflow/sensor/redux/saga/item_regist.ts +++ b/src/ts/@overflow/sensor/redux/saga/item_regist.ts @@ -1,7 +1,7 @@ import { SagaIterator } from 'redux-saga'; import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects'; -import AppContext from '@overflow/commons/context'; +import AppContext from '@overflow/commons/context/AppContext'; import Action from '@overflow/commons/redux/Action'; import SensorItem from '../../api/model/SensorItem'; @@ -16,8 +16,8 @@ function* registItem(action: Action): SagaIterator { // type: types.SENDING_REQUEST, // payload: {sendingRequest: true}, // }); - - const ret = yield call(AppContext.getService().regist, sensorItem); + let sensorItemService = AppContext.getInstance().getPouch(SensorItemService); + const ret = yield call({context: sensorItemService, fn: sensorItemService.regist}, sensorItem); // if (responseBody.token === undefined) { // throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE); diff --git a/src/ts/@overflow/sensor/redux/saga/item_remove.ts b/src/ts/@overflow/sensor/redux/saga/item_remove.ts index 922edc1..24af218 100644 --- a/src/ts/@overflow/sensor/redux/saga/item_remove.ts +++ b/src/ts/@overflow/sensor/redux/saga/item_remove.ts @@ -1,7 +1,7 @@ import { SagaIterator } from 'redux-saga'; import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects'; -import AppContext from '@overflow/commons/context'; +import AppContext from '@overflow/commons/context/AppContext'; import Action from '@overflow/commons/redux/Action'; import SensorItem from '../../api/model/SensorItem'; @@ -16,8 +16,8 @@ function* removeItem(action: Action): SagaIterator { // type: types.SENDING_REQUEST, // payload: {sendingRequest: true}, // }); - - yield call(AppContext.getService().remove, sensorItem); + let sensorItemService = AppContext.getInstance().getPouch(SensorItemService); + yield call({context: sensorItemService, fn: sensorItemService.remove}, sensorItem); // if (responseBody.token === undefined) { // throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE); diff --git a/src/ts/@overflow/sensor/redux/saga/read.ts b/src/ts/@overflow/sensor/redux/saga/read.ts index ce444eb..def367b 100644 --- a/src/ts/@overflow/sensor/redux/saga/read.ts +++ b/src/ts/@overflow/sensor/redux/saga/read.ts @@ -1,7 +1,7 @@ import { SagaIterator } from 'redux-saga'; import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects'; -import AppContext from '@overflow/commons/context'; +import AppContext from '@overflow/commons/context/AppContext'; import Action from '@overflow/commons/redux/Action'; import Sensor from '../../api/model/Sensor'; @@ -16,8 +16,8 @@ function* read(action: Action): SagaIterator { // type: types.SENDING_REQUEST, // payload: {sendingRequest: true}, // }); - - const ret = yield call(AppContext.getService().read, id); + let sensorService = AppContext.getInstance().getPouch(SensorService); + const ret = yield call({context: sensorService, fn: sensorService.read}, id); // if (responseBody.token === undefined) { // throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE); diff --git a/src/ts/@overflow/sensor/redux/saga/read_all_by_target.ts b/src/ts/@overflow/sensor/redux/saga/read_all_by_target.ts index eb3dd23..5751d92 100644 --- a/src/ts/@overflow/sensor/redux/saga/read_all_by_target.ts +++ b/src/ts/@overflow/sensor/redux/saga/read_all_by_target.ts @@ -1,7 +1,7 @@ import { SagaIterator } from 'redux-saga'; import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects'; -import AppContext from '@overflow/commons/context'; +import AppContext from '@overflow/commons/context/AppContext'; import Action from '@overflow/commons/redux/Action'; import Sensor from '../../api/model/Sensor'; @@ -16,8 +16,8 @@ function* readAllByTarget(action: Action): SagaIterator // type: types.SENDING_REQUEST, // payload: {sendingRequest: true}, // }); - - const ret = yield call(AppContext.getService().readAllByTarget, target); + let sensorService = AppContext.getInstance().getPouch(SensorService); + const ret = yield call({context: sensorService, fn: sensorService.readAllByTarget}, target); // if (responseBody.token === undefined) { // throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE); diff --git a/src/ts/@overflow/sensor/redux/saga/regist.ts b/src/ts/@overflow/sensor/redux/saga/regist.ts index e2fd438..7ce6a4c 100644 --- a/src/ts/@overflow/sensor/redux/saga/regist.ts +++ b/src/ts/@overflow/sensor/redux/saga/regist.ts @@ -1,7 +1,7 @@ import { SagaIterator } from 'redux-saga'; import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects'; -import AppContext from '@overflow/commons/context'; +import AppContext from '@overflow/commons/context/AppContext'; import Action from '@overflow/commons/redux/Action'; import Sensor from '../../api/model/Sensor'; @@ -16,8 +16,8 @@ function* regist(action: Action): SagaIterator { // type: types.SENDING_REQUEST, // payload: {sendingRequest: true}, // }); - - const ret = yield call(AppContext.getService().regist, sensor); + let sensorService = AppContext.getInstance().getPouch(SensorService); + const ret = yield call({context: sensorService, fn: sensorService.regist}, sensor); // if (responseBody.token === undefined) { // throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE); diff --git a/src/ts/@overflow/sensor/redux/saga/remove.ts b/src/ts/@overflow/sensor/redux/saga/remove.ts index c1f5039..94c8c29 100644 --- a/src/ts/@overflow/sensor/redux/saga/remove.ts +++ b/src/ts/@overflow/sensor/redux/saga/remove.ts @@ -1,7 +1,7 @@ import { SagaIterator } from 'redux-saga'; import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects'; -import AppContext from '@overflow/commons/context'; +import AppContext from '@overflow/commons/context/AppContext'; import Action from '@overflow/commons/redux/Action'; import Sensor from '../../api/model/Sensor'; @@ -16,8 +16,8 @@ function* remove(action: Action): SagaIterator { // type: types.SENDING_REQUEST, // payload: {sendingRequest: true}, // }); - - const retSensor = yield call(AppContext.getService().remove, sensor); + let sensorService = AppContext.getInstance().getPouch(SensorService); + const retSensor = yield call({context: sensorService, fn: sensorService.remove}, sensor); // if (responseBody.token === undefined) { // throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE); diff --git a/src/ts/@overflow/sensor/redux/saga/start.ts b/src/ts/@overflow/sensor/redux/saga/start.ts index 604e7ac..6b1d743 100644 --- a/src/ts/@overflow/sensor/redux/saga/start.ts +++ b/src/ts/@overflow/sensor/redux/saga/start.ts @@ -1,7 +1,7 @@ import { SagaIterator } from 'redux-saga'; import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects'; -import AppContext from '@overflow/commons/context'; +import AppContext from '@overflow/commons/context/AppContext'; import Action from '@overflow/commons/redux/Action'; import Sensor from '../../api/model/Sensor'; @@ -16,8 +16,8 @@ function* start(action: Action): SagaIterator { // type: types.SENDING_REQUEST, // payload: {sendingRequest: true}, // }); - - const ret = yield call(AppContext.getService().start, sensor); + let sensorService = AppContext.getInstance().getPouch(SensorService); + const ret = yield call({context: sensorService, fn: sensorService.start}, sensor); // if (responseBody.token === undefined) { // throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE); diff --git a/src/ts/@overflow/sensor/redux/saga/stop.ts b/src/ts/@overflow/sensor/redux/saga/stop.ts index 6619c1f..bc30a72 100644 --- a/src/ts/@overflow/sensor/redux/saga/stop.ts +++ b/src/ts/@overflow/sensor/redux/saga/stop.ts @@ -1,7 +1,7 @@ import { SagaIterator } from 'redux-saga'; import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects'; -import AppContext from '@overflow/commons/context'; +import AppContext from '@overflow/commons/context/AppContext'; import Action from '@overflow/commons/redux/Action'; import Sensor from '../../api/model/Sensor'; @@ -16,8 +16,8 @@ function* stop(action: Action): SagaIterator { // type: types.SENDING_REQUEST, // payload: {sendingRequest: true}, // }); - - const ret = yield call(AppContext.getService().stop, sensor); + let sensorService = AppContext.getInstance().getPouch(SensorService); + const ret = yield call({context: sensorService, fn: sensorService.stop}, sensor); // if (responseBody.token === undefined) { // throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE); diff --git a/src/ts/@overflow/target/redux/saga/read.ts b/src/ts/@overflow/target/redux/saga/read.ts index 8dca236..6c39115 100644 --- a/src/ts/@overflow/target/redux/saga/read.ts +++ b/src/ts/@overflow/target/redux/saga/read.ts @@ -1,7 +1,7 @@ import { SagaIterator } from 'redux-saga'; import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects'; -import AppContext from '@overflow/commons/context'; +import AppContext from '@overflow/commons/context/AppContext'; import Action from '@overflow/commons/redux/Action'; import Target from '../../api/model/Target'; @@ -17,7 +17,8 @@ function* read(action: Action): SagaIterator { // payload: {sendingRequest: true}, // }); - const retTarget = yield call(AppContext.getService().read, id); + let targetService = AppContext.getInstance().getPouch(TargetService); + const retTarget = yield call({context: targetService, fn: targetService.read}, id); // if (responseBody.token === undefined) { // throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE); diff --git a/src/ts/@overflow/target/redux/saga/read_all_by_probe.ts b/src/ts/@overflow/target/redux/saga/read_all_by_probe.ts index bd2cabb..e583dac 100644 --- a/src/ts/@overflow/target/redux/saga/read_all_by_probe.ts +++ b/src/ts/@overflow/target/redux/saga/read_all_by_probe.ts @@ -1,7 +1,7 @@ import { SagaIterator } from 'redux-saga'; import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects'; -import AppContext from '@overflow/commons/context'; +import AppContext from '@overflow/commons/context/AppContext'; import Action from '@overflow/commons/redux/Action'; import Target from '../../api/model/Target'; @@ -17,7 +17,8 @@ function* readAllByProbe(action: Action): SagaIterator { // payload: {sendingRequest: true}, // }); - const retTargets = yield call(AppContext.getService().readAllByProbe, probe); + let targetService = AppContext.getInstance().getPouch(TargetService); + const retTargets = yield call({context: targetService, fn: targetService.readAllByProbe}, probe); // if (responseBody.token === undefined) { // throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE); diff --git a/src/ts/@overflow/target/redux/saga/regist.ts b/src/ts/@overflow/target/redux/saga/regist.ts index 7bc1753..4531800 100644 --- a/src/ts/@overflow/target/redux/saga/regist.ts +++ b/src/ts/@overflow/target/redux/saga/regist.ts @@ -1,7 +1,7 @@ import { SagaIterator } from 'redux-saga'; import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects'; -import AppContext from '@overflow/commons/context'; +import AppContext from '@overflow/commons/context/AppContext'; import Action from '@overflow/commons/redux/Action'; import Target from '../../api/model/Target'; @@ -16,8 +16,8 @@ function* regist(action: Action): SagaIterator { // type: types.SENDING_REQUEST, // payload: {sendingRequest: true}, // }); - - const retTarget = yield call(AppContext.getService().regist, target); + let targetService = AppContext.getInstance().getPouch(TargetService); + const retTarget = yield call({context: targetService, fn: targetService.regist}, target); // if (responseBody.token === undefined) { // throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE); diff --git a/src/ts/@overflow/target/redux/saga/regist_discovered_target.ts b/src/ts/@overflow/target/redux/saga/regist_discovered_target.ts index 0e050cd..1d70878 100644 --- a/src/ts/@overflow/target/redux/saga/regist_discovered_target.ts +++ b/src/ts/@overflow/target/redux/saga/regist_discovered_target.ts @@ -1,7 +1,7 @@ import { SagaIterator } from 'redux-saga'; import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects'; -import AppContext from '@overflow/commons/context'; +import AppContext from '@overflow/commons/context/AppContext'; import Action from '@overflow/commons/redux/Action'; import Target from '../../api/model/Target'; @@ -16,8 +16,8 @@ function* registDiscoveredTarget(action: Action): // type: types.SENDING_REQUEST, // payload: {sendingRequest: true}, // }); - - yield call(AppContext.getService().saveAllTarget, hosts, probe); + let targetDiscoveryService = AppContext.getInstance().getPouch(TargetDiscoveryService); + yield call({context: targetDiscoveryService, fn: targetDiscoveryService.saveAllTarget}, hosts, probe); // if (responseBody.token === undefined) { // throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE); diff --git a/src/ts/@overflow/target/redux/saga/remove.ts b/src/ts/@overflow/target/redux/saga/remove.ts index 3908a26..9012bbf 100644 --- a/src/ts/@overflow/target/redux/saga/remove.ts +++ b/src/ts/@overflow/target/redux/saga/remove.ts @@ -1,7 +1,7 @@ import { SagaIterator } from 'redux-saga'; import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects'; -import AppContext from '@overflow/commons/context'; +import AppContext from '@overflow/commons/context/AppContext'; import Action from '@overflow/commons/redux/Action'; import Target from '../../api/model/Target'; @@ -17,7 +17,8 @@ function* remove(action: Action): SagaIterator { // payload: {sendingRequest: true}, // }); - yield call(AppContext.getService().remove, target); + let targetService = AppContext.getInstance().getPouch(TargetService); + yield call({context: targetService, fn: targetService.remove}, target); // if (responseBody.token === undefined) { // throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE); diff --git a/src/ts/@overflow/temp/react/components/Discovery.tsx b/src/ts/@overflow/temp/react/components/Discovery.tsx index 57ba13b..780ce48 100644 --- a/src/ts/@overflow/temp/react/components/Discovery.tsx +++ b/src/ts/@overflow/temp/react/components/Discovery.tsx @@ -1,18 +1,11 @@ import * as React from 'react'; import { RouteComponentProps } from 'react-router'; import DiscoveryContainer from '@overflow/discovery/react/Discovery'; -import WebSocketRPC from '@overflow/commons/websocket/WebSocketRPC'; -import AppContext from '@overflow/commons/context'; -import inject from '@overflow/commons/context/decorator/inject'; class Discovery extends React.Component, object> { - private client: WebSocketRPC; - public constructor(props?: RouteComponentProps, context?: object) { super(props, context); - - let con = AppContext.get(); } public render(): JSX.Element { diff --git a/src/ts/@overflow/temp/react/components/TableSortView.tsx b/src/ts/@overflow/temp/react/components/TableSortView.tsx index c243aa9..1e67a04 100644 --- a/src/ts/@overflow/temp/react/components/TableSortView.tsx +++ b/src/ts/@overflow/temp/react/components/TableSortView.tsx @@ -1,18 +1,11 @@ import * as React from 'react'; import { RouteComponentProps } from 'react-router'; import TableSortContainer from '@overflow/temp/react/components/TableSortContainer'; -import WebSocketRPC from '@overflow/commons/websocket/WebSocketRPC'; -import AppContext from '@overflow/commons/context'; -import inject from '@overflow/commons/context/decorator/inject'; class TableSortView extends React.Component, object> { - private client: WebSocketRPC; - public constructor(props?: RouteComponentProps, context?: object) { super(props, context); - - let con = AppContext.get(); } public render(): JSX.Element {