@redocly/replay 0.19.0-next.6 → 0.19.0-next.7

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.
@@ -1,4 +1 @@
1
- "use strict";const s="Something went wrong, please, try again.";function c(e){return e&&e.replace(/=+$/,"")}function l(e,r){return!!e&&!!r&&c(e)===c(r)}function d(e){let r;if(/code|token|error/.test(window.location.hash)?r=window.location.hash.substring(1):r=location.search.substring(1),!r)throw console.error("No query string in OAuth 2 redirect URL"),new Error(s);const o=new URLSearchParams(r),t=o.get("access_token"),n=o.get("code"),i=o.get("token_type"),a=o.get("expires_in"),u=o.get("state"),h=o.get("error"),w=o.get("error_description")||s;if(h)throw new Error(w);if(!l(u,e?.state))throw new Error("Outdated OAuth2 state");if(e?.flow==="implicit"){if(!t)throw new Error(`Your OAuth2 authentication service provider redirected you without an "access_token".
2
- Please, try again or make sure your OAuth2 settings are correct.`);if(!i)throw new Error(`Your OAuth2 authentication service provider redirected you without a "token_type".
3
- Please, try again or make sure your OAuth2 settings are correct.`);e?.successCallback({access_token:t,token_type:i,expires_in:a,auth_code:""})}if(e?.flow==="authorizationCode"){if(!n)throw new Error(`Your OAuth2 authentication service provider redirected you without authorization "code".
4
- Please, try again or make sure your OAuth2 settings are correct.`);e?.successCallback({auth_code:n,access_token:"",token_type:"bearer"})}}function g(){const e=window.opener?.redirectOAuth2;try{d(e)}catch(r){e?.errorCallback(r)}window.close()}window.onload=g;
1
+ "use strict";const o=require("./replay-oauth2-redirect-handler-Bqw5UUvl.js");function t(){const e=window.opener?.redirectOAuth2;try{o.handleOAuth2Redirect(e)}catch(r){e?.errorCallback(r)}window.close()}window.onload=t;
@@ -1,57 +1,11 @@
1
- const s = "Something went wrong, please, try again.";
2
- function c(e) {
3
- return e && e.replace(/=+$/, "");
4
- }
5
- function l(e, r) {
6
- return !!e && !!r && c(e) === c(r);
7
- }
8
- function d(e) {
9
- let r;
10
- if (/code|token|error/.test(window.location.hash) ? r = window.location.hash.substring(1) : r = location.search.substring(1), !r)
11
- throw console.error("No query string in OAuth 2 redirect URL"), new Error(s);
12
- const o = new URLSearchParams(r), t = o.get("access_token"), n = o.get("code"), i = o.get("token_type"), a = o.get("expires_in"), u = o.get("state"), h = o.get("error"), w = o.get("error_description") || s;
13
- if (h)
14
- throw new Error(w);
15
- if (!l(u, e?.state))
16
- throw new Error("Outdated OAuth2 state");
17
- if (e?.flow === "implicit") {
18
- if (!t)
19
- throw new Error(
20
- `Your OAuth2 authentication service provider redirected you without an "access_token".
21
- Please, try again or make sure your OAuth2 settings are correct.`
22
- );
23
- if (!i)
24
- throw new Error(
25
- `Your OAuth2 authentication service provider redirected you without a "token_type".
26
- Please, try again or make sure your OAuth2 settings are correct.`
27
- );
28
- e?.successCallback({
29
- access_token: t,
30
- token_type: i,
31
- expires_in: a,
32
- auth_code: ""
33
- });
34
- }
35
- if (e?.flow === "authorizationCode") {
36
- if (!n)
37
- throw new Error(
38
- `Your OAuth2 authentication service provider redirected you without authorization "code".
39
- Please, try again or make sure your OAuth2 settings are correct.`
40
- );
41
- e?.successCallback({
42
- auth_code: n,
43
- access_token: "",
44
- token_type: "bearer"
45
- });
46
- }
47
- }
48
- function g() {
49
- const e = window.opener?.redirectOAuth2;
1
+ import { h as e } from "./replay-oauth2-redirect-handler-CqKZB3aV.js";
2
+ function n() {
3
+ const r = window.opener?.redirectOAuth2;
50
4
  try {
51
- d(e);
52
- } catch (r) {
53
- e?.errorCallback(r);
5
+ e(r);
6
+ } catch (o) {
7
+ r?.errorCallback(o);
54
8
  }
55
9
  window.close();
56
10
  }
57
- window.onload = g;
11
+ window.onload = n;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./replay-index-CXcBKtqt.js");async function n(e={}){return typeof e=="object"&&Object.freeze(e),await t.invoke("plugin:dialog|open",{options:e})}exports.open=n;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./replay-index-C8pDALOS.js");async function n(e={}){return typeof e=="object"&&Object.freeze(e),await t.invoke("plugin:dialog|open",{options:e})}exports.open=n;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./replay-index-C8pDALOS.js");async function r(e,n){await o.invoke("plugin:opener|open_url",{url:e,with:n})}exports.openUrl=r;