@feathersjs/generators 5.0.13 → 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.
- package/CHANGELOG.md +12 -0
- package/lib/app/index.d.ts +19 -27
- package/lib/app/index.js +25 -30
- package/lib/app/index.js.map +1 -1
- package/lib/app/index.ts +17 -8
- package/lib/app/templates/app.test.tpl.d.ts +5 -2
- package/lib/app/templates/app.test.tpl.js +3 -7
- package/lib/app/templates/app.test.tpl.js.map +1 -1
- package/lib/app/templates/app.test.tpl.ts +4 -4
- package/lib/app/templates/app.tpl.d.ts +1 -1
- package/lib/app/templates/app.tpl.js +3 -7
- package/lib/app/templates/app.tpl.js.map +1 -1
- package/lib/app/templates/app.tpl.ts +4 -4
- package/lib/app/templates/channels.tpl.d.ts +1 -1
- package/lib/app/templates/channels.tpl.js +3 -7
- package/lib/app/templates/channels.tpl.js.map +1 -1
- package/lib/app/templates/channels.tpl.ts +4 -4
- package/lib/app/templates/client.test.tpl.d.ts +1 -1
- package/lib/app/templates/client.test.tpl.js +3 -7
- package/lib/app/templates/client.test.tpl.js.map +1 -1
- package/lib/app/templates/client.test.tpl.ts +4 -4
- package/lib/app/templates/client.tpl.d.ts +1 -1
- package/lib/app/templates/client.tpl.js +3 -7
- package/lib/app/templates/client.tpl.js.map +1 -1
- package/lib/app/templates/client.tpl.ts +4 -4
- package/lib/app/templates/configuration.tpl.d.ts +1 -1
- package/lib/app/templates/configuration.tpl.js +7 -11
- package/lib/app/templates/configuration.tpl.js.map +1 -1
- package/lib/app/templates/configuration.tpl.ts +4 -4
- package/lib/app/templates/declarations.tpl.d.ts +1 -1
- package/lib/app/templates/declarations.tpl.js +2 -6
- package/lib/app/templates/declarations.tpl.js.map +1 -1
- package/lib/app/templates/declarations.tpl.ts +3 -3
- package/lib/app/templates/index.html.tpl.d.ts +5 -2
- package/lib/app/templates/index.html.tpl.js +2 -6
- package/lib/app/templates/index.html.tpl.js.map +1 -1
- package/lib/app/templates/index.html.tpl.ts +3 -3
- package/lib/app/templates/index.tpl.d.ts +1 -1
- package/lib/app/templates/index.tpl.js +3 -7
- package/lib/app/templates/index.tpl.js.map +1 -1
- package/lib/app/templates/index.tpl.ts +4 -4
- package/lib/app/templates/logger.tpl.d.ts +1 -1
- package/lib/app/templates/logger.tpl.js +6 -10
- package/lib/app/templates/logger.tpl.js.map +1 -1
- package/lib/app/templates/logger.tpl.ts +4 -4
- package/lib/app/templates/package.json.tpl.d.ts +5 -2
- package/lib/app/templates/package.json.tpl.js +2 -6
- package/lib/app/templates/package.json.tpl.js.map +1 -1
- package/lib/app/templates/package.json.tpl.ts +3 -3
- package/lib/app/templates/prettierrc.tpl.d.ts +1 -1
- package/lib/app/templates/prettierrc.tpl.js +5 -9
- package/lib/app/templates/prettierrc.tpl.js.map +1 -1
- package/lib/app/templates/prettierrc.tpl.ts +4 -4
- package/lib/app/templates/readme.md.tpl.d.ts +5 -2
- package/lib/app/templates/readme.md.tpl.js +2 -6
- package/lib/app/templates/readme.md.tpl.js.map +1 -1
- package/lib/app/templates/readme.md.tpl.ts +3 -3
- package/lib/app/templates/services.tpl.d.ts +1 -1
- package/lib/app/templates/services.tpl.js +3 -7
- package/lib/app/templates/services.tpl.js.map +1 -1
- package/lib/app/templates/services.tpl.ts +4 -4
- package/lib/app/templates/tsconfig.json.tpl.d.ts +1 -1
- package/lib/app/templates/tsconfig.json.tpl.js +3 -7
- package/lib/app/templates/tsconfig.json.tpl.js.map +1 -1
- package/lib/app/templates/tsconfig.json.tpl.ts +3 -3
- package/lib/app/templates/validators.tpl.d.ts +1 -1
- package/lib/app/templates/validators.tpl.js +3 -7
- package/lib/app/templates/validators.tpl.js.map +1 -1
- package/lib/app/templates/validators.tpl.ts +4 -4
- package/lib/authentication/index.d.ts +10 -10
- package/lib/authentication/index.js +16 -19
- package/lib/authentication/index.js.map +1 -1
- package/lib/authentication/index.ts +65 -56
- package/lib/authentication/templates/authentication.tpl.d.ts +1 -1
- package/lib/authentication/templates/authentication.tpl.js +11 -15
- package/lib/authentication/templates/authentication.tpl.js.map +1 -1
- package/lib/authentication/templates/authentication.tpl.ts +5 -5
- package/lib/authentication/templates/client.test.tpl.d.ts +1 -1
- package/lib/authentication/templates/client.test.tpl.js +7 -11
- package/lib/authentication/templates/client.test.tpl.js.map +1 -1
- package/lib/authentication/templates/client.test.tpl.ts +5 -5
- package/lib/authentication/templates/config.tpl.d.ts +1 -1
- package/lib/authentication/templates/config.tpl.js +8 -15
- package/lib/authentication/templates/config.tpl.js.map +1 -1
- package/lib/authentication/templates/config.tpl.ts +3 -3
- package/lib/authentication/templates/declarations.tpl.d.ts +1 -1
- package/lib/authentication/templates/declarations.tpl.js +5 -9
- package/lib/authentication/templates/declarations.tpl.js.map +1 -1
- package/lib/authentication/templates/declarations.tpl.ts +3 -3
- package/lib/commons.d.ts +10 -2
- package/lib/commons.js +43 -76
- package/lib/commons.js.map +1 -1
- package/lib/commons.ts +22 -4
- package/lib/connection/index.d.ts +1 -1
- package/lib/connection/index.js +24 -30
- package/lib/connection/index.js.map +1 -1
- package/lib/connection/index.ts +10 -4
- package/lib/connection/templates/knex.tpl.d.ts +1 -1
- package/lib/connection/templates/knex.tpl.js +13 -20
- package/lib/connection/templates/knex.tpl.js.map +1 -1
- package/lib/connection/templates/knex.tpl.ts +4 -4
- package/lib/connection/templates/mongodb.tpl.d.ts +1 -1
- package/lib/connection/templates/mongodb.tpl.js +10 -14
- package/lib/connection/templates/mongodb.tpl.js.map +1 -1
- package/lib/connection/templates/mongodb.tpl.ts +4 -4
- package/lib/hook/index.d.ts +6 -6
- package/lib/hook/index.js +13 -17
- package/lib/hook/index.js.map +1 -1
- package/lib/hook/index.ts +7 -3
- package/lib/hook/templates/hook.tpl.d.ts +1 -1
- package/lib/hook/templates/hook.tpl.js +3 -7
- package/lib/hook/templates/hook.tpl.js.map +1 -1
- package/lib/hook/templates/hook.tpl.ts +4 -4
- package/lib/index.d.ts +7 -7
- package/lib/index.js +7 -36
- package/lib/index.js.map +1 -1
- package/lib/index.ts +7 -7
- package/lib/service/index.d.ts +1 -1
- package/lib/service/index.js +27 -31
- package/lib/service/index.js.map +1 -1
- package/lib/service/index.ts +94 -92
- package/lib/service/templates/client.tpl.d.ts +1 -1
- package/lib/service/templates/client.tpl.js +4 -8
- package/lib/service/templates/client.tpl.js.map +1 -1
- package/lib/service/templates/client.tpl.ts +4 -4
- package/lib/service/templates/schema.json.tpl.d.ts +1 -1
- package/lib/service/templates/schema.json.tpl.js +10 -14
- package/lib/service/templates/schema.json.tpl.js.map +1 -1
- package/lib/service/templates/schema.json.tpl.ts +4 -4
- package/lib/service/templates/schema.typebox.tpl.d.ts +1 -1
- package/lib/service/templates/schema.typebox.tpl.js +8 -12
- package/lib/service/templates/schema.typebox.tpl.js.map +1 -1
- package/lib/service/templates/schema.typebox.tpl.ts +4 -4
- package/lib/service/templates/service.tpl.d.ts +1 -1
- package/lib/service/templates/service.tpl.js +9 -14
- package/lib/service/templates/service.tpl.js.map +1 -1
- package/lib/service/templates/service.tpl.ts +4 -4
- package/lib/service/templates/shared.tpl.d.ts +1 -1
- package/lib/service/templates/shared.tpl.js +3 -7
- package/lib/service/templates/shared.tpl.js.map +1 -1
- package/lib/service/templates/shared.tpl.ts +4 -4
- package/lib/service/templates/test.tpl.d.ts +1 -1
- package/lib/service/templates/test.tpl.js +3 -7
- package/lib/service/templates/test.tpl.js.map +1 -1
- package/lib/service/templates/test.tpl.ts +4 -4
- package/lib/service/type/custom.tpl.d.ts +1 -1
- package/lib/service/type/custom.tpl.js +4 -9
- package/lib/service/type/custom.tpl.js.map +1 -1
- package/lib/service/type/custom.tpl.ts +4 -4
- package/lib/service/type/knex.tpl.d.ts +1 -1
- package/lib/service/type/knex.tpl.js +6 -11
- package/lib/service/type/knex.tpl.js.map +1 -1
- package/lib/service/type/knex.tpl.ts +4 -4
- package/lib/service/type/mongodb.tpl.d.ts +1 -1
- package/lib/service/type/mongodb.tpl.js +4 -9
- package/lib/service/type/mongodb.tpl.js.map +1 -1
- package/lib/service/type/mongodb.tpl.ts +4 -4
- package/package.json +31 -30
|
@@ -1,23 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
.then((0, commons_1.initializeBaseContext)())
|
|
13
|
-
.then((0, commons_1.checkPreconditions)())
|
|
14
|
-
.then((0, pinion_1.prompt)((ctx) => [
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
import { dirname } from 'path';
|
|
3
|
+
import { runGenerators, prompt } from '@featherscloud/pinion';
|
|
4
|
+
import { addVersions, checkPreconditions, initializeBaseContext, install } from '../commons.js';
|
|
5
|
+
import { generate as serviceGenerator } from '../service/index.js';
|
|
6
|
+
// Set __dirname in es module
|
|
7
|
+
const __dirname = dirname(new URL(import.meta.url).pathname);
|
|
8
|
+
export const generate = (ctx) => Promise.resolve(ctx)
|
|
9
|
+
.then(initializeBaseContext())
|
|
10
|
+
.then(checkPreconditions())
|
|
11
|
+
.then(prompt((ctx) => [
|
|
15
12
|
{
|
|
16
13
|
type: 'checkbox',
|
|
17
14
|
name: 'authStrategies',
|
|
18
15
|
when: !ctx.authStrategies,
|
|
19
16
|
message: 'Which authentication methods do you want to use?',
|
|
20
|
-
suffix:
|
|
17
|
+
suffix: chalk.grey(' Other methods and providers can be added at any time.'),
|
|
21
18
|
choices: [
|
|
22
19
|
{
|
|
23
20
|
name: 'Email + Password',
|
|
@@ -62,7 +59,7 @@ const generate = (ctx) => (0, pinion_1.generator)(ctx)
|
|
|
62
59
|
}
|
|
63
60
|
]))
|
|
64
61
|
.then(async (ctx) => {
|
|
65
|
-
const serviceContext = await (
|
|
62
|
+
const serviceContext = await serviceGenerator({
|
|
66
63
|
...ctx,
|
|
67
64
|
name: ctx.service,
|
|
68
65
|
isEntityService: true
|
|
@@ -73,7 +70,8 @@ const generate = (ctx) => (0, pinion_1.generator)(ctx)
|
|
|
73
70
|
...serviceContext
|
|
74
71
|
};
|
|
75
72
|
})
|
|
76
|
-
.then(
|
|
73
|
+
.then(runGenerators(__dirname, 'templates'))
|
|
74
|
+
.then((ctx) => ctx)
|
|
77
75
|
.then((ctx) => {
|
|
78
76
|
const dependencies = [];
|
|
79
77
|
dependencies.push('@feathersjs/authentication-oauth');
|
|
@@ -86,7 +84,6 @@ const generate = (ctx) => (0, pinion_1.generator)(ctx)
|
|
|
86
84
|
dependencies: [...ctx.dependencies, ...dependencies]
|
|
87
85
|
};
|
|
88
86
|
}
|
|
89
|
-
return
|
|
87
|
+
return install(addVersions(dependencies, ctx.dependencyVersions), false, ctx.feathers.packager)(ctx);
|
|
90
88
|
});
|
|
91
|
-
exports.generate = generate;
|
|
92
89
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/authentication/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/authentication/index.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,7 +1,17 @@
|
|
|
1
1
|
import chalk from 'chalk'
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { dirname } from 'path'
|
|
3
|
+
import { runGenerators, prompt } from '@featherscloud/pinion'
|
|
4
|
+
import {
|
|
5
|
+
addVersions,
|
|
6
|
+
checkPreconditions,
|
|
7
|
+
FeathersBaseContext,
|
|
8
|
+
initializeBaseContext,
|
|
9
|
+
install
|
|
10
|
+
} from '../commons.js'
|
|
11
|
+
import { generate as serviceGenerator, ServiceGeneratorContext } from '../service/index.js'
|
|
12
|
+
|
|
13
|
+
// Set __dirname in es module
|
|
14
|
+
const __dirname = dirname(new URL(import.meta.url).pathname)
|
|
5
15
|
|
|
6
16
|
export interface AuthenticationGeneratorContext extends ServiceGeneratorContext {
|
|
7
17
|
service: string
|
|
@@ -14,62 +24,60 @@ export type AuthenticationGeneratorArguments = FeathersBaseContext &
|
|
|
14
24
|
Partial<Pick<AuthenticationGeneratorContext, 'service' | 'authStrategies' | 'path' | 'schema' | 'type'>>
|
|
15
25
|
|
|
16
26
|
export const generate = (ctx: AuthenticationGeneratorArguments) =>
|
|
17
|
-
|
|
27
|
+
Promise.resolve(ctx)
|
|
18
28
|
.then(initializeBaseContext())
|
|
19
29
|
.then(checkPreconditions())
|
|
20
30
|
.then(
|
|
21
|
-
prompt
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
]
|
|
72
|
-
)
|
|
31
|
+
prompt((ctx: AuthenticationGeneratorArguments) => [
|
|
32
|
+
{
|
|
33
|
+
type: 'checkbox',
|
|
34
|
+
name: 'authStrategies',
|
|
35
|
+
when: !ctx.authStrategies,
|
|
36
|
+
message: 'Which authentication methods do you want to use?',
|
|
37
|
+
suffix: chalk.grey(' Other methods and providers can be added at any time.'),
|
|
38
|
+
choices: [
|
|
39
|
+
{
|
|
40
|
+
name: 'Email + Password',
|
|
41
|
+
value: 'local',
|
|
42
|
+
checked: true
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: 'Google',
|
|
46
|
+
value: 'google'
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
name: 'Facebook',
|
|
50
|
+
value: 'facebook'
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
name: 'Twitter',
|
|
54
|
+
value: 'twitter'
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
name: 'GitHub',
|
|
58
|
+
value: 'github'
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
name: 'Auth0',
|
|
62
|
+
value: 'auth0'
|
|
63
|
+
}
|
|
64
|
+
]
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
name: 'service',
|
|
68
|
+
type: 'input',
|
|
69
|
+
when: !ctx.service,
|
|
70
|
+
message: 'What is your authentication service name?',
|
|
71
|
+
default: 'user'
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
name: 'path',
|
|
75
|
+
type: 'input',
|
|
76
|
+
when: !ctx.path,
|
|
77
|
+
message: 'What path should the service be registered on?',
|
|
78
|
+
default: 'users'
|
|
79
|
+
}
|
|
80
|
+
])
|
|
73
81
|
)
|
|
74
82
|
.then(async (ctx) => {
|
|
75
83
|
const serviceContext = await serviceGenerator({
|
|
@@ -85,6 +93,7 @@ export const generate = (ctx: AuthenticationGeneratorArguments) =>
|
|
|
85
93
|
}
|
|
86
94
|
})
|
|
87
95
|
.then(runGenerators(__dirname, 'templates'))
|
|
96
|
+
.then((ctx) => ctx as AuthenticationGeneratorContext)
|
|
88
97
|
.then((ctx) => {
|
|
89
98
|
const dependencies: string[] = []
|
|
90
99
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { AuthenticationGeneratorContext } from '../index';
|
|
1
|
+
import { AuthenticationGeneratorContext } from '../index.js';
|
|
2
2
|
export declare const generate: (ctx: AuthenticationGeneratorContext) => Promise<AuthenticationGeneratorContext>;
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const pinion_1 = require("@feathershq/pinion");
|
|
5
|
-
const commons_1 = require("../../commons");
|
|
6
|
-
const commons_2 = require("../../commons");
|
|
1
|
+
import { before, toFile } from '@featherscloud/pinion';
|
|
2
|
+
import { injectSource, renderSource } from '../../commons.js';
|
|
3
|
+
import { localTemplate, oauthTemplate } from '../../commons.js';
|
|
7
4
|
const template = ({ authStrategies }) => /* ts */ `// For more information about this file see https://dove.feathersjs.com/guides/cli/authentication.html
|
|
8
5
|
import { AuthenticationService, JWTStrategy } from '@feathersjs/authentication'
|
|
9
|
-
${
|
|
10
|
-
${
|
|
6
|
+
${localTemplate(authStrategies, `import { LocalStrategy } from '@feathersjs/authentication-local'`)}
|
|
7
|
+
${oauthTemplate(authStrategies, `import { oauth, OAuthStrategy } from '@feathersjs/authentication-oauth'`)}
|
|
11
8
|
|
|
12
9
|
import type { Application } from './declarations'
|
|
13
10
|
|
|
@@ -26,15 +23,14 @@ export const authentication = (app: Application) => {
|
|
|
26
23
|
.join('\n')}
|
|
27
24
|
|
|
28
25
|
app.use('authentication', authentication)
|
|
29
|
-
${
|
|
26
|
+
${oauthTemplate(authStrategies, `app.configure(oauth())`)}
|
|
30
27
|
}
|
|
31
28
|
`;
|
|
32
29
|
const importTemplate = "import { authentication } from './authentication'";
|
|
33
30
|
const configureTemplate = 'app.configure(authentication)';
|
|
34
|
-
const toAppFile =
|
|
35
|
-
const generate = (ctx) =>
|
|
36
|
-
.then(
|
|
37
|
-
.then(
|
|
38
|
-
.then(
|
|
39
|
-
exports.generate = generate;
|
|
31
|
+
const toAppFile = toFile(({ lib }) => [lib, 'app']);
|
|
32
|
+
export const generate = (ctx) => Promise.resolve(ctx)
|
|
33
|
+
.then(renderSource(template, toFile(({ lib }) => lib, 'authentication')))
|
|
34
|
+
.then(injectSource(importTemplate, before('import { services } from'), toAppFile))
|
|
35
|
+
.then(injectSource(configureTemplate, before('app.configure(services)'), toAppFile));
|
|
40
36
|
//# sourceMappingURL=authentication.tpl.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authentication.tpl.js","sourceRoot":"","sources":["../../../src/authentication/templates/authentication.tpl.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"authentication.tpl.js","sourceRoot":"","sources":["../../../src/authentication/templates/authentication.tpl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AACtD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAE7D,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAE/D,MAAM,QAAQ,GAAG,CAAC,EAChB,cAAc,EACiB,EAAE,EAAE,CAAC,QAAQ,CAAC;;EAE7C,aAAa,CAAC,cAAc,EAAE,kEAAkE,CAAC;EACjG,aAAa,CAAC,cAAc,EAAE,yEAAyE,CAAC;;;;;;;;;;;;;;IActG,cAAc;KACb,GAAG,CACF,CAAC,QAAQ,EAAE,EAAE,CACX,8BAA8B,QAAQ,MACpC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,qBACjD,GAAG,CACN;KACA,IAAI,CAAC,IAAI,CAAC;;;IAGX,aAAa,CAAC,cAAc,EAAE,wBAAwB,CAAC;;CAE1D,CAAA;AAED,MAAM,cAAc,GAAG,mDAAmD,CAAA;AAC1E,MAAM,iBAAiB,GAAG,+BAA+B,CAAA;AACzD,MAAM,SAAS,GAAG,MAAM,CAAiC,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,CAAA;AAEnF,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,GAAmC,EAAE,EAAE,CAC9D,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC;KACjB,IAAI,CACH,YAAY,CACV,QAAQ,EACR,MAAM,CAAiC,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,GAAG,EAAE,gBAAgB,CAAC,CAC3E,CACF;KACA,IAAI,CAAC,YAAY,CAAC,cAAc,EAAE,MAAM,CAAC,0BAA0B,CAAC,EAAE,SAAS,CAAC,CAAC;KACjF,IAAI,CAAC,YAAY,CAAC,iBAAiB,EAAE,MAAM,CAAC,yBAAyB,CAAC,EAAE,SAAS,CAAC,CAAC,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { injectSource, renderSource } from '../../commons'
|
|
3
|
-
import { AuthenticationGeneratorContext } from '../index'
|
|
4
|
-
import { localTemplate, oauthTemplate } from '../../commons'
|
|
1
|
+
import { before, toFile } from '@featherscloud/pinion'
|
|
2
|
+
import { injectSource, renderSource } from '../../commons.js'
|
|
3
|
+
import { AuthenticationGeneratorContext } from '../index.js'
|
|
4
|
+
import { localTemplate, oauthTemplate } from '../../commons.js'
|
|
5
5
|
|
|
6
6
|
const template = ({
|
|
7
7
|
authStrategies
|
|
@@ -41,7 +41,7 @@ const configureTemplate = 'app.configure(authentication)'
|
|
|
41
41
|
const toAppFile = toFile<AuthenticationGeneratorContext>(({ lib }) => [lib, 'app'])
|
|
42
42
|
|
|
43
43
|
export const generate = (ctx: AuthenticationGeneratorContext) =>
|
|
44
|
-
|
|
44
|
+
Promise.resolve(ctx)
|
|
45
45
|
.then(
|
|
46
46
|
renderSource(
|
|
47
47
|
template,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { AuthenticationGeneratorContext } from '../index';
|
|
1
|
+
import { AuthenticationGeneratorContext } from '../index.js';
|
|
2
2
|
export declare const generate: (ctx: AuthenticationGeneratorContext) => Promise<AuthenticationGeneratorContext>;
|
|
@@ -1,18 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const pinion_1 = require("@feathershq/pinion");
|
|
5
|
-
const commons_1 = require("../../commons");
|
|
6
|
-
const commons_2 = require("../../commons");
|
|
1
|
+
import { toFile, when } from '@featherscloud/pinion';
|
|
2
|
+
import { fileExists, renderSource } from '../../commons.js';
|
|
3
|
+
import { localTemplate } from '../../commons.js';
|
|
7
4
|
const template = ({ authStrategies, upperName, type, lib }) => /* ts */ `// For more information about this file see https://dove.feathersjs.com/guides/cli/client.test.html
|
|
8
5
|
import assert from 'assert'
|
|
9
6
|
import axios from 'axios'
|
|
10
7
|
|
|
11
8
|
import rest from '@feathersjs/rest-client'
|
|
12
|
-
${
|
|
9
|
+
${localTemplate(authStrategies, `import authenticationClient from '@feathersjs/authentication-client'`)}
|
|
13
10
|
import { app } from '../${lib}/app'
|
|
14
11
|
import { createClient } from '../${lib}/client'
|
|
15
|
-
${
|
|
12
|
+
${localTemplate(authStrategies, `import type { ${upperName}Data } from '../${lib}/client'`)}
|
|
16
13
|
|
|
17
14
|
const port = app.get('port')
|
|
18
15
|
const appUrl = \`http://\${app.get('host')}:\${port}\`
|
|
@@ -32,7 +29,7 @@ describe('application client tests', () => {
|
|
|
32
29
|
assert.ok(client)
|
|
33
30
|
})
|
|
34
31
|
|
|
35
|
-
${
|
|
32
|
+
${localTemplate(authStrategies, `
|
|
36
33
|
it('creates and authenticates a user with email and password', async () => {
|
|
37
34
|
const userData: ${upperName}Data = {
|
|
38
35
|
email: 'someone@example.com',
|
|
@@ -57,6 +54,5 @@ describe('application client tests', () => {
|
|
|
57
54
|
})`)}
|
|
58
55
|
})
|
|
59
56
|
`;
|
|
60
|
-
const generate = (ctx) =>
|
|
61
|
-
exports.generate = generate;
|
|
57
|
+
export const generate = (ctx) => Promise.resolve(ctx).then(when(({ lib, language }) => fileExists(lib, `client.${language}`), renderSource(template, toFile(({ test }) => test, 'client.test'), { force: true })));
|
|
62
58
|
//# sourceMappingURL=client.test.tpl.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.test.tpl.js","sourceRoot":"","sources":["../../../src/authentication/templates/client.test.tpl.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"client.test.tpl.js","sourceRoot":"","sources":["../../../src/authentication/templates/client.test.tpl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAA;AACpD,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAE3D,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAEhD,MAAM,QAAQ,GAAG,CAAC,EAChB,cAAc,EACd,SAAS,EACT,IAAI,EACJ,GAAG,EAC4B,EAAE,EAAE,CAAC,QAAQ,CAAC;;;;;EAK7C,aAAa,CAAC,cAAc,EAAE,sEAAsE,CAAC;0BAC7E,GAAG;mCACM,GAAG;EACpC,aAAa,CAAC,cAAc,EAAE,iBAAiB,SAAS,mBAAmB,GAAG,UAAU,CAAC;;;;;;;;;;;;;;;;;;;;IAoBvF,aAAa,CACb,cAAc,EACd;;sBAEkB,SAAS;;;;;;;;;;;;;;;;;;;6CAmBc,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI;KACzE,CACF;;CAEF,CAAA;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,GAAmC,EAAE,EAAE,CAC9D,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,CACvB,IAAI,CACF,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,UAAU,CAAC,GAAG,EAAE,UAAU,QAAQ,EAAE,CAAC,EAC5D,YAAY,CACV,QAAQ,EACR,MAAM,CAAiC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,EAAE,aAAa,CAAC,EACzE,EAAE,KAAK,EAAE,IAAI,EAAE,CAChB,CACF,CACF,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { fileExists, renderSource } from '../../commons'
|
|
3
|
-
import { AuthenticationGeneratorContext } from '../index'
|
|
4
|
-
import { localTemplate } from '../../commons'
|
|
1
|
+
import { toFile, when } from '@featherscloud/pinion'
|
|
2
|
+
import { fileExists, renderSource } from '../../commons.js'
|
|
3
|
+
import { AuthenticationGeneratorContext } from '../index.js'
|
|
4
|
+
import { localTemplate } from '../../commons.js'
|
|
5
5
|
|
|
6
6
|
const template = ({
|
|
7
7
|
authStrategies,
|
|
@@ -66,7 +66,7 @@ describe('application client tests', () => {
|
|
|
66
66
|
`
|
|
67
67
|
|
|
68
68
|
export const generate = (ctx: AuthenticationGeneratorContext) =>
|
|
69
|
-
|
|
69
|
+
Promise.resolve(ctx).then(
|
|
70
70
|
when<AuthenticationGeneratorContext>(
|
|
71
71
|
({ lib, language }) => fileExists(lib, `client.${language}`),
|
|
72
72
|
renderSource(
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { AuthenticationGeneratorContext } from '../index';
|
|
1
|
+
import { AuthenticationGeneratorContext } from '../index.js';
|
|
2
2
|
export declare const generate: (ctx: AuthenticationGeneratorContext) => Promise<AuthenticationGeneratorContext>;
|
|
@@ -1,17 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.generate = void 0;
|
|
7
|
-
const crypto_1 = __importDefault(require("crypto"));
|
|
8
|
-
const pinion_1 = require("@feathershq/pinion");
|
|
9
|
-
const generate = (ctx) => (0, pinion_1.generator)(ctx)
|
|
10
|
-
.then((0, pinion_1.mergeJSON)(({ authStrategies }) => {
|
|
1
|
+
import crypto from 'crypto';
|
|
2
|
+
import { toFile, mergeJSON } from '@featherscloud/pinion';
|
|
3
|
+
export const generate = (ctx) => Promise.resolve(ctx)
|
|
4
|
+
.then(mergeJSON(({ authStrategies }) => {
|
|
11
5
|
const authentication = {
|
|
12
6
|
entity: ctx.entity,
|
|
13
7
|
service: ctx.path,
|
|
14
|
-
secret:
|
|
8
|
+
secret: crypto.randomBytes(24).toString('base64'),
|
|
15
9
|
authStrategies: ['jwt'],
|
|
16
10
|
jwtOptions: {
|
|
17
11
|
header: {
|
|
@@ -40,11 +34,10 @@ const generate = (ctx) => (0, pinion_1.generator)(ctx)
|
|
|
40
34
|
}, {});
|
|
41
35
|
}
|
|
42
36
|
return { authentication };
|
|
43
|
-
},
|
|
44
|
-
.then(
|
|
37
|
+
}, toFile('config', 'default.json')))
|
|
38
|
+
.then(mergeJSON({
|
|
45
39
|
authentication: {
|
|
46
40
|
secret: 'FEATHERS_SECRET'
|
|
47
41
|
}
|
|
48
|
-
},
|
|
49
|
-
exports.generate = generate;
|
|
42
|
+
}, toFile('config', 'custom-environment-variables.json')));
|
|
50
43
|
//# sourceMappingURL=config.tpl.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.tpl.js","sourceRoot":"","sources":["../../../src/authentication/templates/config.tpl.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"config.tpl.js","sourceRoot":"","sources":["../../../src/authentication/templates/config.tpl.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAA;AAC3B,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AAGzD,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,GAAmC,EAAE,EAAE,CAC9D,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC;KACjB,IAAI,CACH,SAAS,CACP,CAAC,EAAE,cAAc,EAAE,EAAE,EAAE;IACrB,MAAM,cAAc,GAAQ;QAC1B,MAAM,EAAE,GAAG,CAAC,MAAM;QAClB,OAAO,EAAE,GAAG,CAAC,IAAI;QACjB,MAAM,EAAE,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC;QACjD,cAAc,EAAE,CAAC,KAAK,CAAC;QACvB,UAAU,EAAE;YACV,MAAM,EAAE;gBACN,GAAG,EAAE,QAAQ;aACd;YACD,QAAQ,EAAE,wBAAwB;YAClC,SAAS,EAAE,OAAO;YAClB,SAAS,EAAE,IAAI;SAChB;KACF,CAAA;IAED,IAAI,cAAc,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;QACrC,cAAc,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QAC3C,cAAc,CAAC,KAAK,GAAG;YACrB,aAAa,EAAE,OAAO;YACtB,aAAa,EAAE,UAAU;SAC1B,CAAA;IACH,CAAC;IAED,MAAM,eAAe,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,OAAO,CAAC,CAAA;IAEzE,IAAI,eAAe,CAAC,MAAM,EAAE,CAAC;QAC3B,cAAc,CAAC,KAAK,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE;YAC5D,KAAK,CAAC,IAAI,CAAC,GAAG;gBACZ,GAAG,EAAE,aAAa;gBAClB,MAAM,EAAE,iBAAiB;aAC1B,CAAA;YAED,OAAO,KAAK,CAAA;QACd,CAAC,EAAE,EAAS,CAAC,CAAA;IACf,CAAC;IAED,OAAO,EAAE,cAAc,EAAE,CAAA;AAC3B,CAAC,EACD,MAAM,CAAC,QAAQ,EAAE,cAAc,CAAC,CACjC,CACF;KACA,IAAI,CACH,SAAS,CACP;IACE,cAAc,EAAE;QACd,MAAM,EAAE,iBAAiB;KAC1B;CACF,EACD,MAAM,CAAC,QAAQ,EAAE,mCAAmC,CAAC,CACtD,CACF,CAAA"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import crypto from 'crypto'
|
|
2
|
-
import {
|
|
3
|
-
import { AuthenticationGeneratorContext } from '../index'
|
|
2
|
+
import { toFile, mergeJSON } from '@featherscloud/pinion'
|
|
3
|
+
import { AuthenticationGeneratorContext } from '../index.js'
|
|
4
4
|
|
|
5
5
|
export const generate = (ctx: AuthenticationGeneratorContext) =>
|
|
6
|
-
|
|
6
|
+
Promise.resolve(ctx)
|
|
7
7
|
.then(
|
|
8
8
|
mergeJSON<AuthenticationGeneratorContext>(
|
|
9
9
|
({ authStrategies }) => {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { AuthenticationGeneratorContext } from '../index';
|
|
1
|
+
import { AuthenticationGeneratorContext } from '../index.js';
|
|
2
2
|
export declare const generate: (ctx: AuthenticationGeneratorContext) => Promise<AuthenticationGeneratorContext>;
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.generate = void 0;
|
|
4
|
-
const pinion_1 = require("@feathershq/pinion");
|
|
1
|
+
import { inject, before, toFile, when, append } from '@featherscloud/pinion';
|
|
5
2
|
const importTemplate = ({ upperName, folder, fileName }) => /* ts */ `import { ${upperName} } from './services/${folder.join('/')}/${fileName}'
|
|
6
3
|
`;
|
|
7
4
|
const paramsTemplate = ({ entity, upperName }) => /* ts */ `// Add the ${entity} as an optional property to all params
|
|
@@ -11,9 +8,8 @@ declare module '@feathersjs/feathers' {
|
|
|
11
8
|
}
|
|
12
9
|
}
|
|
13
10
|
`;
|
|
14
|
-
const toDeclarationFile =
|
|
15
|
-
const generate = (ctx) =>
|
|
16
|
-
.then(
|
|
17
|
-
.then(
|
|
18
|
-
exports.generate = generate;
|
|
11
|
+
const toDeclarationFile = toFile(({ lib }) => lib, 'declarations.ts');
|
|
12
|
+
export const generate = (ctx) => Promise.resolve(ctx)
|
|
13
|
+
.then(when((ctx) => ctx.language === 'ts', inject(importTemplate, before(/export \{ NextFunction \}|export type \{ NextFunction \}/), toDeclarationFile)))
|
|
14
|
+
.then(when((ctx) => ctx.language === 'ts', inject(paramsTemplate, append(), toDeclarationFile)));
|
|
19
15
|
//# sourceMappingURL=declarations.tpl.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"declarations.tpl.js","sourceRoot":"","sources":["../../../src/authentication/templates/declarations.tpl.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"declarations.tpl.js","sourceRoot":"","sources":["../../../src/authentication/templates/declarations.tpl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AAG5E,MAAM,cAAc,GAAG,CAAC,EACtB,SAAS,EACT,MAAM,EACN,QAAQ,EACuB,EAAE,EAAE,CAAC,QAAQ,CAAC,YAAY,SAAS,uBAAuB,MAAM,CAAC,IAAI,CACpG,GAAG,CACJ,IAAI,QAAQ;CACZ,CAAA;AAED,MAAM,cAAc,GAAG,CAAC,EACtB,MAAM,EACN,SAAS,EACsB,EAAE,EAAE,CAAC,QAAQ,CAAC,cAAc,MAAM;;;MAG7D,MAAM,MAAM,SAAS;;;CAG1B,CAAA;AAED,MAAM,iBAAiB,GAAG,MAAM,CAAiC,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,GAAG,EAAE,iBAAiB,CAAC,CAAA;AAErG,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,GAAmC,EAAE,EAAE,CAC9D,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC;KACjB,IAAI,CACH,IAAI,CACF,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,QAAQ,KAAK,IAAI,EAC9B,MAAM,CACJ,cAAc,EACd,MAAM,CAAC,0DAA0D,CAAC,EAClE,iBAAiB,CAClB,CACF,CACF;KACA,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,QAAQ,KAAK,IAAI,EAAE,MAAM,CAAC,cAAc,EAAE,MAAM,EAAE,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { AuthenticationGeneratorContext } from '../index'
|
|
1
|
+
import { inject, before, toFile, when, append } from '@featherscloud/pinion'
|
|
2
|
+
import { AuthenticationGeneratorContext } from '../index.js'
|
|
3
3
|
|
|
4
4
|
const importTemplate = ({
|
|
5
5
|
upperName,
|
|
@@ -24,7 +24,7 @@ declare module '@feathersjs/feathers' {
|
|
|
24
24
|
const toDeclarationFile = toFile<AuthenticationGeneratorContext>(({ lib }) => lib, 'declarations.ts')
|
|
25
25
|
|
|
26
26
|
export const generate = (ctx: AuthenticationGeneratorContext) =>
|
|
27
|
-
|
|
27
|
+
Promise.resolve(ctx)
|
|
28
28
|
.then(
|
|
29
29
|
when(
|
|
30
30
|
(ctx) => ctx.language === 'ts',
|
package/lib/commons.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PackageJson } from 'type-fest';
|
|
2
|
-
import { Callable, PinionContext, Location } from '@
|
|
3
|
-
import
|
|
2
|
+
import { Callable, PinionContext, Location } from '@featherscloud/pinion';
|
|
3
|
+
import ts from 'typescript';
|
|
4
4
|
import { Options as PrettierOptions } from 'prettier';
|
|
5
5
|
export declare const version: any;
|
|
6
6
|
export type DependencyVersions = {
|
|
@@ -90,10 +90,15 @@ export declare const addVersions: (dependencies: string[], versions: DependencyV
|
|
|
90
90
|
* @returns The updated context
|
|
91
91
|
*/
|
|
92
92
|
export declare const initializeBaseContext: () => <C extends FeathersBaseContext>(ctx: C) => Promise<Awaited<C> & {
|
|
93
|
+
pkg: import("@featherscloud/pinion").JSONData;
|
|
94
|
+
} & {
|
|
93
95
|
lib: string;
|
|
94
96
|
test: string;
|
|
95
97
|
language: "ts" | "js";
|
|
96
98
|
feathers: FeathersAppInfo;
|
|
99
|
+
dependencyVersions: {
|
|
100
|
+
'@feathersjs/cli': any;
|
|
101
|
+
};
|
|
97
102
|
}>;
|
|
98
103
|
/**
|
|
99
104
|
* Checks if the current context contains a valid generated application. This is necesary for most
|
|
@@ -130,6 +135,9 @@ export declare const renderSource: <C extends PinionContext & {
|
|
|
130
135
|
}>(template: Callable<string, C>, target: Callable<string, C>, options?: {
|
|
131
136
|
force: boolean;
|
|
132
137
|
}) => (ctx: C) => Promise<C>;
|
|
138
|
+
export declare const install: <C extends PinionContext & {
|
|
139
|
+
language: 'js' | 'ts';
|
|
140
|
+
}>(dependencies: Callable<string[], C>, dev: Callable<boolean, C>, packager: Callable<string, C>) => (ctx: C) => Promise<C>;
|
|
133
141
|
/**
|
|
134
142
|
* Inject a source template as the language set in the context.
|
|
135
143
|
*
|