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