@apso/cli 0.6.0 → 0.7.0
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/dist/lib/guards.js
CHANGED
|
@@ -128,7 +128,7 @@ const createGuards = async (rootPath, entities, auth) => {
|
|
|
128
128
|
console.log("[apso] No scopeBy or auth configurations found, skipping guards generation");
|
|
129
129
|
return;
|
|
130
130
|
}
|
|
131
|
-
const guardsDir = path.join(rootPath, "guards");
|
|
131
|
+
const guardsDir = path.join(rootPath, "autogen", "guards");
|
|
132
132
|
// Ensure guards directory exists
|
|
133
133
|
if (!fs.existsSync(guardsDir)) {
|
|
134
134
|
fs.mkdirSync(guardsDir, { recursive: true });
|
|
@@ -21,11 +21,11 @@ import { Reflector } from '@nestjs/core';
|
|
|
21
21
|
import { InjectRepository } from '@nestjs/typeorm';
|
|
22
22
|
import { Repository } from 'typeorm';
|
|
23
23
|
|
|
24
|
-
// Entity imports
|
|
25
|
-
import { <%= it.authConfig.sessionEntity %> } from '
|
|
26
|
-
import { <%= it.authConfig.userEntity %> } from '
|
|
24
|
+
// Entity imports (from sibling autogen folders)
|
|
25
|
+
import { <%= it.authConfig.sessionEntity %> } from '../<%= it.authConfig.sessionEntity %>/<%= it.authConfig.sessionEntity %>.entity';
|
|
26
|
+
import { <%= it.authConfig.userEntity %> } from '../<%= it.authConfig.userEntity %>/<%= it.authConfig.userEntity %>.entity';
|
|
27
27
|
<% if (it.authConfig.accountUserEntity) { %>
|
|
28
|
-
import { <%= it.authConfig.accountUserEntity %> } from '
|
|
28
|
+
import { <%= it.authConfig.accountUserEntity %> } from '../<%= it.authConfig.accountUserEntity %>/<%= it.authConfig.accountUserEntity %>.entity';
|
|
29
29
|
<% } %>
|
|
30
30
|
|
|
31
31
|
/**
|
|
@@ -11,21 +11,21 @@ import { ScopeGuard } from './scope.guard';
|
|
|
11
11
|
import { AuthGuard } from './auth.guard';
|
|
12
12
|
<% } %>
|
|
13
13
|
|
|
14
|
-
<% /* Import all entities for ScopeGuard */ %>
|
|
14
|
+
<% /* Import all entities for ScopeGuard (from sibling autogen folders) */ %>
|
|
15
15
|
<% if (it.scopedEntities && it.scopedEntities.length > 0) { %>
|
|
16
16
|
// Entities for ScopeGuard
|
|
17
17
|
<% it.scopedEntities.forEach((entity) => { %>
|
|
18
|
-
import { <%= entity.name %> } from '
|
|
18
|
+
import { <%= entity.name %> } from '../<%= entity.name %>/<%= entity.name %>.entity';
|
|
19
19
|
<% }) %>
|
|
20
20
|
<% } %>
|
|
21
21
|
|
|
22
|
-
<% /* Import entities for AuthGuard */ %>
|
|
22
|
+
<% /* Import entities for AuthGuard (from sibling autogen folders) */ %>
|
|
23
23
|
<% if (it.authConfig) { %>
|
|
24
24
|
// Entities for AuthGuard
|
|
25
|
-
import { <%= it.authConfig.sessionEntity %> } from '
|
|
26
|
-
import { <%= it.authConfig.userEntity %> } from '
|
|
25
|
+
import { <%= it.authConfig.sessionEntity %> } from '../<%= it.authConfig.sessionEntity %>/<%= it.authConfig.sessionEntity %>.entity';
|
|
26
|
+
import { <%= it.authConfig.userEntity %> } from '../<%= it.authConfig.userEntity %>/<%= it.authConfig.userEntity %>.entity';
|
|
27
27
|
<% if (it.authConfig.accountUserEntity) { %>
|
|
28
|
-
import { <%= it.authConfig.accountUserEntity %> } from '
|
|
28
|
+
import { <%= it.authConfig.accountUserEntity %> } from '../<%= it.authConfig.accountUserEntity %>/<%= it.authConfig.accountUserEntity %>.entity';
|
|
29
29
|
<% } %>
|
|
30
30
|
<% } %>
|
|
31
31
|
|
|
@@ -10,9 +10,9 @@ import { Reflector } from '@nestjs/core';
|
|
|
10
10
|
import { InjectRepository } from '@nestjs/typeorm';
|
|
11
11
|
import { Repository } from 'typeorm';
|
|
12
12
|
|
|
13
|
-
<% /* Import all entities that have scoped relationships */ %>
|
|
13
|
+
<% /* Import all entities that have scoped relationships (from sibling autogen folders) */ %>
|
|
14
14
|
<% it.scopedEntities.forEach((entity) => { %>
|
|
15
|
-
import { <%= entity.name %> } from '
|
|
15
|
+
import { <%= entity.name %> } from '../<%= entity.name %>/<%= entity.name %>.entity';
|
|
16
16
|
<% }) %>
|
|
17
17
|
|
|
18
18
|
/**
|
package/oclif.manifest.json
CHANGED