diff --git a/CHANGELOG.md b/CHANGELOG.md index 7db1e79..305662a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,40 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.2.1](https://github.com/alibaba/lowcode-datasource/compare/v1.2.0...v1.2.1) (2024-09-24) + + +### Bug Fixes + +* 🐛 Remove unused JSExpression and JSFunction functions ([a3e31c6](https://github.com/alibaba/lowcode-datasource/commit/a3e31c6bc67593b01f0533174458fd61e5ae0f82)) + + + + + +# [1.2.0](https://github.com/alibaba/lowcode-datasource/compare/v1.1.4...v1.2.0) (2024-07-03) + + +### Features + +* 🎸 支持用户自定义defaultDataHandler,避免默认都返回了 res.data ([add3c1e](https://github.com/alibaba/lowcode-datasource/commit/add3c1e05e44e6a199f505cac3b657ba3c5e18a8)) +* 🎸 remove mtop & mopen packages ([f517771](https://github.com/alibaba/lowcode-datasource/commit/f517771d3832734cba06c9ca5590a054d55a6fd0)) + + + + + +# [1.1.0](https://github.com/alibaba/lowcode-datasource/compare/v1.0.1...v1.1.0) (2022-06-20) + + +### Features + +* 🎸 为数据源引擎增加 module 入口, 以便支持 vite 和 snowpack 等现代构建工具 ([9e37434](https://github.com/alibaba/lowcode-datasource/commit/9e3743423471e9e11e2181b401f6f54b4e3dc726)) + + + + + ## [1.0.1](https://github.com/alibaba/lowcode-datasource/compare/v1.0.0...v1.0.1) (2022-03-17) diff --git a/README.md b/README.md index a165057..9487987 100644 --- a/README.md +++ b/README.md @@ -74,7 +74,7 @@ export interface RuntimeOptionsConfig { isCors?: boolean; timeout?: number; headers?: Record; - shouldFetch?: () => boolean; + shouldFetch?: (options: RuntimeDataSourceConfig) => boolean; [option: string]: unknown; } export declare type RuntimeOptions = () => RuntimeOptionsConfig; // 考虑需要动态获取值的情况,这里在运行时会真正的转为一个 function diff --git a/lerna.json b/lerna.json index 4100451..484b193 100644 --- a/lerna.json +++ b/lerna.json @@ -2,7 +2,7 @@ "packages": [ "packages/*" ], - "version": "1.0.1", + "version": "1.2.1", "npmClient": "yarn", "useWorkspaces": true, "command": { diff --git a/package.json b/package.json index e80e005..86e3153 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ "lerna": "^4.x", "ts-node": "^7.0.1", "tslib": "^1.9.3", - "typescript": "^3.2.2", + "typescript": "^4.6.2", "xima": "^0.2.15" }, "engines": { @@ -56,7 +56,5 @@ "lockfile": "enable" }, "name": "ali-lowcode-datasource", - "publishConfig": { - "registry": "https://registry.antfin-inc.com" - } -} + "repository": "git@github.com:alibaba/lowcode-datasource.git" +} \ No newline at end of file diff --git a/packages/datasource-engine/CHANGELOG.md b/packages/datasource-engine/CHANGELOG.md index 4541494..a61e5bb 100644 --- a/packages/datasource-engine/CHANGELOG.md +++ b/packages/datasource-engine/CHANGELOG.md @@ -3,6 +3,37 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.2.1](https://github.com/alibaba/lowcode-datasource/compare/v1.2.0...v1.2.1) (2024-09-24) + +**Note:** Version bump only for package @alilc/lowcode-datasource-engine + + + + + +# [1.2.0](https://github.com/alibaba/lowcode-datasource/compare/v1.1.4...v1.2.0) (2024-07-03) + + +### Features + +* 🎸 支持用户自定义defaultDataHandler,避免默认都返回了 res.data ([add3c1e](https://github.com/alibaba/lowcode-datasource/commit/add3c1e05e44e6a199f505cac3b657ba3c5e18a8)) +* 🎸 remove mtop & mopen packages ([f517771](https://github.com/alibaba/lowcode-datasource/commit/f517771d3832734cba06c9ca5590a054d55a6fd0)) + + + + + +# [1.1.0](https://github.com/alibaba/lowcode-datasource/compare/v1.0.1...v1.1.0) (2022-06-20) + + +### Features + +* 🎸 为数据源引擎增加 module 入口, 以便支持 vite 和 snowpack 等现代构建工具 ([9e37434](https://github.com/alibaba/lowcode-datasource/commit/9e3743423471e9e11e2181b401f6f54b4e3dc726)) + + + + + ## [1.0.1](https://github.com/alibaba/lowcode-datasource/compare/v1.0.0...v1.0.1) (2022-03-17) diff --git a/packages/datasource-engine/package.json b/packages/datasource-engine/package.json index 854d1c6..b901c29 100644 --- a/packages/datasource-engine/package.json +++ b/packages/datasource-engine/package.json @@ -1,29 +1,32 @@ { "name": "@alilc/lowcode-datasource-engine", - "version": "1.0.1", + "version": "1.2.1", "description": "DataSource Engine for lowcode", "main": "dist/index.js", "typings": "dist/index.d.ts", "files": [ "dist", + "es", "src", "interpret*", "runtime*" ], "scripts": { "clean": "rm -rf dist", - "build": "npm run clean && tsc ", + "build": "npm run clean && tsc && npm run build:es", + "build:es": "tsc --target es5 --module es6 --outDir es", "test": "ava", "prepublishOnly": "npm run build" }, "dependencies": { - "@alilc/lowcode-datasource-types": "^1.0.1", - "@alilc/lowcode-types": "^1.0.0-beta.3", + "@alilc/lowcode-datasource-types": "^1.2.1", + "@alilc/lowcode-types": "^1.3.0", "lodash": "^4.17.21", - "typescript": "^3.9.7" + "tslib": "^2.0.1" }, "devDependencies": { "@ava/babel": "^1.0.1", + "@types/lodash": "^4.17.0", "@types/promise.allsettled": "^1.0.3", "@types/sinon": "^9.0.5", "ava": "3.11.1", @@ -31,7 +34,7 @@ "json5": "^2.1.3", "sinon": "^9.0.3", "ts-node": "^8.10.2", - "tslib": "^2.0.1" + "typescript": "^4.6.2" }, "publishConfig": { "access": "public", diff --git a/packages/datasource-engine/src/core/RuntimeDataSourceItem.ts b/packages/datasource-engine/src/core/RuntimeDataSourceItem.ts index 4f8a527..cfd9d89 100644 --- a/packages/datasource-engine/src/core/RuntimeDataSourceItem.ts +++ b/packages/datasource-engine/src/core/RuntimeDataSourceItem.ts @@ -88,10 +88,16 @@ class RuntimeDataSourceItem = Record = Record { +import { ExtraConfig } from '@alilc/lowcode-datasource-types'; + + +import { defaultDataHandler, defaultWillFetch } from '../helpers'; + + +const adapt2Runtime = (dataSource: InterpretDataSource, context: IDataSourceRuntimeContext, extraConfig: ExtraConfig) => { const { list: interpretConfigList, dataHandler: interpretDataHandler } = dataSource; const dataHandler: (dataMap?: DataSourceMap) => void = interpretDataHandler ? getRuntimeJsValue(interpretDataHandler, context) @@ -24,6 +29,8 @@ const adapt2Runtime = (dataSource: InterpretDataSource, context: IDataSourceRunt }; } const list: RuntimeDataSourceConfig[] = interpretConfigList.map((el: InterpretDataSourceConfig) => { + const { defaultDataHandler: customDataHandler } = extraConfig; + const finalDataHandler = customDataHandler || defaultDataHandler; return { id: el.id, isInit: getRuntimeValueFromConfig('boolean', el.isInit, context), // 默认 true @@ -31,7 +38,7 @@ const adapt2Runtime = (dataSource: InterpretDataSource, context: IDataSourceRunt type: el.type || 'fetch', willFetch: el.willFetch ? getRuntimeJsValue(el.willFetch, context) : defaultWillFetch, shouldFetch: buildShouldFetch(el, context), - dataHandler: el.dataHandler ? getRuntimeJsValue(el.dataHandler, context) : defaultDataHandler, + dataHandler: el.dataHandler ? getRuntimeJsValue(el.dataHandler, context) : finalDataHandler, errorHandler: el.errorHandler ? getRuntimeJsValue(el.errorHandler, context) : undefined, requestHandler: el.requestHandler ? getRuntimeJsValue(el.requestHandler, context) : undefined, options: buildOptions(el, context), diff --git a/packages/datasource-engine/src/index.ts b/packages/datasource-engine/src/index.ts index 5609588..f013f2d 100644 --- a/packages/datasource-engine/src/index.ts +++ b/packages/datasource-engine/src/index.ts @@ -2,3 +2,5 @@ import createInterpret from './interpret/DataSourceEngineFactory'; import createRuntime from './runtime/RuntimeDataSourceEngineFactory'; export { createInterpret, createRuntime }; + +export * from './types'; diff --git a/packages/datasource-engine/src/interpret/DataSourceEngineFactory.ts b/packages/datasource-engine/src/interpret/DataSourceEngineFactory.ts index 3760e12..62a8656 100644 --- a/packages/datasource-engine/src/interpret/DataSourceEngineFactory.ts +++ b/packages/datasource-engine/src/interpret/DataSourceEngineFactory.ts @@ -2,6 +2,7 @@ import { adapt2Runtime } from '../core/adapter'; import { RuntimeDataSourceItem } from '../core/RuntimeDataSourceItem'; import { reloadDataSourceFactory } from '../core/reloadDataSourceFactory'; import { + DataHandler, IDataSourceRuntimeContext, InterpretDataSource, IRuntimeDataSource, @@ -22,11 +23,14 @@ export default ( context: IDataSourceRuntimeContext, extraConfig: { requestHandlersMap: RequestHandlersMap<{ data: unknown }>; + defaultDataHandler?: DataHandler; } = { requestHandlersMap: {} }, ) => { const { requestHandlersMap } = extraConfig; - const runtimeDataSource: RuntimeDataSource = adapt2Runtime(dataSource, context); + const runtimeDataSource: RuntimeDataSource = adapt2Runtime(dataSource, context, { + defaultDataHandler: extraConfig.defaultDataHandler, + }); const dataSourceMap = runtimeDataSource.list.reduce( (prev: Record, current: RuntimeDataSourceConfig) => { diff --git a/packages/datasource-engine/src/runtime/RuntimeDataSourceEngineFactory.ts b/packages/datasource-engine/src/runtime/RuntimeDataSourceEngineFactory.ts index edcb0fc..c4ebc71 100644 --- a/packages/datasource-engine/src/runtime/RuntimeDataSourceEngineFactory.ts +++ b/packages/datasource-engine/src/runtime/RuntimeDataSourceEngineFactory.ts @@ -5,6 +5,7 @@ import { RequestHandlersMap, RuntimeDataSourceConfig, RuntimeDataSource, + DataHandler, } from '@alilc/lowcode-types'; import { RuntimeDataSourceItem } from '../core'; @@ -22,6 +23,7 @@ export default ( context: IDataSourceRuntimeContext, extraConfig: { requestHandlersMap: RequestHandlersMap<{ data: unknown }>; + defaultDataHandler?: DataHandler; } = { requestHandlersMap: {} }, ) => { const { requestHandlersMap } = extraConfig; @@ -41,7 +43,8 @@ export default ( ? ds.shouldFetch.bind(context) : ds.shouldFetch; ds.willFetch = ds.willFetch ? ds.willFetch.bind(context) : defaultWillFetch; - ds.dataHandler = ds.dataHandler ? ds.dataHandler.bind(context) : defaultDataHandler; + const finalDataHandler = extraConfig.defaultDataHandler || defaultDataHandler; + ds.dataHandler = ds.dataHandler ? ds.dataHandler.bind(context) : finalDataHandler; }); const dataSourceMap = dataSource.list.reduce( diff --git a/packages/datasource-engine/src/types/index.ts b/packages/datasource-engine/src/types/index.ts index 070f086..c7d103f 100644 --- a/packages/datasource-engine/src/types/index.ts +++ b/packages/datasource-engine/src/types/index.ts @@ -1,10 +1,10 @@ -export * from './DataSourceConfig'; -export * from './DataSourceConfigItem'; -export * from './DataSourceEngineOptions'; -export * from './DataSourceOptions'; -export * from './IDataSourceEngine'; -export * from './IDataSourceEngineFactory'; -export * from './IRuntimeContext'; -export * from './IRuntimeDataSource'; -export * from './RequestHandler'; -export * from './RuntimeDataSourceStatus'; +export * from './DataSourceConfig'; +export * from './DataSourceConfigItem'; +export * from './DataSourceEngineOptions'; +export * from './DataSourceOptions'; +export * from './IDataSourceEngine'; +export * from './IDataSourceEngineFactory'; +export * from './IRuntimeContext'; +export * from './IRuntimeDataSource'; +export * from './RequestHandler'; +export * from './RuntimeDataSourceStatus'; diff --git a/packages/datasource-engine/src/typing.d.ts b/packages/datasource-engine/src/typing.d.ts index 2a2deec..e69de29 100644 --- a/packages/datasource-engine/src/typing.d.ts +++ b/packages/datasource-engine/src/typing.d.ts @@ -1 +0,0 @@ -declare module '@ali/universal-mtop'; diff --git a/packages/datasource-engine/src/utils.ts b/packages/datasource-engine/src/utils.ts index 6825854..d8c07ae 100644 --- a/packages/datasource-engine/src/utils.ts +++ b/packages/datasource-engine/src/utils.ts @@ -1,17 +1,16 @@ /* eslint-disable no-new-func */ import { - CompositeValue, IDataSourceRuntimeContext, InterpretDataSourceConfig, isJSExpression, isJSFunction, - JSExpression, - JSFunction, - JSONObject, + IPublicTypeJSExpression, + IPublicTypeJSFunction, RuntimeOptionsConfig, } from '@alilc/lowcode-types'; +import { CompositeValue, JSONObject } from '@alilc/lowcode-datasource-types'; function isObject(obj: unknown) { return Object.prototype.toString.call(obj).indexOf('Object') !== -1; @@ -50,7 +49,7 @@ export const transformBoolStr = (str: string) => { return str !== 'false'; }; -export const getRuntimeJsValue = (value: JSExpression | JSFunction, context: IDataSourceRuntimeContext) => { +export const getRuntimeJsValue = (value: IPublicTypeJSExpression | IPublicTypeJSFunction, context: IDataSourceRuntimeContext) => { if (!['JSExpression', 'JSFunction'].includes(value.type)) { console.error(`translate error, value is ${JSON.stringify(value)}`); return ''; @@ -85,7 +84,7 @@ export const getRuntimeValueFromConfig = (type: string, value: CompositeValue, c return value; }; -export const buildJsonObj = (params: JSONObject | JSExpression, context: IDataSourceRuntimeContext) => { +export const buildJsonObj = (params: JSONObject | IPublicTypeJSExpression, context: IDataSourceRuntimeContext) => { if (isJSExpression(params)) { return transformExpression(params.value, context); } else if (isObject(params)) { // 处理params内部为JSExpression的问题 diff --git a/packages/datasource-engine/test/scenes/p0-0-custom-request-handlers/_datasource-runtime.ts b/packages/datasource-engine/test/scenes/p0-0-custom-request-handlers/_datasource-runtime.ts index fc46c34..ff6ca9b 100644 --- a/packages/datasource-engine/test/scenes/p0-0-custom-request-handlers/_datasource-runtime.ts +++ b/packages/datasource-engine/test/scenes/p0-0-custom-request-handlers/_datasource-runtime.ts @@ -1,4 +1,4 @@ -import { RuntimeDataSource } from '@ali/lowcode-types'; +import { RuntimeDataSource } from '@alilc/lowcode-types'; // 这里仅仅是数据源部分的: // @see: https://yuque.antfin-inc.com/mo/spec/spec-low-code-building-schema#XMeF5 diff --git a/packages/datasource-engine/test/scenes/p0-0-url-params/_datasource-schema.ts b/packages/datasource-engine/test/scenes/p0-0-url-params/_datasource-schema.ts index 20fcb21..544b727 100644 --- a/packages/datasource-engine/test/scenes/p0-0-url-params/_datasource-schema.ts +++ b/packages/datasource-engine/test/scenes/p0-0-url-params/_datasource-schema.ts @@ -1,4 +1,4 @@ -import { InterpretDataSource } from '@ali/lowcode-types'; +import { InterpretDataSource } from '@alilc/lowcode-types'; // 这里仅仅是数据源部分的 schema: // @see: https://yuque.antfin-inc.com/mo/spec/spec-low-code-building-schema#XMeF5 diff --git a/packages/datasource-engine/test/scenes/p0-1-custom-response-status/_datasource-runtime.ts b/packages/datasource-engine/test/scenes/p0-1-custom-response-status/_datasource-runtime.ts index 4b06ca7..f707297 100644 --- a/packages/datasource-engine/test/scenes/p0-1-custom-response-status/_datasource-runtime.ts +++ b/packages/datasource-engine/test/scenes/p0-1-custom-response-status/_datasource-runtime.ts @@ -1,4 +1,4 @@ -import { RuntimeDataSource } from '@ali/lowcode-types'; +import { RuntimeDataSource } from '@alilc/lowcode-types'; // 这里仅仅是数据源部分的: // @see: https://yuque.antfin-inc.com/mo/spec/spec-low-code-building-schema#XMeF5 diff --git a/packages/datasource-fetch-handler/CHANGELOG.md b/packages/datasource-fetch-handler/CHANGELOG.md index 616bb58..9f02721 100644 --- a/packages/datasource-fetch-handler/CHANGELOG.md +++ b/packages/datasource-fetch-handler/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.2.1](https://github.com/alibaba/lowcode-datasource/compare/v1.2.0...v1.2.1) (2024-09-24) + +**Note:** Version bump only for package @alilc/lowcode-datasource-fetch-handler + + + + + +# [1.2.0](https://github.com/alibaba/lowcode-datasource/compare/v1.1.4...v1.2.0) (2024-07-03) + +**Note:** Version bump only for package @alilc/lowcode-datasource-fetch-handler + + + + + ## [1.0.1](https://github.com/alibaba/lowcode-datasource/compare/v1.0.0...v1.0.1) (2022-03-17) **Note:** Version bump only for package @alilc/lowcode-datasource-fetch-handler diff --git a/packages/datasource-fetch-handler/package.json b/packages/datasource-fetch-handler/package.json index 0f576c6..4444847 100644 --- a/packages/datasource-fetch-handler/package.json +++ b/packages/datasource-fetch-handler/package.json @@ -1,6 +1,6 @@ { "name": "@alilc/lowcode-datasource-fetch-handler", - "version": "1.0.1", + "version": "1.2.1", "main": "lib/index.js", "module": "es/index.js", "typings": "es/index.d.ts", @@ -16,8 +16,8 @@ "prepublishOnly": "npm run build" }, "dependencies": { - "@alilc/lowcode-datasource-types": "^1.0.1", - "typescript": "^3.9.7", + "@alilc/lowcode-datasource-types": "^1.2.1", + "typescript": "^4.6.2", "universal-request": "^2.2.0" }, "publishConfig": { diff --git a/packages/datasource-jsonp-handler/CHANGELOG.md b/packages/datasource-jsonp-handler/CHANGELOG.md index 4f8f21b..998d778 100644 --- a/packages/datasource-jsonp-handler/CHANGELOG.md +++ b/packages/datasource-jsonp-handler/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.2.1](https://github.com/alibaba/lowcode-datasource/compare/v1.2.0...v1.2.1) (2024-09-24) + +**Note:** Version bump only for package @alilc/lowcode-datasource-jsonp-handler + + + + + +# [1.2.0](https://github.com/alibaba/lowcode-datasource/compare/v1.1.4...v1.2.0) (2024-07-03) + +**Note:** Version bump only for package @alilc/lowcode-datasource-jsonp-handler + + + + + ## [1.0.1](https://github.com/alibaba/lowcode-datasource/compare/v1.0.0...v1.0.1) (2022-03-17) **Note:** Version bump only for package @alilc/lowcode-datasource-jsonp-handler diff --git a/packages/datasource-jsonp-handler/package.json b/packages/datasource-jsonp-handler/package.json index 7b144c5..189eefa 100644 --- a/packages/datasource-jsonp-handler/package.json +++ b/packages/datasource-jsonp-handler/package.json @@ -1,6 +1,6 @@ { "name": "@alilc/lowcode-datasource-jsonp-handler", - "version": "1.0.1", + "version": "1.2.1", "main": "lib/index.js", "module": "es/index.js", "typings": "es/index.d.ts", @@ -16,9 +16,9 @@ "prepublishOnly": "npm run build" }, "dependencies": { - "@alilc/lowcode-datasource-types": "^1.0.1", + "@alilc/lowcode-datasource-types": "^1.2.1", "jsonp": "^0.2.1", - "typescript": "^3.9.7" + "typescript": "^4.6.2" }, "publishConfig": { "access": "public", diff --git a/packages/datasource-mopen-handler/CHANGELOG.md b/packages/datasource-mopen-handler/CHANGELOG.md deleted file mode 100644 index 91035c5..0000000 --- a/packages/datasource-mopen-handler/CHANGELOG.md +++ /dev/null @@ -1,288 +0,0 @@ -# Change Log - -All notable changes to this project will be documented in this file. -See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. - -## [1.0.1](https://github.com/alibaba/lowcode-datasource/compare/v1.0.0...v1.0.1) (2022-03-17) - -**Note:** Version bump only for package @alilc/lowcode-datasource-mopen-handler - - - - - -# 1.0.0 (2022-02-15) - - -### Features - -* 🎸 提交开源版本 ([453516f](https://github.com/alibaba/lowcode-datasource/commit/453516ffcb25868a6d6f380ec8967a36bb474089)) - - - - - -# [1.0.0](https://github.com/alibaba/lowcode-datasource/compare/v1.0.0-beta.0...v1.0.0) (2022-02-15) - - -### Features - -* 🎸 提交开源版本 ([22a338a](https://github.com/alibaba/lowcode-datasource/commit/22a338a989356cc0f58b276ab3062904b5f005c3)) - - - - - -# [1.0.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-datasource/compare/v1.0.0-beta.0...v1.0.0) (2022-02-15) - -**Note:** Version bump only for package @alilc/lowcode-datasource-mopen-handler - - - - - -# [1.0.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-datasource/compare/v1.0.29...v1.0.0) (2022-01-20) - - -### Bug Fixes - -* 🐛 修复参数深度合并问题 ([e1868b5](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-datasource/commit/e1868b5120dffc798c6278ea016c424a536e3b2a)) - - -### Features - -* 🎸 开源新包 ([16c5589](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-datasource/commit/16c558982f852a009a2c48af7c84629865f0fa7f)) - - - - - -## [1.0.26-alpha.2](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-datasource/compare/v1.0.26-alpha.1...v1.0.26-alpha.2) (2021-12-14) - -**Note:** Version bump only for package @ali/lowcode-datasource-mopen-handler - - - - - -## [1.0.26-alpha.1](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-datasource/compare/v1.0.26-alpha.0...v1.0.26-alpha.1) (2021-12-12) - -**Note:** Version bump only for package @ali/lowcode-datasource-mopen-handler - - - - - -## [1.0.26-alpha.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-datasource/compare/v1.0.25-alpha.0...v1.0.26-alpha.0) (2021-12-12) - -**Note:** Version bump only for package @ali/lowcode-datasource-mopen-handler - - - - - -## [1.0.25-alpha.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-datasource/compare/v1.0.24...v1.0.25-alpha.0) (2021-12-12) - -**Note:** Version bump only for package @ali/lowcode-datasource-mopen-handler - - - - - -## [1.0.24](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-datasource/compare/v1.0.24-beta.14...v1.0.24) (2021-10-08) - -**Note:** Version bump only for package @ali/lowcode-datasource-mopen-handler - - - - - -## [1.0.24-beta.10](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-datasource/compare/v1.0.24-beta.9...v1.0.24-beta.10) (2020-12-09) - -**Note:** Version bump only for package @ali/lowcode-datasource-mopen-handler - - - - - -## [1.0.24-beta.9](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-datasource/compare/v1.0.24-beta.8...v1.0.24-beta.9) (2020-12-09) - -**Note:** Version bump only for package @ali/lowcode-datasource-mopen-handler - - - - - -## [1.0.24-beta.8](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-datasource/compare/v1.0.24-beta.7...v1.0.24-beta.8) (2020-12-09) - -**Note:** Version bump only for package @ali/lowcode-datasource-mopen-handler - - - - - -## [1.0.24-beta.7](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-datasource/compare/v1.0.24-beta.6...v1.0.24-beta.7) (2020-12-09) - -**Note:** Version bump only for package @ali/lowcode-datasource-mopen-handler - - - - - -## [1.0.24-beta.1](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-datasource/compare/v1.0.24-beta.6...v1.0.24-beta.1) (2020-12-09) - -**Note:** Version bump only for package @ali/lowcode-datasource-mopen-handler - - - - - -## [1.0.24-beta.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-datasource/compare/v1.0.24-beta.6...v1.0.24-beta.0) (2020-12-09) - -**Note:** Version bump only for package @ali/lowcode-datasource-mopen-handler - - - - - -## [1.0.24-beta.6](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-datasource/compare/v1.0.24-beta.5...v1.0.24-beta.6) (2020-12-09) - -**Note:** Version bump only for package @ali/lowcode-datasource-mopen-handler - - - - - -## [1.0.24-beta.5](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-datasource/compare/v1.0.24-beta.4...v1.0.24-beta.5) (2020-12-09) - -**Note:** Version bump only for package @ali/lowcode-datasource-mopen-handler - - - - - -## [1.0.24-beta.4](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-datasource/compare/v1.0.24-beta.3...v1.0.24-beta.4) (2020-12-09) - -**Note:** Version bump only for package @ali/lowcode-datasource-mopen-handler - - - - - -## [1.0.24-beta.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-datasource/compare/v1.0.24-beta.3...v1.0.24-beta.0) (2020-12-09) - -**Note:** Version bump only for package @ali/lowcode-datasource-mopen-handler - - - - - -## [1.0.24-beta.3](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-datasource/compare/v1.0.24-beta.2...v1.0.24-beta.3) (2020-12-09) - -**Note:** Version bump only for package @ali/lowcode-datasource-mopen-handler - - - - - -## [1.0.24-beta.2](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-datasource/compare/v1.0.24-beta.1...v1.0.24-beta.2) (2020-12-09) - -**Note:** Version bump only for package @ali/lowcode-datasource-mopen-handler - - - - - -## [1.0.24-beta.1](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-datasource/compare/v1.0.24-beta.0...v1.0.24-beta.1) (2020-12-09) - -**Note:** Version bump only for package @ali/lowcode-datasource-mopen-handler - - - - - -## 1.0.24-beta.0 (2020-12-09) - -**Note:** Version bump only for package @ali/lowcode-datasource-mopen-handler - - - - - - -## [1.0.21](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-datasource-mopen-handler@1.0.20...@ali/lowcode-datasource-mopen-handler@1.0.21) (2020-11-16) - - - - -**Note:** Version bump only for package @ali/lowcode-datasource-mopen-handler - - -## [1.0.20](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-datasource-mopen-handler@1.0.9...@ali/lowcode-datasource-mopen-handler@1.0.20) (2020-11-10) - - -### Bug Fixes - -* 设计和预览两种场景下 requestHandlersMap 的接入 ([f9e5397](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/commit/f9e5397)) - - - - - -## [1.0.9](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-datasource-mopen-handler@1.0.8...@ali/lowcode-datasource-mopen-handler@1.0.9) (2020-11-10) - - - - -**Note:** Version bump only for package @ali/lowcode-datasource-mopen-handler - - -## [1.0.8](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-datasource-mopen-handler@1.0.7...@ali/lowcode-datasource-mopen-handler@1.0.8) (2020-11-05) - - -### Features - -* split datasource types ([fd80698](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/commit/fd80698)) - - - - - -## [1.0.7](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-datasource-mopen-handler@1.0.6...@ali/lowcode-datasource-mopen-handler@1.0.7) (2020-11-05) - - - - -**Note:** Version bump only for package @ali/lowcode-datasource-mopen-handler - - -## [1.0.6](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-datasource-mopen-handler@1.0.5...@ali/lowcode-datasource-mopen-handler@1.0.6) (2020-11-05) - - - - -**Note:** Version bump only for package @ali/lowcode-datasource-mopen-handler - - -## [1.0.5](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-datasource-mopen-handler@1.0.4...@ali/lowcode-datasource-mopen-handler@1.0.5) (2020-11-04) - - - - -**Note:** Version bump only for package @ali/lowcode-datasource-mopen-handler - - -## 1.0.4 (2020-11-04) - - - - -**Note:** Version bump only for package @ali/lowcode-datasource-mopen-handler - - -## 1.0.3 (2020-11-04) - - - - -**Note:** Version bump only for package @ali/lowcode-datasource-mopen-handler diff --git a/packages/datasource-mopen-handler/package.json b/packages/datasource-mopen-handler/package.json deleted file mode 100644 index 91d10c2..0000000 --- a/packages/datasource-mopen-handler/package.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "@alilc/lowcode-datasource-mopen-handler", - "version": "1.0.1", - "main": "lib/index.js", - "module": "es/index.js", - "typings": "es/index.d.ts", - "files": [ - "src", - "lib", - "es" - ], - "scripts": { - "dev": "tsc --watch", - "clean": "rm -rf es lib", - "build": "npm run clean && tsc && tsc --outDir ./lib --module commonjs ", - "prepublishOnly": "npm run build" - }, - "dependencies": { - "@ali/mirror-io-client-mopen": "1.0.0-beta.16", - "@alilc/lowcode-datasource-types": "^1.0.1", - "typescript": "^3.9.7" - }, - "publishConfig": { - "access": "public", - "registry": "https://registry.npmjs.org/" - }, - "gitHead": "714230d68a17fc010fbe80b511802bb410188fb5" -} diff --git a/packages/datasource-mopen-handler/src/index.ts b/packages/datasource-mopen-handler/src/index.ts deleted file mode 100644 index ca338ac..0000000 --- a/packages/datasource-mopen-handler/src/index.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { - MopenClient, - MopenClientConfig, - MOPEN_APPKEY_XSPACE_PRE_ONLINE, - MOPEN_DOMAIN_TAOBAO_PRE_ONLINE, -} from '@ali/mirror-io-client-mopen'; -import { RuntimeOptionsConfig } from '@alilc/lowcode-datasource-types'; - -type Method = 'get' | 'post' | 'GET' | 'POST'; - -type DataType = 'jsonp' | 'json' | 'originaljsonp'; - -export function createMopenHandler( - config: MopenClientConfig = { - mtopDomain: MOPEN_DOMAIN_TAOBAO_PRE_ONLINE, - appKey: MOPEN_APPKEY_XSPACE_PRE_ONLINE, - }, -) { - // eslint-disable-next-line space-before-function-paren - return async function(options: RuntimeOptionsConfig): Promise<{ data: T }> { - const { data, response } = await MopenClient.request({ - config, - ...options, - api: options.uri, - v: options.v as string, - data: options.params, - type: (options.method as Method) || 'get', - dataType: (options.dataType as DataType) || 'json', - timeout: options.timeout, - headers: options.headers, - }); - return { ...response, data }; - }; -} diff --git a/packages/datasource-mtop-handler/.eslintignore b/packages/datasource-mtop-handler/.eslintignore deleted file mode 100644 index fecb7c2..0000000 --- a/packages/datasource-mtop-handler/.eslintignore +++ /dev/null @@ -1,3 +0,0 @@ -/node_modules -/es -/lib \ No newline at end of file diff --git a/packages/datasource-mtop-handler/.eslintrc.js b/packages/datasource-mtop-handler/.eslintrc.js deleted file mode 100644 index 8c13fca..0000000 --- a/packages/datasource-mtop-handler/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - extends: '../../.eslintrc', - rules: { - '@typescript-eslint/no-parameter-properties': 1, - 'no-param-reassign': 0, - }, -}; diff --git a/packages/datasource-mtop-handler/.prettierrc.js b/packages/datasource-mtop-handler/.prettierrc.js deleted file mode 100644 index a425d3f..0000000 --- a/packages/datasource-mtop-handler/.prettierrc.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - singleQuote: true, - trailingComma: 'es5', -}; diff --git a/packages/datasource-mtop-handler/CHANGELOG.md b/packages/datasource-mtop-handler/CHANGELOG.md deleted file mode 100644 index b8394b3..0000000 --- a/packages/datasource-mtop-handler/CHANGELOG.md +++ /dev/null @@ -1,334 +0,0 @@ -# Change Log - -All notable changes to this project will be documented in this file. -See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. - -## [1.0.1](https://github.com/alibaba/lowcode-datasource/compare/v1.0.0...v1.0.1) (2022-03-17) - -**Note:** Version bump only for package @alilc/lowcode-datasource-mtop-handler - - - - - -# 1.0.0 (2022-02-15) - - -### Features - -* 🎸 提交开源版本 ([453516f](https://github.com/alibaba/lowcode-datasource/commit/453516ffcb25868a6d6f380ec8967a36bb474089)) - - - - - -# [1.0.0](https://github.com/alibaba/lowcode-datasource/compare/v1.0.0-beta.0...v1.0.0) (2022-02-15) - - -### Features - -* 🎸 提交开源版本 ([22a338a](https://github.com/alibaba/lowcode-datasource/commit/22a338a989356cc0f58b276ab3062904b5f005c3)) - - - - - -# [1.0.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-datasource/compare/v1.0.0-beta.0...v1.0.0) (2022-02-15) - -**Note:** Version bump only for package @alilc/lowcode-datasource-mtop-handler - - - - - -# [1.0.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-datasource/compare/v1.0.29...v1.0.0) (2022-01-20) - - -### Bug Fixes - -* 🐛 修复参数深度合并问题 ([e1868b5](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-datasource/commit/e1868b5120dffc798c6278ea016c424a536e3b2a)) - - -### Features - -* 🎸 开源新包 ([16c5589](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-datasource/commit/16c558982f852a009a2c48af7c84629865f0fa7f)) - - - - - -## [1.0.26-alpha.2](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-datasource/compare/v1.0.26-alpha.1...v1.0.26-alpha.2) (2021-12-14) - -**Note:** Version bump only for package @ali/lowcode-datasource-mtop-handler - - - - - -## [1.0.26-alpha.1](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-datasource/compare/v1.0.26-alpha.0...v1.0.26-alpha.1) (2021-12-12) - -**Note:** Version bump only for package @ali/lowcode-datasource-mtop-handler - - - - - -## [1.0.26-alpha.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-datasource/compare/v1.0.25-alpha.0...v1.0.26-alpha.0) (2021-12-12) - -**Note:** Version bump only for package @ali/lowcode-datasource-mtop-handler - - - - - -## [1.0.25-alpha.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-datasource/compare/v1.0.24...v1.0.25-alpha.0) (2021-12-12) - -**Note:** Version bump only for package @ali/lowcode-datasource-mtop-handler - - - - - -## [1.0.24](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-datasource/compare/v1.0.24-beta.14...v1.0.24) (2021-10-08) - -**Note:** Version bump only for package @ali/lowcode-datasource-mtop-handler - - - - - -## [1.0.24-beta.14](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-datasource/compare/v1.0.24-beta.13...v1.0.24-beta.14) (2021-03-18) - - -### Bug Fixes - -* version update ([e8b2715](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-datasource/commit/e8b2715f1a94cda81f077c641b953f66ffcb4e16)) - - - - - -## [1.0.24-beta.13](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-datasource/compare/v1.0.24-beta.12...v1.0.24-beta.13) (2021-02-02) - - -### Bug Fixes - -* update version ([6dea344](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-datasource/commit/6dea34469a1a03b710b3544ce42b8d9aa208e35f)) -* 小程序的 sendMtop 设置域名的兼容处理 ([ebb53e6](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-datasource/commit/ebb53e63636dde4b3d30bd82eca0b59ca994259c)) -* 小程序的 sendMtop 设置域名的兼容处理 ([24c377f](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-datasource/commit/24c377f53f24e272835f8e2be7d44055fb190f5a)) - - - - - -## [1.0.24-beta.12](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-datasource/compare/v1.0.24-beta.10...v1.0.24-beta.12) (2021-02-02) - - -### Bug Fixes - -* mtop handler 透传额外的参数 ([f7212d2](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-datasource/commit/f7212d2dfb36dc54cb8a73e2eb774ff99b2f373f)) - - - - - -## [1.0.24-beta.11](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-datasource/compare/v1.0.24-beta.10...v1.0.24-beta.11) (2021-02-02) - - -### Bug Fixes - -* mtop handler 透传额外的参数 ([f7212d2](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-datasource/commit/f7212d2dfb36dc54cb8a73e2eb774ff99b2f373f)) - - - - - -## [1.0.24-beta.10](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-datasource/compare/v1.0.24-beta.9...v1.0.24-beta.10) (2020-12-09) - -**Note:** Version bump only for package @ali/lowcode-datasource-mtop-handler - - - - - -## [1.0.24-beta.9](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-datasource/compare/v1.0.24-beta.8...v1.0.24-beta.9) (2020-12-09) - -**Note:** Version bump only for package @ali/lowcode-datasource-mtop-handler - - - - - -## [1.0.24-beta.8](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-datasource/compare/v1.0.24-beta.7...v1.0.24-beta.8) (2020-12-09) - -**Note:** Version bump only for package @ali/lowcode-datasource-mtop-handler - - - - - -## [1.0.24-beta.7](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-datasource/compare/v1.0.24-beta.6...v1.0.24-beta.7) (2020-12-09) - -**Note:** Version bump only for package @ali/lowcode-datasource-mtop-handler - - - - - -## [1.0.24-beta.1](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-datasource/compare/v1.0.24-beta.6...v1.0.24-beta.1) (2020-12-09) - -**Note:** Version bump only for package @ali/lowcode-datasource-mtop-handler - - - - - -## [1.0.24-beta.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-datasource/compare/v1.0.24-beta.6...v1.0.24-beta.0) (2020-12-09) - -**Note:** Version bump only for package @ali/lowcode-datasource-mtop-handler - - - - - -## [1.0.24-beta.6](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-datasource/compare/v1.0.24-beta.5...v1.0.24-beta.6) (2020-12-09) - -**Note:** Version bump only for package @ali/lowcode-datasource-mtop-handler - - - - - -## [1.0.24-beta.5](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-datasource/compare/v1.0.24-beta.4...v1.0.24-beta.5) (2020-12-09) - -**Note:** Version bump only for package @ali/lowcode-datasource-mtop-handler - - - - - -## [1.0.24-beta.4](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-datasource/compare/v1.0.24-beta.3...v1.0.24-beta.4) (2020-12-09) - -**Note:** Version bump only for package @ali/lowcode-datasource-mtop-handler - - - - - -## [1.0.24-beta.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-datasource/compare/v1.0.24-beta.3...v1.0.24-beta.0) (2020-12-09) - -**Note:** Version bump only for package @ali/lowcode-datasource-mtop-handler - - - - - -## [1.0.24-beta.3](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-datasource/compare/v1.0.24-beta.2...v1.0.24-beta.3) (2020-12-09) - -**Note:** Version bump only for package @ali/lowcode-datasource-mtop-handler - - - - - -## [1.0.24-beta.2](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-datasource/compare/v1.0.24-beta.1...v1.0.24-beta.2) (2020-12-09) - -**Note:** Version bump only for package @ali/lowcode-datasource-mtop-handler - - - - - -## [1.0.24-beta.1](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-datasource/compare/v1.0.24-beta.0...v1.0.24-beta.1) (2020-12-09) - -**Note:** Version bump only for package @ali/lowcode-datasource-mtop-handler - - - - - -## 1.0.24-beta.0 (2020-12-09) - -**Note:** Version bump only for package @ali/lowcode-datasource-mtop-handler - - - - - - -## [1.0.21](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-datasource-mtop-handler@1.0.20...@ali/lowcode-datasource-mtop-handler@1.0.21) (2020-11-16) - - - - -**Note:** Version bump only for package @ali/lowcode-datasource-mtop-handler - - -## [1.0.20](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-datasource-mtop-handler@1.0.8...@ali/lowcode-datasource-mtop-handler@1.0.20) (2020-11-10) - - -### Bug Fixes - -* 设计和预览两种场景下 requestHandlersMap 的接入 ([f9e5397](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/commit/f9e5397)) - - - - - -## [1.0.8](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-datasource-mtop-handler@1.0.7...@ali/lowcode-datasource-mtop-handler@1.0.8) (2020-11-10) - - - - -**Note:** Version bump only for package @ali/lowcode-datasource-mtop-handler - - -## [1.0.7](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-datasource-mtop-handler@1.0.6...@ali/lowcode-datasource-mtop-handler@1.0.7) (2020-11-05) - - -### Features - -* split datasource types ([fd80698](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/commit/fd80698)) - - - - - -## [1.0.6](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-datasource-mtop-handler@1.0.5...@ali/lowcode-datasource-mtop-handler@1.0.6) (2020-11-05) - - - - -**Note:** Version bump only for package @ali/lowcode-datasource-mtop-handler - - -## [1.0.5](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-datasource-mtop-handler@1.0.4...@ali/lowcode-datasource-mtop-handler@1.0.5) (2020-11-05) - - - - -**Note:** Version bump only for package @ali/lowcode-datasource-mtop-handler - - -## [1.0.4](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-datasource-mtop-handler@1.0.3...@ali/lowcode-datasource-mtop-handler@1.0.4) (2020-11-04) - - - - -**Note:** Version bump only for package @ali/lowcode-datasource-mtop-handler - - -## 1.0.3 (2020-11-04) - - - - -**Note:** Version bump only for package @ali/lowcode-datasource-mtop-handler - - -## 1.0.2 (2020-11-04) - - - - -**Note:** Version bump only for package @ali/lowcode-datasource-mtop-handler diff --git a/packages/datasource-mtop-handler/src/index.ts b/packages/datasource-mtop-handler/src/index.ts deleted file mode 100644 index 0dc305e..0000000 --- a/packages/datasource-mtop-handler/src/index.ts +++ /dev/null @@ -1,44 +0,0 @@ -import mtopRequest from '@ali/universal-mtop'; - -import { RuntimeOptionsConfig } from '@alilc/lowcode-datasource-types'; - -export type Method = 'get' | 'post' | 'GET' | 'POST'; - -export type DataType = 'jsonp' | 'json' | 'originaljsonp'; - -// 考虑一下 mtop 类型的问题,官方没有提供 ts 文件 -export function createMtopHandler(config?: MTopConfig) { - if (config && Object.keys(config).length > 0) { - Object.keys(config).forEach((key: string) => { - mtopRequest.config(key, config[key]); - }); - } - // eslint-disable-next-line space-before-function-paren - return async function (options: RuntimeOptionsConfig): Promise<{ data: T }> { - const defaultOptions = { - ...options, // 透传其余的参数 - api: options.uri || options.api, // 兼容老的结构 - v: (options.v as string) || '1.0', - data: options.params, - type: (options.method as Method) || 'get', - dataType: (options.dataType as DataType) || 'json', - timeout: options.timeout, - headers: options.headers, - }; - if (config && config.mpHost) { - // @ts-ignore 小程序的 sendMtop 设置域名的兼容处理 - defaultOptions.mpHost = config.mpHost; - } - const response = await mtopRequest.request(defaultOptions); - if (response.ret && response.ret[0].indexOf('SUCCESS::') > -1) { - // 校验成功 - return response; - } - // 默认异常 - let errorMsg = '未知异常'; - if (response.ret && response.ret[0]) { - errorMsg = response.ret[0]; - } - throw new Error(errorMsg); - }; -} diff --git a/packages/datasource-mtop-handler/src/typings.d.ts b/packages/datasource-mtop-handler/src/typings.d.ts deleted file mode 100644 index 11f4d02..0000000 --- a/packages/datasource-mtop-handler/src/typings.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -declare interface MTopConfig { - prefix?: string; - subDomain?: string; - mainDomain?: string; - [index: string]: unknown; -} - -declare module '@ali/universal-mtop' { - const request: (config: any) => Promise<{ data: T; ret: string[] }>; - const config: (key: string, value: unknown) => void; -} diff --git a/packages/datasource-mtop-handler/tsconfig.json b/packages/datasource-mtop-handler/tsconfig.json deleted file mode 100644 index 4f788e5..0000000 --- a/packages/datasource-mtop-handler/tsconfig.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "compilerOptions": { - "outDir": "es", - "target": "es6", - "module": "esnext", - /* Basic Options */ - // "incremental": true, /* Enable incremental compilation */ - // "target": "es6" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */, - // "module": "esnext" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */, - "lib": [ - "ESNext", - "DOM" - ] /* Specify library files to be included in the compilation. */, - // "allowJs": true, /* Allow javascript files to be compiled. */ - // "checkJs": true, /* Report errors in .js files. */ - // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ - "declaration": true /* Generates corresponding '.d.ts' file. */, - // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */ - // "sourceMap": true, /* Generates corresponding '.map' file. */ - // "outFile": "./", /* Concatenate and emit output to single file. */ - // "outDir": "es" /* Redirect output structure to the directory. */, - // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ - // "composite": true, /* Enable project compilation */ - // "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */ - // "removeComments": true, /* Do not emit comments to output. */ - // "noEmit": true, /* Do not emit outputs. */ - // "importHelpers": true, /* Import emit helpers from 'tslib'. */ - // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ - // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ - /* Strict Type-Checking Options */ - "strict": true /* Enable all strict type-checking options. */, - // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ - // "strictNullChecks": true, /* Enable strict null checks. */ - // "strictFunctionTypes": true, /* Enable strict checking of function types. */ - // "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */ - // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */ - // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ - // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ - /* Additional Checks */ - // "noUnusedLocals": true, /* Report errors on unused locals. */ - // "noUnusedParameters": true, /* Report errors on unused parameters. */ - // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ - // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ - /* Module Resolution Options */ - "moduleResolution": "node" /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */, - // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ - // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ - // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ - // "typeRoots": [], /* List of folders to include type definitions from. */ - // "types": [], /* Type declaration files to be included in compilation. */ - // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ - "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */, - // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ - // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ - /* Source Map Options */ - // "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ - // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ - // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ - // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ - /* Experimental Options */ - // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ - // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ - /* Advanced Options */ - "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */, - "skipLibCheck": true - }, - "include": ["src/**/*"] -} diff --git a/packages/datasource-types/CHANGELOG.md b/packages/datasource-types/CHANGELOG.md index 081b56a..3170ce7 100644 --- a/packages/datasource-types/CHANGELOG.md +++ b/packages/datasource-types/CHANGELOG.md @@ -3,6 +3,29 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.2.1](https://github.com/alibaba/lowcode-datasource/compare/v1.2.0...v1.2.1) (2024-09-24) + + +### Bug Fixes + +* 🐛 Remove unused JSExpression and JSFunction functions ([a3e31c6](https://github.com/alibaba/lowcode-datasource/commit/a3e31c6bc67593b01f0533174458fd61e5ae0f82)) + + + + + +# [1.2.0](https://github.com/alibaba/lowcode-datasource/compare/v1.1.4...v1.2.0) (2024-07-03) + + +### Features + +* 🎸 支持用户自定义defaultDataHandler,避免默认都返回了 res.data ([add3c1e](https://github.com/alibaba/lowcode-datasource/commit/add3c1e05e44e6a199f505cac3b657ba3c5e18a8)) +* 🎸 remove mtop & mopen packages ([f517771](https://github.com/alibaba/lowcode-datasource/commit/f517771d3832734cba06c9ca5590a054d55a6fd0)) + + + + + ## [1.0.1](https://github.com/alibaba/lowcode-datasource/compare/v1.0.0...v1.0.1) (2022-03-17) **Note:** Version bump only for package @alilc/lowcode-datasource-types diff --git a/packages/datasource-types/package.json b/packages/datasource-types/package.json index eeb7f7b..bedb108 100644 --- a/packages/datasource-types/package.json +++ b/packages/datasource-types/package.json @@ -1,6 +1,6 @@ { "name": "@alilc/lowcode-datasource-types", - "version": "1.0.1", + "version": "1.2.1", "main": "lib/index.js", "module": "es/index.js", "typings": "es/index.d.ts", @@ -19,5 +19,8 @@ "access": "public", "registry": "https://registry.npmjs.org/" }, + "dependencies": { + "tslib": "^2.0.1" + }, "gitHead": "714230d68a17fc010fbe80b511802bb410188fb5" } diff --git a/packages/datasource-types/src/ExtraConfig.ts b/packages/datasource-types/src/ExtraConfig.ts new file mode 100644 index 0000000..3a0e965 --- /dev/null +++ b/packages/datasource-types/src/ExtraConfig.ts @@ -0,0 +1,5 @@ +import { DataHandler } from '@alilc/lowcode-types'; + +export type ExtraConfig = { + defaultDataHandler?: DataHandler; +}; diff --git a/packages/datasource-types/src/data-source-runtime.ts b/packages/datasource-types/src/data-source-runtime.ts index 1914927..90d03db 100644 --- a/packages/datasource-types/src/data-source-runtime.ts +++ b/packages/datasource-types/src/data-source-runtime.ts @@ -15,7 +15,7 @@ export interface RuntimeDataSourceConfig { isSync?: boolean; type?: string; willFetch?: WillFetch; - shouldFetch?: () => boolean; + shouldFetch?: (options:RuntimeOptionsConfig) => boolean; requestHandler?: CustomRequestHandler; dataHandler?: DataHandler; errorHandler?: ErrorHandler; diff --git a/packages/datasource-types/src/index.ts b/packages/datasource-types/src/index.ts index f7f9d21..ebc6a59 100644 --- a/packages/datasource-types/src/index.ts +++ b/packages/datasource-types/src/index.ts @@ -2,3 +2,5 @@ export * from './data-source'; export * from './data-source-handlers'; export * from './data-source-interpret'; export * from './data-source-runtime'; +export * from './value-type'; +export * from './ExtraConfig'; diff --git a/packages/datasource-types/src/value-type.ts b/packages/datasource-types/src/value-type.ts index bb959b4..5237970 100644 --- a/packages/datasource-types/src/value-type.ts +++ b/packages/datasource-types/src/value-type.ts @@ -81,11 +81,3 @@ export type CompositeArray = CompositeValue[]; export interface CompositeObject { [key: string]: CompositeValue; } - -export function isJSExpression(data: any): data is JSExpression { - return data && data.type === 'JSExpression'; -} - -export function isJSFunction(x: any): x is JSFunction { - return typeof x === 'object' && x && x.type === 'JSFunction'; -} diff --git a/packages/datasource-mopen-handler/.eslintignore b/packages/datasource-umi-request-handler/.eslintignore similarity index 100% rename from packages/datasource-mopen-handler/.eslintignore rename to packages/datasource-umi-request-handler/.eslintignore diff --git a/packages/datasource-mopen-handler/.eslintrc.js b/packages/datasource-umi-request-handler/.eslintrc.js similarity index 100% rename from packages/datasource-mopen-handler/.eslintrc.js rename to packages/datasource-umi-request-handler/.eslintrc.js diff --git a/packages/datasource-mopen-handler/.prettierrc.js b/packages/datasource-umi-request-handler/.prettierrc.js similarity index 100% rename from packages/datasource-mopen-handler/.prettierrc.js rename to packages/datasource-umi-request-handler/.prettierrc.js diff --git a/packages/datasource-umi-request-handler/CHANGELOG.md b/packages/datasource-umi-request-handler/CHANGELOG.md new file mode 100644 index 0000000..c3f06c8 --- /dev/null +++ b/packages/datasource-umi-request-handler/CHANGELOG.md @@ -0,0 +1,16 @@ +# Change Log + +All notable changes to this project will be documented in this file. +See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +## [1.2.1](https://github.com/alibaba/lowcode-datasource/compare/v1.2.0...v1.2.1) (2024-09-24) + +**Note:** Version bump only for package @alilc/lowcode-datasource-umi-request-handler + + + + + +# [1.2.0](https://github.com/alibaba/lowcode-datasource/compare/v1.1.4...v1.2.0) (2024-07-03) + +**Note:** Version bump only for package @alilc/lowcode-datasource-umi-request-handler diff --git a/packages/datasource-mtop-handler/package.json b/packages/datasource-umi-request-handler/package.json similarity index 72% rename from packages/datasource-mtop-handler/package.json rename to packages/datasource-umi-request-handler/package.json index 250cf45..7586da5 100644 --- a/packages/datasource-mtop-handler/package.json +++ b/packages/datasource-umi-request-handler/package.json @@ -1,6 +1,6 @@ { - "name": "@alilc/lowcode-datasource-mtop-handler", - "version": "1.0.1", + "name": "@alilc/lowcode-datasource-umi-request-handler", + "version": "1.2.1", "main": "lib/index.js", "module": "es/index.js", "typings": "es/index.d.ts", @@ -16,9 +16,9 @@ "prepublishOnly": "npm run build" }, "dependencies": { - "@ali/universal-mtop": "^5.1.9", - "@alilc/lowcode-datasource-types": "^1.0.1", - "typescript": "^3.9.7" + "@alilc/lowcode-datasource-types": "^1.2.1", + "typescript": "^4.6.2", + "umi-request": "^1.4.0" }, "publishConfig": { "access": "public", diff --git a/packages/datasource-umi-request-handler/src/index.ts b/packages/datasource-umi-request-handler/src/index.ts new file mode 100644 index 0000000..05d19e7 --- /dev/null +++ b/packages/datasource-umi-request-handler/src/index.ts @@ -0,0 +1,30 @@ +import { RuntimeOptionsConfig } from '@alilc/lowcode-datasource-types'; + +import request from 'umi-request'; +import { RequestOptionsInit, RequestResponse } from 'umi-request/types'; + +// config 留着扩展 +export function createUmiRequestHandler(config?: Record) { + // eslint-disable-next-line space-before-function-paren + return async function (options: RuntimeOptionsConfig) { + const requestOptions: RequestOptionsInit = { + ...options, + // 请求方法 + method: options.method, + // 请求参数 + data: options.params, + // 请求头信息 + headers: options.headers as HeadersInit, + // 在 requestHandlersMap 控制请求方式对应的发送请求的行为实例设计器时,可丰富扩展传入请求实例的参数 + ...config, + // 'getResponse': 是否获取源 Response, 返回结果将包含一层: { data, response } + // 参考:https://github.com/umijs/umi-request/blob/master/README_zh-CN.md + // 为了尽可能多得给源数据,提供更多灵活自定义的可能 + getResponse: true, + }; + const response: RequestResponse = await request(options.uri, requestOptions); + // 参考 axios 将 options 等请求信息返回,方便使用者根据 options 做一些逻辑处理 + // https://github.com/axios/axios#response-schema + return { ...response, options }; + }; +} diff --git a/packages/datasource-mopen-handler/tsconfig.json b/packages/datasource-umi-request-handler/tsconfig.json similarity index 100% rename from packages/datasource-mopen-handler/tsconfig.json rename to packages/datasource-umi-request-handler/tsconfig.json diff --git a/packages/datasource-universal-mtop-handler/.eslintignore b/packages/datasource-universal-mtop-handler/.eslintignore deleted file mode 100644 index fecb7c2..0000000 --- a/packages/datasource-universal-mtop-handler/.eslintignore +++ /dev/null @@ -1,3 +0,0 @@ -/node_modules -/es -/lib \ No newline at end of file diff --git a/packages/datasource-universal-mtop-handler/.eslintrc.js b/packages/datasource-universal-mtop-handler/.eslintrc.js deleted file mode 100644 index 8c13fca..0000000 --- a/packages/datasource-universal-mtop-handler/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - extends: '../../.eslintrc', - rules: { - '@typescript-eslint/no-parameter-properties': 1, - 'no-param-reassign': 0, - }, -}; diff --git a/packages/datasource-universal-mtop-handler/.prettierrc.js b/packages/datasource-universal-mtop-handler/.prettierrc.js deleted file mode 100644 index de2f53c..0000000 --- a/packages/datasource-universal-mtop-handler/.prettierrc.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - singleQuote: true, - trailingComma: 'all', -}; diff --git a/packages/datasource-universal-mtop-handler/CHANGELOG.md b/packages/datasource-universal-mtop-handler/CHANGELOG.md deleted file mode 100644 index 47996bd..0000000 --- a/packages/datasource-universal-mtop-handler/CHANGELOG.md +++ /dev/null @@ -1,288 +0,0 @@ -# Change Log - -All notable changes to this project will be documented in this file. -See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. - -## [1.0.1](https://github.com/alibaba/lowcode-datasource/compare/v1.0.0...v1.0.1) (2022-03-17) - -**Note:** Version bump only for package @alilc/lowcode-datasource-universal-mtop-handler - - - - - -# 1.0.0 (2022-02-15) - - -### Features - -* 🎸 提交开源版本 ([453516f](https://github.com/alibaba/lowcode-datasource/commit/453516ffcb25868a6d6f380ec8967a36bb474089)) - - - - - -# [1.0.0](https://github.com/alibaba/lowcode-datasource/compare/v1.0.0-beta.0...v1.0.0) (2022-02-15) - - -### Features - -* 🎸 提交开源版本 ([22a338a](https://github.com/alibaba/lowcode-datasource/commit/22a338a989356cc0f58b276ab3062904b5f005c3)) - - - - - -# [1.0.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-datasource/compare/v1.0.0-beta.0...v1.0.0) (2022-02-15) - -**Note:** Version bump only for package @alilc/lowcode-datasource-universal-mtop-handler - - - - - -# [1.0.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-datasource/compare/v1.0.29...v1.0.0) (2022-01-20) - - -### Bug Fixes - -* 🐛 修复参数深度合并问题 ([e1868b5](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-datasource/commit/e1868b5120dffc798c6278ea016c424a536e3b2a)) - - -### Features - -* 🎸 开源新包 ([16c5589](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-datasource/commit/16c558982f852a009a2c48af7c84629865f0fa7f)) - - - - - -## [1.0.26-alpha.2](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-datasource/compare/v1.0.26-alpha.1...v1.0.26-alpha.2) (2021-12-14) - -**Note:** Version bump only for package @ali/lowcode-datasource-universal-mtop-handler - - - - - -## [1.0.26-alpha.1](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-datasource/compare/v1.0.26-alpha.0...v1.0.26-alpha.1) (2021-12-12) - -**Note:** Version bump only for package @ali/lowcode-datasource-universal-mtop-handler - - - - - -## [1.0.26-alpha.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-datasource/compare/v1.0.25-alpha.0...v1.0.26-alpha.0) (2021-12-12) - -**Note:** Version bump only for package @ali/lowcode-datasource-universal-mtop-handler - - - - - -## [1.0.25-alpha.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-datasource/compare/v1.0.24...v1.0.25-alpha.0) (2021-12-12) - -**Note:** Version bump only for package @ali/lowcode-datasource-universal-mtop-handler - - - - - -## [1.0.24](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-datasource/compare/v1.0.24-beta.14...v1.0.24) (2021-10-08) - -**Note:** Version bump only for package @ali/lowcode-datasource-universal-mtop-handler - - - - - -## [1.0.24-beta.10](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-datasource/compare/v1.0.24-beta.9...v1.0.24-beta.10) (2020-12-09) - -**Note:** Version bump only for package @ali/lowcode-datasource-universal-mtop-handler - - - - - -## [1.0.24-beta.9](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-datasource/compare/v1.0.24-beta.8...v1.0.24-beta.9) (2020-12-09) - -**Note:** Version bump only for package @ali/lowcode-datasource-universal-mtop-handler - - - - - -## [1.0.24-beta.8](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-datasource/compare/v1.0.24-beta.7...v1.0.24-beta.8) (2020-12-09) - -**Note:** Version bump only for package @ali/lowcode-datasource-universal-mtop-handler - - - - - -## [1.0.24-beta.7](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-datasource/compare/v1.0.24-beta.6...v1.0.24-beta.7) (2020-12-09) - -**Note:** Version bump only for package @ali/lowcode-datasource-universal-mtop-handler - - - - - -## [1.0.24-beta.1](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-datasource/compare/v1.0.24-beta.6...v1.0.24-beta.1) (2020-12-09) - -**Note:** Version bump only for package @ali/lowcode-datasource-universal-mtop-handler - - - - - -## [1.0.24-beta.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-datasource/compare/v1.0.24-beta.6...v1.0.24-beta.0) (2020-12-09) - -**Note:** Version bump only for package @ali/lowcode-datasource-universal-mtop-handler - - - - - -## [1.0.24-beta.6](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-datasource/compare/v1.0.24-beta.5...v1.0.24-beta.6) (2020-12-09) - -**Note:** Version bump only for package @ali/lowcode-datasource-universal-mtop-handler - - - - - -## [1.0.24-beta.5](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-datasource/compare/v1.0.24-beta.4...v1.0.24-beta.5) (2020-12-09) - -**Note:** Version bump only for package @ali/lowcode-datasource-universal-mtop-handler - - - - - -## [1.0.24-beta.4](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-datasource/compare/v1.0.24-beta.3...v1.0.24-beta.4) (2020-12-09) - -**Note:** Version bump only for package @ali/lowcode-datasource-universal-mtop-handler - - - - - -## [1.0.24-beta.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-datasource/compare/v1.0.24-beta.3...v1.0.24-beta.0) (2020-12-09) - -**Note:** Version bump only for package @ali/lowcode-datasource-universal-mtop-handler - - - - - -## [1.0.24-beta.3](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-datasource/compare/v1.0.24-beta.2...v1.0.24-beta.3) (2020-12-09) - -**Note:** Version bump only for package @ali/lowcode-datasource-universal-mtop-handler - - - - - -## [1.0.24-beta.2](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-datasource/compare/v1.0.24-beta.1...v1.0.24-beta.2) (2020-12-09) - -**Note:** Version bump only for package @ali/lowcode-datasource-universal-mtop-handler - - - - - -## [1.0.24-beta.1](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-datasource/compare/v1.0.24-beta.0...v1.0.24-beta.1) (2020-12-09) - -**Note:** Version bump only for package @ali/lowcode-datasource-universal-mtop-handler - - - - - -## 1.0.24-beta.0 (2020-12-09) - -**Note:** Version bump only for package @ali/lowcode-datasource-universal-mtop-handler - - - - - - -## [1.0.21](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-datasource-universal-mtop-handler@1.0.20...@ali/lowcode-datasource-universal-mtop-handler@1.0.21) (2020-11-16) - - - - -**Note:** Version bump only for package @ali/lowcode-datasource-universal-mtop-handler - - -## [1.0.20](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-datasource-universal-mtop-handler@1.0.8...@ali/lowcode-datasource-universal-mtop-handler@1.0.20) (2020-11-10) - - -### Bug Fixes - -* 设计和预览两种场景下 requestHandlersMap 的接入 ([f9e5397](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/commit/f9e5397)) - - - - - -## [1.0.8](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-datasource-universal-mtop-handler@1.0.7...@ali/lowcode-datasource-universal-mtop-handler@1.0.8) (2020-11-10) - - - - -**Note:** Version bump only for package @ali/lowcode-datasource-universal-mtop-handler - - -## [1.0.7](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-datasource-universal-mtop-handler@1.0.6...@ali/lowcode-datasource-universal-mtop-handler@1.0.7) (2020-11-05) - - -### Features - -* split datasource types ([fd80698](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/commit/fd80698)) - - - - - -## [1.0.6](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-datasource-universal-mtop-handler@1.0.5...@ali/lowcode-datasource-universal-mtop-handler@1.0.6) (2020-11-05) - - - - -**Note:** Version bump only for package @ali/lowcode-datasource-universal-mtop-handler - - -## [1.0.5](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-datasource-universal-mtop-handler@1.0.4...@ali/lowcode-datasource-universal-mtop-handler@1.0.5) (2020-11-05) - - - - -**Note:** Version bump only for package @ali/lowcode-datasource-universal-mtop-handler - - -## [1.0.4](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-datasource-universal-mtop-handler@1.0.3...@ali/lowcode-datasource-universal-mtop-handler@1.0.4) (2020-11-04) - - - - -**Note:** Version bump only for package @ali/lowcode-datasource-universal-mtop-handler - - -## 1.0.3 (2020-11-04) - - - - -**Note:** Version bump only for package @ali/lowcode-datasource-universal-mtop-handler - - -## 1.0.2 (2020-11-04) - - - - -**Note:** Version bump only for package @ali/lowcode-datasource-universal-mtop-handler diff --git a/packages/datasource-universal-mtop-handler/package.json b/packages/datasource-universal-mtop-handler/package.json deleted file mode 100644 index 0120d0a..0000000 --- a/packages/datasource-universal-mtop-handler/package.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "@alilc/lowcode-datasource-universal-mtop-handler", - "version": "1.0.1", - "main": "lib/index.js", - "module": "es/index.js", - "typings": "es/index.d.ts", - "files": [ - "src", - "lib", - "es" - ], - "scripts": { - "dev": "tsc --watch", - "clean": "rm -rf es lib", - "build": "npm run clean && tsc && tsc --outDir ./lib --module commonjs ", - "prepublishOnly": "npm run build" - }, - "dependencies": { - "@ali/mirror-io-client-universal-mtop": "1.0.0-beta.16", - "@alilc/lowcode-datasource-types": "^1.0.1", - "typescript": "^3.9.7" - }, - "publishConfig": { - "access": "public", - "registry": "https://registry.npmjs.org/" - }, - "gitHead": "714230d68a17fc010fbe80b511802bb410188fb5" -} diff --git a/packages/datasource-universal-mtop-handler/src/index.ts b/packages/datasource-universal-mtop-handler/src/index.ts deleted file mode 100644 index 7bdbb21..0000000 --- a/packages/datasource-universal-mtop-handler/src/index.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { - UniversalMtopClient, - UniversalMtopClientConfig, -} from '@ali/mirror-io-client-universal-mtop'; - -import { RuntimeOptionsConfig } from '@alilc/lowcode-datasource-types'; - -type Method = 'get' | 'post' | 'GET' | 'POST'; - -type DataType = 'jsonp' | 'json' | 'originaljsonp'; - -export function createMopenHandler( - config?: UniversalMtopClientConfig, -) { - // eslint-disable-next-line space-before-function-paren - return async function(options: RuntimeOptionsConfig): Promise<{ data: T }> { - const { data, response } = await UniversalMtopClient.request({ - config, - ...options, - api: options.uri, - v: options.v as string, - data: options.params, - type: (options.method as Method) || 'get', - dataType: (options.dataType as DataType) || 'json', - timeout: options.timeout, - headers: options.headers, - }); - return { ...response, data }; - }; -} diff --git a/packages/datasource-universal-mtop-handler/tsconfig.json b/packages/datasource-universal-mtop-handler/tsconfig.json deleted file mode 100644 index 4f788e5..0000000 --- a/packages/datasource-universal-mtop-handler/tsconfig.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "compilerOptions": { - "outDir": "es", - "target": "es6", - "module": "esnext", - /* Basic Options */ - // "incremental": true, /* Enable incremental compilation */ - // "target": "es6" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */, - // "module": "esnext" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */, - "lib": [ - "ESNext", - "DOM" - ] /* Specify library files to be included in the compilation. */, - // "allowJs": true, /* Allow javascript files to be compiled. */ - // "checkJs": true, /* Report errors in .js files. */ - // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ - "declaration": true /* Generates corresponding '.d.ts' file. */, - // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */ - // "sourceMap": true, /* Generates corresponding '.map' file. */ - // "outFile": "./", /* Concatenate and emit output to single file. */ - // "outDir": "es" /* Redirect output structure to the directory. */, - // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ - // "composite": true, /* Enable project compilation */ - // "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */ - // "removeComments": true, /* Do not emit comments to output. */ - // "noEmit": true, /* Do not emit outputs. */ - // "importHelpers": true, /* Import emit helpers from 'tslib'. */ - // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ - // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ - /* Strict Type-Checking Options */ - "strict": true /* Enable all strict type-checking options. */, - // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ - // "strictNullChecks": true, /* Enable strict null checks. */ - // "strictFunctionTypes": true, /* Enable strict checking of function types. */ - // "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */ - // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */ - // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ - // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ - /* Additional Checks */ - // "noUnusedLocals": true, /* Report errors on unused locals. */ - // "noUnusedParameters": true, /* Report errors on unused parameters. */ - // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ - // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ - /* Module Resolution Options */ - "moduleResolution": "node" /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */, - // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ - // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ - // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ - // "typeRoots": [], /* List of folders to include type definitions from. */ - // "types": [], /* Type declaration files to be included in compilation. */ - // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ - "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */, - // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ - // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ - /* Source Map Options */ - // "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ - // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ - // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ - // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ - /* Experimental Options */ - // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ - // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ - /* Advanced Options */ - "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */, - "skipLibCheck": true - }, - "include": ["src/**/*"] -} diff --git a/packages/datasource-url-params-handler/CHANGELOG.md b/packages/datasource-url-params-handler/CHANGELOG.md index 6c84ec2..8d94114 100644 --- a/packages/datasource-url-params-handler/CHANGELOG.md +++ b/packages/datasource-url-params-handler/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.2.1](https://github.com/alibaba/lowcode-datasource/compare/v1.2.0...v1.2.1) (2024-09-24) + +**Note:** Version bump only for package @alilc/lowcode-datasource-url-params-handler + + + + + +# [1.2.0](https://github.com/alibaba/lowcode-datasource/compare/v1.1.4...v1.2.0) (2024-07-03) + +**Note:** Version bump only for package @alilc/lowcode-datasource-url-params-handler + + + + + ## [1.0.1](https://github.com/alibaba/lowcode-datasource/compare/v1.0.0...v1.0.1) (2022-03-17) **Note:** Version bump only for package @alilc/lowcode-datasource-url-params-handler diff --git a/packages/datasource-url-params-handler/package.json b/packages/datasource-url-params-handler/package.json index ddc473e..efdc77d 100644 --- a/packages/datasource-url-params-handler/package.json +++ b/packages/datasource-url-params-handler/package.json @@ -1,6 +1,6 @@ { "name": "@alilc/lowcode-datasource-url-params-handler", - "version": "1.0.1", + "version": "1.2.1", "main": "lib/index.js", "module": "es/index.js", "typings": "es/index.d.ts", @@ -16,9 +16,9 @@ "prepublishOnly": "npm run build" }, "dependencies": { - "@alilc/lowcode-datasource-types": "^1.0.1", + "@alilc/lowcode-datasource-types": "^1.2.1", "query-string": "^6.13.1", - "typescript": "^3.9.7" + "typescript": "^4.6.2" }, "publishConfig": { "access": "public",