@visma-swno/customer-onboarding-wizard 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -2
- package/dist/button-styles.css.d.ts +5 -0
- package/dist/components/customer-onboarding-wizard/customer-onboarding-wizard.d.ts +98 -0
- package/dist/components/customer-onboarding-wizard/wizard-step-complete.d.ts +18 -0
- package/dist/components/customer-onboarding-wizard/wizard-step-welcome.d.ts +19 -0
- package/dist/components/customer-onboarding-wizard/wizard-step1-company.d.ts +46 -0
- package/dist/components/customer-onboarding-wizard/wizard-step2-administrators.d.ts +57 -0
- package/dist/components/customer-onboarding-wizard/wizard-step3-partner-access.d.ts +36 -0
- package/dist/core/http.service.d.ts +221 -0
- package/dist/core/i18n.service.d.ts +135 -0
- package/dist/core/icons.d.ts +21 -0
- package/dist/design-tokens.css.d.ts +6 -0
- package/dist/index.css.d.ts +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +2684 -0
- package/dist/step-styles.css.d.ts +1 -0
- package/package.json +5 -6
- package/dist/assets/Inter-Medium.woff2 +0 -0
- package/dist/assets/Inter-Regular.woff2 +0 -0
- package/dist/assets/Inter-SemiBold.woff2 +0 -0
- package/dist/assets/index.js +0 -2315
- package/dist/index.html +0 -182
package/README.md
CHANGED
|
@@ -24,9 +24,11 @@ npm install @visma-swno/customer-onboarding-wizard
|
|
|
24
24
|
```html
|
|
25
25
|
<vsn-customer-onboarding-wizard
|
|
26
26
|
baseUrl="https://api.example.com"
|
|
27
|
-
taskId="task-12345"
|
|
28
27
|
customerId="customer-67890"
|
|
29
|
-
|
|
28
|
+
taskId="task-12345"
|
|
29
|
+
locale="en-GB"
|
|
30
|
+
step="welcome"
|
|
31
|
+
adminUrl="https://admin.example.com/customer/user-access">
|
|
30
32
|
</vsn-customer-onboarding-wizard>
|
|
31
33
|
```
|
|
32
34
|
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import { SupportedLocale } from '../../core/i18n.service';
|
|
3
|
+
export declare class CustomerOnboardingWizard extends LitElement {
|
|
4
|
+
locale: SupportedLocale;
|
|
5
|
+
baseUrl: string;
|
|
6
|
+
adminUrl: string;
|
|
7
|
+
taskId: string;
|
|
8
|
+
customerId: string;
|
|
9
|
+
step: 'welcome' | 'company' | 'administrators' | 'partner-access' | 'complete';
|
|
10
|
+
private static readonly stepMap;
|
|
11
|
+
private userName;
|
|
12
|
+
private currentUserProfile;
|
|
13
|
+
private currentStep;
|
|
14
|
+
private completedSteps;
|
|
15
|
+
private errorState;
|
|
16
|
+
private customerInfo;
|
|
17
|
+
private visible;
|
|
18
|
+
private i18n;
|
|
19
|
+
private httpService;
|
|
20
|
+
private errorMessageListener;
|
|
21
|
+
private get steps();
|
|
22
|
+
connectedCallback(): void;
|
|
23
|
+
disconnectedCallback(): void;
|
|
24
|
+
/**
|
|
25
|
+
* Set up listener for error-message events from HttpService
|
|
26
|
+
* Listens on component element for instance-scoped events
|
|
27
|
+
*/
|
|
28
|
+
private setupErrorMessageListener;
|
|
29
|
+
/**
|
|
30
|
+
* Remove error-message listener on component disconnect
|
|
31
|
+
*/
|
|
32
|
+
private removeErrorMessageListener;
|
|
33
|
+
/**
|
|
34
|
+
* Dismiss error message manually
|
|
35
|
+
*/
|
|
36
|
+
private dismissError;
|
|
37
|
+
/**
|
|
38
|
+
* Initialize component with authentication token from host application
|
|
39
|
+
*/
|
|
40
|
+
private initializeWithAuth;
|
|
41
|
+
/**
|
|
42
|
+
* Request authentication token from host application
|
|
43
|
+
* Host must listen to 'request-token' event and provide token via callback
|
|
44
|
+
* @returns Promise that resolves with the authentication token
|
|
45
|
+
*/
|
|
46
|
+
private requestAuthToken;
|
|
47
|
+
/**
|
|
48
|
+
* Load user profile from API and set userName
|
|
49
|
+
* userName is populated from getUserProfile() API call
|
|
50
|
+
* Falls back to default 'User' if request fails
|
|
51
|
+
*/
|
|
52
|
+
private loadUserProfile;
|
|
53
|
+
/**
|
|
54
|
+
* Load customer info from API
|
|
55
|
+
* customerInfo is populated from getCustomerInfo() API call
|
|
56
|
+
* Falls back to null if request fails or customerId is not provided
|
|
57
|
+
*/
|
|
58
|
+
private loadCustomerInfo;
|
|
59
|
+
/**
|
|
60
|
+
* Update authentication token
|
|
61
|
+
* Call this method from host application to update token (e.g., after refresh)
|
|
62
|
+
* @param token - New OAuth2 access token
|
|
63
|
+
*/
|
|
64
|
+
updateToken(token: string | null): void;
|
|
65
|
+
willUpdate(changedProperties: Map<string, any>): void;
|
|
66
|
+
static styles: import('lit').CSSResult[];
|
|
67
|
+
/**
|
|
68
|
+
* Load data required for the given step number.
|
|
69
|
+
* Called in two scenarios:
|
|
70
|
+
* 1. On initial load — from `initializeWithAuth()` after the auth token is set,
|
|
71
|
+
* using the `currentStep` derived from the `step` property (direct navigation).
|
|
72
|
+
* 2. On user navigation — from `handleStartSetup()` when entering step 1.
|
|
73
|
+
*
|
|
74
|
+
* When adding data requirements for future steps (e.g. administrators for step 2),
|
|
75
|
+
* add the corresponding fetch call here with the appropriate step guard.
|
|
76
|
+
*/
|
|
77
|
+
private loadDataForStep;
|
|
78
|
+
private handleStartSetup;
|
|
79
|
+
private handleNext;
|
|
80
|
+
private handleComplete;
|
|
81
|
+
private handleSaveAndClose;
|
|
82
|
+
private handleEditCustomer;
|
|
83
|
+
private navigate;
|
|
84
|
+
private handleClose;
|
|
85
|
+
private getStepClass;
|
|
86
|
+
private getLineSegmentClass;
|
|
87
|
+
private renderStepIndicators;
|
|
88
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
89
|
+
/**
|
|
90
|
+
* Render error banner if there's an error message
|
|
91
|
+
*/
|
|
92
|
+
private renderErrorBanner;
|
|
93
|
+
}
|
|
94
|
+
declare global {
|
|
95
|
+
interface HTMLElementTagNameMap {
|
|
96
|
+
'vsn-customer-onboarding-wizard': CustomerOnboardingWizard;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import { Translations } from '../../core/i18n.service';
|
|
3
|
+
/**
|
|
4
|
+
* Completion Screen Component
|
|
5
|
+
* Displays success message and summary after completing onboarding wizard
|
|
6
|
+
*/
|
|
7
|
+
export declare class WizardStepComplete extends LitElement {
|
|
8
|
+
translations: Translations;
|
|
9
|
+
static styles: import('lit').CSSResult[];
|
|
10
|
+
private handleClose;
|
|
11
|
+
private handleGoToAdmin;
|
|
12
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
13
|
+
}
|
|
14
|
+
declare global {
|
|
15
|
+
interface HTMLElementTagNameMap {
|
|
16
|
+
'wizard-step-complete': WizardStepComplete;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import { Translations } from '../../core/i18n.service';
|
|
3
|
+
/**
|
|
4
|
+
* Welcome Step Component
|
|
5
|
+
* Displays welcome message with user name and setup description
|
|
6
|
+
*/
|
|
7
|
+
export declare class WizardStepWelcome extends LitElement {
|
|
8
|
+
userName: string;
|
|
9
|
+
translations: Translations;
|
|
10
|
+
static styles: import('lit').CSSResult[];
|
|
11
|
+
private handleStartSetup;
|
|
12
|
+
private handleSaveAndClose;
|
|
13
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
14
|
+
}
|
|
15
|
+
declare global {
|
|
16
|
+
interface HTMLElementTagNameMap {
|
|
17
|
+
'wizard-step-welcome': WizardStepWelcome;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import { Translations, SupportedLocale } from '../../core/i18n.service';
|
|
3
|
+
import { CustomerInfo } from '../../core/http.service';
|
|
4
|
+
/**
|
|
5
|
+
* Company Step Component
|
|
6
|
+
* Displays customer company information including contact, subscriptions, and partner details
|
|
7
|
+
*/
|
|
8
|
+
export declare class WizardStep1Company extends LitElement {
|
|
9
|
+
translations: Translations;
|
|
10
|
+
locale: SupportedLocale;
|
|
11
|
+
customerInfo: CustomerInfo | null;
|
|
12
|
+
private editingContact;
|
|
13
|
+
private countryDropdownOpen;
|
|
14
|
+
private fieldErrors;
|
|
15
|
+
private editName;
|
|
16
|
+
private editAddress1;
|
|
17
|
+
private editAddress2;
|
|
18
|
+
private editPostalCode;
|
|
19
|
+
private editCity;
|
|
20
|
+
private editCountryCode;
|
|
21
|
+
private editWebUrl;
|
|
22
|
+
private editContactEmail;
|
|
23
|
+
private localCustomer;
|
|
24
|
+
static styles: import('lit').CSSResult[];
|
|
25
|
+
private getCountryLabel;
|
|
26
|
+
private handleNext;
|
|
27
|
+
private handleSaveAndClose;
|
|
28
|
+
private handleEditContact;
|
|
29
|
+
private handleSaveChanges;
|
|
30
|
+
private handleCancelEdit;
|
|
31
|
+
private validateField;
|
|
32
|
+
private clearFieldError;
|
|
33
|
+
private validateForm;
|
|
34
|
+
private toggleCountryDropdown;
|
|
35
|
+
private selectCountry;
|
|
36
|
+
private handleCountryFocusOut;
|
|
37
|
+
private handleCountryKeydown;
|
|
38
|
+
protected updated(changedProperties: Map<PropertyKey, unknown>): void;
|
|
39
|
+
private handleStepKeydown;
|
|
40
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
41
|
+
}
|
|
42
|
+
declare global {
|
|
43
|
+
interface HTMLElementTagNameMap {
|
|
44
|
+
'wizard-step1-company': WizardStep1Company;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import { Translations, SupportedLocale } from '../../core/i18n.service';
|
|
3
|
+
import { HttpService, UserProfile } from '../../core/http.service';
|
|
4
|
+
/**
|
|
5
|
+
* Administrators Step Component
|
|
6
|
+
* Manages administrator user accounts for the customer
|
|
7
|
+
*/
|
|
8
|
+
export declare class WizardStep2Administrators extends LitElement {
|
|
9
|
+
translations: Translations;
|
|
10
|
+
httpService: HttpService | null;
|
|
11
|
+
customerId: string;
|
|
12
|
+
locale: SupportedLocale;
|
|
13
|
+
currentUser: UserProfile | null;
|
|
14
|
+
private existingAdmins;
|
|
15
|
+
private isLoadingAdmins;
|
|
16
|
+
private rows;
|
|
17
|
+
private nextId;
|
|
18
|
+
private lookingUpIds;
|
|
19
|
+
private isConfirming;
|
|
20
|
+
private rowErrors;
|
|
21
|
+
private _loadSequence;
|
|
22
|
+
protected updated(changedProperties: Map<string, unknown>): void;
|
|
23
|
+
private sortAdmins;
|
|
24
|
+
private loadExistingAdmins;
|
|
25
|
+
private get hasOpenRow();
|
|
26
|
+
private get validAdminCount();
|
|
27
|
+
private get canConfirm();
|
|
28
|
+
private get canAddMore();
|
|
29
|
+
private get confirmButtonLabel();
|
|
30
|
+
private addRow;
|
|
31
|
+
private removeRow;
|
|
32
|
+
private doneRow;
|
|
33
|
+
private editRow;
|
|
34
|
+
private updateRowEmail;
|
|
35
|
+
private updateFirstName;
|
|
36
|
+
private updateLastName;
|
|
37
|
+
private setRowFieldError;
|
|
38
|
+
private clearRowFieldError;
|
|
39
|
+
private validateRowEmail;
|
|
40
|
+
private validateRowRequiredField;
|
|
41
|
+
private validateAllRows;
|
|
42
|
+
private lookupUser;
|
|
43
|
+
private handleConfirm;
|
|
44
|
+
private handleSaveAndClose;
|
|
45
|
+
static styles: import('lit').CSSResult[];
|
|
46
|
+
private renderExistingAdminRow;
|
|
47
|
+
private renderLookupRow;
|
|
48
|
+
private renderFoundRow;
|
|
49
|
+
private renderNotFoundRow;
|
|
50
|
+
private renderAdminRow;
|
|
51
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
52
|
+
}
|
|
53
|
+
declare global {
|
|
54
|
+
interface HTMLElementTagNameMap {
|
|
55
|
+
'wizard-step2-administrators': WizardStep2Administrators;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import { Translations } from '../../core/i18n.service';
|
|
3
|
+
import { HttpService } from '../../core/http.service';
|
|
4
|
+
/**
|
|
5
|
+
* Partner Access Step Component
|
|
6
|
+
* Loads consultants from the partner and lets the user select which ones
|
|
7
|
+
* should have access to this customer's account.
|
|
8
|
+
*/
|
|
9
|
+
export declare class WizardStep3PartnerAccess extends LitElement {
|
|
10
|
+
translations: Translations;
|
|
11
|
+
httpService: HttpService | null;
|
|
12
|
+
customerId: string;
|
|
13
|
+
partnerId: string;
|
|
14
|
+
partnerName: string;
|
|
15
|
+
private consultants;
|
|
16
|
+
private isLoading;
|
|
17
|
+
private isConfirming;
|
|
18
|
+
private selectedIds;
|
|
19
|
+
private searchTerm;
|
|
20
|
+
private _loadSequence;
|
|
21
|
+
protected updated(changedProperties: Map<string, unknown>): void;
|
|
22
|
+
private loadConsultants;
|
|
23
|
+
private get filteredConsultants();
|
|
24
|
+
private get confirmButtonLabel();
|
|
25
|
+
private toggleConsultant;
|
|
26
|
+
private handleConfirm;
|
|
27
|
+
private handleSaveAndClose;
|
|
28
|
+
private renderConsultantRow;
|
|
29
|
+
static styles: import('lit').CSSResult[];
|
|
30
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
31
|
+
}
|
|
32
|
+
declare global {
|
|
33
|
+
interface HTMLElementTagNameMap {
|
|
34
|
+
'wizard-step3-partner-access': WizardStep3PartnerAccess;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Structured HTTP error with a numeric status code.
|
|
3
|
+
* Thrown by HttpService.request() for all non-2xx responses so callers
|
|
4
|
+
* can branch on `error.status` instead of parsing error message strings.
|
|
5
|
+
*/
|
|
6
|
+
export declare class HttpError extends Error {
|
|
7
|
+
readonly status: number;
|
|
8
|
+
constructor(status: number, statusText: string);
|
|
9
|
+
}
|
|
10
|
+
export interface RequestConfig {
|
|
11
|
+
method?: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
|
|
12
|
+
headers?: Record<string, string>;
|
|
13
|
+
body?: any;
|
|
14
|
+
timeout?: number;
|
|
15
|
+
/**
|
|
16
|
+
* HTTP status codes for which the error-message event should NOT be emitted.
|
|
17
|
+
* Use for expected non-success responses (e.g. 404 = user not found).
|
|
18
|
+
*/
|
|
19
|
+
suppressErrorStatuses?: number[];
|
|
20
|
+
}
|
|
21
|
+
export interface UserProfile {
|
|
22
|
+
firstName: string;
|
|
23
|
+
lastName: string;
|
|
24
|
+
email: string;
|
|
25
|
+
}
|
|
26
|
+
export interface CustomerInfo {
|
|
27
|
+
customer: {
|
|
28
|
+
customerId: string;
|
|
29
|
+
name: string;
|
|
30
|
+
organizationNumber: string;
|
|
31
|
+
address1: string;
|
|
32
|
+
address2: string;
|
|
33
|
+
postalCode: string;
|
|
34
|
+
city: string;
|
|
35
|
+
countryCode: string;
|
|
36
|
+
webUrl: string;
|
|
37
|
+
contactEmail: string;
|
|
38
|
+
};
|
|
39
|
+
subscriptions: string[];
|
|
40
|
+
partner: {
|
|
41
|
+
partnerId: string;
|
|
42
|
+
name: string;
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
export interface Administrator {
|
|
46
|
+
email: string;
|
|
47
|
+
firstName: string;
|
|
48
|
+
lastName: string;
|
|
49
|
+
}
|
|
50
|
+
export interface AdministratorsResponse {
|
|
51
|
+
content: Administrator[];
|
|
52
|
+
totalNumberOfRecords: number;
|
|
53
|
+
}
|
|
54
|
+
export interface AddAdministratorRequest {
|
|
55
|
+
email: string;
|
|
56
|
+
firstName: string;
|
|
57
|
+
lastName: string;
|
|
58
|
+
languageCode?: string;
|
|
59
|
+
}
|
|
60
|
+
export interface UserByEmailResponse {
|
|
61
|
+
email: string;
|
|
62
|
+
firstName: string;
|
|
63
|
+
lastName: string;
|
|
64
|
+
}
|
|
65
|
+
export interface Consultant {
|
|
66
|
+
id: string;
|
|
67
|
+
email: string;
|
|
68
|
+
firstName: string;
|
|
69
|
+
lastName: string;
|
|
70
|
+
}
|
|
71
|
+
export interface ConsultantsResponse {
|
|
72
|
+
content: Consultant[];
|
|
73
|
+
totalNumberOfRecords: number;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Request body for PUT /api/v1/customers/{customerId}
|
|
77
|
+
* Field names follow the API schema (not the internal CustomerInfo shape)
|
|
78
|
+
*/
|
|
79
|
+
export interface EditCustomerRequest {
|
|
80
|
+
name: string;
|
|
81
|
+
organizationNumber?: string;
|
|
82
|
+
address1?: string;
|
|
83
|
+
address2?: string;
|
|
84
|
+
postalCode?: string;
|
|
85
|
+
city?: string;
|
|
86
|
+
countryCode?: string;
|
|
87
|
+
telephone?: string;
|
|
88
|
+
emailAddress?: string;
|
|
89
|
+
webAddress?: string;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* HTTP Error event detail
|
|
93
|
+
* Dispatched when authentication/authorization fails (401, 403)
|
|
94
|
+
*/
|
|
95
|
+
export interface HttpErrorDetail {
|
|
96
|
+
status: number;
|
|
97
|
+
statusText: string;
|
|
98
|
+
message: string;
|
|
99
|
+
endpoint: string;
|
|
100
|
+
method: string;
|
|
101
|
+
/**
|
|
102
|
+
* Callback to retry the failed request
|
|
103
|
+
* Host application can refresh token, then call retry()
|
|
104
|
+
*/
|
|
105
|
+
retry: () => Promise<any>;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Error Message event detail
|
|
109
|
+
* Dispatched for validation errors, server errors, and network errors
|
|
110
|
+
* Component will display these errors internally
|
|
111
|
+
*/
|
|
112
|
+
export interface ErrorMessageDetail {
|
|
113
|
+
status: number;
|
|
114
|
+
errorKey: 'invalidRequest' | 'validationError' | 'notFound' | 'serverError' | 'requestTimeout' | 'networkError' | 'requestFailed';
|
|
115
|
+
endpoint: string;
|
|
116
|
+
method: string;
|
|
117
|
+
}
|
|
118
|
+
export declare class HttpService {
|
|
119
|
+
private baseUrl;
|
|
120
|
+
private defaultHeaders;
|
|
121
|
+
private authToken;
|
|
122
|
+
private eventTarget;
|
|
123
|
+
constructor(baseUrl: string, defaultHeaders?: Record<string, string>, eventTarget?: EventTarget);
|
|
124
|
+
/**
|
|
125
|
+
* Set the authentication token for all subsequent requests
|
|
126
|
+
* @param token - OAuth2 access token (from sessionStorage)
|
|
127
|
+
*/
|
|
128
|
+
setAuthToken(token: string | null): void;
|
|
129
|
+
/**
|
|
130
|
+
* Get current authentication token
|
|
131
|
+
*/
|
|
132
|
+
getAuthToken(): string | null;
|
|
133
|
+
/**
|
|
134
|
+
* Emit HTTP error event for authentication/authorization errors
|
|
135
|
+
* Only emits for 401 (Unauthorized) and 403 (Forbidden)
|
|
136
|
+
* @param status - HTTP status code (401 or 403)
|
|
137
|
+
* @param statusText - HTTP status text
|
|
138
|
+
* @param endpoint - API endpoint that failed
|
|
139
|
+
* @param method - HTTP method
|
|
140
|
+
* @param retryFn - Function to retry the request
|
|
141
|
+
*/
|
|
142
|
+
private emitHttpError;
|
|
143
|
+
/**
|
|
144
|
+
* Emit error message event for internal error handling
|
|
145
|
+
* Emitted for validation errors (400, 422), not-found errors (404), server errors (5xx), and network errors
|
|
146
|
+
* Component will display these errors in its UI
|
|
147
|
+
* @param status - HTTP status code or 0 for network errors
|
|
148
|
+
* @param errorKey - Translation key for the emitted error
|
|
149
|
+
* @param endpoint - API endpoint that failed
|
|
150
|
+
* @param method - HTTP method
|
|
151
|
+
*/
|
|
152
|
+
private emitErrorMessage;
|
|
153
|
+
request<T>(endpoint: string, config?: RequestConfig): Promise<T>;
|
|
154
|
+
/**
|
|
155
|
+
* Get error key based on status code for i18n translation
|
|
156
|
+
*/
|
|
157
|
+
private getErrorKey;
|
|
158
|
+
get<T>(endpoint: string, headers?: Record<string, string>): Promise<T>;
|
|
159
|
+
post<T>(endpoint: string, body: any, headers?: Record<string, string>): Promise<T>;
|
|
160
|
+
put<T>(endpoint: string, body: any, headers?: Record<string, string>): Promise<T>;
|
|
161
|
+
delete<T>(endpoint: string, headers?: Record<string, string>): Promise<T>;
|
|
162
|
+
getUserProfile(): Promise<UserProfile>;
|
|
163
|
+
/**
|
|
164
|
+
* Get customer info for a customer
|
|
165
|
+
* @param customerId - The customer ID
|
|
166
|
+
* @returns Promise with customer, subscriptions, and partner information
|
|
167
|
+
*/
|
|
168
|
+
getCustomerInfo(customerId: string): Promise<CustomerInfo>;
|
|
169
|
+
/**
|
|
170
|
+
* Get administrators for a customer
|
|
171
|
+
* @param customerId - The customer ID
|
|
172
|
+
* @returns Promise with paginated list of administrators
|
|
173
|
+
*/
|
|
174
|
+
getAdministrators(customerId: string): Promise<AdministratorsResponse>;
|
|
175
|
+
/**
|
|
176
|
+
* Edit customer details (name, address, contact info)
|
|
177
|
+
* PUT /api/v1/customers/{customerId}
|
|
178
|
+
* @param customerId - The customer ID
|
|
179
|
+
* @param data - Fields to update
|
|
180
|
+
* @returns Promise with the parsed response body from the API
|
|
181
|
+
*/
|
|
182
|
+
editCustomer(customerId: string, data: EditCustomerRequest): Promise<unknown>;
|
|
183
|
+
/**
|
|
184
|
+
* Save onboarding progress for a task
|
|
185
|
+
* @param taskId - The onboarding task ID
|
|
186
|
+
* @param step - The current step name
|
|
187
|
+
*/
|
|
188
|
+
saveProgress(taskId: string, step: 'welcome' | 'company' | 'administrators' | 'partner-access'): Promise<void>;
|
|
189
|
+
/**
|
|
190
|
+
* Delete an onboarding task after completion
|
|
191
|
+
* @param taskId - The onboarding task ID
|
|
192
|
+
*/
|
|
193
|
+
deleteTask(taskId: string): Promise<void>;
|
|
194
|
+
/**
|
|
195
|
+
* Look up a user by email address.
|
|
196
|
+
* Returns null when the user does not exist (404), without triggering the
|
|
197
|
+
* error banner — a missing user is a valid business outcome here.
|
|
198
|
+
* @param email - The email address to look up
|
|
199
|
+
*/
|
|
200
|
+
getUserByEmail(email: string): Promise<UserByEmailResponse | null>;
|
|
201
|
+
/**
|
|
202
|
+
* Add administrators to a customer account
|
|
203
|
+
* POST /api/v1/onboarding/customers/{customerId}/administrators
|
|
204
|
+
* @param customerId - The customer ID
|
|
205
|
+
* @param admins - Array of administrator data (email, firstName, lastName, languageCode)
|
|
206
|
+
*/
|
|
207
|
+
addCustomerAdministrators(customerId: string, admins: AddAdministratorRequest[]): Promise<unknown>;
|
|
208
|
+
/**
|
|
209
|
+
* Get consultants for a partner
|
|
210
|
+
* @param partnerId - The partner ID
|
|
211
|
+
* @returns Promise with paginated list of consultants
|
|
212
|
+
*/
|
|
213
|
+
getPartnerConsultants(partnerId: string): Promise<ConsultantsResponse>;
|
|
214
|
+
/**
|
|
215
|
+
* Add consultants to a customer
|
|
216
|
+
* @param customerId - The customer ID
|
|
217
|
+
* @param consultants - Array of consultant data
|
|
218
|
+
*/
|
|
219
|
+
addCustomerConsultants(customerId: string, consultants: Consultant[]): Promise<unknown>;
|
|
220
|
+
patch<T>(endpoint: string, body: any, headers?: Record<string, string>): Promise<T>;
|
|
221
|
+
}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* I18n Service
|
|
3
|
+
* Handles internationalization for the customer onboarding wizard
|
|
4
|
+
* Supported locales: da-DK, en-GB, en-US, fi-FI, nb-NO, nl-NL, sv-SE
|
|
5
|
+
*/
|
|
6
|
+
export type SupportedLocale = 'da-DK' | 'en-GB' | 'en-US' | 'fi-FI' | 'nb-NO' | 'nl-NL' | 'sv-SE';
|
|
7
|
+
export interface Translations {
|
|
8
|
+
wizard: {
|
|
9
|
+
title: string;
|
|
10
|
+
};
|
|
11
|
+
steps: {
|
|
12
|
+
company: string;
|
|
13
|
+
administrators: string;
|
|
14
|
+
partnerAccess: string;
|
|
15
|
+
progressLabel: string;
|
|
16
|
+
};
|
|
17
|
+
welcome: {
|
|
18
|
+
greeting: string;
|
|
19
|
+
description: string;
|
|
20
|
+
};
|
|
21
|
+
company: {
|
|
22
|
+
title: string;
|
|
23
|
+
description: string;
|
|
24
|
+
placeholder: string;
|
|
25
|
+
contactLabel: string;
|
|
26
|
+
editContactLabel: string;
|
|
27
|
+
subscriptionLabel: string;
|
|
28
|
+
address2Placeholder: string;
|
|
29
|
+
saveChanges: string;
|
|
30
|
+
cancelEdit: string;
|
|
31
|
+
companyNameLabel: string;
|
|
32
|
+
organizationNumberLabel: string;
|
|
33
|
+
address1Label: string;
|
|
34
|
+
postalCodeLabel: string;
|
|
35
|
+
cityLabel: string;
|
|
36
|
+
countryLabel: string;
|
|
37
|
+
webUrlLabel: string;
|
|
38
|
+
emailLabel: string;
|
|
39
|
+
editFormLabel: string;
|
|
40
|
+
addressGroupLabel: string;
|
|
41
|
+
managePlanMessage: string;
|
|
42
|
+
fieldRequired: string;
|
|
43
|
+
emailInvalid: string;
|
|
44
|
+
};
|
|
45
|
+
administrators: {
|
|
46
|
+
title: string;
|
|
47
|
+
description: string;
|
|
48
|
+
addAdministratorButton: string;
|
|
49
|
+
addNameButton: string;
|
|
50
|
+
firstNameLabel: string;
|
|
51
|
+
lastNameLabel: string;
|
|
52
|
+
youLabel: string;
|
|
53
|
+
deleteRowLabel: string;
|
|
54
|
+
confirmSingular: string;
|
|
55
|
+
confirmPlural: string;
|
|
56
|
+
doneButton: string;
|
|
57
|
+
editButton: string;
|
|
58
|
+
};
|
|
59
|
+
partnerAccess: {
|
|
60
|
+
title: string;
|
|
61
|
+
description: string;
|
|
62
|
+
findConsultantPlaceholder: string;
|
|
63
|
+
loading: string;
|
|
64
|
+
confirmSingular: string;
|
|
65
|
+
confirmPlural: string;
|
|
66
|
+
};
|
|
67
|
+
complete: {
|
|
68
|
+
title: string;
|
|
69
|
+
message1: string;
|
|
70
|
+
message2: string;
|
|
71
|
+
goToAdminButton: string;
|
|
72
|
+
};
|
|
73
|
+
common: {
|
|
74
|
+
saveAndClose: string;
|
|
75
|
+
startSetup: string;
|
|
76
|
+
confirm: string;
|
|
77
|
+
close: string;
|
|
78
|
+
loading: string;
|
|
79
|
+
dismissError: string;
|
|
80
|
+
};
|
|
81
|
+
errors: {
|
|
82
|
+
invalidRequest: {
|
|
83
|
+
title: string;
|
|
84
|
+
message: string;
|
|
85
|
+
};
|
|
86
|
+
validationError: {
|
|
87
|
+
title: string;
|
|
88
|
+
message: string;
|
|
89
|
+
};
|
|
90
|
+
notFound: {
|
|
91
|
+
title: string;
|
|
92
|
+
message: string;
|
|
93
|
+
};
|
|
94
|
+
serverError: {
|
|
95
|
+
title: string;
|
|
96
|
+
message: string;
|
|
97
|
+
};
|
|
98
|
+
requestTimeout: {
|
|
99
|
+
title: string;
|
|
100
|
+
message: string;
|
|
101
|
+
};
|
|
102
|
+
networkError: {
|
|
103
|
+
title: string;
|
|
104
|
+
message: string;
|
|
105
|
+
};
|
|
106
|
+
requestFailed: {
|
|
107
|
+
title: string;
|
|
108
|
+
message: string;
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* I18n Service Class
|
|
114
|
+
*/
|
|
115
|
+
export declare class I18nService {
|
|
116
|
+
private currentLocale;
|
|
117
|
+
/**
|
|
118
|
+
* Set the current locale
|
|
119
|
+
* Returns true when the locale is supported, otherwise falls back to en-GB and returns false.
|
|
120
|
+
*/
|
|
121
|
+
setLocale(locale: SupportedLocale | string): boolean;
|
|
122
|
+
/**
|
|
123
|
+
* Get the current locale
|
|
124
|
+
*/
|
|
125
|
+
getLocale(): SupportedLocale;
|
|
126
|
+
/**
|
|
127
|
+
* Get translations for the current locale
|
|
128
|
+
*/
|
|
129
|
+
getTranslations(): Translations;
|
|
130
|
+
/**
|
|
131
|
+
* Get a translation by key path
|
|
132
|
+
*/
|
|
133
|
+
t(key: string): string;
|
|
134
|
+
}
|
|
135
|
+
export declare const i18n: I18nService;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SVGTemplateResult } from 'lit';
|
|
2
|
+
/**
|
|
3
|
+
* Icon library for the onboarding wizard
|
|
4
|
+
* All icons from Lucide (https://lucide.dev/)
|
|
5
|
+
*/
|
|
6
|
+
export declare const icons: {
|
|
7
|
+
circle: () => SVGTemplateResult;
|
|
8
|
+
circleDashed: () => SVGTemplateResult;
|
|
9
|
+
check: () => SVGTemplateResult;
|
|
10
|
+
circleDotDashed: () => SVGTemplateResult;
|
|
11
|
+
circleCheckBig: () => SVGTemplateResult;
|
|
12
|
+
octagonAlert: () => SVGTemplateResult;
|
|
13
|
+
x: () => SVGTemplateResult;
|
|
14
|
+
pencil: () => SVGTemplateResult;
|
|
15
|
+
info: () => SVGTemplateResult;
|
|
16
|
+
chevronDown: () => SVGTemplateResult;
|
|
17
|
+
trash: () => SVGTemplateResult;
|
|
18
|
+
userRound: () => SVGTemplateResult;
|
|
19
|
+
plus: () => SVGTemplateResult;
|
|
20
|
+
search: () => SVGTemplateResult;
|
|
21
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const globalStyles: import('lit').CSSResult;
|
package/dist/index.d.ts
ADDED