@redocly/theme 0.67.0-next.4 → 0.67.0-next.6
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/lib/components/Breadcrumbs/BreadcrumbDropdown.js +2 -6
- package/lib/components/Breadcrumbs/Breadcrumbs.js +3 -18
- package/lib/components/Buttons/AIAssistantButton.js +2 -6
- package/lib/components/Buttons/EditPageButton.js +2 -1
- package/lib/components/Catalog/CatalogCardView/CatalogCard.js +1 -1
- package/lib/components/CatalogClassic/CatalogClassicActions.js +3 -1
- package/lib/components/CatalogClassic/CatalogClassicCard.js +1 -1
- package/lib/components/CatalogClassic/CatalogClassicInfoBlock.js +2 -1
- package/lib/components/Feedback/ReportDialog.js +4 -1
- package/lib/components/Filter/FilterCheckboxes.js +3 -1
- package/lib/components/Footer/FooterItem.js +1 -1
- package/lib/components/LanguagePicker/LanguagePicker.js +3 -1
- package/lib/components/Logo/Logo.js +2 -1
- package/lib/components/Menu/MenuContainer.js +1 -0
- package/lib/components/Menu/MenuItem.js +21 -7
- package/lib/components/Navbar/Navbar.js +6 -2
- package/lib/components/Navbar/NavbarItem.js +3 -1
- package/lib/components/Search/SearchDialog.js +5 -33
- package/lib/components/Search/SearchInput.js +4 -1
- package/lib/components/Search/SearchRecent.js +3 -1
- package/lib/components/SidebarActions/SidebarActions.js +10 -3
- package/lib/components/TableOfContent/TableOfContent.js +1 -1
- package/lib/components/UserMenu/LoginButton.js +2 -1
- package/lib/components/UserMenu/LogoutMenuItem.js +2 -1
- package/lib/core/constants/search.js +4 -0
- package/lib/core/hooks/search/use-search-dialog.js +7 -2
- package/lib/core/hooks/use-banner-telemetry.js +2 -11
- package/lib/core/hooks/use-color-switcher.js +2 -1
- package/lib/core/hooks/use-page-actions.js +29 -36
- package/lib/core/hooks/use-product-picker.js +14 -4
- package/lib/core/hooks/use-telemetry-fallback.d.ts +45 -37
- package/lib/core/hooks/use-telemetry-fallback.js +47 -39
- package/lib/core/styles/global.js +33 -0
- package/lib/core/types/l10n.d.ts +1 -1
- package/lib/core/types/search.d.ts +2 -1
- package/lib/core/types/search.js +1 -0
- package/lib/core/utils/index.d.ts +2 -0
- package/lib/core/utils/index.js +2 -0
- package/lib/core/utils/telemetry/generate-before-after-context.d.ts +37 -0
- package/lib/core/utils/telemetry/generate-before-after-context.js +32 -0
- package/lib/core/utils/telemetry/generate-resource-urn.d.ts +7 -0
- package/lib/core/utils/telemetry/generate-resource-urn.js +13 -0
- package/lib/core/utils/telemetry/get-base-data-attributes.d.ts +14 -0
- package/lib/core/utils/telemetry/get-base-data-attributes.js +17 -0
- package/lib/layouts/McpNotAllowed.d.ts +2 -0
- package/lib/layouts/McpNotAllowed.js +67 -0
- package/package.json +3 -3
- package/src/components/Breadcrumbs/BreadcrumbDropdown.tsx +2 -1
- package/src/components/Breadcrumbs/Breadcrumbs.tsx +4 -4
- package/src/components/Buttons/AIAssistantButton.tsx +2 -3
- package/src/components/Buttons/EditPageButton.tsx +4 -1
- package/src/components/Catalog/CatalogCardView/CatalogCard.tsx +2 -2
- package/src/components/CatalogClassic/CatalogClassicActions.tsx +4 -2
- package/src/components/CatalogClassic/CatalogClassicCard.tsx +9 -2
- package/src/components/CatalogClassic/CatalogClassicInfoBlock.tsx +2 -1
- package/src/components/Feedback/ReportDialog.tsx +4 -1
- package/src/components/Filter/FilterCheckboxes.tsx +4 -2
- package/src/components/Footer/FooterItem.tsx +4 -2
- package/src/components/LanguagePicker/LanguagePicker.tsx +9 -2
- package/src/components/Logo/Logo.tsx +7 -1
- package/src/components/Menu/MenuContainer.tsx +1 -0
- package/src/components/Menu/MenuItem.tsx +35 -4
- package/src/components/Navbar/Navbar.tsx +7 -3
- package/src/components/Navbar/NavbarItem.tsx +7 -1
- package/src/components/Search/SearchDialog.tsx +6 -13
- package/src/components/Search/SearchInput.tsx +4 -1
- package/src/components/Search/SearchRecent.tsx +4 -2
- package/src/components/SidebarActions/SidebarActions.tsx +10 -3
- package/src/components/TableOfContent/TableOfContent.tsx +7 -2
- package/src/components/UserMenu/LoginButton.tsx +4 -1
- package/src/components/UserMenu/LogoutMenuItem.tsx +2 -1
- package/src/core/constants/search.ts +4 -0
- package/src/core/hooks/search/use-search-dialog.ts +13 -2
- package/src/core/hooks/use-banner-telemetry.ts +5 -4
- package/src/core/hooks/use-color-switcher.ts +7 -1
- package/src/core/hooks/use-page-actions.ts +38 -44
- package/src/core/hooks/use-product-picker.ts +19 -5
- package/src/core/hooks/use-telemetry-fallback.ts +47 -39
- package/src/core/styles/global.ts +33 -0
- package/src/core/types/l10n.ts +2 -0
- package/src/core/types/search.ts +1 -0
- package/src/core/utils/index.ts +2 -0
- package/src/core/utils/telemetry/generate-before-after-context.ts +59 -0
- package/src/core/utils/telemetry/generate-resource-urn.ts +9 -0
- package/src/core/utils/telemetry/get-base-data-attributes.ts +27 -0
- package/src/layouts/McpNotAllowed.tsx +81 -0
|
@@ -24,13 +24,7 @@ const clipboard_service_1 = require("../utils/clipboard-service");
|
|
|
24
24
|
const dom_1 = require("../utils/dom");
|
|
25
25
|
const mcp_1 = require("../utils/mcp");
|
|
26
26
|
const urls_1 = require("../utils/urls");
|
|
27
|
-
|
|
28
|
-
return {
|
|
29
|
-
id: pageSlug,
|
|
30
|
-
object: 'page',
|
|
31
|
-
uri: pageUrl,
|
|
32
|
-
};
|
|
33
|
-
}
|
|
27
|
+
const get_base_data_attributes_1 = require("../utils/telemetry/get-base-data-attributes");
|
|
34
28
|
const DEFAULT_ENABLED_ACTIONS = [
|
|
35
29
|
'copy',
|
|
36
30
|
'view',
|
|
@@ -55,19 +49,17 @@ function usePageActions(pageSlug, mcpUrl, actions) {
|
|
|
55
49
|
? { serverName: mcpConfig.serverName, url: mcpUrl || '' }
|
|
56
50
|
: { serverName: mcpConfig.serverName, url: mcpConfig.serverUrl || '' };
|
|
57
51
|
const isDocsMcp = !requiresMcpUrl;
|
|
58
|
-
const origin = dom_1.IS_BROWSER ? window.location.origin : '';
|
|
59
|
-
const pageUrl = `${origin}${pageSlug}`;
|
|
60
52
|
return createMCPAction({
|
|
61
53
|
clientType,
|
|
62
54
|
mcpConfig: config,
|
|
63
55
|
translate,
|
|
64
56
|
onClickCallback: isDocsMcp
|
|
65
|
-
? () => telemetry.
|
|
66
|
-
Object.assign(Object.assign({},
|
|
57
|
+
? () => telemetry.sendPageActionsClickedMessage([
|
|
58
|
+
Object.assign(Object.assign({}, (0, get_base_data_attributes_1.getBaseDataAttributes)('pageActions', 'button')), { actionType: `docs-mcp-${clientType}` }),
|
|
67
59
|
])
|
|
68
60
|
: undefined,
|
|
69
61
|
});
|
|
70
|
-
}, [mcpUrl, mcpConfig, translate, telemetry
|
|
62
|
+
}, [mcpUrl, mcpConfig, translate, telemetry]);
|
|
71
63
|
const result = (0, react_1.useMemo)(() => {
|
|
72
64
|
var _a, _b;
|
|
73
65
|
var _c;
|
|
@@ -83,7 +75,6 @@ function usePageActions(pageSlug, mcpUrl, actions) {
|
|
|
83
75
|
? window.location.origin
|
|
84
76
|
: ((_c = globalThis['SSR_HOSTNAME']) !== null && _c !== void 0 ? _c : '');
|
|
85
77
|
const pathname = (0, urls_1.addTrailingSlash)(pageSlug);
|
|
86
|
-
const pageUrl = (0, urls_1.combineUrls)(origin, pathname);
|
|
87
78
|
const isRoot = (0, urls_1.withoutPathPrefix)(pathname) === '/';
|
|
88
79
|
const mdPageUrl = isRoot
|
|
89
80
|
? (0, urls_1.combineUrls)(origin, pathname, 'index.html.md')
|
|
@@ -106,8 +97,8 @@ function usePageActions(pageSlug, mcpUrl, actions) {
|
|
|
106
97
|
}
|
|
107
98
|
const text = yield result.text();
|
|
108
99
|
clipboard_service_1.ClipboardService.copyCustom(text);
|
|
109
|
-
telemetry.
|
|
110
|
-
Object.assign(Object.assign({},
|
|
100
|
+
telemetry.sendPageActionsClickedMessage([
|
|
101
|
+
Object.assign(Object.assign({}, (0, get_base_data_attributes_1.getBaseDataAttributes)('pageActions', 'button')), { actionType: 'copy' }),
|
|
111
102
|
]);
|
|
112
103
|
}
|
|
113
104
|
catch (error) {
|
|
@@ -122,8 +113,8 @@ function usePageActions(pageSlug, mcpUrl, actions) {
|
|
|
122
113
|
iconComponent: MarkdownFullIcon_1.MarkdownFullIcon,
|
|
123
114
|
link: mdPageUrl,
|
|
124
115
|
onClick: () => {
|
|
125
|
-
telemetry.
|
|
126
|
-
Object.assign(Object.assign({},
|
|
116
|
+
telemetry.sendPageActionsClickedMessage([
|
|
117
|
+
Object.assign(Object.assign({}, (0, get_base_data_attributes_1.getBaseDataAttributes)('pageActions', 'button')), { actionType: 'view' }),
|
|
127
118
|
]);
|
|
128
119
|
},
|
|
129
120
|
}),
|
|
@@ -136,8 +127,8 @@ function usePageActions(pageSlug, mcpUrl, actions) {
|
|
|
136
127
|
iconComponent: ChatGptIcon_1.ChatGptIcon,
|
|
137
128
|
link,
|
|
138
129
|
onClick: () => {
|
|
139
|
-
telemetry.
|
|
140
|
-
Object.assign(Object.assign({},
|
|
130
|
+
telemetry.sendPageActionsClickedMessage([
|
|
131
|
+
Object.assign(Object.assign({}, (0, get_base_data_attributes_1.getBaseDataAttributes)('pageActions', 'button')), { actionType: 'chatgpt' }),
|
|
141
132
|
]);
|
|
142
133
|
window.location.href = link;
|
|
143
134
|
},
|
|
@@ -152,8 +143,8 @@ function usePageActions(pageSlug, mcpUrl, actions) {
|
|
|
152
143
|
iconComponent: ClaudeIcon_1.ClaudeIcon,
|
|
153
144
|
link,
|
|
154
145
|
onClick: () => {
|
|
155
|
-
telemetry.
|
|
156
|
-
Object.assign(Object.assign({},
|
|
146
|
+
telemetry.sendPageActionsClickedMessage([
|
|
147
|
+
Object.assign(Object.assign({}, (0, get_base_data_attributes_1.getBaseDataAttributes)('pageActions', 'button')), { actionType: 'claude' }),
|
|
157
148
|
]);
|
|
158
149
|
window.location.href = link;
|
|
159
150
|
},
|
|
@@ -199,24 +190,26 @@ function createMCPAction({ clientType, mcpConfig, translate, onClickCallback, })
|
|
|
199
190
|
}
|
|
200
191
|
function shouldHideAction(action, { pageProps, themeConfig, openapiExcludeFromSearch, isPublic, mcpUrl, isMcpDisabled, }) {
|
|
201
192
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
202
|
-
// Can't use any actions if search is globally disabled (markdown files are not generated)
|
|
203
|
-
if ((_a = themeConfig.search) === null || _a === void 0 ? void 0 : _a.hide) {
|
|
204
|
-
return true;
|
|
205
|
-
}
|
|
206
|
-
// Can't use any actions if no markdown files are generated for LLMs
|
|
207
|
-
if ((_c = (_b = pageProps === null || pageProps === void 0 ? void 0 : pageProps.seo) === null || _b === void 0 ? void 0 : _b.llmstxt) === null || _c === void 0 ? void 0 : _c.hide) {
|
|
208
|
-
return true;
|
|
209
|
-
}
|
|
210
193
|
// Page actions are explicitly disabled in config
|
|
211
|
-
if ((
|
|
194
|
+
if ((_b = (_a = themeConfig.navigation) === null || _a === void 0 ? void 0 : _a.actions) === null || _b === void 0 ? void 0 : _b.hide) {
|
|
212
195
|
return true;
|
|
213
196
|
}
|
|
214
|
-
const
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
197
|
+
const actionDependsOnLlmsTxt = ['view', 'copy', 'chatgpt', 'claude'].includes(action);
|
|
198
|
+
if (actionDependsOnLlmsTxt) {
|
|
199
|
+
// Can't use any actions if search is globally disabled (markdown files are not generated)
|
|
200
|
+
if ((_c = themeConfig.search) === null || _c === void 0 ? void 0 : _c.hide) {
|
|
201
|
+
return true;
|
|
202
|
+
}
|
|
203
|
+
// Can't use any actions if no markdown files are generated for LLMs
|
|
204
|
+
if ((_e = (_d = pageProps === null || pageProps === void 0 ? void 0 : pageProps.seo) === null || _d === void 0 ? void 0 : _d.llmstxt) === null || _e === void 0 ? void 0 : _e.hide) {
|
|
205
|
+
return true;
|
|
206
|
+
}
|
|
207
|
+
const isOpenApiPage = ((_f = pageProps === null || pageProps === void 0 ? void 0 : pageProps.metadata) === null || _f === void 0 ? void 0 : _f.type) === 'openapi' ||
|
|
208
|
+
((_g = pageProps === null || pageProps === void 0 ? void 0 : pageProps.metadata) === null || _g === void 0 ? void 0 : _g.subType) === 'openapi-operation';
|
|
209
|
+
const isPageExcludedFromSearch = ((_h = pageProps === null || pageProps === void 0 ? void 0 : pageProps.frontmatter) === null || _h === void 0 ? void 0 : _h.excludeFromSearch) || (isOpenApiPage && openapiExcludeFromSearch);
|
|
210
|
+
if (isPageExcludedFromSearch) {
|
|
211
|
+
return true;
|
|
212
|
+
}
|
|
220
213
|
}
|
|
221
214
|
return shouldHideActionByType(action, { isPublic, mcpUrl, isMcpDisabled });
|
|
222
215
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useProductPicker = useProductPicker;
|
|
4
|
+
const react_1 = require("react");
|
|
4
5
|
const react_router_dom_1 = require("react-router-dom");
|
|
5
6
|
const utils_1 = require("../../components/Product/utils");
|
|
6
7
|
const use_theme_hooks_1 = require("./use-theme-hooks");
|
|
@@ -12,20 +13,29 @@ function useProductPicker() {
|
|
|
12
13
|
const telemetry = useTelemetry();
|
|
13
14
|
const navigate = (0, react_router_dom_1.useNavigate)();
|
|
14
15
|
const loadAndNavigate = useLoadAndNavigate();
|
|
16
|
+
// An open dropdown can fire a menu item's onAction from an earlier render, so `product.link`
|
|
17
|
+
// may be stale (e.g. after a locale switch); resolve the live product via a ref.
|
|
18
|
+
const productsRef = (0, react_1.useRef)(products);
|
|
19
|
+
productsRef.current = products;
|
|
15
20
|
function setProduct(product) {
|
|
21
|
+
var _a;
|
|
16
22
|
if (!product)
|
|
17
23
|
return;
|
|
18
|
-
|
|
24
|
+
// match on `name` (locale-stable; link/slug are re-localized)
|
|
25
|
+
const freshProduct = (_a = productsRef.current.find((p) => p.name === product.name)) !== null && _a !== void 0 ? _a : product;
|
|
26
|
+
telemetry.sendProductPickerChangedMessage([
|
|
27
|
+
...(0, utils_2.generateBeforeAfterContext)('productPicker', 'dropdown', { product: (currentProduct === null || currentProduct === void 0 ? void 0 : currentProduct.slug) || '' }, { product: freshProduct.slug }),
|
|
28
|
+
]);
|
|
19
29
|
if (typeof document === 'undefined')
|
|
20
30
|
return;
|
|
21
|
-
if (
|
|
31
|
+
if (freshProduct.name) {
|
|
22
32
|
const root = document.documentElement;
|
|
23
33
|
Array.from(root.classList)
|
|
24
34
|
.filter((c) => c.startsWith('product-'))
|
|
25
35
|
.forEach((c) => root.classList.remove(c));
|
|
26
|
-
root.classList.add((0, utils_1.getProductClassName)(
|
|
36
|
+
root.classList.add((0, utils_1.getProductClassName)(freshProduct.name));
|
|
27
37
|
}
|
|
28
|
-
loadAndNavigate({ navigate, to: (0, utils_2.withPathPrefix)(
|
|
38
|
+
loadAndNavigate({ navigate, to: (0, utils_2.withPathPrefix)(freshProduct.link) });
|
|
29
39
|
}
|
|
30
40
|
return {
|
|
31
41
|
currentProduct,
|
|
@@ -1,48 +1,59 @@
|
|
|
1
1
|
export declare const useTelemetryFallback: () => {
|
|
2
2
|
send: () => void;
|
|
3
|
-
sendPageViewedMessage: () => void;
|
|
4
|
-
sendPageActionsButtonClickedMessage: () => void;
|
|
5
3
|
sendErrorMessage: () => void;
|
|
6
4
|
sendClientErrorMessage: () => void;
|
|
5
|
+
sendCatalogEntitiesFilterCheckboxToggledMessage: () => void;
|
|
6
|
+
sendCatalogEntitiesCopyDataSchemaClickedMessage: () => void;
|
|
7
|
+
sendCatalogEntitiesViewModeChangedMessage: () => void;
|
|
8
|
+
sendCatalogEntitiesRelatedEntitiesListSearchQueryMessage: () => void;
|
|
9
|
+
sendCatalogEntitiesRelatedEntitiesListSearchResultClickMessage: () => void;
|
|
10
|
+
sendCatalogEntitiesListSearchQueryMessage: () => void;
|
|
11
|
+
sendCatalogEntitiesListSearchResultClickedMessage: () => void;
|
|
12
|
+
sendRedirectMessage: () => void;
|
|
13
|
+
sendCustomMessage: () => void;
|
|
14
|
+
sendSearchAIQueryMessage: () => void;
|
|
15
|
+
sendSearchAiOpenedMessage: () => void;
|
|
16
|
+
sendSearchAIFeedbackMessage: () => void;
|
|
17
|
+
sendLoginClickedMessage: () => void;
|
|
18
|
+
sendLoginProviderClickedMessage: () => void;
|
|
19
|
+
sendLogoutClickedMessage: () => void;
|
|
20
|
+
sendBannerViewedMessage: () => void;
|
|
21
|
+
sendBannerLinkClickedMessage: () => void;
|
|
22
|
+
sendBannerDismissedMessage: () => void;
|
|
7
23
|
sendBreadcrumbClickedMessage: () => void;
|
|
8
|
-
|
|
9
|
-
sendSidebarItemClickedMessage: () => void;
|
|
10
|
-
sendSidebarItemExpandedMessage: () => void;
|
|
11
|
-
sendSidebarItemCollapsedMessage: () => void;
|
|
12
|
-
sendChangeLayoutButtonClickedMessage: () => void;
|
|
13
|
-
sendEditPageLinkClickedMessage: () => void;
|
|
14
|
-
sendCodeSnippetReportedMessage: () => void;
|
|
15
|
-
sendNavbarMenuItemClickedMessage: () => void;
|
|
16
|
-
sendLoginButtonClickedMessage: () => void;
|
|
17
|
-
sendLoginProviderButtonClickedMessage: () => void;
|
|
18
|
-
sendLogoutMenuItemClickedMessage: () => void;
|
|
19
|
-
sendLogoClickedMessage: () => void;
|
|
20
|
-
sendTocItemClickedMessage: () => void;
|
|
24
|
+
sendCatalogActionsClickedMessage: () => void;
|
|
21
25
|
sendCatalogFilterChangedMessage: () => void;
|
|
22
26
|
sendCatalogItemClickedMessage: () => void;
|
|
23
27
|
sendScorecardLinkClickedMessage: () => void;
|
|
24
|
-
|
|
25
|
-
|
|
28
|
+
sendFilterCheckboxToggledMessage: () => void;
|
|
29
|
+
sendFeedbackMessage: () => void;
|
|
26
30
|
sendFooterItemClickedMessage: () => void;
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
sendNavbarMenuItemClickedMessage: () => void;
|
|
32
|
+
sendColorModeSwitchedMessage: () => void;
|
|
33
|
+
sendLanguagePickerChangedMessage: () => void;
|
|
34
|
+
sendProductPickerChangedMessage: () => void;
|
|
35
|
+
sendLogoClickedMessage: () => void;
|
|
36
|
+
sendCodeSnippetReportedMessage: () => void;
|
|
37
|
+
sendMobileMenuClosedMessage: () => void;
|
|
38
|
+
sendMobileMenuOpenedMessage: () => void;
|
|
39
|
+
sendPageViewedMessage: () => void;
|
|
40
|
+
sendPageTimeMessage: () => void;
|
|
41
|
+
sendPageActionsClickedMessage: () => void;
|
|
42
|
+
sendPageEditClickedMessage: () => void;
|
|
43
|
+
sendSidebarDrilldownBackClickedMessage: () => void;
|
|
44
|
+
sendSidebarItemClickedMessage: () => void;
|
|
45
|
+
sendSidebarExpandedMessage: () => void;
|
|
46
|
+
sendSidebarCollapsedMessage: () => void;
|
|
47
|
+
sendChangeLayoutClickedMessage: () => void;
|
|
48
|
+
sendRequestApiAccessClickedMessage: () => void;
|
|
49
|
+
sendVersionPickerChangedMessage: () => void;
|
|
50
|
+
sendSearchInputResetClickedMessage: () => void;
|
|
51
|
+
sendSearchResultClickedMessage: () => void;
|
|
52
|
+
sendSearchRecentRemoveClickedMessage: () => void;
|
|
32
53
|
sendSearchRecentClickedMessage: () => void;
|
|
33
|
-
sendRequestApiAccessButtonClickedMessage: () => void;
|
|
34
|
-
sendVersionPickerSelectionChangeMessage: () => void;
|
|
35
|
-
sendProductPickedMessage: () => void;
|
|
36
|
-
sendFilterCheckboxToggledMessage: () => void;
|
|
37
|
-
sendLanguagePickerLocaleChangedMessage: () => void;
|
|
38
54
|
sendSearchOpenedMessage: () => void;
|
|
39
55
|
sendSearchQueryMessage: () => void;
|
|
40
|
-
|
|
41
|
-
sendSearchAIQueryMessage: () => void;
|
|
42
|
-
sendSearchAIFeedbackMessage: () => void;
|
|
43
|
-
sendFeedbackMessage: () => void;
|
|
44
|
-
sendSearchResultClickedMessage: () => void;
|
|
45
|
-
sendRedirectMessage: () => void;
|
|
56
|
+
sendTocItemClickedMessage: () => void;
|
|
46
57
|
sendOpenapiDocsMessage: () => void;
|
|
47
58
|
sendCopyCodeSnippetClickedMessage: () => void;
|
|
48
59
|
sendViewedMessage: () => void;
|
|
@@ -65,10 +76,7 @@ export declare const useTelemetryFallback: () => {
|
|
|
65
76
|
sendAsyncapiDocsReferencedInClickedMessage: () => void;
|
|
66
77
|
sendGraphqlDocsViewedMessage: () => void;
|
|
67
78
|
sendGraphqlDocsPerformanceMetricsMessage: () => void;
|
|
79
|
+
sendGraphqlDocsDownloadDefinitionClickedMessage: () => void;
|
|
68
80
|
sendGraphqlDocsReferencedInLinkClickedMessage: () => void;
|
|
69
81
|
sendGraphqlDocsRequiredScopesModalOpenedMessage: () => void;
|
|
70
|
-
sendGraphqlDocsDownloadDefinitionClickedMessage: () => void;
|
|
71
|
-
sendBannerViewedMessage: () => void;
|
|
72
|
-
sendBannerLinkClickedMessage: () => void;
|
|
73
|
-
sendBannerDismissedMessage: () => void;
|
|
74
82
|
};
|
|
@@ -1,53 +1,64 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useTelemetryFallback = void 0;
|
|
4
|
-
//
|
|
5
|
-
//
|
|
4
|
+
// Fallback no-op telemetry used by `useThemeHooks` when no ThemeDataContext
|
|
5
|
+
// provider supplies real hooks.
|
|
6
6
|
const useTelemetryFallback = () => ({
|
|
7
7
|
send: () => { },
|
|
8
|
-
sendPageViewedMessage: () => { },
|
|
9
|
-
sendPageActionsButtonClickedMessage: () => { },
|
|
10
8
|
sendErrorMessage: () => { },
|
|
11
9
|
sendClientErrorMessage: () => { },
|
|
10
|
+
sendCatalogEntitiesFilterCheckboxToggledMessage: () => { },
|
|
11
|
+
sendCatalogEntitiesCopyDataSchemaClickedMessage: () => { },
|
|
12
|
+
sendCatalogEntitiesViewModeChangedMessage: () => { },
|
|
13
|
+
sendCatalogEntitiesRelatedEntitiesListSearchQueryMessage: () => { },
|
|
14
|
+
sendCatalogEntitiesRelatedEntitiesListSearchResultClickMessage: () => { },
|
|
15
|
+
sendCatalogEntitiesListSearchQueryMessage: () => { },
|
|
16
|
+
sendCatalogEntitiesListSearchResultClickedMessage: () => { },
|
|
17
|
+
sendRedirectMessage: () => { },
|
|
18
|
+
sendCustomMessage: () => { },
|
|
19
|
+
sendSearchAIQueryMessage: () => { },
|
|
20
|
+
sendSearchAiOpenedMessage: () => { },
|
|
21
|
+
sendSearchAIFeedbackMessage: () => { },
|
|
22
|
+
sendLoginClickedMessage: () => { },
|
|
23
|
+
sendLoginProviderClickedMessage: () => { },
|
|
24
|
+
sendLogoutClickedMessage: () => { },
|
|
25
|
+
sendBannerViewedMessage: () => { },
|
|
26
|
+
sendBannerLinkClickedMessage: () => { },
|
|
27
|
+
sendBannerDismissedMessage: () => { },
|
|
12
28
|
sendBreadcrumbClickedMessage: () => { },
|
|
13
|
-
|
|
14
|
-
sendSidebarItemClickedMessage: () => { },
|
|
15
|
-
sendSidebarItemExpandedMessage: () => { },
|
|
16
|
-
sendSidebarItemCollapsedMessage: () => { },
|
|
17
|
-
sendChangeLayoutButtonClickedMessage: () => { },
|
|
18
|
-
sendEditPageLinkClickedMessage: () => { },
|
|
19
|
-
sendCodeSnippetReportedMessage: () => { },
|
|
20
|
-
sendNavbarMenuItemClickedMessage: () => { },
|
|
21
|
-
sendLoginButtonClickedMessage: () => { },
|
|
22
|
-
sendLoginProviderButtonClickedMessage: () => { },
|
|
23
|
-
sendLogoutMenuItemClickedMessage: () => { },
|
|
24
|
-
sendLogoClickedMessage: () => { },
|
|
25
|
-
sendTocItemClickedMessage: () => { },
|
|
29
|
+
sendCatalogActionsClickedMessage: () => { },
|
|
26
30
|
sendCatalogFilterChangedMessage: () => { },
|
|
27
31
|
sendCatalogItemClickedMessage: () => { },
|
|
28
32
|
sendScorecardLinkClickedMessage: () => { },
|
|
29
|
-
|
|
30
|
-
|
|
33
|
+
sendFilterCheckboxToggledMessage: () => { },
|
|
34
|
+
sendFeedbackMessage: () => { },
|
|
31
35
|
sendFooterItemClickedMessage: () => { },
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
36
|
+
sendNavbarMenuItemClickedMessage: () => { },
|
|
37
|
+
sendColorModeSwitchedMessage: () => { },
|
|
38
|
+
sendLanguagePickerChangedMessage: () => { },
|
|
39
|
+
sendProductPickerChangedMessage: () => { },
|
|
40
|
+
sendLogoClickedMessage: () => { },
|
|
41
|
+
sendCodeSnippetReportedMessage: () => { },
|
|
42
|
+
sendMobileMenuClosedMessage: () => { },
|
|
43
|
+
sendMobileMenuOpenedMessage: () => { },
|
|
44
|
+
sendPageViewedMessage: () => { },
|
|
45
|
+
sendPageTimeMessage: () => { },
|
|
46
|
+
sendPageActionsClickedMessage: () => { },
|
|
47
|
+
sendPageEditClickedMessage: () => { },
|
|
48
|
+
sendSidebarDrilldownBackClickedMessage: () => { },
|
|
49
|
+
sendSidebarItemClickedMessage: () => { },
|
|
50
|
+
sendSidebarExpandedMessage: () => { },
|
|
51
|
+
sendSidebarCollapsedMessage: () => { },
|
|
52
|
+
sendChangeLayoutClickedMessage: () => { },
|
|
53
|
+
sendRequestApiAccessClickedMessage: () => { },
|
|
54
|
+
sendVersionPickerChangedMessage: () => { },
|
|
55
|
+
sendSearchInputResetClickedMessage: () => { },
|
|
56
|
+
sendSearchResultClickedMessage: () => { },
|
|
57
|
+
sendSearchRecentRemoveClickedMessage: () => { },
|
|
37
58
|
sendSearchRecentClickedMessage: () => { },
|
|
38
|
-
sendRequestApiAccessButtonClickedMessage: () => { },
|
|
39
|
-
sendVersionPickerSelectionChangeMessage: () => { },
|
|
40
|
-
sendProductPickedMessage: () => { },
|
|
41
|
-
sendFilterCheckboxToggledMessage: () => { },
|
|
42
|
-
sendLanguagePickerLocaleChangedMessage: () => { },
|
|
43
59
|
sendSearchOpenedMessage: () => { },
|
|
44
60
|
sendSearchQueryMessage: () => { },
|
|
45
|
-
|
|
46
|
-
sendSearchAIQueryMessage: () => { },
|
|
47
|
-
sendSearchAIFeedbackMessage: () => { },
|
|
48
|
-
sendFeedbackMessage: () => { },
|
|
49
|
-
sendSearchResultClickedMessage: () => { },
|
|
50
|
-
sendRedirectMessage: () => { },
|
|
61
|
+
sendTocItemClickedMessage: () => { },
|
|
51
62
|
sendOpenapiDocsMessage: () => { },
|
|
52
63
|
sendCopyCodeSnippetClickedMessage: () => { },
|
|
53
64
|
sendViewedMessage: () => { },
|
|
@@ -70,12 +81,9 @@ const useTelemetryFallback = () => ({
|
|
|
70
81
|
sendAsyncapiDocsReferencedInClickedMessage: () => { },
|
|
71
82
|
sendGraphqlDocsViewedMessage: () => { },
|
|
72
83
|
sendGraphqlDocsPerformanceMetricsMessage: () => { },
|
|
84
|
+
sendGraphqlDocsDownloadDefinitionClickedMessage: () => { },
|
|
73
85
|
sendGraphqlDocsReferencedInLinkClickedMessage: () => { },
|
|
74
86
|
sendGraphqlDocsRequiredScopesModalOpenedMessage: () => { },
|
|
75
|
-
sendGraphqlDocsDownloadDefinitionClickedMessage: () => { },
|
|
76
|
-
sendBannerViewedMessage: () => { },
|
|
77
|
-
sendBannerLinkClickedMessage: () => { },
|
|
78
|
-
sendBannerDismissedMessage: () => { },
|
|
79
87
|
});
|
|
80
88
|
exports.useTelemetryFallback = useTelemetryFallback;
|
|
81
89
|
//# sourceMappingURL=use-telemetry-fallback.js.map
|
|
@@ -1013,6 +1013,39 @@ const pages = (0, styled_components_1.css) `
|
|
|
1013
1013
|
|
|
1014
1014
|
// @tokens End
|
|
1015
1015
|
|
|
1016
|
+
/**
|
|
1017
|
+
* @tokens 405 MCP Page
|
|
1018
|
+
* @presenter Color
|
|
1019
|
+
*/
|
|
1020
|
+
--page-mcp-405-font-family: var(--font-family-base); // @presenter FontFamily
|
|
1021
|
+
--page-mcp-405-margin-vertical: var(--spacing-xl);
|
|
1022
|
+
--page-mcp-405-margin-horizontal: calc(var(--spacing-xxl) * 2);
|
|
1023
|
+
--page-mcp-405-gap: var(--spacing-lg);
|
|
1024
|
+
--page-mcp-405-max-width: 680px;
|
|
1025
|
+
--page-mcp-405-margin-vertical-mobile: var(--spacing-xxl);
|
|
1026
|
+
--page-mcp-405-margin-horizontal-mobile: 1rem;
|
|
1027
|
+
|
|
1028
|
+
--page-mcp-405-status-text-color: var(--text-color-helper);
|
|
1029
|
+
--page-mcp-405-status-font-size: var(--font-size-lg); // @presenter FontSize
|
|
1030
|
+
--page-mcp-405-status-line-height: var(--line-height-lg); // @presenter LineHeight
|
|
1031
|
+
--page-mcp-405-status-font-weight: var(--font-weight-semibold); // @presenter FontWeight
|
|
1032
|
+
|
|
1033
|
+
--page-mcp-405-title-text-color: var(--text-color-primary);
|
|
1034
|
+
--page-mcp-405-title-font-size: 42px; // @presenter FontSize
|
|
1035
|
+
--page-mcp-405-title-font-weight: var(--font-weight-bold); // @presenter FontWeight
|
|
1036
|
+
--page-mcp-405-title-line-height: 50px; // @presenter LineHeight
|
|
1037
|
+
--page-mcp-405-title-font-size-mobile: var(--h3-font-size);
|
|
1038
|
+
--page-mcp-405-title-line-height-mobile: var(--h3-line-height);
|
|
1039
|
+
|
|
1040
|
+
--page-mcp-405-description-text-color: var(--text-color-secondary);
|
|
1041
|
+
--page-mcp-405-description-font-size: var(--font-size-xl); // @presenter FontSize
|
|
1042
|
+
--page-mcp-405-description-font-weight: var(--font-weight-regular); // @presenter FontWeight
|
|
1043
|
+
--page-mcp-405-description-line-height: var(--line-height-xl);
|
|
1044
|
+
--page-mcp-405-description-font-size-mobile: var(--font-size-lg);
|
|
1045
|
+
--page-mcp-405-description-line-height-mobile: var(--line-height-lg);
|
|
1046
|
+
|
|
1047
|
+
// @tokens End
|
|
1048
|
+
|
|
1016
1049
|
/**
|
|
1017
1050
|
* @tokens 500 Page
|
|
1018
1051
|
* @presenter Color
|
package/lib/core/types/l10n.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TOptions } from 'i18next';
|
|
2
|
-
export type TranslationKey = 'dev.newApp' | 'dev.newApp.text' | 'dev.sidebar.header' | 'dev.sidebar.footer.text' | 'dev.create.app.dialog.appName.placeholder' | 'dev.create.app.dialog.appName.error' | 'dev.create.app.dialog.selectAPIs' | 'dev.create.app.dialog.description' | 'dev.create.app.dialog.description.placeholder' | 'dev.create.app.dialog.create' | 'dev.create.app.dialog.cancel' | 'dev.main.tab.appKeys' | 'dev.main.tab.logs' | 'dev.app.description.title' | 'dev.edit.description.dialog.title' | 'dev.edit.description.dialog.save' | 'dev.edit.description.dialog.cancel' | 'dev.create.app.dialog.callbackUrls' | 'dev.create.app.dialog.callbackUrls.placeholder' | 'dev.create.app.dialog.callbackUrls.hint' | 'dev.app.callbackUrls.title' | 'dev.edit.callbackUrls.dialog.title' | 'dev.edit.callbackUrls.dialog.placeholder' | 'dev.edit.callbackUrls.dialog.hint' | 'dev.edit.callbackUrls.dialog.save' | 'dev.edit.callbackUrls.dialog.cancel' | 'dev.edit.apis.dialog.selectedAPIs' | 'dev.app.key.create' | 'dev.create.key.dialog.title' | 'dev.create.key.dialog.create' | 'dev.create.key.dialog.cancel' | 'dev.app.edit' | 'dev.app.delete' | 'dev.edit.app.dialog.title' | 'dev.edit.app.dialog.save' | 'dev.edit.app.dialog.cancel' | 'dev.delete.app.dialog.title' | 'dev.delete.app.dialog.confirmation' | 'dev.delete.app.dialog.delete' | 'dev.delete.app.dialog.cancel' | 'dev.app.key.roll' | 'dev.roll.key.dialog.title' | 'dev.roll.key.dialog.apiKey' | 'dev.roll.key.dialog.expires' | 'dev.roll.key.dialog.confirmation' | 'dev.roll.key.dialog.cancel' | 'dev.roll.key.dialog.roll' | 'dev.update.key.dialog.title' | 'dev.update.key.dialog.update' | 'dev.update.key.dialog.cancel' | 'dev.app.key.api.name' | 'dev.app.key.api.status' | 'dev.app.key.api.edit' | 'dev.edit.apis.dialog.title' | 'dev.edit.apis.dialog.apiKey' | 'dev.edit.apis.dialog.save' | 'dev.edit.apis.dialog.cancel' | 'dev.select.placeholder' | 'dev.app.overview.status.pending' | 'dev.app.overview.status.approved' | 'dev.app.overview.status.revoked' | 'dev.app.overview.status' | 'dev.app.overview.non-production' | 'dev.app.overview.production' | 'dev.app.overview.clientId' | 'dev.app.overview.apiKey' | 'dev.app.key.revoke' | 'dev.revoke.key.dialog.title' | 'dev.revoke.key.dialog.apiKey' | 'dev.revoke.key.dialog.expires' | 'dev.revoke.key.dialog.confirmation' | 'dev.revoke.key.dialog.revoke' | 'dev.revoke.key.dialog.cancel' | 'dev.app.overview.expires' | 'dev.app.overview.created' | 'dev.app.overview.visibilityToggle.hide' | 'dev.app.overview.visibilityToggle.show' | 'search.loading' | 'search.noResults.title' | 'search.keys.navigate' | 'search.keys.select' | 'search.keys.exit' | 'search.label' | 'search.cancel' | 'search.recent' | 'search.navbar.label' | 'search.suggested' | 'search.showMore' | 'search.error.title' | 'search.error.button' | 'search.filter.title' | 'search.filter.reset' | 'search.filter.field.reset' | 'search.ai.welcomeText' | 'search.ai.newConversation' | 'search.ai.backToSearch' | 'search.ai.back' | 'search.ai.assistant' | 'search.ai.placeholder' | 'search.ai.generatingResponse' | 'search.ai.followUpQuestion' | 'search.ai.suggestionsTitle' | 'search.ai.thinkingText' | 'search.ai.resourcesFound' | 'search.ai.resourcesFound.basedOn' | 'search.ai.resourcesFound.resources' | 'search.ai.feedback.title' | 'search.ai.feedback.detailsPlaceholder' | 'search.ai.feedback.thanks' | 'search.ai.toolCall.executed' | 'search.ai.toolCall.executing' | 'search.ai.toolCall.withArgs' | 'search.ai.button' | 'search.ai.label' | 'search.ai.disclaimer' | 'search.ai.error.description' | 'search.ai.error.description.forbidden' | 'search.ai.error.description.unauthorized' | 'search.ai.error.header' | 'search.ai.error.header.forbidden' | 'search.ai.error.header.unauthorized' | 'search.ai.feedback.more' | 'search.searchItem.deprecated' | 'search.groups.all' | 'search.filter.field.footer' | 'aiAssistant.trigger' | 'toc.header' | 'footer.copyrightText' | 'page.homeButton' | 'page.forbidden.title' | 'page.forbidden.description' | 'page.notFound.title' | 'page.notFound.description' | 'page.lastUpdated.timeago' | 'page.lastUpdated.on' | 'catalog.filters.placeholder' | 'catalog.filters.title' | 'catalog.filters.add' | 'catalog.filters.clearAll' | 'catalog.filters.select.addFilter' | 'catalog.filters.select.all' | 'catalog.filters.done' | 'catalog.catalogs.all.title' | 'catalog.catalogs.all.description' | 'catalog.catalogs.all.switcherLabel' | 'catalog.catalogs.service.title' | 'catalog.catalogs.service.description' | 'catalog.catalogs.service.switcherLabel' | 'catalog.catalogs.user.title' | 'catalog.catalogs.user.description' | 'catalog.catalogs.user.switcherLabel' | 'catalog.catalogs.team.title' | 'catalog.catalogs.team.description' | 'catalog.catalogs.team.switcherLabel' | 'catalog.catalogs.domain.title' | 'catalog.catalogs.domain.description' | 'catalog.catalogs.domain.switcherLabel' | 'catalog.catalogs.apiDescription.title' | 'catalog.catalogs.apiDescription.description' | 'catalog.catalogs.apiDescription.switcherLabel' | 'catalog.catalogs.dataSchema.title' | 'catalog.catalogs.dataSchema.description' | 'catalog.catalogs.dataSchema.switcherLabel' | 'catalog.catalogs.apiOperation.title' | 'catalog.catalogs.apiOperation.description' | 'catalog.catalogs.apiOperation.switcherLabel' | 'catalog.entity.metadata.title' | 'catalog.entity.schema.title' | 'catalog.entity.properties.apiDescription.title' | 'catalog.backToAllLabel' | 'catalog.notConnected' | 'catalog.tags.label' | 'catalog.sort' | 'catalog.catalogs.label' | 'catalog.owners.label' | 'catalog.repositories.label' | 'catalog.email.label' | 'catalog.format.label' | 'catalog.entityType.label' | 'catalog.domains.label' | 'catalog.contact.label' | 'catalog.methodAndPath.label' | 'catalog.links.label' | 'catalog.metadata.domains' | 'catalog.metadata.owners' | 'catalog.history.button.label' | 'catalog.history.sidebar.title' | 'catalog.history.sidebar.close' | 'catalog.history.version.label' | 'catalog.filters.close' | 'catalog.history.version.notSpecified' | 'catalog.history.version.default' | 'catalog.history.revisions.limitMessage' | 'catalog.history.revision.current' | 'catalog.history.revisions.showLess' | 'catalog.history.revisions.showMore' | 'sidebar.menu.backLabel' | 'sidebar.menu.backToLabel' | 'sidebar.actions.show' | 'sidebar.actions.hide' | 'sidebar.actions.changeToSingleColumn' | 'sidebar.actions.changeToTwoColumns' | 'sidebar.actions.singleColumn' | 'sidebar.actions.twoColumns' | 'versionPicker.label' | 'versionPicker.unversioned' | 'codeSnippet.copy.buttonText' | 'codeSnippet.copy.tooltipText' | 'codeSnippet.copy.toasterText' | 'markdown.editPage.text' | 'feedback.settings.comment.submitText' | 'feedback.settings.comment.label' | 'feedback.settings.comment.send' | 'feedback.settings.comment.cancel' | 'feedback.settings.comment.maxLength' | 'feedback.settings.comment.satisfiedLabel' | 'feedback.settings.comment.neutralLabel' | 'feedback.settings.comment.dissatisfiedLabel' | 'feedback.settings.submitText' | 'feedback.settings.label' | 'feedback.settings.reasons.label' | 'feedback.submit' | 'feedback.cancel' | 'feedback.settings.comment.likeLabel' | 'feedback.settings.comment.dislikeLabel' | 'feedback.sentiment.thumbUp' | 'feedback.sentiment.thumbDown' | 'feedback.settings.leftScaleLabel' | 'feedback.settings.rightScaleLabel' | 'feedback.settings.optionalEmail.placeholder' | 'feedback.settings.optionalEmail.label' | 'codeSnippet.report.buttonText' | 'codeSnippet.report.tooltipText' | 'codeSnippet.report.label' | 'codeSnippet.expand.tooltipText' | 'codeSnippet.collapse.tooltipText' | 'userMenu.login' | 'userMenu.logout' | 'userMenu.devOnboardingLabel' | 'mobileMenu.mainMenu' | 'mobileMenu.previous' | 'mobileMenu.products' | 'mobileMenu.version' | 'navbar.products' | 'page.nextButton' | 'page.previousButton' | 'page.actions.copyButtonText' | 'page.actions.copyTitle' | 'page.actions.copyDescription' | 'page.actions.viewAsMdTitle' | 'page.actions.viewAsMdButtonText' | 'page.actions.viewAsMdDescription' | 'page.actions.chatGptTitle' | 'page.actions.chatGptButtonText' | 'page.actions.chatGptDescription' | 'page.actions.claudeTitle' | 'page.actions.claudeButtonText' | 'page.actions.claudeDescription' | 'page.actions.cursorMcpButtonText' | 'page.actions.cursorMcpTitle' | 'page.actions.cursorMcpDescription' | 'page.actions.connectMcp' | 'page.actions.connectMcp.cursor' | 'page.actions.connectMcp.cursorDescription' | 'page.actions.connectMcp.vscode' | 'page.actions.connectMcp.vscodeDescription' | 'page.actions.connectMcp.copyConfig' | 'page.actions.connectMcp.copyConfigDescription' | 'openapi.download.description.title' | 'openapi.info.title' | 'openapi.info.contact.url' | 'openapi.info.contact.name' | 'openapi.info.license' | 'openapi.info.termsOfService' | 'openapi.info.metadata.title' | 'openapi.key' | 'openapi.value' | 'openapi.enum' | 'openapi.items' | 'openapi.default' | 'openapi.variable' | 'openapi.variables' | 'openapi.actions.show' | 'openapi.actions.hide' | 'openapi.actions.more' | 'openapi.languages.title' | 'openapi.languages.moreButton.tooltipText' | 'openapi.servers.title' | 'openapi.operations' | 'openapi.webhooks' | 'openapi.description' | 'openapi.badges.deprecated' | 'openapi.badges.required' | 'openapi.badges.webhook' | 'openapi.request' | 'openapi.path' | 'openapi.query' | 'openapi.cookie' | 'openapi.header' | 'openapi.body' | 'openapi.responses' | 'openapi.response' | 'openapi.callbacks' | 'openapi.callbackRequest' | 'openapi.callbackResponse' | 'openapi.payload' | 'openapi.discriminator' | 'openapi.contentType' | 'openapi.tryIt' | 'openapi.loading' | 'openapi.example' | 'openapi.examples' | 'openapi.additionalProperties' | 'openapi.patternProperties' | 'openapi.required' | 'openapi.recursive' | 'openapi.complex' | 'openapi.hideExample' | 'openapi.showExample' | 'openapi.expandAll' | 'openapi.collapseAll' | 'openapi.viewSecurityDetails' | 'openapi.noResponseExample' | 'openapi.discriminator.searchPlaceholder' | 'openapi.discriminator.searchNoResults' | 'openapi.discriminator.defaultMapping' | 'openapi.discriminator.defaultMappingTooltip' | 'openapi.noResponseContent' | 'openapi.noRequestPayload' | 'openapi.hidePattern' | 'openapi.showPattern' | 'openapi.authorizationUrl' | 'openapi.tokenUrl' | 'openapi.refreshUrl' | 'openapi.showOptionalScopes' | 'openapi.hideOptionalScopes' | 'openapi.security' | 'openapi.httpAuthorizationScheme' | 'openapi.bearerFormat' | 'openapi.parameterName' | 'openapi.flowType' | 'openapi.connectUrl' | 'openapi.requiredScopes' | 'openapi.unsupportedLanguage' | 'openapi.failedToGenerateCodeSample' | 'openapi.schemaCatalogLink.title' | 'openapi.schemaCatalogLink.copyButtonTooltip' | 'openapi.schemaCatalogLink.copiedTooltip' | 'openapi.mcp.title' | 'openapi.mcp.endpoint' | 'openapi.mcp.tools' | 'openapi.mcp.protocolVersion' | 'openapi.mcp.capabilities' | 'openapi.mcp.experimentalCapabilities' | 'openapi.mcp.inputSchema' | 'openapi.mcp.inputExample' | 'openapi.mcp.outputSchema' | 'openapi.mcp.outputExample' | 'asyncapi.download.description.title' | 'asyncapi.info.title' | 'graphql.download.description.title' | 'graphql.info.title' | 'graphql.info.contact.url' | 'graphql.info.contact.name' | 'graphql.info.license' | 'graphql.info.termsOfService' | 'graphql.overview' | 'graphql.metadata' | 'graphql.key' | 'graphql.value' | 'graphql.queries' | 'graphql.mutations' | 'graphql.subscriptions' | 'graphql.directives' | 'graphql.objects' | 'graphql.interfaces' | 'graphql.unions' | 'graphql.enums' | 'graphql.inputs' | 'graphql.scalars' | 'graphql.arguments.label' | 'graphql.arguments.show' | 'graphql.arguments.hide' | 'graphql.arguments.here' | 'graphql.returnTypes.label' | 'graphql.returnTypes.show' | 'graphql.returnTypes.hide' | 'graphql.possibleTypes' | 'graphql.defaultValue' | 'graphql.deprecationReason' | 'graphql.requiredScopes' | 'graphql.viewSecurityDetails' | 'graphql.objectScopes' | 'graphql.fieldScopes' | 'graphql.implementedInterfaces' | 'graphql.implementedBy' | 'graphql.nonNull' | 'graphql.required' | 'graphql.deprecated' | 'graphql.variables' | 'graphql.querySample' | 'graphql.mutationSample' | 'graphql.subscriptionSample' | 'graphql.responseSample' | 'graphql.locations' | 'graphql.sample' | 'graphql.referenced' | 'graphql.content.fragment' | 'button.copy.tooltipText' | 'button.download.tooltipText' | 'button.externalLink.tooltipText' | 'button.email.tooltipText' | 'codeWalkthrough.download' | 'codeWalkthrough.preview' | 'time.justNow' | 'time.past.second' | 'time.past.seconds' | 'time.past.minute' | 'time.past.minutes' | 'time.past.hour' | 'time.past.hours' | 'time.past.day' | 'time.past.days' | 'time.past.week' | 'time.past.weeks' | 'time.past.month' | 'time.past.months' | 'time.past.year' | 'time.past.years' | 'page.internalServerError.title' | 'page.internalServerError.description' | 'page.skipToContent.label' | 'select.noResults' | 'loaders.loading' | 'filter.dateRange.from' | 'filter.dateRange.to' | 'diagram.openFullscreen' | 'diagram.zoomIn' | 'diagram.zoomOut' | 'diagram.reset' | 'diagram.close' | 'diagram.viewer';
|
|
2
|
+
export type TranslationKey = 'dev.newApp' | 'dev.newApp.text' | 'dev.sidebar.header' | 'dev.sidebar.footer.text' | 'dev.create.app.dialog.appName.placeholder' | 'dev.create.app.dialog.appName.error' | 'dev.create.app.dialog.selectAPIs' | 'dev.create.app.dialog.description' | 'dev.create.app.dialog.description.placeholder' | 'dev.create.app.dialog.create' | 'dev.create.app.dialog.cancel' | 'dev.main.tab.appKeys' | 'dev.main.tab.logs' | 'dev.app.description.title' | 'dev.edit.description.dialog.title' | 'dev.edit.description.dialog.save' | 'dev.edit.description.dialog.cancel' | 'dev.create.app.dialog.callbackUrls' | 'dev.create.app.dialog.callbackUrls.placeholder' | 'dev.create.app.dialog.callbackUrls.hint' | 'dev.app.callbackUrls.title' | 'dev.edit.callbackUrls.dialog.title' | 'dev.edit.callbackUrls.dialog.placeholder' | 'dev.edit.callbackUrls.dialog.hint' | 'dev.edit.callbackUrls.dialog.save' | 'dev.edit.callbackUrls.dialog.cancel' | 'dev.edit.apis.dialog.selectedAPIs' | 'dev.app.key.create' | 'dev.create.key.dialog.title' | 'dev.create.key.dialog.create' | 'dev.create.key.dialog.cancel' | 'dev.app.edit' | 'dev.app.delete' | 'dev.edit.app.dialog.title' | 'dev.edit.app.dialog.save' | 'dev.edit.app.dialog.cancel' | 'dev.delete.app.dialog.title' | 'dev.delete.app.dialog.confirmation' | 'dev.delete.app.dialog.delete' | 'dev.delete.app.dialog.cancel' | 'dev.app.key.roll' | 'dev.roll.key.dialog.title' | 'dev.roll.key.dialog.apiKey' | 'dev.roll.key.dialog.expires' | 'dev.roll.key.dialog.confirmation' | 'dev.roll.key.dialog.cancel' | 'dev.roll.key.dialog.roll' | 'dev.update.key.dialog.title' | 'dev.update.key.dialog.update' | 'dev.update.key.dialog.cancel' | 'dev.app.key.api.name' | 'dev.app.key.api.status' | 'dev.app.key.api.edit' | 'dev.edit.apis.dialog.title' | 'dev.edit.apis.dialog.apiKey' | 'dev.edit.apis.dialog.save' | 'dev.edit.apis.dialog.cancel' | 'dev.select.placeholder' | 'dev.app.overview.status.pending' | 'dev.app.overview.status.approved' | 'dev.app.overview.status.revoked' | 'dev.app.overview.status' | 'dev.app.overview.non-production' | 'dev.app.overview.production' | 'dev.app.overview.clientId' | 'dev.app.overview.apiKey' | 'dev.app.key.revoke' | 'dev.revoke.key.dialog.title' | 'dev.revoke.key.dialog.apiKey' | 'dev.revoke.key.dialog.expires' | 'dev.revoke.key.dialog.confirmation' | 'dev.revoke.key.dialog.revoke' | 'dev.revoke.key.dialog.cancel' | 'dev.app.overview.expires' | 'dev.app.overview.created' | 'dev.app.overview.visibilityToggle.hide' | 'dev.app.overview.visibilityToggle.show' | 'search.loading' | 'search.noResults.title' | 'search.keys.navigate' | 'search.keys.select' | 'search.keys.exit' | 'search.label' | 'search.cancel' | 'search.recent' | 'search.navbar.label' | 'search.suggested' | 'search.showMore' | 'search.error.title' | 'search.error.button' | 'search.filter.title' | 'search.filter.reset' | 'search.filter.field.reset' | 'search.ai.welcomeText' | 'search.ai.newConversation' | 'search.ai.backToSearch' | 'search.ai.back' | 'search.ai.assistant' | 'search.ai.placeholder' | 'search.ai.generatingResponse' | 'search.ai.followUpQuestion' | 'search.ai.suggestionsTitle' | 'search.ai.thinkingText' | 'search.ai.resourcesFound' | 'search.ai.resourcesFound.basedOn' | 'search.ai.resourcesFound.resources' | 'search.ai.feedback.title' | 'search.ai.feedback.detailsPlaceholder' | 'search.ai.feedback.thanks' | 'search.ai.toolCall.executed' | 'search.ai.toolCall.executing' | 'search.ai.toolCall.withArgs' | 'search.ai.button' | 'search.ai.label' | 'search.ai.disclaimer' | 'search.ai.error.description' | 'search.ai.error.description.forbidden' | 'search.ai.error.description.unauthorized' | 'search.ai.error.header' | 'search.ai.error.header.forbidden' | 'search.ai.error.header.unauthorized' | 'search.ai.feedback.more' | 'search.searchItem.deprecated' | 'search.groups.all' | 'search.filter.field.footer' | 'aiAssistant.trigger' | 'toc.header' | 'footer.copyrightText' | 'page.homeButton' | 'page.forbidden.title' | 'page.forbidden.description' | 'page.notFound.title' | 'page.notFound.description' | 'page.mcpNotAllowed.title' | 'page.mcpNotAllowed.description' | 'page.lastUpdated.timeago' | 'page.lastUpdated.on' | 'catalog.filters.placeholder' | 'catalog.filters.title' | 'catalog.filters.add' | 'catalog.filters.clearAll' | 'catalog.filters.select.addFilter' | 'catalog.filters.select.all' | 'catalog.filters.done' | 'catalog.catalogs.all.title' | 'catalog.catalogs.all.description' | 'catalog.catalogs.all.switcherLabel' | 'catalog.catalogs.service.title' | 'catalog.catalogs.service.description' | 'catalog.catalogs.service.switcherLabel' | 'catalog.catalogs.user.title' | 'catalog.catalogs.user.description' | 'catalog.catalogs.user.switcherLabel' | 'catalog.catalogs.team.title' | 'catalog.catalogs.team.description' | 'catalog.catalogs.team.switcherLabel' | 'catalog.catalogs.domain.title' | 'catalog.catalogs.domain.description' | 'catalog.catalogs.domain.switcherLabel' | 'catalog.catalogs.apiDescription.title' | 'catalog.catalogs.apiDescription.description' | 'catalog.catalogs.apiDescription.switcherLabel' | 'catalog.catalogs.dataSchema.title' | 'catalog.catalogs.dataSchema.description' | 'catalog.catalogs.dataSchema.switcherLabel' | 'catalog.catalogs.apiOperation.title' | 'catalog.catalogs.apiOperation.description' | 'catalog.catalogs.apiOperation.switcherLabel' | 'catalog.entity.metadata.title' | 'catalog.entity.schema.title' | 'catalog.entity.properties.apiDescription.title' | 'catalog.backToAllLabel' | 'catalog.notConnected' | 'catalog.tags.label' | 'catalog.sort' | 'catalog.catalogs.label' | 'catalog.owners.label' | 'catalog.repositories.label' | 'catalog.email.label' | 'catalog.format.label' | 'catalog.entityType.label' | 'catalog.domains.label' | 'catalog.contact.label' | 'catalog.methodAndPath.label' | 'catalog.links.label' | 'catalog.metadata.domains' | 'catalog.metadata.owners' | 'catalog.history.button.label' | 'catalog.history.sidebar.title' | 'catalog.history.sidebar.close' | 'catalog.history.version.label' | 'catalog.filters.close' | 'catalog.history.version.notSpecified' | 'catalog.history.version.default' | 'catalog.history.revisions.limitMessage' | 'catalog.history.revision.current' | 'catalog.history.revisions.showLess' | 'catalog.history.revisions.showMore' | 'sidebar.menu.backLabel' | 'sidebar.menu.backToLabel' | 'sidebar.actions.show' | 'sidebar.actions.hide' | 'sidebar.actions.changeToSingleColumn' | 'sidebar.actions.changeToTwoColumns' | 'sidebar.actions.singleColumn' | 'sidebar.actions.twoColumns' | 'versionPicker.label' | 'versionPicker.unversioned' | 'codeSnippet.copy.buttonText' | 'codeSnippet.copy.tooltipText' | 'codeSnippet.copy.toasterText' | 'markdown.editPage.text' | 'feedback.settings.comment.submitText' | 'feedback.settings.comment.label' | 'feedback.settings.comment.send' | 'feedback.settings.comment.cancel' | 'feedback.settings.comment.maxLength' | 'feedback.settings.comment.satisfiedLabel' | 'feedback.settings.comment.neutralLabel' | 'feedback.settings.comment.dissatisfiedLabel' | 'feedback.settings.submitText' | 'feedback.settings.label' | 'feedback.settings.reasons.label' | 'feedback.submit' | 'feedback.cancel' | 'feedback.settings.comment.likeLabel' | 'feedback.settings.comment.dislikeLabel' | 'feedback.sentiment.thumbUp' | 'feedback.sentiment.thumbDown' | 'feedback.settings.leftScaleLabel' | 'feedback.settings.rightScaleLabel' | 'feedback.settings.optionalEmail.placeholder' | 'feedback.settings.optionalEmail.label' | 'codeSnippet.report.buttonText' | 'codeSnippet.report.tooltipText' | 'codeSnippet.report.label' | 'codeSnippet.expand.tooltipText' | 'codeSnippet.collapse.tooltipText' | 'userMenu.login' | 'userMenu.logout' | 'userMenu.devOnboardingLabel' | 'mobileMenu.mainMenu' | 'mobileMenu.previous' | 'mobileMenu.products' | 'mobileMenu.version' | 'navbar.products' | 'page.nextButton' | 'page.previousButton' | 'page.actions.copyButtonText' | 'page.actions.copyTitle' | 'page.actions.copyDescription' | 'page.actions.viewAsMdTitle' | 'page.actions.viewAsMdButtonText' | 'page.actions.viewAsMdDescription' | 'page.actions.chatGptTitle' | 'page.actions.chatGptButtonText' | 'page.actions.chatGptDescription' | 'page.actions.claudeTitle' | 'page.actions.claudeButtonText' | 'page.actions.claudeDescription' | 'page.actions.cursorMcpButtonText' | 'page.actions.cursorMcpTitle' | 'page.actions.cursorMcpDescription' | 'page.actions.connectMcp' | 'page.actions.connectMcp.cursor' | 'page.actions.connectMcp.cursorDescription' | 'page.actions.connectMcp.vscode' | 'page.actions.connectMcp.vscodeDescription' | 'page.actions.connectMcp.copyConfig' | 'page.actions.connectMcp.copyConfigDescription' | 'openapi.download.description.title' | 'openapi.info.title' | 'openapi.info.contact.url' | 'openapi.info.contact.name' | 'openapi.info.license' | 'openapi.info.termsOfService' | 'openapi.info.metadata.title' | 'openapi.key' | 'openapi.value' | 'openapi.enum' | 'openapi.items' | 'openapi.default' | 'openapi.variable' | 'openapi.variables' | 'openapi.actions.show' | 'openapi.actions.hide' | 'openapi.actions.more' | 'openapi.languages.title' | 'openapi.languages.moreButton.tooltipText' | 'openapi.servers.title' | 'openapi.operations' | 'openapi.webhooks' | 'openapi.description' | 'openapi.badges.deprecated' | 'openapi.badges.required' | 'openapi.badges.webhook' | 'openapi.request' | 'openapi.path' | 'openapi.query' | 'openapi.cookie' | 'openapi.header' | 'openapi.body' | 'openapi.responses' | 'openapi.response' | 'openapi.callbacks' | 'openapi.callbackRequest' | 'openapi.callbackResponse' | 'openapi.payload' | 'openapi.discriminator' | 'openapi.contentType' | 'openapi.tryIt' | 'openapi.loading' | 'openapi.example' | 'openapi.examples' | 'openapi.additionalProperties' | 'openapi.patternProperties' | 'openapi.required' | 'openapi.recursive' | 'openapi.complex' | 'openapi.hideExample' | 'openapi.showExample' | 'openapi.expandAll' | 'openapi.collapseAll' | 'openapi.viewSecurityDetails' | 'openapi.noResponseExample' | 'openapi.discriminator.searchPlaceholder' | 'openapi.discriminator.searchNoResults' | 'openapi.discriminator.defaultMapping' | 'openapi.discriminator.defaultMappingTooltip' | 'openapi.noResponseContent' | 'openapi.noRequestPayload' | 'openapi.hidePattern' | 'openapi.showPattern' | 'openapi.authorizationUrl' | 'openapi.tokenUrl' | 'openapi.refreshUrl' | 'openapi.showOptionalScopes' | 'openapi.hideOptionalScopes' | 'openapi.security' | 'openapi.httpAuthorizationScheme' | 'openapi.bearerFormat' | 'openapi.parameterName' | 'openapi.flowType' | 'openapi.connectUrl' | 'openapi.requiredScopes' | 'openapi.unsupportedLanguage' | 'openapi.failedToGenerateCodeSample' | 'openapi.schemaCatalogLink.title' | 'openapi.schemaCatalogLink.copyButtonTooltip' | 'openapi.schemaCatalogLink.copiedTooltip' | 'openapi.mcp.title' | 'openapi.mcp.endpoint' | 'openapi.mcp.tools' | 'openapi.mcp.protocolVersion' | 'openapi.mcp.capabilities' | 'openapi.mcp.experimentalCapabilities' | 'openapi.mcp.inputSchema' | 'openapi.mcp.inputExample' | 'openapi.mcp.outputSchema' | 'openapi.mcp.outputExample' | 'asyncapi.download.description.title' | 'asyncapi.info.title' | 'graphql.download.description.title' | 'graphql.info.title' | 'graphql.info.contact.url' | 'graphql.info.contact.name' | 'graphql.info.license' | 'graphql.info.termsOfService' | 'graphql.overview' | 'graphql.metadata' | 'graphql.key' | 'graphql.value' | 'graphql.queries' | 'graphql.mutations' | 'graphql.subscriptions' | 'graphql.directives' | 'graphql.objects' | 'graphql.interfaces' | 'graphql.unions' | 'graphql.enums' | 'graphql.inputs' | 'graphql.scalars' | 'graphql.arguments.label' | 'graphql.arguments.show' | 'graphql.arguments.hide' | 'graphql.arguments.here' | 'graphql.returnTypes.label' | 'graphql.returnTypes.show' | 'graphql.returnTypes.hide' | 'graphql.possibleTypes' | 'graphql.defaultValue' | 'graphql.deprecationReason' | 'graphql.requiredScopes' | 'graphql.viewSecurityDetails' | 'graphql.objectScopes' | 'graphql.fieldScopes' | 'graphql.implementedInterfaces' | 'graphql.implementedBy' | 'graphql.nonNull' | 'graphql.required' | 'graphql.deprecated' | 'graphql.variables' | 'graphql.querySample' | 'graphql.mutationSample' | 'graphql.subscriptionSample' | 'graphql.responseSample' | 'graphql.locations' | 'graphql.sample' | 'graphql.referenced' | 'graphql.content.fragment' | 'button.copy.tooltipText' | 'button.download.tooltipText' | 'button.externalLink.tooltipText' | 'button.email.tooltipText' | 'codeWalkthrough.download' | 'codeWalkthrough.preview' | 'time.justNow' | 'time.past.second' | 'time.past.seconds' | 'time.past.minute' | 'time.past.minutes' | 'time.past.hour' | 'time.past.hours' | 'time.past.day' | 'time.past.days' | 'time.past.week' | 'time.past.weeks' | 'time.past.month' | 'time.past.months' | 'time.past.year' | 'time.past.years' | 'page.internalServerError.title' | 'page.internalServerError.description' | 'page.skipToContent.label' | 'select.noResults' | 'loaders.loading' | 'filter.dateRange.from' | 'filter.dateRange.to' | 'diagram.openFullscreen' | 'diagram.zoomIn' | 'diagram.zoomOut' | 'diagram.reset' | 'diagram.close' | 'diagram.viewer';
|
|
3
3
|
export type Locale = {
|
|
4
4
|
code: string;
|
|
5
5
|
name: string;
|
|
@@ -125,5 +125,6 @@ export declare enum ToolCallName {
|
|
|
125
125
|
GetEndpointInfo = "get-endpoint-info",
|
|
126
126
|
GetSecuritySchemes = "get-security-schemes",
|
|
127
127
|
GetFullApiDescription = "get-full-api-description",
|
|
128
|
-
Execute = "execute"
|
|
128
|
+
Execute = "execute",
|
|
129
|
+
DescribeTools = "describe-tools"
|
|
129
130
|
}
|
package/lib/core/types/search.js
CHANGED
|
@@ -15,5 +15,6 @@ var ToolCallName;
|
|
|
15
15
|
ToolCallName["GetSecuritySchemes"] = "get-security-schemes";
|
|
16
16
|
ToolCallName["GetFullApiDescription"] = "get-full-api-description";
|
|
17
17
|
ToolCallName["Execute"] = "execute";
|
|
18
|
+
ToolCallName["DescribeTools"] = "describe-tools";
|
|
18
19
|
})(ToolCallName || (exports.ToolCallName = ToolCallName = {}));
|
|
19
20
|
//# sourceMappingURL=search.js.map
|
|
@@ -46,3 +46,5 @@ export * from './content-segments';
|
|
|
46
46
|
export * from './custom-catalog-options-casing';
|
|
47
47
|
export * from './get-auto-dismiss-duration';
|
|
48
48
|
export * from './tooltip-placement';
|
|
49
|
+
export * from './telemetry/get-base-data-attributes';
|
|
50
|
+
export * from './telemetry/generate-before-after-context';
|
package/lib/core/utils/index.js
CHANGED
|
@@ -62,4 +62,6 @@ __exportStar(require("./content-segments"), exports);
|
|
|
62
62
|
__exportStar(require("./custom-catalog-options-casing"), exports);
|
|
63
63
|
__exportStar(require("./get-auto-dismiss-duration"), exports);
|
|
64
64
|
__exportStar(require("./tooltip-placement"), exports);
|
|
65
|
+
__exportStar(require("./telemetry/get-base-data-attributes"), exports);
|
|
66
|
+
__exportStar(require("./telemetry/generate-before-after-context"), exports);
|
|
65
67
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { AsyncApiRealmUI } from '@redocly/realm-asyncapi-sdk';
|
|
2
|
+
type UITelemetryClient = AsyncApiRealmUI.Telemetry;
|
|
3
|
+
type UITelemetryClientMethods = {
|
|
4
|
+
[K in keyof UITelemetryClient]: UITelemetryClient[K] extends (...args: any) => any ? UITelemetryClient[K] : never;
|
|
5
|
+
};
|
|
6
|
+
type UITelemetryClientMethodKeys = {
|
|
7
|
+
[K in keyof UITelemetryClientMethods]: Parameters<UITelemetryClientMethods[K]>[0] extends readonly [any, any, ...any[]] ? K : never;
|
|
8
|
+
}[keyof UITelemetryClientMethods];
|
|
9
|
+
type EventSchemaProps<T extends UITelemetryClientMethodKeys> = Parameters<UITelemetryClientMethods[T]>[0];
|
|
10
|
+
type EventAfterContext<T extends UITelemetryClientMethodKeys> = EventSchemaProps<T>[0];
|
|
11
|
+
type EventBeforeContext<T extends UITelemetryClientMethodKeys> = EventSchemaProps<T>[1];
|
|
12
|
+
/**
|
|
13
|
+
* Builds a typed `[after, before]` tuple for Realm UI telemetry events whose AsyncAPI
|
|
14
|
+
* contract lists the updated state first, then the prior state (per CloudEvents styleguide).
|
|
15
|
+
*
|
|
16
|
+
* Each slice merges {@link getBaseDataAttributes} (`id`, `object`, `uri`) with the
|
|
17
|
+
* corresponding partial payload and sets `context` to `'after'` or `'before'`.
|
|
18
|
+
*
|
|
19
|
+
* @template T - Telemetry client method key whose `data` tuple is
|
|
20
|
+
* `[after, before, ...]` (for example `'sendLanguagePickerChangedMessage'`).
|
|
21
|
+
* @param id - Stable resource identifier passed to {@link getBaseDataAttributes}
|
|
22
|
+
* and included on both payloads.
|
|
23
|
+
* @param object - Resource kind passed to {@link getBaseDataAttributes}
|
|
24
|
+
* and included on both payloads (for example `'dropdown'` or `'button'`).
|
|
25
|
+
* @param before - Event-specific fields for the prior state, excluding `id`, `object`,
|
|
26
|
+
* `uri`, and `context` (filled by this helper).
|
|
27
|
+
* @param after - Event-specific fields for the updated state, excluding `id`, `object`,
|
|
28
|
+
* `uri`, and `context` (filled by this helper).
|
|
29
|
+
* @returns A two-tuple in send order: the fully merged after payload, then the fully
|
|
30
|
+
* merged before payload. Spread into the matching `send*Message` call.
|
|
31
|
+
*/
|
|
32
|
+
export declare function generateBeforeAfterContext<T extends UITelemetryClientMethodKeys>(id: EventAfterContext<T>['id'], object: EventAfterContext<T>['object'], before: Omit<EventBeforeContext<T>, 'id' | 'object' | 'uri' | 'context'>, after: Omit<EventAfterContext<T>, 'id' | 'object' | 'uri' | 'context'>): [EventAfterContext<T> & {
|
|
33
|
+
context: 'after';
|
|
34
|
+
}, EventBeforeContext<T> & {
|
|
35
|
+
context: 'before';
|
|
36
|
+
}];
|
|
37
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.generateBeforeAfterContext = generateBeforeAfterContext;
|
|
4
|
+
const get_base_data_attributes_1 = require("./get-base-data-attributes");
|
|
5
|
+
/**
|
|
6
|
+
* Builds a typed `[after, before]` tuple for Realm UI telemetry events whose AsyncAPI
|
|
7
|
+
* contract lists the updated state first, then the prior state (per CloudEvents styleguide).
|
|
8
|
+
*
|
|
9
|
+
* Each slice merges {@link getBaseDataAttributes} (`id`, `object`, `uri`) with the
|
|
10
|
+
* corresponding partial payload and sets `context` to `'after'` or `'before'`.
|
|
11
|
+
*
|
|
12
|
+
* @template T - Telemetry client method key whose `data` tuple is
|
|
13
|
+
* `[after, before, ...]` (for example `'sendLanguagePickerChangedMessage'`).
|
|
14
|
+
* @param id - Stable resource identifier passed to {@link getBaseDataAttributes}
|
|
15
|
+
* and included on both payloads.
|
|
16
|
+
* @param object - Resource kind passed to {@link getBaseDataAttributes}
|
|
17
|
+
* and included on both payloads (for example `'dropdown'` or `'button'`).
|
|
18
|
+
* @param before - Event-specific fields for the prior state, excluding `id`, `object`,
|
|
19
|
+
* `uri`, and `context` (filled by this helper).
|
|
20
|
+
* @param after - Event-specific fields for the updated state, excluding `id`, `object`,
|
|
21
|
+
* `uri`, and `context` (filled by this helper).
|
|
22
|
+
* @returns A two-tuple in send order: the fully merged after payload, then the fully
|
|
23
|
+
* merged before payload. Spread into the matching `send*Message` call.
|
|
24
|
+
*/
|
|
25
|
+
function generateBeforeAfterContext(id, object, before, after) {
|
|
26
|
+
const baseAttributes = (0, get_base_data_attributes_1.getBaseDataAttributes)(id, object);
|
|
27
|
+
return [
|
|
28
|
+
Object.assign(Object.assign(Object.assign({}, baseAttributes), { context: 'after' }), after),
|
|
29
|
+
Object.assign(Object.assign(Object.assign({}, baseAttributes), { context: 'before' }), before),
|
|
30
|
+
];
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=generate-before-after-context.js.map
|