@wisemen/wise-crm-web 0.2.5 → 1.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/BusinessDetailSidebarProvider-Dm6Dd7Nq.js +2899 -0
- package/dist/{BusinessDetailView-BZpocob4.js → BusinessDetailView-BHVUfCpV.js} +5 -5
- package/dist/{CrmDetailHeaderCard-Jo2OteBb.js → CrmDetailHeaderCard-CiVLyIuw.js} +39 -39
- package/dist/{CrmDetailView-DKHX-JEl.js → CrmDetailView-DaAuWeiB.js} +14 -14
- package/dist/{DealCommunicationTabView-ClflVxHJ.js → DealCommunicationTabView-xq_zOAsr.js} +2 -2
- package/dist/{DealDetailView-ChAFvBBK.js → DealDetailView-C54XpYN1.js} +124 -124
- package/dist/{DealExternalAttachment-ClwtFzpQ.js → DealExternalAttachment-Dp44vkgt.js} +1 -1
- package/dist/{DealSendMailDialog-SWWyaxq8.js → DealSendMailDialog-D11Tgd_A.js} +50 -50
- package/dist/{Error-CX6APxDX.js → Error-X0deDY-N.js} +510 -8
- package/dist/{IndividualDetailSidebarProvider-BJgxw1Jd.js → IndividualDetailSidebarProvider-BvjhFng9.js} +218 -218
- package/dist/{IndividualDetailView-CvGUCWPY.js → IndividualDetailView-Cq8iAwQv.js} +5 -5
- package/dist/{client-CpsHjr8V.js → client-S6BLV3Ct.js} +7 -12
- package/dist/composables/crmConfig.composable.d.ts +1 -0
- package/dist/index.js +375 -375
- package/dist/kbo-client/client/client.gen.d.ts +2 -0
- package/dist/kbo-client/client/index.d.ts +8 -0
- package/dist/kbo-client/client/types.gen.d.ts +117 -0
- package/dist/kbo-client/client/utils.gen.d.ts +33 -0
- package/dist/kbo-client/client.gen.d.ts +12 -0
- package/dist/kbo-client/core/auth.gen.d.ts +18 -0
- package/dist/kbo-client/core/bodySerializer.gen.d.ts +25 -0
- package/dist/kbo-client/core/params.gen.d.ts +43 -0
- package/dist/kbo-client/core/pathSerializer.gen.d.ts +33 -0
- package/dist/kbo-client/core/queryKeySerializer.gen.d.ts +18 -0
- package/dist/kbo-client/core/serverSentEvents.gen.d.ts +71 -0
- package/dist/kbo-client/core/types.gen.d.ts +78 -0
- package/dist/kbo-client/core/utils.gen.d.ts +19 -0
- package/dist/kbo-client/index.d.ts +2 -0
- package/dist/kbo-client/sdk.gen.d.ts +72 -0
- package/dist/kbo-client/types.gen.d.ts +2089 -0
- package/dist/kbo-client/zod.gen.d.ts +5943 -0
- package/dist/libs/http.lib.d.ts +3 -1
- package/dist/libs/kboBaseUrl.lib.d.ts +1 -0
- package/dist/models/cbe/search/cbeEnterpriseSearchDto.model.d.ts +1 -1
- package/dist/testing.js +1 -1
- package/package.json +2 -1
- package/dist/BusinessDetailSidebarProvider-CXG99iHk.js +0 -2077
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as AppGroup_default, n as useDateTimeFormat, o as PlainDateTransformer, r as DateUtil, s as ZonedDateTimeTransformer, u as ze } from "./AppSkeletonLoader-BAhoOmFD.js";
|
|
2
|
-
import {
|
|
2
|
+
import { C as unlinkContactPersonFromIndividualV1, G as viewDealNotesIndexV1, J as viewIndividualContactPersonDetailV1, K as viewIndividualActivityLogIndexV1, N as upsertIndividualBillingInformationV1, O as updateIndividualContactPersonV1, Q as viewIndividualStatisticsV1, V as viewCustomFieldDefinitionIndexV1, X as viewIndividualIndexV1, Y as viewIndividualDetailV1, Z as viewIndividualNotesIndexV1, a as createIndividualV1, c as createUserIndividualGrantV1, gt as Locale, it as viewTenantConfigDetailV1, j as updateNoteV1, k as updateIndividualV1, l as deleteNoteV1, mt as EntityType, ot as client, p as linkContactPersonToIndividualV1, pt as EntityColor, q as viewIndividualBillingInformationDetailV1, s as createNoteV1, v as makeIndividualContactPersonPrimaryV1, z as viewBusinessNotesIndexV1 } from "./client-S6BLV3Ct.js";
|
|
3
3
|
import { t as __plugin_vue_export_helper_default } from "./_plugin-vue_export-helper-BSi1g3Lh.js";
|
|
4
4
|
import z$1, { z } from "zod";
|
|
5
5
|
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createStaticVNode, createTextVNode, createVNode, defineComponent, mergeModels, mergeProps, normalizeClass, normalizeStyle, onMounted, onUnmounted, openBlock, readonly, ref, renderList, renderSlot, toDisplayString, unref, useId, useModel, useSlots, watch, withCtx, withModifiers } from "vue";
|
|
@@ -2733,6 +2733,497 @@ function useGoogleMapsApiKey() {
|
|
|
2733
2733
|
setGoogleMapsApiKey: s
|
|
2734
2734
|
};
|
|
2735
2735
|
}
|
|
2736
|
+
const jsonBodySerializer = { bodySerializer: (s) => JSON.stringify(s, (s, F) => typeof F == "bigint" ? F.toString() : F) };
|
|
2737
|
+
Object.entries({
|
|
2738
|
+
$body_: "body",
|
|
2739
|
+
$headers_: "headers",
|
|
2740
|
+
$path_: "path",
|
|
2741
|
+
$query_: "query"
|
|
2742
|
+
});
|
|
2743
|
+
const createSseClient = ({ onRequest: s, onSseError: F, onSseEvent: I, responseTransformer: L, responseValidator: R, sseDefaultRetryDelay: B, sseMaxRetryAttempts: V, sseMaxRetryDelay: H, sseSleepFn: U, url: W, ...G }) => {
|
|
2744
|
+
let K, q = U ?? ((s) => new Promise((F) => setTimeout(F, s)));
|
|
2745
|
+
return { stream: async function* () {
|
|
2746
|
+
let U = B ?? 3e3, J = 0, Y = G.signal ?? new AbortController().signal;
|
|
2747
|
+
for (; !Y.aborted;) {
|
|
2748
|
+
J++;
|
|
2749
|
+
let B = G.headers instanceof Headers ? G.headers : new Headers(G.headers);
|
|
2750
|
+
K !== void 0 && B.set("Last-Event-ID", K);
|
|
2751
|
+
try {
|
|
2752
|
+
let F = {
|
|
2753
|
+
redirect: "follow",
|
|
2754
|
+
...G,
|
|
2755
|
+
body: G.serializedBody,
|
|
2756
|
+
headers: B,
|
|
2757
|
+
signal: Y
|
|
2758
|
+
}, V = new Request(W, F);
|
|
2759
|
+
s && (V = await s(W, F));
|
|
2760
|
+
let H = await (G.fetch ?? globalThis.fetch)(V);
|
|
2761
|
+
if (!H.ok) throw Error(`SSE failed: ${H.status} ${H.statusText}`);
|
|
2762
|
+
if (!H.body) throw Error("No body in SSE response");
|
|
2763
|
+
let q = H.body.pipeThrough(new TextDecoderStream()).getReader(), J = "", X = () => {
|
|
2764
|
+
try {
|
|
2765
|
+
q.cancel();
|
|
2766
|
+
} catch {}
|
|
2767
|
+
};
|
|
2768
|
+
Y.addEventListener("abort", X);
|
|
2769
|
+
try {
|
|
2770
|
+
for (;;) {
|
|
2771
|
+
let { done: s, value: F } = await q.read();
|
|
2772
|
+
if (s) break;
|
|
2773
|
+
J += F, J = J.replace(/\r\n/g, "\n").replace(/\r/g, "\n");
|
|
2774
|
+
let B = J.split("\n\n");
|
|
2775
|
+
J = B.pop() ?? "";
|
|
2776
|
+
for (let s of B) {
|
|
2777
|
+
let F = s.split("\n"), B = [], V;
|
|
2778
|
+
for (let s of F) if (s.startsWith("data:")) B.push(s.replace(/^data:\s*/, ""));
|
|
2779
|
+
else if (s.startsWith("event:")) V = s.replace(/^event:\s*/, "");
|
|
2780
|
+
else if (s.startsWith("id:")) K = s.replace(/^id:\s*/, "");
|
|
2781
|
+
else if (s.startsWith("retry:")) {
|
|
2782
|
+
let F = Number.parseInt(s.replace(/^retry:\s*/, ""), 10);
|
|
2783
|
+
Number.isNaN(F) || (U = F);
|
|
2784
|
+
}
|
|
2785
|
+
let H, W = !1;
|
|
2786
|
+
if (B.length) {
|
|
2787
|
+
let s = B.join("\n");
|
|
2788
|
+
try {
|
|
2789
|
+
H = JSON.parse(s), W = !0;
|
|
2790
|
+
} catch {
|
|
2791
|
+
H = s;
|
|
2792
|
+
}
|
|
2793
|
+
}
|
|
2794
|
+
W && (R && await R(H), L && (H = await L(H))), I?.({
|
|
2795
|
+
data: H,
|
|
2796
|
+
event: V,
|
|
2797
|
+
id: K,
|
|
2798
|
+
retry: U
|
|
2799
|
+
}), B.length && (yield H);
|
|
2800
|
+
}
|
|
2801
|
+
}
|
|
2802
|
+
} finally {
|
|
2803
|
+
Y.removeEventListener("abort", X), q.releaseLock();
|
|
2804
|
+
}
|
|
2805
|
+
break;
|
|
2806
|
+
} catch (s) {
|
|
2807
|
+
if (F?.(s), V !== void 0 && J >= V) break;
|
|
2808
|
+
await q(Math.min(U * 2 ** (J - 1), H ?? 3e4));
|
|
2809
|
+
}
|
|
2810
|
+
}
|
|
2811
|
+
}() };
|
|
2812
|
+
}, separatorArrayExplode = (s) => {
|
|
2813
|
+
switch (s) {
|
|
2814
|
+
case "label": return ".";
|
|
2815
|
+
case "matrix": return ";";
|
|
2816
|
+
case "simple": return ",";
|
|
2817
|
+
default: return "&";
|
|
2818
|
+
}
|
|
2819
|
+
}, separatorArrayNoExplode = (s) => {
|
|
2820
|
+
switch (s) {
|
|
2821
|
+
case "form": return ",";
|
|
2822
|
+
case "pipeDelimited": return "|";
|
|
2823
|
+
case "spaceDelimited": return "%20";
|
|
2824
|
+
default: return ",";
|
|
2825
|
+
}
|
|
2826
|
+
}, separatorObjectExplode = (s) => {
|
|
2827
|
+
switch (s) {
|
|
2828
|
+
case "label": return ".";
|
|
2829
|
+
case "matrix": return ";";
|
|
2830
|
+
case "simple": return ",";
|
|
2831
|
+
default: return "&";
|
|
2832
|
+
}
|
|
2833
|
+
}, serializeArrayParam = ({ allowReserved: s, explode: F, name: I, style: L, value: R }) => {
|
|
2834
|
+
if (!F) {
|
|
2835
|
+
let F = (s ? R : R.map((s) => encodeURIComponent(s))).join(separatorArrayNoExplode(L));
|
|
2836
|
+
switch (L) {
|
|
2837
|
+
case "label": return `.${F}`;
|
|
2838
|
+
case "matrix": return `;${I}=${F}`;
|
|
2839
|
+
case "simple": return F;
|
|
2840
|
+
default: return `${I}=${F}`;
|
|
2841
|
+
}
|
|
2842
|
+
}
|
|
2843
|
+
let B = separatorArrayExplode(L), V = R.map((F) => L === "label" || L === "simple" ? s ? F : encodeURIComponent(F) : serializePrimitiveParam({
|
|
2844
|
+
allowReserved: s,
|
|
2845
|
+
name: I,
|
|
2846
|
+
value: F
|
|
2847
|
+
})).join(B);
|
|
2848
|
+
return L === "label" || L === "matrix" ? B + V : V;
|
|
2849
|
+
}, serializePrimitiveParam = ({ allowReserved: s, name: F, value: I }) => {
|
|
2850
|
+
if (I == null) return "";
|
|
2851
|
+
if (typeof I == "object") throw Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");
|
|
2852
|
+
return `${F}=${s ? I : encodeURIComponent(I)}`;
|
|
2853
|
+
}, serializeObjectParam = ({ allowReserved: s, explode: F, name: I, style: L, value: R, valueOnly: B }) => {
|
|
2854
|
+
if (R instanceof Date) return B ? R.toISOString() : `${I}=${R.toISOString()}`;
|
|
2855
|
+
if (L !== "deepObject" && !F) {
|
|
2856
|
+
let F = [];
|
|
2857
|
+
Object.entries(R).forEach(([I, L]) => {
|
|
2858
|
+
F = [
|
|
2859
|
+
...F,
|
|
2860
|
+
I,
|
|
2861
|
+
s ? L : encodeURIComponent(L)
|
|
2862
|
+
];
|
|
2863
|
+
});
|
|
2864
|
+
let B = F.join(",");
|
|
2865
|
+
switch (L) {
|
|
2866
|
+
case "form": return `${I}=${B}`;
|
|
2867
|
+
case "label": return `.${B}`;
|
|
2868
|
+
case "matrix": return `;${I}=${B}`;
|
|
2869
|
+
default: return B;
|
|
2870
|
+
}
|
|
2871
|
+
}
|
|
2872
|
+
let V = separatorObjectExplode(L), H = Object.entries(R).map(([F, R]) => serializePrimitiveParam({
|
|
2873
|
+
allowReserved: s,
|
|
2874
|
+
name: L === "deepObject" ? `${I}[${F}]` : F,
|
|
2875
|
+
value: R
|
|
2876
|
+
})).join(V);
|
|
2877
|
+
return L === "label" || L === "matrix" ? V + H : H;
|
|
2878
|
+
}, PATH_PARAM_RE = /\{[^{}]+\}/g, defaultPathSerializer = ({ path: s, url: F }) => {
|
|
2879
|
+
let I = F, L = F.match(PATH_PARAM_RE);
|
|
2880
|
+
if (L) for (let F of L) {
|
|
2881
|
+
let L = !1, R = F.substring(1, F.length - 1), B = "simple";
|
|
2882
|
+
R.endsWith("*") && (L = !0, R = R.substring(0, R.length - 1)), R.startsWith(".") ? (R = R.substring(1), B = "label") : R.startsWith(";") && (R = R.substring(1), B = "matrix");
|
|
2883
|
+
let V = s[R];
|
|
2884
|
+
if (V == null) continue;
|
|
2885
|
+
if (Array.isArray(V)) {
|
|
2886
|
+
I = I.replace(F, serializeArrayParam({
|
|
2887
|
+
explode: L,
|
|
2888
|
+
name: R,
|
|
2889
|
+
style: B,
|
|
2890
|
+
value: V
|
|
2891
|
+
}));
|
|
2892
|
+
continue;
|
|
2893
|
+
}
|
|
2894
|
+
if (typeof V == "object") {
|
|
2895
|
+
I = I.replace(F, serializeObjectParam({
|
|
2896
|
+
explode: L,
|
|
2897
|
+
name: R,
|
|
2898
|
+
style: B,
|
|
2899
|
+
value: V,
|
|
2900
|
+
valueOnly: !0
|
|
2901
|
+
}));
|
|
2902
|
+
continue;
|
|
2903
|
+
}
|
|
2904
|
+
if (B === "matrix") {
|
|
2905
|
+
I = I.replace(F, `;${serializePrimitiveParam({
|
|
2906
|
+
name: R,
|
|
2907
|
+
value: V
|
|
2908
|
+
})}`);
|
|
2909
|
+
continue;
|
|
2910
|
+
}
|
|
2911
|
+
let H = encodeURIComponent(B === "label" ? `.${V}` : V);
|
|
2912
|
+
I = I.replace(F, H);
|
|
2913
|
+
}
|
|
2914
|
+
return I;
|
|
2915
|
+
}, getUrl = ({ baseUrl: s, path: F, query: I, querySerializer: L, url: R }) => {
|
|
2916
|
+
let B = R.startsWith("/") ? R : `/${R}`, V = (s ?? "") + B;
|
|
2917
|
+
F && (V = defaultPathSerializer({
|
|
2918
|
+
path: F,
|
|
2919
|
+
url: V
|
|
2920
|
+
}));
|
|
2921
|
+
let H = I ? L(I) : "";
|
|
2922
|
+
return H.startsWith("?") && (H = H.substring(1)), H && (V += `?${H}`), V;
|
|
2923
|
+
};
|
|
2924
|
+
function getValidRequestBody(s) {
|
|
2925
|
+
let F = s.body !== void 0;
|
|
2926
|
+
if (F && s.bodySerializer) return "serializedBody" in s ? s.serializedBody !== void 0 && s.serializedBody !== "" ? s.serializedBody : null : s.body === "" ? null : s.body;
|
|
2927
|
+
if (F) return s.body;
|
|
2928
|
+
}
|
|
2929
|
+
const getAuthToken = async (s, F) => {
|
|
2930
|
+
let I = typeof F == "function" ? await F(s) : F;
|
|
2931
|
+
if (I) return s.scheme === "bearer" ? `Bearer ${I}` : s.scheme === "basic" ? `Basic ${btoa(I)}` : I;
|
|
2932
|
+
}, createQuerySerializer = ({ parameters: s = {}, ...F } = {}) => (I) => {
|
|
2933
|
+
let L = [];
|
|
2934
|
+
if (I && typeof I == "object") for (let R in I) {
|
|
2935
|
+
let B = I[R];
|
|
2936
|
+
if (B == null) continue;
|
|
2937
|
+
let V = s[R] || F;
|
|
2938
|
+
if (Array.isArray(B)) {
|
|
2939
|
+
let s = serializeArrayParam({
|
|
2940
|
+
allowReserved: V.allowReserved,
|
|
2941
|
+
explode: !0,
|
|
2942
|
+
name: R,
|
|
2943
|
+
style: "form",
|
|
2944
|
+
value: B,
|
|
2945
|
+
...V.array
|
|
2946
|
+
});
|
|
2947
|
+
s && L.push(s);
|
|
2948
|
+
} else if (typeof B == "object") {
|
|
2949
|
+
let s = serializeObjectParam({
|
|
2950
|
+
allowReserved: V.allowReserved,
|
|
2951
|
+
explode: !0,
|
|
2952
|
+
name: R,
|
|
2953
|
+
style: "deepObject",
|
|
2954
|
+
value: B,
|
|
2955
|
+
...V.object
|
|
2956
|
+
});
|
|
2957
|
+
s && L.push(s);
|
|
2958
|
+
} else {
|
|
2959
|
+
let s = serializePrimitiveParam({
|
|
2960
|
+
allowReserved: V.allowReserved,
|
|
2961
|
+
name: R,
|
|
2962
|
+
value: B
|
|
2963
|
+
});
|
|
2964
|
+
s && L.push(s);
|
|
2965
|
+
}
|
|
2966
|
+
}
|
|
2967
|
+
return L.join("&");
|
|
2968
|
+
}, getParseAs = (s) => {
|
|
2969
|
+
if (!s) return "stream";
|
|
2970
|
+
let F = s.split(";")[0]?.trim();
|
|
2971
|
+
if (F) {
|
|
2972
|
+
if (F.startsWith("application/json") || F.endsWith("+json")) return "json";
|
|
2973
|
+
if (F === "multipart/form-data") return "formData";
|
|
2974
|
+
if ([
|
|
2975
|
+
"application/",
|
|
2976
|
+
"audio/",
|
|
2977
|
+
"image/",
|
|
2978
|
+
"video/"
|
|
2979
|
+
].some((s) => F.startsWith(s))) return "blob";
|
|
2980
|
+
if (F.startsWith("text/")) return "text";
|
|
2981
|
+
}
|
|
2982
|
+
};
|
|
2983
|
+
var checkForExistence = (s, F) => F ? !!(s.headers.has(F) || s.query?.[F] || s.headers.get("Cookie")?.includes(`${F}=`)) : !1;
|
|
2984
|
+
const setAuthParams = async ({ security: s, ...F }) => {
|
|
2985
|
+
for (let I of s) {
|
|
2986
|
+
if (checkForExistence(F, I.name)) continue;
|
|
2987
|
+
let s = await getAuthToken(I, F.auth);
|
|
2988
|
+
if (!s) continue;
|
|
2989
|
+
let L = I.name ?? "Authorization";
|
|
2990
|
+
switch (I.in) {
|
|
2991
|
+
case "query":
|
|
2992
|
+
F.query ||= {}, F.query[L] = s;
|
|
2993
|
+
break;
|
|
2994
|
+
case "cookie":
|
|
2995
|
+
F.headers.append("Cookie", `${L}=${s}`);
|
|
2996
|
+
break;
|
|
2997
|
+
case "header":
|
|
2998
|
+
default:
|
|
2999
|
+
F.headers.set(L, s);
|
|
3000
|
+
break;
|
|
3001
|
+
}
|
|
3002
|
+
}
|
|
3003
|
+
}, buildUrl = (s) => getUrl({
|
|
3004
|
+
baseUrl: s.baseUrl,
|
|
3005
|
+
path: s.path,
|
|
3006
|
+
query: s.query,
|
|
3007
|
+
querySerializer: typeof s.querySerializer == "function" ? s.querySerializer : createQuerySerializer(s.querySerializer),
|
|
3008
|
+
url: s.url
|
|
3009
|
+
}), mergeConfigs = (s, F) => {
|
|
3010
|
+
let I = {
|
|
3011
|
+
...s,
|
|
3012
|
+
...F
|
|
3013
|
+
};
|
|
3014
|
+
return I.baseUrl?.endsWith("/") && (I.baseUrl = I.baseUrl.substring(0, I.baseUrl.length - 1)), I.headers = mergeHeaders(s.headers, F.headers), I;
|
|
3015
|
+
};
|
|
3016
|
+
var headersEntries = (s) => {
|
|
3017
|
+
let F = [];
|
|
3018
|
+
return s.forEach((s, I) => {
|
|
3019
|
+
F.push([I, s]);
|
|
3020
|
+
}), F;
|
|
3021
|
+
};
|
|
3022
|
+
const mergeHeaders = (...s) => {
|
|
3023
|
+
let F = new Headers();
|
|
3024
|
+
for (let I of s) {
|
|
3025
|
+
if (!I) continue;
|
|
3026
|
+
let s = I instanceof Headers ? headersEntries(I) : Object.entries(I);
|
|
3027
|
+
for (let [I, L] of s) if (L === null) F.delete(I);
|
|
3028
|
+
else if (Array.isArray(L)) for (let s of L) F.append(I, s);
|
|
3029
|
+
else L !== void 0 && F.set(I, typeof L == "object" ? JSON.stringify(L) : L);
|
|
3030
|
+
}
|
|
3031
|
+
return F;
|
|
3032
|
+
};
|
|
3033
|
+
var Interceptors = class {
|
|
3034
|
+
fns = [];
|
|
3035
|
+
clear() {
|
|
3036
|
+
this.fns = [];
|
|
3037
|
+
}
|
|
3038
|
+
eject(s) {
|
|
3039
|
+
let F = this.getInterceptorIndex(s);
|
|
3040
|
+
this.fns[F] && (this.fns[F] = null);
|
|
3041
|
+
}
|
|
3042
|
+
exists(s) {
|
|
3043
|
+
let F = this.getInterceptorIndex(s);
|
|
3044
|
+
return !!this.fns[F];
|
|
3045
|
+
}
|
|
3046
|
+
getInterceptorIndex(s) {
|
|
3047
|
+
return typeof s == "number" ? this.fns[s] ? s : -1 : this.fns.indexOf(s);
|
|
3048
|
+
}
|
|
3049
|
+
update(s, F) {
|
|
3050
|
+
let I = this.getInterceptorIndex(s);
|
|
3051
|
+
return this.fns[I] ? (this.fns[I] = F, s) : !1;
|
|
3052
|
+
}
|
|
3053
|
+
use(s) {
|
|
3054
|
+
return this.fns.push(s), this.fns.length - 1;
|
|
3055
|
+
}
|
|
3056
|
+
};
|
|
3057
|
+
const createInterceptors = () => ({
|
|
3058
|
+
error: new Interceptors(),
|
|
3059
|
+
request: new Interceptors(),
|
|
3060
|
+
response: new Interceptors()
|
|
3061
|
+
});
|
|
3062
|
+
var defaultQuerySerializer = createQuerySerializer({
|
|
3063
|
+
allowReserved: !1,
|
|
3064
|
+
array: {
|
|
3065
|
+
explode: !0,
|
|
3066
|
+
style: "form"
|
|
3067
|
+
},
|
|
3068
|
+
object: {
|
|
3069
|
+
explode: !0,
|
|
3070
|
+
style: "deepObject"
|
|
3071
|
+
}
|
|
3072
|
+
}), defaultHeaders = { "Content-Type": "application/json" };
|
|
3073
|
+
const createConfig = (s = {}) => ({
|
|
3074
|
+
...jsonBodySerializer,
|
|
3075
|
+
headers: defaultHeaders,
|
|
3076
|
+
parseAs: "auto",
|
|
3077
|
+
querySerializer: defaultQuerySerializer,
|
|
3078
|
+
...s
|
|
3079
|
+
}), client$1 = ((s = {}) => {
|
|
3080
|
+
let F = mergeConfigs(createConfig(), s), I = () => ({ ...F }), L = (s) => (F = mergeConfigs(F, s), I()), R = createInterceptors(), B = async (s) => {
|
|
3081
|
+
let I = {
|
|
3082
|
+
...F,
|
|
3083
|
+
...s,
|
|
3084
|
+
fetch: s.fetch ?? F.fetch ?? globalThis.fetch,
|
|
3085
|
+
headers: mergeHeaders(F.headers, s.headers),
|
|
3086
|
+
serializedBody: void 0
|
|
3087
|
+
};
|
|
3088
|
+
return I.security && await setAuthParams({
|
|
3089
|
+
...I,
|
|
3090
|
+
security: I.security
|
|
3091
|
+
}), I.requestValidator && await I.requestValidator(I), I.body !== void 0 && I.bodySerializer && (I.serializedBody = I.bodySerializer(I.body)), (I.body === void 0 || I.serializedBody === "") && I.headers.delete("Content-Type"), {
|
|
3092
|
+
opts: I,
|
|
3093
|
+
url: buildUrl(I)
|
|
3094
|
+
};
|
|
3095
|
+
}, V = async (s) => {
|
|
3096
|
+
let { opts: F, url: I } = await B(s), L = {
|
|
3097
|
+
redirect: "follow",
|
|
3098
|
+
...F,
|
|
3099
|
+
body: getValidRequestBody(F)
|
|
3100
|
+
}, V = new Request(I, L);
|
|
3101
|
+
for (let s of R.request.fns) s && (V = await s(V, F));
|
|
3102
|
+
let H = F.fetch, U;
|
|
3103
|
+
try {
|
|
3104
|
+
U = await H(V);
|
|
3105
|
+
} catch (s) {
|
|
3106
|
+
let I = s;
|
|
3107
|
+
for (let L of R.error.fns) L && (I = await L(s, void 0, V, F));
|
|
3108
|
+
if (I ||= {}, F.throwOnError) throw I;
|
|
3109
|
+
return F.responseStyle === "data" ? void 0 : {
|
|
3110
|
+
error: I,
|
|
3111
|
+
request: V,
|
|
3112
|
+
response: void 0
|
|
3113
|
+
};
|
|
3114
|
+
}
|
|
3115
|
+
for (let s of R.response.fns) s && (U = await s(U, V, F));
|
|
3116
|
+
let W = {
|
|
3117
|
+
request: V,
|
|
3118
|
+
response: U
|
|
3119
|
+
};
|
|
3120
|
+
if (U.ok) {
|
|
3121
|
+
let s = (F.parseAs === "auto" ? getParseAs(U.headers.get("Content-Type")) : F.parseAs) ?? "json";
|
|
3122
|
+
if (U.status === 204 || U.headers.get("Content-Length") === "0") {
|
|
3123
|
+
let I;
|
|
3124
|
+
switch (s) {
|
|
3125
|
+
case "arrayBuffer":
|
|
3126
|
+
case "blob":
|
|
3127
|
+
case "text":
|
|
3128
|
+
I = await U[s]();
|
|
3129
|
+
break;
|
|
3130
|
+
case "formData":
|
|
3131
|
+
I = new FormData();
|
|
3132
|
+
break;
|
|
3133
|
+
case "stream":
|
|
3134
|
+
I = U.body;
|
|
3135
|
+
break;
|
|
3136
|
+
case "json":
|
|
3137
|
+
default:
|
|
3138
|
+
I = {};
|
|
3139
|
+
break;
|
|
3140
|
+
}
|
|
3141
|
+
return F.responseStyle === "data" ? I : {
|
|
3142
|
+
data: I,
|
|
3143
|
+
...W
|
|
3144
|
+
};
|
|
3145
|
+
}
|
|
3146
|
+
let I;
|
|
3147
|
+
switch (s) {
|
|
3148
|
+
case "arrayBuffer":
|
|
3149
|
+
case "blob":
|
|
3150
|
+
case "formData":
|
|
3151
|
+
case "text":
|
|
3152
|
+
I = await U[s]();
|
|
3153
|
+
break;
|
|
3154
|
+
case "json": {
|
|
3155
|
+
let s = await U.text();
|
|
3156
|
+
I = s ? JSON.parse(s) : {};
|
|
3157
|
+
break;
|
|
3158
|
+
}
|
|
3159
|
+
case "stream": return F.responseStyle === "data" ? U.body : {
|
|
3160
|
+
data: U.body,
|
|
3161
|
+
...W
|
|
3162
|
+
};
|
|
3163
|
+
}
|
|
3164
|
+
return s === "json" && (F.responseValidator && await F.responseValidator(I), F.responseTransformer && (I = await F.responseTransformer(I))), F.responseStyle === "data" ? I : {
|
|
3165
|
+
data: I,
|
|
3166
|
+
...W
|
|
3167
|
+
};
|
|
3168
|
+
}
|
|
3169
|
+
let G = await U.text(), K;
|
|
3170
|
+
try {
|
|
3171
|
+
K = JSON.parse(G);
|
|
3172
|
+
} catch {}
|
|
3173
|
+
let q = K ?? G, J = q;
|
|
3174
|
+
for (let s of R.error.fns) s && (J = await s(q, U, V, F));
|
|
3175
|
+
if (J ||= {}, F.throwOnError) throw J;
|
|
3176
|
+
return F.responseStyle === "data" ? void 0 : {
|
|
3177
|
+
error: J,
|
|
3178
|
+
...W
|
|
3179
|
+
};
|
|
3180
|
+
}, H = (s) => (F) => V({
|
|
3181
|
+
...F,
|
|
3182
|
+
method: s
|
|
3183
|
+
}), U = (s) => async (F) => {
|
|
3184
|
+
let { opts: I, url: L } = await B(F);
|
|
3185
|
+
return createSseClient({
|
|
3186
|
+
...I,
|
|
3187
|
+
body: I.body,
|
|
3188
|
+
headers: I.headers,
|
|
3189
|
+
method: s,
|
|
3190
|
+
onRequest: async (s, F) => {
|
|
3191
|
+
let L = new Request(s, F);
|
|
3192
|
+
for (let s of R.request.fns) s && (L = await s(L, I));
|
|
3193
|
+
return L;
|
|
3194
|
+
},
|
|
3195
|
+
serializedBody: getValidRequestBody(I),
|
|
3196
|
+
url: L
|
|
3197
|
+
});
|
|
3198
|
+
};
|
|
3199
|
+
return {
|
|
3200
|
+
buildUrl,
|
|
3201
|
+
connect: H("CONNECT"),
|
|
3202
|
+
delete: H("DELETE"),
|
|
3203
|
+
get: H("GET"),
|
|
3204
|
+
getConfig: I,
|
|
3205
|
+
head: H("HEAD"),
|
|
3206
|
+
interceptors: R,
|
|
3207
|
+
options: H("OPTIONS"),
|
|
3208
|
+
patch: H("PATCH"),
|
|
3209
|
+
post: H("POST"),
|
|
3210
|
+
put: H("PUT"),
|
|
3211
|
+
request: V,
|
|
3212
|
+
setConfig: L,
|
|
3213
|
+
sse: {
|
|
3214
|
+
connect: U("CONNECT"),
|
|
3215
|
+
delete: U("DELETE"),
|
|
3216
|
+
get: U("GET"),
|
|
3217
|
+
head: U("HEAD"),
|
|
3218
|
+
options: U("OPTIONS"),
|
|
3219
|
+
patch: U("PATCH"),
|
|
3220
|
+
post: U("POST"),
|
|
3221
|
+
put: U("PUT"),
|
|
3222
|
+
trace: U("TRACE")
|
|
3223
|
+
},
|
|
3224
|
+
trace: H("TRACE")
|
|
3225
|
+
};
|
|
3226
|
+
})(createConfig({ throwOnError: !0 }));
|
|
2736
3227
|
var ObjectUtil = class s {
|
|
2737
3228
|
static deepClone(s) {
|
|
2738
3229
|
return JSON.parse(JSON.stringify(s));
|
|
@@ -2743,23 +3234,34 @@ var ObjectUtil = class s {
|
|
|
2743
3234
|
return typeof R == "object" && R && !Array.isArray(R) ? s.serialize(R, B) : Array.isArray(R) ? R.map((F, I) => typeof F == "object" ? s.serialize(F, `${B}[${I}]`) : `${encodeURIComponent(`${B}[${I}]`)}=${encodeURIComponent(F)}`).join("&") : R == null ? "" : `${encodeURIComponent(B)}=${encodeURIComponent(R)}`;
|
|
2744
3235
|
}).filter((s) => s !== "").join("&");
|
|
2745
3236
|
}
|
|
2746
|
-
};
|
|
2747
|
-
function setupHttpClient(s, F) {
|
|
2748
|
-
client.setConfig({
|
|
3237
|
+
}, isSetup = !1;
|
|
3238
|
+
function setupHttpClient(s, F, I) {
|
|
3239
|
+
if (client.setConfig({
|
|
2749
3240
|
baseUrl: F,
|
|
2750
3241
|
headers: { "Accept-Language": typeof navigator < "u" ? navigator.language : "en-US" },
|
|
2751
3242
|
querySerializer: ObjectUtil.serialize
|
|
2752
|
-
}), client.
|
|
3243
|
+
}), client$1.setConfig({
|
|
3244
|
+
baseUrl: I,
|
|
3245
|
+
headers: { "Accept-Language": typeof navigator < "u" ? navigator.language : "en-US" },
|
|
3246
|
+
querySerializer: ObjectUtil.serialize
|
|
3247
|
+
}), isSetup) return;
|
|
3248
|
+
isSetup = !0;
|
|
3249
|
+
async function L(F) {
|
|
2753
3250
|
let I = await s();
|
|
2754
3251
|
return F.headers.set("Authorization", `Bearer ${I}`), F;
|
|
2755
|
-
}
|
|
3252
|
+
}
|
|
3253
|
+
client.interceptors.request.use(L), client$1.interceptors.request.use(L), client.interceptors.response.use((s) => (s?.status === 401 && console.error(s), s)), client$1.interceptors.response.use((s) => (s?.status === 401 && console.error(s), s));
|
|
3254
|
+
}
|
|
3255
|
+
var KBO_BASE_URL_TEST = "https://kbo-service.test.appwi.se", KBO_BASE_URL_PRODUCTION = "https://kbo-service.appwi.se";
|
|
3256
|
+
function getKboBaseUrl(s) {
|
|
3257
|
+
return s === "development" ? KBO_BASE_URL_TEST : KBO_BASE_URL_PRODUCTION;
|
|
2756
3258
|
}
|
|
2757
3259
|
var individualCustomFieldDefinition = [], businessCustomFieldDefinition = [], isInitialized = ref(!1), crmOptions = ref({ deals: null }), tenantCrmConfig = ref(null);
|
|
2758
3260
|
function useCrmConfig() {
|
|
2759
3261
|
let s = useGoogleMapsApiKey();
|
|
2760
3262
|
async function F(F) {
|
|
2761
3263
|
let I = useI18n();
|
|
2762
|
-
crmOptions.value = F.options, setupHttpClient(F.getAccessToken, F.apiCrmBaseUrl), s.setGoogleMapsApiKey(F.googleMapsApiKey), client.setConfig({ headers: { "Accept-Language": F.locale } }), tenantCrmConfig.value === null && (tenantCrmConfig.value = await fetchConfig()), setBrandColors(tenantCrmConfig.value.entities), individualCustomFieldDefinition = await fetchCustomFieldDefinition(EntityType.INDIVIDUAL), businessCustomFieldDefinition = await fetchCustomFieldDefinition(EntityType.BUSINESS), isInitialized.value = !0, watch(() => I.locale.value, async (s) => {
|
|
3264
|
+
crmOptions.value = F.options, setupHttpClient(F.getAccessToken, F.apiCrmBaseUrl, getKboBaseUrl(F.environment)), s.setGoogleMapsApiKey(F.googleMapsApiKey), client.setConfig({ headers: { "Accept-Language": F.locale } }), tenantCrmConfig.value === null && (tenantCrmConfig.value = await fetchConfig()), setBrandColors(tenantCrmConfig.value.entities), individualCustomFieldDefinition = await fetchCustomFieldDefinition(EntityType.INDIVIDUAL), businessCustomFieldDefinition = await fetchCustomFieldDefinition(EntityType.BUSINESS), isInitialized.value = !0, watch(() => I.locale.value, async (s) => {
|
|
2763
3265
|
client.setConfig({ headers: { "Accept-Language": s } }), tenantCrmConfig.value = await fetchConfig();
|
|
2764
3266
|
}, { deep: !0 });
|
|
2765
3267
|
}
|
|
@@ -12668,4 +13170,4 @@ var CrmDetailContainer_default = /* @__PURE__ */ __plugin_vue_export_helper_defa
|
|
|
12668
13170
|
]));
|
|
12669
13171
|
}
|
|
12670
13172
|
});
|
|
12671
|
-
export {
|
|
13173
|
+
export { useNoteDeleteMutation as $, AppColorProvider_default as A, CrmDetailSidebarNotesView_default as B, AppSeparator_default as C, useCrmConfig as D, useEntityDetail as E, AppSidebarFormFooter_default as F, AppDialogContainer_default as G, AppForm_default as H, AppAndOrSeparator_default as I, AppDialogActionCancel_default as J, AppDialogActions_default as K, useOffsetInfiniteQuery as L, useSearch as M, useRouteQueryState as N, client$1 as O, AppSidebarFormSubmitButton_default as P, useKeysetInfiniteQuery as Q, NoteUpdateDialog_default as R, EntityAutocomplete_default as S, useCrm as T, i18nPlugin as U, toFormField as V, AppConfirmDialog_default as W, LoggerUtil as X, useApiErrorToast as Y, createI18nKeyMap as Z, IndividualAutocomplete_default as _, AppOpenEntityButton_default as a, StringUtil as at, IndividualUpdateTransformer as b, CrmDetailAccordionRoot_default as c, ActivityIndexTransformer as ct, ContactPersonFormNameField_default as d, en_US_default as dt, NoteService as et, ContactPersonFormContactField_default as f, phoneNumberFormSchema as g, useContactPersonCreateMutation as h, CrmDetailSidebarAccordionHeaderIconButton_default as i, ContactPersonUpdateTransformer as it, EntityTypeUtil as j, useGoogleMapsApiKey as k, AppIconLabelPair_default as l, individualUuidSchema as lt, AppDialog_default as m, CrmDetailContainer_default as n, AppEmptyState_default as nt, CrmDetailSidebarCard_default as o, AddressTransformer as ot, AppUnstyledButton_default as p, AppDialogActionPrimary_default as q, CrmDetailSidebarTabs_default as r, AppGrid_default as rt, CrmDetailSidebarAccordionItem_default as s, ActivityIndexPaginationTransformer as st, Error_default as t, AppInfiniteScroll_default as tt, individualItemSchema as u, nl_BE_default as ut, useIndividualIndexQuery as v, AppHeightTransition_default as w, AppGlobalFormError_default as x, IndividualService as y, AppDialogHeader_default as z };
|