@rxap/oauth 22.0.0-dev.0 → 22.0.0-dev.2

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 (77) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/README.md +5 -3
  3. package/compodoc/architecture.html +222 -0
  4. package/compodoc/changelog.html +76 -5
  5. package/compodoc/dependencies.html +104 -25
  6. package/compodoc/index.html +50 -8
  7. package/compodoc/injectables/AuthenticationService.html +83 -21
  8. package/compodoc/js/architecture-graph.js +288 -0
  9. package/compodoc/js/libs/bootstrap-native.js +4 -2
  10. package/compodoc/js/libs/jszip.min.js +13 -0
  11. package/compodoc/js/libs/svg-pan-zoom.min.js +3 -3
  12. package/compodoc/js/libs/tablesort.min.js +3 -3
  13. package/compodoc/js/libs/tablesort.number.min.js +3 -3
  14. package/compodoc/js/libs/vis-network.min.js +78 -0
  15. package/compodoc/js/menu-wc.js +25 -12
  16. package/compodoc/js/menu.js +10 -11
  17. package/compodoc/js/routes/routes_index.js +1 -0
  18. package/compodoc/js/routes.js +142 -34
  19. package/compodoc/js/search/search-lunr.js +6 -8
  20. package/compodoc/js/search/search.js +118 -66
  21. package/compodoc/js/search/search_index.js +2 -2
  22. package/compodoc/js/tabs.js +98 -15
  23. package/compodoc/js/tree.js +44 -7
  24. package/compodoc/license.html +48 -6
  25. package/compodoc/llms.txt +41 -0
  26. package/compodoc/miscellaneous/functions.html +140 -15
  27. package/compodoc/miscellaneous/variables.html +52 -5
  28. package/compodoc/modules.html +44 -3
  29. package/compodoc/overview.html +54 -3
  30. package/compodoc/properties.html +45 -4
  31. package/compodoc/routes.html +227 -0
  32. package/compodoc/styles/compodoc.css +365 -44
  33. package/compodoc/styles/dark.css +16 -0
  34. package/compodoc/template-playground/default-templates.json +192 -0
  35. package/compodoc/template-playground/hbs-render.service.ts +217 -0
  36. package/compodoc/template-playground/main.ts +9 -0
  37. package/compodoc/template-playground/template-editor.service.ts +173 -0
  38. package/compodoc/template-playground/template-playground.component.ts +614 -0
  39. package/compodoc/template-playground/template-playground.module.ts +29 -0
  40. package/compodoc/template-playground/zip-export.service.ts +86 -0
  41. package/compodoc/template-playground-app/app.js +1389 -0
  42. package/compodoc/template-playground-app/index.html +462 -0
  43. package/docs/documentation.json +135 -68
  44. package/docs/html/assets/highlight.css +1 -1
  45. package/docs/html/assets/icons.js +1 -1
  46. package/docs/html/assets/icons.svg +1 -1
  47. package/docs/html/assets/main.js +5 -5
  48. package/docs/html/assets/search.js +1 -1
  49. package/docs/html/assets/style.css +265 -228
  50. package/docs/html/classes/AuthenticationService.html +134 -8
  51. package/docs/html/functions/AuthenticationGuard.html +43 -1
  52. package/docs/html/functions/ProvideAuth.html +42 -1
  53. package/docs/html/functions/withAuthConfig.html +42 -1
  54. package/docs/html/hierarchy.html +29 -0
  55. package/docs/html/index.html +44 -7
  56. package/docs/html/modules.html +40 -1
  57. package/docs/markdown/README.md +6 -4
  58. package/docs/markdown/classes/AuthenticationService.md +13 -13
  59. package/docs/markdown/functions/AuthenticationGuard.md +2 -2
  60. package/docs/markdown/functions/ProvideAuth.md +2 -2
  61. package/docs/markdown/functions/withAuthConfig.md +2 -2
  62. package/docs/markdown/globals.md +2 -2
  63. package/docs/wiki/Class.AuthenticationService.md +12 -12
  64. package/docs/wiki/Function.AuthenticationGuard.md +1 -1
  65. package/docs/wiki/Function.ProvideAuth.md +1 -1
  66. package/docs/wiki/Function.withAuthConfig.md +1 -1
  67. package/docs/wiki/Home.md +5 -3
  68. package/docs/wiki/globals.md +1 -1
  69. package/generators.json +16 -0
  70. package/package.json +15 -17
  71. package/src/generators/init/generator.js +120 -0
  72. package/src/generators/init/index.js +6 -0
  73. package/src/generators/init/schema.json +8 -0
  74. package/src/generators/package.json +3 -0
  75. package/compodoc/js/libs/vis.min.js +0 -47
  76. package/compodoc/js/menu-wc_es5.js +0 -40
  77. package/theme.css +0 -1
