@genesislcap/foundation-user 14.176.1-alpha-ed9e3d4.0 → 14.177.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,11 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@genesislcap/foundation-user](./foundation-user.md) &gt; [DefaultUser](./foundation-user.defaultuser.md) &gt; [permissions](./foundation-user.defaultuser.permissions.md)
4
+
5
+ ## DefaultUser.permissions property
6
+
7
+ **Signature:**
8
+
9
+ ```typescript
10
+ get permissions(): string[];
11
+ ```
@@ -0,0 +1,11 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@genesislcap/foundation-user](./foundation-user.md) &gt; [DefaultUser](./foundation-user.defaultuser.md) &gt; [profiles](./foundation-user.defaultuser.profiles.md)
4
+
5
+ ## DefaultUser.profiles property
6
+
7
+ **Signature:**
8
+
9
+ ```typescript
10
+ get profiles(): string[];
11
+ ```
@@ -0,0 +1,39 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@genesislcap/foundation-user](./foundation-user.md) &gt; [getUserChannel](./foundation-user.getuserchannel.md)
4
+
5
+ ## getUserChannel() function
6
+
7
+ Gets UserChannel from the DI container.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ export declare function getUserChannel(): UserChannel;
13
+ ```
14
+ **Returns:**
15
+
16
+ [UserChannel](./foundation-user.userchannel.md)
17
+
18
+ ## Remarks
19
+
20
+ A utility method for host applications that are not using decorators or the DI container.
21
+
22
+ ## Example
23
+
24
+
25
+ ```ts
26
+ import { getUserChannel } from '@genesislcap/foundation-user';
27
+ ...
28
+ const channel = getUserChannel();
29
+ ...
30
+ channel.onmessage = (e) => {
31
+ if (channel.isMessageType('user-authentication-change', e)) {
32
+ logger.debug('user-authentication-change', e.data.detail);
33
+ return;
34
+ }
35
+ }
36
+ ...
37
+ channel.close();
38
+ ```
39
+
@@ -0,0 +1,20 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@genesislcap/foundation-user](./foundation-user.md) &gt; [LegacyUserAPI](./foundation-user.legacyuserapi.md) &gt; [hasAdminProfile](./foundation-user.legacyuserapi.hasadminprofile.md)
4
+
5
+ ## LegacyUserAPI.hasAdminProfile() method
6
+
7
+ > Warning: This API is now obsolete.
8
+ >
9
+ > - Use `isAdmin` instead.
10
+ >
11
+
12
+ **Signature:**
13
+
14
+ ```typescript
15
+ hasAdminProfile(): boolean;
16
+ ```
17
+ **Returns:**
18
+
19
+ boolean
20
+
@@ -0,0 +1,30 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@genesislcap/foundation-user](./foundation-user.md) &gt; [LegacyUserAPI](./foundation-user.legacyuserapi.md)
4
+
5
+ ## LegacyUserAPI interface
6
+
7
+ **Signature:**
8
+
9
+ ```typescript
10
+ export interface LegacyUserAPI
11
+ ```
12
+
13
+ ## Remarks
14
+
15
+ For backwards compatibility, will be removed in a future major release, likely v15.
16
+
17
+ ## Properties
18
+
19
+ | Property | Modifiers | Type | Description |
20
+ | --- | --- | --- | --- |
21
+ | [permissions](./foundation-user.legacyuserapi.permissions.md) | <code>readonly</code> | string\[\] | |
22
+ | [profiles](./foundation-user.legacyuserapi.profiles.md) | <code>readonly</code> | string\[\] | |
23
+ | [username](./foundation-user.legacyuserapi.username.md) | <code>readonly</code> | string | |
24
+
25
+ ## Methods
26
+
27
+ | Method | Description |
28
+ | --- | --- |
29
+ | [hasAdminProfile()](./foundation-user.legacyuserapi.hasadminprofile.md) | |
30
+
@@ -0,0 +1,16 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@genesislcap/foundation-user](./foundation-user.md) &gt; [LegacyUserAPI](./foundation-user.legacyuserapi.md) &gt; [permissions](./foundation-user.legacyuserapi.permissions.md)
4
+
5
+ ## LegacyUserAPI.permissions property
6
+
7
+ > Warning: This API is now obsolete.
8
+ >
9
+ > - Use `permission` instead.
10
+ >
11
+
12
+ **Signature:**
13
+
14
+ ```typescript
15
+ readonly permissions: string[];
16
+ ```
@@ -0,0 +1,16 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@genesislcap/foundation-user](./foundation-user.md) &gt; [LegacyUserAPI](./foundation-user.legacyuserapi.md) &gt; [profiles](./foundation-user.legacyuserapi.profiles.md)
4
+
5
+ ## LegacyUserAPI.profiles property
6
+
7
+ > Warning: This API is now obsolete.
8
+ >
9
+ > - Use `profile` instead.
10
+ >
11
+
12
+ **Signature:**
13
+
14
+ ```typescript
15
+ readonly profiles: string[];
16
+ ```
@@ -0,0 +1,16 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@genesislcap/foundation-user](./foundation-user.md) &gt; [LegacyUserAPI](./foundation-user.legacyuserapi.md) &gt; [username](./foundation-user.legacyuserapi.username.md)
4
+
5
+ ## LegacyUserAPI.username property
6
+
7
+ > Warning: This API is now obsolete.
8
+ >
9
+ > - Use `userName` instead.
10
+ >
11
+
12
+ **Signature:**
13
+
14
+ ```typescript
15
+ readonly username: string;
16
+ ```
@@ -15,14 +15,17 @@
15
15
  | Function | Description |
16
16
  | --- | --- |
17
17
  | [getUser()](./foundation-user.getuser.md) | Gets User from the DI container. |
18
+ | [getUserChannel()](./foundation-user.getuserchannel.md) | Gets UserChannel from the DI container. |
18
19
 
19
20
  ## Interfaces
20
21
 
21
22
  | Interface | Description |
22
23
  | --- | --- |
24
+ | [LegacyUserAPI](./foundation-user.legacyuserapi.md) | |
23
25
  | [SetUserProperties](./foundation-user.setuserproperties.md) | SetUserProperties is a partial match of <code>LoginAck</code> from <code>@genesislcap/foundation-auth</code>. |
24
26
  | [User](./foundation-user.user.md) | User interface. |
25
27
  | [UserActionHistory](./foundation-user.useractionhistory.md) | UserActionHistory. |
28
+ | [UserChannel](./foundation-user.userchannel.md) | UserChannel DI interface. |
26
29
  | [UserConfig](./foundation-user.userconfig.md) | UserConfig DI interface. |
27
30
  | [UserDetailsProductProperty](./foundation-user.userdetailsproductproperty.md) | |
28
31
  | [UserDetailsProperty](./foundation-user.userdetailsproperty.md) | |
@@ -38,10 +41,12 @@
38
41
  | [defaultUserConfig](./foundation-user.defaultuserconfig.md) | Default UserConfig DI implementation. |
39
42
  | [logger](./foundation-user.logger.md) | |
40
43
  | [UserAuthenticationChangeType](./foundation-user.userauthenticationchangetype.md) | UserAuthenticationChangeType. |
44
+ | [UserChannelId](./foundation-user.userchannelid.md) | UserChannelId. |
41
45
 
42
46
  ## Type Aliases
43
47
 
44
48
  | Type Alias | Description |
45
49
  | --- | --- |
46
50
  | [UserAuthenticationChangeEvent](./foundation-user.userauthenticationchangeevent.md) | UserAuthenticationChangeEvent. |
51
+ | [UserChannelEvents](./foundation-user.userchannelevents.md) | UserChannelEvents. |
47
52
 
@@ -24,9 +24,7 @@ addAuthenticationChangeListener(listener: Listener<UserAuthenticationChangeEvent
24
24
 
25
25
 
26
26
  ```ts
