@endge/core 1.2.13 → 2.0.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/core.cjs +312 -308
- package/dist/core.js +31530 -28231
- package/dist/domain/entities/reflect/RAuthProfile.d.ts +3 -3
- package/dist/domain/entities/runtime/ComponentSFCEventBoundary.d.ts +2 -0
- package/dist/domain/entities/runtime/hosts/ComponentSFCRuntimeHost.d.ts +1 -1
- package/dist/domain/types/auth/auth-profile.types.d.ts +79 -27
- package/dist/domain/types/auth/auth-runtime.types.d.ts +0 -23
- package/dist/domain/types/component/sfc/ast.types.d.ts +2 -0
- package/dist/domain/types/component/sfc/intrinsic-events.types.d.ts +6 -0
- package/dist/domain/types/component/sfc/ir.types.d.ts +90 -1
- package/dist/domain/types/component/sfc/visual-projection.types.d.ts +34 -0
- package/dist/domain/types/document/domain-export.type.d.ts +1 -0
- package/dist/domain/types/kernel/bootstrap.types.d.ts +1 -1
- package/dist/main.d.ts +3 -0
- package/dist/model/modules/domain/endge-domain.d.ts +2 -0
- package/dist/model/modules/security/auth/AuthInteractionRequiredError.d.ts +6 -0
- package/dist/model/modules/security/auth/AuthProfileRegistry.d.ts +4 -4
- package/dist/model/modules/security/auth/AuthRequestResolver.d.ts +6 -1
- package/dist/model/modules/security/auth/AuthSessionManager.d.ts +2 -6
- package/dist/model/modules/security/auth/adapters/BasicAuthAdapter.d.ts +10 -0
- package/dist/model/modules/security/auth/adapters/BearerAuthAdapter.d.ts +1 -1
- package/dist/model/modules/security/auth/adapters/OAuth2ClientCredentialsAuthAdapter.d.ts +8 -0
- package/dist/model/modules/security/auth/adapters/OidcAuthAdapter.d.ts +8 -0
- package/dist/model/modules/security/endge-auth.d.ts +12 -2
- package/dist/model/services/auth/OidcBrowserSession_Service.d.ts +26 -0
- package/dist/model/services/compiler/component-sfc/component-sfc-interactions.d.ts +12 -0
- package/dist/test/component-sfc-interactions.bench.d.ts +1 -0
- package/dist/test/component-sfc-interactions.test.d.ts +1 -0
- package/dist/test/security/auth-profile-serializer.test.d.ts +1 -0
- package/dist/test/security/auth-test-helpers.d.ts +0 -1
- package/dist/test/security/oidc-browser-session.test.d.ts +1 -0
- package/dist/test/tools/component-sfc-edit-trigger.test.d.ts +1 -0
- package/dist/tools/component-sfc-edit-trigger.d.ts +11 -0
- package/package.json +6 -4
- package/dist/model/modules/security/auth/adapters/KeycloakAuthAdapter.d.ts +0 -25
- package/dist/model/services/auth/KeycloakAuthClient.d.ts +0 -21
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { AuthProfileAdapterId, AuthProfileConfig,
|
|
1
|
+
import { AuthProfileAdapterId, AuthProfileConfig, AuthProfileCredentials, AuthSessionPolicy } from '../../types/auth/auth-profile.types';
|
|
2
2
|
import { DuplicateOptions, REntity } from './REntity';
|
|
3
3
|
export declare class RAuthProfile extends REntity {
|
|
4
4
|
displayName: string;
|
|
5
5
|
description: string | null;
|
|
6
6
|
adapterId: AuthProfileAdapterId;
|
|
7
7
|
config: AuthProfileConfig;
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
credentials: AuthProfileCredentials;
|
|
9
|
+
session: AuthSessionPolicy | undefined;
|
|
10
10
|
active: boolean;
|
|
11
11
|
static fromPlain(raw: any): RAuthProfile;
|
|
12
12
|
toPlain(): Record<string, unknown>;
|
|
@@ -21,6 +21,8 @@ export declare class ComponentSFCEventBoundary {
|
|
|
21
21
|
} | null): ComponentSFCEventBoundary;
|
|
22
22
|
/** True when the current public manifest observes one Event of this child source. */
|
|
23
23
|
observesChild(source: ComponentSFCEventRuntimeSource, event: string): boolean;
|
|
24
|
+
/** Claims a mount-scoped logical `.once` rule after it has matched. */
|
|
25
|
+
claimLocalOnce(key: string): boolean;
|
|
24
26
|
/** Runs local `@event` reactions, then routes the occurrence unless `.stop` is present. */
|
|
25
27
|
routeChild(source: ComponentSFCEventRuntimeSource, event: string, payload: unknown, bindings?: readonly RComponentSFC_IR_EventBinding[], trace?: string[], depth?: number, scope?: Record<string, unknown>): Promise<void>;
|
|
26
28
|
/** Receives an intrinsic or nested child occurrence and resolves public ports by origin. */
|
|
@@ -81,7 +81,7 @@ export declare class ComponentSFCRuntimeHost extends RuntimeHostBase<'component-
|
|
|
81
81
|
/** Emits an own/public Event through the root Component SFC boundary. */
|
|
82
82
|
emitEventPort(name: string, payload: unknown, source?: ComponentSFCEventRuntimeSource): Promise<void>;
|
|
83
83
|
/** Executes one compiler-linked Event reaction for a renderer boundary. */
|
|
84
|
-
executeEventPortAction(ownerIdentity: string, port: ComponentSFCEventPort, payload: unknown, source: ComponentSFCEventRuntimeSource | undefined, emitOwn: (name: string, payload: unknown, trace: string[], depth: number) => Promise<void>, trace?: string[], depth?: number, scope?: Record<string, unknown>): Promise<
|
|
84
|
+
executeEventPortAction(ownerIdentity: string, port: ComponentSFCEventPort, payload: unknown, source: ComponentSFCEventRuntimeSource | undefined, emitOwn: (name: string, payload: unknown, trace: string[], depth: number) => Promise<void>, trace?: string[], depth?: number, scope?: Record<string, unknown>): Promise<boolean>;
|
|
85
85
|
/** Publishes an already routed root Event without using the global Endge.events bus. */
|
|
86
86
|
publishEventPort(name: string, payload: unknown, source?: ComponentSFCEventRuntimeSource): void;
|
|
87
87
|
/** Возвращает активную host-owned edit-сессию конкретного renderer consumer. */
|
|
@@ -1,12 +1,68 @@
|
|
|
1
|
-
export type AuthProfileAdapterId = '
|
|
2
|
-
export type
|
|
3
|
-
export
|
|
1
|
+
export type AuthProfileAdapterId = 'oidc' | 'oauth2-client-credentials' | 'basic' | 'bearer' | (string & {});
|
|
2
|
+
export type AuthSessionStorage = 'localStorage' | 'sessionStorage' | 'memory';
|
|
3
|
+
export interface AuthSessionPolicy {
|
|
4
|
+
storage: AuthSessionStorage;
|
|
5
|
+
persistRefreshToken: boolean;
|
|
6
|
+
}
|
|
4
7
|
export interface AuthProfileConfig {
|
|
5
8
|
[key: string]: unknown;
|
|
6
9
|
}
|
|
7
|
-
export interface
|
|
8
|
-
[key: string]: string
|
|
10
|
+
export interface AuthProfileCredentials {
|
|
11
|
+
[key: string]: string;
|
|
9
12
|
}
|
|
13
|
+
/** Persisted discriminated contract of the four built-in adapters. */
|
|
14
|
+
export interface AuthProfileBase {
|
|
15
|
+
id: string;
|
|
16
|
+
identity: string;
|
|
17
|
+
name: string;
|
|
18
|
+
description?: string;
|
|
19
|
+
active: boolean;
|
|
20
|
+
adapterId: string;
|
|
21
|
+
config: Record<string, unknown>;
|
|
22
|
+
credentials: Record<string, string>;
|
|
23
|
+
}
|
|
24
|
+
export interface OidcAuthProfile extends AuthProfileBase {
|
|
25
|
+
adapterId: 'oidc';
|
|
26
|
+
config: {
|
|
27
|
+
issuer: string;
|
|
28
|
+
clientId: string;
|
|
29
|
+
scopes: string[];
|
|
30
|
+
};
|
|
31
|
+
credentials: Record<string, never>;
|
|
32
|
+
session: AuthSessionPolicy;
|
|
33
|
+
}
|
|
34
|
+
export interface OAuth2ClientCredentialsProfile extends AuthProfileBase {
|
|
35
|
+
adapterId: 'oauth2-client-credentials';
|
|
36
|
+
config: {
|
|
37
|
+
tokenEndpoint: string;
|
|
38
|
+
clientId: string;
|
|
39
|
+
scopes: string[];
|
|
40
|
+
clientAuthentication: 'client_secret_basic' | 'client_secret_post';
|
|
41
|
+
};
|
|
42
|
+
credentials: {
|
|
43
|
+
clientSecret: string;
|
|
44
|
+
};
|
|
45
|
+
session: AuthSessionPolicy;
|
|
46
|
+
}
|
|
47
|
+
export interface BasicAuthProfile extends AuthProfileBase {
|
|
48
|
+
adapterId: 'basic';
|
|
49
|
+
config: Record<string, never>;
|
|
50
|
+
credentials: {
|
|
51
|
+
username: string;
|
|
52
|
+
password: string;
|
|
53
|
+
};
|
|
54
|
+
session?: never;
|
|
55
|
+
}
|
|
56
|
+
export interface BearerAuthProfile extends AuthProfileBase {
|
|
57
|
+
adapterId: 'bearer';
|
|
58
|
+
config: Record<string, never>;
|
|
59
|
+
credentials: {
|
|
60
|
+
token: string;
|
|
61
|
+
};
|
|
62
|
+
session?: never;
|
|
63
|
+
}
|
|
64
|
+
export type AuthProfile = OidcAuthProfile | OAuth2ClientCredentialsProfile | BasicAuthProfile | BearerAuthProfile;
|
|
65
|
+
/** Runtime projection also accepts structurally validated registry extensions and legacy numeric IDs. */
|
|
10
66
|
export interface AuthProfileSchema {
|
|
11
67
|
id: string | number;
|
|
12
68
|
identity: string;
|
|
@@ -15,8 +71,8 @@ export interface AuthProfileSchema {
|
|
|
15
71
|
description?: string | null;
|
|
16
72
|
adapterId: AuthProfileAdapterId;
|
|
17
73
|
config: AuthProfileConfig;
|
|
18
|
-
|
|
19
|
-
|
|
74
|
+
credentials: AuthProfileCredentials;
|
|
75
|
+
session?: AuthSessionPolicy;
|
|
20
76
|
folderId?: string | number | null;
|
|
21
77
|
active: boolean;
|
|
22
78
|
deletedAt?: string | null;
|
|
@@ -29,6 +85,7 @@ export interface AuthTokenSet {
|
|
|
29
85
|
sessionState?: string;
|
|
30
86
|
accessExpiresAt: number | null;
|
|
31
87
|
refreshExpiresAt?: number | null;
|
|
88
|
+
headers?: Record<string, string>;
|
|
32
89
|
}
|
|
33
90
|
export interface AuthResolvedSession {
|
|
34
91
|
profileIdentity: string | null;
|
|
@@ -49,20 +106,14 @@ export type AuthRequestPolicy = {
|
|
|
49
106
|
export interface AuthResolveOptions {
|
|
50
107
|
forceRefresh?: boolean;
|
|
51
108
|
}
|
|
52
|
-
export interface AuthLoginCredentials {
|
|
53
|
-
username: string;
|
|
54
|
-
password: string;
|
|
55
|
-
}
|
|
56
109
|
export interface AuthEnsureOptions {
|
|
57
110
|
forceRefresh?: boolean;
|
|
58
|
-
/** Запрещает первичный auto-login service-профиля, сохраняя restore и refresh. */
|
|
59
|
-
allowServiceLogin?: boolean;
|
|
60
111
|
}
|
|
61
112
|
export interface AuthSessionSourceResolveOptions {
|
|
62
113
|
forceRefresh: boolean;
|
|
63
114
|
minValiditySeconds: number;
|
|
64
115
|
}
|
|
65
|
-
/** Host-owned источник session для внешнего Authorization Code
|
|
116
|
+
/** Host-owned источник session для внешнего Authorization Code + PKCE flow. */
|
|
66
117
|
export interface AuthSessionSource {
|
|
67
118
|
resolveToken: (options: AuthSessionSourceResolveOptions) => Promise<AuthTokenSet | null>;
|
|
68
119
|
logout?: () => Promise<void>;
|
|
@@ -75,23 +126,15 @@ export interface EndgeAuthContext {
|
|
|
75
126
|
sessionId?: string;
|
|
76
127
|
profileIdentity?: string;
|
|
77
128
|
}
|
|
78
|
-
export interface AuthCredentialResolveInput {
|
|
79
|
-
ref: string;
|
|
80
|
-
profileIdentity: string;
|
|
81
|
-
credential: string;
|
|
82
|
-
signal?: AbortSignal;
|
|
83
|
-
}
|
|
84
|
-
export type EndgeAuthCredentialResolver = (input: AuthCredentialResolveInput) => string | undefined | Promise<string | undefined>;
|
|
85
129
|
export interface EndgeAuthBootOptions {
|
|
86
|
-
|
|
87
|
-
/** Host-owned namespace isolates persisted sessions of identical Workspaces across backends. */
|
|
130
|
+
/** Host-owned namespace isolates sessions одинаковых Workspaces across backends. */
|
|
88
131
|
storageNamespace?: string;
|
|
89
132
|
}
|
|
90
133
|
export interface AuthAdapterContext {
|
|
91
134
|
profile: AuthProfileSchema;
|
|
92
|
-
credentials?: Record<string, string>;
|
|
93
135
|
token?: AuthTokenSet;
|
|
94
136
|
signal?: AbortSignal;
|
|
137
|
+
resolveValue: (value: unknown) => string;
|
|
95
138
|
resolveCredential: (credential: string) => Promise<string>;
|
|
96
139
|
}
|
|
97
140
|
/** Контракт расширяемого auth adapter. Storage и application state остаются в EndgeAuth. */
|
|
@@ -104,9 +147,6 @@ export interface AuthProfileAdapter {
|
|
|
104
147
|
logout?(context: AuthAdapterContext): Promise<void>;
|
|
105
148
|
loadUserInfo?(context: AuthAdapterContext): Promise<Record<string, unknown> | null>;
|
|
106
149
|
}
|
|
107
|
-
export interface AuthProfileTestOptions {
|
|
108
|
-
credentials?: Record<string, string>;
|
|
109
|
-
}
|
|
110
150
|
export interface AuthProfileTestResult {
|
|
111
151
|
authenticated: boolean;
|
|
112
152
|
profileIdentity: string;
|
|
@@ -114,3 +154,15 @@ export interface AuthProfileTestResult {
|
|
|
114
154
|
context: EndgeAuthContext;
|
|
115
155
|
userInfo: Record<string, unknown> | null;
|
|
116
156
|
}
|
|
157
|
+
export interface OidcBrowserSessionOptions {
|
|
158
|
+
issuer: string;
|
|
159
|
+
clientId: string;
|
|
160
|
+
scopes: string[];
|
|
161
|
+
redirectUri: string;
|
|
162
|
+
popupRedirectUri?: string;
|
|
163
|
+
postLogoutRedirectUri?: string;
|
|
164
|
+
session: AuthSessionPolicy;
|
|
165
|
+
storageNamespace: string;
|
|
166
|
+
profileIdentity: string;
|
|
167
|
+
flow: 'popup' | 'redirect';
|
|
168
|
+
}
|
|
@@ -10,26 +10,3 @@ export interface AuthSessionState {
|
|
|
10
10
|
token: AuthTokenSet;
|
|
11
11
|
userInfo: Record<string, unknown> | null;
|
|
12
12
|
}
|
|
13
|
-
export interface KeycloakTokenResponse {
|
|
14
|
-
access_token: string;
|
|
15
|
-
expires_in?: number;
|
|
16
|
-
refresh_expires_in?: number;
|
|
17
|
-
refresh_token?: string;
|
|
18
|
-
token_type?: string;
|
|
19
|
-
id_token?: string;
|
|
20
|
-
session_state?: string;
|
|
21
|
-
scope?: string;
|
|
22
|
-
}
|
|
23
|
-
export interface KeycloakTransportConfig {
|
|
24
|
-
baseUrl: string;
|
|
25
|
-
tokenPath: string;
|
|
26
|
-
logoutPath: string;
|
|
27
|
-
userinfoPath: string;
|
|
28
|
-
}
|
|
29
|
-
export interface KeycloakAuthTransport {
|
|
30
|
-
passwordGrant(payload: Record<string, string>, signal?: AbortSignal): Promise<KeycloakTokenResponse>;
|
|
31
|
-
refreshGrant(payload: Record<string, string>, signal?: AbortSignal): Promise<KeycloakTokenResponse>;
|
|
32
|
-
logout(payload: Record<string, string>, signal?: AbortSignal): Promise<void>;
|
|
33
|
-
getUserInfo(accessToken: string, signal?: AbortSignal): Promise<Record<string, unknown>>;
|
|
34
|
-
}
|
|
35
|
-
export type KeycloakAuthTransportFactory = (config: KeycloakTransportConfig) => KeycloakAuthTransport;
|
|
@@ -115,6 +115,8 @@ export interface RComponentSFC_AST_Attribute {
|
|
|
115
115
|
value: string | null;
|
|
116
116
|
/** Флаг динамического binding через :name. */
|
|
117
117
|
dynamic: boolean;
|
|
118
|
+
/** Static modifiers of a dynamic binding, for example `:on.stop.capture`. */
|
|
119
|
+
modifiers: string[];
|
|
118
120
|
/** Позиция атрибута в полном source. */
|
|
119
121
|
range: RComponentSFC_SourceRange;
|
|
120
122
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { RComponentSFC_IR_Tag } from './ir.types';
|
|
2
2
|
export interface ComponentSFCEventModifiersState {
|
|
3
3
|
alt: boolean;
|
|
4
|
+
altGraph: boolean;
|
|
4
5
|
ctrl: boolean;
|
|
5
6
|
meta: boolean;
|
|
6
7
|
shift: boolean;
|
|
@@ -8,6 +9,10 @@ export interface ComponentSFCEventModifiersState {
|
|
|
8
9
|
export interface ComponentSFCInteractionEventPayload {
|
|
9
10
|
type: string;
|
|
10
11
|
modifiers: ComponentSFCEventModifiersState;
|
|
12
|
+
held: {
|
|
13
|
+
key: string[];
|
|
14
|
+
code: string[];
|
|
15
|
+
};
|
|
11
16
|
}
|
|
12
17
|
export interface ComponentSFCPointerEventPayload extends ComponentSFCInteractionEventPayload {
|
|
13
18
|
x: number;
|
|
@@ -20,6 +25,7 @@ export interface ComponentSFCKeyboardEventPayload extends ComponentSFCInteractio
|
|
|
20
25
|
key: string;
|
|
21
26
|
code: string;
|
|
22
27
|
repeat: boolean;
|
|
28
|
+
composing: boolean;
|
|
23
29
|
}
|
|
24
30
|
export interface ComponentSFCInputEventPayload extends ComponentSFCInteractionEventPayload {
|
|
25
31
|
value: unknown;
|
|
@@ -59,18 +59,82 @@ export interface ComponentSFCVariant {
|
|
|
59
59
|
nodeId: string;
|
|
60
60
|
}
|
|
61
61
|
/** Декларативный триггер входа в edit-вариант. */
|
|
62
|
-
export interface
|
|
62
|
+
export interface ComponentSFCInteractionTriggerModifiers {
|
|
63
|
+
/** Физическая клавиша Control на любой платформе. */
|
|
64
|
+
ctrl?: boolean;
|
|
65
|
+
/** Физическая клавиша Shift. */
|
|
66
|
+
shift?: boolean;
|
|
67
|
+
/** Физическая клавиша Alt/Option. */
|
|
68
|
+
alt?: boolean;
|
|
69
|
+
/** Физическая клавиша Meta: Command на macOS, Windows/Super на других платформах. */
|
|
70
|
+
meta?: boolean;
|
|
71
|
+
/** Основной shortcut modifier: Command на macOS, Control на Windows/Linux. */
|
|
72
|
+
mod?: boolean;
|
|
73
|
+
/** AltGraph, когда браузер предоставляет его через getModifierState(). */
|
|
74
|
+
altGraph?: boolean;
|
|
75
|
+
/** Запрещает дополнительные физические ctrl/shift/alt/meta modifiers. */
|
|
76
|
+
exact?: boolean;
|
|
77
|
+
}
|
|
78
|
+
/** Обычные немодификаторные клавиши, удерживаемые во время trigger event. */
|
|
79
|
+
export interface ComponentSFCInteractionTriggerHeldKeys {
|
|
80
|
+
/** Логические KeyboardEvent.key с учётом раскладки. */
|
|
81
|
+
key?: string[];
|
|
82
|
+
/** Физические KeyboardEvent.code без зависимости от раскладки. */
|
|
83
|
+
code?: string[];
|
|
84
|
+
/** all требует все перечисленные клавиши, any — хотя бы одну. */
|
|
85
|
+
match?: 'all' | 'any';
|
|
86
|
+
/** Запрещает другие удерживаемые обычные клавиши. */
|
|
87
|
+
exact?: boolean;
|
|
88
|
+
}
|
|
89
|
+
export interface ComponentSFCInteractionTrigger {
|
|
63
90
|
event: string;
|
|
64
91
|
key?: string[];
|
|
92
|
+
code?: string[];
|
|
93
|
+
held?: ComponentSFCInteractionTriggerHeldKeys;
|
|
94
|
+
modifiers?: ComponentSFCInteractionTriggerModifiers;
|
|
95
|
+
repeat?: boolean;
|
|
96
|
+
composing?: boolean;
|
|
65
97
|
button?: number;
|
|
66
98
|
stop?: boolean;
|
|
67
99
|
prevent?: boolean;
|
|
68
100
|
self?: boolean;
|
|
101
|
+
once?: boolean;
|
|
102
|
+
capture?: boolean;
|
|
103
|
+
passive?: boolean;
|
|
69
104
|
}
|
|
105
|
+
export type ComponentSFCInteractionTriggerPlatform = 'macos' | 'windows' | 'linux' | 'unknown';
|
|
106
|
+
/** Renderer-neutral snapshot нативного события для проверки edit trigger. */
|
|
107
|
+
export interface ComponentSFCInteractionTriggerEvent {
|
|
108
|
+
key?: string;
|
|
109
|
+
code?: string;
|
|
110
|
+
repeat?: boolean;
|
|
111
|
+
composing?: boolean;
|
|
112
|
+
button?: number;
|
|
113
|
+
targetIsCurrentTarget: boolean;
|
|
114
|
+
held?: {
|
|
115
|
+
key: string[];
|
|
116
|
+
code: string[];
|
|
117
|
+
};
|
|
118
|
+
modifiers: {
|
|
119
|
+
ctrl: boolean;
|
|
120
|
+
shift: boolean;
|
|
121
|
+
alt: boolean;
|
|
122
|
+
meta: boolean;
|
|
123
|
+
altGraph: boolean;
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
/** Backward-compatible editable names for the shared interaction contract. */
|
|
127
|
+
export type ComponentSFCEditTriggerModifiers = ComponentSFCInteractionTriggerModifiers;
|
|
128
|
+
export type ComponentSFCEditTriggerHeldKeys = ComponentSFCInteractionTriggerHeldKeys;
|
|
129
|
+
export type ComponentSFCEditTrigger = ComponentSFCInteractionTrigger;
|
|
130
|
+
export type ComponentSFCEditTriggerPlatform = ComponentSFCInteractionTriggerPlatform;
|
|
131
|
+
export type ComponentSFCEditTriggerEvent = ComponentSFCInteractionTriggerEvent;
|
|
70
132
|
/** Renderer-neutral поведение редактируемого template-узла. */
|
|
71
133
|
export interface ComponentSFCEditableBehavior {
|
|
72
134
|
value: RComponentSFC_IR_Value;
|
|
73
135
|
triggers: RComponentSFC_IR_Value;
|
|
136
|
+
/** Static suffix modifiers declared on `:edit-on`. */
|
|
137
|
+
modifiers?: RComponentSFC_IR_EventModifier[];
|
|
74
138
|
}
|
|
75
139
|
/** Нормализованное публичное событие завершённого редактирования. */
|
|
76
140
|
export interface ComponentSFCEditedEventPayload<T = unknown> {
|
|
@@ -97,6 +161,8 @@ export interface RComponentSFC_IR_ElementNode {
|
|
|
97
161
|
directives: RComponentSFC_IR_Directives;
|
|
98
162
|
/** Local renderer Event reactions declared through `@event` attributes. */
|
|
99
163
|
events?: RComponentSFC_IR_EventBinding[];
|
|
164
|
+
/** Conditional local reactions declared through the renderer-neutral `:on` annotation. */
|
|
165
|
+
interactions?: RComponentSFC_IR_InteractionGroup[];
|
|
100
166
|
/** Compiler-owned edit behavior; editable/edit-on не передаются visual adapter-у как props. */
|
|
101
167
|
editable?: ComponentSFCEditableBehavior;
|
|
102
168
|
/** Дочерние IR-узлы. */
|
|
@@ -149,6 +215,29 @@ export interface RComponentSFC_IR_EventBinding {
|
|
|
149
215
|
name: string;
|
|
150
216
|
modifiers: RComponentSFC_IR_EventModifier[];
|
|
151
217
|
action: ComponentSFCEventAction;
|
|
218
|
+
/** Ordered reactions. `action` remains as a compatibility view of the first item. */
|
|
219
|
+
actions?: ComponentSFCEventAction[];
|
|
220
|
+
sourceRange?: RComponentSFC_SourceRange;
|
|
221
|
+
}
|
|
222
|
+
export interface RComponentSFC_IR_InteractionRule {
|
|
223
|
+
/** Static event name required to install the adapter listener. */
|
|
224
|
+
event: string;
|
|
225
|
+
/** Runtime-evaluated trigger descriptor without `reaction`. */
|
|
226
|
+
trigger: RComponentSFC_IR_Value;
|
|
227
|
+
/** Suffix modifiers applied to this rule after evaluating `trigger`. */
|
|
228
|
+
modifiers: RComponentSFC_IR_EventModifier[];
|
|
229
|
+
/** Listener options known at compile time. */
|
|
230
|
+
listener: {
|
|
231
|
+
capture: boolean;
|
|
232
|
+
passive: boolean;
|
|
233
|
+
};
|
|
234
|
+
/** Reactions executed sequentially in Source order. */
|
|
235
|
+
reactions: ComponentSFCEventAction[];
|
|
236
|
+
sourceRange?: RComponentSFC_SourceRange;
|
|
237
|
+
}
|
|
238
|
+
/** One `:on` annotation. Rules inside the group use first-match-wins semantics. */
|
|
239
|
+
export interface RComponentSFC_IR_InteractionGroup {
|
|
240
|
+
rules: RComponentSFC_IR_InteractionRule[];
|
|
152
241
|
sourceRange?: RComponentSFC_SourceRange;
|
|
153
242
|
}
|
|
154
243
|
/** IR текстовый узел. */
|
|
@@ -21,6 +21,34 @@ export interface ComponentSFCVisualAttribute {
|
|
|
21
21
|
}
|
|
22
22
|
/** Редактируемый prop binding единственного управляемого элемента колонки Table. */
|
|
23
23
|
export type ComponentSFCTableCellBindingProjection = ComponentSFCVisualAttribute;
|
|
24
|
+
export type ComponentSFCTableCellInteractionModifier = 'ctrl' | 'shift' | 'alt' | 'meta' | 'mod' | 'altGraph' | 'exact';
|
|
25
|
+
export type ComponentSFCTableCellInteractionFlag = 'stop' | 'prevent' | 'self' | 'once' | 'capture' | 'passive';
|
|
26
|
+
/** Visual-editor-safe projection of one static Cell `:on` rule. */
|
|
27
|
+
export interface ComponentSFCTableCellInteractionRuleProjection {
|
|
28
|
+
event: string;
|
|
29
|
+
key: string[];
|
|
30
|
+
code: string[];
|
|
31
|
+
held: {
|
|
32
|
+
key: string[];
|
|
33
|
+
code: string[];
|
|
34
|
+
match: 'all' | 'any';
|
|
35
|
+
exact: boolean;
|
|
36
|
+
} | null;
|
|
37
|
+
modifiers: Partial<Record<ComponentSFCTableCellInteractionModifier, boolean>>;
|
|
38
|
+
repeat: boolean | null;
|
|
39
|
+
composing: boolean | null;
|
|
40
|
+
button: number | null;
|
|
41
|
+
flags: Partial<Record<ComponentSFCTableCellInteractionFlag, boolean>>;
|
|
42
|
+
reactionSource: string;
|
|
43
|
+
}
|
|
44
|
+
/** Source-preserving Cell interaction read-model used by the Table visual editor. */
|
|
45
|
+
export interface ComponentSFCTableCellInteractionsProjection {
|
|
46
|
+
editable: boolean;
|
|
47
|
+
rules: ComponentSFCTableCellInteractionRuleProjection[];
|
|
48
|
+
suffixes: ComponentSFCTableCellInteractionFlag[];
|
|
49
|
+
sourceRange?: RComponentSFC_SourceRange;
|
|
50
|
+
message?: string;
|
|
51
|
+
}
|
|
24
52
|
/** Способ, которым содержимое ячейки представлено в простом visual editor. */
|
|
25
53
|
export type ComponentSFCTableVisualCellTag = Exclude<RComponentSFC_IR_Tag, 'Component' | 'Table' | 'Column' | 'Cell' | 'ColumnMenu' | 'RowMenu' | 'MenuItem' | 'MenuSeparator'>;
|
|
26
54
|
export type ComponentSFCTableCellProjection = {
|
|
@@ -58,6 +86,7 @@ export interface ComponentSFCTableColumnProjection {
|
|
|
58
86
|
pinnable: ComponentSFCVisualSourceValue | null;
|
|
59
87
|
attributes: ComponentSFCVisualAttribute[];
|
|
60
88
|
cell: ComponentSFCTableCellProjection;
|
|
89
|
+
interactions: ComponentSFCTableCellInteractionsProjection;
|
|
61
90
|
hasCustomCell: boolean;
|
|
62
91
|
cellSource: string | null;
|
|
63
92
|
sourceRange: RComponentSFC_SourceRange;
|
|
@@ -126,6 +155,11 @@ export type ComponentSFCTableSourcePatch = {
|
|
|
126
155
|
name: string;
|
|
127
156
|
value: string | null;
|
|
128
157
|
valueKind: 'expression' | 'literal';
|
|
158
|
+
} | {
|
|
159
|
+
type: 'set-column-cell-on';
|
|
160
|
+
columnIndex: number;
|
|
161
|
+
/** Complete object/array expression, or null to remove the annotation. */
|
|
162
|
+
value: string | null;
|
|
129
163
|
} | {
|
|
130
164
|
type: 'set-menu-mode';
|
|
131
165
|
menu: ComponentSFCTableVisualMenuKind;
|
|
@@ -70,6 +70,7 @@ export type EndgePortableWorkspace = Omit<EndgeWorkspaceExport, 'installedIntegr
|
|
|
70
70
|
export interface EndgeDomainBundle {
|
|
71
71
|
schemaVersion: number;
|
|
72
72
|
kind: 'workspace-snapshot';
|
|
73
|
+
domainVersion?: string;
|
|
73
74
|
workspace: EndgePortableWorkspace;
|
|
74
75
|
installedIntegrations: EndgeInstalledIntegrationExport[];
|
|
75
76
|
documents: EndgePortableDocuments;
|
|
@@ -38,7 +38,7 @@ export interface EndgeBootContext {
|
|
|
38
38
|
vars: Record<string, unknown>;
|
|
39
39
|
/** Host-local UI policy; it does not mutate persisted Workspace configuration. */
|
|
40
40
|
ui?: EndgeUIBootOptions;
|
|
41
|
-
/** Host-owned
|
|
41
|
+
/** Host-owned browser session namespace. */
|
|
42
42
|
auth?: EndgeAuthBootOptions;
|
|
43
43
|
/**
|
|
44
44
|
* Для plain provider.
|
package/dist/main.d.ts
CHANGED
|
@@ -15,6 +15,8 @@ export * from './model/modules/runtime/execution/endge-query';
|
|
|
15
15
|
export * from './model/modules/runtime/execution/endge-computation';
|
|
16
16
|
export * from './model/modules/runtime/core/endge-runtime';
|
|
17
17
|
export * from './model/modules/security/endge-auth';
|
|
18
|
+
export * from './model/modules/security/auth/AuthInteractionRequiredError';
|
|
19
|
+
export * from './model/services/auth/OidcBrowserSession_Service';
|
|
18
20
|
export * from './model/modules/context/endge-i18n';
|
|
19
21
|
export * from './model/modules/context/endge-workspace';
|
|
20
22
|
export * from './model/modules/context/endge-vars';
|
|
@@ -163,6 +165,7 @@ export * from './domain/entities/action-flow/REndgeFlow';
|
|
|
163
165
|
export * from './tools/openapi-parser';
|
|
164
166
|
export * from './tools/graphql-parser';
|
|
165
167
|
export * from './tools/ScheduleUpdate-sse-generator';
|
|
168
|
+
export * from './tools/component-sfc-edit-trigger';
|
|
166
169
|
export * from './model/config/diagnostics.config';
|
|
167
170
|
export * from './model/adapters/diagnostics/ConsoleDiagnosticsAdapter';
|
|
168
171
|
export * from './model/adapters/diagnostics/DiagnosticsAdapterRegistry';
|
|
@@ -33,7 +33,9 @@ import { RType } from '../../../domain/entities/reflect/RType';
|
|
|
33
33
|
import { RVocabs } from '../../../domain/entities/reflect/RVocabs';
|
|
34
34
|
import { RI18nBundle } from '../../../domain/entities/reflect/RI18nBundle';
|
|
35
35
|
import { ResolvedEntityIndex } from './resolved/resolved-entity-index';
|
|
36
|
+
/** Материализует только активные документы; tombstones остаются в repository server state. */
|
|
36
37
|
export declare function normalizeSnapshotDocuments(documents: readonly EndgeLiveDomainDocument[], folderIds: ReadonlyMap<string, string>): Record<string, unknown>[];
|
|
38
|
+
/** Материализует только активные папки; tombstones остаются в repository server state. */
|
|
37
39
|
export declare function normalizeSnapshotFolders(folders: readonly EndgeLiveDomainDocument[], folderIds: ReadonlyMap<string, string>): Record<string, unknown>[];
|
|
38
40
|
/**
|
|
39
41
|
* EndgeDomain – менеджер доменных данных.
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** Сигнал host-приложению, что продолжение требует пользовательского OIDC flow. */
|
|
2
|
+
export declare class AuthInteractionRequiredError extends Error {
|
|
3
|
+
readonly profileIdentity: string;
|
|
4
|
+
readonly code = "auth_interaction_required";
|
|
5
|
+
constructor(profileIdentity: string);
|
|
6
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { RAuthProfile } from '../../../../domain/entities/reflect/RAuthProfile';
|
|
2
|
-
import { AuthAdapterContext, AuthProfileSchema,
|
|
2
|
+
import { AuthAdapterContext, AuthProfileSchema, AuthProfileTestResult } from '../../../../domain/types/auth/auth-profile.types';
|
|
3
3
|
import { AuthAdapterRegistry } from './AuthAdapterRegistry';
|
|
4
4
|
interface AuthProfileRegistryDependencies {
|
|
5
5
|
listProfiles: () => RAuthProfile[];
|
|
6
6
|
getDefaultIdentity: () => string | null;
|
|
7
|
-
|
|
7
|
+
resolveValue: (value: unknown) => string;
|
|
8
8
|
getSignal: () => AbortSignal | undefined;
|
|
9
9
|
}
|
|
10
10
|
/** Читает persisted AuthProfile и проверяет adapter-specific contracts. */
|
|
@@ -21,11 +21,11 @@ export declare class AuthProfileRegistry {
|
|
|
21
21
|
/** Проверяет все не удалённые profiles текущего Domain. */
|
|
22
22
|
validateAll(): void;
|
|
23
23
|
/** Проверяет profile в изолированной session без записи token в storage. */
|
|
24
|
-
test(profile: AuthProfileSchema
|
|
24
|
+
test(profile: AuthProfileSchema): Promise<AuthProfileTestResult>;
|
|
25
25
|
/** Требует существующий активный profile. */
|
|
26
26
|
requireActive(profileOrIdentity: AuthProfileSchema | string): AuthProfileSchema;
|
|
27
27
|
/** Создаёт adapter context с opaque host credential resolver. */
|
|
28
|
-
createAdapterContext(profile: AuthProfileSchema
|
|
28
|
+
createAdapterContext(profile: AuthProfileSchema): AuthAdapterContext;
|
|
29
29
|
private _adapterContext;
|
|
30
30
|
private _validateCommon;
|
|
31
31
|
}
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import { AuthRequestPolicy, AuthResolvedSession, AuthResolveOptions } from '../../../../domain/types/auth/auth-profile.types';
|
|
2
2
|
import { AuthProfileRegistry } from './AuthProfileRegistry';
|
|
3
3
|
import { AuthSessionManager } from './AuthSessionManager';
|
|
4
|
+
import { AuthInteractionRequiredError } from './AuthInteractionRequiredError';
|
|
4
5
|
/** Разрешает auth policy запроса без изменения sessions других profiles. */
|
|
5
6
|
export declare class AuthRequestResolver {
|
|
6
7
|
private readonly _profiles;
|
|
7
8
|
private readonly _sessions;
|
|
8
|
-
|
|
9
|
+
private readonly _onInteractionRequired?;
|
|
10
|
+
constructor(_profiles: AuthProfileRegistry, _sessions: AuthSessionManager, _onInteractionRequired?: ((error: AuthInteractionRequiredError) => void) | undefined);
|
|
9
11
|
/** Возвращает transport-neutral credentials для none/inherit/profile policy. */
|
|
10
12
|
resolve(policy: AuthRequestPolicy, options?: AuthResolveOptions): Promise<AuthResolvedSession>;
|
|
13
|
+
/** Publishes the typed host signal before the request fails. */
|
|
14
|
+
private _throwInteractionRequired;
|
|
15
|
+
private _publishAndThrow;
|
|
11
16
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AuthEnsureOptions,
|
|
1
|
+
import { AuthEnsureOptions, AuthProfileSchema, AuthResolvedSession, AuthSessionSource, AuthTokenSet, EndgeAuthContext } from '../../../../domain/types/auth/auth-profile.types';
|
|
2
2
|
import { AuthAdapterRegistry } from './AuthAdapterRegistry';
|
|
3
3
|
import { AuthProfileRegistry } from './AuthProfileRegistry';
|
|
4
4
|
import { AuthSessionStore } from './AuthSessionStore';
|
|
@@ -33,11 +33,6 @@ export declare class AuthSessionManager {
|
|
|
33
33
|
configureDefault(profile: AuthProfileSchema | null): void;
|
|
34
34
|
/** Подключает host-owned session source и запрещает смешивание с persisted snapshot profile. */
|
|
35
35
|
connect(profileIdentity: string, source: AuthSessionSource): void;
|
|
36
|
-
/** Выполняет interactive login default runtime profile. */
|
|
37
|
-
login(credentials: AuthLoginCredentials): Promise<void>;
|
|
38
|
-
/** Входит в указанный Keycloak profile, не меняя default profile. */
|
|
39
|
-
loginWithProfile(profileIdentity: string, credentials: AuthLoginCredentials): Promise<void>;
|
|
40
|
-
private _loginWithProfile;
|
|
41
36
|
/** Гарантирует действующую session default runtime profile. */
|
|
42
37
|
ensureValid(options?: AuthEnsureOptions): Promise<boolean>;
|
|
43
38
|
/** Загружает userinfo для session default runtime profile. */
|
|
@@ -56,6 +51,7 @@ export declare class AuthSessionManager {
|
|
|
56
51
|
private _clearState;
|
|
57
52
|
private _defaultState;
|
|
58
53
|
private _isAccessTokenUsable;
|
|
54
|
+
private _isSessionUsable;
|
|
59
55
|
private _isAccessTokenFresh;
|
|
60
56
|
private _refreshSkewMs;
|
|
61
57
|
private _isRefreshExpired;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AuthAdapterContext, AuthProfileAdapter, AuthProfileSchema, AuthTokenSet } from '../../../../../domain/types/auth/auth-profile.types';
|
|
2
|
+
/** Материализует HTTP Basic header без token session. */
|
|
3
|
+
export declare class BasicAuthAdapter implements AuthProfileAdapter {
|
|
4
|
+
readonly id = "basic";
|
|
5
|
+
readonly label = "Basic";
|
|
6
|
+
/** Проверяет строгий Basic contract. */
|
|
7
|
+
validate(profile: AuthProfileSchema): void;
|
|
8
|
+
/** Разрешает credentials и возвращает готовый Authorization header. */
|
|
9
|
+
authenticate(context: AuthAdapterContext): Promise<AuthTokenSet>;
|
|
10
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AuthAdapterContext, AuthProfileAdapter, AuthProfileSchema, AuthTokenSet } from '../../../../../domain/types/auth/auth-profile.types';
|
|
2
|
-
/**
|
|
2
|
+
/** Материализует Bearer header из literal или Workspace variable. */
|
|
3
3
|
export declare class BearerAuthAdapter implements AuthProfileAdapter {
|
|
4
4
|
readonly id = "bearer";
|
|
5
5
|
readonly label = "Bearer token";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AuthAdapterContext, AuthProfileAdapter, AuthProfileSchema, AuthTokenSet } from '../../../../../domain/types/auth/auth-profile.types';
|
|
2
|
+
/** Выполняет OAuth2 Client Credentials grant. */
|
|
3
|
+
export declare class OAuth2ClientCredentialsAuthAdapter implements AuthProfileAdapter {
|
|
4
|
+
readonly id = "oauth2-client-credentials";
|
|
5
|
+
readonly label = "OAuth2 Client Credentials";
|
|
6
|
+
validate(profile: AuthProfileSchema): void;
|
|
7
|
+
authenticate(context: AuthAdapterContext): Promise<AuthTokenSet>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AuthAdapterContext, AuthProfileAdapter, AuthProfileSchema, AuthTokenSet } from '../../../../../domain/types/auth/auth-profile.types';
|
|
2
|
+
/** Валидирует общий OIDC profile; interactive flow запускает host через session source. */
|
|
3
|
+
export declare class OidcAuthAdapter implements AuthProfileAdapter {
|
|
4
|
+
readonly id = "oidc";
|
|
5
|
+
readonly label = "OIDC";
|
|
6
|
+
validate(profile: AuthProfileSchema): void;
|
|
7
|
+
authenticate(context: AuthAdapterContext): Promise<AuthTokenSet>;
|
|
8
|
+
}
|