@keycloakify/angular 0.0.11 → 0.1.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.
Files changed (60) hide show
  1. package/bin/108.index.js +242 -0
  2. package/bin/338.index.js +104 -54
  3. package/bin/402.index.js +1250 -0
  4. package/bin/758.index.js +777 -53
  5. package/bin/{925.index.js → 84.index.js} +124 -624
  6. package/bin/main.js +59 -4
  7. package/package.json +1 -1
  8. package/src/bin/add-story.ts +126 -0
  9. package/src/bin/eject-page.ts +49 -11
  10. package/src/bin/main.ts +2 -4
  11. package/src/bin/tools/nodeModulesBinDirPath.ts +38 -0
  12. package/src/bin/tools/runPrettier.ts +89 -0
  13. package/src/bin/tools/transformCodebase_async.ts +89 -0
  14. package/src/bin/update-kc-gen.ts +20 -15
  15. package/stories/account/pages/account.stories.ts +133 -0
  16. package/stories/account/pages/applications.stories.ts +196 -0
  17. package/stories/account/pages/federated-identity.stories.ts +78 -0
  18. package/stories/account/pages/log.stories.ts +147 -0
  19. package/stories/account/pages/password.stories.ts +104 -0
  20. package/stories/account/pages/sessions.stories.ts +143 -0
  21. package/stories/account/pages/totp.stories.ts +100 -0
  22. package/stories/login/pages/code.stories.ts +51 -0
  23. package/stories/login/pages/delete-account-confirm.stories.ts +43 -0
  24. package/stories/login/pages/delete-credential.stories.ts +56 -0
  25. package/stories/login/pages/error.stories.ts +56 -0
  26. package/stories/login/pages/frontchannel-logout.stories.ts +26 -0
  27. package/stories/login/pages/idp-review-user-profile.stories.ts +60 -0
  28. package/stories/login/pages/info.stories.ts +94 -0
  29. package/stories/login/pages/login-config-totp.stories.ts +57 -0
  30. package/stories/login/pages/login-device-verify-user-code.stories.ts +14 -0
  31. package/stories/login/pages/login-idp-link-confirm-override.stories.ts +17 -0
  32. package/stories/login/pages/login-idp-link-confirm.stories.ts +103 -0
  33. package/stories/login/pages/login-idp-link-email.stories.ts +102 -0
  34. package/stories/login/pages/login-oauth-grant.stories.ts +68 -0
  35. package/stories/login/pages/login-oauth2-device-verify-user-code.stories.ts +15 -0
  36. package/stories/login/pages/login-otp.stories.ts +94 -0
  37. package/stories/login/pages/login-page-expired.stories.ts +31 -0
  38. package/stories/login/pages/login-passkeys-conditional-authenticate.stories.ts +16 -0
  39. package/stories/login/pages/login-password.stories.ts +52 -0
  40. package/stories/login/pages/login-recovery-authn-code-config.stories.ts +31 -0
  41. package/stories/login/pages/login-recovery-authn-code-input.stories.ts +16 -0
  42. package/stories/login/pages/login-reset-otp.stories.ts +71 -0
  43. package/stories/login/pages/login-reset-password.stories.ts +50 -0
  44. package/stories/login/pages/login-update-password.stories.ts +46 -0
  45. package/stories/login/pages/login-update-profile.stories.ts +31 -0
  46. package/stories/login/pages/login-username.stories.ts +28 -0
  47. package/stories/login/pages/login-verify-email.stories.ts +98 -0
  48. package/stories/login/pages/login-x509-info.stories.ts +40 -0
  49. package/stories/login/pages/login.stories.ts +260 -0
  50. package/stories/login/pages/logout-confirm.stories.ts +44 -0
  51. package/stories/login/pages/register.stories.ts +230 -0
  52. package/stories/login/pages/saml-post-form.stories.ts +17 -0
  53. package/stories/login/pages/select-authenticator.stories.ts +95 -0
  54. package/stories/login/pages/terms.stories.ts +79 -0
  55. package/stories/login/pages/update-email.stories.ts +31 -0
  56. package/stories/login/pages/webauthn-authenticate.stories.ts +126 -0
  57. package/stories/login/pages/webauthn-error.stories.ts +62 -0
  58. package/stories/login/pages/webauthn-register.stories.ts +46 -0
  59. package/src/bin/tools/runFormat.ts +0 -71
  60. package/src/stories/login/pages/login/login.stories.ts +0 -146
