@vc-shell/framework 1.1.99-alpha.2 → 1.2.1
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/core/api/platform.ts +9883 -9883
- package/core/composables/useDynamicProperties/index.ts +21 -19
- package/core/composables/useNotifications/index.ts +1 -32
- package/core/composables/useSettings/index.ts +3 -8
- package/core/composables/useUser/index.ts +171 -74
- package/core/composables/useUserManagement/index.ts +25 -67
- package/core/interceptors/index.ts +56 -19
- package/core/plugins/signalR/index.ts +1 -27
- package/core/types/index.ts +0 -2
- package/dist/core/api/platform.d.ts +1 -1
- package/dist/core/api/platform.d.ts.map +1 -1
- package/dist/core/composables/useDynamicProperties/index.d.ts +1 -1
- package/dist/core/composables/useDynamicProperties/index.d.ts.map +1 -1
- package/dist/core/composables/useNotifications/index.d.ts.map +1 -1
- package/dist/core/composables/useSettings/index.d.ts.map +1 -1
- package/dist/core/composables/useUser/index.d.ts +9 -18
- package/dist/core/composables/useUser/index.d.ts.map +1 -1
- package/dist/core/composables/useUserManagement/index.d.ts +7 -7
- package/dist/core/composables/useUserManagement/index.d.ts.map +1 -1
- package/dist/core/interceptors/index.d.ts +1 -2
- package/dist/core/interceptors/index.d.ts.map +1 -1
- package/dist/core/plugins/signalR/index.d.ts +0 -2
- package/dist/core/plugins/signalR/index.d.ts.map +1 -1
- package/dist/core/types/index.d.ts +1 -1
- package/dist/core/types/index.d.ts.map +1 -1
- package/dist/framework.js +6799 -6812
- package/dist/index.css +1 -1
- package/dist/index.d.ts +0 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/injection-keys.d.ts +1 -2
- package/dist/injection-keys.d.ts.map +1 -1
- package/dist/shared/components/app-switcher/composables/useAppSwitcher/index.d.ts.map +1 -1
- package/dist/shared/components/sign-in/useExternalProvider.d.ts +1 -1
- package/dist/shared/components/sign-in/useExternalProvider.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/helpers/nodeBuilder.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/pages/dynamic-blade-form.vue.d.ts +2 -2
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/ui/components/molecules/index.d.ts +1 -0
- package/dist/ui/components/molecules/index.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-accordion/_internal/vc-accordion-item/vc-accordion-item.vue.d.ts +34 -0
- package/dist/ui/components/molecules/vc-accordion/_internal/vc-accordion-item/vc-accordion-item.vue.d.ts.map +1 -0
- package/dist/ui/components/molecules/vc-accordion/index.d.ts +7 -0
- package/dist/ui/components/molecules/vc-accordion/index.d.ts.map +1 -0
- package/dist/ui/components/molecules/vc-accordion/vc-accordion.vue.d.ts +42 -0
- package/dist/ui/components/molecules/vc-accordion/vc-accordion.vue.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-app/vc-app.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-dynamic-property/vc-dynamic-property.vue.d.ts.map +1 -1
- package/dist/vendor-tiptap-core-8RGSOCZs.js +3442 -0
- package/dist/{vendor-tiptap-extension-blockquote-r1MBx4hD.js → vendor-tiptap-extension-blockquote-BVmAuV7o.js} +1 -1
- package/dist/{vendor-tiptap-extension-bold-BjLI4i8b.js → vendor-tiptap-extension-bold-BOh8AIRZ.js} +1 -1
- package/dist/{vendor-tiptap-extension-code-D5-kDnMW.js → vendor-tiptap-extension-code-R4pc2wFE.js} +1 -1
- package/dist/{vendor-tiptap-extension-code-block-RjEb0zPA.js → vendor-tiptap-extension-code-block-DibKlZFG.js} +1 -1
- package/dist/{vendor-tiptap-extension-document--PLOxIdq.js → vendor-tiptap-extension-document-BwORJR1k.js} +1 -1
- package/dist/{vendor-tiptap-extension-hard-break-9cxC2YOS.js → vendor-tiptap-extension-hard-break-DH36OfVk.js} +9 -13
- package/dist/{vendor-tiptap-extension-heading-2w0TutHn.js → vendor-tiptap-extension-heading-oMLORiPI.js} +1 -1
- package/dist/{vendor-tiptap-extension-horizontal-rule-CFowa_lc.js → vendor-tiptap-extension-horizontal-rule-BMHSoB_Y.js} +1 -1
- package/dist/vendor-tiptap-extension-image-DF1ZJ94q.js +80 -0
- package/dist/{vendor-tiptap-extension-italic-Bn-6saY0.js → vendor-tiptap-extension-italic-BzqrUuB0.js} +1 -1
- package/dist/{vendor-tiptap-extension-link-BmcG1_k-.js → vendor-tiptap-extension-link-hMFZ0hfl.js} +1 -1
- package/dist/{vendor-tiptap-extension-list-BrNBJ45n.js → vendor-tiptap-extension-list-Bj5AK6Pq.js} +1 -1
- package/dist/{vendor-tiptap-extension-paragraph-DAiYhwUB.js → vendor-tiptap-extension-paragraph-Bs1wl42E.js} +1 -1
- package/dist/vendor-tiptap-extension-placeholder-CupUGaI_.js +1 -0
- package/dist/{vendor-tiptap-extension-strike-DqbXPfos.js → vendor-tiptap-extension-strike-C4YpGyzc.js} +1 -1
- package/dist/vendor-tiptap-extension-table-D8RFr_6X.js +368 -0
- package/dist/vendor-tiptap-extension-table-cell-k9uLwyL6.js +1 -0
- package/dist/vendor-tiptap-extension-table-header-k9uLwyL6.js +1 -0
- package/dist/vendor-tiptap-extension-table-row-k9uLwyL6.js +1 -0
- package/dist/{vendor-tiptap-extension-text-BFnfj70b.js → vendor-tiptap-extension-text-C4dQW13r.js} +1 -1
- package/dist/{vendor-tiptap-extension-text-style-Darua3qr.js → vendor-tiptap-extension-text-style-a_NYjXT6.js} +1 -1
- package/dist/{vendor-tiptap-extension-underline-QyVnBqQZ.js → vendor-tiptap-extension-underline-DthCaPX3.js} +1 -1
- package/dist/{vendor-tiptap-extensions-CU-D7bfm.js → vendor-tiptap-extensions-C8rF1qdq.js} +1 -1
- package/dist/{vendor-tiptap-markdown-BwATYN5A.js → vendor-tiptap-markdown-DRc3qhBU.js} +1 -1
- package/dist/{vendor-tiptap-starter-kit-5luf7zzS.js → vendor-tiptap-starter-kit-BfUUblkP.js} +17 -17
- package/dist/{vendor-tiptap-vue-3-CFBErZGb.js → vendor-tiptap-vue-3-DYxT2sf6.js} +1 -1
- package/dist/{vendor-vueuse-components-sgKpNzof.js → vendor-vueuse-components-B0zqjNRW.js} +1 -1
- package/dist/{vendor-vueuse-core-D0cN7FqY.js → vendor-vueuse-core-CYgwn-B2.js} +10 -10
- package/dist/{vendor-vueuse-shared-Pt0UEStA.js → vendor-vueuse-shared-B_uDJJ6V.js} +19 -19
- package/package.json +5 -7
- package/shared/components/app-switcher/components/vc-app-switcher/vc-app-switcher.vue +2 -2
- package/shared/components/app-switcher/composables/useAppSwitcher/index.ts +1 -15
- package/shared/components/sign-in/useExternalProvider.ts +1 -11
- package/shared/modules/dynamic/helpers/nodeBuilder.ts +3 -11
- package/ui/components/atoms/vc-badge/vc-badge.stories.ts +1 -1
- package/ui/components/atoms/vc-button/vc-button.stories.ts +1 -1
- package/ui/components/atoms/vc-card/vc-card.stories.ts +1 -1
- package/ui/components/atoms/vc-col/vc-col.stories.ts +1 -1
- package/ui/components/atoms/vc-container/vc-container.stories.ts +1 -1
- package/ui/components/atoms/vc-hint/vc-hint.stories.ts +1 -1
- package/ui/components/atoms/vc-icon/vc-icon.stories.ts +1 -1
- package/ui/components/atoms/vc-image/vc-image.stories.ts +1 -1
- package/ui/components/atoms/vc-label/vc-label.stories.ts +1 -1
- package/ui/components/atoms/vc-link/vc-link.stories.ts +1 -1
- package/ui/components/atoms/vc-progress/vc-progress.stories.ts +1 -1
- package/ui/components/atoms/vc-row/vc-row.stories.ts +1 -1
- package/ui/components/atoms/vc-skeleton/vc-skeleton.stories.ts +1 -1
- package/ui/components/atoms/vc-status/vc-status.stories.ts +1 -1
- package/ui/components/atoms/vc-status-icon/vc-status-icon.stories.ts +1 -1
- package/ui/components/atoms/vc-tooltip/vc-tooltip.stories.ts +1 -1
- package/ui/components/atoms/vc-video/vc-video.stories.ts +1 -1
- package/ui/components/atoms/vc-widget/vc-widget.stories.ts +1 -1
- package/ui/components/molecules/index.ts +1 -0
- package/ui/components/molecules/vc-accordion/_internal/vc-accordion-item/vc-accordion-item.vue +251 -0
- package/ui/components/molecules/vc-accordion/index.ts +11 -0
- package/ui/components/molecules/vc-accordion/vc-accordion.stories.ts +526 -0
- package/ui/components/molecules/vc-accordion/vc-accordion.vue +176 -0
- package/ui/components/molecules/vc-breadcrumbs/vc-breadcrumbs.stories.ts +1 -1
- package/ui/components/molecules/vc-checkbox/vc-checkbox.stories.ts +1 -1
- package/ui/components/molecules/vc-editor/vc-editor.stories.ts +1 -1
- package/ui/components/molecules/vc-field/vc-field.stories.ts +1 -1
- package/ui/components/molecules/vc-file-upload/vc-file-upload.stories.ts +1 -1
- package/ui/components/molecules/vc-form/vc-form.stories.ts +1 -1
- package/ui/components/molecules/vc-input/vc-input.stories.ts +1 -1
- package/ui/components/molecules/vc-input-currency/vc-input-currency.stories.ts +1 -1
- package/ui/components/molecules/vc-input-dropdown/vc-input-dropdown.stories.ts +1 -1
- package/ui/components/molecules/vc-multivalue/vc-multivalue.stories.ts +1 -1
- package/ui/components/molecules/vc-pagination/vc-pagination.stories.ts +1 -1
- package/ui/components/molecules/vc-radio-button/vc-radio-button.stories.ts +1 -1
- package/ui/components/molecules/vc-rating/vc-rating.stories.ts +1 -1
- package/ui/components/molecules/vc-select/vc-select.stories.ts +1 -1
- package/ui/components/molecules/vc-slider/vc-slider.stories.ts +1 -1
- package/ui/components/molecules/vc-switch/vc-switch.stories.ts +1 -1
- package/ui/components/molecules/vc-textarea/vc-textarea.stories.ts +1 -1
- package/ui/components/molecules/vc-toast/vc-toast.stories.ts +1 -1
- package/ui/components/organisms/vc-app/vc-app.vue +2 -20
- package/ui/components/organisms/vc-dynamic-property/vc-dynamic-property.vue +4 -0
- package/ui/components/organisms/vc-gallery/vc-gallery.stories.ts +1 -1
- package/ui/components/organisms/vc-popup/vc-popup.stories.ts +1 -1
- package/core/providers/README.md +0 -176
- package/core/providers/auth-provider-manager.ts +0 -74
- package/core/providers/auth-provider-utils.ts +0 -26
- package/core/providers/example-custom-auth-provider.ts +0 -162
- package/core/providers/index.ts +0 -3
- package/core/providers/platform-auth-provider.ts +0 -207
- package/core/types/auth-provider.ts +0 -40
- package/dist/core/providers/auth-provider-manager.d.ts +0 -34
- package/dist/core/providers/auth-provider-manager.d.ts.map +0 -1
- package/dist/core/providers/auth-provider-utils.d.ts +0 -17
- package/dist/core/providers/auth-provider-utils.d.ts.map +0 -1
- package/dist/core/providers/example-custom-auth-provider.d.ts +0 -45
- package/dist/core/providers/example-custom-auth-provider.d.ts.map +0 -1
- package/dist/core/providers/index.d.ts +0 -3
- package/dist/core/providers/index.d.ts.map +0 -1
- package/dist/core/providers/platform-auth-provider.d.ts +0 -34
- package/dist/core/providers/platform-auth-provider.d.ts.map +0 -1
- package/dist/core/types/auth-provider.d.ts +0 -27
- package/dist/core/types/auth-provider.d.ts.map +0 -1
- package/dist/vendor-tiptap-core-ClsTgaMv.js +0 -3699
- package/dist/vendor-tiptap-extension-image-aWn-na6j.js +0 -127
- package/dist/vendor-tiptap-extension-placeholder-9tURDKy-.js +0 -1
- package/dist/vendor-tiptap-extension-table-DQwPaR7v.js +0 -374
- package/dist/vendor-tiptap-extension-table-cell-C0tEP_0i.js +0 -1
- package/dist/vendor-tiptap-extension-table-header-C0tEP_0i.js +0 -1
- package/dist/vendor-tiptap-extension-table-row-C0tEP_0i.js +0 -1
|
@@ -1,207 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
-
import { computed, Ref, ref, ComputedRef } from "vue";
|
|
3
|
-
import {
|
|
4
|
-
UserDetail,
|
|
5
|
-
SecurityClient,
|
|
6
|
-
ResetPasswordConfirmRequest,
|
|
7
|
-
SecurityResult,
|
|
8
|
-
ValidatePasswordResetTokenRequest,
|
|
9
|
-
IdentityResult,
|
|
10
|
-
ChangePasswordRequest,
|
|
11
|
-
LoginType,
|
|
12
|
-
LoginRequest,
|
|
13
|
-
SignInResult,
|
|
14
|
-
IIdentityResult,
|
|
15
|
-
ISecurityResult,
|
|
16
|
-
} from "../api/platform";
|
|
17
|
-
import { RequestPasswordResult } from "../types";
|
|
18
|
-
import { useExternalProvider } from "../../shared/components/sign-in/useExternalProvider";
|
|
19
|
-
import { IAuthProvider } from "../types/auth-provider";
|
|
20
|
-
|
|
21
|
-
const DEMO_USER = {
|
|
22
|
-
id: "demo_user_id",
|
|
23
|
-
userName: "DEMO_USER",
|
|
24
|
-
isAdministrator: true,
|
|
25
|
-
} as UserDetail;
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Platform-based authentication provider
|
|
29
|
-
* Implements authentication using VirtoCommerce Platform API
|
|
30
|
-
*/
|
|
31
|
-
export class PlatformAuthProvider implements IAuthProvider {
|
|
32
|
-
private _user: Ref<UserDetail | undefined> = ref();
|
|
33
|
-
private _loading: Ref<boolean> = ref(false);
|
|
34
|
-
private securityClient: SecurityClient;
|
|
35
|
-
private externalSignInStorage: ReturnType<typeof useExternalProvider>["storage"];
|
|
36
|
-
private externalSignOut: ReturnType<typeof useExternalProvider>["signOut"];
|
|
37
|
-
|
|
38
|
-
constructor() {
|
|
39
|
-
console.log("🔐 [PlatformAuthProvider] Constructor called - using PLATFORM authentication");
|
|
40
|
-
this.securityClient = new SecurityClient();
|
|
41
|
-
const { storage, signOut } = useExternalProvider();
|
|
42
|
-
this.externalSignInStorage = storage;
|
|
43
|
-
this.externalSignOut = signOut;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
get user(): ComputedRef<UserDetail | undefined> {
|
|
47
|
-
return computed(() => this._user.value);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
get loading(): ComputedRef<boolean> {
|
|
51
|
-
return computed(() => this._loading.value);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
get isAuthenticated(): ComputedRef<boolean> {
|
|
55
|
-
return computed(() => this._user.value?.userName != null);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
get isAdministrator(): ComputedRef<boolean | undefined> {
|
|
59
|
-
return computed(() => this._user.value?.isAdministrator);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
async validateToken(userId: string, token: string): Promise<boolean> {
|
|
63
|
-
let result = false;
|
|
64
|
-
try {
|
|
65
|
-
this._loading.value = true;
|
|
66
|
-
result = await this.securityClient.validatePasswordResetToken(userId, {
|
|
67
|
-
token,
|
|
68
|
-
} as ValidatePasswordResetTokenRequest);
|
|
69
|
-
} catch (e) {
|
|
70
|
-
//TODO: log error
|
|
71
|
-
} finally {
|
|
72
|
-
this._loading.value = false;
|
|
73
|
-
}
|
|
74
|
-
return result;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
async validatePassword(password: string): Promise<IIdentityResult> {
|
|
78
|
-
return this.securityClient.validatePassword(password) as Promise<IIdentityResult>;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
async resetPasswordByToken(userId: string, password: string, token: string): Promise<ISecurityResult> {
|
|
82
|
-
return this.securityClient.resetPasswordByToken(userId, {
|
|
83
|
-
newPassword: password,
|
|
84
|
-
token,
|
|
85
|
-
} as ResetPasswordConfirmRequest);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
async signIn(
|
|
89
|
-
username: string,
|
|
90
|
-
password: string,
|
|
91
|
-
): Promise<SignInResult | { succeeded: boolean; error?: any; status?: number }> {
|
|
92
|
-
console.debug(`[@vc-shell/framework#PlatformAuthProvider:signIn] - Entry point`);
|
|
93
|
-
|
|
94
|
-
// Handle demo mode for platform provider
|
|
95
|
-
if (window.__DEMO_MODE__) {
|
|
96
|
-
console.warn("[PlatformAuthProvider] Running in DEMO mode - authentication is mocked");
|
|
97
|
-
this._user.value = DEMO_USER as UserDetail;
|
|
98
|
-
return { succeeded: true } as SignInResult;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
try {
|
|
102
|
-
this._loading.value = true;
|
|
103
|
-
const result = await this.securityClient.login(new LoginRequest({ userName: username, password }));
|
|
104
|
-
return await this.securityClient
|
|
105
|
-
.getCurrentUser()
|
|
106
|
-
.then((res) => {
|
|
107
|
-
if (res) {
|
|
108
|
-
this._user.value = res;
|
|
109
|
-
return result;
|
|
110
|
-
}
|
|
111
|
-
throw { succeeded: false };
|
|
112
|
-
})
|
|
113
|
-
.catch((e) => {
|
|
114
|
-
throw e;
|
|
115
|
-
});
|
|
116
|
-
} catch (e: any) {
|
|
117
|
-
//TODO: log error
|
|
118
|
-
console.log(e);
|
|
119
|
-
return { succeeded: false, error: e.message, status: e.status };
|
|
120
|
-
} finally {
|
|
121
|
-
this._loading.value = false;
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
async signOut(): Promise<void> {
|
|
126
|
-
console.debug(`[@vc-shell/framework#PlatformAuthProvider:signOut] - Entry point`);
|
|
127
|
-
|
|
128
|
-
this._user.value = undefined;
|
|
129
|
-
|
|
130
|
-
if (this.externalSignInStorage.value?.providerType) {
|
|
131
|
-
await this.externalSignOut(this.externalSignInStorage.value.providerType);
|
|
132
|
-
} else {
|
|
133
|
-
this.securityClient.logout();
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
async loadUser(): Promise<UserDetail> {
|
|
138
|
-
console.debug(`[@vc-shell/framework#PlatformAuthProvider:loadUser] - Entry point`);
|
|
139
|
-
|
|
140
|
-
// Handle demo mode for platform provider
|
|
141
|
-
if (window.__DEMO_MODE__) {
|
|
142
|
-
console.warn(
|
|
143
|
-
"[PlatformAuthProvider] Running in DEMO mode. All API calls are disabled. Please add APP_PLATFORM_URL to your application's .env file to enable API calls.",
|
|
144
|
-
);
|
|
145
|
-
this._user.value = DEMO_USER as UserDetail;
|
|
146
|
-
return { ...this._user.value } as UserDetail;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
try {
|
|
150
|
-
this._loading.value = true;
|
|
151
|
-
this._user.value = await this.securityClient.getCurrentUser();
|
|
152
|
-
console.log("[PlatformAuthProvider]: an user details has been loaded", this._user.value);
|
|
153
|
-
} catch (e: any) {
|
|
154
|
-
console.error(e);
|
|
155
|
-
} finally {
|
|
156
|
-
this._loading.value = false;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
return { ...this._user.value } as UserDetail;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
async requestPasswordReset(loginOrEmail: string): Promise<RequestPasswordResult> {
|
|
163
|
-
try {
|
|
164
|
-
this._loading.value = true;
|
|
165
|
-
await this.securityClient.requestPasswordReset(loginOrEmail);
|
|
166
|
-
return { succeeded: true };
|
|
167
|
-
} catch (e) {
|
|
168
|
-
//TODO: log error
|
|
169
|
-
return { succeeded: false, error: e as string };
|
|
170
|
-
} finally {
|
|
171
|
-
this._loading.value = false;
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
async changeUserPassword(oldPassword: string, newPassword: string): Promise<SecurityResult | undefined> {
|
|
176
|
-
let result;
|
|
177
|
-
|
|
178
|
-
try {
|
|
179
|
-
this._loading.value = true;
|
|
180
|
-
const command = new ChangePasswordRequest({
|
|
181
|
-
oldPassword,
|
|
182
|
-
newPassword,
|
|
183
|
-
});
|
|
184
|
-
|
|
185
|
-
result = await this.securityClient.changeCurrentUserPassword(command);
|
|
186
|
-
} catch (e: any) {
|
|
187
|
-
return { succeeded: false, errors: [e.message] } as SecurityResult;
|
|
188
|
-
} finally {
|
|
189
|
-
this._loading.value = false;
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
return result;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
async getLoginType(): Promise<LoginType[]> {
|
|
196
|
-
let result: LoginType[] | null = null;
|
|
197
|
-
try {
|
|
198
|
-
result = await this.securityClient.getLoginTypes();
|
|
199
|
-
} catch (e) {
|
|
200
|
-
console.error(e);
|
|
201
|
-
throw e;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
return result;
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
-
import { ComputedRef } from "vue";
|
|
3
|
-
import {
|
|
4
|
-
SignInResult,
|
|
5
|
-
IUserDetail,
|
|
6
|
-
ISecurityResult,
|
|
7
|
-
ILoginType,
|
|
8
|
-
IIdentityResult,
|
|
9
|
-
} from "../api/platform";
|
|
10
|
-
import { RequestPasswordResult } from "./index";
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Interface for authentication provider
|
|
14
|
-
* Allows custom authentication implementations while maintaining compatibility with all framework pages
|
|
15
|
-
*/
|
|
16
|
-
export interface IAuthProvider {
|
|
17
|
-
// Core properties
|
|
18
|
-
user: ComputedRef<IUserDetail | undefined>;
|
|
19
|
-
loading: ComputedRef<boolean>;
|
|
20
|
-
isAuthenticated: ComputedRef<boolean>;
|
|
21
|
-
isAdministrator: ComputedRef<boolean | undefined>;
|
|
22
|
-
|
|
23
|
-
// Core methods
|
|
24
|
-
loadUser(): Promise<IUserDetail>;
|
|
25
|
-
signIn(
|
|
26
|
-
username: string,
|
|
27
|
-
password: string,
|
|
28
|
-
): Promise<SignInResult | { succeeded: boolean; error?: any; status?: number }>;
|
|
29
|
-
signOut(): Promise<void>;
|
|
30
|
-
|
|
31
|
-
// Password management methods
|
|
32
|
-
validateToken(userId: string, token: string): Promise<boolean>;
|
|
33
|
-
validatePassword(password: string): Promise<IIdentityResult>;
|
|
34
|
-
resetPasswordByToken(userId: string, password: string, token: string): Promise<ISecurityResult>;
|
|
35
|
-
requestPasswordReset(loginOrEmail: string): Promise<RequestPasswordResult>;
|
|
36
|
-
changeUserPassword(oldPassword: string, newPassword: string): Promise<ISecurityResult | undefined>;
|
|
37
|
-
|
|
38
|
-
// Additional methods
|
|
39
|
-
getLoginType(): Promise<ILoginType[]>;
|
|
40
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { IAuthProvider } from "../types/auth-provider";
|
|
2
|
-
/**
|
|
3
|
-
* Global auth provider manager
|
|
4
|
-
* Provides access to auth provider before Vue app context is available
|
|
5
|
-
* This is necessary for early initialization scenarios where composables
|
|
6
|
-
* are called before app.use(VirtoShellFramework)
|
|
7
|
-
*/
|
|
8
|
-
declare class AuthProviderManager {
|
|
9
|
-
private provider;
|
|
10
|
-
private defaultProvider;
|
|
11
|
-
private configureWasCalled;
|
|
12
|
-
/**
|
|
13
|
-
* Set the global auth provider
|
|
14
|
-
* Should be called via VirtoShellFramework.configure() before any composables
|
|
15
|
-
* If custom provider is provided, it will replace the default
|
|
16
|
-
*/
|
|
17
|
-
setProvider(provider: IAuthProvider): void;
|
|
18
|
-
/**
|
|
19
|
-
* Get the global auth provider
|
|
20
|
-
* Lazy-initializes default PlatformAuthProvider if no custom provider was set
|
|
21
|
-
*/
|
|
22
|
-
getProvider(): IAuthProvider;
|
|
23
|
-
/**
|
|
24
|
-
* Check if provider is available
|
|
25
|
-
*/
|
|
26
|
-
hasProvider(): boolean;
|
|
27
|
-
/**
|
|
28
|
-
* Reset manager (for testing)
|
|
29
|
-
*/
|
|
30
|
-
reset(): void;
|
|
31
|
-
}
|
|
32
|
-
export declare const authProviderManager: AuthProviderManager;
|
|
33
|
-
export {};
|
|
34
|
-
//# sourceMappingURL=auth-provider-manager.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auth-provider-manager.d.ts","sourceRoot":"","sources":["../../../core/providers/auth-provider-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAGvD;;;;;GAKG;AACH,cAAM,mBAAmB;IACvB,OAAO,CAAC,QAAQ,CAA8B;IAC9C,OAAO,CAAC,eAAe,CAA8B;IACrD,OAAO,CAAC,kBAAkB,CAAS;IAEnC;;;;OAIG;IACH,WAAW,CAAC,QAAQ,EAAE,aAAa,GAAG,IAAI;IAM1C;;;OAGG;IACH,WAAW,IAAI,aAAa;IAyB5B;;OAEG;IACH,WAAW,IAAI,OAAO;IAItB;;OAEG;IACH,KAAK,IAAI,IAAI;CAKd;AAGD,eAAO,MAAM,mBAAmB,qBAA4B,CAAC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { IAuthProvider } from "../types/auth-provider";
|
|
2
|
-
/**
|
|
3
|
-
* Check if the provider is a platform provider
|
|
4
|
-
* Centralized logic for determining platform-specific features availability
|
|
5
|
-
*/
|
|
6
|
-
export declare function isPlatformProvider(provider: IAuthProvider | null | undefined): boolean;
|
|
7
|
-
/**
|
|
8
|
-
* Check if platform-specific features should be enabled
|
|
9
|
-
* This is the main function to use throughout the framework
|
|
10
|
-
*/
|
|
11
|
-
export declare function shouldEnablePlatformFeatures(provider: IAuthProvider | null | undefined): boolean;
|
|
12
|
-
/**
|
|
13
|
-
* Get a safe provider instance with fallback
|
|
14
|
-
* Handles null/undefined cases gracefully
|
|
15
|
-
*/
|
|
16
|
-
export declare function getSafeProvider(provider: IAuthProvider | null | undefined): IAuthProvider | null;
|
|
17
|
-
//# sourceMappingURL=auth-provider-utils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auth-provider-utils.d.ts","sourceRoot":"","sources":["../../../core/providers/auth-provider-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAGvD;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,aAAa,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAEtF;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,QAAQ,EAAE,aAAa,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAEhG;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,aAAa,GAAG,IAAI,GAAG,SAAS,GAAG,aAAa,GAAG,IAAI,CAEhG"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Example Custom Authentication Provider
|
|
3
|
-
*
|
|
4
|
-
* This is an example implementation showing how to create a custom authentication provider.
|
|
5
|
-
* You can use this as a template to implement your own authentication logic.
|
|
6
|
-
*
|
|
7
|
-
* @example
|
|
8
|
-
* ```typescript
|
|
9
|
-
* import { CustomAuthProvider } from './auth/custom-provider';
|
|
10
|
-
*
|
|
11
|
-
* const customAuthProvider = new CustomAuthProvider();
|
|
12
|
-
*
|
|
13
|
-
* app.use(VirtoShellFramework, {
|
|
14
|
-
* router,
|
|
15
|
-
* authProvider: customAuthProvider,
|
|
16
|
-
* i18n: { ... }
|
|
17
|
-
* });
|
|
18
|
-
* ```
|
|
19
|
-
*/
|
|
20
|
-
import { ComputedRef } from "vue";
|
|
21
|
-
import { UserDetail, SecurityResult, LoginType, SignInResult, IIdentityResult } from "../api/platform";
|
|
22
|
-
import { RequestPasswordResult } from "../types";
|
|
23
|
-
import { IAuthProvider } from "../types/auth-provider";
|
|
24
|
-
export declare class CustomAuthProvider implements IAuthProvider {
|
|
25
|
-
private _user;
|
|
26
|
-
private _loading;
|
|
27
|
-
get user(): ComputedRef<UserDetail | undefined>;
|
|
28
|
-
get loading(): ComputedRef<boolean>;
|
|
29
|
-
get isAuthenticated(): ComputedRef<boolean>;
|
|
30
|
-
get isAdministrator(): ComputedRef<boolean | undefined>;
|
|
31
|
-
loadUser(): Promise<UserDetail>;
|
|
32
|
-
signIn(username: string, password: string): Promise<SignInResult | {
|
|
33
|
-
succeeded: boolean;
|
|
34
|
-
error?: any;
|
|
35
|
-
status?: number;
|
|
36
|
-
}>;
|
|
37
|
-
signOut(): Promise<void>;
|
|
38
|
-
validateToken(userId: string, token: string): Promise<boolean>;
|
|
39
|
-
validatePassword(password: string): Promise<IIdentityResult>;
|
|
40
|
-
resetPasswordByToken(userId: string, password: string, token: string): Promise<SecurityResult>;
|
|
41
|
-
requestPasswordReset(loginOrEmail: string): Promise<RequestPasswordResult>;
|
|
42
|
-
changeUserPassword(oldPassword: string, newPassword: string): Promise<SecurityResult | undefined>;
|
|
43
|
-
getLoginType(): Promise<LoginType[]>;
|
|
44
|
-
}
|
|
45
|
-
//# sourceMappingURL=example-custom-auth-provider.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"example-custom-auth-provider.d.ts","sourceRoot":"","sources":["../../../core/providers/example-custom-auth-provider.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAsB,WAAW,EAAE,MAAM,KAAK,CAAC;AACtD,OAAO,EACL,UAAU,EACV,cAAc,EAEd,SAAS,EACT,YAAY,EACZ,eAAe,EAChB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD,qBAAa,kBAAmB,YAAW,aAAa;IAEtD,OAAO,CAAC,KAAK,CAAsC;IACnD,OAAO,CAAC,QAAQ,CAA4B;IAE5C,IAAI,IAAI,IAAI,WAAW,CAAC,UAAU,GAAG,SAAS,CAAC,CAE9C;IAED,IAAI,OAAO,IAAI,WAAW,CAAC,OAAO,CAAC,CAElC;IAED,IAAI,eAAe,IAAI,WAAW,CAAC,OAAO,CAAC,CAE1C;IAED,IAAI,eAAe,IAAI,WAAW,CAAC,OAAO,GAAG,SAAS,CAAC,CAEtD;IAEK,QAAQ,IAAI,OAAO,CAAC,UAAU,CAAC;IAsB/B,MAAM,CACV,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,YAAY,GAAG;QAAE,SAAS,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,GAAG,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAgCzE,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAOxB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAM9D,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;IAM5D,oBAAoB,CACxB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,cAAc,CAAC;IAMpB,oBAAoB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAM1E,kBAAkB,CACtB,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC;IAMhC,YAAY,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC;CAK3C"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../core/providers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { ComputedRef } from "vue";
|
|
2
|
-
import { UserDetail, SecurityResult, LoginType, SignInResult, IIdentityResult, ISecurityResult } from "../api/platform";
|
|
3
|
-
import { RequestPasswordResult } from "../types";
|
|
4
|
-
import { IAuthProvider } from "../types/auth-provider";
|
|
5
|
-
/**
|
|
6
|
-
* Platform-based authentication provider
|
|
7
|
-
* Implements authentication using VirtoCommerce Platform API
|
|
8
|
-
*/
|
|
9
|
-
export declare class PlatformAuthProvider implements IAuthProvider {
|
|
10
|
-
private _user;
|
|
11
|
-
private _loading;
|
|
12
|
-
private securityClient;
|
|
13
|
-
private externalSignInStorage;
|
|
14
|
-
private externalSignOut;
|
|
15
|
-
constructor();
|
|
16
|
-
get user(): ComputedRef<UserDetail | undefined>;
|
|
17
|
-
get loading(): ComputedRef<boolean>;
|
|
18
|
-
get isAuthenticated(): ComputedRef<boolean>;
|
|
19
|
-
get isAdministrator(): ComputedRef<boolean | undefined>;
|
|
20
|
-
validateToken(userId: string, token: string): Promise<boolean>;
|
|
21
|
-
validatePassword(password: string): Promise<IIdentityResult>;
|
|
22
|
-
resetPasswordByToken(userId: string, password: string, token: string): Promise<ISecurityResult>;
|
|
23
|
-
signIn(username: string, password: string): Promise<SignInResult | {
|
|
24
|
-
succeeded: boolean;
|
|
25
|
-
error?: any;
|
|
26
|
-
status?: number;
|
|
27
|
-
}>;
|
|
28
|
-
signOut(): Promise<void>;
|
|
29
|
-
loadUser(): Promise<UserDetail>;
|
|
30
|
-
requestPasswordReset(loginOrEmail: string): Promise<RequestPasswordResult>;
|
|
31
|
-
changeUserPassword(oldPassword: string, newPassword: string): Promise<SecurityResult | undefined>;
|
|
32
|
-
getLoginType(): Promise<LoginType[]>;
|
|
33
|
-
}
|
|
34
|
-
//# sourceMappingURL=platform-auth-provider.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"platform-auth-provider.d.ts","sourceRoot":"","sources":["../../../core/providers/platform-auth-provider.ts"],"names":[],"mappings":"AACA,OAAO,EAAsB,WAAW,EAAE,MAAM,KAAK,CAAC;AACtD,OAAO,EACL,UAAU,EAGV,cAAc,EAId,SAAS,EAET,YAAY,EACZ,eAAe,EACf,eAAe,EAChB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAEjD,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAQvD;;;GAGG;AACH,qBAAa,oBAAqB,YAAW,aAAa;IACxD,OAAO,CAAC,KAAK,CAAsC;IACnD,OAAO,CAAC,QAAQ,CAA4B;IAC5C,OAAO,CAAC,cAAc,CAAiB;IACvC,OAAO,CAAC,qBAAqB,CAAoD;IACjF,OAAO,CAAC,eAAe,CAAoD;;IAU3E,IAAI,IAAI,IAAI,WAAW,CAAC,UAAU,GAAG,SAAS,CAAC,CAE9C;IAED,IAAI,OAAO,IAAI,WAAW,CAAC,OAAO,CAAC,CAElC;IAED,IAAI,eAAe,IAAI,WAAW,CAAC,OAAO,CAAC,CAE1C;IAED,IAAI,eAAe,IAAI,WAAW,CAAC,OAAO,GAAG,SAAS,CAAC,CAEtD;IAEK,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAe9D,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;IAI5D,oBAAoB,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;IAO/F,MAAM,CACV,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,YAAY,GAAG;QAAE,SAAS,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,GAAG,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAkCzE,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAYxB,QAAQ,IAAI,OAAO,CAAC,UAAU,CAAC;IAyB/B,oBAAoB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAa1E,kBAAkB,CAAC,WAAW,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC;IAoBjG,YAAY,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC;CAW3C"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { ComputedRef } from "vue";
|
|
2
|
-
import { SignInResult, IUserDetail, ISecurityResult, ILoginType, IIdentityResult } from "../api/platform";
|
|
3
|
-
import { RequestPasswordResult } from "./index";
|
|
4
|
-
/**
|
|
5
|
-
* Interface for authentication provider
|
|
6
|
-
* Allows custom authentication implementations while maintaining compatibility with all framework pages
|
|
7
|
-
*/
|
|
8
|
-
export interface IAuthProvider {
|
|
9
|
-
user: ComputedRef<IUserDetail | undefined>;
|
|
10
|
-
loading: ComputedRef<boolean>;
|
|
11
|
-
isAuthenticated: ComputedRef<boolean>;
|
|
12
|
-
isAdministrator: ComputedRef<boolean | undefined>;
|
|
13
|
-
loadUser(): Promise<IUserDetail>;
|
|
14
|
-
signIn(username: string, password: string): Promise<SignInResult | {
|
|
15
|
-
succeeded: boolean;
|
|
16
|
-
error?: any;
|
|
17
|
-
status?: number;
|
|
18
|
-
}>;
|
|
19
|
-
signOut(): Promise<void>;
|
|
20
|
-
validateToken(userId: string, token: string): Promise<boolean>;
|
|
21
|
-
validatePassword(password: string): Promise<IIdentityResult>;
|
|
22
|
-
resetPasswordByToken(userId: string, password: string, token: string): Promise<ISecurityResult>;
|
|
23
|
-
requestPasswordReset(loginOrEmail: string): Promise<RequestPasswordResult>;
|
|
24
|
-
changeUserPassword(oldPassword: string, newPassword: string): Promise<ISecurityResult | undefined>;
|
|
25
|
-
getLoginType(): Promise<ILoginType[]>;
|
|
26
|
-
}
|
|
27
|
-
//# sourceMappingURL=auth-provider.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auth-provider.d.ts","sourceRoot":"","sources":["../../../core/types/auth-provider.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,KAAK,CAAC;AAClC,OAAO,EACL,YAAY,EACZ,WAAW,EACX,eAAe,EACf,UAAU,EACV,eAAe,EAChB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAEhD;;;GAGG;AACH,MAAM,WAAW,aAAa;IAE5B,IAAI,EAAE,WAAW,CAAC,WAAW,GAAG,SAAS,CAAC,CAAC;IAC3C,OAAO,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAC9B,eAAe,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IACtC,eAAe,EAAE,WAAW,CAAC,OAAO,GAAG,SAAS,CAAC,CAAC;IAGlD,QAAQ,IAAI,OAAO,CAAC,WAAW,CAAC,CAAC;IACjC,MAAM,CACJ,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,YAAY,GAAG;QAAE,SAAS,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,GAAG,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAChF,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAGzB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAC/D,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;IAC7D,oBAAoB,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;IAChG,oBAAoB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAC;IAC3E,kBAAkB,CAAC,WAAW,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,GAAG,SAAS,CAAC,CAAC;IAGnG,YAAY,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC;CACvC"}
|