Context API has been changed.
This commit is contained in:
parent
9d31903a6f
commit
f3f163047b
|
@ -2,7 +2,7 @@ import { SagaIterator } from 'redux-saga';
|
||||||
import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects';
|
import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects';
|
||||||
|
|
||||||
|
|
||||||
import AppContext from '@overflow/commons/context';
|
|
||||||
import Action from '@overflow/commons/redux/Action';
|
import Action from '@overflow/commons/redux/Action';
|
||||||
|
|
||||||
import ApiKey from '../../api/model/ApiKey';
|
import ApiKey from '../../api/model/ApiKey';
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { SagaIterator } from 'redux-saga';
|
||||||
import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects';
|
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 Action from '@overflow/commons/redux/Action';
|
||||||
|
|
||||||
import ApiKey from '../../api/model/ApiKey';
|
import ApiKey from '../../api/model/ApiKey';
|
||||||
|
@ -17,8 +17,8 @@ function* regist(action: Action<RegistPayload>): SagaIterator {
|
||||||
// type: types.SENDING_REQUEST,
|
// type: types.SENDING_REQUEST,
|
||||||
// payload: {sendingRequest: true},
|
// payload: {sendingRequest: true},
|
||||||
// });
|
// });
|
||||||
|
let apiKeyService: ApiKeyService = AppContext.getInstance().getPouch(ApiKeyService);
|
||||||
const retApikey = yield call(AppContext.getService<ApiKeyService>().regist, apiKey);
|
const retApikey = yield call({context: apiKeyService, fn: apiKeyService.regist}, apiKey);
|
||||||
|
|
||||||
// if (responseBody.token === undefined) {
|
// if (responseBody.token === undefined) {
|
||||||
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
||||||
|
|
|
@ -1,18 +1,11 @@
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { RouteComponentProps } from 'react-router';
|
import { RouteComponentProps } from 'react-router';
|
||||||
import TargetDetailContainer from '@overflow/target/react/TargetDetail';
|
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<RouteComponentProps<object>, object> {
|
class TargetDetail extends React.Component<RouteComponentProps<object>, object> {
|
||||||
|
|
||||||
private client: WebSocketRPC;
|
|
||||||
|
|
||||||
public constructor(props?: RouteComponentProps<object>, context?: object) {
|
public constructor(props?: RouteComponentProps<object>, context?: object) {
|
||||||
super(props, context);
|
super(props, context);
|
||||||
|
|
||||||
let con = AppContext.get<WebSocketRPC>();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public render(): JSX.Element {
|
public render(): JSX.Element {
|
||||||
|
|
|
@ -1,18 +1,11 @@
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { RouteComponentProps } from 'react-router';
|
import { RouteComponentProps } from 'react-router';
|
||||||
import TargetListContainer from '@overflow/target/react/TargetList';
|
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<RouteComponentProps<object>, object> {
|
class TargetList extends React.Component<RouteComponentProps<object>, object> {
|
||||||
|
|
||||||
private client: WebSocketRPC;
|
|
||||||
|
|
||||||
public constructor(props?: RouteComponentProps<object>, context?: object) {
|
public constructor(props?: RouteComponentProps<object>, context?: object) {
|
||||||
super(props, context);
|
super(props, context);
|
||||||
|
|
||||||
let con = AppContext.get<WebSocketRPC>();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public render(): JSX.Element {
|
public render(): JSX.Element {
|
||||||
|
|
|
@ -1,18 +1,11 @@
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { RouteComponentProps } from 'react-router';
|
import { RouteComponentProps } from 'react-router';
|
||||||
import SignInContainer from '@overflow/member/react/SignIn';
|
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<RouteComponentProps<object>, object> {
|
class SignOut extends React.Component<RouteComponentProps<object>, object> {
|
||||||
|
|
||||||
private client: WebSocketRPC;
|
|
||||||
|
|
||||||
public constructor(props?: RouteComponentProps<object>, context?: object) {
|
public constructor(props?: RouteComponentProps<object>, context?: object) {
|
||||||
super(props, context);
|
super(props, context);
|
||||||
|
|
||||||
let con = AppContext.get<WebSocketRPC>();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public render(): JSX.Element {
|
public render(): JSX.Element {
|
||||||
|
@ -20,10 +13,6 @@ class SignOut extends React.Component<RouteComponentProps<object>, object> {
|
||||||
<SignInContainer />
|
<SignInContainer />
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
private test( c: WebSocketRPC): void {
|
|
||||||
console.log('');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,18 +1,11 @@
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { RouteComponentProps } from 'react-router';
|
import { RouteComponentProps } from 'react-router';
|
||||||
import ProbeDetailContainer from '@overflow/probe/react/ProbeDetail';
|
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<RouteComponentProps<object>, object> {
|
class ProbeDetail extends React.Component<RouteComponentProps<object>, object> {
|
||||||
|
|
||||||
private client: WebSocketRPC;
|
|
||||||
|
|
||||||
public constructor(props?: RouteComponentProps<object>, context?: object) {
|
public constructor(props?: RouteComponentProps<object>, context?: object) {
|
||||||
super(props, context);
|
super(props, context);
|
||||||
|
|
||||||
let con = AppContext.get<WebSocketRPC>();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public render(): JSX.Element {
|
public render(): JSX.Element {
|
||||||
|
|
|
@ -1,17 +1,10 @@
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { RouteComponentProps } from 'react-router';
|
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<RouteComponentProps<object>, object> {
|
class ProbeHistory extends React.Component<RouteComponentProps<object>, object> {
|
||||||
|
|
||||||
private client: WebSocketRPC;
|
|
||||||
|
|
||||||
public constructor(props?: RouteComponentProps<object>, context?: object) {
|
public constructor(props?: RouteComponentProps<object>, context?: object) {
|
||||||
super(props, context);
|
super(props, context);
|
||||||
|
|
||||||
let con = AppContext.get<WebSocketRPC>();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public render(): JSX.Element {
|
public render(): JSX.Element {
|
||||||
|
|
|
@ -1,18 +1,11 @@
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { RouteComponentProps } from 'react-router';
|
import { RouteComponentProps } from 'react-router';
|
||||||
import ProbeHostContainer from '@overflow/probe/react/ProbeHost';
|
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<RouteComponentProps<object>, object> {
|
class ProbeHost extends React.Component<RouteComponentProps<object>, object> {
|
||||||
|
|
||||||
private client: WebSocketRPC;
|
|
||||||
|
|
||||||
public constructor(props?: RouteComponentProps<object>, context?: object) {
|
public constructor(props?: RouteComponentProps<object>, context?: object) {
|
||||||
super(props, context);
|
super(props, context);
|
||||||
|
|
||||||
let con = AppContext.get<WebSocketRPC>();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public render(): JSX.Element {
|
public render(): JSX.Element {
|
||||||
|
|
|
@ -1,18 +1,11 @@
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { RouteComponentProps } from 'react-router';
|
import { RouteComponentProps } from 'react-router';
|
||||||
import ProbeListContainer from '@overflow/probe/react/ProbeList';
|
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<RouteComponentProps<object>, object> {
|
class ProbeList extends React.Component<RouteComponentProps<object>, object> {
|
||||||
|
|
||||||
private client: WebSocketRPC;
|
|
||||||
|
|
||||||
public constructor(props?: RouteComponentProps<object>, context?: object) {
|
public constructor(props?: RouteComponentProps<object>, context?: object) {
|
||||||
super(props, context);
|
super(props, context);
|
||||||
|
|
||||||
let con = AppContext.get<WebSocketRPC>();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public render(): JSX.Element {
|
public render(): JSX.Element {
|
||||||
|
|
|
@ -1,18 +1,11 @@
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { RouteComponentProps } from 'react-router';
|
import { RouteComponentProps } from 'react-router';
|
||||||
import NoauthProbeListContainer from '@overflow/noauthprobe/react/NoauthProbeList';
|
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<RouteComponentProps<object>, object> {
|
class ProbeList extends React.Component<RouteComponentProps<object>, object> {
|
||||||
|
|
||||||
private client: WebSocketRPC;
|
|
||||||
|
|
||||||
public constructor(props?: RouteComponentProps<object>, context?: object) {
|
public constructor(props?: RouteComponentProps<object>, context?: object) {
|
||||||
super(props, context);
|
super(props, context);
|
||||||
|
|
||||||
let con = AppContext.get<WebSocketRPC>();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public render(): JSX.Element {
|
public render(): JSX.Element {
|
||||||
|
|
|
@ -1,18 +1,11 @@
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { RouteComponentProps } from 'react-router';
|
import { RouteComponentProps } from 'react-router';
|
||||||
import ProbeDownContainer from '@overflow/probe/react/ProbeDown';
|
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<RouteComponentProps<object>, object> {
|
class ProbeList extends React.Component<RouteComponentProps<object>, object> {
|
||||||
|
|
||||||
private client: WebSocketRPC;
|
|
||||||
|
|
||||||
public constructor(props?: RouteComponentProps<object>, context?: object) {
|
public constructor(props?: RouteComponentProps<object>, context?: object) {
|
||||||
super(props, context);
|
super(props, context);
|
||||||
|
|
||||||
let con = AppContext.get<WebSocketRPC>();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public render(): JSX.Element {
|
public render(): JSX.Element {
|
||||||
|
|
|
@ -1,18 +1,11 @@
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { RouteComponentProps } from 'react-router';
|
import { RouteComponentProps } from 'react-router';
|
||||||
import SensorDetailContainer from '@overflow/sensor/react/SensorDetail';
|
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<RouteComponentProps<object>, object> {
|
class SensorDetail extends React.Component<RouteComponentProps<object>, object> {
|
||||||
|
|
||||||
private client: WebSocketRPC;
|
|
||||||
|
|
||||||
public constructor(props?: RouteComponentProps<object>, context?: object) {
|
public constructor(props?: RouteComponentProps<object>, context?: object) {
|
||||||
super(props, context);
|
super(props, context);
|
||||||
|
|
||||||
let con = AppContext.get<WebSocketRPC>();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public render(): JSX.Element {
|
public render(): JSX.Element {
|
||||||
|
@ -20,10 +13,6 @@ class SensorDetail extends React.Component<RouteComponentProps<object>, object>
|
||||||
<SensorDetailContainer />
|
<SensorDetailContainer />
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
private test( c: WebSocketRPC): void {
|
|
||||||
console.log('');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,18 +1,11 @@
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { RouteComponentProps } from 'react-router';
|
import { RouteComponentProps } from 'react-router';
|
||||||
import SensorDetailInfoContainer from '@overflow/sensor/react/SensorDetailInfo';
|
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<RouteComponentProps<object>, object> {
|
class SensorDetailInfo extends React.Component<RouteComponentProps<object>, object> {
|
||||||
|
|
||||||
private client: WebSocketRPC;
|
|
||||||
|
|
||||||
public constructor(props?: RouteComponentProps<object>, context?: object) {
|
public constructor(props?: RouteComponentProps<object>, context?: object) {
|
||||||
super(props, context);
|
super(props, context);
|
||||||
|
|
||||||
let con = AppContext.get<WebSocketRPC>();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public render(): JSX.Element {
|
public render(): JSX.Element {
|
||||||
|
@ -20,10 +13,6 @@ class SensorDetailInfo extends React.Component<RouteComponentProps<object>, obje
|
||||||
<SensorDetailInfoContainer />
|
<SensorDetailInfoContainer />
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
private test( c: WebSocketRPC): void {
|
|
||||||
console.log('');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,18 +1,11 @@
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { RouteComponentProps } from 'react-router';
|
import { RouteComponentProps } from 'react-router';
|
||||||
import SensorDetailItemsContainer from '@overflow/sensor/react/SensorDetailItems';
|
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<RouteComponentProps<object>, object> {
|
class SensorDetailItems extends React.Component<RouteComponentProps<object>, object> {
|
||||||
|
|
||||||
private client: WebSocketRPC;
|
|
||||||
|
|
||||||
public constructor(props?: RouteComponentProps<object>, context?: object) {
|
public constructor(props?: RouteComponentProps<object>, context?: object) {
|
||||||
super(props, context);
|
super(props, context);
|
||||||
|
|
||||||
let con = AppContext.get<WebSocketRPC>();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public render(): JSX.Element {
|
public render(): JSX.Element {
|
||||||
|
@ -20,10 +13,6 @@ class SensorDetailItems extends React.Component<RouteComponentProps<object>, obj
|
||||||
<SensorDetailItemsContainer />
|
<SensorDetailItemsContainer />
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
private test( c: WebSocketRPC): void {
|
|
||||||
console.log('');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,18 +1,11 @@
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { RouteComponentProps } from 'react-router';
|
import { RouteComponentProps } from 'react-router';
|
||||||
import SensorItemTreeContainer from '@overflow/meta/react/SensorItemTree';
|
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<RouteComponentProps<object>, object> {
|
class SensorItemTree extends React.Component<RouteComponentProps<object>, object> {
|
||||||
|
|
||||||
private client: WebSocketRPC;
|
|
||||||
|
|
||||||
public constructor(props?: RouteComponentProps<object>, context?: object) {
|
public constructor(props?: RouteComponentProps<object>, context?: object) {
|
||||||
super(props, context);
|
super(props, context);
|
||||||
|
|
||||||
let con = AppContext.get<WebSocketRPC>();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public render(): JSX.Element {
|
public render(): JSX.Element {
|
||||||
|
@ -20,10 +13,6 @@ class SensorItemTree extends React.Component<RouteComponentProps<object>, object
|
||||||
<SensorItemTreeContainer />
|
<SensorItemTreeContainer />
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
private test( c: WebSocketRPC): void {
|
|
||||||
console.log('');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,18 +1,11 @@
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { RouteComponentProps } from 'react-router';
|
import { RouteComponentProps } from 'react-router';
|
||||||
import SensorListContainer from '@overflow/sensor/react/SensorList';
|
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<RouteComponentProps<object>, object> {
|
class SensorList extends React.Component<RouteComponentProps<object>, object> {
|
||||||
|
|
||||||
private client: WebSocketRPC;
|
|
||||||
|
|
||||||
public constructor(props?: RouteComponentProps<object>, context?: object) {
|
public constructor(props?: RouteComponentProps<object>, context?: object) {
|
||||||
super(props, context);
|
super(props, context);
|
||||||
|
|
||||||
let con = AppContext.get<WebSocketRPC>();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public render(): JSX.Element {
|
public render(): JSX.Element {
|
||||||
|
@ -20,10 +13,6 @@ class SensorList extends React.Component<RouteComponentProps<object>, object> {
|
||||||
<SensorListContainer />
|
<SensorListContainer />
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
private test( c: WebSocketRPC): void {
|
|
||||||
console.log('');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,18 +1,11 @@
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { RouteComponentProps } from 'react-router';
|
import { RouteComponentProps } from 'react-router';
|
||||||
import SensorSetupContainer from '@overflow/sensor/react/SensorConfiguration';
|
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<RouteComponentProps<object>, object> {
|
class SensorSetup extends React.Component<RouteComponentProps<object>, object> {
|
||||||
|
|
||||||
private client: WebSocketRPC;
|
|
||||||
|
|
||||||
public constructor(props?: RouteComponentProps<object>, context?: object) {
|
public constructor(props?: RouteComponentProps<object>, context?: object) {
|
||||||
super(props, context);
|
super(props, context);
|
||||||
|
|
||||||
let con = AppContext.get<WebSocketRPC>();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public render(): JSX.Element {
|
public render(): JSX.Element {
|
||||||
|
@ -20,10 +13,6 @@ class SensorSetup extends React.Component<RouteComponentProps<object>, object> {
|
||||||
<SensorSetupContainer />
|
<SensorSetupContainer />
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
private test(c: WebSocketRPC): void {
|
|
||||||
console.log('');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -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__';
|
|
|
@ -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<string | symbol, Config>;
|
|
||||||
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;
|
|
|
@ -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 <TFunction extends Function>(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;
|
|
|
@ -1,78 +0,0 @@
|
||||||
import * as METADATA from './constants';
|
|
||||||
import { Config as InjectConfig } from './decorator/inject';
|
|
||||||
|
|
||||||
export type ClassConstructor<T> = {new(...args: any[]): T};
|
|
||||||
|
|
||||||
class AppContext {
|
|
||||||
private static context: AppContext = null;
|
|
||||||
private instanceMap: Map<symbol, Function>;
|
|
||||||
|
|
||||||
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<string | symbol, InjectConfig> = 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<T>(type: ClassConstructor<T>, ...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>(): 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;
|
|
|
@ -1,5 +1,3 @@
|
||||||
import AppContext from '../context';
|
|
||||||
|
|
||||||
abstract class Platform {
|
abstract class Platform {
|
||||||
|
|
||||||
public static getAppContainer(containerId: string): Promise<HTMLElement> {
|
public static getAppContainer(containerId: string): Promise<HTMLElement> {
|
||||||
|
@ -12,15 +10,6 @@ abstract class Platform {
|
||||||
return appContainer;
|
return appContainer;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static * getAppContext(): IterableIterator<Promise<AppContext>> {
|
|
||||||
const appContext = yield new Promise<AppContext>(resolve => {
|
|
||||||
const context = AppContext.getContext();
|
|
||||||
resolve(context);
|
|
||||||
});
|
|
||||||
|
|
||||||
return appContext;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default Platform;
|
export default Platform;
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { SagaIterator } from 'redux-saga';
|
||||||
import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects';
|
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 Action from '@overflow/commons/redux/Action';
|
||||||
|
|
||||||
import DomainMember from '../../api/model/DomainMember';
|
import DomainMember from '../../api/model/DomainMember';
|
||||||
|
@ -17,8 +17,8 @@ function* regist(action: Action<MemberRegistPayload>): SagaIterator {
|
||||||
// type: types.SENDING_REQUEST,
|
// type: types.SENDING_REQUEST,
|
||||||
// payload: {sendingRequest: true},
|
// payload: {sendingRequest: true},
|
||||||
// });
|
// });
|
||||||
|
let domainMemberService = AppContext.getInstance().getPouch(DomainMemberService);
|
||||||
yield call(AppContext.getService<DomainMemberService>().regist, dm);
|
yield call({context: domainMemberService, fn: domainMemberService.regist}, dm);
|
||||||
|
|
||||||
// if (responseBody.token === undefined) {
|
// if (responseBody.token === undefined) {
|
||||||
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { SagaIterator } from 'redux-saga';
|
||||||
import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects';
|
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 Action from '@overflow/commons/redux/Action';
|
||||||
|
|
||||||
import Domain from '../../api/model/Domain';
|
import Domain from '../../api/model/Domain';
|
||||||
|
@ -17,8 +17,8 @@ function* regist(action: Action<RegistPayload>): SagaIterator {
|
||||||
// type: types.SENDING_REQUEST,
|
// type: types.SENDING_REQUEST,
|
||||||
// payload: {sendingRequest: true},
|
// payload: {sendingRequest: true},
|
||||||
// });
|
// });
|
||||||
|
let domainService = AppContext.getInstance().getPouch(DomainService);
|
||||||
yield call(AppContext.getService<DomainService>().regist, dm);
|
yield call({context: domainService, fn: domainService.regist}, dm);
|
||||||
|
|
||||||
// if (responseBody.token === undefined) {
|
// if (responseBody.token === undefined) {
|
||||||
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
||||||
|
|
|
@ -6,7 +6,7 @@ import { SagaIterator } from 'redux-saga';
|
||||||
import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects';
|
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 Action from '@overflow/commons/redux/Action';
|
||||||
|
|
||||||
import EmailAuth from '@overflow/email/api/model/EmailAuth';
|
import EmailAuth from '@overflow/email/api/model/EmailAuth';
|
||||||
|
@ -22,8 +22,8 @@ function* modify(action: Action<ModifyPayload>): SagaIterator {
|
||||||
// type: types.SENDING_REQUEST,
|
// type: types.SENDING_REQUEST,
|
||||||
// payload: {sendingRequest: true},
|
// payload: {sendingRequest: true},
|
||||||
// });
|
// });
|
||||||
|
let emailAuthService = AppContext.getInstance().getPouch(EmailAuthService);
|
||||||
const emailAuth = yield call(AppContext.getService<EmailAuthService>().modify, ea);
|
const emailAuth = yield call({context: emailAuthService, fn: emailAuthService.modify}, ea);
|
||||||
|
|
||||||
// if (responseBody.token === undefined) {
|
// if (responseBody.token === undefined) {
|
||||||
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { SagaIterator } from 'redux-saga';
|
||||||
import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects';
|
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 Action from '@overflow/commons/redux/Action';
|
||||||
|
|
||||||
import EmailAuth from '@overflow/email/api/model/EmailAuth';
|
import EmailAuth from '@overflow/email/api/model/EmailAuth';
|
||||||
|
@ -18,8 +18,8 @@ function* read(action: Action<ReadPayload>): SagaIterator {
|
||||||
// type: types.SENDING_REQUEST,
|
// type: types.SENDING_REQUEST,
|
||||||
// payload: {sendingRequest: true},
|
// payload: {sendingRequest: true},
|
||||||
// });
|
// });
|
||||||
|
let emailAuthService = AppContext.getInstance().getPouch(EmailAuthService);
|
||||||
const emailAuth = yield call(AppContext.getService<EmailAuthService>().read, id);
|
const emailAuth = yield call({context: emailAuthService, fn: emailAuthService.read}, id);
|
||||||
|
|
||||||
// if (responseBody.token === undefined) {
|
// if (responseBody.token === undefined) {
|
||||||
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { SagaIterator } from 'redux-saga';
|
||||||
import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects';
|
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 Action from '@overflow/commons/redux/Action';
|
||||||
|
|
||||||
import EmailAuth from '@overflow/email/api/model/EmailAuth';
|
import EmailAuth from '@overflow/email/api/model/EmailAuth';
|
||||||
|
@ -18,8 +18,8 @@ function* readByAuthKey(action: Action<ReadByAuthKeyPayload>): SagaIterator {
|
||||||
// type: types.SENDING_REQUEST,
|
// type: types.SENDING_REQUEST,
|
||||||
// payload: {sendingRequest: true},
|
// payload: {sendingRequest: true},
|
||||||
// });
|
// });
|
||||||
|
let emailAuthService = AppContext.getInstance().getPouch(EmailAuthService);
|
||||||
const emailAuth = yield call(AppContext.getService<EmailAuthService>().readByAuthKey, authKey);
|
const emailAuth = yield call({context: emailAuthService, fn: emailAuthService.readByAuthKey}, authKey);
|
||||||
|
|
||||||
// if (responseBody.token === undefined) {
|
// if (responseBody.token === undefined) {
|
||||||
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { SagaIterator } from 'redux-saga';
|
||||||
import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects';
|
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 Action from '@overflow/commons/redux/Action';
|
||||||
|
|
||||||
import EmailAuth from '@overflow/email/api/model/EmailAuth';
|
import EmailAuth from '@overflow/email/api/model/EmailAuth';
|
||||||
|
@ -18,8 +18,8 @@ function* readByMember(action: Action<ReadByMemberPayload>): SagaIterator {
|
||||||
// type: types.SENDING_REQUEST,
|
// type: types.SENDING_REQUEST,
|
||||||
// payload: {sendingRequest: true},
|
// payload: {sendingRequest: true},
|
||||||
// });
|
// });
|
||||||
|
let emailAuthService = AppContext.getInstance().getPouch(EmailAuthService);
|
||||||
const emailAuths = yield call(AppContext.getService<EmailAuthService>().readByMember, id);
|
const emailAuths = yield call({context: emailAuthService, fn: emailAuthService.readByMember}, id);
|
||||||
|
|
||||||
// if (responseBody.token === undefined) {
|
// if (responseBody.token === undefined) {
|
||||||
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { SagaIterator } from 'redux-saga';
|
||||||
import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects';
|
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 Action from '@overflow/commons/redux/Action';
|
||||||
|
|
||||||
import EmailAuth from '@overflow/email/api/model/EmailAuth';
|
import EmailAuth from '@overflow/email/api/model/EmailAuth';
|
||||||
|
@ -18,8 +18,8 @@ function* sendEmail(action: Action<SendEmailPayload>): SagaIterator {
|
||||||
// type: types.SENDING_REQUEST,
|
// type: types.SENDING_REQUEST,
|
||||||
// payload: {sendingRequest: true},
|
// payload: {sendingRequest: true},
|
||||||
// });
|
// });
|
||||||
|
let emailAuthService = AppContext.getInstance().getPouch(EmailAuthService);
|
||||||
const emailAuth = yield call(AppContext.getService<EmailAuthService>().sendEmailByMember, memberId, email);
|
const emailAuth = yield call({context: emailAuthService, fn: emailAuthService.sendEmailByMember}, memberId, email);
|
||||||
|
|
||||||
// if (responseBody.token === undefined) {
|
// if (responseBody.token === undefined) {
|
||||||
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { SagaIterator } from 'redux-saga';
|
||||||
import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects';
|
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 Action from '@overflow/commons/redux/Action';
|
||||||
|
|
||||||
import InfraHost from '../../api/model/InfraHost';
|
import InfraHost from '../../api/model/InfraHost';
|
||||||
|
@ -17,8 +17,8 @@ function* read(action: Action<HostReadPayload>): SagaIterator {
|
||||||
// type: types.SENDING_REQUEST,
|
// type: types.SENDING_REQUEST,
|
||||||
// payload: {sendingRequest: true},
|
// payload: {sendingRequest: true},
|
||||||
// });
|
// });
|
||||||
|
let infraHostService = AppContext.getInstance().getPouch(InfraHostService);
|
||||||
const retApikey = yield call(AppContext.getService<InfraHostService>().read, id);
|
const retApikey = yield call({context: infraHostService, fn: infraHostService.read}, id);
|
||||||
|
|
||||||
// if (responseBody.token === undefined) {
|
// if (responseBody.token === undefined) {
|
||||||
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { SagaIterator } from 'redux-saga';
|
||||||
import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects';
|
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 Action from '@overflow/commons/redux/Action';
|
||||||
|
|
||||||
import InfraHost from '../../api/model/InfraHost';
|
import InfraHost from '../../api/model/InfraHost';
|
||||||
|
@ -17,8 +17,8 @@ function* regist(action: Action<HostRegistPayload>): SagaIterator {
|
||||||
// type: types.SENDING_REQUEST,
|
// type: types.SENDING_REQUEST,
|
||||||
// payload: {sendingRequest: true},
|
// payload: {sendingRequest: true},
|
||||||
// });
|
// });
|
||||||
|
let infraHostService = AppContext.getInstance().getPouch(InfraHostService);
|
||||||
const retApikey = yield call(AppContext.getService<InfraHostService>().regist, infraHost);
|
const retApikey = yield call({context: infraHostService, fn: infraHostService.regist}, infraHost);
|
||||||
|
|
||||||
// if (responseBody.token === undefined) {
|
// if (responseBody.token === undefined) {
|
||||||
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { SagaIterator } from 'redux-saga';
|
||||||
import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects';
|
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 Action from '@overflow/commons/redux/Action';
|
||||||
|
|
||||||
import InfraMachine from '../../api/model/InfraMachine';
|
import InfraMachine from '../../api/model/InfraMachine';
|
||||||
|
@ -17,8 +17,8 @@ function* read(action: Action<MachineReadPayload>): SagaIterator {
|
||||||
// type: types.SENDING_REQUEST,
|
// type: types.SENDING_REQUEST,
|
||||||
// payload: {sendingRequest: true},
|
// payload: {sendingRequest: true},
|
||||||
// });
|
// });
|
||||||
|
let infraMachineService = AppContext.getInstance().getPouch(InfraMachineService);
|
||||||
const retApikey = yield call(AppContext.getService<InfraMachineService>().read, id);
|
const retApikey = yield call({context: infraMachineService, fn: infraMachineService.read}, id);
|
||||||
|
|
||||||
// if (responseBody.token === undefined) {
|
// if (responseBody.token === undefined) {
|
||||||
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { SagaIterator } from 'redux-saga';
|
||||||
import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects';
|
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 Action from '@overflow/commons/redux/Action';
|
||||||
|
|
||||||
import InfraMachine from '../../api/model/InfraMachine';
|
import InfraMachine from '../../api/model/InfraMachine';
|
||||||
|
@ -18,7 +18,8 @@ function* regist(action: Action<MachineRegistPayload>): SagaIterator {
|
||||||
// payload: {sendingRequest: true},
|
// payload: {sendingRequest: true},
|
||||||
// });
|
// });
|
||||||
|
|
||||||
const retApikey = yield call(AppContext.getService<InfraMachineService>().regist, infraMachine);
|
let infraMachineService = AppContext.getInstance().getPouch(InfraMachineService);
|
||||||
|
const retApikey = yield call({context: infraMachineService, fn: infraMachineService.regist}, infraMachine);
|
||||||
|
|
||||||
// if (responseBody.token === undefined) {
|
// if (responseBody.token === undefined) {
|
||||||
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { SagaIterator } from 'redux-saga';
|
||||||
import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects';
|
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 Action from '@overflow/commons/redux/Action';
|
||||||
|
|
||||||
import InfraOSApplication from '../../api/model/InfraOSApplication';
|
import InfraOSApplication from '../../api/model/InfraOSApplication';
|
||||||
|
@ -17,8 +17,8 @@ function* read(action: Action<OSApplicationReadPayload>): SagaIterator {
|
||||||
// type: types.SENDING_REQUEST,
|
// type: types.SENDING_REQUEST,
|
||||||
// payload: {sendingRequest: true},
|
// payload: {sendingRequest: true},
|
||||||
// });
|
// });
|
||||||
|
let infraOSApplicationService = AppContext.getInstance().getPouch(InfraOSApplicationService);
|
||||||
const retApikey = yield call(AppContext.getService<InfraOSApplicationService>().read, id);
|
const retApikey = yield call({context: infraOSApplicationService, fn: infraOSApplicationService.read}, id);
|
||||||
|
|
||||||
// if (responseBody.token === undefined) {
|
// if (responseBody.token === undefined) {
|
||||||
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { SagaIterator } from 'redux-saga';
|
||||||
import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects';
|
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 Action from '@overflow/commons/redux/Action';
|
||||||
|
|
||||||
import InfraOSApplication from '../../api/model/InfraOSApplication';
|
import InfraOSApplication from '../../api/model/InfraOSApplication';
|
||||||
|
@ -17,8 +17,8 @@ function* regist(action: Action<OSApplicationRegistPayload>): SagaIterator {
|
||||||
// type: types.SENDING_REQUEST,
|
// type: types.SENDING_REQUEST,
|
||||||
// payload: {sendingRequest: true},
|
// payload: {sendingRequest: true},
|
||||||
// });
|
// });
|
||||||
|
let infraOSApplicationService = AppContext.getInstance().getPouch(InfraOSApplicationService);
|
||||||
const retApikey = yield call(AppContext.getService<InfraOSApplicationService>().regist, infraOSApplication);
|
const retApikey = yield call({context: infraOSApplicationService, fn: infraOSApplicationService.regist}, infraOSApplication);
|
||||||
|
|
||||||
// if (responseBody.token === undefined) {
|
// if (responseBody.token === undefined) {
|
||||||
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { SagaIterator } from 'redux-saga';
|
||||||
import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects';
|
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 Action from '@overflow/commons/redux/Action';
|
||||||
|
|
||||||
import InfraOSDaemon from '../../api/model/InfraOSDaemon';
|
import InfraOSDaemon from '../../api/model/InfraOSDaemon';
|
||||||
|
@ -17,8 +17,8 @@ function* read(action: Action<OSDaemonReadPayload>): SagaIterator {
|
||||||
// type: types.SENDING_REQUEST,
|
// type: types.SENDING_REQUEST,
|
||||||
// payload: {sendingRequest: true},
|
// payload: {sendingRequest: true},
|
||||||
// });
|
// });
|
||||||
|
let infraOSDaemonService = AppContext.getInstance().getPouch(InfraOSDaemonService);
|
||||||
const retApikey = yield call(AppContext.getService<InfraOSDaemonService>().read, id);
|
const retApikey = yield call({context: infraOSDaemonService, fn: infraOSDaemonService.read}, id);
|
||||||
|
|
||||||
// if (responseBody.token === undefined) {
|
// if (responseBody.token === undefined) {
|
||||||
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { SagaIterator } from 'redux-saga';
|
||||||
import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects';
|
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 Action from '@overflow/commons/redux/Action';
|
||||||
|
|
||||||
import InfraOSDaemon from '../../api/model/InfraOSDaemon';
|
import InfraOSDaemon from '../../api/model/InfraOSDaemon';
|
||||||
|
@ -17,8 +17,8 @@ function* regist(action: Action<OSDaemonRegistPayload>): SagaIterator {
|
||||||
// type: types.SENDING_REQUEST,
|
// type: types.SENDING_REQUEST,
|
||||||
// payload: {sendingRequest: true},
|
// payload: {sendingRequest: true},
|
||||||
// });
|
// });
|
||||||
|
let infraOSDaemonService = AppContext.getInstance().getPouch(InfraOSDaemonService);
|
||||||
const retApikey = yield call(AppContext.getService<InfraOSDaemonService>().regist, infraOSDaemon);
|
const retApikey = yield call({context: infraOSDaemonService, fn: infraOSDaemonService.regist}, infraOSDaemon);
|
||||||
|
|
||||||
// if (responseBody.token === undefined) {
|
// if (responseBody.token === undefined) {
|
||||||
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { SagaIterator } from 'redux-saga';
|
||||||
import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects';
|
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 Action from '@overflow/commons/redux/Action';
|
||||||
|
|
||||||
import InfraOSPort from '../../api/model/InfraOSPort';
|
import InfraOSPort from '../../api/model/InfraOSPort';
|
||||||
|
@ -17,8 +17,8 @@ function* read(action: Action<OSPortReadPayload>): SagaIterator {
|
||||||
// type: types.SENDING_REQUEST,
|
// type: types.SENDING_REQUEST,
|
||||||
// payload: {sendingRequest: true},
|
// payload: {sendingRequest: true},
|
||||||
// });
|
// });
|
||||||
|
let infraOSPortService = AppContext.getInstance().getPouch(InfraOSPortService);
|
||||||
const retApikey = yield call(AppContext.getService<InfraOSPortService>().read, id);
|
const retApikey = yield call({context: infraOSPortService, fn: infraOSPortService.read}, id);
|
||||||
|
|
||||||
// if (responseBody.token === undefined) {
|
// if (responseBody.token === undefined) {
|
||||||
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { SagaIterator } from 'redux-saga';
|
||||||
import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects';
|
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 Action from '@overflow/commons/redux/Action';
|
||||||
|
|
||||||
import InfraOSPort from '../../api/model/InfraOSPort';
|
import InfraOSPort from '../../api/model/InfraOSPort';
|
||||||
|
@ -17,8 +17,8 @@ function* regist(action: Action<OSPortRegistPayload>): SagaIterator {
|
||||||
// type: types.SENDING_REQUEST,
|
// type: types.SENDING_REQUEST,
|
||||||
// payload: {sendingRequest: true},
|
// payload: {sendingRequest: true},
|
||||||
// });
|
// });
|
||||||
|
let infraOSPortService = AppContext.getInstance().getPouch(InfraOSPortService);
|
||||||
const retApikey = yield call(AppContext.getService<InfraOSPortService>().regist, infraOSPort);
|
const retApikey = yield call({context: infraOSPortService, fn: infraOSPortService.regist}, infraOSPort);
|
||||||
|
|
||||||
// if (responseBody.token === undefined) {
|
// if (responseBody.token === undefined) {
|
||||||
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { SagaIterator } from 'redux-saga';
|
||||||
import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects';
|
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 Action from '@overflow/commons/redux/Action';
|
||||||
|
|
||||||
import InfraOS from '../../api/model/InfraOS';
|
import InfraOS from '../../api/model/InfraOS';
|
||||||
|
@ -17,8 +17,8 @@ function* read(action: Action<OSReadPayload>): SagaIterator {
|
||||||
// type: types.SENDING_REQUEST,
|
// type: types.SENDING_REQUEST,
|
||||||
// payload: {sendingRequest: true},
|
// payload: {sendingRequest: true},
|
||||||
// });
|
// });
|
||||||
|
let infraOSService = AppContext.getInstance().getPouch(InfraOSService);
|
||||||
const retApikey = yield call(AppContext.getService<InfraOSService>().read, id);
|
const retApikey = yield call({context: infraOSService, fn: infraOSService.read}, id);
|
||||||
|
|
||||||
// if (responseBody.token === undefined) {
|
// if (responseBody.token === undefined) {
|
||||||
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { SagaIterator } from 'redux-saga';
|
||||||
import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects';
|
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 Action from '@overflow/commons/redux/Action';
|
||||||
|
|
||||||
import InfraOS from '../../api/model/InfraOS';
|
import InfraOS from '../../api/model/InfraOS';
|
||||||
|
@ -17,8 +17,8 @@ function* regist(action: Action<OSRegistPayload>): SagaIterator {
|
||||||
// type: types.SENDING_REQUEST,
|
// type: types.SENDING_REQUEST,
|
||||||
// payload: {sendingRequest: true},
|
// payload: {sendingRequest: true},
|
||||||
// });
|
// });
|
||||||
|
let infraOSService = AppContext.getInstance().getPouch(InfraOSService);
|
||||||
const retApikey = yield call(AppContext.getService<InfraOSService>().regist, infraOS);
|
const retApikey = yield call({context: infraOSService, fn: infraOSService.regist}, infraOS);
|
||||||
|
|
||||||
// if (responseBody.token === undefined) {
|
// if (responseBody.token === undefined) {
|
||||||
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { SagaIterator } from 'redux-saga';
|
||||||
import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects';
|
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 Action from '@overflow/commons/redux/Action';
|
||||||
|
|
||||||
import Infra from '../../api/model/Infra';
|
import Infra from '../../api/model/Infra';
|
||||||
|
@ -17,8 +17,8 @@ function* read(action: Action<ReadPayload>): SagaIterator {
|
||||||
// type: types.SENDING_REQUEST,
|
// type: types.SENDING_REQUEST,
|
||||||
// payload: {sendingRequest: true},
|
// payload: {sendingRequest: true},
|
||||||
// });
|
// });
|
||||||
|
let infraService = AppContext.getInstance().getPouch(InfraService);
|
||||||
const retApikey = yield call(AppContext.getService<InfraService>().read, id);
|
const retApikey = yield call({context: infraService, fn: infraService.read}, id);
|
||||||
|
|
||||||
// if (responseBody.token === undefined) {
|
// if (responseBody.token === undefined) {
|
||||||
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { SagaIterator } from 'redux-saga';
|
||||||
import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects';
|
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 Action from '@overflow/commons/redux/Action';
|
||||||
|
|
||||||
import Infra from '../../api/model/Infra';
|
import Infra from '../../api/model/Infra';
|
||||||
|
@ -17,8 +17,8 @@ function* regist(action: Action<RegistPayload>): SagaIterator {
|
||||||
// type: types.SENDING_REQUEST,
|
// type: types.SENDING_REQUEST,
|
||||||
// payload: {sendingRequest: true},
|
// payload: {sendingRequest: true},
|
||||||
// });
|
// });
|
||||||
|
let infraService = AppContext.getInstance().getPouch(InfraService);
|
||||||
const retApikey = yield call(AppContext.getService<InfraService>().regist, infra);
|
const retApikey = yield call({context: infraService, fn: infraService.regist}, infra);
|
||||||
|
|
||||||
// if (responseBody.token === undefined) {
|
// if (responseBody.token === undefined) {
|
||||||
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { SagaIterator } from 'redux-saga';
|
||||||
import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects';
|
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 Action from '@overflow/commons/redux/Action';
|
||||||
|
|
||||||
import InfraService from '../../api/model/InfraService';
|
import InfraService from '../../api/model/InfraService';
|
||||||
|
@ -17,8 +17,8 @@ function* read(action: Action<ServiceReadPayload>): SagaIterator {
|
||||||
// type: types.SENDING_REQUEST,
|
// type: types.SENDING_REQUEST,
|
||||||
// payload: {sendingRequest: true},
|
// payload: {sendingRequest: true},
|
||||||
// });
|
// });
|
||||||
|
let infraServiceService = AppContext.getInstance().getPouch(InfraServiceService);
|
||||||
const retApikey = yield call(AppContext.getService<InfraServiceService>().read, id);
|
const retApikey = yield call({context: infraServiceService, fn: infraServiceService.read}, id);
|
||||||
|
|
||||||
// if (responseBody.token === undefined) {
|
// if (responseBody.token === undefined) {
|
||||||
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { SagaIterator } from 'redux-saga';
|
||||||
import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects';
|
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 Action from '@overflow/commons/redux/Action';
|
||||||
|
|
||||||
import InfraService from '../../api/model/InfraService';
|
import InfraService from '../../api/model/InfraService';
|
||||||
|
@ -17,8 +17,8 @@ function* regist(action: Action<ServiceRegistPayload>): SagaIterator {
|
||||||
// type: types.SENDING_REQUEST,
|
// type: types.SENDING_REQUEST,
|
||||||
// payload: {sendingRequest: true},
|
// payload: {sendingRequest: true},
|
||||||
// });
|
// });
|
||||||
|
let infraServiceService = AppContext.getInstance().getPouch(InfraServiceService);
|
||||||
const retApikey = yield call(AppContext.getService<InfraServiceService>().regist, infraService);
|
const retApikey = yield call({context: infraServiceService, fn: infraServiceService.regist}, infraService);
|
||||||
|
|
||||||
// if (responseBody.token === undefined) {
|
// if (responseBody.token === undefined) {
|
||||||
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import Service from '@overflow/commons/api/Service';
|
import Service from '@overflow/commons/api/Service';
|
||||||
import Member from '../model/Member';
|
import Member from '../model/Member';
|
||||||
import Injectable from '@overflow/commons/context/pouches/decorator/Injectable';
|
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';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { SagaIterator } from 'redux-saga';
|
||||||
import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects';
|
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 Action from '@overflow/commons/redux/Action';
|
||||||
|
|
||||||
import Member from '../../api/model/Member';
|
import Member from '../../api/model/Member';
|
||||||
|
@ -17,8 +17,8 @@ function* modify(action: Action<ModifyPayload>): SagaIterator {
|
||||||
// type: types.SENDING_REQUEST,
|
// type: types.SENDING_REQUEST,
|
||||||
// payload: {sendingRequest: true},
|
// payload: {sendingRequest: true},
|
||||||
// });
|
// });
|
||||||
|
let memberService = AppContext.getInstance().getPouch(MemberService);
|
||||||
const member = yield call(AppContext.getService<MemberService>().modify, tempMember);
|
const member = yield call({context: memberService, fn: memberService.modify}, tempMember);
|
||||||
|
|
||||||
// if (responseBody.token === undefined) {
|
// if (responseBody.token === undefined) {
|
||||||
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { SagaIterator } from 'redux-saga';
|
||||||
import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects';
|
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 Action from '@overflow/commons/redux/Action';
|
||||||
|
|
||||||
import Member from '../../api/model/Member';
|
import Member from '../../api/model/Member';
|
||||||
|
@ -17,8 +17,8 @@ function* read(action: Action<ReadPayload>): SagaIterator {
|
||||||
// type: types.SENDING_REQUEST,
|
// type: types.SENDING_REQUEST,
|
||||||
// payload: {sendingRequest: true},
|
// payload: {sendingRequest: true},
|
||||||
// });
|
// });
|
||||||
|
let memberService = AppContext.getInstance().getPouch(MemberService);
|
||||||
const member = yield call(AppContext.getService<MemberService>().read, id);
|
const member = yield call({context: memberService, fn: memberService.read}, id);
|
||||||
|
|
||||||
// if (responseBody.token === undefined) {
|
// if (responseBody.token === undefined) {
|
||||||
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { SagaIterator } from 'redux-saga';
|
||||||
import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects';
|
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 Action from '@overflow/commons/redux/Action';
|
||||||
|
|
||||||
import NoAuthProbe from '../../api/model/NoAuthProbe';
|
import NoAuthProbe from '../../api/model/NoAuthProbe';
|
||||||
|
@ -17,8 +17,8 @@ function* read(action: Action<ReadPayload>): SagaIterator {
|
||||||
// type: types.SENDING_REQUEST,
|
// type: types.SENDING_REQUEST,
|
||||||
// payload: {sendingRequest: true},
|
// payload: {sendingRequest: true},
|
||||||
// });
|
// });
|
||||||
|
let noAuthProbeService = AppContext.getInstance().getPouch(NoAuthProbeService);
|
||||||
const retApikey = yield call(AppContext.getService<NoAuthProbeService>().read, id);
|
const retApikey = yield call({context: noAuthProbeService, fn: noAuthProbeService.read}, id);
|
||||||
|
|
||||||
// if (responseBody.token === undefined) {
|
// if (responseBody.token === undefined) {
|
||||||
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { SagaIterator } from 'redux-saga';
|
||||||
import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects';
|
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 Action from '@overflow/commons/redux/Action';
|
||||||
|
|
||||||
import NoAuthProbe from '../../api/model/NoAuthProbe';
|
import NoAuthProbe from '../../api/model/NoAuthProbe';
|
||||||
|
@ -17,8 +17,8 @@ function* readAllByDomain(action: Action<ReadAllByDomainPayload>): SagaIterator
|
||||||
// type: types.SENDING_REQUEST,
|
// type: types.SENDING_REQUEST,
|
||||||
// payload: {sendingRequest: true},
|
// payload: {sendingRequest: true},
|
||||||
// });
|
// });
|
||||||
|
let noAuthProbeService = AppContext.getInstance().getPouch(NoAuthProbeService);
|
||||||
const noauthProbeList = yield call(AppContext.getService<NoAuthProbeService>().readAllByDomain, domain);
|
const noauthProbeList = yield call({context: noAuthProbeService, fn: noAuthProbeService.readAllByDomain}, domain);
|
||||||
|
|
||||||
// if (responseBody.token === undefined) {
|
// if (responseBody.token === undefined) {
|
||||||
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { SagaIterator } from 'redux-saga';
|
||||||
import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects';
|
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 Action from '@overflow/commons/redux/Action';
|
||||||
|
|
||||||
import NoAuthProbe from '../../api/model/NoAuthProbe';
|
import NoAuthProbe from '../../api/model/NoAuthProbe';
|
||||||
|
@ -17,8 +17,8 @@ function* regist(action: Action<RegistPayload>): SagaIterator {
|
||||||
// type: types.SENDING_REQUEST,
|
// type: types.SENDING_REQUEST,
|
||||||
// payload: {sendingRequest: true},
|
// payload: {sendingRequest: true},
|
||||||
// });
|
// });
|
||||||
|
let noAuthProbeService = AppContext.getInstance().getPouch(NoAuthProbeService);
|
||||||
const retApikey = yield call(AppContext.getService<NoAuthProbeService>().regist, noAuthProbe);
|
const retApikey = yield call({context: noAuthProbeService, fn: noAuthProbeService.regist}, noAuthProbe);
|
||||||
|
|
||||||
// if (responseBody.token === undefined) {
|
// if (responseBody.token === undefined) {
|
||||||
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { SagaIterator } from 'redux-saga';
|
import { SagaIterator } from 'redux-saga';
|
||||||
import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects';
|
import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects';
|
||||||
import { SagaWatcher } from '@overflow/commons/redux-saga';
|
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 Action from '@overflow/commons/redux/Action';
|
||||||
import ProbeService from '../../api/service/ProbeService';
|
import ProbeService from '../../api/service/ProbeService';
|
||||||
import * as ReadAllByDomainActions from '../action/read_all_by_domain';
|
import * as ReadAllByDomainActions from '../action/read_all_by_domain';
|
||||||
|
@ -11,9 +11,8 @@ function* readAllByDomain(action: Action<ReadAllByDomainPayload>): SagaIterator
|
||||||
try {
|
try {
|
||||||
const { domain } = action.payload;
|
const { domain } = action.payload;
|
||||||
|
|
||||||
let service = AppContext.getService(ProbeService);
|
let probeService = AppContext.getInstance().getPouch(ProbeService);
|
||||||
|
const ret = yield call({context: probeService, fn: probeService.readAllByDomain}, domain);
|
||||||
const ret = yield call({context: service, fn: service.readAllByDomain}, domain);
|
|
||||||
|
|
||||||
yield put(ReadAllByDomainActions.requestSuccess(ret));
|
yield put(ReadAllByDomainActions.requestSuccess(ret));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { SagaIterator } from 'redux-saga';
|
import { SagaIterator } from 'redux-saga';
|
||||||
import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects';
|
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 Action from '@overflow/commons/redux/Action';
|
||||||
|
|
||||||
import Probe from '../../api/model/Probe';
|
import Probe from '../../api/model/Probe';
|
||||||
|
@ -16,8 +16,8 @@ function* readByProbeKey(action: Action<ReadByProbeKeyPayload>): SagaIterator {
|
||||||
// type: types.SENDING_REQUEST,
|
// type: types.SENDING_REQUEST,
|
||||||
// payload: {sendingRequest: true},
|
// payload: {sendingRequest: true},
|
||||||
// });
|
// });
|
||||||
|
let probeService = AppContext.getInstance().getPouch(ProbeService);
|
||||||
const ret = yield call(AppContext.getService<ProbeService>().readByProbeKey, probeKey);
|
const ret = yield call({context: probeService, fn: probeService.readByProbeKey}, probeKey);
|
||||||
|
|
||||||
// if (responseBody.token === undefined) {
|
// if (responseBody.token === undefined) {
|
||||||
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { SagaIterator } from 'redux-saga';
|
import { SagaIterator } from 'redux-saga';
|
||||||
import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects';
|
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 Action from '@overflow/commons/redux/Action';
|
||||||
|
|
||||||
import Probe from '../../api/model/Probe';
|
import Probe from '../../api/model/Probe';
|
||||||
|
@ -16,8 +16,8 @@ function* regist(action: Action<RegistPayload>): SagaIterator {
|
||||||
// type: types.SENDING_REQUEST,
|
// type: types.SENDING_REQUEST,
|
||||||
// payload: {sendingRequest: true},
|
// payload: {sendingRequest: true},
|
||||||
// });
|
// });
|
||||||
|
let probeService = AppContext.getInstance().getPouch(ProbeService);
|
||||||
const ret = yield call(AppContext.getService<ProbeService>().regist, probe);
|
const ret = yield call({context: probeService, fn: probeService.regist}, probe);
|
||||||
|
|
||||||
// if (responseBody.token === undefined) {
|
// if (responseBody.token === undefined) {
|
||||||
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { SagaIterator } from 'redux-saga';
|
import { SagaIterator } from 'redux-saga';
|
||||||
import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects';
|
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 Action from '@overflow/commons/redux/Action';
|
||||||
|
|
||||||
import ProbeTaskService from '../../api/service/ProbeTaskService';
|
import ProbeTaskService from '../../api/service/ProbeTaskService';
|
||||||
|
@ -15,8 +15,8 @@ function* readAllTaskByProbe(action: Action<TaskReadAllByProbePayload>): SagaIte
|
||||||
// type: types.SENDING_REQUEST,
|
// type: types.SENDING_REQUEST,
|
||||||
// payload: {sendingRequest: true},
|
// payload: {sendingRequest: true},
|
||||||
// });
|
// });
|
||||||
|
let probeTaskService = AppContext.getInstance().getPouch(ProbeTaskService);
|
||||||
const ret = yield call(AppContext.getService<ProbeTaskService>().readAllByProbe, probe);
|
const ret = yield call({context: probeTaskService, fn: probeTaskService.readAllByProbe}, probe);
|
||||||
|
|
||||||
// if (responseBody.token === undefined) {
|
// if (responseBody.token === undefined) {
|
||||||
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { SagaIterator } from 'redux-saga';
|
import { SagaIterator } from 'redux-saga';
|
||||||
import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects';
|
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 Action from '@overflow/commons/redux/Action';
|
||||||
|
|
||||||
import ProbeTask from '../../api/model/ProbeTask';
|
import ProbeTask from '../../api/model/ProbeTask';
|
||||||
|
@ -16,8 +16,8 @@ function* registTask(action: Action<TaskRegistPayload>): SagaIterator {
|
||||||
// type: types.SENDING_REQUEST,
|
// type: types.SENDING_REQUEST,
|
||||||
// payload: {sendingRequest: true},
|
// payload: {sendingRequest: true},
|
||||||
// });
|
// });
|
||||||
|
let probeTaskService = AppContext.getInstance().getPouch(ProbeTaskService);
|
||||||
const ret = yield call(AppContext.getService<ProbeTaskService>().regist, probeTask);
|
const ret = yield call({context: probeTaskService, fn: probeTaskService.regist}, probeTask);
|
||||||
|
|
||||||
// if (responseBody.token === undefined) {
|
// if (responseBody.token === undefined) {
|
||||||
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
||||||
|
|
|
@ -16,7 +16,7 @@ export class SensorItemService extends Service {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public read(id:string): Promise<Sensor> {
|
public read(id:number): Promise<Sensor> {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { SagaIterator } from 'redux-saga';
|
import { SagaIterator } from 'redux-saga';
|
||||||
import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects';
|
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 Action from '@overflow/commons/redux/Action';
|
||||||
|
|
||||||
import SensorItem from '../../api/model/SensorItem';
|
import SensorItem from '../../api/model/SensorItem';
|
||||||
|
@ -16,8 +16,8 @@ function* readItem(action: Action<ItemReadPayload>): SagaIterator {
|
||||||
// type: types.SENDING_REQUEST,
|
// type: types.SENDING_REQUEST,
|
||||||
// payload: {sendingRequest: true},
|
// payload: {sendingRequest: true},
|
||||||
// });
|
// });
|
||||||
|
let sensorItemService = AppContext.getInstance().getPouch(SensorItemService);
|
||||||
const ret = yield call(AppContext.getService<SensorItemService>().read, id);
|
const ret = yield call({context: sensorItemService, fn: sensorItemService.read}, id);
|
||||||
|
|
||||||
// if (responseBody.token === undefined) {
|
// if (responseBody.token === undefined) {
|
||||||
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { SagaIterator } from 'redux-saga';
|
import { SagaIterator } from 'redux-saga';
|
||||||
import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects';
|
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 Action from '@overflow/commons/redux/Action';
|
||||||
|
|
||||||
import SensorItem from '../../api/model/SensorItem';
|
import SensorItem from '../../api/model/SensorItem';
|
||||||
|
@ -16,8 +16,8 @@ function* readAllItemBySensor(action: Action<ItemReadAllBySensorActionsPayload>)
|
||||||
// type: types.SENDING_REQUEST,
|
// type: types.SENDING_REQUEST,
|
||||||
// payload: {sendingRequest: true},
|
// payload: {sendingRequest: true},
|
||||||
// });
|
// });
|
||||||
|
let sensorItemService = AppContext.getInstance().getPouch(SensorItemService);
|
||||||
const ret = yield call(AppContext.getService<SensorItemService>().readAllBySensor, sensor);
|
const ret = yield call({context: sensorItemService, fn: sensorItemService.readAllBySensor}, sensor);
|
||||||
|
|
||||||
// if (responseBody.token === undefined) {
|
// if (responseBody.token === undefined) {
|
||||||
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { SagaIterator } from 'redux-saga';
|
import { SagaIterator } from 'redux-saga';
|
||||||
import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects';
|
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 Action from '@overflow/commons/redux/Action';
|
||||||
|
|
||||||
import SensorItem from '../../api/model/SensorItem';
|
import SensorItem from '../../api/model/SensorItem';
|
||||||
|
@ -16,8 +16,8 @@ function* registItem(action: Action<ItemRegistPayload>): SagaIterator {
|
||||||
// type: types.SENDING_REQUEST,
|
// type: types.SENDING_REQUEST,
|
||||||
// payload: {sendingRequest: true},
|
// payload: {sendingRequest: true},
|
||||||
// });
|
// });
|
||||||
|
let sensorItemService = AppContext.getInstance().getPouch(SensorItemService);
|
||||||
const ret = yield call(AppContext.getService<SensorItemService>().regist, sensorItem);
|
const ret = yield call({context: sensorItemService, fn: sensorItemService.regist}, sensorItem);
|
||||||
|
|
||||||
// if (responseBody.token === undefined) {
|
// if (responseBody.token === undefined) {
|
||||||
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { SagaIterator } from 'redux-saga';
|
import { SagaIterator } from 'redux-saga';
|
||||||
import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects';
|
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 Action from '@overflow/commons/redux/Action';
|
||||||
|
|
||||||
import SensorItem from '../../api/model/SensorItem';
|
import SensorItem from '../../api/model/SensorItem';
|
||||||
|
@ -16,8 +16,8 @@ function* removeItem(action: Action<ItemRemovePayload>): SagaIterator {
|
||||||
// type: types.SENDING_REQUEST,
|
// type: types.SENDING_REQUEST,
|
||||||
// payload: {sendingRequest: true},
|
// payload: {sendingRequest: true},
|
||||||
// });
|
// });
|
||||||
|
let sensorItemService = AppContext.getInstance().getPouch(SensorItemService);
|
||||||
yield call(AppContext.getService<SensorItemService>().remove, sensorItem);
|
yield call({context: sensorItemService, fn: sensorItemService.remove}, sensorItem);
|
||||||
|
|
||||||
// if (responseBody.token === undefined) {
|
// if (responseBody.token === undefined) {
|
||||||
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { SagaIterator } from 'redux-saga';
|
import { SagaIterator } from 'redux-saga';
|
||||||
import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects';
|
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 Action from '@overflow/commons/redux/Action';
|
||||||
|
|
||||||
import Sensor from '../../api/model/Sensor';
|
import Sensor from '../../api/model/Sensor';
|
||||||
|
@ -16,8 +16,8 @@ function* read(action: Action<ReadPayload>): SagaIterator {
|
||||||
// type: types.SENDING_REQUEST,
|
// type: types.SENDING_REQUEST,
|
||||||
// payload: {sendingRequest: true},
|
// payload: {sendingRequest: true},
|
||||||
// });
|
// });
|
||||||
|
let sensorService = AppContext.getInstance().getPouch(SensorService);
|
||||||
const ret = yield call(AppContext.getService<SensorService>().read, id);
|
const ret = yield call({context: sensorService, fn: sensorService.read}, id);
|
||||||
|
|
||||||
// if (responseBody.token === undefined) {
|
// if (responseBody.token === undefined) {
|
||||||
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { SagaIterator } from 'redux-saga';
|
import { SagaIterator } from 'redux-saga';
|
||||||
import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects';
|
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 Action from '@overflow/commons/redux/Action';
|
||||||
|
|
||||||
import Sensor from '../../api/model/Sensor';
|
import Sensor from '../../api/model/Sensor';
|
||||||
|
@ -16,8 +16,8 @@ function* readAllByTarget(action: Action<ReadAllByTargetPayload>): SagaIterator
|
||||||
// type: types.SENDING_REQUEST,
|
// type: types.SENDING_REQUEST,
|
||||||
// payload: {sendingRequest: true},
|
// payload: {sendingRequest: true},
|
||||||
// });
|
// });
|
||||||
|
let sensorService = AppContext.getInstance().getPouch(SensorService);
|
||||||
const ret = yield call(AppContext.getService<SensorService>().readAllByTarget, target);
|
const ret = yield call({context: sensorService, fn: sensorService.readAllByTarget}, target);
|
||||||
|
|
||||||
// if (responseBody.token === undefined) {
|
// if (responseBody.token === undefined) {
|
||||||
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { SagaIterator } from 'redux-saga';
|
import { SagaIterator } from 'redux-saga';
|
||||||
import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects';
|
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 Action from '@overflow/commons/redux/Action';
|
||||||
|
|
||||||
import Sensor from '../../api/model/Sensor';
|
import Sensor from '../../api/model/Sensor';
|
||||||
|
@ -16,8 +16,8 @@ function* regist(action: Action<RegistPayload>): SagaIterator {
|
||||||
// type: types.SENDING_REQUEST,
|
// type: types.SENDING_REQUEST,
|
||||||
// payload: {sendingRequest: true},
|
// payload: {sendingRequest: true},
|
||||||
// });
|
// });
|
||||||
|
let sensorService = AppContext.getInstance().getPouch(SensorService);
|
||||||
const ret = yield call(AppContext.getService<SensorService>().regist, sensor);
|
const ret = yield call({context: sensorService, fn: sensorService.regist}, sensor);
|
||||||
|
|
||||||
// if (responseBody.token === undefined) {
|
// if (responseBody.token === undefined) {
|
||||||
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { SagaIterator } from 'redux-saga';
|
import { SagaIterator } from 'redux-saga';
|
||||||
import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects';
|
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 Action from '@overflow/commons/redux/Action';
|
||||||
|
|
||||||
import Sensor from '../../api/model/Sensor';
|
import Sensor from '../../api/model/Sensor';
|
||||||
|
@ -16,8 +16,8 @@ function* remove(action: Action<RemovePayload>): SagaIterator {
|
||||||
// type: types.SENDING_REQUEST,
|
// type: types.SENDING_REQUEST,
|
||||||
// payload: {sendingRequest: true},
|
// payload: {sendingRequest: true},
|
||||||
// });
|
// });
|
||||||
|
let sensorService = AppContext.getInstance().getPouch(SensorService);
|
||||||
const retSensor = yield call(AppContext.getService<SensorService>().remove, sensor);
|
const retSensor = yield call({context: sensorService, fn: sensorService.remove}, sensor);
|
||||||
|
|
||||||
// if (responseBody.token === undefined) {
|
// if (responseBody.token === undefined) {
|
||||||
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { SagaIterator } from 'redux-saga';
|
import { SagaIterator } from 'redux-saga';
|
||||||
import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects';
|
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 Action from '@overflow/commons/redux/Action';
|
||||||
|
|
||||||
import Sensor from '../../api/model/Sensor';
|
import Sensor from '../../api/model/Sensor';
|
||||||
|
@ -16,8 +16,8 @@ function* start(action: Action<StartPayload>): SagaIterator {
|
||||||
// type: types.SENDING_REQUEST,
|
// type: types.SENDING_REQUEST,
|
||||||
// payload: {sendingRequest: true},
|
// payload: {sendingRequest: true},
|
||||||
// });
|
// });
|
||||||
|
let sensorService = AppContext.getInstance().getPouch(SensorService);
|
||||||
const ret = yield call(AppContext.getService<SensorService>().start, sensor);
|
const ret = yield call({context: sensorService, fn: sensorService.start}, sensor);
|
||||||
|
|
||||||
// if (responseBody.token === undefined) {
|
// if (responseBody.token === undefined) {
|
||||||
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { SagaIterator } from 'redux-saga';
|
import { SagaIterator } from 'redux-saga';
|
||||||
import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects';
|
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 Action from '@overflow/commons/redux/Action';
|
||||||
|
|
||||||
import Sensor from '../../api/model/Sensor';
|
import Sensor from '../../api/model/Sensor';
|
||||||
|
@ -16,8 +16,8 @@ function* stop(action: Action<StopPayload>): SagaIterator {
|
||||||
// type: types.SENDING_REQUEST,
|
// type: types.SENDING_REQUEST,
|
||||||
// payload: {sendingRequest: true},
|
// payload: {sendingRequest: true},
|
||||||
// });
|
// });
|
||||||
|
let sensorService = AppContext.getInstance().getPouch(SensorService);
|
||||||
const ret = yield call(AppContext.getService<SensorService>().stop, sensor);
|
const ret = yield call({context: sensorService, fn: sensorService.stop}, sensor);
|
||||||
|
|
||||||
// if (responseBody.token === undefined) {
|
// if (responseBody.token === undefined) {
|
||||||
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { SagaIterator } from 'redux-saga';
|
import { SagaIterator } from 'redux-saga';
|
||||||
import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects';
|
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 Action from '@overflow/commons/redux/Action';
|
||||||
|
|
||||||
import Target from '../../api/model/Target';
|
import Target from '../../api/model/Target';
|
||||||
|
@ -17,7 +17,8 @@ function* read(action: Action<ReadPayload>): SagaIterator {
|
||||||
// payload: {sendingRequest: true},
|
// payload: {sendingRequest: true},
|
||||||
// });
|
// });
|
||||||
|
|
||||||
const retTarget = yield call(AppContext.getService<TargetService>().read, id);
|
let targetService = AppContext.getInstance().getPouch(TargetService);
|
||||||
|
const retTarget = yield call({context: targetService, fn: targetService.read}, id);
|
||||||
|
|
||||||
// if (responseBody.token === undefined) {
|
// if (responseBody.token === undefined) {
|
||||||
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { SagaIterator } from 'redux-saga';
|
import { SagaIterator } from 'redux-saga';
|
||||||
import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects';
|
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 Action from '@overflow/commons/redux/Action';
|
||||||
|
|
||||||
import Target from '../../api/model/Target';
|
import Target from '../../api/model/Target';
|
||||||
|
@ -17,7 +17,8 @@ function* readAllByProbe(action: Action<ReadAllByProbePayload>): SagaIterator {
|
||||||
// payload: {sendingRequest: true},
|
// payload: {sendingRequest: true},
|
||||||
// });
|
// });
|
||||||
|
|
||||||
const retTargets = yield call(AppContext.getService<TargetService>().readAllByProbe, probe);
|
let targetService = AppContext.getInstance().getPouch(TargetService);
|
||||||
|
const retTargets = yield call({context: targetService, fn: targetService.readAllByProbe}, probe);
|
||||||
|
|
||||||
// if (responseBody.token === undefined) {
|
// if (responseBody.token === undefined) {
|
||||||
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { SagaIterator } from 'redux-saga';
|
import { SagaIterator } from 'redux-saga';
|
||||||
import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects';
|
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 Action from '@overflow/commons/redux/Action';
|
||||||
|
|
||||||
import Target from '../../api/model/Target';
|
import Target from '../../api/model/Target';
|
||||||
|
@ -16,8 +16,8 @@ function* regist(action: Action<RegistPayload>): SagaIterator {
|
||||||
// type: types.SENDING_REQUEST,
|
// type: types.SENDING_REQUEST,
|
||||||
// payload: {sendingRequest: true},
|
// payload: {sendingRequest: true},
|
||||||
// });
|
// });
|
||||||
|
let targetService = AppContext.getInstance().getPouch(TargetService);
|
||||||
const retTarget = yield call(AppContext.getService<TargetService>().regist, target);
|
const retTarget = yield call({context: targetService, fn: targetService.regist}, target);
|
||||||
|
|
||||||
// if (responseBody.token === undefined) {
|
// if (responseBody.token === undefined) {
|
||||||
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { SagaIterator } from 'redux-saga';
|
import { SagaIterator } from 'redux-saga';
|
||||||
import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects';
|
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 Action from '@overflow/commons/redux/Action';
|
||||||
|
|
||||||
import Target from '../../api/model/Target';
|
import Target from '../../api/model/Target';
|
||||||
|
@ -16,8 +16,8 @@ function* registDiscoveredTarget(action: Action<RegistDiscoveredTargetPayload>):
|
||||||
// type: types.SENDING_REQUEST,
|
// type: types.SENDING_REQUEST,
|
||||||
// payload: {sendingRequest: true},
|
// payload: {sendingRequest: true},
|
||||||
// });
|
// });
|
||||||
|
let targetDiscoveryService = AppContext.getInstance().getPouch(TargetDiscoveryService);
|
||||||
yield call(AppContext.getService<TargetDiscoveryService>().saveAllTarget, hosts, probe);
|
yield call({context: targetDiscoveryService, fn: targetDiscoveryService.saveAllTarget}, hosts, probe);
|
||||||
|
|
||||||
// if (responseBody.token === undefined) {
|
// if (responseBody.token === undefined) {
|
||||||
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { SagaIterator } from 'redux-saga';
|
import { SagaIterator } from 'redux-saga';
|
||||||
import { call, Effect, fork, put, takeLatest } from 'redux-saga/effects';
|
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 Action from '@overflow/commons/redux/Action';
|
||||||
|
|
||||||
import Target from '../../api/model/Target';
|
import Target from '../../api/model/Target';
|
||||||
|
@ -17,7 +17,8 @@ function* remove(action: Action<RemovePayload>): SagaIterator {
|
||||||
// payload: {sendingRequest: true},
|
// payload: {sendingRequest: true},
|
||||||
// });
|
// });
|
||||||
|
|
||||||
yield call(AppContext.getService<TargetService>().remove, target);
|
let targetService = AppContext.getInstance().getPouch(TargetService);
|
||||||
|
yield call({context: targetService, fn: targetService.remove}, target);
|
||||||
|
|
||||||
// if (responseBody.token === undefined) {
|
// if (responseBody.token === undefined) {
|
||||||
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
// throw new Error(MESSAGES.UNABLE_TO_FIND_TOKEN_IN_LOGIN_RESPONSE);
|
||||||
|
|
|
@ -1,18 +1,11 @@
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { RouteComponentProps } from 'react-router';
|
import { RouteComponentProps } from 'react-router';
|
||||||
import DiscoveryContainer from '@overflow/discovery/react/Discovery';
|
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<RouteComponentProps<object>, object> {
|
class Discovery extends React.Component<RouteComponentProps<object>, object> {
|
||||||
|
|
||||||
private client: WebSocketRPC;
|
|
||||||
|
|
||||||
public constructor(props?: RouteComponentProps<object>, context?: object) {
|
public constructor(props?: RouteComponentProps<object>, context?: object) {
|
||||||
super(props, context);
|
super(props, context);
|
||||||
|
|
||||||
let con = AppContext.get<WebSocketRPC>();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public render(): JSX.Element {
|
public render(): JSX.Element {
|
||||||
|
|
|
@ -1,18 +1,11 @@
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { RouteComponentProps } from 'react-router';
|
import { RouteComponentProps } from 'react-router';
|
||||||
import TableSortContainer from '@overflow/temp/react/components/TableSortContainer';
|
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<RouteComponentProps<object>, object> {
|
class TableSortView extends React.Component<RouteComponentProps<object>, object> {
|
||||||
|
|
||||||
private client: WebSocketRPC;
|
|
||||||
|
|
||||||
public constructor(props?: RouteComponentProps<object>, context?: object) {
|
public constructor(props?: RouteComponentProps<object>, context?: object) {
|
||||||
super(props, context);
|
super(props, context);
|
||||||
|
|
||||||
let con = AppContext.get<WebSocketRPC>();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public render(): JSX.Element {
|
public render(): JSX.Element {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user