@feathersjs/generators 5.0.14 → 5.0.15

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 (158) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/lib/app/index.d.ts +19 -27
  3. package/lib/app/index.js +25 -30
  4. package/lib/app/index.js.map +1 -1
  5. package/lib/app/index.ts +17 -8
  6. package/lib/app/templates/app.test.tpl.d.ts +5 -2
  7. package/lib/app/templates/app.test.tpl.js +3 -7
  8. package/lib/app/templates/app.test.tpl.js.map +1 -1
  9. package/lib/app/templates/app.test.tpl.ts +4 -4
  10. package/lib/app/templates/app.tpl.d.ts +1 -1
  11. package/lib/app/templates/app.tpl.js +3 -7
  12. package/lib/app/templates/app.tpl.js.map +1 -1
  13. package/lib/app/templates/app.tpl.ts +4 -4
  14. package/lib/app/templates/channels.tpl.d.ts +1 -1
  15. package/lib/app/templates/channels.tpl.js +3 -7
  16. package/lib/app/templates/channels.tpl.js.map +1 -1
  17. package/lib/app/templates/channels.tpl.ts +4 -4
  18. package/lib/app/templates/client.test.tpl.d.ts +1 -1
  19. package/lib/app/templates/client.test.tpl.js +3 -7
  20. package/lib/app/templates/client.test.tpl.js.map +1 -1
  21. package/lib/app/templates/client.test.tpl.ts +4 -4
  22. package/lib/app/templates/client.tpl.d.ts +1 -1
  23. package/lib/app/templates/client.tpl.js +3 -7
  24. package/lib/app/templates/client.tpl.js.map +1 -1
  25. package/lib/app/templates/client.tpl.ts +4 -4
  26. package/lib/app/templates/configuration.tpl.d.ts +1 -1
  27. package/lib/app/templates/configuration.tpl.js +7 -11
  28. package/lib/app/templates/configuration.tpl.js.map +1 -1
  29. package/lib/app/templates/configuration.tpl.ts +4 -4
  30. package/lib/app/templates/declarations.tpl.d.ts +1 -1
  31. package/lib/app/templates/declarations.tpl.js +2 -6
  32. package/lib/app/templates/declarations.tpl.js.map +1 -1
  33. package/lib/app/templates/declarations.tpl.ts +3 -3
  34. package/lib/app/templates/index.html.tpl.d.ts +5 -2
  35. package/lib/app/templates/index.html.tpl.js +2 -6
  36. package/lib/app/templates/index.html.tpl.js.map +1 -1
  37. package/lib/app/templates/index.html.tpl.ts +3 -3
  38. package/lib/app/templates/index.tpl.d.ts +1 -1
  39. package/lib/app/templates/index.tpl.js +3 -7
  40. package/lib/app/templates/index.tpl.js.map +1 -1
  41. package/lib/app/templates/index.tpl.ts +4 -4
  42. package/lib/app/templates/logger.tpl.d.ts +1 -1
  43. package/lib/app/templates/logger.tpl.js +6 -10
  44. package/lib/app/templates/logger.tpl.js.map +1 -1
  45. package/lib/app/templates/logger.tpl.ts +4 -4
  46. package/lib/app/templates/package.json.tpl.d.ts +5 -2
  47. package/lib/app/templates/package.json.tpl.js +2 -6
  48. package/lib/app/templates/package.json.tpl.js.map +1 -1
  49. package/lib/app/templates/package.json.tpl.ts +3 -3
  50. package/lib/app/templates/prettierrc.tpl.d.ts +1 -1
  51. package/lib/app/templates/prettierrc.tpl.js +5 -9
  52. package/lib/app/templates/prettierrc.tpl.js.map +1 -1
  53. package/lib/app/templates/prettierrc.tpl.ts +4 -4
  54. package/lib/app/templates/readme.md.tpl.d.ts +5 -2
  55. package/lib/app/templates/readme.md.tpl.js +2 -6
  56. package/lib/app/templates/readme.md.tpl.js.map +1 -1
  57. package/lib/app/templates/readme.md.tpl.ts +3 -3
  58. package/lib/app/templates/services.tpl.d.ts +1 -1
  59. package/lib/app/templates/services.tpl.js +3 -7
  60. package/lib/app/templates/services.tpl.js.map +1 -1
  61. package/lib/app/templates/services.tpl.ts +4 -4
  62. package/lib/app/templates/tsconfig.json.tpl.d.ts +1 -1
  63. package/lib/app/templates/tsconfig.json.tpl.js +3 -7
  64. package/lib/app/templates/tsconfig.json.tpl.js.map +1 -1
  65. package/lib/app/templates/tsconfig.json.tpl.ts +3 -3
  66. package/lib/app/templates/validators.tpl.d.ts +1 -1
  67. package/lib/app/templates/validators.tpl.js +3 -7
  68. package/lib/app/templates/validators.tpl.js.map +1 -1
  69. package/lib/app/templates/validators.tpl.ts +4 -4
  70. package/lib/authentication/index.d.ts +10 -10
  71. package/lib/authentication/index.js +16 -19
  72. package/lib/authentication/index.js.map +1 -1
  73. package/lib/authentication/index.ts +65 -56
  74. package/lib/authentication/templates/authentication.tpl.d.ts +1 -1
  75. package/lib/authentication/templates/authentication.tpl.js +11 -15
  76. package/lib/authentication/templates/authentication.tpl.js.map +1 -1
  77. package/lib/authentication/templates/authentication.tpl.ts +5 -5
  78. package/lib/authentication/templates/client.test.tpl.d.ts +1 -1
  79. package/lib/authentication/templates/client.test.tpl.js +7 -11
  80. package/lib/authentication/templates/client.test.tpl.js.map +1 -1
  81. package/lib/authentication/templates/client.test.tpl.ts +5 -5
  82. package/lib/authentication/templates/config.tpl.d.ts +1 -1
  83. package/lib/authentication/templates/config.tpl.js +8 -15
  84. package/lib/authentication/templates/config.tpl.js.map +1 -1
  85. package/lib/authentication/templates/config.tpl.ts +3 -3
  86. package/lib/authentication/templates/declarations.tpl.d.ts +1 -1
  87. package/lib/authentication/templates/declarations.tpl.js +5 -9
  88. package/lib/authentication/templates/declarations.tpl.js.map +1 -1
  89. package/lib/authentication/templates/declarations.tpl.ts +3 -3
  90. package/lib/commons.d.ts +10 -2
  91. package/lib/commons.js +43 -76
  92. package/lib/commons.js.map +1 -1
  93. package/lib/commons.ts +22 -4
  94. package/lib/connection/index.d.ts +1 -1
  95. package/lib/connection/index.js +24 -30
  96. package/lib/connection/index.js.map +1 -1
  97. package/lib/connection/index.ts +10 -4
  98. package/lib/connection/templates/knex.tpl.d.ts +1 -1
  99. package/lib/connection/templates/knex.tpl.js +13 -20
  100. package/lib/connection/templates/knex.tpl.js.map +1 -1
  101. package/lib/connection/templates/knex.tpl.ts +4 -4
  102. package/lib/connection/templates/mongodb.tpl.d.ts +1 -1
  103. package/lib/connection/templates/mongodb.tpl.js +10 -14
  104. package/lib/connection/templates/mongodb.tpl.js.map +1 -1
  105. package/lib/connection/templates/mongodb.tpl.ts +4 -4
  106. package/lib/hook/index.d.ts +6 -6
  107. package/lib/hook/index.js +13 -17
  108. package/lib/hook/index.js.map +1 -1
  109. package/lib/hook/index.ts +7 -3
  110. package/lib/hook/templates/hook.tpl.d.ts +1 -1
  111. package/lib/hook/templates/hook.tpl.js +3 -7
  112. package/lib/hook/templates/hook.tpl.js.map +1 -1
  113. package/lib/hook/templates/hook.tpl.ts +4 -4
  114. package/lib/index.d.ts +7 -7
  115. package/lib/index.js +7 -36
  116. package/lib/index.js.map +1 -1
  117. package/lib/index.ts +7 -7
  118. package/lib/service/index.d.ts +1 -1
  119. package/lib/service/index.js +27 -31
  120. package/lib/service/index.js.map +1 -1
  121. package/lib/service/index.ts +94 -92
  122. package/lib/service/templates/client.tpl.d.ts +1 -1
  123. package/lib/service/templates/client.tpl.js +4 -8
  124. package/lib/service/templates/client.tpl.js.map +1 -1
  125. package/lib/service/templates/client.tpl.ts +4 -4
  126. package/lib/service/templates/schema.json.tpl.d.ts +1 -1
  127. package/lib/service/templates/schema.json.tpl.js +10 -14
  128. package/lib/service/templates/schema.json.tpl.js.map +1 -1
  129. package/lib/service/templates/schema.json.tpl.ts +4 -4
  130. package/lib/service/templates/schema.typebox.tpl.d.ts +1 -1
  131. package/lib/service/templates/schema.typebox.tpl.js +8 -12
  132. package/lib/service/templates/schema.typebox.tpl.js.map +1 -1
  133. package/lib/service/templates/schema.typebox.tpl.ts +4 -4
  134. package/lib/service/templates/service.tpl.d.ts +1 -1
  135. package/lib/service/templates/service.tpl.js +9 -14
  136. package/lib/service/templates/service.tpl.js.map +1 -1
  137. package/lib/service/templates/service.tpl.ts +4 -4
  138. package/lib/service/templates/shared.tpl.d.ts +1 -1
  139. package/lib/service/templates/shared.tpl.js +3 -7
  140. package/lib/service/templates/shared.tpl.js.map +1 -1
  141. package/lib/service/templates/shared.tpl.ts +4 -4
  142. package/lib/service/templates/test.tpl.d.ts +1 -1
  143. package/lib/service/templates/test.tpl.js +3 -7
  144. package/lib/service/templates/test.tpl.js.map +1 -1
  145. package/lib/service/templates/test.tpl.ts +4 -4
  146. package/lib/service/type/custom.tpl.d.ts +1 -1
  147. package/lib/service/type/custom.tpl.js +4 -9
  148. package/lib/service/type/custom.tpl.js.map +1 -1
  149. package/lib/service/type/custom.tpl.ts +4 -4
  150. package/lib/service/type/knex.tpl.d.ts +1 -1
  151. package/lib/service/type/knex.tpl.js +6 -11
  152. package/lib/service/type/knex.tpl.js.map +1 -1
  153. package/lib/service/type/knex.tpl.ts +4 -4
  154. package/lib/service/type/mongodb.tpl.d.ts +1 -1
  155. package/lib/service/type/mongodb.tpl.js +4 -9
  156. package/lib/service/type/mongodb.tpl.js.map +1 -1
  157. package/lib/service/type/mongodb.tpl.ts +4 -4
  158. package/package.json +30 -29
