@rxap/schematic-nestjs 0.1.0-dev.2 → 0.1.0-dev.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.
Files changed (82) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +1 -1
  3. package/package.json +21 -21
  4. package/src/index.js +2 -1
  5. package/src/schematics/crud/index.js +18 -14
  6. package/src/schematics/crud/index.js.map +1 -1
  7. package/src/schematics/crud/schema.js +2 -1
  8. package/src/schematics/crud-init/index.js +10 -7
  9. package/src/schematics/crud-init/index.js.map +1 -1
  10. package/src/schematics/crud-init/schema.js +2 -1
  11. package/src/schematics/crud-service/add-module-export.js +13 -8
  12. package/src/schematics/crud-service/add-module-export.js.map +1 -1
  13. package/src/schematics/crud-service/add-module-provider.js +13 -8
  14. package/src/schematics/crud-service/add-module-provider.js.map +1 -1
  15. package/src/schematics/crud-service/coerce-class-method.js +6 -5
  16. package/src/schematics/crud-service/coerce-class-method.js.map +1 -1
  17. package/src/schematics/crud-service/coerce-class-property.js +6 -5
  18. package/src/schematics/crud-service/coerce-class-property.js.map +1 -1
  19. package/src/schematics/crud-service/coerce-collection-enum.js +13 -7
  20. package/src/schematics/crud-service/coerce-collection-enum.js.map +1 -1
  21. package/src/schematics/crud-service/coerce-module-class.js +9 -5
  22. package/src/schematics/crud-service/coerce-module-class.js.map +1 -1
  23. package/src/schematics/crud-service/coerce-source-file-rule.js +7 -3
  24. package/src/schematics/crud-service/coerce-source-file-rule.js.map +1 -1
  25. package/src/schematics/crud-service/crud-class/create-method.js +14 -10
  26. package/src/schematics/crud-service/crud-class/create-method.js.map +1 -1
  27. package/src/schematics/crud-service/crud-class/delete-method.js +13 -9
  28. package/src/schematics/crud-service/crud-class/delete-method.js.map +1 -1
  29. package/src/schematics/crud-service/crud-class/exists-method.js +13 -9
  30. package/src/schematics/crud-service/crud-class/exists-method.js.map +1 -1
  31. package/src/schematics/crud-service/crud-class/find-in-group-method.js +9 -5
  32. package/src/schematics/crud-service/crud-class/find-in-group-method.js.map +1 -1
  33. package/src/schematics/crud-service/crud-class/find-method.js +13 -9
  34. package/src/schematics/crud-service/crud-class/find-method.js.map +1 -1
  35. package/src/schematics/crud-service/crud-class/get-method.js +13 -9
  36. package/src/schematics/crud-service/crud-class/get-method.js.map +1 -1
  37. package/src/schematics/crud-service/crud-class/update-field-method.js +14 -10
  38. package/src/schematics/crud-service/crud-class/update-field-method.js.map +1 -1
  39. package/src/schematics/crud-service/crud-class/update-method.js +14 -10
  40. package/src/schematics/crud-service/crud-class/update-method.js.map +1 -1
  41. package/src/schematics/crud-service/crud-class.js +26 -22
  42. package/src/schematics/crud-service/crud-class.js.map +1 -1
  43. package/src/schematics/crud-service/dto-class/create-dto-class.js +9 -5
  44. package/src/schematics/crud-service/dto-class/create-dto-class.js.map +1 -1
  45. package/src/schematics/crud-service/dto-class/dto-class.js +25 -21
  46. package/src/schematics/crud-service/dto-class/dto-class.js.map +1 -1
  47. package/src/schematics/crud-service/dto-class/update-dto-class.js +9 -5
  48. package/src/schematics/crud-service/dto-class/update-dto-class.js.map +1 -1
  49. package/src/schematics/crud-service/index.js +70 -65
  50. package/src/schematics/crud-service/index.js.map +1 -1
  51. package/src/schematics/crud-service/options.js +2 -1
  52. package/src/schematics/crud-service/schema.js +2 -1
  53. package/src/schematics/feature-microservice/index.js +30 -24
  54. package/src/schematics/feature-microservice/index.js.map +1 -1
  55. package/src/schematics/frontend-microservice/index.js +29 -23
  56. package/src/schematics/frontend-microservice/index.js.map +1 -1
  57. package/src/schematics/health-indicator/add-health-endpoint.js +12 -8
  58. package/src/schematics/health-indicator/add-health-endpoint.js.map +1 -1
  59. package/src/schematics/health-indicator/add-health-indicator.js +14 -10
  60. package/src/schematics/health-indicator/add-health-indicator.js.map +1 -1
  61. package/src/schematics/health-indicator/add-to-global-health-endpoint.js +14 -9
  62. package/src/schematics/health-indicator/add-to-global-health-endpoint.js.map +1 -1
  63. package/src/schematics/health-indicator/coerce-health-controller.js +12 -8
  64. package/src/schematics/health-indicator/coerce-health-controller.js.map +1 -1
  65. package/src/schematics/health-indicator/coerce-health-module.js +14 -10
  66. package/src/schematics/health-indicator/coerce-health-module.js.map +1 -1
  67. package/src/schematics/health-indicator/index.js +21 -18
  68. package/src/schematics/health-indicator/index.js.map +1 -1
  69. package/src/schematics/health-indicator-init/index.js +15 -12
  70. package/src/schematics/health-indicator-init/index.js.map +1 -1
  71. package/src/schematics/init/index.js +127 -112
  72. package/src/schematics/init/index.js.map +1 -1
  73. package/src/schematics/jwt/index.js +17 -14
  74. package/src/schematics/jwt/index.js.map +1 -1
  75. package/src/schematics/microservice/index.js +41 -35
  76. package/src/schematics/microservice/index.js.map +1 -1
  77. package/src/schematics/open-api/index.js +15 -12
  78. package/src/schematics/open-api/index.js.map +1 -1
  79. package/src/schematics/sentry/index.js +30 -25
  80. package/src/schematics/sentry/index.js.map +1 -1
  81. package/src/schematics/validator/index.js +10 -7
  82. package/src/schematics/validator/index.js.map +1 -1
