vona-cli-set-api 1.0.278 → 1.0.280

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.
@@ -46,7 +46,7 @@
46
46
  }
47
47
  },
48
48
  "dependencies": {
49
- "vona": "^5.0.161"
49
+ "vona": "^5.0.162"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@cabloy/lint": "^5.0.16",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vona-module-home-base",
3
3
  "type": "module",
4
- "version": "5.0.8",
4
+ "version": "5.0.9",
5
5
  "title": "home-base",
6
6
  "vonaModule": {
7
7
  "dependencies": {
@@ -5,7 +5,7 @@ import { Service } from 'vona-module-a-bean';
5
5
  @Service()
6
6
  export class ServiceMenu extends BeanBase {
7
7
  async retrieveMenus(publicPath?: string): Promise<IMenus> {
8
- return await this.$scope.menu.service.menu.retrieveMenus(publicPath, async () => {
8
+ return await this.bean.menu.retrieveMenus(publicPath, async () => {
9
9
  return this._getMenusDefault();
10
10
  });
11
11
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vona-module-home-user",
3
3
  "type": "module",
4
- "version": "5.0.10",
4
+ "version": "5.0.11",
5
5
  "title": "home-user",
6
6
  "vonaModule": {
7
7
  "fileVersion": 1,
@@ -15,7 +15,7 @@ export class EventListenerRegister
15
15
  const user = await next() as IUserBase;
16
16
  // mail: activate
17
17
  if (!data.autoActivate && user.email) {
18
- await this.$scope.mailconfirm.service.mail.emailConfirm(user);
18
+ await this.bean.mailConfirm.emailConfirm(user);
19
19
  }
20
20
  return user;
21
21
  }
@@ -7,7 +7,6 @@ import { Service } from 'vona-module-a-bean';
7
7
  export class ServicePassportAdapter extends BeanBase implements IPassportAdapter {
8
8
  async isAdmin(passport: IPassport | undefined): Promise<boolean> {
9
9
  if (!passport) return false;
10
- if (passport.user?.name === 'admin') return true;
11
10
  if (passport.roles?.some(role => role.name === 'admin')) return true;
12
11
  return false;
13
12
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vona-suite-a-home",
3
3
  "type": "module",
4
- "version": "5.0.11",
4
+ "version": "5.0.12",
5
5
  "title": "a-home",
6
6
  "description": "",
7
7
  "author": "zhennann",
@@ -1,7 +1,6 @@
1
1
  import type { Dto<%=argv.resourceNameCapitalize%>Create, Dto<%=argv.resourceNameCapitalize%>QueryRes, Dto<%=argv.resourceNameCapitalize%>Update, Entity<%=argv.resourceNameCapitalize%> } from 'vona-module-<%=argv.moduleInfo.relativeName%>';
2
2
  import assert from 'node:assert';
3
3
  import { describe, it } from 'node:test';
4
- import { catchError } from '@cabloy/utils';
5
4
  import { app } from 'vona-mock';
6
5
 
7
6
  describe('<%=argv.resourceName%>.test.ts', () => {
@@ -30,15 +29,13 @@ describe('<%=argv.resourceName%>.test.ts', () => {
30
29
  body: dataUpdate,
31
30
  });
32
31
  // findOne
33
- const <%=argv.resourceName%>: Entity<%=argv.resourceNameCapitalize%> = await app.bean.executor.performAction('get', '<%=argv.moduleActionPathRaw%>/:id', { params: { id: <%=argv.resourceName%>Id } });
32
+ let <%=argv.resourceName%>: Entity<%=argv.resourceNameCapitalize%> = await app.bean.executor.performAction('get', '<%=argv.moduleActionPathRaw%>/:id', { params: { id: <%=argv.resourceName%>Id } });
34
33
  assert.equal(<%=argv.resourceName%>.name, dataUpdate.name);
35
34
  // delete
36
35
  await app.bean.executor.performAction('delete', '<%=argv.moduleActionPathRaw%>/:id', { params: { id: <%=argv.resourceName%>.id } });
37
36
  // findOne
38
- const [_, err] = await catchError(() => {
39
- return app.bean.executor.performAction('get', '<%=argv.moduleActionPathRaw%>/:id', { params: { id: <%=argv.resourceName%>.id } });
40
- });
41
- assert.equal(err?.code, 404);
37
+ <%=argv.resourceName%> = await app.bean.executor.performAction('get', '<%=argv.moduleActionPathRaw%>/:id', { params: { id: <%=argv.resourceName%>.id } });
38
+ assert.equal(<%=argv.resourceName%>, undefined);
42
39
  // logout
43
40
  await app.bean.passport.signout();
44
41
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vona-cli-set-api",
3
3
  "type": "module",
4
- "version": "1.0.278",
4
+ "version": "1.0.280",
5
5
  "description": "vona cli-set-api",
6
6
  "publishConfig": {
7
7
  "access": "public"