@@ -1,2 +1,2 @@
1
- import { ServiceGeneratorContext } from '../index';
1
+ import { ServiceGeneratorContext } from '../index.js';
2
2
  export declare const generate: (ctx: ServiceGeneratorContext) => Promise<ServiceGeneratorContext>;
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.generate = void 0;
4
- const pinion_1 = require("@feathershq/pinion");
5
- const commons_1 = require("../../commons");
1
+ import { toFile, after, before, when } from '@featherscloud/pinion';
2
+ import { fileExists, injectSource } from '../../commons.js';
6
3
  const importTemplate = ({ upperName, folder, fileName, camelName }) => /* ts */ `
7
4
  import { ${camelName}Client } from './services/${folder.join('/')}/${fileName}.shared'
8
5
  export type {
@@ -13,7 +10,6 @@ export type {
13
10
  } from './services/${folder.join('/')}/${fileName}.shared'
14
11
  `;
15
12
  const registrationTemplate = ({ camelName }) => ` client.configure(${camelName}Client)`;
16
- const toClientFile = (0, pinion_1.toFile)(({ lib }) => [lib, 'client']);
17
- const generate = async (ctx) => (0, pinion_1.generator)(ctx).then((0, pinion_1.when)(({ lib, language }) => (0, commons_1.fileExists)(lib, `client.${language}`), (0, commons_1.injectSource)(registrationTemplate, (0, pinion_1.before)('return client'), toClientFile), (0, commons_1.injectSource)(importTemplate, (0, pinion_1.after)(({ language }) => language === 'ts' ? 'import type { AuthenticationClientOptions }' : 'import authenticationClient'), toClientFile)));
18
- exports.generate = generate;
13
+ const toClientFile = toFile(({ lib }) => [lib, 'client']);
14
+ export const generate = async (ctx) => Promise.resolve(ctx).then(when(({ lib, language }) => fileExists(lib, `client.${language}`), injectSource(registrationTemplate, before('return client'), toClientFile), injectSource(importTemplate, after(({ language }) => language === 'ts' ? 'import type { AuthenticationClientOptions }' : 'import authenticationClient'), toClientFile)));
19
15
  //# sourceMappingURL=client.tpl.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"client.tpl.js","sourceRoot":"","sources":["../../../src/service/templates/client.tpl.ts"],"names":[],"mappings":";;;AAAA,+CAA2E;AAC3E,2CAAwD;AAGxD,MAAM,cAAc,GAAG,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAA2B,EAAE,EAAE,CAAC,QAAQ,CAAC;WAC9F,SAAS,6BAA6B,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,QAAQ;;IAEzE,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;qBACQ,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,QAAQ;CAChD,CAAA;AAED,MAAM,oBAAoB,GAAG,CAAC,EAAE,SAAS,EAA2B,EAAE,EAAE,CACtE,sBAAsB,SAAS,SAAS,CAAA;AAE1C,MAAM,YAAY,GAAG,IAAA,eAAM,EAA0B,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAA;AAE3E,MAAM,QAAQ,GAAG,KAAK,EAAE,GAA4B,EAAE,EAAE,CAC7D,IAAA,kBAAS,EAAC,GAAG,CAAC,CAAC,IAAI,CACjB,IAAA,aAAI,EACF,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,IAAA,oBAAU,EAAC,GAAG,EAAE,UAAU,Q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CACF,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,UAAU,CAAC,GAAG,EAAE,UAAU,QAAQ,EAAE,CAAC,EAC5D,YAAY,CAAC,oBAAoB,EAAE,MAAM,CAAC,eAAe,CAAC,EAAE,YAAY,CAAC,EACzE,YAAY,CACV,cAAc,EACd,KAAK,CAA0B,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAC9C,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC,6CAA6C,CAAC,CAAC,CAAC,6BAA6B,CAClG,EACD,YAAY,CACb,CACF,CACF,CAAA"}
