diff --git a/.apiforgerc b/.apiforgerc new file mode 100644 index 000000000..cf6e47ba4 --- /dev/null +++ b/.apiforgerc @@ -0,0 +1,36 @@ +{ + "client": { + "sqle-ui": { + "project": "sqle-ui", + "output": "packages/shared/lib/api/sqle/service", + "branch": "main", + "swaggerPath": "", + "swaggerOutput": "", + "plugin": "dot-remove", + "template": "complex" + }, + "dms-ui": { + "project": "dms-ui", + "output": "packages/shared/lib/api/base/service", + "branch": "main", + "swaggerPath": "", + "swaggerOutput": "", + "plugin": "simple-cleaner", + "template": "complex" + } + }, + "mocks": { + "packages/shared/lib/api/sqle/service": { + "clientPath": "packages/shared/lib/api/sqle/service", + "output": "packages/sqle/src/testUtils/mockApi", + "utilsAlias": "@actiontech/shared/lib/testUtil/mockApi", + "serviceAlias": "@actiontech/shared/lib/api/sqle/service" + }, + "packages/shared/lib/api/base/service": { + "clientPath": "packages/shared/lib/api/base/service", + "output": "packages/base/src/testUtils/mockApi", + "utilsAlias": "@actiontech/shared/lib/testUtil/mockApi", + "serviceAlias": "@actiontech/shared/lib/api/base/service" + } + } +} \ No newline at end of file diff --git a/.apigeneratorrc b/.apigeneratorrc deleted file mode 100644 index fda007cd1..000000000 --- a/.apigeneratorrc +++ /dev/null @@ -1,20 +0,0 @@ -[ - { - "project": "sqle-ui", - "output": "packages/shared/lib/api/sqle/service", - "branch": "main", - "swaggerPath": "", - "swaggerOutput": "", - "plugin": "dot-remove", - "template": "complex" - }, - { - "project": "dms-ui", - "output": "packages/shared/lib/api/base/service", - "branch": "main", - "swaggerPath": "", - "swaggerOutput": "", - "plugin": "simple-cleaner", - "template": "complex" - } -] \ No newline at end of file diff --git a/package.json b/package.json index 1ebc53991..83a166aee 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,8 @@ "icon:docs:build": "pnpm --filter @actiontech/icons docs:build", "icon:build": "pnpm --filter @actiontech/icons build", "dms:g": "pnpm --filter @actiontech/cli-create-dms-page build && create-dms-page", - "api:g": "sh ./scripts/api/gen_api.sh" + "api_client:g": "sh ./scripts/api/gen_api.sh", + "api_mocks:g": "npm_config_registry=http://10.186.18.19:4873 pnpx @actiontech/cli api-mocks -y" }, "keywords": [], "author": "", diff --git a/scripts/api/gen_api.sh b/scripts/api/gen_api.sh index 08b5ef757..b50cd46c9 100644 --- a/scripts/api/gen_api.sh +++ b/scripts/api/gen_api.sh @@ -1,3 +1,3 @@ #!/bin/sh -npm_config_registry=http://10.186.18.19:4873 pnpx @actiontech/cli api-gen -y "$@" && pnpm --filter @actiontech/shared api:exports:g +npm_config_registry=http://10.186.18.19:4873 pnpx @actiontech/cli api-client -y "$@" && pnpm --filter @actiontech/shared api:exports:g