package/package.json CHANGED
@@ -1,20 +1,20 @@
1
1
  {
2
- "version": "22.0.0-dev.0",
2
+ "version": "22.0.0-dev.2",
3
3
  "name": "@rxap/oauth",
4
4
  "description": "This package provides an authentication guard and service for Angular applications using OAuth 2.0 and OpenID Connect. It simplifies the integration of authentication flows, including sign-in, sign-out, and token management, with support for disabled authentication scenarios. The package also includes a provider function to streamline configuration.\n",
5
5
  "license": "GPL-3.0-or-later",
6
6
  "dependencies": {
7
7
  "@nx/devkit": "24.0.6",
8
- "tslib": "2.6.2"
8
+ "tslib": "2.9.1"
9
9
  },
10
10
  "peerDependencies": {
11
- "@angular/core": "^22.3.0",
12
- "@angular/router": "^22.3.0",
13
- "@rxap/authentication": "^22.0.0-dev.0",
14
- "@rxap/rxjs": "^1.1.18",
15
- "angular-oauth2-oidc": "^15.0.1",
16
- "angular-oauth2-oidc-jwks": "^15.0.1",
17
- "rxjs": "^7.8.2"
11
+ "@angular/core": "^22.0.0",
12
+ "@angular/router": "^22.0.0",
13
+ "@rxap/authentication": "^22.0.0-dev.2",
14
+ "@rxap/rxjs": "^1.1.19-dev.1",
15
+ "angular-oauth2-oidc": "^22.0.0",
16
+ "angular-oauth2-oidc-jwks": "^22.0.0",
17
+ "rxjs": "^7.0.0"
18
18
  },
19
19
  "author": {
20
20
  "name": "Merzough Münker",
@@ -59,21 +59,20 @@
59
59
  },
60
60
  {
61
61
  "package": "@rxap/authentication",
62
- "version": "22.0.0-dev.0"
62
+ "version": "22.0.0-dev.2"
63
63
  },
64
64
  {
65
65
  "package": "@rxap/rxjs",
66
- "version": "1.1.18"
66
+ "version": "1.1.19-dev.1"
67
67
  },
68
68
  {
69
69
  "package": "@rxap/utilities",
70
- "version": "16.5.2"
70
+ "version": "16.5.3-dev.1"
71
71
  }
72
72
  ]
73
73
  },
74
74
  "publishConfig": {
75
- "access": "public",
76
- "directory": "../../../dist/packages/angular/oauth"
75
+ "access": "public"
77
76
  },
78
77
  "repository": {
79
78
  "type": "git",
@@ -91,8 +90,7 @@
91
90
  ".": {
92
91
  "types": "./types/rxap-oauth.d.ts",
93
92
  "default": "./fesm2022/rxap-oauth.mjs"
94
- },
95
- "./theme": "./theme.css"
93
+ }
96
94
  },
97
95
  "type": "module"
