@feathersjs/cli 5.0.0-pre.33 → 5.0.0-pre.35

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 (175) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/lib/index.d.ts +6 -2
  3. package/lib/index.js +59 -2
  4. package/lib/index.js.map +1 -1
  5. package/package.json +30 -30
  6. package/lib/app/index.d.ts +0 -29
  7. package/lib/app/index.js +0 -146
  8. package/lib/app/index.js.map +0 -1
  9. package/lib/app/index.ts +0 -227
  10. package/lib/app/static/.gitignore +0 -121
  11. package/lib/app/templates/app.test.tpl.d.ts +0 -2
  12. package/lib/app/templates/app.test.tpl.js +0 -48
  13. package/lib/app/templates/app.test.tpl.js.map +0 -1
  14. package/lib/app/templates/app.test.tpl.ts +0 -47
  15. package/lib/app/templates/app.tpl.d.ts +0 -2
  16. package/lib/app/templates/app.tpl.js +0 -121
  17. package/lib/app/templates/app.tpl.js.map +0 -1
  18. package/lib/app/templates/app.tpl.ts +0 -136
  19. package/lib/app/templates/channels.tpl.d.ts +0 -2
  20. package/lib/app/templates/channels.tpl.js +0 -48
  21. package/lib/app/templates/channels.tpl.js.map +0 -1
  22. package/lib/app/templates/channels.tpl.ts +0 -54
  23. package/lib/app/templates/client.test.tpl.d.ts +0 -2
  24. package/lib/app/templates/client.test.tpl.js +0 -27
  25. package/lib/app/templates/client.test.tpl.js.map +0 -1
  26. package/lib/app/templates/client.test.tpl.ts +0 -26
  27. package/lib/app/templates/client.tpl.d.ts +0 -2
  28. package/lib/app/templates/client.tpl.js +0 -37
  29. package/lib/app/templates/client.tpl.js.map +0 -1
  30. package/lib/app/templates/client.tpl.ts +0 -44
  31. package/lib/app/templates/config.tpl.d.ts +0 -2
  32. package/lib/app/templates/config.tpl.js +0 -30
  33. package/lib/app/templates/config.tpl.js.map +0 -1
  34. package/lib/app/templates/config.tpl.ts +0 -31
  35. package/lib/app/templates/declarations.tpl.d.ts +0 -2
  36. package/lib/app/templates/declarations.tpl.js +0 -27
  37. package/lib/app/templates/declarations.tpl.js.map +0 -1
  38. package/lib/app/templates/declarations.tpl.ts +0 -36
  39. package/lib/app/templates/index.html.tpl.d.ts +0 -2
  40. package/lib/app/templates/index.html.tpl.js +0 -45
  41. package/lib/app/templates/index.html.tpl.js.map +0 -1
  42. package/lib/app/templates/index.html.tpl.ts +0 -44
  43. package/lib/app/templates/index.tpl.d.ts +0 -2
  44. package/lib/app/templates/index.tpl.js +0 -18
  45. package/lib/app/templates/index.tpl.js.map +0 -1
  46. package/lib/app/templates/index.tpl.ts +0 -22
  47. package/lib/app/templates/logger.tpl.d.ts +0 -2
  48. package/lib/app/templates/logger.tpl.js +0 -39
  49. package/lib/app/templates/logger.tpl.js.map +0 -1
  50. package/lib/app/templates/logger.tpl.ts +0 -44
  51. package/lib/app/templates/package.json.tpl.d.ts +0 -2
  52. package/lib/app/templates/package.json.tpl.js +0 -55
  53. package/lib/app/templates/package.json.tpl.js.map +0 -1
  54. package/lib/app/templates/package.json.tpl.ts +0 -68
  55. package/lib/app/templates/prettierrc.tpl.d.ts +0 -2
  56. package/lib/app/templates/prettierrc.tpl.js +0 -11
  57. package/lib/app/templates/prettierrc.tpl.js.map +0 -1
  58. package/lib/app/templates/prettierrc.tpl.ts +0 -14
  59. package/lib/app/templates/readme.md.tpl.d.ts +0 -2
  60. package/lib/app/templates/readme.md.tpl.js +0 -54
  61. package/lib/app/templates/readme.md.tpl.js.map +0 -1
  62. package/lib/app/templates/readme.md.tpl.ts +0 -57
  63. package/lib/app/templates/schemas.tpl.d.ts +0 -2
  64. package/lib/app/templates/schemas.tpl.js +0 -75
  65. package/lib/app/templates/schemas.tpl.js.map +0 -1
  66. package/lib/app/templates/schemas.tpl.ts +0 -89
  67. package/lib/app/templates/services.tpl.d.ts +0 -2
  68. package/lib/app/templates/services.tpl.js +0 -14
  69. package/lib/app/templates/services.tpl.js.map +0 -1
  70. package/lib/app/templates/services.tpl.ts +0 -18
  71. package/lib/app/templates/tsconfig.json.tpl.d.ts +0 -2
  72. package/lib/app/templates/tsconfig.json.tpl.js +0 -22
  73. package/lib/app/templates/tsconfig.json.tpl.js.map +0 -1
  74. package/lib/app/templates/tsconfig.json.tpl.ts +0 -28
  75. package/lib/authentication/index.d.ts +0 -73
  76. package/lib/authentication/index.js +0 -107
  77. package/lib/authentication/index.js.map +0 -1
  78. package/lib/authentication/index.ts +0 -126
  79. package/lib/authentication/templates/authentication.tpl.d.ts +0 -2
  80. package/lib/authentication/templates/authentication.tpl.js +0 -39
  81. package/lib/authentication/templates/authentication.tpl.js.map +0 -1
  82. package/lib/authentication/templates/authentication.tpl.ts +0 -50
  83. package/lib/authentication/templates/client.test.tpl.d.ts +0 -2
  84. package/lib/authentication/templates/client.test.tpl.js +0 -61
  85. package/lib/authentication/templates/client.test.tpl.js.map +0 -1
  86. package/lib/authentication/templates/client.test.tpl.ts +0 -73
  87. package/lib/authentication/templates/client.tpl.d.ts +0 -2
  88. package/lib/authentication/templates/client.tpl.js +0 -14
  89. package/lib/authentication/templates/client.tpl.js.map +0 -1
  90. package/lib/authentication/templates/client.tpl.ts +0 -19
  91. package/lib/authentication/templates/config.tpl.d.ts +0 -2
  92. package/lib/authentication/templates/config.tpl.js +0 -50
  93. package/lib/authentication/templates/config.tpl.js.map +0 -1
  94. package/lib/authentication/templates/config.tpl.ts +0 -57
  95. package/lib/authentication/templates/declarations.tpl.d.ts +0 -2
  96. package/lib/authentication/templates/declarations.tpl.js +0 -19
  97. package/lib/authentication/templates/declarations.tpl.js.map +0 -1
  98. package/lib/authentication/templates/declarations.tpl.ts +0 -34
  99. package/lib/authentication/templates/knex.tpl.d.ts +0 -2
  100. package/lib/authentication/templates/knex.tpl.js +0 -45
  101. package/lib/authentication/templates/knex.tpl.js.map +0 -1
  102. package/lib/authentication/templates/knex.tpl.ts +0 -62
  103. package/lib/authentication/templates/schema.json.tpl.d.ts +0 -2
  104. package/lib/authentication/templates/schema.json.tpl.js +0 -93
  105. package/lib/authentication/templates/schema.json.tpl.js.map +0 -1
  106. package/lib/authentication/templates/schema.json.tpl.ts +0 -108
  107. package/lib/authentication/templates/schema.typebox.tpl.d.ts +0 -3
  108. package/lib/authentication/templates/schema.typebox.tpl.js +0 -78
  109. package/lib/authentication/templates/schema.typebox.tpl.js.map +0 -1
  110. package/lib/authentication/templates/schema.typebox.tpl.ts +0 -94
  111. package/lib/cli.d.ts +0 -6
  112. package/lib/cli.js +0 -75
  113. package/lib/cli.js.map +0 -1
  114. package/lib/cli.ts +0 -68
  115. package/lib/commons.d.ts +0 -143
  116. package/lib/commons.js +0 -190
  117. package/lib/commons.js.map +0 -1
  118. package/lib/commons.ts +0 -276
  119. package/lib/connection/index.d.ts +0 -55
  120. package/lib/connection/index.js +0 -88
  121. package/lib/connection/index.js.map +0 -1
  122. package/lib/connection/index.ts +0 -123
  123. package/lib/connection/templates/knex.tpl.d.ts +0 -2
  124. package/lib/connection/templates/knex.tpl.js +0 -46
  125. package/lib/connection/templates/knex.tpl.js.map +0 -1
  126. package/lib/connection/templates/knex.tpl.ts +0 -63
  127. package/lib/connection/templates/mongodb.tpl.d.ts +0 -2
  128. package/lib/connection/templates/mongodb.tpl.js +0 -33
  129. package/lib/connection/templates/mongodb.tpl.js.map +0 -1
  130. package/lib/connection/templates/mongodb.tpl.ts +0 -38
  131. package/lib/hook/index.d.ts +0 -22
  132. package/lib/hook/index.js +0 -43
  133. package/lib/hook/index.js.map +0 -1
  134. package/lib/hook/index.ts +0 -47
  135. package/lib/hook/templates/hook.tpl.d.ts +0 -2
  136. package/lib/hook/templates/hook.tpl.js +0 -20
  137. package/lib/hook/templates/hook.tpl.js.map +0 -1
  138. package/lib/hook/templates/hook.tpl.ts +0 -31
  139. package/lib/index.ts +0 -2
  140. package/lib/service/index.d.ts +0 -64
  141. package/lib/service/index.js +0 -116
  142. package/lib/service/index.js.map +0 -1
  143. package/lib/service/index.ts +0 -191
  144. package/lib/service/templates/client.tpl.d.ts +0 -2
  145. package/lib/service/templates/client.tpl.js +0 -31
  146. package/lib/service/templates/client.tpl.js.map +0 -1
  147. package/lib/service/templates/client.tpl.ts +0 -57
  148. package/lib/service/templates/schema.json.tpl.d.ts +0 -2
  149. package/lib/service/templates/schema.json.tpl.js +0 -75
  150. package/lib/service/templates/schema.json.tpl.js.map +0 -1
  151. package/lib/service/templates/schema.json.tpl.ts +0 -87
  152. package/lib/service/templates/schema.typebox.tpl.d.ts +0 -2
  153. package/lib/service/templates/schema.typebox.tpl.js +0 -55
  154. package/lib/service/templates/schema.typebox.tpl.js.map +0 -1
  155. package/lib/service/templates/schema.typebox.tpl.ts +0 -67
  156. package/lib/service/templates/service.tpl.d.ts +0 -3
  157. package/lib/service/templates/service.tpl.js +0 -98
  158. package/lib/service/templates/service.tpl.js.map +0 -1
  159. package/lib/service/templates/service.tpl.ts +0 -134
  160. package/lib/service/templates/test.tpl.d.ts +0 -2
  161. package/lib/service/templates/test.tpl.js +0 -24
  162. package/lib/service/templates/test.tpl.js.map +0 -1
  163. package/lib/service/templates/test.tpl.ts +0 -28
  164. package/lib/service/type/custom.tpl.d.ts +0 -3
  165. package/lib/service/type/custom.tpl.js +0 -94
  166. package/lib/service/type/custom.tpl.js.map +0 -1
  167. package/lib/service/type/custom.tpl.ts +0 -99
  168. package/lib/service/type/knex.tpl.d.ts +0 -3
  169. package/lib/service/type/knex.tpl.js +0 -67
  170. package/lib/service/type/knex.tpl.js.map +0 -1
  171. package/lib/service/type/knex.tpl.ts +0 -88
  172. package/lib/service/type/mongodb.tpl.d.ts +0 -3
  173. package/lib/service/type/mongodb.tpl.js +0 -47
  174. package/lib/service/type/mongodb.tpl.js.map +0 -1
  175. package/lib/service/type/mongodb.tpl.ts +0 -59
