RuntimeContext->GeneralRuntimeContext
This commit is contained in:
parent
0dfefb1bfa
commit
96bf35ffb9
|
|
@ -2,7 +2,7 @@ import { Context } from 'oak-domain/lib/types';
|
|||
import { UniversalContext } from 'oak-domain/lib/store/UniversalContext';
|
||||
import { EntityDict } from 'oak-app-domain/EntityDict';
|
||||
import { RowStore } from 'oak-domain/lib/types';
|
||||
export declare class RuntimeContext<ED extends EntityDict> extends UniversalContext<ED> implements Context<ED> {
|
||||
export declare class GeneralRuntimeContext<ED extends EntityDict> extends UniversalContext<ED> implements Context<ED> {
|
||||
applicationId: string;
|
||||
constructor(store: RowStore<ED>, appId: string);
|
||||
getApplication(): Promise<import("oak-domain/lib/types").SelectRowShape<ED["application"]["Schema"], {
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.RuntimeContext = void 0;
|
||||
exports.GeneralRuntimeContext = void 0;
|
||||
const UniversalContext_1 = require("oak-domain/lib/store/UniversalContext");
|
||||
class RuntimeContext extends UniversalContext_1.UniversalContext {
|
||||
class GeneralRuntimeContext extends UniversalContext_1.UniversalContext {
|
||||
applicationId;
|
||||
constructor(store, appId) {
|
||||
super(store);
|
||||
|
|
@ -23,5 +23,5 @@ class RuntimeContext extends UniversalContext_1.UniversalContext {
|
|||
getToken() {
|
||||
}
|
||||
}
|
||||
exports.RuntimeContext = RuntimeContext;
|
||||
exports.GeneralRuntimeContext = GeneralRuntimeContext;
|
||||
;
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
import { RuntimeContext } from '../RuntimeContext';
|
||||
import { GeneralRuntimeContext } from '../RuntimeContext';
|
||||
import { EntityDict } from 'oak-app-domain/EntityDict';
|
||||
export declare function loginMp<ED extends EntityDict>(params: {
|
||||
code: string;
|
||||
}, context: RuntimeContext<ED>): Promise<string>;
|
||||
}, context: GeneralRuntimeContext<ED>): Promise<string>;
|
||||
export declare function loginByPassword<ED extends EntityDict>(params: {
|
||||
password: string;
|
||||
mobile: string;
|
||||
}, context: RuntimeContext<ED>): Promise<string>;
|
||||
}, context: GeneralRuntimeContext<ED>): Promise<string>;
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ async function loginByPassword(params, context) {
|
|||
}
|
||||
exports.loginByPassword = loginByPassword;
|
||||
/* export type AspectDict<ED extends EntityDict> = {
|
||||
loginMp: (params: { code: string }, context: RuntimeContext<ED>) => Promise<string>;
|
||||
loginByPassword: (params: { password: string, mobile: string }, context: RuntimeContext<ED>) => Promise<string>;
|
||||
loginMp: (params: { code: string }, context: GeneralRuntimeContext<ED>) => Promise<string>;
|
||||
loginByPassword: (params: { password: string, mobile: string }, context: GeneralRuntimeContext<ED>) => Promise<string>;
|
||||
};
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import { EntityDict } from 'oak-app-domain/EntityDict';
|
|||
import { RowStore } from 'oak-domain/lib/types';
|
||||
|
||||
|
||||
export class RuntimeContext<ED extends EntityDict> extends UniversalContext<ED> implements Context<ED> {
|
||||
export class GeneralRuntimeContext<ED extends EntityDict> extends UniversalContext<ED> implements Context<ED> {
|
||||
applicationId: string;
|
||||
constructor(store: RowStore<ED>, appId: string) {
|
||||
super(store);
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
import { RuntimeContext } from '../RuntimeContext';
|
||||
import { GeneralRuntimeContext } from '../RuntimeContext';
|
||||
import { EntityDict } from 'oak-app-domain/EntityDict';
|
||||
|
||||
export async function loginMp<ED extends EntityDict>(params: { code: string }, context: RuntimeContext<ED>): Promise<string> {
|
||||
export async function loginMp<ED extends EntityDict>(params: { code: string }, context: GeneralRuntimeContext<ED>): Promise<string> {
|
||||
const { rowStore } = context;
|
||||
throw new Error('method not implemented!');
|
||||
}
|
||||
|
||||
export async function loginByPassword<ED extends EntityDict>(params: { password: string, mobile: string }, context: RuntimeContext<ED>): Promise<string> {
|
||||
export async function loginByPassword<ED extends EntityDict>(params: { password: string, mobile: string }, context: GeneralRuntimeContext<ED>): Promise<string> {
|
||||
const { rowStore } = context;
|
||||
|
||||
const { result: [mobile]} = await rowStore.select('mobile', {
|
||||
|
|
@ -21,7 +21,7 @@ export async function loginByPassword<ED extends EntityDict>(params: { password:
|
|||
}
|
||||
|
||||
/* export type AspectDict<ED extends EntityDict> = {
|
||||
loginMp: (params: { code: string }, context: RuntimeContext<ED>) => Promise<string>;
|
||||
loginByPassword: (params: { password: string, mobile: string }, context: RuntimeContext<ED>) => Promise<string>;
|
||||
loginMp: (params: { code: string }, context: GeneralRuntimeContext<ED>) => Promise<string>;
|
||||
loginByPassword: (params: { password: string, mobile: string }, context: GeneralRuntimeContext<ED>) => Promise<string>;
|
||||
};
|
||||
*/
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
import { MakeOakComponent, MakeOakPage } from 'oak-frontend-base';
|
||||
import { EntityDict } from 'oak-app-domain/EntityDict';
|
||||
import { RuntimeContext } from '../RuntimeContext';
|
||||
import { GeneralRuntimeContext } from '../RuntimeContext';
|
||||
import aspectDict from '../aspects';
|
||||
declare global {
|
||||
const OakPage: MakeOakPage<EntityDict, RuntimeContext<EntityDict>, typeof aspectDict, {}>;
|
||||
const OakComponent: MakeOakComponent<EntityDict, RuntimeContext<EntityDict>, typeof aspectDict, {}>;
|
||||
const OakPage: MakeOakPage<EntityDict, GeneralRuntimeContext<EntityDict>, typeof aspectDict, {}>;
|
||||
const OakComponent: MakeOakComponent<EntityDict, GeneralRuntimeContext<EntityDict>, typeof aspectDict, {}>;
|
||||
}
|
||||
export {}
|
||||
Loading…
Reference in New Issue