mushroom-cli 1.1.0-alpha.22 → 1.1.0-alpha.24

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/gen/gen-csharp.js CHANGED
@@ -910,21 +910,6 @@ namespace ${namespace}
910
910
  {
911
911
  ${collectionNames}
912
912
  public static IMongoDatabase GetDatabase() => Mushroom.MushroomDaoFactory.GetDbAdapter() as IMongoDatabase;
913
-
914
- public static async System.Threading.Tasks.Task<T> FindByIdAsync<T, TId>(this IMongoCollection<T> collection, TId id) where T : Mushroom.Models.IResource<TId>
915
- {
916
- return await (await collection.FindAsync(Builders<T>.Filter.Eq(doc => doc.Id, id))).FirstOrDefaultAsync();
917
- }
918
-
919
- public static async System.Threading.Tasks.Task<T> FindByIdAsync<T, TId>(this IMongoCollection<T> collection, TId id, FindOptions<T> findOptions) where T : Mushroom.Models.IResource<TId>
920
- {
921
- return await (await collection.FindAsync(Builders<T>.Filter.Eq(doc => doc.Id, id), findOptions)).FirstOrDefaultAsync();
922
- }
923
-
924
- public static async System.Threading.Tasks.Task<T> FindByIdAsync<T, TId>(this IMongoCollection<T> collection, TId id, ProjectionDefinition<T> projection) where T : Mushroom.Models.IResource<TId>
925
- {
926
- return await (await collection.FindAsync(Builders<T>.Filter.Eq(doc => doc.Id, id), new FindOptions<T> { Projection = projection })).FirstOrDefaultAsync();
927
- }
928
913
  }
929
914
  }
930
915
  `;
@@ -933,7 +918,7 @@ ${collectionNames}
933
918
 
934
919
  namespace ${namespace}
935
920
  {
936
- public class ResourceNames
921
+ public class ResourceNamess
937
922
  {
938
923
  private ResourceNames() { }
939
924
 
@@ -985,7 +970,8 @@ ${strJobReferences}
985
970
  #endif
986
971
  `;
987
972
 
988
- const infoFileContent = `// Mushroom CLI version: ${package.version}${newLine}// Compatible with Mushroom Server version: 0.2.18 or higher (https://www.nuget.org/packages/Mushroom/)`
973
+ const infoFileContent = `// Mushroom CLI version: ${package.version}${newLine}// Compatible with Mushroom Server version: 0.2.25.4 or higher (https://www.nuget.org/packages/Mushroom/)
974
+ // For Mushroom Server 0.2.18 to 0.2.25.4: Please remove all FindById methods in DbConnector.cs`
989
975
 
990
976
  fs.writeFileSync(aliasProject.output + "/DbConnector.cs", dbConnectorFileContent);
991
977
  fs.writeFileSync(aliasProject.output + "/ResourceNames.cs", resourceNamesFileContent);
@@ -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
 
@@ -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) {
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.22",
3
+ "version": "1.1.0-alpha.24",
4
4
  "description": "Mushroom CLI",
5
5
  "main": "mr.js",
6
6
  "scripts": {
@@ -17,8 +17,8 @@
17
17
  "author": "suco2007",
18
18
  "license": "ISC",
19
19
  "dependencies": {
20
- "jsdom": "^20.0.0",
21
- "json5": "^2.2.1",
20
+ "jsdom": "^21.0.0",
21
+ "json5": "^2.2.3",
22
22
  "node-fetch": "^2.6.7",
23
23
  "open": "^8.4.0",
24
24
  "readline-sync": "^1.4.10",