@feathersjs/cli 5.0.0-pre.30 → 5.0.0-pre.32
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 +20 -0
- package/lib/app/index.js +5 -5
- package/lib/app/index.js.map +1 -1
- package/lib/app/index.ts +13 -12
- package/lib/app/templates/app.tpl.js +7 -8
- package/lib/app/templates/app.tpl.js.map +1 -1
- package/lib/app/templates/app.tpl.ts +11 -8
- package/lib/app/templates/channels.tpl.js +4 -30
- package/lib/app/templates/channels.tpl.js.map +1 -1
- package/lib/app/templates/channels.tpl.ts +6 -30
- package/lib/app/templates/client.test.tpl.d.ts +2 -0
- package/lib/app/templates/client.test.tpl.js +27 -0
- package/lib/app/templates/client.test.tpl.js.map +1 -0
- package/lib/app/templates/client.test.tpl.ts +26 -0
- package/lib/app/templates/client.tpl.js +17 -3
- package/lib/app/templates/client.tpl.js.map +1 -1
- package/lib/app/templates/client.tpl.ts +20 -3
- package/lib/app/templates/declarations.tpl.js +3 -0
- package/lib/app/templates/declarations.tpl.js.map +1 -1
- package/lib/app/templates/declarations.tpl.ts +3 -0
- package/lib/app/templates/logger.tpl.js +8 -2
- package/lib/app/templates/logger.tpl.js.map +1 -1
- package/lib/app/templates/logger.tpl.ts +8 -2
- package/lib/app/templates/schemas.tpl.js +4 -5
- package/lib/app/templates/schemas.tpl.js.map +1 -1
- package/lib/app/templates/schemas.tpl.ts +4 -5
- package/lib/authentication/index.d.ts +3 -0
- package/lib/authentication/index.js +5 -1
- package/lib/authentication/index.js.map +1 -1
- package/lib/authentication/index.ts +5 -0
- package/lib/authentication/templates/authentication.tpl.js +5 -4
- package/lib/authentication/templates/authentication.tpl.js.map +1 -1
- package/lib/authentication/templates/authentication.tpl.ts +5 -5
- package/lib/authentication/templates/{test.tpl.d.ts → client.test.tpl.d.ts} +0 -0
- package/lib/authentication/templates/client.test.tpl.js +61 -0
- package/lib/authentication/templates/client.test.tpl.js.map +1 -0
- package/lib/authentication/templates/client.test.tpl.ts +73 -0
- package/lib/authentication/templates/client.tpl.d.ts +2 -0
- package/lib/authentication/templates/client.tpl.js +14 -0
- package/lib/authentication/templates/client.tpl.js.map +1 -0
- package/lib/authentication/templates/client.tpl.ts +19 -0
- package/lib/authentication/templates/declarations.tpl.js +1 -1
- package/lib/authentication/templates/declarations.tpl.ts +1 -1
- package/lib/authentication/templates/knex.tpl.js +3 -3
- package/lib/authentication/templates/knex.tpl.ts +3 -3
- package/lib/authentication/templates/schema.json.tpl.js +26 -25
- package/lib/authentication/templates/schema.json.tpl.js.map +1 -1
- package/lib/authentication/templates/schema.json.tpl.ts +26 -26
- package/lib/authentication/templates/schema.typebox.tpl.js +26 -27
- package/lib/authentication/templates/schema.typebox.tpl.js.map +1 -1
- package/lib/authentication/templates/schema.typebox.tpl.ts +28 -28
- package/lib/service/index.d.ts +5 -63
- package/lib/service/index.js +74 -75
- package/lib/service/index.js.map +1 -1
- package/lib/service/index.ts +10 -4
- package/lib/service/templates/client.tpl.js +15 -20
- package/lib/service/templates/client.tpl.js.map +1 -1
- package/lib/service/templates/client.tpl.ts +29 -25
- package/lib/service/templates/schema.json.tpl.js +24 -22
- package/lib/service/templates/schema.json.tpl.js.map +1 -1
- package/lib/service/templates/schema.json.tpl.ts +24 -22
- package/lib/service/templates/schema.typebox.tpl.js +22 -25
- package/lib/service/templates/schema.typebox.tpl.js.map +1 -1
- package/lib/service/templates/schema.typebox.tpl.ts +22 -25
- package/lib/service/type/knex.tpl.d.ts +1 -1
- package/lib/service/type/knex.tpl.js +10 -8
- package/lib/service/type/knex.tpl.js.map +1 -1
- package/lib/service/type/knex.tpl.ts +10 -9
- package/lib/service/type/mongodb.tpl.d.ts +1 -1
- package/lib/service/type/mongodb.tpl.js +7 -5
- package/lib/service/type/mongodb.tpl.js.map +1 -1
- package/lib/service/type/mongodb.tpl.ts +8 -6
- package/package.json +18 -16
- package/lib/authentication/templates/test.tpl.js +0 -43
- package/lib/authentication/templates/test.tpl.js.map +0 -1
- package/lib/authentication/templates/test.tpl.ts +0 -53
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@feathersjs/cli",
|
|
3
3
|
"description": "The command line interface for creating Feathers applications",
|
|
4
|
-
"version": "5.0.0-pre.
|
|
4
|
+
"version": "5.0.0-pre.32",
|
|
5
5
|
"homepage": "https://feathersjs.com",
|
|
6
6
|
"main": "lib/",
|
|
7
7
|
"bin": {
|
|
@@ -58,20 +58,22 @@
|
|
|
58
58
|
"prettier": "^2.7.1"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
|
-
"@feathersjs/authentication": "^5.0.0-pre.
|
|
62
|
-
"@feathersjs/authentication-
|
|
63
|
-
"@feathersjs/authentication-
|
|
64
|
-
"@feathersjs/
|
|
65
|
-
"@feathersjs/
|
|
66
|
-
"@feathersjs/
|
|
67
|
-
"@feathersjs/
|
|
68
|
-
"@feathersjs/
|
|
69
|
-
"@feathersjs/
|
|
70
|
-
"@feathersjs/
|
|
71
|
-
"@feathersjs/
|
|
72
|
-
"@feathersjs/
|
|
73
|
-
"@feathersjs/
|
|
74
|
-
"@feathersjs/
|
|
61
|
+
"@feathersjs/authentication": "^5.0.0-pre.32",
|
|
62
|
+
"@feathersjs/authentication-client": "^5.0.0-pre.32",
|
|
63
|
+
"@feathersjs/authentication-local": "^5.0.0-pre.32",
|
|
64
|
+
"@feathersjs/authentication-oauth": "^5.0.0-pre.32",
|
|
65
|
+
"@feathersjs/configuration": "^5.0.0-pre.32",
|
|
66
|
+
"@feathersjs/errors": "^5.0.0-pre.32",
|
|
67
|
+
"@feathersjs/express": "^5.0.0-pre.32",
|
|
68
|
+
"@feathersjs/feathers": "^5.0.0-pre.32",
|
|
69
|
+
"@feathersjs/knex": "^5.0.0-pre.32",
|
|
70
|
+
"@feathersjs/koa": "^5.0.0-pre.32",
|
|
71
|
+
"@feathersjs/mongodb": "^5.0.0-pre.32",
|
|
72
|
+
"@feathersjs/rest-client": "^5.0.0-pre.32",
|
|
73
|
+
"@feathersjs/schema": "^5.0.0-pre.32",
|
|
74
|
+
"@feathersjs/socketio": "^5.0.0-pre.32",
|
|
75
|
+
"@feathersjs/transport-commons": "^5.0.0-pre.32",
|
|
76
|
+
"@feathersjs/typebox": "^5.0.0-pre.32",
|
|
75
77
|
"@types/mocha": "^10.0.0",
|
|
76
78
|
"@types/node": "^18.8.2",
|
|
77
79
|
"@types/prettier": "^2.7.1",
|
|
@@ -82,5 +84,5 @@
|
|
|
82
84
|
"type-fest": "^3.0.0",
|
|
83
85
|
"typescript": "^4.8.4"
|
|
84
86
|
},
|
|
85
|
-
"gitHead": "
|
|
87
|
+
"gitHead": "b405e205fc6d9fbd42b42c7a3f30ea4bf33d121d"
|
|
86
88
|
}
|
|
@@ -1,43 +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 template = ({ authStrategies, path, lib }) => /* ts */ `import assert from 'assert';
|
|
7
|
-
import { app } from '../${lib}/app';
|
|
8
|
-
|
|
9
|
-
describe('authentication', () => {
|
|
10
|
-
${authStrategies.includes('local')
|
|
11
|
-
? `
|
|
12
|
-
const userInfo = {
|
|
13
|
-
email: 'someone@example.com',
|
|
14
|
-
password: 'supersecret'
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
before(async () => {
|
|
18
|
-
try {
|
|
19
|
-
await app.service('${path}').create(userInfo)
|
|
20
|
-
} catch (error) {
|
|
21
|
-
// Do nothing, it just means the user already exists and can be tested
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
it('authenticates user and creates accessToken', async () => {
|
|
26
|
-
const { user, accessToken } = await app.service('authentication').create({
|
|
27
|
-
strategy: 'local',
|
|
28
|
-
...userInfo
|
|
29
|
-
}, {})
|
|
30
|
-
|
|
31
|
-
assert.ok(accessToken, 'Created access token for user')
|
|
32
|
-
assert.ok(user, 'Includes user in authentication data')
|
|
33
|
-
})`
|
|
34
|
-
: ''}
|
|
35
|
-
|
|
36
|
-
it('registered the authentication service', () => {
|
|
37
|
-
assert.ok(app.service('authentication'))
|
|
38
|
-
})
|
|
39
|
-
})
|
|
40
|
-
`;
|
|
41
|
-
const generate = (ctx) => (0, pinion_1.generator)(ctx).then((0, commons_1.renderSource)(template, (0, pinion_1.toFile)(({ test }) => test, 'authentication.test')));
|
|
42
|
-
exports.generate = generate;
|
|
43
|
-
//# sourceMappingURL=test.tpl.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"test.tpl.js","sourceRoot":"","sources":["../../../src/authentication/templates/test.tpl.ts"],"names":[],"mappings":";;;AAAA,+CAAsD;AACtD,2CAA4C;AAG5C,MAAM,QAAQ,GAAG,CAAC,EAChB,cAAc,EACd,IAAI,EACJ,GAAG,EAC4B,EAAE,EAAE,CAAC,QAAQ,CAAC;0BACrB,GAAG;;;IAIzB,cAAc,CAAC,QAAQ,CAAC,OAAO,CAAC;IAC9B,CAAC,CAAC;;;;;;;;2BAQmB,IAAI;;;;;;;;;;;;;;KAc1B;IACC,CAAC,CAAC,EACN;;;;;;CAMD,CAAA;AAEM,MAAM,QAAQ,GAAG,CAAC,GAAmC,EAAE,EAAE,CAC9D,IAAA,kBAAS,EAAC,GAAG,CAAC,CAAC,IAAI,CACjB,IAAA,sBAAY,EACV,QAAQ,EACR,IAAA,eAAM,EAAiC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,EAAE,qBAAqB,CAAC,CAClF,CACF,CAAA;AANU,QAAA,QAAQ,YAMlB"}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { generator, toFile } from '@feathershq/pinion'
|
|
2
|
-
import { renderSource } from '../../commons'
|
|
3
|
-
import { AuthenticationGeneratorContext } from '../index'
|
|
4
|
-
|
|
5
|
-
const template = ({
|
|
6
|
-
authStrategies,
|
|
7
|
-
path,
|
|
8
|
-
lib
|
|
9
|
-
}: AuthenticationGeneratorContext) => /* ts */ `import assert from 'assert';
|
|
10
|
-
import { app } from '../${lib}/app';
|
|
11
|
-
|
|
12
|
-
describe('authentication', () => {
|
|
13
|
-
${
|
|
14
|
-
authStrategies.includes('local')
|
|
15
|
-
? `
|
|
16
|
-
const userInfo = {
|
|
17
|
-
email: 'someone@example.com',
|
|
18
|
-
password: 'supersecret'
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
before(async () => {
|
|
22
|
-
try {
|
|
23
|
-
await app.service('${path}').create(userInfo)
|
|
24
|
-
} catch (error) {
|
|
25
|
-
// Do nothing, it just means the user already exists and can be tested
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
it('authenticates user and creates accessToken', async () => {
|
|
30
|
-
const { user, accessToken } = await app.service('authentication').create({
|
|
31
|
-
strategy: 'local',
|
|
32
|
-
...userInfo
|
|
33
|
-
}, {})
|
|
34
|
-
|
|
35
|
-
assert.ok(accessToken, 'Created access token for user')
|
|
36
|
-
assert.ok(user, 'Includes user in authentication data')
|
|
37
|
-
})`
|
|
38
|
-
: ''
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
it('registered the authentication service', () => {
|
|
42
|
-
assert.ok(app.service('authentication'))
|
|
43
|
-
})
|
|
44
|
-
})
|
|
45
|
-
`
|
|
46
|
-
|
|
47
|
-
export const generate = (ctx: AuthenticationGeneratorContext) =>
|
|
48
|
-
generator(ctx).then(
|
|
49
|
-
renderSource(
|
|
50
|
-
template,
|
|
51
|
-
toFile<AuthenticationGeneratorContext>(({ test }) => test, 'authentication.test')
|
|
52
|
-
)
|
|
53
|
-
)
|