mushroom-cli 1.2.1 → 1.2.3

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/README.md CHANGED
@@ -132,12 +132,24 @@ npx mushroom-cli parameters --no-check-update
132
132
 
133
133
  ## Version
134
134
 
135
+ ### 1.2.3
136
+
137
+ Improvement
138
+
139
+ - gen ts-driver: separate `import` and `import type` when import mushroomjs
140
+
141
+ ### 1.2.2
142
+
143
+ New features:
144
+
145
+ - gen ts-driver, js-driver: adding binaryResponse to `_raw_http_method_` actions
146
+
135
147
  ### 1.2.1
136
148
 
137
149
  Improvement/Changes:
138
150
 
139
- - gen-docs: fix bugs
140
- - gen-csharp: fix signarute for RegisterCustomViewMethod method
151
+ - gen docs: fix bugs
152
+ - gen c#-mongo: fix signature for RegisterCustomViewMethod method
141
153
  - init netcore:
142
154
  - change: show warning message when replacing content in unexisting file (instead of throwing error)
143
155
 
@@ -147,9 +159,9 @@ New features:
147
159
 
148
160
  - Support merge command
149
161
  - Support type for View result
150
- - gen-ts-driver: Support offline mode
162
+ - gen ts-driver: Support offline mode
151
163
  - init netcore: Support some new set-functions: `ToLowerCase`, `ToUpperCase`, `Trim`, `Replace`, `New-RandomNumber`, `New-RandomString`
152
- - gen-docs: New gen docs engine v1.2 - deal with very big api docs
164
+ - gen docs: New gen docs engine v1.2 - deal with very big api docs
153
165
  - support minify
154
166
  - allow user to add and change API root url
155
167
  - add `JavascriptParamModel`, `JavascriptRequestBodyModel`, `JavascriptResultModel` tab in code snippets of custom methods
@@ -192,7 +204,7 @@ Fixed bugs:
192
204
  - gen docs
193
205
  - Generate wrong required field for view parameter
194
206
  - doesn't exclude fields of object in an array
195
- - gen-ts
207
+ - gen ts-driver
196
208
  - add null value for nullable field type
197
209
 
198
210
  ### 1.1.1
@@ -66,6 +66,7 @@ exports.extensions = extensions;
66
66
  let clientCache = undefined;
67
67
  let includeTotal = undefined;
68
68
  let offlineMode = undefined;
69
+ let binaryResponse = undefined;
69
70
  if ((actionName === 'findById' || actionName === 'findMany') && entity.actions[actionName]) {
70
71
  if (isAllowCache(entity.actions[actionName], true))
71
72
  clientCache = true;
@@ -77,10 +78,16 @@ exports.extensions = extensions;
77
78
  entity.actions[actionName].some((a) => a.offlineMode === 'allow'))
78
79
  offlineMode = 'allow';
79
80
  }
81
+ else if (actionName.indexOf('_raw_http_method_') === 0) {
82
+ if (entity.actions[actionName]?.some((action) => action.codeHint?.delegator?.isBinaryResponse)) {
83
+ binaryResponse = true;
84
+ }
85
+ }
80
86
  actions[actionName] = {
81
87
  clientCache,
82
88
  includeTotal,
83
89
  offlineMode,
90
+ binaryResponse,
84
91
  };
85
92
  }
86
93
  const views = {};
@@ -259,7 +259,8 @@ export function genTypescriptDriverString(aliasProject, source) {
259
259
  extensionsCodeLines.push('FileExtension.useFile(mushroom);');
260
260
  }
261
261
  }