27
- import type { UserAuthenticationChangeEvent } from '@genesislcap/foundation-user';
28
- ...
29
- const unsubscribe = this.user.addAuthenticationChangeListener((event: UserAuthenticationChangeEvent) => {
27
+ const unsubscribe = this.user.addAuthenticationChangeListener((event) => {
30
28
  console.log('User authenticated?', event.detail);
31
29
  });
32
30
  ```
@@ -9,9 +9,9 @@ User interface.
9
9
  **Signature:**
10
10
 
11
11
  ```typescript
12
- export interface User extends UserPathHistory, UserActionHistory
12
+ export interface User extends UserPathHistory, UserActionHistory, LegacyUserAPI
13
13
  ```
14
- **Extends:** [UserPathHistory](./foundation-user.userpathhistory.md)<!-- -->, [UserActionHistory](./foundation-user.useractionhistory.md)
14
+ **Extends:** [UserPathHistory](./foundation-user.userpathhistory.md)<!-- -->, [UserActionHistory](./foundation-user.useractionhistory.md)<!-- -->, [LegacyUserAPI](./foundation-user.legacyuserapi.md)
15
15
 
16
16
  ## Remarks
17
17
 
@@ -38,7 +38,6 @@ import { User } from '@genesislcap/foundation-user';
38
38
  | [rawProperties](./foundation-user.user.rawproperties.md) | <code>readonly</code> | Partial&lt;[SetUserProperties](./foundation-user.setuserproperties.md)<!-- -->&gt; | A structuredClone of the raw unmanaged properties used to set the user. |
39
39
  | [sourceRef](./foundation-user.user.sourceref.md) | <code>readonly</code> | string | |
40
40
  | [userKVs](./foundation-user.user.userkvs.md) | <code>readonly</code> | { \[key: string\]: any; } | |
41
- | [username](./foundation-user.user.username.md) | <code>readonly</code> | string | |
42
41
  | [userName](./foundation-user.user.username.md) | <code>readonly</code> | string | |
43
42
 
44
43
  ## Methods
@@ -0,0 +1,33 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@genesislcap/foundation-user](./foundation-user.md) &gt; [UserChannel](./foundation-user.userchannel.md)
4
+
5
+ ## UserChannel interface
6
+
7
+ UserChannel DI interface.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ export interface UserChannel extends TypedBroadcastChannel<UserChannelEvents>
13
+ ```
14
+ **Extends:** TypedBroadcastChannel&lt;[UserChannelEvents](./foundation-user.userchannelevents.md)<!-- -->&gt;
15
+
16
+ ## Example
17
+
18
+
19
+ ```ts
20
+ import { UserChannel } from '@genesislcap/foundation-user';
21
+ ...
22
+ @UserChannel protected channel: UserChannel;
23
+ ...
24
+ this.channel.onmessage = (e) => {
25
+ if (this.channel.isMessageType('user-authentication-change', e)) {
26
+ logger.debug('user-authentication-change', e.data.detail);
27
+ return;
28
+ }
29
+ }
30
+ ...
31
+ this.channel.close();
32
+ ```
33
+
@@ -0,0 +1,17 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@genesislcap/foundation-user](./foundation-user.md) &gt; [UserChannelEvents](./foundation-user.userchannelevents.md)
4
+
5
+ ## UserChannelEvents type
6
+
7
+ UserChannelEvents.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ export type UserChannelEvents = {
13
+ [UserAuthenticationChangeType]: boolean;
14
+ };
15
+ ```
16
+ **References:** [UserAuthenticationChangeType](./foundation-user.userauthenticationchangetype.md)
17
+
@@ -0,0 +1,13 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@genesislcap/foundation-user](./foundation-user.md) &gt; [UserChannelId](./foundation-user.userchannelid.md)
4
+
5
+ ## UserChannelId variable
6
+
7
+ UserChannelId.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ UserChannelId = "genesis-user"
13
+ ```
@@ -8,6 +8,7 @@ import { InterfaceSymbol } from '@microsoft/fast-foundation';
8
8
  import { Listener } from '@genesislcap/foundation-utils';
9
9
  import { Logger } from '@genesislcap/foundation-logger';
10
10
  import { Observer } from '@genesislcap/foundation-utils';
11
+ import { TypedBroadcastChannel } from '@genesislcap/foundation-broadcast-channel';
11
12
 
12
13
  // @public
13
14
  export class DefaultUser implements User {
@@ -30,6 +31,8 @@ export class DefaultUser implements User {
30
31
  //
31
32
  // (undocumented)
32
33
  details: SetUserProperties['details'];
34
+ // (undocumented)
35
+ hasAdminProfile(): boolean;
33
36
  // @internal (undocumented)
34
37
  protected hasKey(keys: string[], key: string | string[]): boolean;
35
38
  // Warning: (ae-unresolved-inheritdoc-reference) The @inheritDoc reference could not be resolved: The reference is ambiguous because "User" has more than one declaration; you need to add a TSDoc member reference selector
@@ -66,10 +69,18 @@ export class DefaultUser implements User {
66
69
  //
67
70
  // (undocumented)
68
71
  permission: string[];
72
+ // @internal (undocumented)
73
+ protected permissionChanged(): void;
74
+ // (undocumented)
75
+ get permissions(): string[];
69
76
  // Warning: (ae-unresolved-inheritdoc-reference) The @inheritDoc reference could not be resolved: The reference is ambiguous because "User" has more than one declaration; you need to add a TSDoc member reference selector
70
77
  //
71
78
  // (undocumented)
72
79
  profile: string[];
80
+ // @internal (undocumented)
81
+ protected profileChanged(): void;
82
+ // (undocumented)
83
+ get profiles(): string[];
73
84
  // Warning: (ae-unresolved-inheritdoc-reference) The @inheritDoc reference could not be resolved: The reference is ambiguous because "User" has more than one declaration; you need to add a TSDoc member reference selector
74
85
  //
75
86
  // (undocumented)
@@ -98,8 +109,6 @@ export class DefaultUser implements User {
98
109
  //
99
110
  // (undocumented)
100
111
  userName: string;
101
- // Warning: (ae-unresolved-inheritdoc-reference) The @inheritDoc reference could not be resolved: The reference is ambiguous because "User" has more than one declaration; you need to add a TSDoc member reference selector
102
- //
103
112
  // (undocumented)
104
113
  get username(): string;
105
114
  // @internal (undocumented)
@@ -112,6 +121,21 @@ export const defaultUserConfig: UserConfig;
112
121
  // @public
113
122
  export function getUser(): User;
114
123
 
124
+ // @public
125
+ export function getUserChannel(): UserChannel;
126
+
127
+ // @public (undocumented)
128
+ export interface LegacyUserAPI {
129
+ // @deprecated (undocumented)
130
+ hasAdminProfile(): boolean;
131
+ // @deprecated (undocumented)
132
+ readonly permissions: string[];
133
+ // @deprecated (undocumented)
134
+ readonly profiles: string[];
135
+ // @deprecated (undocumented)
136
+ readonly username: string;
137
+ }
138
+
115
139
  // @public (undocumented)
116
140
  export const logger: Logger;
117
141
 
@@ -136,7 +160,7 @@ export interface SetUserProperties extends Partial<UserQueueProperties> {
136
160
  // Warning: (ae-internal-mixed-release-tag) Mixed release tags are not allowed for "User" because one of its declarations is marked as @internal
137
161
  //
138
162
  // @public
139
- export interface User extends UserPathHistory, UserActionHistory {
163
+ export interface User extends UserPathHistory, UserActionHistory, LegacyUserAPI {
140
164
  // (undocumented)
141
165
  addAuthenticationChangeListener(listener: Listener<UserAuthenticationChangeEvent>): () => void;
142
166
  // (undocumented)
@@ -172,8 +196,6 @@ export interface User extends UserPathHistory, UserActionHistory {
172
196
  };
173
197
  // (undocumented)
174
198
  readonly userName: string;
175
- // (undocumented)
176
- readonly username: string;
177
199
  }
178
200
 
179
201
  // @internal
@@ -194,6 +216,23 @@ export type UserAuthenticationChangeEvent = CustomEvent<boolean>;
194
216
  // @public
195
217
  export const UserAuthenticationChangeType = "user-authentication-change";
196
218
 
219
+ // Warning: (ae-internal-mixed-release-tag) Mixed release tags are not allowed for "UserChannel" because one of its declarations is marked as @internal
220
+ //
221
+ // @public
222
+ export interface UserChannel extends TypedBroadcastChannel<UserChannelEvents> {
223
+ }
224
+
225
+ // @internal
226
+ export const UserChannel: InterfaceSymbol<TypedBroadcastChannel<UserChannelEvents>>;
227
+
228
+ // @public
229
+ export type UserChannelEvents = {
230
+ [UserAuthenticationChangeType]: boolean;
231
+ };
232
+
233
+ // @public
234
+ export const UserChannelId = "genesis-user";
235
+
197
236
  // Warning: (ae-internal-mixed-release-tag) Mixed release tags are not allowed for "UserConfig" because one of its declarations is marked as @internal
198
237
  //
199
238
  // @public
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@genesislcap/foundation-user",
3
3
  "description": "Genesis User",
4
- "version": "14.176.1-alpha-ed9e3d4.0",
4
+ "version": "14.177.1",
5
5
  "sideEffects": false,
6
6
  "license": "SEE LICENSE IN license.txt",
7
7
  "main": "dist/esm/index.js",
@@ -26,18 +26,19 @@
26
26
  "test": "genx test"
27
27
  },
28
28
  "devDependencies": {
29
- "@genesislcap/foundation-testing": "14.176.1-alpha-ed9e3d4.0",
30
- "@genesislcap/genx": "14.176.1-alpha-ed9e3d4.0",
31
- "@genesislcap/rollup-builder": "14.176.1-alpha-ed9e3d4.0",
32
- "@genesislcap/ts-builder": "14.176.1-alpha-ed9e3d4.0",
33
- "@genesislcap/uvu-playwright-builder": "14.176.1-alpha-ed9e3d4.0",
34
- "@genesislcap/vite-builder": "14.176.1-alpha-ed9e3d4.0",
35
- "@genesislcap/webpack-builder": "14.176.1-alpha-ed9e3d4.0",
29
+ "@genesislcap/foundation-testing": "14.177.1",
30
+ "@genesislcap/genx": "14.177.1",
31
+ "@genesislcap/rollup-builder": "14.177.1",
32
+ "@genesislcap/ts-builder": "14.177.1",
33
+ "@genesislcap/uvu-playwright-builder": "14.177.1",
34
+ "@genesislcap/vite-builder": "14.177.1",
35
+ "@genesislcap/webpack-builder": "14.177.1",
36
36
  "rimraf": "^3.0.2"
37
37
  },
38
38
  "dependencies": {
39
- "@genesislcap/foundation-logger": "14.176.1-alpha-ed9e3d4.0",
40
- "@genesislcap/foundation-utils": "14.176.1-alpha-ed9e3d4.0",
39
+ "@genesislcap/foundation-broadcast-channel": "14.177.1",
40
+ "@genesislcap/foundation-logger": "14.177.1",
41
+ "@genesislcap/foundation-utils": "14.177.1",
41
42
  "@microsoft/fast-element": "^1.12.0",
42
43
  "@microsoft/fast-foundation": "^2.49.4"
43
44
  },
@@ -49,5 +50,5 @@
49
50
  "publishConfig": {
50
51
  "access": "public"
51
52
  },
52
- "gitHead": "6445272a68d360b0f5bb97adc641df806470957e"
53
+ "gitHead": "c07c95144c7ef605e038161300877aea756dcc28"
53
54
  }