@acorex/platform-generator 18.0.3 → 18.0.7

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.
Files changed (20) hide show
  1. package/README.md +11 -11
  2. package/generators.json +9 -9
  3. package/package.json +6 -6
  4. package/src/generators/app-module/files/src/app/app.module.ts.template +1 -1
  5. package/src/generators/app-module/files/src/app/app.routes.ts.template +6 -18
  6. package/src/generators/app-module/files/src/app/modules/auth/auth.strategy.ts.template +11 -3
  7. package/src/generators/app-module/files/src/app/modules/auth/permission.loader.ts.template +1 -1
  8. package/src/generators/app-module/files/src/app/modules/auth/tenant.loader.ts.template +1 -1
  9. package/src/generators/app-module/files/src/app/modules/layout/entity.loader.ts.template +1 -1
  10. package/src/generators/app-module/files/src/app/modules/layout/layout-root.module.ts.template +7 -3
  11. package/src/generators/app-module/files/src/app/modules/root/root.module.ts.template +3 -1
  12. package/src/generators/app-module/files/src/app/modules/root/sample/sample.entity.ts.template +8 -9
  13. package/src/generators/app-module/files/src/environments/environment.dev.ts.template +0 -1
  14. package/src/generators/app-module/files/src/environments/environment.local.ts.template +0 -1
  15. package/src/generators/app-module/files/src/environments/environment.prod.ts.template +0 -1
  16. package/src/generators/app-module/files/src/environments/environment.test.local.ts.template +0 -1
  17. package/src/generators/app-module/files/src/environments/environment.test.ts.template +0 -1
  18. package/src/generators/app-module/files/src/environments/environment.ts.template +0 -1
  19. package/src/generators/app-module/schema.d.ts +4 -4
  20. package/src/generators/app-module/schema.json +27 -27