98
- }
96
+ }
@@ -0,0 +1,120 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.initGenerator = initGenerator;
4
+ const devkit_1 = require("@nx/devkit");
5
+ const fs_1 = require("fs");
6
+ const path_1 = require("path");
7
+ /**
8
+ * Resolves the directory of a package installed in the workspace. The lookup starts at the
9
+ * workspace root, not at this package: with an isolated node_modules layout (pnpm) or Yarn PnP
10
+ * the peer is not resolvable from here. The plain node_modules path is the fallback for packages
11
+ * whose `exports` map hides their package.json.
12
+ */
13
+ function resolvePackageDir(root, packageName) {
14
+ try {
15
+ return (0, path_1.dirname)(require.resolve(`${packageName}/package.json`, { paths: [root] }));
16
+ }
17
+ catch {
18
+ return (0, path_1.join)(root, 'node_modules', ...packageName.split('/'));
19
+ }
20
+ }
21
+ async function initGenerator(tree, options) {
22
+ // The package's own package.json lives on disk next to the compiled generator
23
+ // (inside node_modules when installed), which the virtual Tree does not track.
24
+ // Read it directly from the physical filesystem.
25
+ const packageJsonFilePath = (0, path_1.join)(__dirname, '..', '..', '..', 'package.json');
26
+ if (!(0, fs_1.existsSync)(packageJsonFilePath)) {
27
+ console.error('package.json not found in: ' + packageJsonFilePath);
28
+ return;
29
+ }
30
+ const { peerDependencies, name: packageName } = JSON.parse((0, fs_1.readFileSync)(packageJsonFilePath, 'utf-8'));
31
+ console.log(`Coerce peer dependencies for package: ${packageName}`);
32
+ if (!peerDependencies || !Object.keys(peerDependencies).length) {
33
+ console.log('No peer dependencies found');
34
+ return;
35
+ }
36
+ console.log(`Peer dependencies: ${Object.keys(peerDependencies).join(', ')}`);
37
+ const rootPackageJson = JSON.parse(tree.read('package.json', 'utf-8'));
38
+ let isDevDependency = !!rootPackageJson.devDependencies?.[packageName];
39
+ if (isDevDependency &&
40
+ [/^@rxap\/ngx/, /^@rxap\/nest/].some((rx) => rx.test(packageName))) {
41
+ rootPackageJson.dependencies ??= {};
42
+ rootPackageJson.dependencies[packageName] =
43
+ rootPackageJson.devDependencies[packageName];
44
+ delete rootPackageJson.devDependencies[packageName];
45
+ isDevDependency = false;
46
+ tree.write('package.json', JSON.stringify(rootPackageJson, null, 2));
47
+ }
48
+ if (!isDevDependency &&
49
+ [
50
+ /^@rxap\/plugin/,
51
+ /^@rxap\/workspace/,
52
+ /@rxap\/schematic/,
53
+ ].some((rx) => rx.test(packageName))) {
54
+ rootPackageJson.devDependencies ??= {};
55
+ rootPackageJson.devDependencies[packageName] =
56
+ rootPackageJson.dependencies[packageName];
57
+ delete rootPackageJson.dependencies[packageName];
58
+ isDevDependency = true;
59
+ tree.write('package.json', JSON.stringify(rootPackageJson, null, 2));
60
+ }
61
+ const missingPeerDependencies = Object.entries(peerDependencies)
62
+ .filter(([dep]) => !rootPackageJson.dependencies?.[dep] &&
63
+ !rootPackageJson.devDependencies?.[dep])
64
+ .reduce((acc, [dep, version]) => ({ ...acc, [dep]: version }), {});
65
+ if (!Object.keys(missingPeerDependencies).length) {
66
+ console.log('No missing peer dependencies');
67
+ return;
68
+ }
69
+ if (isDevDependency) {
70
+ (0, devkit_1.addDependenciesToPackageJson)(tree, {}, missingPeerDependencies);
71
+ }
72
+ else {
73
+ (0, devkit_1.addDependenciesToPackageJson)(tree, missingPeerDependencies, {});
74
+ }
75
+ await (0, devkit_1.formatFiles)(tree);
76
+ (0, devkit_1.installPackagesTask)(tree);
77
+ for (const peer of Object.keys(missingPeerDependencies)) {
78
+ console.log(`Peer dependency ${peer} added to package.json`);
79
+ // node_modules is physical and excluded from the virtual Tree, so read the
80
+ // peer files from disk.
81
+ const peerPackageDir = resolvePackageDir(tree.root, peer);
82
+ const peerPackageJsonFilePath = (0, path_1.join)(peerPackageDir, 'package.json');
83
+ if (!(0, fs_1.existsSync)(peerPackageJsonFilePath)) {
84
+ console.log(`Peer dependency ${peer} has no package.json`);
85
+ continue;
86
+ }
87
+ const { generators, schematics } = JSON.parse((0, fs_1.readFileSync)(peerPackageJsonFilePath, 'utf-8'));
88
+ if (!generators && !schematics) {
89
+ console.log(`Peer dependency ${peer} has no generators or schematics`);
90
+ continue;
91
+ }
92
+ const configFile = generators || schematics;
93
+ const configFilePath = (0, path_1.join)(peerPackageDir, configFile);
94
+ if (!(0, fs_1.existsSync)(configFilePath)) {
95
+ console.log(`Peer dependency ${peer} has no generators or schematics file`);
96
+ continue;
97
+ }
98
+ const config = JSON.parse((0, fs_1.readFileSync)(configFilePath, 'utf-8'));
99
+ if (!config.generators?.init) {
100
+ console.log(`Peer dependency ${peer} has no init generator`);
101
+ continue;
102
+ }
103
+ const initGeneratorFilePath = config.generators.init.factory;
104
+ const fullInitGeneratorFilePath = (0, path_1.join)(peerPackageDir, initGeneratorFilePath) + '.js';
105
+ if (!(0, fs_1.existsSync)(fullInitGeneratorFilePath)) {
106
+ console.log(`Peer dependency ${peer} has no init generator file: ` +
107
+ fullInitGeneratorFilePath);
108
+ continue;
109
+ }
110
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
111
+ const initGenerator = require((0, path_1.join)(peerPackageDir, initGeneratorFilePath))?.default;
112
+ if (typeof initGenerator !== 'function') {
113
+ console.log(`Peer dependency ${peer} has no init generator function`);
114
+ continue;
115
+ }
116
+ console.log(`Run init generator for peer dependency ${peer}`);
117
+ await initGenerator(tree, options);
118
+ }
119
+ }
120
+ exports.default = initGenerator;
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const devkit_1 = require("@nx/devkit");
4
+ const generator_1 = require("./generator");
5
+ const schematic = (0, devkit_1.convertNxGenerator)(generator_1.default);
6
+ exports.default = schematic;
@@ -0,0 +1,8 @@
1
+ {
2
+ "$schema": "http://json-schema.org/schema",
3
+ "$id": "Init",
4
+ "title": "",
5
+ "type": "object",
6
+ "properties": {},
7
+ "required": []
8
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "commonjs"
3
+ }