mushroom-cli 1.1.0-alpha.21 → 1.1.0-alpha.23

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/docs/docs.html CHANGED
@@ -440,7 +440,7 @@
440
440
  Đơn giản
441
441
  <pre data-language="javascript">try {
442
442
  const response = await mushroom.<span data-mt-attr='{"text": "$entityName"}'></span>.listAsync();
443
- console.log("Các <span data-mt-attr='{"text": "$entityName"}'></span> thỏa mãn: %o, info: %o", response);
443
+ console.log("Các <span data-mt-attr='{"text": "$entityName"}'></span> thỏa mãn: %o", response);
444
444
  }
445
445
  catch (e) {
446
446
  console.error("Có lỗi: %o", e);
@@ -457,7 +457,7 @@ catch (e) {
457
457
  </span><span data-mt-cond='{"action.pagingType": "Page"}'> page: 1,
458
458
  </span><span data-mt-cond='{"entity.features.vn_text.fields.length": {"$gt": 0}}'> vn_text: "Chuỗi tìm kiếm", <span class="code-comment">// tìm kiếm tiếng Việt không dấu, không phân biệt hoa thường trên <span data-mt-cond='{"entity.features.vn_text.fields.length": {"$gt": 1}}'>các</span> trường: <span class="separated-items" data-mt-iterate='{"data": "$entity.features.vn_text.fields"}'><span data-mt-attr='{"text": "$this"}'></span><span class="separator">,</span></span></span>
459
459
  </span> });
460
- console.log("Các <span data-mt-attr='{"text": "$entityName"}'></span> thỏa mãn: %o, info: %o", response);
460
+ console.log("Các <span data-mt-attr='{"text": "$entityName"}'></span> thỏa mãn: %o", response);
461
461
  }
462
462
  catch (e) {
463
463
  console.error("Có lỗi: %o", e);
@@ -39,13 +39,13 @@ function genJavascriptDriverString(aliasProject, source) {
39
39
  extensionsImportLines.push('//import * as AuthExtension from "mushroomjs-auth";');
40
40
  extensionsImportLines.push('var AuthExtension = require("mushroomjs-auth");');
41
41
  extensionsExportLines.push('Auth: AuthExtension');
42
- extensionsCodeLines.push("AuthExtension.useAuth(AuthExtension.AuthLocalStorage);");
42
+ extensionsCodeLines.push("AuthExtension.useAuth(AuthExtension.AuthLocalStorage, mushroom_1.default);");
43
43
  }
44
44
  if (aliasProject.features.includes("file")) {
45
45
  extensionsImportLines.push('//import * as FileExtension from "mushroomjs-file";');
46
46
  extensionsImportLines.push('var FileExtension = require("mushroomjs-file");');
47
47
  extensionsExportLines.push('File: FileExtension');
48
- extensionsCodeLines.push("FileExtension.useFile();");
48
+ extensionsCodeLines.push("FileExtension.useFile(mushroom_1.default);");
49
49
  }
50
50
  }
51
51
 
@@ -80,7 +80,8 @@ exports.extensions = extensions;
80
80
  continue;
81
81
 
82
82
  actions[actionName] = {
83
- clientCache: (actionName === "findById" || actionName === "findMany") && isAllowCache(entity.actions[actionName], true) ? true : undefined
83
+ clientCache: (actionName === "findById" || actionName === "findMany") && isAllowCache(entity.actions[actionName], true) ? true : undefined,
84
+ includeTotal: actionName === "findMany" && entity.actions[actionName].some(a => a.includeTotal) ? true: undefined
84
85
  };
85
86
  }
86
87
 
@@ -114,13 +114,13 @@ function genTypescriptDriverString(aliasProject, source) {
114
114
  extensionsImportLines.push('import * as AuthExtension from "mushroomjs-auth";');
115
115
  extensionsExportLines.push('File: FileExtension');
116
116
  extensionsTypes.push("AuthExtension.IMushroomAuth & ");
117
- extensionsCodeLines.push("AuthExtension.useAuth(AuthExtension.AuthLocalStorage);");
117
+ extensionsCodeLines.push("AuthExtension.useAuth(AuthExtension.AuthLocalStorage, mushroom);");
118
118
  }
119
119
  if (aliasProject.features.includes("file")) {
120
120
  extensionsImportLines.push('import * as FileExtension from "mushroomjs-file";');
121
121
  extensionsExportLines.push('Auth: AuthExtension');
122
122
  extensionsTypes.push("FileExtension.IMushroomFile & ");
123
- extensionsCodeLines.push("FileExtension.useFile();");
123
+ extensionsCodeLines.push("FileExtension.useFile(mushroom);");
124
124
  }
125
125
  }
126
126
 
@@ -154,7 +154,8 @@ export type IdValue = ${source.idType == "AutoIncInt" || source.idType == "AutoI
154
154
  continue;
155
155
 
156
156
  actions[actionName] = {
157
- clientCache: (actionName === "findById" || actionName === "findMany") && isAllowCache(entity.actions[actionName], true) ? true : undefined
157
+ clientCache: (actionName === "findById" || actionName === "findMany") && isAllowCache(entity.actions[actionName], true) ? true : undefined,
158
+ includeTotal: actionName === "findMany" && entity.actions[actionName].some(a => a.includeTotal) ? true: undefined
158
159
  };
159
160
 
160
161
  switch (actionName) {
@@ -41,9 +41,9 @@ function transformViewNode(view) {
41
41
 
42
42
  function mergeApiProject(totalProject, fragmentProject, options) {
43
43
  if (totalProject.name != null && fragmentProject.name != null && fragmentProject.name != totalProject.name)
44
- throw new Error(`Unable merge project '${fragmentProject.name}' into '${totalProject.name}`);
44
+ throw new Error(`Unable merge project '${fragmentProject.name}' into '${totalProject.name}'`);
45
45
  if (totalProject.version != null && fragmentProject.version != null && fragmentProject.version != totalProject.version)
46
- throw new Error(`Unable merge project '${fragmentProject.version}' into '${totalProject.version}`);
46
+ throw new Error(`Unable merge project '${fragmentProject.version}' into '${totalProject.version}'`);
47
47
 
48
48
  if (fragmentProject.environmentVariables != null) {
49
49
  totalProject.environmentVariables = totalProject.environmentVariables || {};
package/mr.js CHANGED
@@ -66,7 +66,7 @@ async function run(args) {
66
66
  try {
67
67
  var data = await checkUpdateTask;
68
68
  if (data["dist-tags"] && data["dist-tags"][currentDistTag] && data["dist-tags"][currentDistTag] !== pkg.version) {
69
- console.warn(`YOUR mushroom-cli VERSION IS NOT LATEST (dist-tags: ${currentDistTag}). PLEASE RUN: npm i mushroom-cli@${data["dist-tags"][currentDistTag]}`);
69
+ console.warn(`YOUR mushroom-cli VERSION IS NOT LATEST (dist-tags: ${currentDistTag}). PLEASE RUN: npm i mushroom-cli@${data["dist-tags"][currentDistTag]} OR yarn add mushroom-cli@^${data["dist-tags"][currentDistTag]}`);
70
70
  }
71
71
  }
72
72
  catch(e) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mushroom-cli",
3
- "version": "1.1.0-alpha.21",
3
+ "version": "1.1.0-alpha.23",
4
4
  "description": "Mushroom CLI",
5
5
  "main": "mr.js",
6
6
  "scripts": {