@@ -1,15 +1,18 @@
1
- import { underscore } from '@angular-devkit/core/src/utils/strings';
2
- import { camelize } from '@rxap/schematics-utilities';
3
- import { Scope, } from 'ts-morph';
4
- export function ExistsMethod(options, className) {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ExistsMethod = void 0;
4
+ const strings_1 = require("@angular-devkit/core/src/utils/strings");
5
+ const schematics_utilities_1 = require("@rxap/schematics-utilities");
6
+ const ts_morph_1 = require("ts-morph");
7
+ function ExistsMethod(options, className) {
5
8
  const { dtoName, documentId, collection, parentCollectionList } = options;
6
9
  return {
7
10
  name: 'exists',
8
- scope: Scope.Public,
11
+ scope: ts_morph_1.Scope.Public,
9
12
  isAsync: true,
10
13
  parameters: [
11
14
  ...parentCollectionList.map(collection => ({
12
- name: `${camelize(collection)}Id`,
15
+ name: `${(0, schematics_utilities_1.camelize)(collection)}Id`,
13
16
  type: 'string',
14
17
  })),
15
18
  {
@@ -23,10 +26,10 @@ export function ExistsMethod(options, className) {
23
26
  writer => {
24
27
  writer.write(`const snapshot = await this.firestore`);
25
28
  for (const subCollection of parentCollectionList) {
26
- writer.writeLine(`.collection(Collection.${underscore(subCollection).toUpperCase()})`);
27
- writer.writeLine(`.doc(${camelize(subCollection)}Id)`);
29
+ writer.writeLine(`.collection(Collection.${(0, strings_1.underscore)(subCollection).toUpperCase()})`);
30
+ writer.writeLine(`.doc(${(0, schematics_utilities_1.camelize)(subCollection)}Id)`);
28
31
  }
29
- writer.writeLine(`.collection(Collection.${underscore(collection).toUpperCase()})`);
32
+ writer.writeLine(`.collection(Collection.${(0, strings_1.underscore)(collection).toUpperCase()})`);
30
33
  writer.writeLine(`.doc(${documentId})`);
31
34
  if (options.privateName) {
32
35
  writer.writeLine(`.collection(Collection.PRIVATE)`);
@@ -39,4 +42,5 @@ export function ExistsMethod(options, className) {
39
42
  ],
40
43
  };
41
44
  }
45
+ exports.ExistsMethod = ExistsMethod;
42
46
  //# sourceMappingURL=exists-method.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"exists-method.js","sourceRoot":"","sources":["../../../../../../../../packages/schematic/nestjs/src/schematics/crud-service/crud-class/exists-method.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,EAGL,KAAK,GACN,MAAM,UAAU,CAAC;AAGlB,MAAM,UAAU,YAAY,CAAC,OAAgB,EAAE,SAAiB;IAC9D,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,oBAAoB,EAAE,GAAG,OAAO,CAAC;IAC1E,OAAO;QACL,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,KAAK,CAAC,MAAM;QACnB,OAAO,EAAE,IAAI;QACb,UAAU,EAAE;YACV,GAAG,oBAAoB,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;gBACzC,IAAI,EAAE,GAAI,QAAQ,CAAC,UAAU,CAAE,IAAI;gBACnC,IAAI,EAAE,QAAQ;aACf,CAAC,CAAC;YACH;gBACE,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,QAAQ;aACf;SACF;QACD,UAAU,EAAE,WAAY,OAAQ,GAAG;QACnC,UAAU,EAAE;YACV,oCAAqC,UAAW,MAAO,SAAU,IAAI;YACrE,MAAM,CAAC,EAAE;gBACP,MAAM,CAAC,KAAK,CAAC,uCAAuC,CAAC,CAAC;gBACtD,KAAK,MAAM,aAAa,IAAI,oBAAoB,EAAE;oBAChD,MAAM,CAAC,SAAS,CAAC,0BAA2B,UAAU,CAAC,aAAa,CAAC,CAAC,WAAW,EAAG,GAAG,CAAC,CAAC;oBACzF,MAAM,CAAC,SAAS,CAAC,QAAS,QAAQ,CAAC,aAAa,CAAE,KAAK,CAAC,CAAC;iBAC1D;gBACD,MAAM,CAAC,SAAS,CAAC,0BAA2B,UAAU,CAAC,UAAU,CAAC,CAAC,WAAW,EAAG,GAAG,CAAC,CAAC;gBACtF,MAAM,CAAC,SAAS,CAAC,QAAS,UAAW,GAAG,CAAC,CAAC;gBAC1C,IAAI,OAAO,CAAC,WAAW,EAAE;oBACvB,MAAM,CAAC,SAAS,CAAC,iCAAiC,CAAC,CAAC;oBACpD,MAAM,CAAC,SAAS,CAAC,SAAU,OAAO,CAAC,WAAY,IAAI,CAAC,CAAC;iBACtD;gBACD,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;gBAC3B,MAAM,CAAC,SAAS,CAAC,6CAA6C,CAAC,CAAC;gBAChE,MAAM,CAAC,SAAS,CAAC,wBAAwB,CAAC,CAAC;YAC7C,CAAC;SACF;KACF,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"exists-method.js","sourceRoot":"","sources":["../../../../../../../../packages/schematic/nestjs/src/schematics/crud-service/crud-class/exists-method.ts"],"names":[],"mappings":";;;AAAA,oEAAoE;AACpE,qEAAsD;AACtD,uCAIkB;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C;iBACtD;gBACD,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;gBAC3B,MAAM,CAAC,SAAS,CAAC,6CAA6C,CAAC,CAAC;gBAChE,MAAM,CAAC,SAAS,CAAC,wBAAwB,CAAC,CAAC;YAC7C,CAAC;SACF;KACF,CAAC;AACJ,CAAC;AArCD,oCAqCC"}
@@ -1,10 +1,13 @@
1
- import { underscore } from '@angular-devkit/core/src/utils/strings';
2
- import { Scope, } from 'ts-morph';
3
- export function FindInGroupMethod(options, className) {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FindInGroupMethod = void 0;
4
+ const strings_1 = require("@angular-devkit/core/src/utils/strings");
5
+ const ts_morph_1 = require("ts-morph");
6
+ function FindInGroupMethod(options, className) {
4
7
  const { dtoName, camelized, collection, parentCollectionList } = options;
5
8
  return {
6
9
  name: 'findInGroup',
7
- scope: Scope.Public,
10
+ scope: ts_morph_1.Scope.Public,
8
11
  isAsync: true,
9
12
  parameters: [
10
13
  {
@@ -18,7 +21,7 @@ export function FindInGroupMethod(options, className) {
18
21
  `this.logger.verbose('findInGroup', '${className}')`,
19
22
  writer => {
20
23
  writer.write(`const ref = this.firestore`);
21
- writer.writeLine(`.collectionGroup(Collection.${underscore(collection).toUpperCase()});`);
24
+ writer.writeLine(`.collectionGroup(Collection.${(0, strings_1.underscore)(collection).toUpperCase()});`);
22
25
  writer.write(`const querySnapshot = await query(ref)`);
23
26
  writer.writeLine('.get()');
24
27
  writer.writeLine('.catch(FirestoreErrorHandler<QuerySnapshot>(this.logger));');
@@ -30,4 +33,5 @@ export function FindInGroupMethod(options, className) {
30
33
  ],
31
34
  };
32
35
  }
36
+ exports.FindInGroupMethod = FindInGroupMethod;
33
37
  //# sourceMappingURL=find-in-group-method.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"find-in-group-method.js","sourceRoot":"","sources":["../../../../../../../../packages/schematic/nestjs/src/schematics/crud-service/crud-class/find-in-group-method.ts"],"names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Root":"","sources":["../../../../../../../../packages/schematic/nestjs/src/schematics/crud-service/crud-class/find-in-group-method.ts"],"names":[],"mappings":";;;AAAA,oEAAoE;AACpE,uCAIkB;AAGlB,SAAgB,iBAAiB,CAAC,OAAgB,EAAE,SAAiB;IACnE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,oBAAoB,EAAE,GAAG,OAAO,CAAC;IACzE,OAAO;QACL,IAAI,EAAE,aAAa;QACnB,KAAK,EAAE,gBAAK,CAAC,MAAM;QACnB,OAAO,EAAE,IAAI;QACb,UAAU,EAAE;YACV;gBACE,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,4BAA4B;gBAClC,WAAW,EAAE,gBAAgB;aAC9B;SACF;QACD,UAAU,EAAE,WAAY,OAAQ,KAAK;QACrC,UAAU,EAAE;YACV,uCAAwC,SAAU,IAAI;YACtD,MAAM,CAAC,EAAE;gBACP,MAAM,CAAC,KAAK,CAAC,4BAA4B,CAAC,CAAC;gBAC3C,MAAM,CAAC,SAAS,CAAC,+BAAgC,IAAA,oBAAU,EAAC,UAAU,CAAC,CAAC,WAAW,EAAG,IAAI,CAAC,CAAC;gBAC5F,MAAM,CAAC,KAAK,CAAC,wCAAwC,CAAC,CAAC;gBACvD,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;gBAC3B,MAAM,CAAC,SAAS,CAAC,4DAA4D,CAAC,CAAC;gBAC/E,MAAM,CAAC,SAAS,CAAC,SAAU,SAAU,uBAAwB,OAAQ,uEAAuE,CAAC,CAAC;gBAC9I,MAAM,CAAC,SAAS,CAAC,kBAAmB,SAAU,YAAa,SAAU,oBAAqB,SAAU,mDAAmD,CAAC,CAAC;gBACzJ,MAAM,CAAC,SAAS,CAAC,sEAAsE,CAAC,CAAC;gBACzF,MAAM,CAAC,KAAK,CAAC,UAAW,SAAU,OAAO,CAAC,CAAC;YAC7C,CAAC;SACF;KACF,CAAC;AACJ,CAAC;AA7BD,8CA6BC"}
@@ -1,15 +1,18 @@
1
- import { underscore } from '@angular-devkit/core/src/utils/strings';
2
- import { camelize } from '@rxap/schematics-utilities';
3
- import { Scope, } from 'ts-morph';
4
- export function FindMethod(options, className) {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FindMethod = void 0;
4
+ const strings_1 = require("@angular-devkit/core/src/utils/strings");
5
+ const schematics_utilities_1 = require("@rxap/schematics-utilities");
6
+ const ts_morph_1 = require("ts-morph");
7
+ function FindMethod(options, className) {
5
8
  const { dtoName, camelized, collection, parentCollectionList } = options;
6
9
  return {
7
10
  name: 'find',
8
- scope: Scope.Public,
11
+ scope: ts_morph_1.Scope.Public,
9
12
  isAsync: true,
10
13
  parameters: [
11
14
  ...parentCollectionList.map(collection => ({
12
- name: `${camelize(collection)}Id`,
15
+ name: `${(0, schematics_utilities_1.camelize)(collection)}Id`,
13
16
  type: 'string',
14
17
  })),
15
18
  {
@@ -24,10 +27,10 @@ export function FindMethod(options, className) {
24
27
  writer => {
25
28
  writer.write(`const ref = this.firestore`);
26
29
  for (const subCollection of parentCollectionList) {
27
- writer.writeLine(`.collection(Collection.${underscore(subCollection).toUpperCase()})`);
28
- writer.writeLine(`.doc(${camelize(subCollection)}Id)`);
30
+ writer.writeLine(`.collection(Collection.${(0, strings_1.underscore)(subCollection).toUpperCase()})`);
31
+ writer.writeLine(`.doc(${(0, schematics_utilities_1.camelize)(subCollection)}Id)`);
29
32
  }
30
- writer.writeLine(`.collection(Collection.${underscore(collection).toUpperCase()});`);
33
+ writer.writeLine(`.collection(Collection.${(0, strings_1.underscore)(collection).toUpperCase()});`);
31
34
  writer.write(`const querySnapshot = await query(ref)`);
32
35
  writer.writeLine('.get()');
33
36
  writer.writeLine('.catch(FirestoreErrorHandler<QuerySnapshot>(this.logger));');
@@ -39,4 +42,5 @@ export function FindMethod(options, className) {
39
42
  ],
40
43
  };
41
44
  }
45
+ exports.FindMethod = FindMethod;
42
46
  //# sourceMappingURL=find-method.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"find-method.js","sourceRoot":"","sources":["../../../../../../../../packages/schematic/nestjs/src/schematics/crud-service/crud-class/find-method.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,EAGL,KAAK,GACN,MAAM,UAAU,CAAC;AAGlB,MAAM,UAAU,UAAU,CAAC,OAAgB,EAAE,SAAiB;IAC5D,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,oBAAoB,EAAE,GAAG,OAAO,CAAC;IACzE,OAAO;QACL,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,KAAK,CAAC,MAAM;QACnB,OAAO,EAAE,IAAI;QACb,UAAU,EAAE;YACV,GAAG,oBAAoB,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;gBACzC,IAAI,EAAE,GAAI,QAAQ,CAAC,UAAU,CAAE,IAAI;gBACnC,IAAI,EAAE,QAAQ;aACf,CAAC,CAAC;YACH;gBACE,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,4BAA4B;gBAClC,WAAW,EAAE,gBAAgB;aAC9B;SACF;QACD,UAAU,EAAE,WAAY,OAAQ,KAAK;QACrC,UAAU,EAAE;YACV,gCAAiC,SAAU,IAAI;YAC/C,MAAM,CAAC,EAAE;gBACP,MAAM,CAAC,KAAK,CAAC,4BAA4B,CAAC,CAAC;gBAC3C,KAAK,MAAM,aAAa,IAAI,oBAAoB,EAAE;oBAChD,MAAM,CAAC,SAAS,CAAC,0BAA2B,UAAU,CAAC,aAAa,CAAC,CAAC,WAAW,EAAG,GAAG,CAAC,CAAC;oBACzF,MAAM,CAAC,SAAS,CAAC,QAAS,QAAQ,CAAC,aAAa,CAAE,KAAK,CAAC,CAAC;iBAC1D;gBACD,MAAM,CAAC,SAAS,CAAC,0BAA2B,UAAU,CAAC,UAAU,CAAC,CAAC,WAAW,EAAG,IAAI,CAAC,CAAC;gBACvF,MAAM,CAAC,KAAK,CAAC,wCAAwC,CAAC,CAAC;gBACvD,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;gBAC3B,MAAM,CAAC,SAAS,CAAC,4DAA4D,CAAC,CAAC;gBAC/E,MAAM,CAAC,SAAS,CAAC,SAAU,SAAU,uBAAwB,OAAQ,uEAAuE,CAAC,CAAC;gBAC9I,MAAM,CAAC,SAAS,CAAC,kBAAmB,SAAU,YAAa,SAAU,oBAAqB,SAAU,mDAAmD,CAAC,CAAC;gBACzJ,MAAM,CAAC,SAAS,CAAC,sEAAsE,CAAC,CAAC;gBACzF,MAAM,CAAC,KAAK,CAAC,UAAW,SAAU,OAAO,CAAC,CAAC;YAC7C,CAAC;SACF;KACF,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"find-method.js","sourceRoot":"","sources":["../../../../../../../../packages/schematic/nestjs/src/schematics/crud-service/crud-class/find-method.ts"],"names":[],"mappings":";;;AAAA,oEAAoE;AACpE,qEAAsD;AACtD,uCAIkB;AAGlB,SAAgB,UAAU,CAAC,OAAgB,EAAE,SAAiB;IAC5D,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,oBAAoB,EAAE,GAAG,OAAO,CAAC;IACzE,OAAO;QACL,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,gBAAK,CAAC,MAAM;QACnB,OAAO,EAAE,IAAI;QACb,UAAU,EAAE;YACV,GAAG,oBAAoB,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;gBACzC,IAAI,EAAE,GAAI,IAAA,+BAAQ,EAAC,UAAU,CAAE,IAAI;gBACnC,IAAI,EAAE,QAAQ;aACf,CAAC,CAAC;YACH;gBACE,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,4BAA4B;gBAClC,WAAW,EAAE,gBAAgB;aAC9B;SACF;QACD,UAAU,EAAE,WAAY,OAAQ,KAAK;QACrC,UAAU,EAAE;YACV,gCAAiC,SAAU,IAAI;YAC/C,MAAM,CAAC,EAAE;gBACP,MAAM,CAAC,KAAK,CAAC,4BAA4B,CAAC,CAAC;gBAC3C,KAAK,MAAM,aAAa,IAAI,oBAAoB,EAAE;oBAChD,MAAM,CAAC,SAAS,CAAC,0BAA2B,IAAA,oBAAU,EAAC,aAAa,CAAC,CAAC,WAAW,EAAG,GAAG,CAAC,CAAC;oBACzF,MAAM,CAAC,SAAS,CAAC,QAAS,IAAA,+BAAQ,EAAC,aAAa,CAAE,KAAK,CAAC,CAAC;iBAC1D;gBACD,MAAM,CAAC,SAAS,CAAC,0BAA2B,IAAA,oBAAU,EAAC,UAAU,CAAC,CAAC,WAAW,EAAG,IAAI,CAAC,CAAC;gBACvF,MAAM,CAAC,KAAK,CAAC,wCAAwC,CAAC,CAAC;gBACvD,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;gBAC3B,MAAM,CAAC,SAAS,CAAC,4DAA4D,CAAC,CAAC;gBAC/E,MAAM,CAAC,SAAS,CAAC,SAAU,SAAU,uBAAwB,OAAQ,uEAAuE,CAAC,CAAC;gBAC9I,MAAM,CAAC,SAAS,CAAC,kBAAmB,SAAU,YAAa,SAAU,oBAAqB,SAAU,mDAAmD,CAAC,CAAC;gBACzJ,MAAM,CAAC,SAAS,CAAC,sEAAsE,CAAC,CAAC;gBACzF,MAAM,CAAC,KAAK,CAAC,UAAW,SAAU,OAAO,CAAC,CAAC;YAC7C,CAAC;SACF;KACF,CAAC;AACJ,CAAC;AArCD,gCAqCC"}
@@ -1,15 +1,18 @@
1
- import { underscore } from '@angular-devkit/core/src/utils/strings';
2
- import { camelize } from '@rxap/schematics-utilities';
3
- import { Scope, } from 'ts-morph';
4
- export function GetMethod(options, className) {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetMethod = void 0;
4
+ const strings_1 = require("@angular-devkit/core/src/utils/strings");
5
+ const schematics_utilities_1 = require("@rxap/schematics-utilities");
6
+ const ts_morph_1 = require("ts-morph");
7
+ function GetMethod(options, className) {
5
8
  const { classified, dtoName, documentId, camelized, collection, parentCollectionList } = options;
6
9
  return {
7
10
  name: 'get',
8
- scope: Scope.Public,
11
+ scope: ts_morph_1.Scope.Public,
9
12
  isAsync: true,
10
13
  parameters: [
11
14
  ...parentCollectionList.map(collection => ({
12
- name: `${camelize(collection)}Id`,
15
+ name: `${(0, schematics_utilities_1.camelize)(collection)}Id`,
13
16
  type: 'string',
14
17
  })),
15
18
  {
@@ -23,10 +26,10 @@ export function GetMethod(options, className) {
23
26
  writer => {
24
27
  writer.write(`const snapshot = await this.firestore`);
25
28
  for (const subCollection of parentCollectionList) {
26
- writer.writeLine(`.collection(Collection.${underscore(subCollection).toUpperCase()})`);
27
- writer.writeLine(`.doc(${camelize(subCollection)}Id)`);
29
+ writer.writeLine(`.collection(Collection.${(0, strings_1.underscore)(subCollection).toUpperCase()})`);
30
+ writer.writeLine(`.doc(${(0, schematics_utilities_1.camelize)(subCollection)}Id)`);
28
31
  }
29
- writer.writeLine(`.collection(Collection.${underscore(collection).toUpperCase()})`);
32
+ writer.writeLine(`.collection(Collection.${(0, strings_1.underscore)(collection).toUpperCase()})`);
30
33
  writer.writeLine(`.doc(${documentId})`);
31
34
  if (options.privateName) {
32
35
  writer.writeLine(`.collection(Collection.PRIVATE)`);
@@ -45,4 +48,5 @@ export function GetMethod(options, className) {
45
48
  ],
46
49
  };
47
50
  }
51
+ exports.GetMethod = GetMethod;
48
52
  //# sourceMappingURL=get-method.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-method.js","sourceRoot":"","sources":["../../../../../../../../packages/schematic/nestjs/src/schematics/crud-service/crud-class/get-method.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,EAGL,KAAK,GACN,MAAM,UAAU,CAA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;iBACtD;gBACD,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;gBAC3B,MAAM,CAAC,SAAS,CAAC,6CAA6C,CAAC,CAAC;gBAChE,MAAM,CAAC,SAAS,CAAC,yBAAyB,CAAC,CAAC;gBAC5C,MAAM,CAAC,SAAS,CAAC,kCAAmC,UAAW,oDAAoD,CAAC,CAAC;gBACrH,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;gBACtB,MAAM,CAAC,SAAS,CAAC,SAAU,SAAU,mBAAoB,OAAQ,4CAA4C,CAAC,CAAC;gBAC/G,MAAM,CAAC,SAAS,CAAC,+BAAgC,SAAU,4BAA4B,CAAC,CAAC;gBACzF,MAAM,CAAC,SAAS,CAAC,+DAA+D,CAAC,CAAC;gBAClF,MAAM,CAAC,KAAK,CAAC,UAAW,SAAU,GAAG,CAAC,CAAC;YACzC,CAAC;SACF;KACF,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"get-method.js","sourceRoot":"","sources":["../../../../../../../../packages/schematic/nestjs/src/schematics/crud-service/crud-class/get-method.ts"],"names":[],"mappings":";;;AAAA,oEAAoE;AACpE,qEAAsD;AACtD,uCAIkB;AAGlB,SAAgB,SAAS,CAAC,OAAgB,EAAE,SAAiB;IAC3D,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,oBAAoB,EAAE,GAAG,OAAO,CAAC;IACjG,OAAO;QACL,IAAI,EAAE,KAAK;QACX,KAAK,EAAE,gBAAK,CAAC,MAAM;QACnB,OAAO,EAAE,IAAI;QACb,UAAU,EAAE;YACV,GAAG,oBAAoB,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;gBACzC,IAAI,EAAE,GAAI,IAAA,+BAAQ,EAAC,UAAU,CAAE,IAAI;gBACnC,IAAI,EAAE,QAAQ;aACf,CAAC,CAAC;YACH;gBACE,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,QAAQ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;gBAClF,MAAM,CAAC,KAAK,CAAC,UAAW,SAAU,GAAG,CAAC,CAAC;YACzC,CAAC;SACF;KACF,CAAC;AACJ,CAAC;AA3CD,8BA2CC"}
@@ -1,15 +1,18 @@
1
- import { underscore } from '@angular-devkit/core/src/utils/strings';
2
- import { camelize } from '@rxap/schematics-utilities';
3
- import { Scope, } from 'ts-morph';
4
- export function UpdateFieldMethod(options, className) {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UpdateFieldMethod = void 0;
4
+ const strings_1 = require("@angular-devkit/core/src/utils/strings");
5
+ const schematics_utilities_1 = require("@rxap/schematics-utilities");
6
+ const ts_morph_1 = require("ts-morph");
7
+ function UpdateFieldMethod(options, className) {
5
8
  const { classified, documentId, dtoName, camelized, collection, parentCollectionList, privateName } = options;
6
9
  return {
7
10
  name: 'updateField',
8
- scope: Scope.Public,
11
+ scope: ts_morph_1.Scope.Public,
9
12
  isAsync: true,
10
13
  parameters: [
11
14
  ...parentCollectionList.map(collection => ({
12
- name: `${camelize(collection)}Id`,
15
+ name: `${(0, schematics_utilities_1.camelize)(collection)}Id`,
13
16
  type: 'string',
14
17
  })),
15
18
  {
@@ -41,10 +44,10 @@ export function UpdateFieldMethod(options, className) {
41
44
  writer => {
42
45
  writer.write('await this.firestore');
43
46
  for (const subCollection of parentCollectionList) {
44
- writer.writeLine(`.collection(Collection.${underscore(subCollection).toUpperCase()})`);
45
- writer.writeLine(`.doc(${camelize(subCollection)}Id)`);
47
+ writer.writeLine(`.collection(Collection.${(0, strings_1.underscore)(subCollection).toUpperCase()})`);
48
+ writer.writeLine(`.doc(${(0, schematics_utilities_1.camelize)(subCollection)}Id)`);
46
49
  }
47
- writer.writeLine(`.collection(Collection.${underscore(collection).toUpperCase()})`);
50
+ writer.writeLine(`.collection(Collection.${(0, strings_1.underscore)(collection).toUpperCase()})`);
48
51
  writer.writeLine(`.doc(${documentId})`);
49
52
  if (privateName) {
50
53
  writer.writeLine(`.collection(Collection.PRIVATE)`);
@@ -55,10 +58,11 @@ export function UpdateFieldMethod(options, className) {
55
58
  },
56
59
  `this.logger.debug('updated: ' + ${documentId}, '${className}')`,
57
60
  `return this.get(${[
58
- ...parentCollectionList.map(collection => `${camelize(collection)}Id`),
61
+ ...parentCollectionList.map(collection => `${(0, schematics_utilities_1.camelize)(collection)}Id`),
59
62
  `${documentId}`,
60
63
  ].join(', ')})`,
61
64
  ],
62
65
  };
63
66
  }
67
+ exports.UpdateFieldMethod = UpdateFieldMethod;
64
68
  //# sourceMappingURL=update-field-method.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"update-field-method.js","sourceRoot":"","sources":["../../../../../../../../packages/schematic/nestjs/src/schematics/crud-service/crud-class/update-field-method.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,EAGL,KAAK,GACN,MAAM,UAAU,CAAC;AAGlB,MAAM,UAAU,iBAAiB,CAAC,OAAgB,EAAE,SAAiB;IACnE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,oBAAoB,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC;IAC9G,OAAO;QACL,IAAI,EAAE,aAAa;QACnB,KAAK,EAAE,KAAK,CAAC,MAAM;QACnB,OAAO,EAAE,IAAI;QACb,UAAU,EAAE;YACV,GAAG,oBAAoB,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;gBACzC,IAAI,EAAE,GAAI,QAAQ,CAAC,UAAU,CAAE,IAAI;gBACnC,IAAI,EAAE,QAAQ;aACf,CAAC,CAAC;YACH;gBACE,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,QAAQ;aACf;YACD;;;;eAIG;YACH;gBACE,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,oBAAoB;aAC3B;YACD;gBACE,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+ {"version":3,"file":"update-field-method.js","sourceRoot":"","sources":["../../../../../../../../packages/schematic/nestjs/src/schematics/crud-service/crud-class/update-field-method.ts"],"names":[],"mappings":";;;AAAA,oEAAoE;AACpE,qEAAsD;AACtD,uCAIkB;AAGlB,SAAgB,iBAAiB,CAAC,OAAgB,EAAE,SAAiB;IACnE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,oBAAoB,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC;IAC9G,OAAO;QACL,IAAI,EAAE,aAAa;QACnB,KAAK,EAAE,gBAAK,CAAC,MAAM;QACnB,OAAO,EAAE,IAAI;QACb,UAAU,EAAE;YACV,GAAG,oBAAoB,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;gBACzC,IAAI,EAAE,GAAI,IAAA,+BAAQ,EAAC,UAAU,CAAE,IAAI;gBACnC,IAAI,EAAE,QAAQ;aACf,CAAC,CAAC;YACH;gBACE,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,QAAQ;aACf;YACD;;;;eAIG;YACH;gBACE,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,oBAAoB;aAC3B;YACD;gBACE,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,KAAK;aACZ;YACD;gBACE,IAAI,EAAE,0BAA0B;gBAChC,IAAI,EAAE,OAAO;gBACb,eAAe,EAAE,IAAI;aACtB;SACF;QACD,UAAU,EAAE,WAAY,OAAQ,GAAG;QACnC,UAAU,EAAE;YACV,oCAAqC,UAAW,MAAO,SAAU,IAAI;YACrE,MAAM,CAAC,EAAE;gBACP,MAAM,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAC;gBACrC,KAAK,MAAM,aAAa,IAAI,oBAAoB,EAAE;oBAChD,MAAM,CAAC,SAAS,CAAC,0BAA2B,IAAA,oBAAU,EAAC,aAAa,CAAC,CAAC,WAAW,EAAG,GAAG,CAAC,CAAC;oBACzF,MAAM,CAAC,SAAS,CAAC,QAAS,IAAA,+BAAQ,EAAC,aAAa,CAAE,KAAK,CAAC,CAAC;iBAC1D;gBACD,MAAM,CAAC,SAAS,CAAC,0BAA2B,IAAA,oBAAU,EAAC,UAAU,CAAC,CAAC,WAAW,EAAG,GAAG,CAAC,CAAC;gBACtF,MAAM,CAAC,SAAS,CAAC,QAAS,UAAW,GAAG,CAAC,CAAC;gBAC1C,IAAI,WAAW,EAAE;oBACf,MAAM,CAAC,SAAS,CAAC,iCAAiC,CAAC,CAAC;oBACpD,MAAM,CAAC,SAAS,CAAC,SAAU,OAAO,CAAC,WAAY,IAAI,CAAC,CAAC;iBACtD;gBACD,MAAM,CAAC,SAAS,CAAC,oDAAoD,CAAC,CAAC;gBACvE,MAAM,CAAC,SAAS,CAAC,6CAA6C,CAAC,CAAC;YAClE,CAAC;YACD,mCAAoC,UAAW,MAAO,SAAU,IAAI;YACpE,mBAAoB;gBAClB,GAAG,oBAAoB,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC,GAAI,IAAA,+BAAQ,EAAC,UAAU,CAAE,IAAI,CAAC;gBACxE,GAAI,UAAW,EAAE;aAClB,CAAC,IAAI,CAAC,IAAI,CAAE,GAAG;SACjB;KACF,CAAC;AACJ,CAAC;AA3DD,8CA2DC"}
@@ -1,15 +1,18 @@
1
- import { underscore } from '@angular-devkit/core/src/utils/strings';
2
- import { camelize } from '@rxap/schematics-utilities';
3
- import { Scope, } from 'ts-morph';
4
- export function UpdateMethod(options, className) {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UpdateMethod = void 0;
4
+ const strings_1 = require("@angular-devkit/core/src/utils/strings");
5
+ const schematics_utilities_1 = require("@rxap/schematics-utilities");
6
+ const ts_morph_1 = require("ts-morph");
7
+ function UpdateMethod(options, className) {
5
8
  const { classified, documentId, dtoName, camelized, collection, parentCollectionList, privateName } = options;
6
9
  return {
7
10
  name: 'update',
8
- scope: Scope.Public,
11
+ scope: ts_morph_1.Scope.Public,
9
12
  isAsync: true,
10
13
  parameters: [
11
14
  ...parentCollectionList.map(collection => ({
12
- name: `${camelize(collection)}Id`,
15
+ name: `${(0, schematics_utilities_1.camelize)(collection)}Id`,
13
16
  type: 'string',
14
17
  })),
15
18
  {
@@ -32,10 +35,10 @@ export function UpdateMethod(options, className) {
32
35
  writer.writeLine('plain.__updatedAt = new Date()');
33
36
  writer.write('await this.firestore');
34
37
  for (const subCollection of parentCollectionList) {
35
- writer.writeLine(`.collection(Collection.${underscore(subCollection).toUpperCase()})`);
36
- writer.writeLine(`.doc(${camelize(subCollection)}Id)`);
38
+ writer.writeLine(`.collection(Collection.${(0, strings_1.underscore)(subCollection).toUpperCase()})`);
39
+ writer.writeLine(`.doc(${(0, schematics_utilities_1.camelize)(subCollection)}Id)`);
37
40
  }
38
- writer.writeLine(`.collection(Collection.${underscore(collection).toUpperCase()})`);
41
+ writer.writeLine(`.collection(Collection.${(0, strings_1.underscore)(collection).toUpperCase()})`);
39
42
  writer.writeLine(`.doc(${documentId})`);
40
43
  if (privateName) {
41
44
  writer.writeLine(`.collection(Collection.PRIVATE)`);
@@ -46,10 +49,11 @@ export function UpdateMethod(options, className) {
46
49
  },
47
50
  `this.logger.debug('updated: ' + ${documentId}, '${className}')`,
48
51
  `return this.get(${[
49
- ...parentCollectionList.map(collection => `${camelize(collection)}Id`),
52
+ ...parentCollectionList.map(collection => `${(0, schematics_utilities_1.camelize)(collection)}Id`),
50
53
  `${documentId}`,
51
54
  ].join(', ')})`,
52
55
  ],
53
56
  };
54
57
  }
58
+ exports.UpdateMethod = UpdateMethod;
55
59
  //# sourceMappingURL=update-method.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"update-method.js","sourceRoot":"","sources":["../../../../../../../../packages/schematic/nestjs/src/schematics/crud-service/crud-class/update-method.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAE,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C,SAAS,CAAC,QAAS,QAAQ,CAAC,aAAa,CAAE,KAAK,CAAC,CAAC;iBAC1D;gBACD,MAAM,CAAC,SAAS,CAAC,0BAA2B,UAAU,CAAC,UAAU,CAAC,CAAC,WAAW,EAAG,GAAG,CAAC,CAAC;gBACtF,MAAM,CAAC,SAAS,CAAC,QAAS,UAAW,GAAG,CAAC,CAAC;gBAC1C,IAAI,WAAW,EAAE;oBACf,MAAM,CAAC,SAAS,CAAC,iCAAiC,CAAC,CAAC;oBACpD,MAAM,CAAC,SAAS,CAAC,SAAU,OAAO,CAAC,WAAY,IAAI,CAAC,CAAC;iBACtD;gBACD,MAAM,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;gBACnC,MAAM,CAAC,SAAS,CAAC,6CAA6C,CAAC,CAAC;YAClE,CAAC;YACD,mCAAoC,UAAW,MAAO,SAAU,IAAI;YACpE,mBAAoB;gBAClB,GAAG,oBAAoB,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC,GAAI,QAAQ,CAAC,UAAU,CAAE,IAAI,CAAC;gBACxE,GAAI,UAAW,EAAE;aAClB,CAAC,IAAI,CAAC,IAAI,CAAE,GAAG;SACjB;KACF,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"update-method.js","sourceRoot":"","sources":["../../../../../../../../packages/schematic/nestjs/src/schematics/crud-service/crud-class/update-method.ts"],"names":[],"mappings":";;;AAAA,oEAAoE;AACpE,qEAAsD;AACtD,uCAIkB;AAGlB,SAAgB,YAAY,CAAC,OAAgB,EAAE,SAAiB;IAC9D,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,oBAAoB,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC;IAC9G,OAAO;QACL,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,gBAAK,CAAC,MAAM;QACnB,OAAO,EAAE,IAAI;QACb,UAAU,EAAE;YACV,GAAG,oBAAoB,CAAC,GAAG,CA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AY,IAAI,CAAC,CAAC;iBACtD;gBACD,MAAM,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;gBACnC,MAAM,CAAC,SAAS,CAAC,6CAA6C,CAAC,CAAC;YAClE,CAAC;YACD,mCAAoC,UAAW,MAAO,SAAU,IAAI;YACpE,mBAAoB;gBAClB,GAAG,oBAAoB,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC,GAAI,IAAA,+BAAQ,EAAC,UAAU,CAAE,IAAI,CAAC;gBACxE,GAAI,UAAW,EAAE;aAClB,CAAC,IAAI,CAAC,IAAI,CAAE,GAAG;SACjB;KACF,CAAC;AACJ,CAAC;AAlDD,oCAkDC"}
@@ -1,14 +1,17 @@
1
- import { CoerceClass } from '@rxap/schematics-ts-morph';
2
- import { Scope, } from 'ts-morph';
3
- import { CreateMethod } from './crud-class/create-method';
4
- import { DeleteMethod } from './crud-class/delete-method';
5
- import { ExistsMethod } from './crud-class/exists-method';
6
- import { FindInGroupMethod } from './crud-class/find-in-group-method';
7
- import { FindMethod } from './crud-class/find-method';
8
- import { GetMethod } from './crud-class/get-method';
9
- import { UpdateMethod } from './crud-class/update-method';
10
- import { UpdateFieldMethod } from './crud-class/update-field-method';
11
- export function CrudClass(sourceFile, options) {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CrudClass = void 0;
4
+ const schematics_ts_morph_1 = require("@rxap/schematics-ts-morph");
5
+ const ts_morph_1 = require("ts-morph");
6
+ const create_method_1 = require("./crud-class/create-method");
7
+ const delete_method_1 = require("./crud-class/delete-method");
8
+ const exists_method_1 = require("./crud-class/exists-method");
9
+ const find_in_group_method_1 = require("./crud-class/find-in-group-method");
10
+ const find_method_1 = require("./crud-class/find-method");
11
+ const get_method_1 = require("./crud-class/get-method");
12
+ const update_method_1 = require("./crud-class/update-method");
13
+ const update_field_method_1 = require("./crud-class/update-field-method");
14
+ function CrudClass(sourceFile, options) {
12
15
  const { classified, dtoName, dasherized } = options;
13
16
  if (options.overwrite) {
14
17
  // TODO : replace hack with correct implementation to remove all statements
@@ -76,18 +79,18 @@ export function CrudClass(sourceFile, options) {
76
79
  ]);
77
80
  const className = classified + 'CrudService';
78
81
  const methods = [
79
- CreateMethod(options, className),
80
- DeleteMethod(options, className),
81
- UpdateMethod(options, className),
82
- GetMethod(options, className),
83
- ExistsMethod(options, className),
84
- UpdateFieldMethod(options, className),
82
+ (0, create_method_1.CreateMethod)(options, className),
83
+ (0, delete_method_1.DeleteMethod)(options, className),
84
+ (0, update_method_1.UpdateMethod)(options, className),
85
+ (0, get_method_1.GetMethod)(options, className),
86
+ (0, exists_method_1.ExistsMethod)(options, className),
87
+ (0, update_field_method_1.UpdateFieldMethod)(options, className),
85
88
  ];
86
89
  if (!options.privateName) {
87
- methods.push(FindMethod(options, className));
88
- methods.push(FindInGroupMethod(options, className));
90
+ methods.push((0, find_method_1.FindMethod)(options, className));
91
+ methods.push((0, find_in_group_method_1.FindInGroupMethod)(options, className));
89
92
  }
90
- CoerceClass(sourceFile, className, {
93
+ (0, schematics_ts_morph_1.CoerceClass)(sourceFile, className, {
91
94
  isExported: true,
92
95
  decorators: [
93
96
  {
@@ -99,14 +102,14 @@ export function CrudClass(sourceFile, options) {
99
102
  {
100
103
  parameters: [
101
104
  {
102
- scope: Scope.Private,
105
+ scope: ts_morph_1.Scope.Private,
103
106
  isReadonly: true,
104
107
  name: 'logger',
105
108
  type: 'Logger',
106
109
  decorators: [{ name: 'Inject', arguments: ['Logger'] }],
107
110
  },
108
111
  {
109
- scope: Scope.Private,
112
+ scope: ts_morph_1.Scope.Private,
110
113
  isReadonly: true,
111
114
  name: 'firestore',
112
115
  type: 'Firestore',
@@ -118,4 +121,5 @@ export function CrudClass(sourceFile, options) {
118
121
  methods,
119
122
  });
120
123
  }
124
+ exports.CrudClass = CrudClass;
121
125
  //# sourceMappingURL=crud-class.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"crud-class.js","sourceRoot":"","sources":["../../../../../../../packages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I,CAAC,OAAO,CAAC,WAAW,EAAE;QACxB,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC;QAC7C,OAAO,CAAC,IAAI,CAAC,iBAAiB,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC;KACrD;IAED,WAAW,CAAC,UAAU,EAAE,SAAS,EAAE;QACjC,UAAU,EAAE,IAAI;QAChB,UAAU,EAAE;YACV;gBACE,IAAI,EAAE,YAAY;gBAClB,SAAS,EAAE,EAAE;aACd;SACF;QACD,KAAK,EAAE;YACL;gBACE,UAAU,EAAE;oBACV;wBACE,KAAK,EAAE,KAAK,CAAC,OAAO;wBACpB,UAAU,EAAE,IAAI;wBAChB,IAAI,EAAE,QAAQ;wBACd,IAAI,EAAE,QAAQ;wBACd,UAAU,EAAE,CAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAE,QAAQ,CAAE,EAAE,CAAE;qBAC5D;oBACD;wBACE,KAAK,EAAE,KAAK,CAAC,OAAO;wBACpB,UAAU,EAAE,IAAI;wBAChB,IAAI,EAAE,WAAW;wBACjB,IAAI,EAAE,WAAW;wBACjB,UAAU,EAAE,CAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAE,WAAW,CAAE,EAAE,CAAE;qBAC/D;iBACF;aACF;SACF;QACD,OAAO;KACR,CAAC,CAAC;AAEL,CAAC"}
1
+ {"version":3,"file":"crud-class.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/nestjs/src/schematics/crud-service/crud-class.ts"],"names":[],"mappings":";;;AAAA,mEAAwD;AACxD,uCAGkB;AAClB,8DAA0D;AAC1D,8DAA0D;AAC1D,8DAA0D;AAC1D,4EAAsE;AACtE,0DAAsD;AACtD,wDAAoD;AACpD,8DAA0D;AAE1D,0EAAqE;AAErE,SAAgB,SAAS,CAAC,UAAsB,EAAE,OAAgB;IAChE,MAAM,EAAE,UAAU,EAAE,OAAO,EAA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AE,EAAE,CAAE;qBAC5D;oBACD;wBACE,KAAK,EAAE,gBAAK,CAAC,OAAO;wBACpB,UAAU,EAAE,IAAI;wBAChB,IAAI,EAAE,WAAW;wBACjB,IAAI,EAAE,WAAW;wBACjB,UAAU,EAAE,CAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAE,WAAW,CAAE,EAAE,CAAE;qBAC/D;iBACF;aACF;SACF;QACD,OAAO;KACR,CAAC,CAAC;AAEL,CAAC;AApHD,8BAoHC"}
@@ -1,13 +1,16 @@
1
- import { CoerceClass } from '@rxap/schematics-ts-morph';
2
- import { camelize } from '@rxap/schematics-utilities';
3
- export function CreateDtoClass(sourceFile, options) {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CreateDtoClass = void 0;
4
+ const schematics_ts_morph_1 = require("@rxap/schematics-ts-morph");
5
+ const schematics_utilities_1 = require("@rxap/schematics-utilities");
6
+ function CreateDtoClass(sourceFile, options) {
4
7
  const { classified, dtoName, camelized, collection, parentCollectionList } = options;
5
- CoerceClass(sourceFile, `Create${dtoName}`, {
8
+ (0, schematics_ts_morph_1.CoerceClass)(sourceFile, `Create${dtoName}`, {
6
9
  isExported: true,
7
10
  extends: writer => {
8
11
  writer.write('OmitType(');
9
12
  writer.write(`${dtoName},`);
10
- writer.write(`[ ${['id', ...parentCollectionList.map(pc => camelize(pc) + 'Id')].map(id => `'${id}'`)
13
+ writer.write(`[ ${['id', ...parentCollectionList.map(pc => (0, schematics_utilities_1.camelize)(pc) + 'Id')].map(id => `'${id}'`)
11
14
  .join()} ] as const`);
12
15
  writer.write(')');
13
16
  },
@@ -19,4 +22,5 @@ export function CreateDtoClass(sourceFile, options) {
19
22
  },
20
23
  ]);
21
24
  }
25
+ exports.CreateDtoClass = CreateDtoClass;
22
26
  //# sourceMappingURL=create-dto-class.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"create-dto-class.js","sourceRoot":"","sources":["../../../../../../../../packages/schematic/nestjs/src/schematics/crud-service/dto-class/create-dto-class.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAItD,MAAM,UAAU,cAAc,CAAC,UAAsB,EAAE,OAAgB;IAErE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,oBAAoB,EAAE,GAAG,OAAO,CAAC;IAErF,WAAW,CAAC,UAAU,EAAE,SAAU,OAAQ,EAAE,EAAE;QAC5C,UAAU,EAAE,IAAI;QAChB,OAAO,EAAE,MAAM,CAAC,EAAE;YAChB,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;YAC1B,MAAM,CAAC,KAAK,CAAC,GAAI,OAAQ,GAAG,CAAC,CAAC;YAC9B,MAAM,CAAC,KAAK,CAAC,KAAM,CAAE,IAAI,EAAE,GAAG,oBAAoB,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,CAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,IAAK,EAAG,GAAG,CAAC;iBACtB,IAAI,EAAG,aAAa,CAAC,CAAC;YAC1G,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACpB,CAAC;KACF,CAAC,CAAC;IAEH,UAAU,CAAC,qBAAqB,CAAC;QAC/B;YACE,YAAY,EAAE,CAAE,UAAU,CAAE;YAC5B,eAAe,EAAE,iBAAiB;SACnC;KACF,CAAC,CAAC;AAEL,CAAC"}
1
+ {"version":3,"file":"create-dto-class.js","sourceRoot":"","sources":["../../../../../../../../packages/schematic/nestjs/src/schematics/crud-service/dto-class/create-dto-class.ts"],"names":[],"mappings":";;;AAAA,mEAAwD;AACxD,qEAAsD;AAItD,SAAgB,cAAc,CAAC,UAAsB,EAAE,OAAgB;IAErE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,oBAAoB,EAAE,GAAG,OAAO,CAAC;IAErF,IAAA,iCAAW,EAAC,UAAU,EAAE,SAAU,OAAQ,EAAE,EAAE;QAC5C,UAAU,EAAE,IAAI;QAChB,OAAO,EAAE,MAAM,CAAC,EAAE;YAChB,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;YAC1B,MAAM,CAAC,KAAK,CAAC,GAAI,OAAQ,GAAG,CAAC,CAAC;YAC9B,MAAM,CAAC,KAAK,CAAC,KAAM,CAAE,IAAI,EAAE,GAAG,oBAAoB,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,IAAA,+BAAQ,EAAC,EAAE,CAAC,GAAG,IAAI,CAAC,CAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,IAAK,EAAG,GAAG,CAAC;iBACtB,IAAI,EAAG,aAAa,CAAC,CAAC;YAC1G,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACpB,CAAC;KACF,CAAC,CAAC;IAEH,UAAU,CAAC,qBAAqB,CAAC;QAC/B;YACE,YAAY,EAAE,CAAE,UAAU,CAAE;YAC5B,eAAe,EAAE,iBAAiB;SACnC;KACF,CAAC,CAAC;AAEL,CAAC;AAtBD,wCAsBC"}
@@ -1,16 +1,19 @@
1
- import { CoerceClass } from '@rxap/schematics-ts-morph';
2
- import { camelize } from '@rxap/schematics-utilities';
3
- import { Scope, Writers, } from 'ts-morph';
4
- import { CoerceClassMethod } from '../coerce-class-method';
5
- import { CoerceClassProperty } from '../coerce-class-property';
6
- export function DtoClass(sourceFile, options) {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DtoClass = void 0;
4
+ const schematics_ts_morph_1 = require("@rxap/schematics-ts-morph");
5
+ const schematics_utilities_1 = require("@rxap/schematics-utilities");
6
+ const ts_morph_1 = require("ts-morph");
7
+ const coerce_class_method_1 = require("../coerce-class-method");
8
+ const coerce_class_property_1 = require("../coerce-class-property");
9
+ function DtoClass(sourceFile, options) {
7
10
  const { classified, dtoName, camelized, collection, parentCollectionList } = options;
8
- const classDeclaration = CoerceClass(sourceFile, dtoName, {
11
+ const classDeclaration = (0, schematics_ts_morph_1.CoerceClass)(sourceFile, dtoName, {
9
12
  isExported: true,
10
13
  });
11
- CoerceClassProperty(classDeclaration, 'id', {
14
+ (0, coerce_class_property_1.CoerceClassProperty)(classDeclaration, 'id', {
12
15
  type: 'string',
13
- scope: Scope.Public,
16
+ scope: ts_morph_1.Scope.Public,
14
17
  hasExclamationToken: true,
15
18
  decorators: [
16
19
  {
@@ -23,9 +26,9 @@ export function DtoClass(sourceFile, options) {
23
26
  ],
24
27
  });
25
28
  for (const parentCollection of parentCollectionList) {
26
- CoerceClassProperty(classDeclaration, camelize(parentCollection) + 'Id', {
29
+ (0, coerce_class_property_1.CoerceClassProperty)(classDeclaration, (0, schematics_utilities_1.camelize)(parentCollection) + 'Id', {
27
30
  type: 'string',
28
- scope: Scope.Public,
31
+ scope: ts_morph_1.Scope.Public,
29
32
  hasExclamationToken: true,
30
33
  decorators: [
31
34
  {
@@ -38,16 +41,16 @@ export function DtoClass(sourceFile, options) {
38
41
  ],
39
42
  });
40
43
  }
41
- CoerceClassMethod(classDeclaration, `FromCreate${dtoName}`, {
44
+ (0, coerce_class_method_1.CoerceClassMethod)(classDeclaration, `FromCreate${dtoName}`, {
42
45
  isStatic: true,
43
- scope: Scope.Public,
46
+ scope: ts_morph_1.Scope.Public,
44
47
  parameters: [
45
48
  {
46
49
  name: `create${dtoName}`,
47
50
  type: `Create${dtoName}`,
48
51
  },
49
52
  ...parentCollectionList.map(parentCollection => ({
50
- name: `${camelize(parentCollection)}Id`,
53
+ name: `${(0, schematics_utilities_1.camelize)(parentCollection)}Id`,
51
54
  type: 'string',
52
55
  })),
53
56
  {
@@ -56,30 +59,30 @@ export function DtoClass(sourceFile, options) {
56
59
  initializer: 'uuid()',
57
60
  },
58
61
  ],
59
- statements: Writers.returnStatement(writer => {
62
+ statements: ts_morph_1.Writers.returnStatement(writer => {
60
63
  writer.write('plainToClass(');
61
64
  writer.writeLine(`${dtoName},`);
62
65
  writer.writeLine('{');
63
66
  writer.writeLine(`...classToPlain(create${dtoName}, CrudTransformOptions()),`);
64
67
  writer.writeLine(`id: ${camelized}Id,`);
65
68
  for (const parentCollection of parentCollectionList) {
66
- writer.writeLine(`${camelize(parentCollection)}Id,`);
69
+ writer.writeLine(`${(0, schematics_utilities_1.camelize)(parentCollection)}Id,`);
67
70
  }
68
71
  writer.writeLine('},');
69
72
  writer.writeLine('CrudTransformOptions()');
70
73
  writer.write(');');
71
74
  }),
72
75
  });
73
- CoerceClassMethod(classDeclaration, `FromUpdate${dtoName}`, {
76
+ (0, coerce_class_method_1.CoerceClassMethod)(classDeclaration, `FromUpdate${dtoName}`, {
74
77
  isStatic: true,
75
- scope: Scope.Public,
78
+ scope: ts_morph_1.Scope.Public,
76
79
  parameters: [
77
80
  {
78
81
  name: `update${dtoName}`,
79
82
  type: `Update${dtoName}`,
80
83
  },
81
84
  ...parentCollectionList.map(parentCollection => ({
82
- name: `${camelize(parentCollection)}Id`,
85
+ name: `${(0, schematics_utilities_1.camelize)(parentCollection)}Id`,
83
86
  type: 'string',
84
87
  })),
85
88
  {
@@ -88,14 +91,14 @@ export function DtoClass(sourceFile, options) {
88
91
  initializer: 'uuid()',
89
92
  },
90
93
  ],
91
- statements: Writers.returnStatement(writer => {
94
+ statements: ts_morph_1.Writers.returnStatement(writer => {
92
95
  writer.write('plainToClass(');
93
96
  writer.writeLine(`${dtoName},`);
94
97
  writer.writeLine('{');
95
98
  writer.writeLine(`...classToPlain(update${dtoName}, CrudTransformOptions()),`);
96
99
  writer.writeLine(`id: ${camelized}Id,`);
97
100
  for (const parentCollection of parentCollectionList) {
98
- writer.writeLine(`${camelize(parentCollection)}Id,`);
101
+ writer.writeLine(`${(0, schematics_utilities_1.camelize)(parentCollection)}Id,`);
99
102
  }
100
103
  writer.writeLine('},');
101
104
  writer.writeLine('CrudTransformOptions()');
@@ -126,4 +129,5 @@ export function DtoClass(sourceFile, options) {
126
129
  },
127
130
  ]);
128
131
  }
132
+ exports.DtoClass = DtoClass;
129
133
  //# sourceMappingURL=dto-class.js.map