@simitgroup/simpleapp-generator 2.0.3-n-alpha → 2.0.3-o-alpha

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/ReleaseNote.md CHANGED
@@ -1,3 +1,6 @@
1
+ [2.0.3o-alpha]
2
+ 1. Fix mini app current action type
3
+
1
4
  [2.0.3n-alpha]
2
5
  1. Add hasRole checking in hasAccessByPageMeta
3
6
  2. Add type for Simple App Service
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@simitgroup/simpleapp-generator",
3
- "version": "2.0.3n-alpha",
3
+ "version": "2.0.3o-alpha",
4
4
  "description": "frontend nuxtjs and backend nests code generator using jsonschema.",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -38,6 +38,9 @@
38
38
  import { MiniAppApiListParam } from "../../types/bridge.type";
39
39
  import { MiniAppBridgeService } from "../bridge.service";
40
40
  import * as Schema from "../../openapi/backend-api";
41
+ <% if (miniAppWhitelistApis.current) { %>
42
+ import * as CustomSchema from "../../types/resources";
43
+ <% } %>
41
44
  import { CreateResource, PatchResource, UpdateResource } from "../../types/common";
42
45
 
43
46
  export class MiniApp<%= pascalName %>BridgeService {
@@ -89,7 +92,7 @@ export class MiniApp<%= pascalName %>BridgeService {
89
92
  }
90
93
  <% } else if(action === 'current') { %>
91
94
  async <%= action %>() {
92
- return this.bridge.callApi(this.resourceName, "<%= action %>");
95
+ return this.bridge.callApi<CustomSchema.Current<%= pascalName %>>(this.resourceName, "<%= action %>");
93
96
  }
94
97
  <% } else { %>
95
98
  <% const apiSetting = it.apiSettings.find(item => item.action === action); %>
@@ -24,7 +24,7 @@ export class MiniApp<%= pascalName %>BridgeEditableService extends MiniApp<%= pa
24
24
  <% if (value !== true && typeof value !== 'object') { return; } %>
25
25
 
26
26
  <% if(action === 'current') { %>
27
- protected override async handleCurrent(message: MiniAppBridgeMessageApi<<%= typeActionName %>>): Promise<any> {
27
+ protected override async handleCurrent(message: MiniAppBridgeMessageApi<<%= typeActionName %>>) {
28
28
  return {};
29
29
  }
30
30
  <% } %>
@@ -151,8 +151,8 @@ export class MiniApp<%= pascalName %>BridgeService {
151
151
  return (await this.api!.autoComplete(message.params.query ?? "", {})).data;
152
152
  }
153
153
  <% } else if(action === 'current') { %>
154
- protected async handleCurrent(message: MiniAppBridgeMessageApi<<%= typeActionName %>>) {
155
- return {};
154
+ protected async handleCurrent(message: MiniAppBridgeMessageApi<<%= typeActionName %>>): Promise<unknown> {
155
+ return null;
156
156
  }
157
157
  <% } else { %>
158
158
  protected async handle<%= upperFirstCase(action) %>(message: MiniAppBridgeMessageApi<<%= typeActionName %>>) {