@@ -1,6 +1,6 @@
1
- import { generator, toFile, after, before, when } from '@feathershq/pinion'
2
- import { fileExists, injectSource } from '../../commons'
3
- import { ServiceGeneratorContext } from '../index'
1
+ import { toFile, after, before, when } from '@featherscloud/pinion'
2
+ import { fileExists, injectSource } from '../../commons.js'
3
+ import { ServiceGeneratorContext } from '../index.js'
4
4
 
5
5
  const importTemplate = ({ upperName, folder, fileName, camelName }: ServiceGeneratorContext) => /* ts */ `
6
6
  import { ${camelName}Client } from './services/${folder.join('/')}/${fileName}.shared'
@@ -18,7 +18,7 @@ const registrationTemplate = ({ camelName }: ServiceGeneratorContext) =>
18
18
  const toClientFile = toFile<ServiceGeneratorContext>(({ lib }) => [lib, 'client'])
19
19
 
20
20
  export const generate = async (ctx: ServiceGeneratorContext) =>
21
- generator(ctx).then(
21
+ Promise.resolve(ctx).then(
22
22
  when<ServiceGeneratorContext>(
23
23
  ({ lib, language }) => fileExists(lib, `client.${language}`),
24
24
  injectSource(registrationTemplate, before('return client'), toClientFile),
@@ -1,2 +1,2 @@
1
- import { ServiceGeneratorContext } from '../index';
1
+ import { ServiceGeneratorContext } from '../index.js';
2
2
  export declare const generate: (ctx: ServiceGeneratorContext) => Promise<ServiceGeneratorContext>;
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.generate = void 0;
4
- const pinion_1 = require("@feathershq/pinion");
5
- const commons_1 = require("../../commons");
1
+ import { toFile, when } from '@featherscloud/pinion';
2
+ import { fileExists, localTemplate, renderSource } from '../../commons.js';
6
3
  const authFieldsTemplate = (authStrategies) => authStrategies
7
4
  .map((name) => name === 'local'
8
5
  ? ` email: { type: 'string' },
@@ -15,10 +12,10 @@ import { resolve, getValidator, querySyntax } from '@feathersjs/schema'${type ==
15
12
  import { ObjectIdSchema } from '@feathersjs/schema'`
16
13
  : ''}
17
14
  import type { FromSchema } from '@feathersjs/schema'
18
- ${(0, commons_1.localTemplate)(authStrategies, `import { passwordHash } from '@feathersjs/authentication-local'`)}
15
+ ${localTemplate(authStrategies, `import { passwordHash } from '@feathersjs/authentication-local'`)}
19
16
 
20
17
  import type { HookContext } from '${relative}/declarations'
21
- import { dataValidator, queryValidator } from '${relative}/${(0, commons_1.fileExists)(cwd, lib, 'schemas') ? 'schemas/' : '' // This is for legacy backwards compatibility
18
+ import { dataValidator, queryValidator } from '${relative}/${fileExists(cwd, lib, 'schemas') ? 'schemas/' : '' // This is for legacy backwards compatibility
22
19
  }validators'
23
20
  import type { ${upperName}Service } from './${fileName}.class'
24
21
 
@@ -27,7 +24,7 @@ export const ${camelName}Schema = {
27
24
  $id: '${upperName}',
28
25
  type: 'object',
29
26
  additionalProperties: false,
30
- required: [ '${type === 'mongodb' ? '_id' : 'id'}', ${(0, commons_1.localTemplate)(authStrategies, `'email'`, `'text'`)} ],
27
+ required: [ '${type === 'mongodb' ? '_id' : 'id'}', ${localTemplate(authStrategies, `'email'`, `'text'`)} ],
31
28
  properties: {
32
29
  ${type === 'mongodb' ? `_id: ObjectIdSchema(),` : `id: { type: 'number' },`}
33
30
  ${isEntityService
@@ -41,7 +38,7 @@ export const ${camelName}Validator = getValidator(${camelName}Schema, dataValida
41
38
  export const ${camelName}Resolver = resolve<${upperName}, HookContext<${upperName}Service>>({})
42
39
 
43
40
  export const ${camelName}ExternalResolver = resolve<${upperName}, HookContext<${upperName}Service>>({
44
- ${(0, commons_1.localTemplate)(authStrategies, `// The password should never be visible externally
41
+ ${localTemplate(authStrategies, `// The password should never be visible externally
45
42
  password: async () => undefined`)}
46
43
  })
47
44
 
@@ -50,7 +47,7 @@ export const ${camelName}DataSchema = {
50
47
  $id: '${upperName}Data',
51
48
  type: 'object',
52
49
  additionalProperties: false,
53
- required: [ ${(0, commons_1.localTemplate)(authStrategies, `'email'`, `'text'`)} ],
50
+ required: [ ${localTemplate(authStrategies, `'email'`, `'text'`)} ],
54
51
  properties: {
55
52
  ...${camelName}Schema.properties
56
53
  }
@@ -58,7 +55,7 @@ export const ${camelName}DataSchema = {
58
55
  export type ${upperName}Data = FromSchema<typeof ${camelName}DataSchema>
59
56
  export const ${camelName}DataValidator = getValidator(${camelName}DataSchema, dataValidator)
60
57
  export const ${camelName}DataResolver = resolve<${upperName}Data, HookContext<${upperName}Service>>({
61
- ${(0, commons_1.localTemplate)(authStrategies, `password: passwordHash({ strategy: 'local' })`)}
58
+ ${localTemplate(authStrategies, `password: passwordHash({ strategy: 'local' })`)}
62
59
  })
63
60
 
64
61
  // Schema for updating existing data
@@ -74,7 +71,7 @@ export const ${camelName}PatchSchema = {
74
71
  export type ${upperName}Patch = FromSchema<typeof ${camelName}PatchSchema>
75
72
  export const ${camelName}PatchValidator = getValidator(${camelName}PatchSchema, dataValidator)
76
73
  export const ${camelName}PatchResolver = resolve<${upperName}Patch, HookContext<${upperName}Service>>({
77
- ${(0, commons_1.localTemplate)(authStrategies, `password: passwordHash({ strategy: 'local' })`)}
74
+ ${localTemplate(authStrategies, `password: passwordHash({ strategy: 'local' })`)}
78
75
  })
79
76
 
80
77
  // Schema for allowed query properties
@@ -102,11 +99,10 @@ export const ${camelName}QueryResolver = resolve<${upperName}Query, HookContext<
102
99
  : ''}
103
100
  })
