Merge branch 'dev' into release
This commit is contained in:
commit
30dc768153
|
|
@ -1,8 +1,8 @@
|
|||
import { EntityDict, OperateOption, SelectOption, OperationResult, AggregationResult } from "oak-domain/lib/types";
|
||||
import { AmapInstance } from "oak-external-sdk";
|
||||
import { AmapInstance } from "oak-external-sdk/lib/service/amap/Amap";
|
||||
import { EntityDict as BaseEntityDict } from 'oak-domain/lib/base-app-domain';
|
||||
import { AsyncContext } from "oak-domain/lib/store/AsyncRowStore";
|
||||
export type CommonAspectDict<ED extends EntityDict & BaseEntityDict, Cxt extends AsyncContext<ED>> = {
|
||||
export declare type CommonAspectDict<ED extends EntityDict & BaseEntityDict, Cxt extends AsyncContext<ED>> = {
|
||||
operate: <T extends keyof ED, OP extends OperateOption>(params: {
|
||||
entity: T;
|
||||
operation: ED[T]['Operation'] | ED[T]['Operation'][];
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { AmapInstance } from 'oak-external-sdk';
|
||||
import { AmapInstance } from "oak-external-sdk/lib/service/amap/Amap";
|
||||
export declare function amap<T extends 'getDrivingPath' | 'regeo' | 'ipLoc' | 'getDistrict' | 'geocode'>(options: {
|
||||
key: string;
|
||||
method: T;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { AmapSDK } from 'oak-external-sdk';
|
||||
import AmapSDK from 'oak-external-sdk/lib/AmapSDK';
|
||||
export async function amap(options) {
|
||||
const { key, method, data } = options;
|
||||
const instance = AmapSDK.getInstance(key);
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ export declare function operate<ED extends BaseEntityDict & EntityDict, T extend
|
|||
entity: T;
|
||||
operation: ED[T]['Operation'] | ED[T]['Operation'][];
|
||||
option?: OP;
|
||||
}, context: Cxt): Promise<import("oak-domain/lib/types").OperationResult<ED> | import("oak-domain/lib/types").OperationResult<ED>[]>;
|
||||
}, context: Cxt): Promise<import("oak-domain/lib/types").OperationResult<ED> | Awaited<import("oak-domain/lib/types").OperationResult<ED>>[]>;
|
||||
export declare function select<ED extends BaseEntityDict & EntityDict, T extends keyof ED, Cxt extends AsyncContext<ED>, OP extends SelectOption>(params: {
|
||||
entity: T;
|
||||
selection: ED[T]['Selection'];
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ export async function operate(params, context) {
|
|||
throw new OakUnloggedInException();
|
||||
} */
|
||||
if (!context.allowUserUpdate()) {
|
||||
throw new OakUserUnpermittedException('您被禁更新');
|
||||
throw new OakUserUnpermittedException(entity, operation instanceof Array ? operation[0] : operation, '您被禁更新');
|
||||
}
|
||||
if (operation instanceof Array) {
|
||||
const result = [];
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import { EntityDict, OperateOption, SelectOption, OperationResult, AggregationResult } from "oak-domain/lib/types";
|
||||
import { AmapInstance } from "oak-external-sdk";
|
||||
import { AmapInstance } from "oak-external-sdk/lib/service/amap/Amap";
|
||||
import { EntityDict as BaseEntityDict } from 'oak-domain/lib/base-app-domain';
|
||||
import { AsyncContext } from "oak-domain/lib/store/AsyncRowStore";
|
||||
export type CommonAspectDict<ED extends EntityDict & BaseEntityDict, Cxt extends AsyncContext<ED>> = {
|
||||
export declare type CommonAspectDict<ED extends EntityDict & BaseEntityDict, Cxt extends AsyncContext<ED>> = {
|
||||
operate: <T extends keyof ED, OP extends OperateOption>(params: {
|
||||
entity: T;
|
||||
operation: ED[T]['Operation'] | ED[T]['Operation'][];
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { AmapInstance } from 'oak-external-sdk';
|
||||
import { AmapInstance } from "oak-external-sdk/lib/service/amap/Amap";
|
||||
export declare function amap<T extends 'getDrivingPath' | 'regeo' | 'ipLoc' | 'getDistrict' | 'geocode'>(options: {
|
||||
key: string;
|
||||
method: T;
|
||||
|
|
|
|||
|
|
@ -1,10 +1,11 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.amap = void 0;
|
||||
const oak_external_sdk_1 = require("oak-external-sdk");
|
||||
const tslib_1 = require("tslib");
|
||||
const AmapSDK_1 = tslib_1.__importDefault(require("oak-external-sdk/lib/AmapSDK"));
|
||||
async function amap(options) {
|
||||
const { key, method, data } = options;
|
||||
const instance = oak_external_sdk_1.AmapSDK.getInstance(key);
|
||||
const instance = AmapSDK_1.default.getInstance(key);
|
||||
const fn = instance[method];
|
||||
if (!fn) {
|
||||
throw new Error('method not implemented');
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ export declare function operate<ED extends BaseEntityDict & EntityDict, T extend
|
|||
entity: T;
|
||||
operation: ED[T]['Operation'] | ED[T]['Operation'][];
|
||||
option?: OP;
|
||||
}, context: Cxt): Promise<import("oak-domain/lib/types").OperationResult<ED> | import("oak-domain/lib/types").OperationResult<ED>[]>;
|
||||
}, context: Cxt): Promise<import("oak-domain/lib/types").OperationResult<ED> | Awaited<import("oak-domain/lib/types").OperationResult<ED>>[]>;
|
||||
export declare function select<ED extends BaseEntityDict & EntityDict, T extends keyof ED, Cxt extends AsyncContext<ED>, OP extends SelectOption>(params: {
|
||||
entity: T;
|
||||
selection: ED[T]['Selection'];
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ async function operate(params, context) {
|
|||
throw new OakUnloggedInException();
|
||||
} */
|
||||
if (!context.allowUserUpdate()) {
|
||||
throw new types_1.OakUserUnpermittedException('您被禁更新');
|
||||
throw new types_1.OakUserUnpermittedException(entity, operation instanceof Array ? operation[0] : operation, '您被禁更新');
|
||||
}
|
||||
if (operation instanceof Array) {
|
||||
const result = [];
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "oak-common-aspect",
|
||||
"version": "2.2.4",
|
||||
"version": "2.2.5",
|
||||
"description": "",
|
||||
"author": {
|
||||
"name": "XuChang"
|
||||
|
|
@ -20,8 +20,8 @@
|
|||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"lodash": "^4.17.21",
|
||||
"oak-domain": "^4.0.2",
|
||||
"oak-external-sdk": "^2.0.3",
|
||||
"oak-domain": "^4.2.0",
|
||||
"oak-external-sdk": "^2.1.0",
|
||||
"xlsx": "^0.18.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { EntityDict, OperateOption, SelectOption, OperationResult, AggregationResult } from "oak-domain/lib/types";
|
||||
import { AmapInstance } from "oak-external-sdk";
|
||||
import { AmapInstance } from "oak-external-sdk/lib/service/amap/Amap";
|
||||
import { EntityDict as BaseEntityDict } from 'oak-domain/lib/base-app-domain';
|
||||
import { AsyncContext } from "oak-domain/lib/store/AsyncRowStore";
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import { AmapSDK, AmapInstance } from 'oak-external-sdk';
|
||||
import AmapSDK from 'oak-external-sdk/lib/AmapSDK';
|
||||
import { AmapInstance } from "oak-external-sdk/lib/service/amap/Amap";
|
||||
|
||||
export async function amap<T extends 'getDrivingPath' | 'regeo' | 'ipLoc' | 'getDistrict' | 'geocode'>(options: {
|
||||
key: string;
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ export async function operate<
|
|||
throw new OakUnloggedInException();
|
||||
} */
|
||||
if (!context.allowUserUpdate()) {
|
||||
throw new OakUserUnpermittedException('您被禁更新');
|
||||
throw new OakUserUnpermittedException(entity, operation instanceof Array ? operation[0] : operation, '您被禁更新');
|
||||
}
|
||||
|
||||
if (operation instanceof Array) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue