@epam/ai-dial-chat-hooks 1.5.0-dev.35 → 1.5.0-dev.36

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.
Files changed (37) hide show
  1. package/external-services/useExternalServiceLogin.js +7 -7
  2. package/external-services.js +3 -3
  3. package/index.js +247 -247
  4. package/oauth/batch-channel.d.ts +42 -0
  5. package/oauth/batch-channel.d.ts.map +1 -0
  6. package/oauth/batch-channel.js +90 -0
  7. package/oauth/handshake.d.ts +59 -2
  8. package/oauth/handshake.d.ts.map +1 -1
  9. package/oauth/handshake.js +204 -35
  10. package/oauth/models.d.ts +90 -1
  11. package/oauth/models.d.ts.map +1 -1
  12. package/oauth/popup.d.ts +35 -1
  13. package/oauth/popup.d.ts.map +1 -1
  14. package/oauth/popup.js +35 -15
  15. package/oauth/redirect-state.d.ts +12 -0
  16. package/oauth/redirect-state.d.ts.map +1 -0
  17. package/oauth/redirect-state.js +20 -0
  18. package/oauth/types.d.ts +41 -2
  19. package/oauth/types.d.ts.map +1 -1
  20. package/oauth/types.js +9 -3
  21. package/oauth/useOAuthCallbackCompletion/useOAuthCallbackCompletion.d.ts +11 -5
  22. package/oauth/useOAuthCallbackCompletion/useOAuthCallbackCompletion.d.ts.map +1 -1
  23. package/oauth/useOAuthCallbackCompletion/useOAuthCallbackCompletion.js +95 -66
  24. package/oauth/useToolsetLogin/useToolsetLogin.d.ts +11 -1
  25. package/oauth/useToolsetLogin/useToolsetLogin.d.ts.map +1 -1
  26. package/oauth/useToolsetLogin/useToolsetLogin.js +96 -45
  27. package/oauth.js +10 -10
  28. package/offline-credentials/useOfflineCredentialsLogin/useOfflineCredentialsLogin.js +5 -5
  29. package/package.json +17 -17
  30. package/signin-interrupt/models.d.ts +25 -1
  31. package/signin-interrupt/models.d.ts.map +1 -1
  32. package/signin-interrupt/types.d.ts +12 -1
  33. package/signin-interrupt/types.d.ts.map +1 -1
  34. package/signin-interrupt/types.js +4 -2
  35. package/signin-interrupt/useSigninInterrupt/useSigninInterrupt.d.ts +29 -5
  36. package/signin-interrupt/useSigninInterrupt/useSigninInterrupt.d.ts.map +1 -1
  37. package/signin-interrupt/useSigninInterrupt/useSigninInterrupt.js +412 -134
@@ -1,6 +1,6 @@
1
1
  import { OAuthResourceKind as e, ToolsetCredentialsLevel as t, ToolsetOAuthInitiationResultType as n, ToolsetOAuthResultType as r } from "../oauth/types.js";
2
- import { waitForToolsetOAuthResult as i } from "../oauth/handshake.js";
3
- import { navigateToolsetOAuthPopup as a, openToolsetOAuthPopup as o } from "../oauth/popup.js";
2
+ import { navigateToolsetOAuthPopup as i, openToolsetOAuthPopup as a } from "../oauth/popup.js";
3
+ import { waitForToolsetOAuthResult as o } from "../oauth/handshake.js";
4
4
  import { OfflineCredentialsLoginOutcomeType as s } from "../offline-credentials/useOfflineCredentialsLogin/useOfflineCredentialsLogin.js";
5
5
  import { buildExternalServiceScopeId as c } from "../shared/external-services.js";
6
6
  import { useCallback as l } from "react";
@@ -15,7 +15,7 @@ var u = /* @__PURE__ */ function(e) {
15
15
  return e.Success = "success", e.Failure = "failure", e.PopupBlocked = "popup-blocked", e.Cancelled = "cancelled", e.AdminConsentRequired = "admin-consent-required", e.OfflineUnavailable = "offline-unavailable", e;
16
16
  }({}), m = (e) => e === "GLOBAL" ? t.Global : t.User, h = ({ callbackPath: t, getExternalService: u, signInExternalService: d, signOutExternalService: f, getOfflineCredentials: p, loginOfflineCredentials: h }) => {
17
17
  let g = l(async ({ appId: e, serviceId: t, popup: n }) => {
18
- let r = n ?? o();
18
+ let r = n ?? a();
19
19
  if (!r) return { type: "popup-blocked" };
20
20
  try {
21
21
  let n = await u(e, t);
@@ -44,13 +44,13 @@ var u = /* @__PURE__ */ function(e) {
44
44
  });
45
45
  } catch {}
46
46
  }, [f]), v = l(async (s) => {
47
- let { appId: l, serviceId: d, credentialsLevel: f, oauthSettings: p, forceStale: h, offlineUsageConsent: g, popup: v } = s, y = c(l, d), b = m(f), x = v ?? o();
47
+ let { appId: l, serviceId: d, credentialsLevel: f, oauthSettings: p, forceStale: h, offlineUsageConsent: g, popup: v } = s, y = c(l, d), b = m(f), x = v ?? a();
48
48
  if (!x) return { type: "popup-blocked" };
49
49
  h && await _(l, d, f, "OAUTH");
50
50
  try {
51
- let o = a(x, p ?? {}, y, t, b, e.ExternalService, g);
52
- if (o.type !== n.Started) return { type: "failure" };
53
- let s = await i(o.popup, o.flowId, {
51
+ let a = i(x, p ?? {}, y, t, b, e.ExternalService, g);
52
+ if (a.type !== n.Started) return { type: "failure" };
53
+ let s = await o(a.popup, a.flowId, {
54
54
  toolsetId: y,
55
55
  credentialsLevel: b,
56
56
  callbackPath: t
@@ -1,5 +1,5 @@
1
1
  import { ExternalServiceAuthStatus as e, ExternalServiceAuthType as t, ExternalServiceCredentialsLevel as n, ExternalServiceLoginOutcomeType as r, useExternalServiceLogin as i } from "./external-services/useExternalServiceLogin.js";
2
2
  import { getSigninEventResourceKey as a, resolveExternalServiceSigninRowInfo as o, resolveToolsetSigninRowInfo as s } from "./signin-interrupt/signin-row-info.js";
3
- import { SigninInterruptAnnouncementKind as c, SigninInterruptRowError as l, SigninInterruptRowStatus as u } from "./signin-interrupt/types.js";
4
- import { useSigninInterrupt as d } from "./signin-interrupt/useSigninInterrupt/useSigninInterrupt.js";
5
- export { e as ExternalServiceAuthStatus, t as ExternalServiceAuthType, n as ExternalServiceCredentialsLevel, r as ExternalServiceLoginOutcomeType, c as SigninInterruptAnnouncementKind, l as SigninInterruptRowError, u as SigninInterruptRowStatus, a as getSigninEventResourceKey, o as resolveExternalServiceSigninRowInfo, s as resolveToolsetSigninRowInfo, i as useExternalServiceLogin, d as useSigninInterrupt };
3
+ import { SigninInterruptAnnouncementKind as c, SigninInterruptRowError as l, SigninInterruptRowStatus as u, SigninInterruptRunPhase as d } from "./signin-interrupt/types.js";
4
+ import { useSigninInterrupt as f } from "./signin-interrupt/useSigninInterrupt/useSigninInterrupt.js";
5
+ export { e as ExternalServiceAuthStatus, t as ExternalServiceAuthType, n as ExternalServiceCredentialsLevel, r as ExternalServiceLoginOutcomeType, c as SigninInterruptAnnouncementKind, l as SigninInterruptRowError, u as SigninInterruptRowStatus, d as SigninInterruptRunPhase, a as getSigninEventResourceKey, o as resolveExternalServiceSigninRowInfo, s as resolveToolsetSigninRowInfo, i as useExternalServiceLogin, f as useSigninInterrupt };