@visma-swno/customer-onboarding-wizard 1.0.15 → 1.0.16
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/http.service.d.ts +4 -2
- package/dist/index.js +20 -18
- package/package.json +1 -1
|
@@ -224,11 +224,13 @@ export declare class HttpService {
|
|
|
224
224
|
*/
|
|
225
225
|
addCustomerAdministrators(customerId: string, admins: AddAdministratorRequest[]): Promise<unknown>;
|
|
226
226
|
/**
|
|
227
|
-
* Get consultants for a partner
|
|
227
|
+
* Get consultants for a partner, scoped to a customer
|
|
228
|
+
* GET /api/v1/partners/{partnerId}/customer/{customerId}/consultants
|
|
228
229
|
* @param partnerId - The partner ID
|
|
230
|
+
* @param customerId - The customer ID the consultants are scoped to
|
|
229
231
|
* @returns Promise with paginated list of consultants
|
|
230
232
|
*/
|
|
231
|
-
getPartnerConsultants(partnerId: string): Promise<ConsultantsResponse>;
|
|
233
|
+
getPartnerConsultants(partnerId: string, customerId: string): Promise<ConsultantsResponse>;
|
|
232
234
|
/**
|
|
233
235
|
* Add consultants to a customer
|
|
234
236
|
* POST /api/v1/customers/{customerId}/partners/{partnerId}/consultants
|
package/dist/index.js
CHANGED
|
@@ -100,7 +100,7 @@ const N = S`:host{--ga-color-black:#000;--ga-color-blue-10:#edf4fe;--ga-color-in
|
|
|
100
100
|
<path d="m21 21-4.3-4.3"/>
|
|
101
101
|
</svg>
|
|
102
102
|
`
|
|
103
|
-
},
|
|
103
|
+
}, I = {
|
|
104
104
|
"en-US": {
|
|
105
105
|
wizard: {
|
|
106
106
|
title: "Set up your company"
|
|
@@ -791,7 +791,7 @@ class U {
|
|
|
791
791
|
*/
|
|
792
792
|
setLocale(t) {
|
|
793
793
|
const a = t === "en-GB" ? "en-US" : t;
|
|
794
|
-
return Object.prototype.hasOwnProperty.call(
|
|
794
|
+
return Object.prototype.hasOwnProperty.call(I, a) ? (this.currentLocale = a, !0) : (console.warn(`Locale "${t}" not supported. Falling back to en-US.`), this.currentLocale = "en-US", !1);
|
|
795
795
|
}
|
|
796
796
|
/**
|
|
797
797
|
* Get the current locale
|
|
@@ -804,20 +804,20 @@ class U {
|
|
|
804
804
|
* Get translations for the current locale
|
|
805
805
|
*/
|
|
806
806
|
getTranslations() {
|
|
807
|
-
return
|
|
807
|
+
return I[this.currentLocale];
|
|
808
808
|
}
|
|
809
809
|
/**
|
|
810
810
|
* Get a translation by key path
|
|
811
811
|
*/
|
|
812
812
|
t(t) {
|
|
813
813
|
const a = t.split(".");
|
|
814
|
-
let i =
|
|
814
|
+
let i = I[this.currentLocale];
|
|
815
815
|
for (const r of a)
|
|
816
816
|
i = i == null ? void 0 : i[r];
|
|
817
817
|
return typeof i == "string" ? i : t;
|
|
818
818
|
}
|
|
819
819
|
}
|
|
820
|
-
class
|
|
820
|
+
class q extends Error {
|
|
821
821
|
constructor(t, a) {
|
|
822
822
|
super(`HTTP ${t}: ${a}`), this.status = t, this.name = "HttpError";
|
|
823
823
|
}
|
|
@@ -921,11 +921,11 @@ class F {
|
|
|
921
921
|
const T = this.getErrorKey(g.status);
|
|
922
922
|
this.emitErrorMessage(g.status, T, t, i);
|
|
923
923
|
}
|
|
924
|
-
throw new
|
|
924
|
+
throw new q(g.status, g.statusText);
|
|
925
925
|
}
|
|
926
926
|
return g.status === 204 ? void 0 : await g.json();
|
|
927
927
|
} catch (g) {
|
|
928
|
-
if (clearTimeout(L), g instanceof
|
|
928
|
+
if (clearTimeout(L), g instanceof q)
|
|
929
929
|
throw g;
|
|
930
930
|
if (g instanceof Error) {
|
|
931
931
|
const k = g.message.includes("aborted") ? "requestTimeout" : "networkError";
|
|
@@ -1020,7 +1020,7 @@ class F {
|
|
|
1020
1020
|
{ suppressErrorStatuses: [404] }
|
|
1021
1021
|
);
|
|
1022
1022
|
} catch (a) {
|
|
1023
|
-
if (a instanceof
|
|
1023
|
+
if (a instanceof q && a.status === 404)
|
|
1024
1024
|
return null;
|
|
1025
1025
|
throw a;
|
|
1026
1026
|
}
|
|
@@ -1035,12 +1035,14 @@ class F {
|
|
|
1035
1035
|
return this.post(`/api/v1/customers/${t}/administrators`, a);
|
|
1036
1036
|
}
|
|
1037
1037
|
/**
|
|
1038
|
-
* Get consultants for a partner
|
|
1038
|
+
* Get consultants for a partner, scoped to a customer
|
|
1039
|
+
* GET /api/v1/partners/{partnerId}/customer/{customerId}/consultants
|
|
1039
1040
|
* @param partnerId - The partner ID
|
|
1041
|
+
* @param customerId - The customer ID the consultants are scoped to
|
|
1040
1042
|
* @returns Promise with paginated list of consultants
|
|
1041
1043
|
*/
|
|
1042
|
-
getPartnerConsultants(t) {
|
|
1043
|
-
return this.get(`/api/v1/partners/${t}/consultants`);
|
|
1044
|
+
getPartnerConsultants(t, a) {
|
|
1045
|
+
return this.get(`/api/v1/partners/${t}/customer/${a}/consultants`);
|
|
1044
1046
|
}
|
|
1045
1047
|
/**
|
|
1046
1048
|
* Add consultants to a customer
|
|
@@ -1057,7 +1059,7 @@ class F {
|
|
|
1057
1059
|
}
|
|
1058
1060
|
}
|
|
1059
1061
|
const P = S`:host{display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden;}.step-content{text-align:left;flex:1;min-height:0;overflow-y:auto;}.step-content h2{font-size:var(--ga-text-2xl-size);line-height:var(--ga-text-2xl-line-height);letter-spacing:var(--ga-text-2xl-tracking);font-weight:var(--ga-font-weight-normal);margin:0 0 var(--ga-size-spacing-03);color:var(--ga-color-text-headings);}.wizard-actions{display:flex;justify-content:flex-end;align-items:center;margin-top:var(--ga-size-spacing-05);padding-top:var(--ga-size-spacing-05);border-top:var(--ga-size-border-width-sm) solid var(--ga-color-neutral-30);gap:var(--ga-size-spacing-05);flex-shrink:0;}.field-error{display:flex;align-items:center;gap:var(--ga-size-spacing-02);margin-top:var(--ga-size-spacing-01);color:var(--ga-color-icon-error);font-size:var(--ga-text-sm-size);font-family:var(--vsn-customer-onboarding-wizard-font-family);line-height:var(--ga-text-sm-line-height);}.field-error svg{width:var(--ga-size-spacing-04);height:var(--ga-size-spacing-04);flex-shrink:0;}.field-error-text{color:var(--ga-color-text-body);}.field-error--empty{visibility:hidden;}`;
|
|
1060
|
-
var M = Object.defineProperty, V = Object.getOwnPropertyDescriptor,
|
|
1062
|
+
var M = Object.defineProperty, V = Object.getOwnPropertyDescriptor, D = (e, t, a, i) => {
|
|
1061
1063
|
for (var r = i > 1 ? void 0 : i ? V(t, a) : t, s = e.length - 1, o; s >= 0; s--)
|
|
1062
1064
|
(o = e[s]) && (r = (i ? o(t, a, r) : o(r)) || r);
|
|
1063
1065
|
return i && r && M(t, a, r), r;
|
|
@@ -1111,13 +1113,13 @@ j.styles = [
|
|
|
1111
1113
|
P,
|
|
1112
1114
|
S`.wizard-content{display:flex;flex-direction:column;gap:var(--ga-size-spacing-06);flex:1 1 270px;min-height:0;text-align:left;align-self:center;width:100%;max-width:var(--ga-size-content-sm);padding:0;overflow-y:auto;}.wizard-content p{font-size:var(--ga-text-md-size);line-height:var(--ga-text-md-line-height);letter-spacing:var(--ga-text-md-tracking);color:var(--ga-color-text-body);margin:0;}.wizard-content h2.welcome-message{font-size:var(--ga-text-2xl-size);line-height:var(--ga-text-2xl-line-height);letter-spacing:var(--ga-text-2xl-tracking);font-weight:var(--ga-font-weight-normal);margin:0;color:var(--ga-color-text-headings);}.wizard-actions{border-top:none;padding-top:0;margin-top:0;}h2[tabindex="-1"]:focus{outline:none;}`
|
|
1113
1115
|
];
|
|
1114
|
-
|
|
1116
|
+
D([
|
|
1115
1117
|
d({ type: String })
|
|
1116
1118
|
], j.prototype, "userName", 2);
|
|
1117
|
-
|
|
1119
|
+
D([
|
|
1118
1120
|
d({ type: Object })
|
|
1119
1121
|
], j.prototype, "translations", 2);
|
|
1120
|
-
j =
|
|
1122
|
+
j = D([
|
|
1121
1123
|
A("wizard-step-welcome")
|
|
1122
1124
|
], j);
|
|
1123
1125
|
var _ = Object.defineProperty, K = Object.getOwnPropertyDescriptor, h = (e, t, a, i) => {
|
|
@@ -2147,17 +2149,17 @@ let w = class extends E {
|
|
|
2147
2149
|
});
|
|
2148
2150
|
}
|
|
2149
2151
|
willUpdate(e) {
|
|
2150
|
-
(e.has("httpService") || e.has("partnerId")) && this.loadConsultants();
|
|
2152
|
+
(e.has("httpService") || e.has("partnerId") || e.has("customerId")) && this.loadConsultants();
|
|
2151
2153
|
}
|
|
2152
2154
|
async loadConsultants() {
|
|
2153
|
-
if (!this.httpService || !this.partnerId) {
|
|
2155
|
+
if (!this.httpService || !this.partnerId || !this.customerId) {
|
|
2154
2156
|
++this._loadSequence, this.consultants = [], this.selectedIds = /* @__PURE__ */ new Set(), this.searchTerm = "", this.isLoading = !1;
|
|
2155
2157
|
return;
|
|
2156
2158
|
}
|
|
2157
2159
|
const e = ++this._loadSequence;
|
|
2158
2160
|
this.isLoading = !0, this.consultants = [], this.selectedIds = /* @__PURE__ */ new Set(), this.searchTerm = "";
|
|
2159
2161
|
try {
|
|
2160
|
-
const t = await this.httpService.getPartnerConsultants(this.partnerId);
|
|
2162
|
+
const t = await this.httpService.getPartnerConsultants(this.partnerId, this.customerId);
|
|
2161
2163
|
if (e !== this._loadSequence) return;
|
|
2162
2164
|
this.consultants = t.content;
|
|
2163
2165
|
} catch {
|