@epam/ai-dial-chat-hooks 1.1.0-dev.423 → 1.1.0-dev.426
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/{api-error-DuLNy43N.js → api-error/api-error.js} +1 -1
- package/api-transport/create-csrf-middleware.js +21 -0
- package/api-transport/create-unauthorized-middleware.js +41 -0
- package/attachment/useAttachmentAction/useAttachmentAction.js +74 -0
- package/attachment/useAttachmentValidation/useAttachmentValidation.js +35 -0
- package/attachments.js +3 -2
- package/catalog/catalog-derivations.js +10 -0
- package/catalog/catalog-primary-action.js +21 -0
- package/catalog/create-publish-api.js +27 -0
- package/catalog/deployment-endpoint-url.js +34 -0
- package/{deployment-id-CxWgJTs9.js → catalog/deployment-id.js} +1 -1
- package/catalog/entity-details.js +6 -0
- package/catalog/map-deployment-limits-to-catalog.js +73 -0
- package/catalog/map-deployment-limits-to-input.js +14 -0
- package/catalog/map-deployment-to-catalog-item.js +92 -0
- package/catalog/map-entity-details-to-catalog.js +350 -0
- package/catalog/map-prompt-to-catalog-item.js +49 -0
- package/catalog/map-skill-to-catalog-item.js +123 -0
- package/catalog/mcp-endpoint-url.js +26 -0
- package/catalog/publish.js +18 -0
- package/catalog/useCatalogEditNavigation/useCatalogEditNavigation.js +109 -0
- package/catalog/useCatalogItemDetails.js +101 -0
- package/catalog/useCatalogToolsetCredentials/useCatalogToolsetCredentials.js +146 -0
- package/catalog/useFavoriteEntitiesState/useFavoriteEntitiesState.js +50 -0
- package/catalog/usePublishFolders/usePublishFolders.js +72 -0
- package/catalog.js +22 -3
- package/conversation/announcement-message.js +42 -0
- package/conversation/conversation-transfer/async.js +18 -0
- package/conversation/conversation-transfer/attachment-refs.js +11 -0
- package/conversation/conversation-transfer/build-upload-path.js +27 -0
- package/{date-BeuD8G79.js → conversation/conversation-transfer/date.js} +1 -1
- package/conversation/conversation-transfer/dial-file-resolve.js +18 -0
- package/conversation/conversation-transfer/export-conversation.js +32 -0
- package/conversation/conversation-transfer/import-conversation.js +93 -0
- package/conversation/conversation-transfer/progress.js +39 -0
- package/conversation/conversation-transfer/queue.js +84 -0
- package/conversation/conversation-transfer/types.js +9 -0
- package/conversation/conversation-transfer/zip-export.js +19 -0
- package/conversation/conversation-transfer/zip-import.js +29 -0
- package/conversation/create-chat-stream-api.js +96 -0
- package/conversation/deriveConversationRowActionState/deriveConversationRowActionState.js +14 -0
- package/conversation/display-name-watch.js +5 -0
- package/conversation/footer-message.js +23 -0
- package/conversation/get-model-id-from-conversation-id.js +14 -0
- package/conversation/greeting.js +7 -0
- package/conversation/message-factory.js +19 -0
- package/conversation/message-utils.js +13 -0
- package/conversation/overlay-messages.js +8 -0
- package/conversation/quick-app-conversation-starters.js +29 -0
- package/conversation/starter-option.js +27 -0
- package/conversation/useActiveConversationSync/useActiveConversationSync.js +19 -0
- package/conversation/useAsyncConfirmDialog/useAsyncConfirmDialog.js +39 -0
- package/conversation/useAttachmentUpload/useAttachmentUpload.js +33 -0
- package/conversation/useConversationExport/useConversationExport.js +285 -0
- package/conversation/useConversationHandlers/attachment-to-dto.js +13 -0
- package/conversation/useConversationHandlers/message-factory.js +21 -0
- package/conversation/useConversationHandlers/message-utils.js +8 -0
- package/conversation/useConversationHandlers/starter-option.js +11 -0
- package/conversation/useConversationHandlers/useConversationHandlers.js +263 -0
- package/conversation/useConversationImport/useConversationImport.js +239 -0
- package/conversation/useConversationLookupMaps/useConversationLookupMaps.js +11 -0
- package/conversation/useConversationPanelItems/useConversationPanelItems.js +35 -0
- package/{useConversationScroll-CliIMnjP.js → conversation/useConversationScroll/useConversationScroll.js} +1 -1
- package/conversation/useConversationStream/apply-chunk.js +78 -0
- package/conversation/useConversationStream/buffered-generation.js +18 -0
- package/conversation/useConversationStream/conversation-path.js +8 -0
- package/conversation/useConversationStream/generation-resume.js +126 -0
- package/conversation/useConversationStream/useConversationStream.js +148 -0
- package/conversation/useImportFilePicker/useImportFilePicker.js +20 -0
- package/conversation/useTranscribeAudio/audio-transcription-error.js +12 -0
- package/conversation/useTranscribeAudio/transcription-retry.js +38 -0
- package/conversation/useTranscribeAudio/useTranscribeAudio.js +41 -0
- package/{useConversationSources-DKaKvjXZ.js → conversation-sources/useConversationSources/useConversationSources.js} +1 -1
- package/conversation-sources.js +1 -1
- package/conversation-transfer.js +7 -3
- package/conversation.d.ts +66 -0
- package/conversation.js +31 -2
- package/file-manager.d.ts +3 -4
- package/file-manager.js +28 -3
- package/files/annotation.js +15 -0
- package/files/attachment-canvas.js +218 -0
- package/files/attachment-dto-to-display.js +15 -0
- package/files/attachment-types.js +16 -0
- package/files/create-files-api.js +40 -0
- package/files/create-upload-file-with-progress.js +42 -0
- package/files/dial-file-manager-copy-move.util.js +55 -0
- package/files/dial-file-manager-mapping.util.js +140 -0
- package/files/dial-file-manager-path.util.js +72 -0
- package/files/dial-file-manager.model.js +25 -0
- package/files/dial-file-manager.types.js +10 -0
- package/files/dial-file-to-attachment.js +37 -0
- package/files/dial-file.js +30 -0
- package/files/dial-files-api.js +6 -0
- package/files/download-destination.js +6 -0
- package/files/file-manager-variant.js +11 -0
- package/files/file-name.js +19 -0
- package/files/prepare-download-destination.js +24 -0
- package/files/resolve-dial-file-api-path.js +33 -0
- package/files/source-content.js +37 -0
- package/files/useDialFileListing/useDialFileListing.js +295 -0
- package/files/useDialFileManager/useDialFileManager.js +146 -0
- package/files/useDialFileManagerTabConfig/useDialFileManagerTabConfig.js +23 -0
- package/files/useDialFileMetadata/useDialFileMetadata.js +42 -0
- package/files/useDialFileMutations/useDialFileMutations.js +359 -0
- package/files/useDialFileSharing/useDialFileSharing.js +70 -0
- package/files/useDialFileUploadBatch/useDialFileUploadBatch.js +156 -0
- package/index.d.ts +69 -4
- package/index.js +134 -28
- package/mcp-apps/mcp-apps-api-client.js +48 -0
- package/mcp-apps/useMcpAppHostAdapter/useMcpAppHostAdapter.js +26 -0
- package/mcp-apps/useMcpAppHostContext/useMcpAppHostContext.js +26 -0
- package/mcp-apps/useMcpAppTools/useMcpAppTools.js +71 -0
- package/mcp-apps/useOpenMcpAppCanvas/useOpenMcpAppCanvas.js +58 -0
- package/mcp-apps.js +6 -2
- package/oauth/authorize-url.js +12 -0
- package/oauth/handshake.js +65 -0
- package/oauth/popup.js +29 -0
- package/oauth/toolset-id.js +10 -0
- package/oauth/types.js +24 -0
- package/oauth/useOAuthCallbackCompletion/useOAuthCallbackCompletion.js +94 -0
- package/oauth/useToolsetLogin/useToolsetLogin.js +73 -0
- package/oauth.js +9 -3
- package/package.json +35 -23
- package/prompt/export-prompt.js +28 -0
- package/prompt/prompt-resource.js +15 -0
- package/prompt/prompt.js +12 -0
- package/prompt/usePromptsState/usePromptsState.js +42 -0
- package/scheduled-task/scheduled-task-mapping.js +6 -0
- package/{scheduled-task-trigger-D9RZCk52.js → scheduled-task/scheduled-task-trigger.js} +39 -40
- package/scheduled-tasks.js +3 -2
- package/scroll-anchoring.js +1 -1
- package/shared/application-schema.js +4 -0
- package/shared/browser-timezone.js +10 -0
- package/{cron-weekday-B4w29eAC.js → shared/cron-weekday.js} +1 -1
- package/shared/custom-apps.js +30 -0
- package/shared/external-services.js +18 -0
- package/{formatting-CZyyxBG3.js → shared/formatting.js} +1 -1
- package/{prompt-resource-Bt1I-8ri.js → shared/locale.js} +2 -13
- package/{string-utils-iBi2Y55C.js → shared/string-utils.js} +1 -1
- package/shared/toolset-login-events.js +13 -0
- package/sharing.js +3 -3
- package/skill/skill-file-batch-validation.js +48 -0
- package/skill/skill-file-preview.js +15 -0
- package/skill/skill-manifest.js +70 -0
- package/skill/skill-types.js +15 -0
- package/skill/skill.js +48 -0
- package/skill/useSkillEditorLoad.js +103 -0
- package/skill/useSkillEditorSubmit.js +135 -0
- package/skill/useSkillFileActions.js +99 -0
- package/skill/useSkillFilePreview.js +29 -0
- package/{useSkillsState-BoLlwmzb.js → skill/useSkillsState/useSkillsState.js} +1 -1
- package/skill-editor.js +8 -3
- package/skills-state.js +1 -1
- package/source-content.d.ts +29 -0
- package/source-content.js +2 -0
- package/usage/useUsageData/useUsageData.js +32 -0
- package/useChatSettingsFormConfig/useChatSettingsFormConfig.js +74 -0
- package/{usePanelMaxWidth-BEZYuqF9.js → usePageFileDrag/usePageFileDrag.js} +1 -11
- package/usePanelMaxWidth/usePanelMaxWidth.js +8 -0
- package/{useShareLink-xkiaxATt.js → useShareLink/useShareLink.js} +1 -1
- package/{useShareRecipientsCount-BgwCLKY0.js → useShareRecipientsCount/useShareRecipientsCount.js} +1 -1
- package/useToolsMenu/useToolsMenu.js +50 -0
- package/useViewportWidth/useViewportWidth.js +12 -0
- package/utils.js +17 -7
- package/viewport-layout.js +4 -2
- package/attachment-types-AAoN9E95.js +0 -7760
- package/browser-Btsa0Lmr.js +0 -607
- package/skill-manifest-CeG6-WSK.js +0 -4056
- package/useAttachmentValidation-CkMTd5lA.js +0 -102
- package/useConversationImport-CDRs7JF1.js +0 -826
- package/useDialFileManagerTabConfig-CjI46lMo.js +0 -2291
- package/useOAuthCallbackCompletion-CvyTKLER.js +0 -93
- package/useOpenMcpAppCanvas-C7-AMseH.js +0 -207
- package/useSkillFileActions-B-VaGD20.js +0 -373
- package/useSkillFilePreview-B5o1n_0F.js +0 -1244
- package/useToolsMenu-zURpMEn1.js +0 -1882
- package/useToolsetLogin-B05m134e.js +0 -195
- package/useUsageData-D7BxloKZ.js +0 -201
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { TOOLSET_REDIRECT_STATE_KEY as e, ToolsetCredentialsLevel as t, ToolsetOAuthCallbackQuery as n, ToolsetOAuthChannelControlType as r, ToolsetOAuthFailureReason as i, ToolsetOAuthResultType as a } from "../types.js";
|
|
2
|
+
import { getToolsetOAuthChannelName as o } from "../handshake.js";
|
|
3
|
+
import { useEffect as s, useRef as c, useState as l } from "react";
|
|
4
|
+
//#region src/oauth/useOAuthCallbackCompletion/useOAuthCallbackCompletion.ts
|
|
5
|
+
var u = 500, d = (e) => typeof e == "object" && !!e && "type" in e && e.type === r.ResultAcknowledged, f = () => {
|
|
6
|
+
let t = sessionStorage.getItem(e);
|
|
7
|
+
if (!t) return null;
|
|
8
|
+
try {
|
|
9
|
+
return JSON.parse(t);
|
|
10
|
+
} catch {
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
}, p = (e) => {
|
|
14
|
+
try {
|
|
15
|
+
window.history.replaceState({}, document.title, `${e.pathname}${e.search}`);
|
|
16
|
+
} catch {}
|
|
17
|
+
}, m = (e, t) => {
|
|
18
|
+
let r = new URL(window.location.pathname, window.location.origin);
|
|
19
|
+
if (r.searchParams.set(n.Result, t.type), t.type === a.Failure && r.searchParams.set(n.FailureReason, t.reason), p(r), !e) {
|
|
20
|
+
window.close();
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
try {
|
|
24
|
+
let n = new BroadcastChannel(o(e));
|
|
25
|
+
n.postMessage(t);
|
|
26
|
+
let r = setInterval(() => {
|
|
27
|
+
n.postMessage(t);
|
|
28
|
+
}, u);
|
|
29
|
+
n.onmessage = (e) => {
|
|
30
|
+
d(e.data) && (clearInterval(r), n.close(), window.close());
|
|
31
|
+
};
|
|
32
|
+
} catch {}
|
|
33
|
+
}, h = ({ searchParams: n, callbackPath: r, exchange: o }) => {
|
|
34
|
+
let [u, d] = l(!0), [h, g] = l(null), _ = c(!1), v = c(o);
|
|
35
|
+
v.current = o;
|
|
36
|
+
let y = c(r);
|
|
37
|
+
return y.current = r, s(() => {
|
|
38
|
+
if (_.current) return;
|
|
39
|
+
_.current = !0;
|
|
40
|
+
let r = (e, t) => {
|
|
41
|
+
m(e, t), d(!1), g(t.type === a.Failure ? t.reason : null);
|
|
42
|
+
};
|
|
43
|
+
(async () => {
|
|
44
|
+
let o = n.get("code"), s = n.get("state"), c = f();
|
|
45
|
+
sessionStorage.removeItem(e);
|
|
46
|
+
let l = c?.state ?? s ?? void 0;
|
|
47
|
+
if (p(new URL(window.location.pathname, window.location.origin)), !o || !c?.toolsetId) {
|
|
48
|
+
r(l, {
|
|
49
|
+
type: a.Failure,
|
|
50
|
+
reason: c?.toolsetId ? i.MissingCode : i.MissingRedirectState
|
|
51
|
+
});
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
if (c.state != null && c.state !== s) {
|
|
55
|
+
r(l, {
|
|
56
|
+
type: a.Failure,
|
|
57
|
+
reason: i.StateMismatch
|
|
58
|
+
});
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
let u = c.credentialsLevel ?? t.User, d = c.redirectUri ?? `${window.location.origin}${y.current}`;
|
|
62
|
+
try {
|
|
63
|
+
let e = await v.current({
|
|
64
|
+
code: o,
|
|
65
|
+
redirectUri: d,
|
|
66
|
+
credentialsLevel: u,
|
|
67
|
+
redirectState: c
|
|
68
|
+
});
|
|
69
|
+
if (e != null) {
|
|
70
|
+
r(l, {
|
|
71
|
+
type: a.Failure,
|
|
72
|
+
reason: e
|
|
73
|
+
});
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
r(l, {
|
|
77
|
+
type: a.Success,
|
|
78
|
+
toolsetId: c.toolsetId,
|
|
79
|
+
credentialsLevel: u
|
|
80
|
+
});
|
|
81
|
+
} catch {
|
|
82
|
+
r(l, {
|
|
83
|
+
type: a.Failure,
|
|
84
|
+
reason: i.LoginRequestFailed
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
})();
|
|
88
|
+
}, [n]), {
|
|
89
|
+
isInProgress: u,
|
|
90
|
+
failureReason: h
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
//#endregion
|
|
94
|
+
export { h as useOAuthCallbackCompletion };
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { OAuthResourceKind as e, ToolsetAuthStatus as t, ToolsetAuthTypes as n, ToolsetCredentialsLevel as r, ToolsetOAuthInitiationResultType as i, ToolsetOAuthResultType as a } from "../types.js";
|
|
2
|
+
import { emitToolsetLoginSuccess as o } from "../../shared/toolset-login-events.js";
|
|
3
|
+
import { waitForToolsetOAuthResult as s } from "../handshake.js";
|
|
4
|
+
import { initiateOAuthLogin as c, navigateToolsetOAuthPopup as l, openToolsetOAuthPopup as u } from "../popup.js";
|
|
5
|
+
import { useCallback as d } from "react";
|
|
6
|
+
//#region src/oauth/useToolsetLogin/useToolsetLogin.ts
|
|
7
|
+
var f = /* @__PURE__ */ function(e) {
|
|
8
|
+
return e.Success = "success", e.Failure = "failure", e.PopupBlocked = "popup-blocked", e.Cancelled = "cancelled", e;
|
|
9
|
+
}({}), p = ({ callbackPath: f, loginToolset: p, logoutToolset: m, getToolset: h }) => {
|
|
10
|
+
let g = d(async (e, t, n) => {
|
|
11
|
+
try {
|
|
12
|
+
await m(e, {
|
|
13
|
+
url: e,
|
|
14
|
+
credentialsLevel: t,
|
|
15
|
+
authenticationType: n
|
|
16
|
+
});
|
|
17
|
+
} catch {}
|
|
18
|
+
}, [m]), _ = d(async (d) => {
|
|
19
|
+
let { toolsetId: p, credentialsLevel: m, oauthSettings: _, forceStale: v, offlineUsageConsent: y } = d, b = {
|
|
20
|
+
clientId: _?.clientId,
|
|
21
|
+
authorizationEndpoint: _?.authorizationEndpoint,
|
|
22
|
+
scopes: _?.scopes,
|
|
23
|
+
codeChallenge: _?.codeChallenge,
|
|
24
|
+
codeChallengeMethod: _?.codeChallengeMethod
|
|
25
|
+
}, x = v ? await (async () => {
|
|
26
|
+
let t = u();
|
|
27
|
+
return t ? (await g(p, m, n.OAuth), l(t, b, p, f, m, e.Toolset, y)) : { type: i.Blocked };
|
|
28
|
+
})() : c(b, p, f, m, y);
|
|
29
|
+
if (x.type === i.Blocked) return { type: "popup-blocked" };
|
|
30
|
+
if (x.type !== i.Started) return { type: "failure" };
|
|
31
|
+
let S = await s(x.popup, x.flowId, {
|
|
32
|
+
toolsetId: p,
|
|
33
|
+
credentialsLevel: m,
|
|
34
|
+
callbackPath: f
|
|
35
|
+
});
|
|
36
|
+
if (S.type === a.Success) return o({
|
|
37
|
+
toolsetId: p,
|
|
38
|
+
credentialsLevel: m
|
|
39
|
+
}), { type: "success" };
|
|
40
|
+
if (S.type === a.Failure) return { type: "failure" };
|
|
41
|
+
try {
|
|
42
|
+
let e = await h(p);
|
|
43
|
+
if ((m === r.User ? e.authSettings?.userLevelAuthStatus : e.authSettings?.globalAuthStatus) === t.SignedIn) return o({
|
|
44
|
+
toolsetId: p,
|
|
45
|
+
credentialsLevel: m
|
|
46
|
+
}), { type: "success" };
|
|
47
|
+
} catch {}
|
|
48
|
+
return { type: "cancelled" };
|
|
49
|
+
}, [
|
|
50
|
+
f,
|
|
51
|
+
h,
|
|
52
|
+
g
|
|
53
|
+
]), v = d(async (e) => {
|
|
54
|
+
let { toolsetId: t, credentialsLevel: n, authenticationType: r, apiKey: i, isCurrentlyFailed: a, forceStale: s, offlineUsageConsent: c } = e;
|
|
55
|
+
try {
|
|
56
|
+
return (s || a) && await g(t, n, r), await p(t, {
|
|
57
|
+
url: t,
|
|
58
|
+
credentialsLevel: n,
|
|
59
|
+
authenticationType: r,
|
|
60
|
+
apiKey: i?.trim(),
|
|
61
|
+
offlineUsageConsent: c
|
|
62
|
+
}), o({
|
|
63
|
+
toolsetId: t,
|
|
64
|
+
credentialsLevel: n
|
|
65
|
+
}), { type: "success" };
|
|
66
|
+
} catch {
|
|
67
|
+
return { type: "failure" };
|
|
68
|
+
}
|
|
69
|
+
}, [p, g]);
|
|
70
|
+
return { login: d((e) => e.authenticationType === n.OAuth ? _(e) : v(e), [_, v]) };
|
|
71
|
+
};
|
|
72
|
+
//#endregion
|
|
73
|
+
export { f as ToolsetLoginOutcomeType, p as useToolsetLogin };
|
package/oauth.js
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { decodeToolsetId as e, encodeToolsetId as t, isPublicToolsetId as n } from "./oauth/toolset-id.js";
|
|
2
|
+
import { OAuthResourceKind as r, TOOLSET_REDIRECT_STATE_KEY as i, ToolsetAuthStatus as a, ToolsetAuthTypes as o, ToolsetCredentialsLevel as s, ToolsetOAuthCallbackQuery as c, ToolsetOAuthChannelControlType as l, ToolsetOAuthFailureReason as u, ToolsetOAuthInitiationResultType as d, ToolsetOAuthResultType as f, WithLogin as p } from "./oauth/types.js";
|
|
3
|
+
import { emitToolsetLoginSuccess as m, subscribeToolsetLoginSuccess as h } from "./shared/toolset-login-events.js";
|
|
4
|
+
import { getToolsetOAuthChannelName as g, waitForToolsetOAuthResult as _ } from "./oauth/handshake.js";
|
|
5
|
+
import { buildToolsetAuthorizeUrl as v, getToolsetRedirectUri as y } from "./oauth/authorize-url.js";
|
|
6
|
+
import { initiateOAuthLogin as b, navigateToolsetOAuthPopup as x, openToolsetOAuthPopup as S } from "./oauth/popup.js";
|
|
7
|
+
import { ToolsetLoginOutcomeType as C, useToolsetLogin as w } from "./oauth/useToolsetLogin/useToolsetLogin.js";
|
|
8
|
+
import { useOAuthCallbackCompletion as T } from "./oauth/useOAuthCallbackCompletion/useOAuthCallbackCompletion.js";
|
|
9
|
+
export { r as OAuthResourceKind, i as TOOLSET_REDIRECT_STATE_KEY, a as ToolsetAuthStatus, o as ToolsetAuthTypes, s as ToolsetCredentialsLevel, C as ToolsetLoginOutcomeType, c as ToolsetOAuthCallbackQuery, l as ToolsetOAuthChannelControlType, u as ToolsetOAuthFailureReason, d as ToolsetOAuthInitiationResultType, f as ToolsetOAuthResultType, p as WithLogin, v as buildToolsetAuthorizeUrl, e as decodeToolsetId, m as emitToolsetLoginSuccess, t as encodeToolsetId, g as getToolsetOAuthChannelName, y as getToolsetRedirectUri, b as initiateOAuthLogin, n as isPublicToolsetId, x as navigateToolsetOAuthPopup, S as openToolsetOAuthPopup, h as subscribeToolsetLoginSuccess, T as useOAuthCallbackCompletion, w as useToolsetLogin, _ as waitForToolsetOAuthResult };
|
package/package.json
CHANGED
|
@@ -1,16 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@epam/ai-dial-chat-hooks",
|
|
3
3
|
"description": "Framework-level React hooks extracted from AI DIAL Chat for building custom chat interfaces",
|
|
4
|
-
"version": "1.1.0-dev.
|
|
4
|
+
"version": "1.1.0-dev.426",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
|
-
"sideEffects": [
|
|
8
|
-
"./index.js",
|
|
9
|
-
"./oauth.js",
|
|
10
|
-
"./file-manager.js",
|
|
11
|
-
"./useToolsetLogin-*.js",
|
|
12
|
-
"./useDialFileManagerTabConfig-*.js"
|
|
13
|
-
],
|
|
14
7
|
"main": "./index.js",
|
|
15
8
|
"module": "./index.js",
|
|
16
9
|
"types": "./index.d.ts",
|
|
@@ -51,6 +44,11 @@
|
|
|
51
44
|
"import": "./file-manager.js",
|
|
52
45
|
"default": "./file-manager.js"
|
|
53
46
|
},
|
|
47
|
+
"./source-content": {
|
|
48
|
+
"types": "./source-content.d.ts",
|
|
49
|
+
"import": "./source-content.js",
|
|
50
|
+
"default": "./source-content.js"
|
|
51
|
+
},
|
|
54
52
|
"./catalog": {
|
|
55
53
|
"types": "./catalog.d.ts",
|
|
56
54
|
"import": "./catalog.js",
|
|
@@ -97,26 +95,34 @@
|
|
|
97
95
|
"default": "./mcp-apps.js"
|
|
98
96
|
}
|
|
99
97
|
},
|
|
98
|
+
"dependencies": {
|
|
99
|
+
"dompurify": "3.4.13",
|
|
100
|
+
"fflate": "^0.8.3",
|
|
101
|
+
"lru-cache": "^10.4.3",
|
|
102
|
+
"mime-types": "^3.0.2",
|
|
103
|
+
"yaml": "^2.9.0"
|
|
104
|
+
},
|
|
100
105
|
"peerDependencies": {
|
|
101
106
|
"react": "^19.2.6",
|
|
102
|
-
"@epam/ai-dial-attachment-canvas": "1.1.0-dev.
|
|
103
|
-
"@epam/ai-dial-attachment-input": "1.1.0-dev.
|
|
104
|
-
"@epam/ai-dial-catalog": "1.1.0-dev.
|
|
105
|
-
"@epam/ai-dial-chat-api-client": "1.1.0-dev.
|
|
106
|
-
"@epam/ai-dial-chat-overlay": "1.1.0-dev.
|
|
107
|
-
"@epam/ai-dial-chat-shared": "1.1.0-dev.
|
|
108
|
-
"@epam/ai-dial-deployment-creation-form": "1.1.0-dev.
|
|
109
|
-
"@epam/ai-dial-mcp-apps": "1.1.0-dev.
|
|
110
|
-
"@epam/ai-dial-publish-panel": "1.1.0-dev.
|
|
111
|
-
"@epam/ai-dial-quotations": "1.1.0-dev.
|
|
107
|
+
"@epam/ai-dial-attachment-canvas": "1.1.0-dev.426",
|
|
108
|
+
"@epam/ai-dial-attachment-input": "1.1.0-dev.426",
|
|
109
|
+
"@epam/ai-dial-catalog": "1.1.0-dev.426",
|
|
110
|
+
"@epam/ai-dial-chat-api-client": "1.1.0-dev.426",
|
|
111
|
+
"@epam/ai-dial-chat-overlay": "1.1.0-dev.426",
|
|
112
|
+
"@epam/ai-dial-chat-shared": "1.1.0-dev.426",
|
|
113
|
+
"@epam/ai-dial-deployment-creation-form": "1.1.0-dev.426",
|
|
114
|
+
"@epam/ai-dial-mcp-apps": "1.1.0-dev.426",
|
|
115
|
+
"@epam/ai-dial-publish-panel": "1.1.0-dev.426",
|
|
116
|
+
"@epam/ai-dial-quotations": "1.1.0-dev.426",
|
|
112
117
|
"@epam/ai-dial-react-file-manager": "*",
|
|
113
|
-
"@epam/ai-dial-scheduled-tasks": "1.1.0-dev.
|
|
114
|
-
"@epam/ai-dial-share": "1.1.0-dev.
|
|
115
|
-
"@epam/ai-dial-skill-editor": "1.1.0-dev.
|
|
116
|
-
"@epam/ai-dial-source-panel": "1.1.0-dev.
|
|
118
|
+
"@epam/ai-dial-scheduled-tasks": "1.1.0-dev.426",
|
|
119
|
+
"@epam/ai-dial-share": "1.1.0-dev.426",
|
|
120
|
+
"@epam/ai-dial-skill-editor": "1.1.0-dev.426",
|
|
121
|
+
"@epam/ai-dial-source-panel": "1.1.0-dev.426",
|
|
117
122
|
"@epam/ai-dial-ui-kit": "*",
|
|
118
123
|
"@modelcontextprotocol/sdk": "^1.27.1",
|
|
119
|
-
"@epam/pdf-highlighter-kit": ">=0.0.14"
|
|
124
|
+
"@epam/pdf-highlighter-kit": ">=0.0.14",
|
|
125
|
+
"@mcp-ui/client": "^7.1.1"
|
|
120
126
|
},
|
|
121
127
|
"peerDependenciesMeta": {
|
|
122
128
|
"@epam/ai-dial-attachment-canvas": {
|
|
@@ -177,6 +183,12 @@
|
|
|
177
183
|
"optional": true
|
|
178
184
|
}
|
|
179
185
|
},
|
|
186
|
+
"sideEffects": [
|
|
187
|
+
"./oauth.js",
|
|
188
|
+
"./file-manager.js",
|
|
189
|
+
"./shared/toolset-login-events.js",
|
|
190
|
+
"./files/attachment-canvas.js"
|
|
191
|
+
],
|
|
180
192
|
"repository": {
|
|
181
193
|
"type": "git",
|
|
182
194
|
"url": "git+https://github.com/epam/ai-dial-chat.git",
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { formatDateYMD as e } from "../conversation/conversation-transfer/date.js";
|
|
2
|
+
//#region src/prompt/export-prompt.ts
|
|
3
|
+
var t = (e) => {
|
|
4
|
+
let t = e.split("/").filter(Boolean);
|
|
5
|
+
return t.map((e, n) => {
|
|
6
|
+
let r = t.slice(0, n).join("/");
|
|
7
|
+
return {
|
|
8
|
+
id: t.slice(0, n + 1).join("/"),
|
|
9
|
+
name: e,
|
|
10
|
+
...r ? { folderId: r } : void 0
|
|
11
|
+
};
|
|
12
|
+
});
|
|
13
|
+
}, n = (e) => ({
|
|
14
|
+
version: 5,
|
|
15
|
+
prompts: [{
|
|
16
|
+
id: e.id,
|
|
17
|
+
name: e.name,
|
|
18
|
+
description: e.description ?? "",
|
|
19
|
+
content: e.content,
|
|
20
|
+
...e.folderId ? { folderId: e.folderId } : void 0
|
|
21
|
+
}],
|
|
22
|
+
folders: t(e.folderId)
|
|
23
|
+
}), r = (e) => new Blob([JSON.stringify(e, null, 2)], { type: "application/json" }), i = /[^a-zA-Z0-9._-]+/g, a = (t, n, r = /* @__PURE__ */ new Date()) => {
|
|
24
|
+
let a = t.replace(i, "_");
|
|
25
|
+
return `${e(r)}_${n}_prompt_${a}.json`;
|
|
26
|
+
};
|
|
27
|
+
//#endregion
|
|
28
|
+
export { n as buildPromptExportEnvelope, a as buildPromptExportFileName, r as serializePromptExport };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//#region src/prompt/prompt-resource.ts
|
|
2
|
+
var e = /* @__PURE__ */ function(e) {
|
|
3
|
+
return e.Personal = "personal", e.SharedWithMe = "sharedWithMe", e.Public = "public", e;
|
|
4
|
+
}({}), t = "prompts/", n = (e) => {
|
|
5
|
+
if (!e.startsWith(t)) return null;
|
|
6
|
+
let n = e.slice(8), r = n.indexOf("/");
|
|
7
|
+
if (r <= 0) return null;
|
|
8
|
+
let i = n.slice(0, r), a = n.slice(r + 1);
|
|
9
|
+
return i === "" || a === "" ? null : {
|
|
10
|
+
bucket: i,
|
|
11
|
+
path: a
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
//#endregion
|
|
15
|
+
export { e as PromptSource, n as parsePromptResourceUrl };
|
package/prompt/prompt.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
//#region src/prompt/prompt.ts
|
|
2
|
+
var e = /* @__PURE__ */ function(e) {
|
|
3
|
+
return e.Required = "required", e.TooLong = "tooLong", e.InvalidName = "invalidName", e.Conflict = "conflict", e;
|
|
4
|
+
}({}), t = /^(?!\.{1,2}$)[a-zA-Z0-9 _.-]+$/, n = 256, r = 2e3, i = 5e4, a = 10, o = (e) => {
|
|
5
|
+
let n = e.trim();
|
|
6
|
+
return n.length === 0 ? "required" : n.length > 256 ? "tooLong" : t.test(n) ? null : "invalidName";
|
|
7
|
+
}, s = (e) => e.length > 2e3 ? "tooLong" : null, c = (e) => e.trim().length === 0 ? "required" : e.length > 5e4 ? "tooLong" : null, l = (e, t) => {
|
|
8
|
+
let n = t - e.length;
|
|
9
|
+
return n <= 10 ? n : null;
|
|
10
|
+
}, u = (e, t) => e ? `${e}/${t}` : t;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { i as PROMPT_CONTENT_MAX_LENGTH, a as PROMPT_COUNTER_ANNOUNCE_THRESHOLD, r as PROMPT_DESCRIPTION_MAX_LENGTH, n as PROMPT_NAME_MAX_LENGTH, e as PromptFieldError, u as buildPromptPath, l as getRemainingCharacters, c as validatePromptContent, s as validatePromptDescription, o as validatePromptName };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { useCallback as e, useEffect as t, useMemo as n, useState as r } from "react";
|
|
2
|
+
//#region src/prompt/usePromptsState/usePromptsState.ts
|
|
3
|
+
var i = ({ listPrompts: i }) => {
|
|
4
|
+
let [a, o] = r([]), [s, c] = r([]), [l, u] = r([]), [d, f] = r([]), [p, m] = r([]), [h, g] = r(!0), [_, v] = r(null), y = e(async () => {
|
|
5
|
+
try {
|
|
6
|
+
let e = await i();
|
|
7
|
+
o(e.prompts), c(e.folders), u(e.sharedWithMe), f(e.publicPrompts ?? []), m(e.publicFolders ?? []), v(null);
|
|
8
|
+
} catch (e) {
|
|
9
|
+
v(e);
|
|
10
|
+
}
|
|
11
|
+
}, [i]);
|
|
12
|
+
return t(() => {
|
|
13
|
+
let e = { value: !1 };
|
|
14
|
+
return (async () => {
|
|
15
|
+
let t = await i().catch((t) => (e.value || v(t), null));
|
|
16
|
+
e.value || (t != null && (o(t.prompts), c(t.folders), u(t.sharedWithMe), f(t.publicPrompts ?? []), m(t.publicFolders ?? []), v(null)), g(!1));
|
|
17
|
+
})(), () => {
|
|
18
|
+
e.value = !0;
|
|
19
|
+
};
|
|
20
|
+
}, [i]), n(() => ({
|
|
21
|
+
prompts: a,
|
|
22
|
+
folders: s,
|
|
23
|
+
sharedWithMe: l,
|
|
24
|
+
publicPrompts: d,
|
|
25
|
+
publicFolders: p,
|
|
26
|
+
isLoading: h,
|
|
27
|
+
error: _,
|
|
28
|
+
refetch: y,
|
|
29
|
+
refetchPublicPrompts: y
|
|
30
|
+
}), [
|
|
31
|
+
a,
|
|
32
|
+
s,
|
|
33
|
+
l,
|
|
34
|
+
d,
|
|
35
|
+
p,
|
|
36
|
+
h,
|
|
37
|
+
_,
|
|
38
|
+
y
|
|
39
|
+
]);
|
|
40
|
+
};
|
|
41
|
+
//#endregion
|
|
42
|
+
export { i as usePromptsState };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
//#region src/scheduled-task/scheduled-task-mapping.ts
|
|
2
|
+
var e = /* @__PURE__ */ function(e) {
|
|
3
|
+
return e.UnsupportedCronShape = "unsupportedCronShape", e.UnsupportedTriggerType = "unsupportedTriggerType", e.MissingRequiredFields = "missingRequiredFields", e;
|
|
4
|
+
}({});
|
|
5
|
+
//#endregion
|
|
6
|
+
export { e as UnsupportedTriggerReason };
|
|
@@ -1,25 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}({}), a = new Set([
|
|
1
|
+
import { padTwoDigits as e } from "../shared/formatting.js";
|
|
2
|
+
import { UnsupportedTriggerReason as t } from "./scheduled-task-mapping.js";
|
|
3
|
+
import { apSchedulerDayToJsDay as n, jsDayToApSchedulerDay as r } from "../shared/cron-weekday.js";
|
|
4
|
+
import { ScheduledTaskRepeat as i } from "@epam/ai-dial-scheduled-tasks";
|
|
5
|
+
//#region src/scheduled-task/scheduled-task-trigger.ts
|
|
6
|
+
var a = new Set([
|
|
8
7
|
"hour",
|
|
9
8
|
"minute",
|
|
10
9
|
"day_of_week",
|
|
11
10
|
"day"
|
|
12
11
|
]), o = "09:00", s = (e) => {
|
|
13
|
-
if (e.repeat ===
|
|
12
|
+
if (e.repeat === i.Hourly) {
|
|
14
13
|
let t = /* @__PURE__ */ new Date();
|
|
15
14
|
return t.setHours(0, Number(e.minute), 0, 0), {
|
|
16
15
|
hour: "*",
|
|
17
16
|
minute: String(t.getUTCMinutes())
|
|
18
17
|
};
|
|
19
18
|
}
|
|
20
|
-
let [
|
|
19
|
+
let [t, a] = e.time.split(":"), o = Number(t), s = Number(a), c = /* @__PURE__ */ new Date();
|
|
21
20
|
c.setHours(o, s, 0, 0);
|
|
22
|
-
let l = e.repeat ===
|
|
21
|
+
let l = e.repeat === i.Weekly && !!e.dayOfWeek, u = e.repeat === i.Monthly && !!e.dayOfMonth;
|
|
23
22
|
if (l) {
|
|
24
23
|
let t = (n(Number(e.dayOfWeek)) - c.getDay() + 7) % 7;
|
|
25
24
|
c.setDate(c.getDate() + t);
|
|
@@ -28,12 +27,12 @@ var i = /* @__PURE__ */ function(e) {
|
|
|
28
27
|
hour: String(c.getUTCHours()),
|
|
29
28
|
minute: String(c.getUTCMinutes())
|
|
30
29
|
};
|
|
31
|
-
return l && (d.day_of_week = String(
|
|
30
|
+
return l && (d.day_of_week = String(r(c.getUTCDay()))), u && (d.day = String(c.getUTCDate())), d;
|
|
32
31
|
}, c = (e, t) => {
|
|
33
32
|
let [n, r, i] = e.split("-").map(Number), a = new Date(n, r - 1, i);
|
|
34
33
|
return t === "start" ? a.setHours(0, 0, 0, 0) : a.setHours(23, 59, 59, 999), a.toISOString();
|
|
35
34
|
}, l = (e) => {
|
|
36
|
-
let t = e.repeat ===
|
|
35
|
+
let t = e.repeat === i.OneTime ? { date: new Date(e.runAt ?? "").toISOString() } : { cron: {
|
|
37
36
|
fields: s(e),
|
|
38
37
|
...e.startDate ? { startDate: c(e.startDate, "start") } : {},
|
|
39
38
|
...e.endDate ? { endDate: c(e.endDate, "end") } : {}
|
|
@@ -51,27 +50,27 @@ var i = /* @__PURE__ */ function(e) {
|
|
|
51
50
|
}, f = (t) => {
|
|
52
51
|
let n = new Date(t);
|
|
53
52
|
return `${n.getFullYear()}-${e(n.getMonth() + 1)}-${e(n.getDate())}`;
|
|
54
|
-
}, p = (
|
|
55
|
-
let i = new Set(Object.entries(
|
|
53
|
+
}, p = (t) => {
|
|
54
|
+
let i = new Set(Object.entries(t).filter(([, e]) => e != null).map(([e]) => e)), o = [...i].filter((e) => !a.has(e)), s = i.has("day_of_week"), c = i.has("day");
|
|
56
55
|
if (o.length > 0 || s && c || !i.has("hour") || !i.has("minute")) return { ok: !1 };
|
|
57
|
-
if (
|
|
56
|
+
if (t.hour === "*" && /^\d+$/.test(String(t.minute)) && !s && !c) {
|
|
58
57
|
let e = /* @__PURE__ */ new Date();
|
|
59
|
-
return e.setUTCHours(0, Number(
|
|
58
|
+
return e.setUTCHours(0, Number(t.minute), 0, 0), {
|
|
60
59
|
ok: !0,
|
|
61
60
|
isHourly: !0,
|
|
62
61
|
minute: String(e.getMinutes())
|
|
63
62
|
};
|
|
64
63
|
}
|
|
65
|
-
let l = Number(
|
|
64
|
+
let l = Number(t.hour), u = Number(t.minute);
|
|
66
65
|
if (Number.isNaN(l) || Number.isNaN(u)) return { ok: !1 };
|
|
67
66
|
let d = /* @__PURE__ */ new Date();
|
|
68
67
|
if (d.setUTCHours(l, u, 0, 0), s) {
|
|
69
|
-
let e = Number(
|
|
68
|
+
let e = Number(t.day_of_week);
|
|
70
69
|
if (Number.isNaN(e)) return { ok: !1 };
|
|
71
|
-
let
|
|
72
|
-
d.setUTCDate(d.getUTCDate() +
|
|
70
|
+
let r = (n(e) - d.getUTCDay() + 7) % 7;
|
|
71
|
+
d.setUTCDate(d.getUTCDate() + r);
|
|
73
72
|
} else if (c) {
|
|
74
|
-
let e = Number(
|
|
73
|
+
let e = Number(t.day);
|
|
75
74
|
if (Number.isNaN(e)) return { ok: !1 };
|
|
76
75
|
d.setUTCDate(e);
|
|
77
76
|
}
|
|
@@ -79,18 +78,18 @@ var i = /* @__PURE__ */ function(e) {
|
|
|
79
78
|
ok: !0,
|
|
80
79
|
isHourly: !1,
|
|
81
80
|
time: `${e(d.getHours())}:${e(d.getMinutes())}`,
|
|
82
|
-
...s ? { dayOfWeek: String(
|
|
81
|
+
...s ? { dayOfWeek: String(r(d.getDay())) } : {},
|
|
83
82
|
...c ? { dayOfMonth: String(d.getDate()) } : {}
|
|
84
83
|
};
|
|
85
84
|
}, m = (e) => {
|
|
86
85
|
if (!e.model || !e.prompt) return {
|
|
87
86
|
ok: !1,
|
|
88
|
-
reason:
|
|
87
|
+
reason: t.MissingRequiredFields
|
|
89
88
|
};
|
|
90
|
-
let { date:
|
|
91
|
-
if (a === !!
|
|
89
|
+
let { date: n, cron: r } = e.trigger, a = !!n;
|
|
90
|
+
if (a === !!r) return {
|
|
92
91
|
ok: !1,
|
|
93
|
-
reason:
|
|
92
|
+
reason: t.UnsupportedTriggerType
|
|
94
93
|
};
|
|
95
94
|
let s = {
|
|
96
95
|
displayName: e.displayName,
|
|
@@ -102,33 +101,33 @@ var i = /* @__PURE__ */ function(e) {
|
|
|
102
101
|
ok: !0,
|
|
103
102
|
values: {
|
|
104
103
|
...s,
|
|
105
|
-
repeat:
|
|
106
|
-
runAt: d(
|
|
104
|
+
repeat: i.OneTime,
|
|
105
|
+
runAt: d(n),
|
|
107
106
|
time: o
|
|
108
107
|
}
|
|
109
108
|
};
|
|
110
|
-
if (!
|
|
109
|
+
if (!r) return {
|
|
111
110
|
ok: !1,
|
|
112
|
-
reason:
|
|
111
|
+
reason: t.UnsupportedTriggerType
|
|
113
112
|
};
|
|
114
|
-
let c = p(
|
|
113
|
+
let c = p(r.fields);
|
|
115
114
|
if (!c.ok) return {
|
|
116
115
|
ok: !1,
|
|
117
|
-
reason:
|
|
116
|
+
reason: t.UnsupportedCronShape
|
|
118
117
|
};
|
|
119
118
|
if (c.isHourly) return {
|
|
120
119
|
ok: !0,
|
|
121
120
|
values: {
|
|
122
121
|
...s,
|
|
123
|
-
repeat:
|
|
122
|
+
repeat: i.Hourly,
|
|
124
123
|
time: o,
|
|
125
124
|
minute: c.minute,
|
|
126
|
-
...
|
|
127
|
-
...
|
|
125
|
+
...r.startDate ? { startDate: f(r.startDate) } : {},
|
|
126
|
+
...r.endDate ? { endDate: f(r.endDate) } : {}
|
|
128
127
|
}
|
|
129
128
|
};
|
|
130
|
-
let l =
|
|
131
|
-
return c.dayOfWeek ? l =
|
|
129
|
+
let l = i.Daily;
|
|
130
|
+
return c.dayOfWeek ? l = i.Weekly : c.dayOfMonth && (l = i.Monthly), {
|
|
132
131
|
ok: !0,
|
|
133
132
|
values: {
|
|
134
133
|
...s,
|
|
@@ -136,10 +135,10 @@ var i = /* @__PURE__ */ function(e) {
|
|
|
136
135
|
time: c.time,
|
|
137
136
|
...c.dayOfWeek ? { dayOfWeek: c.dayOfWeek } : {},
|
|
138
137
|
...c.dayOfMonth ? { dayOfMonth: c.dayOfMonth } : {},
|
|
139
|
-
...
|
|
140
|
-
...
|
|
138
|
+
...r.startDate ? { startDate: f(r.startDate) } : {},
|
|
139
|
+
...r.endDate ? { endDate: f(r.endDate) } : {}
|
|
141
140
|
}
|
|
142
141
|
};
|
|
143
142
|
};
|
|
144
143
|
//#endregion
|
|
145
|
-
export {
|
|
144
|
+
export { l as mapFormValuesToCreateBody, u as mapFormValuesToUpdateBody, m as mapScheduledTaskDtoToFormValues };
|
package/scheduled-tasks.js
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { UnsupportedTriggerReason as e } from "./scheduled-task/scheduled-task-mapping.js";
|
|
2
|
+
import { mapFormValuesToCreateBody as t, mapFormValuesToUpdateBody as n, mapScheduledTaskDtoToFormValues as r } from "./scheduled-task/scheduled-task-trigger.js";
|
|
3
|
+
export { e as UnsupportedTriggerReason, t as mapFormValuesToCreateBody, n as mapFormValuesToUpdateBody, r as mapScheduledTaskDtoToFormValues };
|
package/scroll-anchoring.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useConversationScroll as e } from "./conversation/useConversationScroll/useConversationScroll.js";
|
|
2
2
|
export { e as useConversationScroll };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
//#region src/shared/custom-apps.ts
|
|
2
|
+
var e = (e) => {
|
|
3
|
+
let t = e.trim();
|
|
4
|
+
if (!t || !/^https?:\/\//.test(t)) return !1;
|
|
5
|
+
try {
|
|
6
|
+
return !!new URL(t);
|
|
7
|
+
} catch {
|
|
8
|
+
return !1;
|
|
9
|
+
}
|
|
10
|
+
}, t = (e) => {
|
|
11
|
+
let t = e.trim();
|
|
12
|
+
if (t) try {
|
|
13
|
+
return JSON.parse(t);
|
|
14
|
+
} catch {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
}, n = ["rate_endpoint", "configuration_endpoint"], r = (e) => {
|
|
18
|
+
let t = e.trim();
|
|
19
|
+
if (!t) return !0;
|
|
20
|
+
try {
|
|
21
|
+
let e = JSON.parse(t);
|
|
22
|
+
if (typeof e != "object" || !e || Array.isArray(e)) return !1;
|
|
23
|
+
let r = Object.keys(e);
|
|
24
|
+
return r.length > 0 && r.every((e) => n.includes(e));
|
|
25
|
+
} catch {
|
|
26
|
+
return !1;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
//#endregion
|
|
30
|
+
export { e as isValidAbsoluteUrl, r as isValidFeaturesData, t as parseFeaturesData };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//#region src/shared/external-services.ts
|
|
2
|
+
var e = "/external_services/", t = (t) => {
|
|
3
|
+
let n = t.indexOf(e);
|
|
4
|
+
if (n === -1) return null;
|
|
5
|
+
let r = t.slice(0, n), i = t.slice(n + 19);
|
|
6
|
+
return !r || !i ? null : {
|
|
7
|
+
appId: r,
|
|
8
|
+
serviceName: i
|
|
9
|
+
};
|
|
10
|
+
}, n = (t, n) => `${t}${e}${n}`, r = (e) => {
|
|
11
|
+
try {
|
|
12
|
+
return decodeURIComponent(e);
|
|
13
|
+
} catch {
|
|
14
|
+
return e;
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
//#endregion
|
|
18
|
+
export { n as buildExternalServiceScopeId, r as getExternalServiceFallbackName, t as parseExternalServiceUrl };
|