@@ -1,71 +0,0 @@
1
- import * as fs from 'fs';
2
- import { dirname as pathDirname } from 'path';
3
- import { assert, Equals } from 'tsafe/assert';
4
- import chalk from 'chalk';
5
- import { id } from 'tsafe/id';
6
- import { z } from 'zod';
7
- import { is } from 'tsafe/is';
8
- import * as child_process from 'child_process';
9
-
10
- export function runFormat(params: { packageJsonFilePath: string }) {
11
- const { packageJsonFilePath } = params;
12
-
13
- const parsedPackageJson = (() => {
14
- type ParsedPackageJson = {
15
- scripts?: Record<string, string>;
16
- };
17
-
18
- const zParsedPackageJson = (() => {
19
- type TargetType = ParsedPackageJson;
20
-
21
- const zTargetType = z.object({
22
- scripts: z.record(z.string()).optional()
23
- });
24
-
25
- assert<Equals<z.infer<typeof zTargetType>, TargetType>>();
26
-
27
- return id<z.ZodType<TargetType>>(zTargetType);
28
- })();
29
-
30
- const parsedPackageJson = JSON.parse(
31
- fs.readFileSync(packageJsonFilePath).toString('utf8')
32
- );
33
-
34
- zParsedPackageJson.parse(parsedPackageJson);
35
-
36
- assert(is<ParsedPackageJson>(parsedPackageJson));
37
-
38
- return parsedPackageJson;
39
- })();
40
-
41
- const { scripts } = parsedPackageJson;
42
-
43
- if (scripts === undefined) {
44
- return;
45
- }
46
-
47
- for (const scriptName of ['format', 'lint']) {
48
- if (!(scriptName in scripts)) {
49
- continue;
50
- }
51
-
52
- const command = `npm run ${scriptName}`;
53
-
54
- console.log(chalk.grey(`$ ${command}`));
55
-
56
- try {
57
- child_process.execSync(`npm run ${scriptName}`, {
58
- stdio: 'inherit',
59
- cwd: pathDirname(packageJsonFilePath)
60
- });
61
- } catch {
62
- console.log(
63
- chalk.yellow(
64
- `\`${command}\` failed, please format your code manually, continuing...`
65
- )
66
- );
67
- }
68
-
69
- return;
70
- }
71
- }
@@ -1,146 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/angular';
2
- import { KcPageStoryComponent } from '../kc-page-story.component'; // Assuming this is the Angular component
3
-
4
- export const KcActionsData = {};
5
-
6
- const meta: Meta<KcPageStoryComponent> = {
7
- title: 'login/login.ftl',
8
- component: KcPageStoryComponent
9
- };
10
-
11
- export default meta;
12
-
13
- type Story = StoryObj<KcPageStoryComponent>;
14
-
15
- export const Default: Story = {
16
- args: {
17
- // No specific args, default rendering of the component
18
- }
19
- };
20
-
21
- export const WithInvalidCredential: Story = {
22
- args: {
23
- kcContext: {
24
- login: {
25
- username: 'johndoe'
26
- },
27
- messagesPerField: {
28
- existsError: (fieldName: string, ...otherFieldNames: string[]) => {
29
- const fieldNames = [fieldName, ...otherFieldNames];
30
- return (
31
- fieldNames.includes('username') || fieldNames.includes('password')
32
- );
33
- },
34
- get: (fieldName: string) => {
35
- if (fieldName === 'username' || fieldName === 'password') {
36
- return 'Invalid username or password.';
37
- }
38
- return '';
39
- }
40
- }
41
- }
42
- }
43
- };
44
-
45
- export const WithoutRegistration: Story = {
46
- args: {
47
- kcContext: {
48
- realm: { registrationAllowed: false }
49
- }
50
- }
51
- };
52
-
53
- export const WithoutRememberMe: Story = {
54
- args: {
55
- kcContext: {
56
- realm: { rememberMe: false }
57
- }
58
- }
59
- };
60
-
61
- export const WithoutPasswordReset: Story = {
62
- args: {
63
- kcContext: {
64
- realm: { resetPasswordAllowed: false }
65
- }
66
- }
67
- };
68
-
69
- export const WithEmailAsUsername: Story = {
70
- args: {
71
- kcContext: {
72
- realm: { loginWithEmailAllowed: false }
73
- }
74
- }
75
- };
76
-
77
- export const WithPresetUsername: Story = {
78
- args: {
79
- kcContext: {
80
- login: { username: 'max.mustermann@mail.com' }
81
- }
82
- }
83
- };
84
-
85
- export const WithImmutablePresetUsername: Story = {
86
- args: {
87
- kcContext: {
88
- auth: {
89
- attemptedUsername: 'max.mustermann@mail.com',
90
- showUsername: true
91
- },
92
- usernameHidden: true,
93
- message: {
94
- type: 'info',
95
- summary: 'Please re-authenticate to continue'
96
- }
97
- }
98
- }
99
- };
100
-
101
- export const WithSocialProviders: Story = {
102
- args: {
103
- kcContext: {
104
- social: {
105
- displayInfo: true,
106
- providers: [
107
- {
108
- loginUrl: 'google',
109
- alias: 'google',
110
- providerId: 'google',
111
- displayName: 'Google',
112
- iconClasses: 'fa fa-google'
113
- },
114
- {
115
- loginUrl: 'microsoft',
116
- alias: 'microsoft',
117
- providerId: 'microsoft',
118
- displayName: 'Microsoft',
119
- iconClasses: 'fa fa-windows'
120
- }
121
- // Add other providers as needed
122
- ]
123
- }
124
- }
125
- }
126
- };
127
-
128
- export const WithoutPasswordField: Story = {
129
- args: {
130
- kcContext: {
131
- realm: { password: false }
132
- }
133
- }
134
- };
135
-
136
- export const WithErrorMessage: Story = {
137
- args: {
138
- kcContext: {
139
- message: {
140
- summary:
141
- 'The time allotted for the connection has elapsed.<br/>The login process will restart from the beginning.',
142
- type: 'error'
143
- }
144
- }
145
- }
146
- };