104
101
  `;
105
- const generate = (ctx) => (0, pinion_1.generator)(ctx).then((0, pinion_1.when)(({ schema }) => schema === 'json', (0, commons_1.renderSource)(template, (0, pinion_1.toFile)(({ lib, folder, fileName }) => [
102
+ export const generate = (ctx) => Promise.resolve(ctx).then(when(({ schema }) => schema === 'json', renderSource(template, toFile(({ lib, folder, fileName }) => [
106
103
  lib,
107
104
  'services',
108
105
  ...folder,
109
106
  `${fileName}.schema`
110
107
  ]))));
111
- exports.generate = generate;
112
108
  //# sourceMappingURL=schema.json.tpl.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"schema.json.tpl.js","sourceRoot":"","sources":["../../../src/service/templates/schema.json.tpl.ts"],"names":[],"mappings":";;;AAAA,+CAA4D;AAC5D,2CAAuE;AAGvE,MAAM,kBAAkB,GAAG,CAAC,cAAwB,EAAE,EAAE,CACtD,cAAc;KACX,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CACZ,IAAI,KAAK,OAAO;IACd,CAAC,CAAC;iCACuB;IACzB,CAAC,CAAC,OAAO,IAAI,wBAAwB,CACxC;KACA,IAAI,CAAC,KAAK,CAAC,CAAA;AAEhB,MAAM,QAAQ,GAAG,CAAC,EAChB,SAAS,EACT,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,cAAc,EACd,eAAe,EACf,IAAI,EACJ,GAAG,EACH,GAAG,EACqB,EAAE,EAAE,CAAC,QAAQ,CAAC;yEAEtC,IAAI,KAAK,SAAS;IAChB,CAAC,CAAC;oDAC8C;IAChD,CAAC,CAAC,EACN;;EAEE,IAAA,uBAAa,EAAC,cAAc,EAAE,iEAAiE,CAAC;;oCAE9D,QAAQ;iDACK,QAAQ,IACvD,IAAA,oBAAU,EAAC,GAAG,EAAE,GAAG,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,6CAA6C;AACjG;gBACgB,SAAS,qBAAqB,QAAQ;;;eAGvC,SAAS;UACd,SAAS;;;iBAGF,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,MAAM,IAAA,uBAAa,EAAC,cAAc,EAAE,SAAS,EAAE,QAAQ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AC,CAAC,CAAC,IAAI;;mCAEF,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI;;;;IAIhE;IACE,CAAC,CAAC,EACN;;CAED,CAAA;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,GAA4B,EAAE,EAAE,CACvD,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,CACvB,IAAI,CACF,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,MAAM,KAAK,MAAM,EACjC,YAAY,CACV,QAAQ,EACR,MAAM,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,EAA2B,EAAE,EAAE,CAAC;IAC7D,GAAG;IACH,UAAU;IACV,GAAG,MAAM;IACT,GAAG,QAAQ,SAAS;CACrB,CAAC,CACH,CACF,CACF,CAAA"}
@@ -1,6 +1,6 @@
1
- import { generator, toFile, when } from '@feathershq/pinion'
2
- import { fileExists, localTemplate, renderSource } from '../../commons'
3
- import { ServiceGeneratorContext } from '../index'
1
+ import { toFile, when } from '@featherscloud/pinion'
2
+ import { fileExists, localTemplate, renderSource } from '../../commons.js'
3
+ import { ServiceGeneratorContext } from '../index.js'
4
4
 
5
5
  const authFieldsTemplate = (authStrategies: string[]) =>
6
6
  authStrategies
@@ -127,7 +127,7 @@ export const ${camelName}QueryResolver = resolve<${upperName}Query, HookContext<
127
127
  `
128
128
 
129
129
  export const generate = (ctx: ServiceGeneratorContext) =>
