customer-module-frontend 2.0.1-beta.2 → 2.0.1-beta.4

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.
@@ -35813,31 +35813,31 @@ const Uh = ({
35813
35813
  e.data
35814
35814
  );
35815
35815
  }
35816
- }, Yp = async (A, t, e) => {
35817
- const E = kI(), {
35818
- authType: g,
35819
- clientId: C,
35820
- clientSecret: I,
35821
- scopes: r,
35822
- authEndpointUrl: B,
35823
- tokenEndpointUrl: a,
35824
- refreshTokenUrl: o,
35825
- keyName: i,
35826
- prefix: c
35827
- } = t;
35828
- return (await E(`/v1/api/connector/${A}/auth`, {
35829
- method: "PATCH",
35816
+ }, Yp = async (A, t, e, E) => {
35817
+ const g = kI(), {
35818
+ authType: C,
35819
+ clientId: I,
35820
+ clientSecret: r,
35821
+ scopes: B,
35822
+ authEndpointUrl: a,
35823
+ tokenEndpointUrl: o,
35824
+ refreshTokenUrl: i,
35825
+ keyName: c,
35826
+ prefix: h
35827
+ } = t, m = E === "ug" ? "/v1/api/connector/auth" : `/v1/api/connector/${A}/auth`;
35828
+ return (await g(m, {
35829
+ method: E === "ug" ? "POST" : "PATCH",
35830
35830
  data: {
35831
35831
  authDetails: {
35832
- authType: g,
35833
- clientId: C,
35834
- clientSecret: I,
35835
- scopes: r,
35836
- authEndpointUrl: B,
35837
- tokenEndpointUrl: a,
35838
- refreshTokenUrl: o,
35839
- keyName: i,
35840
- prefix: c
35832
+ authType: C,
35833
+ clientId: I,
35834
+ clientSecret: r,
35835
+ scopes: B,
35836
+ authEndpointUrl: a,
35837
+ tokenEndpointUrl: o,
35838
+ refreshTokenUrl: i,
35839
+ keyName: c,
35840
+ prefix: h
35841
35841
  },
35842
35842
  variables: e
35843
35843
  }
@@ -35910,12 +35910,12 @@ const Uh = ({
35910
35910
  return;
35911
35911
  }
35912
35912
  if (W)
35913
- d.current = W.id;
35913
+ d.current = { id: W.id, source: "ug" };
35914
35914
  else {
35915
35915
  const AA = await Wp();
35916
35916
  if (F) return;
35917
35917
  const $ = AA.find((mA) => mA.type === E) ?? AA.find((mA) => mA.name.toLowerCase().includes(E));
35918
- $ ? d.current = $.id : console.error(
35918
+ $ ? d.current = { id: $.id, source: "list" } : console.error(
35919
35919
  `[CrmConnectStep] ${g} not found in /ug or /list. Available types:`,
35920
35920
  AA.map((mA) => mA.type)
35921
35921
  );
@@ -35978,10 +35978,11 @@ const Uh = ({
35978
35978
  try {
35979
35979
  const F = d.current;
35980
35980
  if (!F) throw new Error(`${g} template ID not resolved`);
35981
- const P = await qp(F), { id: W, authorizationUrl: AA } = await Yp(
35982
- F,
35981
+ const P = await qp(F.id), { id: W, authorizationUrl: AA } = await Yp(
35982
+ F.id,
35983
35983
  P.authDetails,
35984
- P.variables
35984
+ P.variables,
35985
+ F.source
35985
35986
  );
35986
35987
  v.current = window.open(AA, "_blank"), h(W), i("polling"), B(`${g} authorisation started`);
35987
35988
  } catch (F) {