@@ -1,62 +0,0 @@
1
- import { generator, when, toFile } from '@feathershq/pinion'
2
- import { getDatabaseAdapter, renderSource } from '../../commons'
3
- import { AuthenticationGeneratorContext } from '../index'
4
-
5
- const migrationTemplate = ({
6
- kebabPath,
7
- authStrategies
8
- }: AuthenticationGeneratorContext) => /* ts */ `import type { Knex } from 'knex'
9
-
10
- export async function up(knex: Knex): Promise<void> {
11
- await knex.schema.alterTable('${kebabPath}', function (table) {
12
- table.dropColumn('text')${authStrategies
13
- .map((name) =>
14
- name === 'local'
15
- ? `
16
- table.string('email').unique()
17
- table.string('password')`
18
- : `
19
- table.string('${name}Id')`
20
- )
21
- .join('\n')}
22
- })
23
- }
24
-
25
- export async function down(knex: Knex): Promise<void> {
26
- await knex.schema.alterTable('${kebabPath}', function (table) {
27
- table.string('text')${authStrategies
28
- .map((name) =>
29
- name === 'local'
30
- ? `
31
- table.dropColumn('email')
32
- table.dropColumn('password')`
33
- : `
34
- table.dropColumn('${name}Id')
35
- `
36
- )
37
- .join('\n')}
38
- })
39
- }
40
- `
41
-
42
- export const generate = (ctx: AuthenticationGeneratorContext) =>
43
- generator(ctx).then(
44
- when(
45
- (ctx) => getDatabaseAdapter(ctx.feathers?.database) === 'knex',
46
- renderSource(
47
- migrationTemplate,
48
- toFile(
49
- toFile<AuthenticationGeneratorContext>('migrations', () => {
50
- // Probably not great but it works to align with the Knex migration file format
51
- // We add 2 seconds so that the migrations run in the correct order
52
- const migrationDate = new Date(Date.now() + 2000)
53
- .toISOString()
54
- .replace(/\D/g, '')
55
- .substring(0, 14)
56
-
57
- return `${migrationDate}_authentication`
58
- })
59
- )
60
- )
61
- )
62
- )
@@ -1,2 +0,0 @@
1
- import { AuthenticationGeneratorContext } from '../index';
2
- export declare const generate: (ctx: AuthenticationGeneratorContext) => Promise<AuthenticationGeneratorContext>;
@@ -1,93 +0,0 @@
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");
6
- const index_1 = require("../index");
7
- const template = ({ camelName, upperName, authStrategies, type, relative }) => /* ts */ `import { resolve, querySyntax, getValidator, getDataValidator } from '@feathersjs/schema'
8
- import type { FromSchema } from '@feathersjs/schema'
9
- ${(0, index_1.localTemplate)(authStrategies, `import { passwordHash } from '@feathersjs/authentication-local'`)}
10
-
11
- import type { HookContext } from '${relative}/declarations'
12
- import { dataValidator, queryValidator } from '${relative}/schemas/validators'
13
-
14
- // Main data model schema
15
- export const ${camelName}Schema = {
16
- $id: '${upperName}',
17
- type: 'object',
18
- additionalProperties: false,
19
- required: [ '${type === 'mongodb' ? '_id' : 'id'}'${(0, index_1.localTemplate)(authStrategies, ", 'email'")} ],
20
- properties: {
21
- ${type === 'mongodb' ? '_id' : 'id'}: {
22
- type: '${type === 'mongodb' ? 'string' : 'number'}'
23
- },
24
- ${authStrategies
25
- .map((name) => name === 'local'
26
- ? ` email: { type: 'string' },
27
- password: { type: 'string' }`
28
- : ` ${name}Id: { type: 'string' }`)
29
- .join(',\n')}
30
- }
31
- } as const
32
- export type ${upperName} = FromSchema<typeof ${camelName}Schema>
33
- export const ${camelName}Resolver = resolve<${upperName}, HookContext>({
34
- properties: {}
35
- })
36
-
37
- // Schema for the basic data model (e.g. creating new entries)
38
- export const ${camelName}DataSchema = {
39
- $id: '${upperName}Data',
40
- type: 'object',
41
- additionalProperties: false,
42
- required: [ ],
43
- properties: {
44
- ...${camelName}Schema.properties
45
- }
46
- } as const
47
- export type ${upperName}Data = FromSchema<typeof ${camelName}DataSchema>
48
- export const ${camelName}DataValidator = getDataValidator(${camelName}DataSchema, dataValidator)
49
- export const ${camelName}DataResolver = resolve<${upperName}Data, HookContext>({
50
- properties: {
51
- ${(0, index_1.localTemplate)(authStrategies, `password: passwordHash({ strategy: 'local' })`)}
52
- }
53
- })
54
-
55
- export const ${camelName}ExternalResolver = resolve<${upperName}, HookContext>({
56
- properties: {
57
- // The password should never be visible externally
58
- password: async () => undefined
59
- }
60
- })
61
-
62
- // Schema for allowed query properties
63
- export const ${camelName}QuerySchema = {
64
- $id: '${upperName}Query',
65
- type: 'object',
66
- additionalProperties: false,
67
- properties: {
68
- ...querySyntax(${camelName}Schema.properties)
69
- }
70
- } as const
71
- export type ${upperName}Query = FromSchema<typeof ${camelName}QuerySchema>
72
- export const ${camelName}QueryValidator = getValidator(${camelName}QuerySchema, queryValidator)
73
- export const ${camelName}QueryResolver = resolve<${upperName}Query, HookContext>({
74
- properties: {
75
- // If there is a user (e.g. with authentication), they are only allowed to see their own data
76
- ${type === 'mongodb' ? '_id' : 'id'}: async (value, user, context) => {
77
- if (context.params.user) {
78
- return context.params.user.${type === 'mongodb' ? '_id' : 'id'}
79
- }
80
-
81
- return value
82
- }
83
- }
84
- })
85
- `;
86
- 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 }) => [
87
- lib,
88
- 'services',
89
- ...folder,
90
- `${fileName}.schema`
91
- ]), { force: true })));
92
- exports.generate = generate;
93
- //# sourceMappingURL=schema.json.tpl.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"schema.json.tpl.js","sourceRoot":"","sources":["../../../src/authentication/templates/schema.json.tpl.ts"],"names":[],"mappings":";;;AAAA,+CAA4D;AAC5D,2CAA4C;AAC5C,oCAAwE;AAExE,MAAM,QAAQ,GAAG,CAAC,EAChB,SAAS,EACT,SAAS,EACT,cAAc,EACd,IAAI,EACJ,QAAQ,EACuB,EAAE,EAAE,CAAC,QAAQ,CAAC;;EAE7C,IAAA,qBAAa,EAAC,cAAc,EAAE,iEAAiE,CAAC;;oCAE9D,QAAQ;iDACK,QAAQ;;;eAG1C,SAAS;UACd,SAAS;;;iBAGF,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,IAAI,IAAA,qBAAa,EAAC,cAAc,EAAE,WAAW,CAAC;;MAE1F,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI;eACxB,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ;;MAE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
1
- import { generator, toFile, when } from '@feathershq/pinion'
2
- import { renderSource } from '../../commons'
3
- import { AuthenticationGeneratorContext, localTemplate } from '../index'
4
-
5
- const template = ({
6
- camelName,
7
- upperName,
8
- authStrategies,
9
- type,
10
- relative
11
- }: AuthenticationGeneratorContext) => /* ts */ `import { resolve, querySyntax, getValidator, getDataValidator } from '@feathersjs/schema'
12
- import type { FromSchema } from '@feathersjs/schema'
13
- ${localTemplate(authStrategies, `import { passwordHash } from '@feathersjs/authentication-local'`)}
14
-
15
- import type { HookContext } from '${relative}/declarations'
16
- import { dataValidator, queryValidator } from '${relative}/schemas/validators'
17
-
18
- // Main data model schema
19
- export const ${camelName}Schema = {
20
- $id: '${upperName}',
21
- type: 'object',
22
- additionalProperties: false,
23
- required: [ '${type === 'mongodb' ? '_id' : 'id'}'${localTemplate(authStrategies, ", 'email'")} ],
24
- properties: {
25
- ${type === 'mongodb' ? '_id' : 'id'}: {
26
- type: '${type === 'mongodb' ? 'string' : 'number'}'
27
- },
28
- ${authStrategies
29
- .map((name) =>
30
- name === 'local'
31
- ? ` email: { type: 'string' },
32
- password: { type: 'string' }`
33
- : ` ${name}Id: { type: 'string' }`
34
- )
35
- .join(',\n')}
36
- }
37
- } as const
38
- export type ${upperName} = FromSchema<typeof ${camelName}Schema>
39
- export const ${camelName}Resolver = resolve<${upperName}, HookContext>({
40
- properties: {}
41
- })
42
-
43
- // Schema for the basic data model (e.g. creating new entries)
44
- export const ${camelName}DataSchema = {
45
- $id: '${upperName}Data',
46
- type: 'object',
47
- additionalProperties: false,
48
- required: [ ],
49
- properties: {
50
- ...${camelName}Schema.properties
51
- }
52
- } as const
53
- export type ${upperName}Data = FromSchema<typeof ${camelName}DataSchema>
54
- export const ${camelName}DataValidator = getDataValidator(${camelName}DataSchema, dataValidator)
55
- export const ${camelName}DataResolver = resolve<${upperName}Data, HookContext>({
56
- properties: {
57
- ${localTemplate(authStrategies, `password: passwordHash({ strategy: 'local' })`)}
58
- }
59
- })
60
-
61
- export const ${camelName}ExternalResolver = resolve<${upperName}, HookContext>({
62
- properties: {
63
- // The password should never be visible externally
64
- password: async () => undefined
65
- }
66
- })
67
-
68
- // Schema for allowed query properties
69
- export const ${camelName}QuerySchema = {
70
- $id: '${upperName}Query',
71
- type: 'object',
72
- additionalProperties: false,
73
- properties: {
74
- ...querySyntax(${camelName}Schema.properties)
75
- }
76
- } as const
77
- export type ${upperName}Query = FromSchema<typeof ${camelName}QuerySchema>
78
- export const ${camelName}QueryValidator = getValidator(${camelName}QuerySchema, queryValidator)
79
- export const ${camelName}QueryResolver = resolve<${upperName}Query, HookContext>({
80
- properties: {
81
- // If there is a user (e.g. with authentication), they are only allowed to see their own data
82
- ${type === 'mongodb' ? '_id' : 'id'}: async (value, user, context) => {
83
- if (context.params.user) {
84
- return context.params.user.${type === 'mongodb' ? '_id' : 'id'}
85
- }
86
-
87
- return value
88
- }
89
- }
90
- })
91
- `
92
-
93
- export const generate = (ctx: AuthenticationGeneratorContext) =>
94
- generator(ctx).then(
95
- when<AuthenticationGeneratorContext>(
96
- ({ schema }) => schema === 'json',
97
- renderSource(
98
- template,
99
- toFile(({ lib, folder, fileName }: AuthenticationGeneratorContext) => [
100
- lib,
101
- 'services',
102
- ...folder,
103
- `${fileName}.schema`
104
- ]),
105
- { force: true }
106
- )
107
- )
108
- )
@@ -1,3 +0,0 @@
1
- import { AuthenticationGeneratorContext } from '../index';
2
- export declare const template: ({ camelName, upperName, authStrategies, type, relative }: AuthenticationGeneratorContext) => string;
3
- export declare const generate: (ctx: AuthenticationGeneratorContext) => Promise<AuthenticationGeneratorContext>;
@@ -1,78 +0,0 @@
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 index_1 = require("../index");
7
- const template = ({ camelName, upperName, authStrategies, type, relative }) => /* ts */ `import { resolve } from '@feathersjs/schema'
8
- import { Type, getDataValidator, getValidator, querySyntax } from '@feathersjs/typebox'
9
- import type { Static } from '@feathersjs/typebox'
10
- ${(0, index_1.localTemplate)(authStrategies, `import { passwordHash } from '@feathersjs/authentication-local'`)}
11
-
12
- import type { HookContext } from '${relative}/declarations'
13
- import { dataValidator, queryValidator } from '${relative}/schemas/validators'
14
-
15
- // Main data model schema
16
- export const ${camelName}Schema = Type.Object({
17
- ${type === 'mongodb' ? '_id: Type.String()' : 'id: Type.Number()'},
18
- ${authStrategies
19
- .map((name) => name === 'local'
20
- ? ` email: Type.String(),
21
- password: Type.Optional(Type.String())`
22
- : ` ${name}Id: Type.Optional(Type.String())`)
23
- .join(',\n')}
24
- },{ $id: '${upperName}', additionalProperties: false })
25
- export type ${upperName} = Static<typeof ${camelName}Schema>
26
- export const ${camelName}Resolver = resolve<${upperName}, HookContext>({
27
- properties: {}
28
- })
29
-
30
- export const ${camelName}ExternalResolver = resolve<${upperName}, HookContext>({
31
- properties: {
32
- // The password should never be visible externally
33
- password: async () => undefined
34
- }
35
- })
36
-
37
- // Schema for the basic data model (e.g. creating new entries)
38
- export const ${camelName}DataSchema = Type.Pick(${camelName}Schema, [
39
- ${authStrategies.map((name) => (name === 'local' ? `'email', 'password'` : `'${name}Id'`)).join(', ')}
40
- ],
41
- { $id: '${upperName}Data', additionalProperties: false }
42
- )
43
- export type ${upperName}Data = Static<typeof ${camelName}DataSchema>
44
- export const ${camelName}DataValidator = getDataValidator(${camelName}DataSchema, dataValidator)
45
- export const ${camelName}DataResolver = resolve<${upperName}, HookContext>({
46
- properties: {
47
- ${(0, index_1.localTemplate)(authStrategies, `password: passwordHash({ strategy: 'local' })`)}
48
- }
49
- })
50
-
51
- // Schema for allowed query properties
52
- export const ${camelName}QueryProperties = Type.Pick(${camelName}Schema, ['${type === 'mongodb' ? '_id' : 'id'}', ${authStrategies.map((name) => (name === 'local' ? `'email'` : `'${name}Id'`)).join(', ')}
53
- ])
54
- export const ${camelName}QuerySchema = querySyntax(${camelName}QueryProperties)
55
- export type ${upperName}Query = Static<typeof ${camelName}QuerySchema>
56
- export const ${camelName}QueryValidator = getValidator(${camelName}QuerySchema, queryValidator)
57
- export const ${camelName}QueryResolver = resolve<${upperName}Query, HookContext>({
58
- properties: {
59
- // If there is a user (e.g. with authentication), they are only allowed to see their own data
60
- ${type === 'mongodb' ? '_id' : 'id'}: async (value, user, context) => {
61
- if (context.params.user) {
62
- return context.params.user.${type === 'mongodb' ? '_id' : 'id'}
63
- }
64
-
65
- return value
66
- }
67
- }
68
- })
69
- `;
70
- exports.template = template;
71
- const generate = (ctx) => (0, pinion_1.generator)(ctx).then((0, pinion_1.when)(({ schema }) => schema === 'typebox', (0, commons_1.renderSource)(exports.template, (0, pinion_1.toFile)(({ lib, folder, fileName }) => [
72
- lib,
73
- 'services',
74
- ...folder,
75
- `${fileName}.schema`
76
- ]), { force: true })));
77
- exports.generate = generate;
78
- //# sourceMappingURL=schema.typebox.tpl.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"schema.typebox.tpl.js","sourceRoot":"","sources":["../../../src/authentication/templates/schema.typebox.tpl.ts"],"names":[],"mappings":";;;AAAA,+CAA4D;AAC5D,2CAA4C;AAC5C,oCAAwE;AAEjE,MAAM,QAAQ,GAAG,CAAC,EACvB,SAAS,EACT,SAAS,EACT,cAAc,EACd,IAAI,EACJ,QAAQ,EACuB,EAAE,EAAE,CAAC,QAAQ,CAAC;;;EAG7C,IAAA,qBAAa,EAAC,cAAc,EAAE,iEAAiE,CAAC;;oCAE9D,QAAQ;iDACK,QAAQ;;;eAG1C,SAAS;IACpB,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,mBAAmB;IAC/D,cAAc;KACb,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CACZ,IAAI,KAAK,OAAO;IACd,CAAC,CAAC;yCAC+B;IACjC,CAAC,CAAC,OAAO,IAAI,kCAAkC,CAClD;KACA,IAAI,CAAC,KAAK,CAAC;YACJ,SAAS;cAC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K,SAAS,EACpC,IAAA,sBAAY,EACV,gBAAQ,EACR,IAAA,eAAM,EAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAkC,EAAE,EAAE,CAAC;IACpE,GAAG;IACH,UAAU;IACV,GAAG,MAAM;IACT,GAAG,QAAQ,SAAS;CACrB,CAAC,EACF,EAAE,KAAK,EAAE,IAAI,EAAE,CAChB,CACF,CACF,CAAA;AAfU,QAAA,QAAQ,YAelB"}
@@ -1,94 +0,0 @@
1
- import { generator, toFile, when } from '@feathershq/pinion'
2
- import { renderSource } from '../../commons'
3
- import { AuthenticationGeneratorContext, localTemplate } from '../index'
4
-
5
- export const template = ({
6
- camelName,
7
- upperName,
8
- authStrategies,
9
- type,
10
- relative
11
- }: AuthenticationGeneratorContext) => /* ts */ `import { resolve } from '@feathersjs/schema'
12
- import { Type, getDataValidator, getValidator, querySyntax } from '@feathersjs/typebox'
13
- import type { Static } from '@feathersjs/typebox'
14
- ${localTemplate(authStrategies, `import { passwordHash } from '@feathersjs/authentication-local'`)}
15
-
16
- import type { HookContext } from '${relative}/declarations'
17
- import { dataValidator, queryValidator } from '${relative}/schemas/validators'
18
-
19
- // Main data model schema
20
- export const ${camelName}Schema = Type.Object({
21
- ${type === 'mongodb' ? '_id: Type.String()' : 'id: Type.Number()'},
22
- ${authStrategies
23
- .map((name) =>
24
- name === 'local'
25
- ? ` email: Type.String(),
26
- password: Type.Optional(Type.String())`
27
- : ` ${name}Id: Type.Optional(Type.String())`
28
- )
29
- .join(',\n')}
30
- },{ $id: '${upperName}', additionalProperties: false })
31
- export type ${upperName} = Static<typeof ${camelName}Schema>
32
- export const ${camelName}Resolver = resolve<${upperName}, HookContext>({
33
- properties: {}
34
- })
35
-
36
- export const ${camelName}ExternalResolver = resolve<${upperName}, HookContext>({
37
- properties: {
38
- // The password should never be visible externally
39
- password: async () => undefined
40
- }
41
- })
42
-
43
- // Schema for the basic data model (e.g. creating new entries)
44
- export const ${camelName}DataSchema = Type.Pick(${camelName}Schema, [
45
- ${authStrategies.map((name) => (name === 'local' ? `'email', 'password'` : `'${name}Id'`)).join(', ')}
46
- ],
47
- { $id: '${upperName}Data', additionalProperties: false }
48
- )
49
- export type ${upperName}Data = Static<typeof ${camelName}DataSchema>
50
- export const ${camelName}DataValidator = getDataValidator(${camelName}DataSchema, dataValidator)
51
- export const ${camelName}DataResolver = resolve<${upperName}, HookContext>({
52
- properties: {
53
- ${localTemplate(authStrategies, `password: passwordHash({ strategy: 'local' })`)}
54
- }
55
- })
56
-
57
- // Schema for allowed query properties
58
- export const ${camelName}QueryProperties = Type.Pick(${camelName}Schema, ['${
59
- type === 'mongodb' ? '_id' : 'id'
60
- }', ${authStrategies.map((name) => (name === 'local' ? `'email'` : `'${name}Id'`)).join(', ')}
61
- ])
62
- export const ${camelName}QuerySchema = querySyntax(${camelName}QueryProperties)
63
- export type ${upperName}Query = Static<typeof ${camelName}QuerySchema>
64
- export const ${camelName}QueryValidator = getValidator(${camelName}QuerySchema, queryValidator)
65
- export const ${camelName}QueryResolver = resolve<${upperName}Query, HookContext>({
66
- properties: {
67
- // If there is a user (e.g. with authentication), they are only allowed to see their own data
68
- ${type === 'mongodb' ? '_id' : 'id'}: async (value, user, context) => {
69
- if (context.params.user) {
70
- return context.params.user.${type === 'mongodb' ? '_id' : 'id'}
71
- }
72
-
73
- return value
74
- }
75
- }
76
- })
77
- `
78
-
79
- export const generate = (ctx: AuthenticationGeneratorContext) =>
80
- generator(ctx).then(
81
- when<AuthenticationGeneratorContext>(
82
- ({ schema }) => schema === 'typebox',
83
- renderSource(
84
- template,
85
- toFile(({ lib, folder, fileName }: AuthenticationGeneratorContext) => [
86
- lib,
87
- 'services',
88
- ...folder,
89
- `${fileName}.schema`
90
- ]),
91
- { force: true }
92
- )
93
- )
94
- )
package/lib/cli.d.ts DELETED
@@ -1,6 +0,0 @@
1
- import chalk from 'chalk';
2
- import { Command } from 'commander';
3
- export * from 'commander';
4
- export { chalk };
5
- export declare const commandRunner: (name: string) => (options: any) => Promise<void>;
6
- export declare const program: Command;
package/lib/cli.js DELETED
@@ -1,75 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- var __importDefault = (this && this.__importDefault) || function (mod) {
17
- return (mod && mod.__esModule) ? mod : { "default": mod };
18
- };
19
- Object.defineProperty(exports, "__esModule", { value: true });
20
- exports.program = exports.commandRunner = exports.chalk = void 0;
21
- const chalk_1 = __importDefault(require("chalk"));
22
- exports.chalk = chalk_1.default;
23
- const commander_1 = require("commander");
24
- const pinion_1 = require("@feathershq/pinion");
25
- const commons_1 = require("./commons");
26
- __exportStar(require("commander"), exports);
27
- const commandRunner = (name) => async (options) => {
28
- const ctx = (0, pinion_1.getContext)({
29
- ...options
30
- });
31
- await (0, pinion_1.generator)(ctx)
32
- .then((0, pinion_1.runGenerator)(__dirname, name, 'index'))
33
- .catch((error) => {
34
- const { logger } = ctx.pinion;
35
- logger.error(`Error: ${chalk_1.default.white(error.message)}`);
36
- });
37
- };
38
- exports.commandRunner = commandRunner;
39
- exports.program = new commander_1.Command();
40
- exports.program
41
- .name('feathers')
42
- .description('The Feathers command line interface 🕊️')
43
- .version(commons_1.version)
44
- .showHelpAfterError();
45
- const generate = exports.program.command('generate').alias('g');
46
- generate
47
- .command('app')
48
- .description('Generate a new application')
49
- .option('--name <name>', 'The name of the application')
50
- .action((0, exports.commandRunner)('app'));
51
- generate
52
- .command('service')
53
- .description('Generate a new service')
54
- .option('--name <name>', 'The service name')
55
- .option('--path <path>', 'The path to register the service on')
56
- .option('--type <type>', 'The service type (knex, mongodb, custom)')
57
- .action((0, exports.commandRunner)('service'));
58
- generate
59
- .command('hook')
60
- .description('Generate a hook')
61
- .option('--name <name>', 'The name of the hook')
62
- .option('--type <type>', 'The hook type (around or regular)')
63
- .action((0, exports.commandRunner)('hook'));
64
- generate
65
- .command('connection')
66
- .description('Add a new database connection')
67
- .action((0, exports.commandRunner)('connection'));
68
- generate
69
- .command('authentication')
70
- .description('Add authentication to the application')
71
- .action((0, exports.commandRunner)('authentication'));
72
- generate.description(`Run a generator. Currently available: \n ${generate.commands
73
- .map((cmd) => `${chalk_1.default.blue(cmd.name())}: ${cmd.description()} `)
74
- .join('\n ')}`);
75
- //# sourceMappingURL=cli.js.map
package/lib/cli.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,kDAAyB;AAMhB,gBANF,eAAK,CAME;AALd,yCAAmC;AACnC,+CAAwE;AACxE,uCAAwD;AAExD,4CAAyB;AAGlB,MAAM,aAAa,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,KAAK,EAAE,OAAY,EAAE,EAAE;IACpE,MAAM,GAAG,GAAG,IAAA,mBAAU,EAAsB;QAC1C,GAAG,OAAO;KACX,CAAC,CAAA;IAEF,MAAM,IAAA,kBAAS,EAAC,GAAG,CAAC;SACjB,IAAI,CAAC,IAAA,qBAAY,EAAC,SAAS,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;SAC5C,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;QACf,MAAM,EAAE,MAAM,EAAE,GAAG,GAAG,CAAC,MAAM,CAAA;QAE7B,MAAM,CAAC,KAAK,CAAC,UAAU,eAAK,CAAC,KAAK,CAAC,KAAK,CAA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,gBAAgB,CAAC;KACzB,WAAW,CAAC,uCAAuC,CAAC;KACpD,MAAM,CAAC,IAAA,qBAAa,EAAC,gBAAgB,CAAC,CAAC,CAAA;AAE1C,QAAQ,CAAC,WAAW,CAClB,6CAA6C,QAAQ,CAAC,QAAQ;KAC3D,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,eAAK,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,KAAK,GAAG,CAAC,WAAW,EAAE,GAAG,CAAC;KAChE,IAAI,CAAC,MAAM,CAAC,EAAE,CAClB,CAAA"}
package/lib/cli.ts DELETED
@@ -1,68 +0,0 @@
1
- import chalk from 'chalk'
2
- import { Command } from 'commander'
3
- import { generator, runGenerator, getContext } from '@feathershq/pinion'
4
- import { FeathersBaseContext, version } from './commons'
5
-
6
- export * from 'commander'
7
- export { chalk }
8
-
9
- export const commandRunner = (name: string) => async (options: any) => {
10
- const ctx = getContext<FeathersBaseContext>({
11
- ...options
12
- })
13
-
14
- await generator(ctx)
15
- .then(runGenerator(__dirname, name, 'index'))
16
- .catch((error) => {
17
- const { logger } = ctx.pinion
18
-
19
- logger.error(`Error: ${chalk.white(error.message)}`)
20
- })
21
- }
22
-
23
- export const program = new Command()
24
-
25
- program
26
- .name('feathers')
27
- .description('The Feathers command line interface 🕊️')
28
- .version(version)
29
- .showHelpAfterError()
30
-
31
- const generate = program.command('generate').alias('g')
32
-
33
- generate
34
- .command('app')
35
- .description('Generate a new application')
36
- .option('--name <name>', 'The name of the application')
37
- .action(commandRunner('app'))
38
-
39
- generate
40
- .command('service')
41
- .description('Generate a new service')
42
- .option('--name <name>', 'The service name')
43
- .option('--path <path>', 'The path to register the service on')
44
- .option('--type <type>', 'The service type (knex, mongodb, custom)')
45
- .action(commandRunner('service'))
46
-
47
- generate
48
- .command('hook')
49
- .description('Generate a hook')
50
- .option('--name <name>', 'The name of the hook')
51
- .option('--type <type>', 'The hook type (around or regular)')
52
- .action(commandRunner('hook'))
53
-
54
- generate
55
- .command('connection')
56
- .description('Add a new database connection')
57
- .action(commandRunner('connection'))
58
-
59
- generate
60
- .command('authentication')
61
- .description('Add authentication to the application')
62
- .action(commandRunner('authentication'))
63
-
64
- generate.description(
65
- `Run a generator. Currently available: \n ${generate.commands
66
- .map((cmd) => `${chalk.blue(cmd.name())}: ${cmd.description()} `)
67
- .join('\n ')}`
68
- )