130
- generator(ctx).then(
130
+ Promise.resolve(ctx).then(
131
131
  when<ServiceGeneratorContext>(
132
132
  ({ schema }) => schema === 'json',
133
133
  renderSource(
@@ -1,2 +1,2 @@
1
- import { ServiceGeneratorContext } from '../index';
1
+ import { ServiceGeneratorContext } from '../index.js';
2
2
  export declare const generate: (ctx: ServiceGeneratorContext) => Promise<ServiceGeneratorContext>;
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.generate = void 0;
4
- const pinion_1 = require("@feathershq/pinion");
5
- const commons_1 = require("../../commons");
1
+ import { toFile, when } from '@featherscloud/pinion';
2
+ import { fileExists, localTemplate, renderSource } from '../../commons.js';
6
3
  const authFieldsTemplate = (authStrategies) => authStrategies
7
4
  .map((name) => name === 'local'
8
5
  ? ` email: Type.String(),
@@ -16,10 +13,10 @@ import { Type, getValidator, querySyntax } from '@feathersjs/typebox'${type ===
16
13
  import { ObjectIdSchema } from '@feathersjs/typebox'`
17
14
  : ''}
18
15
  import type { Static } from '@feathersjs/typebox'
19
- ${(0, commons_1.localTemplate)(authStrategies, `import { passwordHash } from '@feathersjs/authentication-local'`)}
16
+ ${localTemplate(authStrategies, `import { passwordHash } from '@feathersjs/authentication-local'`)}
20
17
 
21
18
  import type { HookContext } from '${relative}/declarations'
22
- import { dataValidator, queryValidator } from '${relative}/${(0, commons_1.fileExists)(cwd, lib, 'schemas') ? 'schemas/' : '' // This is for legacy backwards compatibility
19
+ import { dataValidator, queryValidator } from '${relative}/${fileExists(cwd, lib, 'schemas') ? 'schemas/' : '' // This is for legacy backwards compatibility
23
20
  }validators'
24
21
  import type { ${upperName}Service } from './${fileName}.class'
25
22
 
@@ -33,7 +30,7 @@ export const ${camelName}Validator = getValidator(${camelName}Schema, dataValida
33
30
  export const ${camelName}Resolver = resolve<${upperName}, HookContext<${upperName}Service>>({})
34
31
 
35
32
  export const ${camelName}ExternalResolver = resolve<${upperName}, HookContext<${upperName}Service>>({
36
- ${(0, commons_1.localTemplate)(authStrategies, `// The password should never be visible externally
33
+ ${localTemplate(authStrategies, `// The password should never be visible externally
37
34
  password: async () => undefined`)}
38
35
  })
39
36
 
@@ -48,7 +45,7 @@ export const ${camelName}DataSchema = Type.Pick(${camelName}Schema, [
48
45
  export type ${upperName}Data = Static<typeof ${camelName}DataSchema>
49
46
  export const ${camelName}DataValidator = getValidator(${camelName}DataSchema, dataValidator)
50
47
  export const ${camelName}DataResolver = resolve<${upperName}, HookContext<${upperName}Service>>({
51
- ${(0, commons_1.localTemplate)(authStrategies, `password: passwordHash({ strategy: 'local' })`)}
48
+ ${localTemplate(authStrategies, `password: passwordHash({ strategy: 'local' })`)}
52
49
  })
53
50
 
54
51
  // Schema for updating existing entries
@@ -58,7 +55,7 @@ export const ${camelName}PatchSchema = Type.Partial(${camelName}Schema, {
58
55
  export type ${upperName}Patch = Static<typeof ${camelName}PatchSchema>
59
56
  export const ${camelName}PatchValidator = getValidator(${camelName}PatchSchema, dataValidator)
60
57
  export const ${camelName}PatchResolver = resolve<${upperName}, HookContext<${upperName}Service>>({
61
- ${(0, commons_1.localTemplate)(authStrategies, `password: passwordHash({ strategy: 'local' })`)}
58
+ ${localTemplate(authStrategies, `password: passwordHash({ strategy: 'local' })`)}
62
59
  })
63
60
 
64
61
  // Schema for allowed query properties
@@ -88,11 +85,10 @@ export const ${camelName}QueryResolver = resolve<${upperName}Query, HookContext<
88
85
  : ''}
89
86
  })
90
87
  `;
91
- const generate = (ctx) => (0, pinion_1.generator)(ctx).then((0, pinion_1.when)(({ schema }) => schema === 'typebox', (0, commons_1.renderSource)(template, (0, pinion_1.toFile)(({ lib, folder, fileName }) => [
88
+ export const generate = (ctx) => Promise.resolve(ctx).then(when(({ schema }) => schema === 'typebox', renderSource(template, toFile(({ lib, folder, fileName }) => [
92
89
  lib,
93
90
  'services',
94
91
  ...folder,
95
92
  `${fileName}.schema`
96
93
  ]))));
97
- exports.generate = generate;
98
94
  //# sourceMappingURL=schema.typebox.tpl.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"schema.typebox.tpl.js","sourceRoot":"","sources":["../../../src/service/templates/schema.typebox.tpl.ts"],"names":[],"mappings":";;;AAAA,+CAA4D;AAC5D,2CAAuE;AAGvE,MAAM,kBAAkB,GAAG,CAAC,cAAwB,EAAE,EAAE,CACtD,cAAc;KACX,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CACZ,IAAI,KAAK,OAAO;IACd,CAAC,CAAC;yCAC+B;IACjC,CA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ACR,SAAS;;;;cAIX,SAAS,yBAAyB,SAAS;eAC1C,SAAS,iCAAiC,SAAS;eACnD,SAAS,2BAA2B,SAAS,sBAAsB,SAAS;IAEvF,eAAe;IACb,CAAC,CAAC;;IAEJ,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI;;mCAEF,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI;;;;IAIhE;IACE,CAAC,CAAC,EACN;;CAED,CAAA;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,GAA4B,EAAE,EAAE,CACvD,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,CACvB,IAAI,CACF,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,MAAM,KAAK,SAAS,EACpC,YAAY,CACV,QAAQ,EACR,MAAM,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,EAA2B,EAAE,EAAE,CAAC;IAC7D,GAAG;IACH,UAAU;IACV,GAAG,MAAM;IACT,GAAG,QAAQ,SAAS;CACrB,CAAC,CACH,CACF,CACF,CAAA"}
@@ -1,6 +1,6 @@
1
- import { generator, toFile, when } from '@feathershq/pinion'
2
- import { fileExists, localTemplate, renderSource } from '../../commons'
3
- import { ServiceGeneratorContext } from '../index'
1
+ import { toFile, when } from '@featherscloud/pinion'
2
+ import { fileExists, localTemplate, renderSource } from '../../commons.js'
3
+ import { ServiceGeneratorContext } from '../index.js'
4
4
 
5
5
  const authFieldsTemplate = (authStrategies: string[]) =>
6
6
  authStrategies
@@ -115,7 +115,7 @@ export const ${camelName}QueryResolver = resolve<${upperName}Query, HookContext<
115
115
  `
116
116
 
117
117
  export const generate = (ctx: ServiceGeneratorContext) =>
118
- generator(ctx).then(
118
+ Promise.resolve(ctx).then(
119
119
  when<ServiceGeneratorContext>(
120
120
  ({ schema }) => schema === 'typebox',
121
121
  renderSource(
@@ -1,3 +1,3 @@
1
- import { ServiceGeneratorContext } from '../index';
1
+ import { ServiceGeneratorContext } from '../index.js';
2
2
  export declare const template: ({ camelName, authentication, isEntityService, path, lib, language, className, relative, schema, fileName }: ServiceGeneratorContext) => string;
3
3
  export declare const generate: (ctx: ServiceGeneratorContext) => Promise<ServiceGeneratorContext>;
@@ -1,9 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.generate = exports.template = void 0;
4
- const pinion_1 = require("@feathershq/pinion");
5
- const commons_1 = require("../../commons");
6
- const template = ({ camelName, authentication, isEntityService, path, lib, language, className, relative, schema, fileName }) => /* ts */ `// For more information about this file see https://dove.feathersjs.com/guides/cli/service.html
1
+ import { toFile, after, prepend } from '@featherscloud/pinion';
2
+ import { fileExists, injectSource, renderSource } from '../../commons.js';
3
+ export const template = ({ camelName, authentication, isEntityService, path, lib, language, className, relative, schema, fileName }) => /* ts */ `// For more information about this file see https://dove.feathersjs.com/guides/cli/service.html
7
4
  ${authentication || isEntityService ? `import { authenticate } from '@feathersjs/authentication'` : ''}
8
5
  ${schema
9
6
  ? `
@@ -24,7 +21,7 @@ import {
24
21
 
25
22
  import type { Application } from '${relative}/declarations'
26
23
  import { ${className}, getOptions } from './${fileName}.class'
27
- ${(0, commons_1.fileExists)(lib, `client.${language}`)
24
+ ${fileExists(lib, `client.${language}`)
28
25
  ? `import { ${camelName}Path, ${camelName}Methods } from './${fileName}.shared'`
29
26
  : `
30
27
  export const ${camelName}Path = '${path}'
@@ -102,16 +99,14 @@ declare module '${relative}/declarations' {
102
99
  }
103
100
  }
104
101
  `;
105
- exports.template = template;
106
- const toServiceIndex = (0, pinion_1.toFile)(({ lib }) => [lib, 'services', `index`]);
107
- const generate = (ctx) => (0, pinion_1.generator)(ctx)
108
- .then((0, commons_1.renderSource)(exports.template, (0, pinion_1.toFile)(({ lib, fileName, folder }) => [
102
+ const toServiceIndex = toFile(({ lib }) => [lib, 'services', `index`]);
103
+ export const generate = (ctx) => Promise.resolve(ctx)
104
+ .then(renderSource(template, toFile(({ lib, fileName, folder }) => [
109
105
  lib,
110
106
  'services',
111
107
  ...folder,
112
108
  `${fileName}`
113
109
  ])))
114
- .then((0, commons_1.injectSource)(({ camelName, folder, fileName }) => `import { ${camelName} } from './${folder.join('/')}/${fileName}'`, (0, pinion_1.prepend)(), toServiceIndex))
115
- .then((0, commons_1.injectSource)(({ camelName }) => ` app.configure(${camelName})`, (0, pinion_1.after)('export const services'), toServiceIndex));
116
- exports.generate = generate;
110
+ .then(injectSource(({ camelName, folder, fileName }) => `import { ${camelName} } from './${folder.join('/')}/${fileName}'`, prepend(), toServiceIndex))
111
+ .then(injectSource(({ camelName }) => ` app.configure(${camelName})`, after('export const services'), toServiceIndex));
117
112
  //# sourceMappingURL=service.tpl.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"service.tpl.js","sourceRoot":"","sources":["../../../src/service/templates/service.tpl.ts"],"names":[],"mappings":";;;AAAA,+CAAsE;AACtE,2CAAsE;AAG/D,MAAM,QAAQ,GAAG,CAAC,EACvB,SAAS,EACT,cAAc,EACd,eAAe,EACf,IAAI,EACJ,GAAG,EACH,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,MAAM,EACN,QAAQ,EACgB,EAAE,EAAE,CAAC,QAAQ,CAAC;EACtC,cAAc,IAAI,eAAe,CAAC,CAAC,CAAC,2DAA2D,CAAC,CAAC,CAAC,EAAE;EAEpG,MAAM;IACJ,CAAC,CAAC;;;;IAIF,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;YACD,QAAQ;CACnB;IACG,CAAC,CAAC,EACN;;oCAEoC,QAAQ;WACjC,SAAS,0BAA0B,QAAQ;EAEpD,IAAA,oBAAU,EAAC,GAAG,EAAE,UAAU,QAAQ,EAAE,CAAC;IACnC,CAAC,CAAC,YAAY,SAAS,SAAS,SAAS,qBAAqB,QAAQ,UAAU;IAChF,CAAC,CAAC;e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H,YAAY,CACV,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,EAAE,CAClC,YAAY,SAAS,cAAc,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,QAAQ,GAAG,EACpE,OAAO,EAAE,EACT,cAAc,CACf,CACF;KACA,IAAI,CACH,YAAY,CACV,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,mBAAmB,SAAS,GAAG,EAClD,KAAK,CAAC,uBAAuB,CAAC,EAC9B,cAAc,CACf,CACF,CAAA"}
@@ -1,6 +1,6 @@
1
- import { generator, toFile, after, prepend } from '@feathershq/pinion'
2
- import { fileExists, injectSource, renderSource } from '../../commons'
3
- import { ServiceGeneratorContext } from '../index'
1
+ import { toFile, after, prepend } from '@featherscloud/pinion'
2
+ import { fileExists, injectSource, renderSource } from '../../commons.js'
3
+ import { ServiceGeneratorContext } from '../index.js'
4
4
 
5
5
  export const template = ({
6
6
  camelName,
@@ -132,7 +132,7 @@ declare module '${relative}/declarations' {
132
132
  const toServiceIndex = toFile(({ lib }: ServiceGeneratorContext) => [lib, 'services', `index`])
133
133
 
134
134
  export const generate = (ctx: ServiceGeneratorContext) =>
135
- generator(ctx)
135
+ Promise.resolve(ctx)
136
136
  .then(
137
137
  renderSource(
138
138
  template,
@@ -1,2 +1,2 @@
1
- import { ServiceGeneratorContext } from '../index';
1
+ import { ServiceGeneratorContext } from '../index.js';
2
2
  export declare const generate: (ctx: ServiceGeneratorContext) => Promise<ServiceGeneratorContext>;
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.generate = void 0;
4
- const pinion_1 = require("@feathershq/pinion");
5
- const commons_1 = require("../../commons");
1
+ import { toFile, when } from '@featherscloud/pinion';
2
+ import { fileExists, renderSource } from '../../commons.js';
6
3
  const sharedTemplate = ({ camelName, upperName, className, fileName, relative, path }) => /* ts */ `// For more information about this file see https://dove.feathersjs.com/guides/cli/service.shared.html
7
4
  import type { Params } from '@feathersjs/feathers'
8
5
  import type { ClientApplication } from '${relative}/client'
@@ -40,11 +37,10 @@ declare module '${relative}/client' {
40
37
  }
41
38
  }
42
39
  `;
43
- const generate = async (ctx) => (0, pinion_1.generator)(ctx).then((0, pinion_1.when)(({ lib, language }) => (0, commons_1.fileExists)(lib, `client.${language}`), (0, commons_1.renderSource)(sharedTemplate, (0, pinion_1.toFile)(({ lib, folder, fileName }) => [
40
+ export const generate = async (ctx) => Promise.resolve(ctx).then(when(({ lib, language }) => fileExists(lib, `client.${language}`), renderSource(sharedTemplate, toFile(({ lib, folder, fileName }) => [
44
41
  lib,
45
42
  'services',
46
43
  ...folder,
47
44
  `${fileName}.shared`
48
45
  ]))));
49
- exports.generate = generate;
50
46
  //# sourceMappingURL=shared.tpl.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"shared.tpl.js","sourceRoot":"","sources":["../../../src/service/templates/shared.tpl.ts"],"names":[],"mappings":";;;AAAA,+CAA4D;AAC5D,2CAAwD;AAGxD,MAAM,cAAc,GAAG,CAAC,EACtB,SAAS,EACT,SAAS,EACT,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,IAAI,EACoB,EAAE,EAAE,CAAC,QAAQ,CAAC;;0CAEE,QAAQ;;IAE9C,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;YACD,QAAQ;;gBAEJ,SAAS,KAAK,SAAS,SAAS,SAAS,UAAU,SAAS;;cAE9D,SAAS;IACnB,SAAS,WAAW,SAAS;WACtB,SAAS;;;eAGL,SAAS,WAAW,IAAI;;eAExB,SAAS;;eAET,SAAS;;;eAGT,SAAS,4BAA4B,SAAS;eAC9C,SAAS;;;;;kBAKN,QAAQ;;OAEnB,SAAS,UAAU,SAAS;;;CAGlC,CAAA;AAEM,MAAM,QAAQ,GAAG,KAAK,EAAE,GAA4B,EAAE,EAAE,CAC7D,IAAA,kBAAS,EAAC,GAAG,CAAC,CAAC,IAAI,CACjB,IAAA,aAA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AAE,EAAE,CAAC,UAAU,CAAC,GAAG,EAAE,UAAU,QAAQ,EAAE,CAAC,EAC5D,YAAY,CACV,cAAc,EACd,MAAM,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,EAA2B,EAAE,EAAE,CAAC;IAC7D,GAAG;IACH,UAAU;IACV,GAAG,MAAM;IACT,GAAG,QAAQ,SAAS;CACrB,CAAC,CACH,CACF,CACF,CAAA"}
@@ -1,6 +1,6 @@
1
- import { generator, toFile, when } from '@feathershq/pinion'
2
- import { fileExists, renderSource } from '../../commons'
3
- import { ServiceGeneratorContext } from '../index'
1
+ import { toFile, when } from '@featherscloud/pinion'
2
+ import { fileExists, renderSource } from '../../commons.js'
3
+ import { ServiceGeneratorContext } from '../index.js'
4
4
 
5
5
  const sharedTemplate = ({
6
6
  camelName,
@@ -48,7 +48,7 @@ declare module '${relative}/client' {
48
48
  `
49
49
 
50
50
  export const generate = async (ctx: ServiceGeneratorContext) =>
51
- generator(ctx).then(
51
+ Promise.resolve(ctx).then(
52
52
  when<ServiceGeneratorContext>(
53
53
  ({ lib, language }) => fileExists(lib, `client.${language}`),
54
54
  renderSource(
@@ -1,2 +1,2 @@
1
- import { ServiceGeneratorContext } from '../index';
1
+ import { ServiceGeneratorContext } from '../index.js';
2
2
  export declare const generate: (ctx: ServiceGeneratorContext) => Promise<ServiceGeneratorContext>;
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.generate = void 0;
4
- const pinion_1 = require("@feathershq/pinion");
5
- const commons_1 = require("../../commons");
1
+ import { toFile } from '@featherscloud/pinion';
2
+ import { renderSource } from '../../commons.js';
6
3
  const template = ({ relative, lib, path }) => /* ts */ `// For more information about this file see https://dove.feathersjs.com/guides/cli/service.test.html
7
4
  import assert from 'assert'
8
5
  import { app } from '../${relative}/${lib}/app'
@@ -15,11 +12,10 @@ describe('${path} service', () => {
15
12
  })
16
13
  })
17
14
  `;
18
- const generate = (ctx) => (0, pinion_1.generator)(ctx).then((0, commons_1.renderSource)(template, (0, pinion_1.toFile)(({ test, folder, fileName }) => [
15
+ export const generate = (ctx) => Promise.resolve(ctx).then(renderSource(template, toFile(({ test, folder, fileName }) => [
19
16
  test,
20
17
  'services',
21
18
  ...folder,
22
19
  `${fileName}.test`
23
20
  ])));
24
- exports.generate = generate;
25
21
  //# sourceMappingURL=test.tpl.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"test.tpl.js","sourceRoot":"","sources":["../../../src/service/templates/test.tpl.ts"],"names":[],"mappings":";;;AAAA,+CAAsD;AACtD,2CAA4C;AAG5C,MAAM,QAAQ,GAAG,CAAC,EAChB,QAAQ,EACR,GAAG,EACH,IAAI,EACoB,EAAE,EAAE,CAAC,QAAQ,CAAC;;0BAEd,QAAQ,IAAI,GAAG;;YAE7B,IAAI;;mCAEmB,IAAI;;;;;CAKtC,CAAA;AAEM,MAAM,QAAQ,GAAG,CAAC,GAA4B,EAAE,EAAE,CACvD,IAAA,kBAAS,EAAC,GAAG,CAAC,CAAC,IAAI,CACjB,IAAA,sBAAY,EACV,QAAQ,EACR,IAAA,eAAM,EAA0B,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC;IAC9D,IAAI;IACJ,UAAU;IACV,GAAG,MAAM;IACT,GAAG,QAAQ,OAAO;CACnB,CAAC,CACH,CACF,CAAA;AAXU,QAAA,QAAQ,YAWlB"}
1
+ {"version":3,"file":"test.tpl.js","sourceRoot":"","sources":["../../../src/service/templates/test.tpl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAG/C,MAAM,QAAQ,GAAG,CAAC,EAChB,QAAQ,EACR,GAAG,EACH,IAAI,EACoB,EAAE,EAAE,CAAC,QAAQ,CAAC;;0BAEd,QAAQ,IAAI,GAAG;;YAE7B,IAAI;;mCAEmB,IAAI;;;;;CAKtC,CAAA;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,GAA4B,EAAE,EAAE,CACvD,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,CACvB,YAAY,CACV,QAAQ,EACR,MAAM,CAA0B,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC;IAC9D,IAAI;IACJ,UAAU;IACV,GAAG,MAAM;IACT,GAAG,QAAQ,OAAO;CACnB,CAAC,CACH,CACF,CAAA"}
@@ -1,6 +1,6 @@
1
- import { generator, toFile } from '@feathershq/pinion'
2
- import { renderSource } from '../../commons'
3
- import { ServiceGeneratorContext } from '../index'
1
+ import { toFile } from '@featherscloud/pinion'
2
+ import { renderSource } from '../../commons.js'
3
+ import { ServiceGeneratorContext } from '../index.js'
4
4
 
5
5
  const template = ({
6
6
  relative,
@@ -20,7 +20,7 @@ describe('${path} service', () => {
20
20
  `
21
21
 
22
22
  export const generate = (ctx: ServiceGeneratorContext) =>
23
- generator(ctx).then(
23
+ Promise.resolve(ctx).then(
24
24
  renderSource(
25
25
  template,
26
26
  toFile<ServiceGeneratorContext>(({ test, folder, fileName }) => [
@@ -1,3 +1,3 @@
1
- import { ServiceGeneratorContext } from '../index';
1
+ import { ServiceGeneratorContext } from '../index.js';
2
2
  export declare const template: ({ className, upperName, schema, fileName, relative }: ServiceGeneratorContext) => string;
3
3
  export declare const generate: (ctx: ServiceGeneratorContext) => Promise<ServiceGeneratorContext>;
@@ -1,9 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.generate = exports.template = void 0;
4
- const pinion_1 = require("@feathershq/pinion");
5
- const commons_1 = require("../../commons");
6
- const template = ({ className, upperName, schema, fileName, relative }) => /* ts */ `// For more information about this file see https://dove.feathersjs.com/guides/cli/service.class.html#custom-services
1
+ import { toFile } from '@featherscloud/pinion';
2
+ import { renderSource } from '../../commons.js';
3
+ export const template = ({ className, upperName, schema, fileName, relative }) => /* ts */ `// For more information about this file see https://dove.feathersjs.com/guides/cli/service.class.html#custom-services
7
4
  import type { Id, NullableId, Params, ServiceInterface } from '@feathersjs/feathers'
8
5
 
9
6
  import type { Application } from '${relative}/declarations'
@@ -90,12 +87,10 @@ export const getOptions = (app: Application) => {
90
87
  return { app }
91
88
  }
92
89
  `;
93
- exports.template = template;
94
- const generate = (ctx) => (0, pinion_1.generator)(ctx).then((0, commons_1.renderSource)(exports.template, (0, pinion_1.toFile)(({ lib, folder, fileName }) => [
90
+ export const generate = (ctx) => Promise.resolve(ctx).then(renderSource(template, toFile(({ lib, folder, fileName }) => [
95
91
  lib,
96
92
  'services',
97
93
  ...folder,
98
94
  `${fileName}.class`
99
95
  ])));
100
- exports.generate = generate;
101
96
  //# sourceMappingURL=custom.tpl.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"custom.tpl.js","sourceRoot":"","sources":["../../../src/service/type/custom.tpl.ts"],"names":[],"mappings":";;;AAAA,+CAAsD;AACtD,2CAA4C;AAGrC,MAAM,QAAQ,GAAG,CAAC,EACvB,SAAS,EACT,SAAS,EACT,MAAM,EACN,QAAQ,EACR,QAAQ,EACgB,EAAE,EAAE,CAAC,QAAQ,CAAC;;;oCAGJ,QAAQ;EAE1C,MAAM;IACJ,CAAC,CAAC;IACF,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;YACD,QAAQ;CACnB;IACG,CAAC,CAAC;OACC,SAAS;OACT,SAAS;OACT,SAAS;OACT,SAAS;CAEhB;;gBAEgB,SAAS,KAAK,SAAS,SAAS,SAAS,UAAU,SAAS;;mBAEzD,SAAS;;;;mBAIT,SAAS,yBAAyB,SAAS;;;;;eAK/C,SAAS,0BAA0B,SAAS,YAAY,SAAS;kCAC9C,SAAS,KAAK,SAAS,wBAAwB,SAAS;iCACzD,SAAS;;;kDAGQ,SAAS;;;;yDAIF,SAAS;;;;;;;wBAO1C,SAAS,0CAA0C,SAAS;wB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C,SAAS,KAAK,SAAS,wBAAwB,SAAS;iCACzD,SAAS;;;kDAGQ,SAAS;;;;yDAIF,SAAS;;;;;;;wBAO1C,SAAS,0CAA0C,SAAS;wBAC5D,SAAS,4CAA4C,SAAS;wBAC9D,SAAS,QAAQ,SAAS,4CAA4C,SAAS,IAAI,SAAS;;;;;;;;;;;;wCAY5E,SAAS,2CAA2C,SAAS;;;;;;;uCAO9D,SAAS,4CAA4C,SAAS;;;;;;;;oEAQjC,SAAS;;;;;;;;;;;CAW5E,CAAA;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,GAA4B,EAAE,EAAE,CACvD,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,CACvB,YAAY,CACV,QAAQ,EACR,MAAM,CAA0B,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC;IAC7D,GAAG;IACH,UAAU;IACV,GAAG,MAAM;IACT,GAAG,QAAQ,QAAQ;CACpB,CAAC,CACH,CACF,CAAA"}
@@ -1,6 +1,6 @@
1
- import { generator, toFile } from '@feathershq/pinion'
2
- import { renderSource } from '../../commons'
3
- import { ServiceGeneratorContext } from '../index'
1
+ import { toFile } from '@featherscloud/pinion'
2
+ import { renderSource } from '../../commons.js'
3
+ import { ServiceGeneratorContext } from '../index.js'
4
4
 
5
5
  export const template = ({
6
6
  className,
@@ -99,7 +99,7 @@ export const getOptions = (app: Application) => {
99
99
  `
100
100
 
101
101
  export const generate = (ctx: ServiceGeneratorContext) =>
102
- generator(ctx).then(
102
+ Promise.resolve(ctx).then(
103
103
  renderSource(
104
104
  template,
105
105
  toFile<ServiceGeneratorContext>(({ lib, folder, fileName }) => [
@@ -1,3 +1,3 @@
1
- import { ServiceGeneratorContext } from '../index';
1
+ import { ServiceGeneratorContext } from '../index.js';
2
2
  export declare const template: ({ className, upperName, feathers, schema, fileName, relative }: ServiceGeneratorContext) => string;
3
3
  export declare const generate: (ctx: ServiceGeneratorContext) => Promise<ServiceGeneratorContext>;
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.generate = exports.template = void 0;
4
- const pinion_1 = require("@feathershq/pinion");
5
- const commons_1 = require("../../commons");
1
+ import { toFile } from '@featherscloud/pinion';
2
+ import { renderSource, yyyymmddhhmmss } from '../../commons.js';
6
3
  const migrationTemplate = ({ kebabPath, authStrategies, isEntityService }) => /* ts */ `// For more information about this file see https://dove.feathersjs.com/guides/cli/knexfile.html
7
4
  import type { Knex } from 'knex'
8
5
 
@@ -27,7 +24,7 @@ export async function down(knex: Knex): Promise<void> {
27
24
  await knex.schema.dropTable('${kebabPath}')
28
25
  }
29
26
  `;
30
- const template = ({ className, upperName, feathers, schema, fileName, relative }) => /* ts */ `// For more information about this file see https://dove.feathersjs.com/guides/cli/service.class.html#database-services
27
+ export const template = ({ className, upperName, feathers, schema, fileName, relative }) => /* ts */ `// For more information about this file see https://dove.feathersjs.com/guides/cli/service.class.html#database-services
31
28
  import type { Params } from '@feathersjs/feathers'
32
29
  import { KnexService } from '@feathersjs/knex'
33
30
  import type { KnexAdapterParams, KnexAdapterOptions } from '@feathersjs/knex'
@@ -66,14 +63,12 @@ export const getOptions = (app: Application): KnexAdapterOptions => {
66
63
  }
67
64
  }
68
65
  `;
69
- exports.template = template;
70
- const generate = (ctx) => (0, pinion_1.generator)(ctx)
71
- .then((0, commons_1.renderSource)(exports.template, (0, pinion_1.toFile)(({ lib, folder, fileName }) => [
66
+ export const generate = (ctx) => Promise.resolve(ctx)
67
+ .then(renderSource(template, toFile(({ lib, folder, fileName }) => [
72
68
  lib,
73
69
  'services',
74
70
  ...folder,
75
71
  `${fileName}.class`
76
72
  ])))
77
- .then((0, commons_1.renderSource)(migrationTemplate, (0, pinion_1.toFile)('migrations', ({ kebabName }) => `${(0, commons_1.yyyymmddhhmmss)()}_${kebabName}`)));
78
- exports.generate = generate;
73
+ .then(renderSource(migrationTemplate, toFile('migrations', ({ kebabName }) => `${yyyymmddhhmmss()}_${kebabName}`)));
79
74
  //# sourceMappingURL=knex.tpl.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"knex.tpl.js","sourceRoot":"","sources":["../../../src/service/type/knex.tpl.ts"],"names":[],"mappings":";;;AAAA,+CAAsD;AACtD,2CAA4D;AAG5D,MAAM,iBAAiB,GAAG,CAAC,EACzB,SAAS,EACT,cAAc,EACd,eAAe,EACS,EAAE,EAAE,CAAC,QAAQ,CAAC;;;;mCAIL,SAAS;;MAGtC,eAAe;IACb,CAAC,CAAC,cAAc;SACX,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CACZ,IAAI,KAAK,OAAO;QACd,CAAC,CAAC;;6BAEW;QACb,CAAC,CAAC;oBACE,IAAI,MAAM,CACjB;SACA,IAAI,CAAC,IAAI,CAAC;IACf,CAAC,CAAC;yBAEN;;;;;iCAK6B,SAAS;;CAEzC,CAAA;AAEM,MAAM,QAAQ,GAAG,CAAC,EACvB,SAAS,EACT,SAAS,EACT,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,QAAQ,EACgB,EAAE,EAAE,CAAC,QAAQ,CAAC;;;;;oCAKJ,QAAQ;EAE1C,MAAM;IACJ,CAAC,CAAC;IACF,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;YACD,QAAQ;CACnB;IACG,CAAC,CAAC;OACC,SAAS;OACT,SAAS;OACT,SAAS;OACT,SAAS;CAEhB;;gBAEgB,SAAS,KAAK,SAAS,SAAS,SAAS,UAAU,SAAS;;mBAEzD,SAAS,oCAAoC,SAAS;;;;eAI1D,SAAS,mCAAmC,SAAS;wBAC5C,SAAS,KAAK,SAAS,SAAS,SAAS,WAAW,SAAS;;;;;;sBAM/D,QAAQ,CAAC,QAAQ;aAC1B,QAAQ;;;CAGpB,CAAA;AA/CY,QAAA,QAAQ,YA+CpB;AAEM,MAAM,QAAQ,GAAG,CAAC,GAA4B,EAAE,EAAE,CACvD,IAAA,kBAAS,EAAC,GAAG,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