262
- let code = `import mushroom, { defineAsyncResource, defineAsyncView, fireEvent, createRestfulAsyncFunction, IdType, IMushroom, Mushroom, MushroomRequest, MushroomRequestSetting, MushroomRestfulRequest, MushroomResponse, MushroomResponseDataType, MushroomResourceBase, MushroomListResource, MushroomCountResource, MushroomFindByIdResource, MushroomCreateResource, MushroomBatchCreateResource, MushroomUpdateResource, MushroomBatchUpdateResource, MushroomPartialUpdateResource, MushroomDeleteResource, MushroomBatchDeleteResource, MushroomExtensibleResource, MushroomViewFunction, MushroomError, IMushroomOfflineResponse, MushroomOfflineResponse, MushroomOfflineResponseState } from "mushroomjs";
262
+ let code = `import mushroom, { defineAsyncResource, defineAsyncView, fireEvent, createRestfulAsyncFunction, Mushroom, MushroomError } from "mushroomjs";
263
+ import type { IdType, IMushroom, MushroomRequest, MushroomRequestSetting, MushroomRestfulRequest, MushroomResponse, MushroomResponseDataType, MushroomResourceBase, MushroomListResource, MushroomCountResource, MushroomFindByIdResource, MushroomCreateResource, MushroomBatchCreateResource, MushroomUpdateResource, MushroomBatchUpdateResource, MushroomPartialUpdateResource, MushroomDeleteResource, MushroomBatchDeleteResource, MushroomExtensibleResource, MushroomViewFunction, IMushroomOfflineResponse, MushroomOfflineResponse, MushroomOfflineResponseState } from "mushroomjs";
263
264
  ${extensionsImportLines.join('\n')}
264
265
  export * from "mushroomjs";
265
266
  export const extensions = {
@@ -356,6 +357,9 @@ export interface CustomMethodBodyRequest<TBody> extends MushroomRequest {
356
357
  const customCode = generateCustomMethodCode(entityName, actionName, entity.actions[actionName]);
357
358
  customMethodCode += customCode.methodCode;
358
359
  code += customCode.classesCode;
360
+ if (entity.actions[actionName]?.some((action) => action.codeHint?.delegator?.isBinaryResponse)) {
361
+ actions[actionName].binaryResponse = true;
362
+ }
359
363
  break;
360
364
  }
361
365
  else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mushroom-cli",
3
- "version": "1.2.1",
3
+ "version": "1.2.3",
4
4
  "description": "Mushroom CLI",
5
5
  "main": "dist/mr.js",
6
6
  "type": "module",
@@ -33,30 +33,30 @@
33
33
  "author": "suco2007",
34
34
  "license": "ISC",
35
35
  "dependencies": {
36
- "jsdom": "^26.1.0",
36
+ "jsdom": "^27.4.0",
37
37
  "json5": "^2.2.3",
38
- "minify": "^14.0.0",
38
+ "minify": "^14.1.0",
39
39
  "node-fetch": "^3.3.2",
40
- "open": "^10.1.2",
40
+ "open": "^11.0.0",
41
41
  "readline-sync": "^1.4.10",
42
42
  "targz": "^1.0.1"
43
43
  },
44
44
  "devDependencies": {
45
- "@eslint/js": "^9.34.0",
46
- "@types/jsdom": "^21.1.7",
45
+ "@eslint/js": "^9.39.2",
46
+ "@types/jsdom": "^27.0.0",
47
47
  "@types/minify": "^9.1.4",
48
48
  "@types/node": "^22.15.29",
49
49
  "@types/node-fetch": "^2.6.13",
50
50
  "@types/readline-sync": "^1.4.8",
51
51
  "@types/targz": "^1.0.5",
52
52
  "copyfiles": "^2.4.1",
53
- "eslint": "^9.34.0",
53
+ "eslint": "^9.39.2",
54
54
  "husky": "^9.1.7",
55
- "lint-staged": "^16.1.0",
56
- "only-allow": "^1.2.1",
57
- "prettier": "^3.5.3",
58
- "typescript": "^5.8.3",
59
- "typescript-eslint": "^8.41.0"
55
+ "lint-staged": "^16.2.7",
56
+ "only-allow": "^1.2.2",
57
+ "prettier": "^3.7.4",
58
+ "typescript": "^5.9.3",
59
+ "typescript-eslint": "^8.51.0"
60
60
  },
61
61
  "engines": {
62
62
  "node": ">=14.0.0"