@vc-shell/framework 1.0.300 → 1.0.301

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/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## [1.0.301](https://github.com/VirtoCommerce/vc-shell/compare/v1.0.300...v1.0.301) (2024-10-01)
2
+
3
+
4
+
1
5
  ## [1.0.300](https://github.com/VirtoCommerce/vc-shell/compare/v1.0.299...v1.0.300) (2024-10-01)
2
6
 
3
7
 
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as a, openBlock as i, createBlock as r, unref as t } from "vue";
2
- import { _ as p } from "./external-provider.vue_vue_type_script_setup_true_lang-i8UevzqR.js";
3
- import { u as s } from "./index-brymheD-.js";
2
+ import { _ as p } from "./external-provider.vue_vue_type_script_setup_true_lang-LOFUQw3T.js";
3
+ import { u as s } from "./index-BPscLY-3.js";
4
4
  const g = /* @__PURE__ */ a({
5
5
  __name: "azuread",
6
6
  props: {
@@ -1,4 +1,4 @@
1
- import { _ as f } from "./external-provider.vue_vue_type_script_setup_true_lang-i8UevzqR.js";
1
+ import { _ as f } from "./external-provider.vue_vue_type_script_setup_true_lang-LOFUQw3T.js";
2
2
  export {
3
3
  f as default
4
4
  };
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as r, openBlock as s, createBlock as n, unref as o, withCtx as i, createElementVNode as a, createVNode as l, createTextVNode as p, toDisplayString as c } from "vue";
2
- import { _ as m, a as _ } from "./index-brymheD-.js";
2
+ import { _ as m, a as _ } from "./index-BPscLY-3.js";
3
3
  import "vee-validate";
4
4
  import "vue-router";
5
5
  const d = { class: "tw-flex tw-flex-row tw-items-center tw-gap-2" }, N = /* @__PURE__ */ r({
@@ -0,0 +1,4 @@
1
+ import { b as f } from "./index-BPscLY-3.js";
2
+ export {
3
+ f as default
4
+ };
package/dist/framework.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import "vue-router";
2
- import { az as i, bV as n, cx as o, aA as c, aB as r, aC as l, bM as u, ao as p, c2 as b, c1 as d, c4 as y, c3 as g, al as V, am as m, bL as S, ap as C, aG as P, aH as h, cs as D, cD as A, aI as I, aD as R, aE as f, aF as L, aJ as M, aK as T, aL as B, aq as E, aM as N, ca as w, c9 as U, aN as O, bN as v, ar as k, aO as q, aP as x, aQ as F, aR as j, aS as z, aT as J, aU as K, bP as H, aV as W, aW as G, aX as Q, bO as X, aY as Y, cm as Z, b as _, an as $, aZ as aa, a_ as sa, a$ as ea, cA as ta, b0 as ia, as as na, b1 as oa, bQ as ca, b2 as ra, b3 as la, ct as ua, b4 as pa, b5 as ba, b6 as da, b7 as ya, at as ga, b8 as Va, cB as ma, b9 as Sa, ba as Ca, bb as Pa, bc as ha, bd as Da, be as Aa, au as Ia, ci as Ra, cv as fa, cw as La, bf as Ma, bg as Ta, av as Ba, bh as Ea, bR as Na, bi as wa, bj as Ua, bk as Oa, bS as va, bl as ka, bm as qa, bn as xa, bo as Fa, bT as ja, bp as za, aw as Ja, bq as Ka, br as Ha, cC as Wa, bs as Ga, bt as Qa, bu as Xa, bv as Ya, ax as Za, bw as _a, bx as $a, ay as as, by as ss, c0 as es, cy as ts, bz as is, bA as ns, bB as os, bU as cs, bC as rs, bD as ls, cz as us, bE as ps, bF as bs, cu as ds, bG as ys, bH as gs, bI as Vs, bJ as ms, K as Ss, cc as Cs, cb as Ps, c as hs, L as Ds, cg as As, cf as Is, t as Rs, _ as fs, V as Ls, J as Ms, d as Ts, e as Bs, M as Es, v as Ns, H as ws, x as Us, w as Os, N as vs, f as ks, g as qs, a as xs, y as Fs, z as js, h as zs, j as Js, k as Ks, O as Hs, G as Ws, A as Gs, B as Qs, P as Xs, cp as Ys, co as Zs, l as _s, I as $s, C as ae, m as se, D as ee, E as te, n as ie, o as ne, p as oe, Q as ce, F as re, s as le, q as ue, r as pe, bK as be, ae as de, a7 as ye, ad as ge, af as Ve, ce as me, bW as Se, bZ as Ce, ah as Pe, c5 as he, ag as De, i as Ae, ac as Ie, b_ as Re, cr as fe, aa as Le, bX as Me, bY as Te, b$ as Be, a8 as Ee, ab as Ne, a9 as we, cl as Ue, ak as Oe, cn as ve, aj as ke, a4 as qe, X as xe, cd as Fe, R as je, a3 as ze, T as Je, ch as Ke, W as He, cj as We, c7 as Ge, ai as Qe, c6 as Xe, a6 as Ye, Z as Ze, ck as _e, U as $e, c8 as at, a5 as st, S as et, a0 as tt, a2 as it, cq as nt, a1 as ot, Y as ct, $ as rt } from "./index-brymheD-.js";
2
+ import { az as i, bV as n, cx as o, aA as c, aB as r, aC as l, bM as u, ao as p, c2 as b, c1 as d, c4 as y, c3 as g, al as V, am as m, bL as S, ap as C, aG as P, aH as h, cs as D, cD as A, aI as I, aD as R, aE as f, aF as L, aJ as M, aK as T, aL as B, aq as E, aM as N, ca as w, c9 as U, aN as O, bN as v, ar as k, aO as q, aP as x, aQ as F, aR as j, aS as z, aT as J, aU as K, bP as H, aV as W, aW as G, aX as Q, bO as X, aY as Y, cm as Z, b as _, an as $, aZ as aa, a_ as sa, a$ as ea, cA as ta, b0 as ia, as as na, b1 as oa, bQ as ca, b2 as ra, b3 as la, ct as ua, b4 as pa, b5 as ba, b6 as da, b7 as ya, at as ga, b8 as Va, cB as ma, b9 as Sa, ba as Ca, bb as Pa, bc as ha, bd as Da, be as Aa, au as Ia, ci as Ra, cv as fa, cw as La, bf as Ma, bg as Ta, av as Ba, bh as Ea, bR as Na, bi as wa, bj as Ua, bk as Oa, bS as va, bl as ka, bm as qa, bn as xa, bo as Fa, bT as ja, bp as za, aw as Ja, bq as Ka, br as Ha, cC as Wa, bs as Ga, bt as Qa, bu as Xa, bv as Ya, ax as Za, bw as _a, bx as $a, ay as as, by as ss, c0 as es, cy as ts, bz as is, bA as ns, bB as os, bU as cs, bC as rs, bD as ls, cz as us, bE as ps, bF as bs, cu as ds, bG as ys, bH as gs, bI as Vs, bJ as ms, K as Ss, cc as Cs, cb as Ps, c as hs, L as Ds, cg as As, cf as Is, t as Rs, _ as fs, V as Ls, J as Ms, d as Ts, e as Bs, M as Es, v as Ns, H as ws, x as Us, w as Os, N as vs, f as ks, g as qs, a as xs, y as Fs, z as js, h as zs, j as Js, k as Ks, O as Hs, G as Ws, A as Gs, B as Qs, P as Xs, cp as Ys, co as Zs, l as _s, I as $s, C as ae, m as se, D as ee, E as te, n as ie, o as ne, p as oe, Q as ce, F as re, s as le, q as ue, r as pe, bK as be, ae as de, a7 as ye, ad as ge, af as Ve, ce as me, bW as Se, bZ as Ce, ah as Pe, c5 as he, ag as De, i as Ae, ac as Ie, b_ as Re, cr as fe, aa as Le, bX as Me, bY as Te, b$ as Be, a8 as Ee, ab as Ne, a9 as we, cl as Ue, ak as Oe, cn as ve, aj as ke, a4 as qe, X as xe, cd as Fe, R as je, a3 as ze, T as Je, ch as Ke, W as He, cj as We, c7 as Ge, ai as Qe, c6 as Xe, a6 as Ye, Z as Ze, ck as _e, U as $e, c8 as at, a5 as st, S as et, a0 as tt, a2 as it, cq as nt, a1 as ot, Y as ct, $ as rt } from "./index-BPscLY-3.js";
3
3
  import "vue";
4
4
  export {
5
5
  i as AccountState,
@@ -39270,40 +39270,43 @@ const qSe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty(
39270
39270
  deep: !0
39271
39271
  }
39272
39272
  );
39273
- async function n(a, s) {
39273
+ function n() {
39274
+ const { searchParams: s } = new URL(location.href);
39275
+ return s.get("returnUrl") || s.get("ReturnUrl");
39276
+ }
39277
+ async function r(s, o) {
39274
39278
  try {
39275
- let o = window.location.origin + "/externalsignin?";
39276
- const l = window.location.pathname ?? "/", c = {
39277
- providerType: a
39278
- };
39279
- if (e.value = c, a === null) throw new Error("The parameter 'authenticationType' cannot be null.");
39280
- a !== void 0 && (o += "authenticationType=" + encodeURIComponent("" + a) + "&"), l !== void 0 && (o += "returnUrl=" + encodeURIComponent("" + l) + "&"), o = o.replace(/[?&]$/, ""), window.location.href = o;
39281
- } catch (o) {
39282
- throw console.error(o), o;
39279
+ const l = window.location.origin, c = window.location.pathname ?? n() ?? "/";
39280
+ if (!s)
39281
+ throw new Error("The parameter 'authenticationType' cannot be null or undefined.");
39282
+ const u = new URL("/externalsignin", l);
39283
+ u.searchParams.set("authenticationType", s), u.searchParams.set("returnUrl", c), e.value = { providerType: s }, console.log("url", u), window.location.assign(u);
39284
+ } catch (l) {
39285
+ throw console.error(l), l;
39283
39286
  }
39284
39287
  }
39285
- async function r(a) {
39288
+ async function i(s) {
39286
39289
  try {
39287
- let s = window.location.origin + "/externalsignin/signout?";
39288
- a !== void 0 && (s += "authenticationType=" + encodeURIComponent("" + a) + "&"), window.location.pathname !== void 0 && (s += "returnUrl=" + encodeURIComponent("" + window.location.pathname) + "&"), s = s.replace(/[?&]$/, ""), window.location.href = s, e.value = {};
39289
- } catch (s) {
39290
- throw console.error(s), s;
39290
+ const o = window.location.origin, l = window.location.pathname ?? "/", c = new URL("/externalsignin/signout", o);
39291
+ c.searchParams.set("authenticationType", s), c.searchParams.set("returnUrl", l), e.value = {}, window.location.assign(c);
39292
+ } catch (o) {
39293
+ throw console.error(o), o;
39291
39294
  }
39292
39295
  }
39293
- async function i() {
39294
- let a;
39296
+ async function a() {
39297
+ let s;
39295
39298
  try {
39296
- a = await t.getExternalLoginProviders();
39297
- } catch (s) {
39298
- console.error(s);
39299
+ s = await t.getExternalLoginProviders();
39300
+ } catch (o) {
39301
+ console.error(o);
39299
39302
  }
39300
- return a;
39303
+ return s;
39301
39304
  }
39302
39305
  return {
39303
39306
  storage: e,
39304
- signIn: n,
39305
- signOut: r,
39306
- getProviders: i
39307
+ signIn: r,
39308
+ signOut: i,
39309
+ getProviders: a
39307
39310
  };
39308
39311
  }, qc = re();
39309
39312
  function WSe() {
@@ -60500,7 +60503,7 @@ const D6e = {
60500
60503
  providers: {}
60501
60504
  },
60502
60505
  setup(t) {
60503
- const e = /* @__PURE__ */ Object.assign({ "./azuread.vue": () => import("./azuread-36Jpmrhw.js"), "./external-provider.vue": () => import("./external-provider-C8gSyvJw.js"), "./external-providers.vue": () => import("./external-providers-B0oU_R3n.js") }), n = (r) => {
60506
+ const e = /* @__PURE__ */ Object.assign({ "./azuread.vue": () => import("./azuread-BLZ8u__x.js"), "./external-provider.vue": () => import("./external-provider-BLMlIQHa.js"), "./external-providers.vue": () => import("./external-providers-BXnXf0Vm.js") }), n = (r) => {
60504
60507
  const i = `./${r.toLowerCase()}.vue`, a = e[i];
60505
60508
  return a !== void 0 ? one({
60506
60509
  loader: a,
@@ -1 +1 @@
1
- {"version":3,"file":"useExternalProvider.d.ts","sourceRoot":"","sources":["../../../../shared/components/sign-in/useExternalProvider.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC/B,OAAO,EAAwB,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AAE9F,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,GAAG,CAAC;QAAE,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;KAAE,CAAC,CAAC;IACpD,MAAM,EAAE,CAAC,kBAAkB,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9D,OAAO,EAAE,CAAC,kBAAkB,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,YAAY,EAAE,MAAM,OAAO,CAAC,0BAA0B,EAAE,GAAG,SAAS,CAAC,CAAC;CACvE;AAID,eAAO,MAAM,mBAAmB,QAAO,oBAgFtC,CAAC"}
1
+ {"version":3,"file":"useExternalProvider.d.ts","sourceRoot":"","sources":["../../../../shared/components/sign-in/useExternalProvider.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC/B,OAAO,EAAwB,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AAE9F,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,GAAG,CAAC;QAAE,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;KAAE,CAAC,CAAC;IACpD,MAAM,EAAE,CAAC,kBAAkB,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9D,OAAO,EAAE,CAAC,kBAAkB,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,YAAY,EAAE,MAAM,OAAO,CAAC,0BAA0B,EAAE,GAAG,SAAS,CAAC,CAAC;CACvE;AAID,eAAO,MAAM,mBAAmB,QAAO,oBAuFtC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vc-shell/framework",
3
- "version": "1.0.300",
3
+ "version": "1.0.301",
4
4
  "type": "module",
5
5
  "main": "./dist/framework.js",
6
6
  "types": "./dist/index.d.ts",
@@ -61,9 +61,9 @@
61
61
  "devDependencies": {
62
62
  "@types/dompurify": "^3.0.5",
63
63
  "@types/quill": "^2.0.14",
64
- "@vc-shell/api-client-generator": "^1.0.300",
65
- "@vc-shell/config-generator": "^1.0.300",
66
- "@vc-shell/ts-config": "^1.0.300",
64
+ "@vc-shell/api-client-generator": "^1.0.301",
65
+ "@vc-shell/config-generator": "^1.0.301",
66
+ "@vc-shell/ts-config": "^1.0.301",
67
67
  "@vitejs/plugin-vue": "5.0.3",
68
68
  "cypress-signalr-mock": "^1.5.0",
69
69
  "sass": "^1.69.6",
@@ -29,44 +29,51 @@ export const useExternalProvider = (): IUseExternalProvider => {
29
29
 
30
30
  async function externalSignIn(authenticationType: string, oidcUrl: string) {
31
31
  try {
32
- let url_ = window.location.origin + "/externalsignin?";
33
- const returnUrl = window.location.pathname ?? "/";
32
+ const origin = window.location.origin;
33
+ const finalReturnUrl = window.location.pathname ?? getReturnUrlValue() ?? "/";
34
+
35
+ if (!authenticationType) {
36
+ throw new Error("The parameter 'authenticationType' cannot be null or undefined.");
37
+ }
34
38
 
35
- const signInData = {
36
- providerType: authenticationType,
37
- };
39
+ // const oidcUrlObject = new URL(oidcUrl, origin);
40
+ // const callbackUrl = new URL("/auth/callback", origin);
41
+ const url = new URL("/externalsignin", origin);
38
42
 
39
- externalSignInStorage.value = signInData;
43
+ // Set query parameters
44
+ // callbackUrl.searchParams.set("returnUrl", finalReturnUrl);
45
+ url.searchParams.set("authenticationType", authenticationType);
46
+ // url.searchParams.set("callbackUrl", callbackUrl.href);
47
+ url.searchParams.set("returnUrl", finalReturnUrl);
40
48
 
41
- if (authenticationType === null) throw new Error("The parameter 'authenticationType' cannot be null.");
42
- else {
43
- if (authenticationType !== undefined)
44
- url_ += "authenticationType=" + encodeURIComponent("" + authenticationType) + "&";
45
- if (returnUrl !== undefined) url_ += "returnUrl=" + encodeURIComponent("" + returnUrl) + "&";
46
- }
47
- url_ = url_.replace(/[?&]$/, "");
49
+ // Store sign-in data
50
+ externalSignInStorage.value = { providerType: authenticationType };
48
51
 
49
- window.location.href = url_;
52
+ console.log("url", url);
53
+ // Redirect to the constructed URL
54
+ window.location.assign(url);
50
55
  } catch (e) {
51
56
  console.error(e);
52
-
53
57
  throw e;
54
58
  }
55
59
  }
56
60
 
57
61
  async function externalSignOut(authenticationType: string): Promise<void> {
58
62
  try {
59
- let url_ = window.location.origin + "/externalsignin/signout?";
63
+ const origin = window.location.origin;
64
+ const returnUrl = window.location.pathname ?? "/";
60
65
 
61
- if (authenticationType !== undefined)
62
- url_ += "authenticationType=" + encodeURIComponent("" + authenticationType) + "&";
63
- if (window.location.pathname !== undefined)
64
- url_ += "returnUrl=" + encodeURIComponent("" + window.location.pathname) + "&";
66
+ const url = new URL("/externalsignin/signout", origin);
65
67
 
66
- url_ = url_.replace(/[?&]$/, "");
67
- window.location.href = url_;
68
+ // Set query parameters
69
+ url.searchParams.set("authenticationType", authenticationType);
70
+ url.searchParams.set("returnUrl", returnUrl);
68
71
 
72
+ // Clear sign-in data
69
73
  externalSignInStorage.value = {};
74
+
75
+ // Redirect to the sign-out URL
76
+ window.location.assign(url);
70
77
  } catch (e) {
71
78
  console.error(e);
72
79
  throw e;
@@ -1,4 +0,0 @@
1
- import { b as f } from "./index-brymheD-.js";
2
- export {
3
- f as default
4
- };