From 9a0e69b77c6b213fbc6c6ba6fa811a92efbe44af Mon Sep 17 00:00:00 2001 From: Xc Date: Thu, 28 Dec 2023 11:46:35 +0800 Subject: [PATCH 1/3] 2.2.5-dev --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 584d532..770608d 100644 --- a/package.json +++ b/package.json @@ -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": "file:../oak-domain", + "oak-external-sdk": "file:../oak-external-sdk", "xlsx": "^0.18.5" }, "devDependencies": { From 9d5fe459406b5b114d11ad17df611f7283031f3f Mon Sep 17 00:00:00 2001 From: Xc Date: Sat, 17 Feb 2024 23:36:27 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=AF=B9external-sdk=E5=BC=95=E7=94=A8?= =?UTF-8?q?=E4=BD=8D=E7=BD=AE=E7=9A=84=E6=94=B9=E5=8F=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- es/AspectDict.d.ts | 4 ++-- es/amap.d.ts | 2 +- es/amap.js | 2 +- es/crud.d.ts | 2 +- es/crud.js | 2 +- lib/AspectDict.d.ts | 4 ++-- lib/amap.d.ts | 2 +- lib/amap.js | 5 +++-- lib/crud.d.ts | 2 +- lib/crud.js | 2 +- src/AspectDict.ts | 2 +- src/amap.ts | 3 ++- src/crud.ts | 2 +- 13 files changed, 18 insertions(+), 16 deletions(-) diff --git a/es/AspectDict.d.ts b/es/AspectDict.d.ts index e51ed50..8cc8bac 100644 --- a/es/AspectDict.d.ts +++ b/es/AspectDict.d.ts @@ -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> = { +export declare type CommonAspectDict> = { operate: (params: { entity: T; operation: ED[T]['Operation'] | ED[T]['Operation'][]; diff --git a/es/amap.d.ts b/es/amap.d.ts index b536292..9261e99 100644 --- a/es/amap.d.ts +++ b/es/amap.d.ts @@ -1,4 +1,4 @@ -import { AmapInstance } from 'oak-external-sdk'; +import { AmapInstance } from "oak-external-sdk/lib/service/amap/Amap"; export declare function amap(options: { key: string; method: T; diff --git a/es/amap.js b/es/amap.js index d2cb46d..4be0cd7 100644 --- a/es/amap.js +++ b/es/amap.js @@ -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); diff --git a/es/crud.d.ts b/es/crud.d.ts index 3119773..3ec5bed 100644 --- a/es/crud.d.ts +++ b/es/crud.d.ts @@ -5,7 +5,7 @@ export declare function operate | import("oak-domain/lib/types").OperationResult[]>; +}, context: Cxt): Promise | Awaited>[]>; export declare function select, OP extends SelectOption>(params: { entity: T; selection: ED[T]['Selection']; diff --git a/es/crud.js b/es/crud.js index 9ba3ded..d96d026 100644 --- a/es/crud.js +++ b/es/crud.js @@ -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 = []; diff --git a/lib/AspectDict.d.ts b/lib/AspectDict.d.ts index e51ed50..8cc8bac 100644 --- a/lib/AspectDict.d.ts +++ b/lib/AspectDict.d.ts @@ -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> = { +export declare type CommonAspectDict> = { operate: (params: { entity: T; operation: ED[T]['Operation'] | ED[T]['Operation'][]; diff --git a/lib/amap.d.ts b/lib/amap.d.ts index b536292..9261e99 100644 --- a/lib/amap.d.ts +++ b/lib/amap.d.ts @@ -1,4 +1,4 @@ -import { AmapInstance } from 'oak-external-sdk'; +import { AmapInstance } from "oak-external-sdk/lib/service/amap/Amap"; export declare function amap(options: { key: string; method: T; diff --git a/lib/amap.js b/lib/amap.js index f21b783..375084f 100644 --- a/lib/amap.js +++ b/lib/amap.js @@ -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'); diff --git a/lib/crud.d.ts b/lib/crud.d.ts index 3119773..3ec5bed 100644 --- a/lib/crud.d.ts +++ b/lib/crud.d.ts @@ -5,7 +5,7 @@ export declare function operate | import("oak-domain/lib/types").OperationResult[]>; +}, context: Cxt): Promise | Awaited>[]>; export declare function select, OP extends SelectOption>(params: { entity: T; selection: ED[T]['Selection']; diff --git a/lib/crud.js b/lib/crud.js index d5d9490..fcdd88a 100644 --- a/lib/crud.js +++ b/lib/crud.js @@ -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 = []; diff --git a/src/AspectDict.ts b/src/AspectDict.ts index 5ab34f6..0d03b9c 100644 --- a/src/AspectDict.ts +++ b/src/AspectDict.ts @@ -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"; diff --git a/src/amap.ts b/src/amap.ts index 37a382d..e6e4b76 100644 --- a/src/amap.ts +++ b/src/amap.ts @@ -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(options: { key: string; diff --git a/src/crud.ts b/src/crud.ts index 1f14379..aea18ad 100644 --- a/src/crud.ts +++ b/src/crud.ts @@ -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) { From 5e5a1fbd42e529aac295153e96b700687e04b0ac Mon Sep 17 00:00:00 2001 From: "Xc@centOs" Date: Tue, 20 Feb 2024 17:08:20 +0800 Subject: [PATCH 3/3] 2.2.5-publish --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 770608d..4ec43d4 100644 --- a/package.json +++ b/package.json @@ -20,8 +20,8 @@ "license": "ISC", "dependencies": { "lodash": "^4.17.21", - "oak-domain": "file:../oak-domain", - "oak-external-sdk": "file:../oak-external-sdk", + "oak-domain": "^4.2.0", + "oak-external-sdk": "^2.1.0", "xlsx": "^0.18.5" }, "devDependencies": {