@ruiapp/rapid-core 0.9.12 → 0.9.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -8201,13 +8201,14 @@ class ServerOperationPlugin {
8201
8201
  async configureRoutes(server, applicationConfig) {
8202
8202
  const routes = [];
8203
8203
  for (const operation of this.#operations) {
8204
+ const path = operation.path || `/app/${operation.code}`;
8204
8205
  routes.push({
8205
8206
  namespace: "app",
8206
8207
  name: `app.operations.${operation.code}`,
8207
8208
  code: `app.operations.${operation.code}`,
8208
8209
  type: "RESTful",
8209
8210
  method: operation.method,
8210
- endpoint: `/app/${operation.code}`,
8211
+ endpoint: path,
8211
8212
  actions: [
8212
8213
  {
8213
8214
  code: "runServerOperation",
@@ -5,6 +5,10 @@ export interface ServerOperation {
5
5
  code: string;
6
6
  description?: string;
7
7
  method: RpdHttpMethod;
8
+ /**
9
+ * 接口路径,默认值为 `/app/{code}`
10
+ */
11
+ path?: string;
8
12
  permissionCheck?: PermissionCheckPolicy;
9
13
  handler: (ctx: ActionHandlerContext) => Promise<void>;
10
14
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ruiapp/rapid-core",
3
- "version": "0.9.12",
3
+ "version": "0.9.13",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -62,13 +62,14 @@ class ServerOperationPlugin implements RapidPlugin {
62
62
  async configureRoutes(server: IRpdServer, applicationConfig: RpdApplicationConfig): Promise<any> {
63
63
  const routes: RpdRoute[] = [];
64
64
  for (const operation of this.#operations) {
65
+ const path = operation.path || `/app/${operation.code}`;
65
66
  routes.push({
66
67
  namespace: "app",
67
68
  name: `app.operations.${operation.code}`,
68
69
  code: `app.operations.${operation.code}`,
69
70
  type: "RESTful",
70
71
  method: operation.method,
71
- endpoint: `/app/${operation.code}`,
72
+ endpoint: path,
72
73
  actions: [
73
74
  {
74
75
  code: "runServerOperation",
@@ -6,6 +6,11 @@ export interface ServerOperation {
6
6
  code: string;
7
7
  description?: string;
8
8
  method: RpdHttpMethod;
9
+
10
+ /**
11
+ * 接口路径,默认值为 `/app/{code}`
12
+ */
13
+ path?: string;
9
14
  permissionCheck?: PermissionCheckPolicy;
10
15
  handler: (ctx: ActionHandlerContext) => Promise<void>;
11
16
  }