package/README.md CHANGED
@@ -1,11 +1,11 @@
1
- # generator
2
-
3
- This library was generated with [Nx](https://nx.dev).
4
-
5
- ## Building
6
-
7
- Run `nx build generator` to build the library.
8
-
9
- ## Running unit tests
10
-
11
- Run `nx test generator` to execute the unit tests via [Jest](https://jestjs.io).
1
+ # generator
2
+
3
+ This library was generated with [Nx](https://nx.dev).
4
+
5
+ ## Building
6
+
7
+ Run `nx build generator` to build the library.
8
+
9
+ ## Running unit tests
10
+
11
+ Run `nx test generator` to execute the unit tests via [Jest](https://jestjs.io).
package/generators.json CHANGED
@@ -1,9 +1,9 @@
1
- {
2
- "generators": {
3
- "app-module": {
4
- "factory": "./src/generators/app-module/generator",
5
- "schema": "./src/generators/app-module/schema.json",
6
- "description": "app-module generator"
7
- }
8
- }
9
- }
1
+ {
2
+ "generators": {
3
+ "app-module": {
4
+ "factory": "./src/generators/app-module/generator",
5
+ "schema": "./src/generators/app-module/schema.json",
6
+ "description": "app-module generator"
7
+ }
8
+ }
9
+ }
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "@acorex/platform-generator",
3
- "version": "18.0.3",
3
+ "version": "18.0.7",
4
4
  "dependencies": {
5
5
  "@nx/devkit": "19.2.2",
6
6
  "tslib": "^2.3.0"
7
7
  },
8
8
  "peerDependencies": {
9
- "@acorex/platform": "*",
10
- "@acorex/modules": "*",
11
- "@acorex/styles": "*",
12
- "@acorex/core": "*",
13
- "@acorex/components": "*"
9
+ "@acorex/platform": ">=18.0.0",
10
+ "@acorex/modules": ">=18.0.0",
11
+ "@acorex/styles": ">=18.0.0",
12
+ "@acorex/core": ">=18.0.0",
13
+ "@acorex/components": ">=18.0.0"
14
14
  },
15
15
  "type": "commonjs",
16
16
  "main": "./src/index.js",
@@ -25,7 +25,7 @@ import { AXPTranslationRootModule } from './modules/common/translation-root.modu
25
25
  import { AXPLayoutRootModule } from './modules/layout/layout-root.module';
26
26
 
27
27
  import { AXLoadingDialogModule } from '@acorex/components/loading-dialog';
28
- import { AXP_ROOT_CONFIG_TOKEN } from '@acorex/platform/core';
28
+ import { AXP_ROOT_CONFIG_TOKEN } from '@acorex/platform/common';
29
29
  import { environment } from '../environments/environment';
30
30
 
31
31
  export function initApp() {
@@ -2,25 +2,13 @@ import { AXPAdminLayoutComponent, AX_ADMIN_ROUTES } from '@acorex/platform/layou
2
2
  import { Route } from '@angular/router';
3
3
 
4
4
  export const appRoutes: Route[] = [
5
- {
5
+ {
6
+ path: '<%= name %>',
7
+ loadChildren: () => import('./modules/<%= name %>/<%= name %>-root.module').then((c) => c.<%= upperCase(name) %>RootModule),
8
+ },
9
+ {
6
10
  path: '',
7
11
  pathMatch: 'full',
8
- redirectTo: '<%= name %>'
12
+ redirectTo: '<%= name %>',
9
13
  },
10
- {
11
- path: '',
12
- component: AXPAdminLayoutComponent,
13
- children: [
14
- {
15
- path: '<%= name %>',
16
- loadChildren: () => import('./modules/<%= name %>/<%= name %>-root.module').then(c => c.<%= upperCase(name) %>RootModule)
17
- },
18
- {
19
- path: '',
20
- children: [
21
- ...AX_ADMIN_ROUTES
22
- ]
23
- }
24
- ]
25
- }
26
14
  ];
@@ -1,4 +1,4 @@
1
- import { AXPAuthStrategy, AXPBaseCredentials, AXPRefreshTokenResult, AXPSignInResult, AXPUser } from '@acorex/platform/auth';
1
+ import { AXPAuthStrategy, AXPBaseCredentials, AXPRefreshTokenResult, AXPSessionContext, AXPSignInResult, AXPUser } from '@acorex/platform/auth';
2
2
  import { AXPDataProvider } from '@acorex/platform/common';
3
3
  import { Injectable, Injector, inject } from '@angular/core';
4
4
 
@@ -77,7 +77,15 @@ export class <%= upperCase(name) %>Strategy implements AXPAuthStrategy {
77
77
  console.log('User signed out');
78
78
  }
79
79
 
80
- refreshToken(refreshToken: string): Promise<AXPRefreshTokenResult> {
81
- throw new Error('Method not implemented.');
80
+ async refreshToken(context: AXPSessionContext): Promise<AXPRefreshTokenResult> {
81
+ return {
82
+ succeed: true,
83
+ data: {
84
+ accessToken: 'access_token',
85
+ refreshToken: 'refresh_token',
86
+ application: context.application,
87
+ tenant: context.tenant,
88
+ }
89
+ }
82
90
  }
83
91
  }
@@ -1,5 +1,5 @@
1
1
  import { AXPPermission, AXPPermissionLoader, AXPSessionContext } from '@acorex/platform/auth';
2
- import { AXP_ROOT_CONFIG_TOKEN } from '@acorex/platform/core';
2
+ import { AXP_ROOT_CONFIG_TOKEN } from '@acorex/platform/common';
3
3
  import { Injectable, inject } from '@angular/core';
4
4
  import { Observable, map, of } from 'rxjs';
5
5
 
@@ -1,5 +1,5 @@
1
1
  import { AXPTenant, AXPTenantLoader, AXPSessionContext } from '@acorex/platform/auth';
2
- import { AXP_ROOT_CONFIG_TOKEN } from '@acorex/platform/core';
2
+ import { AXP_ROOT_CONFIG_TOKEN } from '@acorex/platform/common';
3
3
  import { Injectable, inject } from '@angular/core';
4
4
  import { Observable, delay, of } from 'rxjs';
5
5
 
@@ -1,4 +1,4 @@
1
- import { AXPEntityConfig, AXPEntityLoader } from '@acorex/platform/layouts';
1
+ import { AXPEntityConfig, AXPEntityLoader } from '@acorex/platform/common';
2
2
  import { Injectable, Injector, inject } from '@angular/core';
3
3
 
4
4
  @Injectable()
@@ -1,17 +1,21 @@
1
1
  import {
2
2
  AXPAdminLayoutModule,
3
- AXPFooterTextSlotComponent,
4
3
  AXPLayoutModule,
4
+ } from '@acorex/platform/layouts';
5
+
6
+ import {
7
+ AXPFooterTextSlotComponent,
5
8
  AXPNavBarSlotComponent,
6
9
  AXPThemeSlotComponent,
7
10
  AXP_ENTITY_LOADER,
8
- } from '@acorex/platform/layouts';
11
+ AXPComponentSlotModule,
12
+ } from '@acorex/platform/common';
9
13
  import { NgModule, inject } from '@angular/core';
10
14
  import { AXPRootMenuLoader } from './menu.loader';
11
15
  import { AXPRootEntityLoader } from './entity.loader';
12
16
  import { AXPCommonModule, AXPMenuItem, AXPNavigateAction, AXP_MENU_LOADER, AXP_PLATFORM_CONFIG_TOKEN } from '@acorex/platform/common';
13
17
  import pkg from '../../../../../../package.json';
14
- import { AXPComponentSlotModule } from '@acorex/platform/layout';
18
+ import { AXPComponentSlotModule } from '@acorex/platform/layout/builder';
15
19
 
16
20
 
17
21
  @NgModule({
@@ -1,4 +1,5 @@
1
1
  import { AXPAuthGuard, AXPPermissionGuard } from '@acorex/platform/auth';
2
+ import { AXPRootLayoutComponent } from '@acorex/platform/themes/default';
2
3
  import { CommonModule } from '@angular/common';
3
4
  import { NgModule } from '@angular/core';
4
5
  import { RouterModule, Routes } from '@angular/router';
@@ -11,9 +12,10 @@ const routes: Routes = [
11
12
  },
12
13
  {
13
14
  path: '',
15
+ component: AXPRootLayoutComponent,
14
16
  children: [
15
17
  {
16
- //canActivate: [AXPAuthGuard],
18
+ canActivate: [AXPAuthGuard],
17
19
  path: 'home',
18
20
  loadComponent: () => import('./home/home.page').then((c) => c.<%= upperCase(name) %>HomePage),
19
21
  }
@@ -1,16 +1,15 @@
1
1
  import { AXDataSourceQuery } from '@acorex/components/common';
2
2
  import { applyFilterArray, applySortArray } from '@acorex/modules/backend';
3
3
  import {
4
- AXPEntityConfig,
5
- AXPEntityListDisplayColumnConfig,
6
- AXPEntityProperty,
7
- convertPropertiesToColumns,
8
- widgetSchemas,
9
- } from '@acorex/platform/layouts';
4
+ AXPEntityConfig,
5
+ AXPEntityListDisplayColumnConfig,
6
+ convertPropertiesToColumns,
7
+ AXPEntityPropertyConfig,
8
+ widgetSchemas,
9
+ } from '@acorex/platform/common';
10
10
  import { Injector } from '@angular/core';
11
- import { assign } from 'lodash-es';
12
11
 
13
- const properties: AXPEntityProperty[] = [
12
+ const properties: AXPEntityPropertyConfig[] = [
14
13
  {
15
14
  name: 'firstname',
16
15
  title: 'First Name',
@@ -99,7 +98,7 @@ const columns: AXPEntityListDisplayColumnConfig[] = convertPropertiesToColumns(.
99
98
  export async function entityFactory(injector: Injector): Promise<AXPEntityConfig> {
100
99
 
101
100
  const entity: AXPEntityConfig = {
102
- module: '<% name %>',
101
+ module: '<%= name %>',
103
102
  name: entityName,
104
103
  title: 'Sample Entity',
105
104
  properties: properties,
@@ -4,7 +4,6 @@ export const environment = {
4
4
  //?
5
5
  oidcConfig: {
6
6
  authority: 'https://192.168.25.91:44320',
7
- end_session_endpoint: 'https://192.168.25.91:44320/api/auth/logout',
8
7
  userinfo_endpoint: 'https://192.168.25.91:44320/api/userinfo',
9
8
  scope: 'openid profile email offline_access api1',
10
9
  client_id: 'acorex',
@@ -4,7 +4,6 @@ export const environment = {
4
4
  //?
5
5
  oidcConfig: {
6
6
  authority: 'https://localhost:44320',
7
- end_session_endpoint: 'https://localhost:44320/api/auth/logout',
8
7
  userinfo_endpoint: 'https://localhost:44320/api/userinfo',
9
8
  scope: 'openid profile email offline_access api1',
10
9
  client_id: 'acorex',
@@ -4,7 +4,6 @@ export const environment = {
4
4
  //?
5
5
  oidcConfig: {
6
6
  authority: 'https://asc.acorexui.com:44320',
7
- end_session_endpoint: 'https://asc.acorexui.com:44320/api/auth/logout',
8
7
  userinfo_endpoint: 'https://asc.acorexui.com:44320/api/userinfo',
9
8
  scope: 'openid profile email offline_access api1',
10
9
  client_id: 'acorex',
@@ -4,7 +4,6 @@ export const environment = {
4
4
  //?
5
5
  oidcConfig: {
6
6
  authority: 'https://asctest.acorexui.com:44320',
7
- end_session_endpoint: 'https://asctest.acorexui.com:44320/api/auth/logout',
8
7
  userinfo_endpoint: 'https://asctest.acorexui.com:44320/api/userinfo',
9
8
  scope: 'openid profile email offline_access api1',
10
9
  client_id: 'acorex',
@@ -4,7 +4,6 @@ export const environment = {
4
4
  //?
5
5
  oidcConfig: {
6
6
  authority: 'https://asctest.acorexui.com:44320',
7
- end_session_endpoint: 'https://asctest.acorexui.com:44320/api/auth/logout',
8
7
  userinfo_endpoint: 'https://asctest.acorexui.com:44320/api/userinfo',
9
8
  scope: 'openid profile email offline_access api1',
10
9
  client_id: 'acorex',
@@ -4,7 +4,6 @@ export const environment = {
4
4
  //?
5
5
  oidcConfig: {
6
6
  authority: 'https://localhost:44320',
7
- end_session_endpoint: 'https://localhost:44320/api/auth/logout',
8
7
  userinfo_endpoint: 'https://localhost:44320/api/userinfo',
9
8
  scope: 'openid profile email offline_access api1',
10
9
  client_id: 'acorex',
@@ -1,4 +1,4 @@
1
- export interface AppModuleGeneratorSchema {
2
- name: string;
3
- title: string;
4
- }
1
+ export interface AppModuleGeneratorSchema {
2
+ name: string;
3
+ title: string;
4
+ }
@@ -1,27 +1,27 @@
1
- {
2
- "$schema": "https://json-schema.org/schema",
3
- "$id": "AppModule",
4
- "title": "",
5
- "type": "object",
6
- "properties": {
7
- "name": {
8
- "type": "string",
9
- "description": "",
10
- "$default": {
11
- "$source": "argv",
12
- "index": 0
13
- },
14
- "x-prompt": "What name would you like to use?"
15
- },
16
- "title": {
17
- "type": "string",
18
- "description": "",
19
- "$default": {
20
- "$source": "argv",
21
- "index": 1
22
- },
23
- "x-prompt": "What title would you like to use?"
24
- }
25
- },
26
- "required": ["name", "title"]
27
- }
1
+ {
2
+ "$schema": "https://json-schema.org/schema",
3
+ "$id": "AppModule",
4
+ "title": "",
5
+ "type": "object",
6
+ "properties": {
7
+ "name": {
8
+ "type": "string",
9
+ "description": "",
10
+ "$default": {
11
+ "$source": "argv",
12
+ "index": 0
13
+ },
14
+ "x-prompt": "What name would you like to use?"
15
+ },
16
+ "title": {
17
+ "type": "string",
18
+ "description": "",
19
+ "$default": {
20
+ "$source": "argv",
21
+ "index": 1
22
+ },
23
+ "x-prompt": "What title would you like to use?"
24
+ }
25
+ },
26
+ "required": ["name", "title"]
27
+ }