vona-module-test-vona 5.0.72 → 5.0.74

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.
@@ -1,13 +1,13 @@
1
1
  import type { IJwtToken } from 'vona-module-a-jwt';
2
- import type { IUserBase } from 'vona-module-a-user';
2
+ import type { IUser } from 'vona-module-a-user';
3
3
  import type { IDecoratorControllerOptions } from 'vona-module-a-web';
4
4
  import { BeanBase } from 'vona';
5
5
  export interface IControllerOptionsPassport extends IDecoratorControllerOptions {
6
6
  }
7
7
  export declare class ControllerPassport extends BeanBase {
8
- echo(name: string, user: IUserBase): {
8
+ echo(name: string, user: IUser): {
9
9
  name: string;
10
- user: IUserBase;
10
+ user: IUser;
11
11
  };
12
12
  login(name: string): Promise<IJwtToken>;
13
13
  isAuthenticated(): boolean;
package/dist/index.js CHANGED
@@ -2699,7 +2699,7 @@ let ControllerPassport = (_dec$9 = Controller({
2699
2699
  return Arg.param('name')(target, key, 0);
2700
2700
  }, _dec7$8 = function (target, key) {
2701
2701
  return Arg.user()(target, key, 1);
2702
- }, _dec8$6 = Reflect.metadata("design:type", Function), _dec9$5 = Reflect.metadata("design:paramtypes", [String, typeof IUserBase === "undefined" ? Object : IUserBase]), _dec0$5 = Web.post('login'), _dec1$5 = Api.body(v.object(DtoJwtToken)), _dec10$4 = Passport.public(), _dec11$4 = function (target, key) {
2702
+ }, _dec8$6 = Reflect.metadata("design:type", Function), _dec9$5 = Reflect.metadata("design:paramtypes", [String, typeof IUser === "undefined" ? Object : IUser]), _dec0$5 = Web.post('login'), _dec1$5 = Api.body(v.object(DtoJwtToken)), _dec10$4 = Passport.public(), _dec11$4 = function (target, key) {
2703
2703
  return Arg.body('name')(target, key, 0);
2704
2704
  }, _dec12$4 = Reflect.metadata("design:type", Function), _dec13$4 = Reflect.metadata("design:paramtypes", [String]), _dec14$3 = Web.get('isAuthenticated'), _dec15$3 = Reflect.metadata("design:type", Function), _dec16$3 = Reflect.metadata("design:paramtypes", []), _dec17$3 = Web.post('refresh'), _dec18$3 = Api.body(v.object(DtoJwtToken)), _dec19$3 = Passport.public(), _dec20$3 = function (target, key) {
2705
2705
  return Arg.body('refreshToken')(target, key, 0);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vona-module-test-vona",
3
3
  "type": "module",
4
- "version": "5.0.72",
4
+ "version": "5.0.74",
5
5
  "title": "test-vona",
6
6
  "vonaModule": {
7
7
  "fileVersion": 1,
@@ -1,5 +1,5 @@
1
1
  import type { IJwtToken } from 'vona-module-a-jwt';
2
- import type { IUserBase, IUserNameRecord } from 'vona-module-a-user';
2
+ import type { IUser, IUserNameRecord } from 'vona-module-a-user';
3
3
  import type { IDecoratorControllerOptions } from 'vona-module-a-web';
4
4
  import assert from 'node:assert';
5
5
  import { BeanBase } from 'vona';
@@ -15,7 +15,7 @@ export interface IControllerOptionsPassport extends IDecoratorControllerOptions
15
15
  export class ControllerPassport extends BeanBase {
16
16
  @Web.get('echo/:name')
17
17
  @Passport.public()
18
- echo(@Arg.param('name') name: string, @Arg.user() user: IUserBase) {
18
+ echo(@Arg.param('name') name: string, @Arg.user() user: IUser) {
19
19
  assert.equal(name, 'admin');
20
20
  assert.equal(user.name, 'admin');
21
21
  return { name, user };
package/test/jwt.test.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { IPayloadDataBase } from 'vona-module-a-jwt';
1
+ import type { IPayloadData } from 'vona-module-a-jwt';
2
2
  import assert from 'node:assert';
3
3
  import { describe, it } from 'node:test';
4
4
  import { catchError } from '@cabloy/utils';
@@ -8,7 +8,7 @@ describe('jwt.test.ts', () => {
8
8
  it('action:jwt', async () => {
9
9
  await app.bean.executor.mockCtx(async () => {
10
10
  // sign
11
- const payloadData: IPayloadDataBase = { userId: 1, authId: 1 };
11
+ const payloadData: IPayloadData = { userId: 1, authId: 1 };
12
12
  const token = await app.bean.jwt.get('access').sign(payloadData);
13
13
  assert.equal(token.split('.').length, 3);
14
14
  // verify