@lightdash/common 3.276.2 → 3.278.0
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/dist/cjs/.tsbuildinfo +1 -1
- package/dist/cjs/dbt/lintDbtYaml.d.ts +13 -0
- package/dist/cjs/dbt/lintDbtYaml.d.ts.map +1 -0
- package/dist/cjs/dbt/lintDbtYaml.js +92 -0
- package/dist/cjs/dbt/lintDbtYaml.js.map +1 -0
- package/dist/cjs/ee/AiAgent/chartConfig/web/getWebAiChartConfig.d.ts +28 -28
- package/dist/cjs/ee/AiAgent/schemas/tools/toolDashboardV2Args.d.ts +26 -26
- package/dist/cjs/ee/AiAgent/schemas/tools/toolRunMetricQueryArgs.d.ts +62 -62
- package/dist/cjs/ee/AiAgent/utils.d.ts +13 -13
- package/dist/cjs/index.d.ts +1 -0
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/api.d.ts +2 -2
- package/dist/cjs/types/api.d.ts.map +1 -1
- package/dist/cjs/types/api.js.map +1 -1
- package/dist/cjs/types/ci.d.ts +9 -0
- package/dist/cjs/types/ci.d.ts.map +1 -1
- package/dist/cjs/types/semanticStudio.d.ts +33 -0
- package/dist/cjs/types/semanticStudio.d.ts.map +1 -1
- package/dist/cjs/utils/apiSourceQuery.js +1 -1
- package/dist/cjs/utils/apiSourceQuery.js.map +1 -1
- package/dist/cjs/utils/liveSourceIntegrations.d.ts +58 -6
- package/dist/cjs/utils/liveSourceIntegrations.d.ts.map +1 -1
- package/dist/cjs/utils/liveSourceIntegrations.js +120 -7
- package/dist/cjs/utils/liveSourceIntegrations.js.map +1 -1
- package/dist/esm/.tsbuildinfo +1 -1
- package/dist/esm/dbt/lintDbtYaml.d.ts +13 -0
- package/dist/esm/dbt/lintDbtYaml.d.ts.map +1 -0
- package/dist/esm/dbt/lintDbtYaml.js +87 -0
- package/dist/esm/dbt/lintDbtYaml.js.map +1 -0
- package/dist/esm/ee/AiAgent/chartConfig/web/getWebAiChartConfig.d.ts +28 -28
- package/dist/esm/ee/AiAgent/schemas/tools/toolDashboardV2Args.d.ts +26 -26
- package/dist/esm/ee/AiAgent/schemas/tools/toolRunMetricQueryArgs.d.ts +62 -62
- package/dist/esm/ee/AiAgent/utils.d.ts +13 -13
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/api.d.ts +2 -2
- package/dist/esm/types/api.d.ts.map +1 -1
- package/dist/esm/types/api.js.map +1 -1
- package/dist/esm/types/ci.d.ts +9 -0
- package/dist/esm/types/ci.d.ts.map +1 -1
- package/dist/esm/types/semanticStudio.d.ts +33 -0
- package/dist/esm/types/semanticStudio.d.ts.map +1 -1
- package/dist/esm/utils/apiSourceQuery.js +2 -2
- package/dist/esm/utils/apiSourceQuery.js.map +1 -1
- package/dist/esm/utils/liveSourceIntegrations.d.ts +58 -6
- package/dist/esm/utils/liveSourceIntegrations.d.ts.map +1 -1
- package/dist/esm/utils/liveSourceIntegrations.js +117 -6
- package/dist/esm/utils/liveSourceIntegrations.js.map +1 -1
- package/dist/types/.tsbuildinfo +1 -1
- package/dist/types/dbt/lintDbtYaml.d.ts +13 -0
- package/dist/types/dbt/lintDbtYaml.d.ts.map +1 -0
- package/dist/types/dbt/lintDbtYaml.js +87 -0
- package/dist/types/dbt/lintDbtYaml.js.map +1 -0
- package/dist/types/ee/AiAgent/chartConfig/web/getWebAiChartConfig.d.ts +28 -28
- package/dist/types/ee/AiAgent/schemas/tools/toolDashboardV2Args.d.ts +26 -26
- package/dist/types/ee/AiAgent/schemas/tools/toolRunMetricQueryArgs.d.ts +62 -62
- package/dist/types/ee/AiAgent/utils.d.ts +13 -13
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +1 -0
- package/dist/types/index.js.map +1 -1
- package/dist/types/types/api.d.ts +2 -2
- package/dist/types/types/api.d.ts.map +1 -1
- package/dist/types/types/api.js.map +1 -1
- package/dist/types/types/ci.d.ts +9 -0
- package/dist/types/types/ci.d.ts.map +1 -1
- package/dist/types/types/semanticStudio.d.ts +33 -0
- package/dist/types/types/semanticStudio.d.ts.map +1 -1
- package/dist/types/utils/apiSourceQuery.js +2 -2
- package/dist/types/utils/apiSourceQuery.js.map +1 -1
- package/dist/types/utils/liveSourceIntegrations.d.ts +58 -6
- package/dist/types/utils/liveSourceIntegrations.d.ts.map +1 -1
- package/dist/types/utils/liveSourceIntegrations.js +117 -6
- package/dist/types/utils/liveSourceIntegrations.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,18 +1,70 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { type ApiSourceOf, type ExternalConnectionApiSource } from '../ee/externalConnections/types';
|
|
1
3
|
import { ApiConnectorType } from '../types/querySources';
|
|
2
|
-
/**
|
|
3
|
-
export type
|
|
4
|
-
|
|
4
|
+
/** How an admin connects a source, which decides the dialog it opens. */
|
|
5
|
+
export type LiveSourceSetupKind = 'google' | 'posthog' | 'token' | 'linkedin_ads';
|
|
6
|
+
type LiveIntegrationCatalogFields<C extends ApiConnectorType> = {
|
|
7
|
+
/** Stable id, sent with analytics events. */
|
|
8
|
+
id: string;
|
|
9
|
+
/** The name people see when adding and listing sources. */
|
|
5
10
|
label: string;
|
|
11
|
+
/** The name refusals and API errors use. */
|
|
12
|
+
messageLabel: string;
|
|
6
13
|
/** The name AI agents read and repeat. */
|
|
7
14
|
agentLabel: string;
|
|
15
|
+
description: string;
|
|
16
|
+
setup: LiveSourceSetupKind;
|
|
17
|
+
/** The settings a source stores; checked against the API type. */
|
|
18
|
+
settings: z.ZodType<ApiSourceOf<C>>;
|
|
19
|
+
/** What one source reads, shown wherever it is listed. */
|
|
20
|
+
getTarget: (apiSource: ApiSourceOf<C>) => string;
|
|
8
21
|
/** How an agent writes one request in the integration's own query language. */
|
|
9
22
|
agentQueryGuide: string;
|
|
23
|
+
/** Offered by the onboarding tools step. Most sources are added later. */
|
|
24
|
+
inOnboarding?: true;
|
|
10
25
|
};
|
|
11
26
|
/**
|
|
12
|
-
*
|
|
13
|
-
*
|
|
27
|
+
* Everything the backend, the app and AI agents share about each live
|
|
28
|
+
* integration. One entry per connector; a missing one fails typecheck. The
|
|
29
|
+
* agent guide is read in this order, so add new integrations at the end.
|
|
14
30
|
*/
|
|
15
|
-
export declare const
|
|
31
|
+
export declare const LIVE_INTEGRATION_CATALOG: {
|
|
32
|
+
[C in ApiConnectorType]: LiveIntegrationCatalogFields<C>;
|
|
33
|
+
};
|
|
34
|
+
/** One integration's catalog entry, for a source of any connector. */
|
|
35
|
+
export type LiveIntegrationCatalogEntry = Omit<LiveIntegrationCatalogFields<ApiConnectorType>, 'getTarget' | 'settings'> & {
|
|
36
|
+
connector: ApiConnectorType;
|
|
37
|
+
getTarget: (apiSource: ExternalConnectionApiSource) => string;
|
|
38
|
+
};
|
|
39
|
+
export declare const getLiveIntegrationCatalogEntry: (connector: ApiConnectorType) => LiveIntegrationCatalogEntry;
|
|
40
|
+
/** What a source reads: a PostHog project, a Search Console site, a GA4 property and so on. */
|
|
41
|
+
export declare const getLiveSourceTarget: (apiSource: ExternalConnectionApiSource) => string;
|
|
16
42
|
/** The agent tool's description of its query field, one sentence block per integration. */
|
|
17
43
|
export declare const getLiveSourceAgentQueryGuide: () => string;
|
|
44
|
+
/**
|
|
45
|
+
* APIs that answer reports or their own query language, so they could be
|
|
46
|
+
* queried live; users ask for them and we count the requests.
|
|
47
|
+
*/
|
|
48
|
+
export declare const REQUESTABLE_LIVE_INTEGRATIONS: readonly [{
|
|
49
|
+
readonly id: 'shopify';
|
|
50
|
+
readonly label: 'Shopify';
|
|
51
|
+
readonly description: 'Orders, products and sales with ShopifyQL';
|
|
52
|
+
}, {
|
|
53
|
+
readonly id: 'stripe';
|
|
54
|
+
readonly label: 'Stripe';
|
|
55
|
+
readonly description: 'Payments, subscriptions and revenue';
|
|
56
|
+
}, {
|
|
57
|
+
readonly id: 'salesforce';
|
|
58
|
+
readonly label: 'Salesforce';
|
|
59
|
+
readonly description: 'Accounts, opportunities and pipeline with SOQL';
|
|
60
|
+
}, {
|
|
61
|
+
readonly id: 'mixpanel';
|
|
62
|
+
readonly label: 'Mixpanel';
|
|
63
|
+
readonly description: 'Product events, funnels and retention';
|
|
64
|
+
}, {
|
|
65
|
+
readonly id: 'jira';
|
|
66
|
+
readonly label: 'Jira';
|
|
67
|
+
readonly description: 'Issues, sprints and cycle time with JQL';
|
|
68
|
+
}];
|
|
69
|
+
export {};
|
|
18
70
|
//# sourceMappingURL=liveSourceIntegrations.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"liveSourceIntegrations.d.ts","sourceRoot":"","sources":["../../../src/utils/liveSourceIntegrations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,
|
|
1
|
+
{"version":3,"file":"liveSourceIntegrations.d.ts","sourceRoot":"","sources":["../../../src/utils/liveSourceIntegrations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACH,KAAK,WAAW,EAChB,KAAK,2BAA2B,EACnC,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,yEAAyE;AACzE,MAAM,MAAM,mBAAmB,GACzB,QAAQ,GACR,SAAS,GACT,OAAO,GACP,cAAc,CAAC;AAErB,KAAK,4BAA4B,CAAC,CAAC,SAAS,gBAAgB,IAAI;IAC5D,6CAA6C;IAC7C,EAAE,EAAE,MAAM,CAAC;IACX,2DAA2D;IAC3D,KAAK,EAAE,MAAM,CAAC;IACd,4CAA4C;IAC5C,YAAY,EAAE,MAAM,CAAC;IACrB,0CAA0C;IAC1C,UAAU,EAAE,MAAM,C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WAAW,EAAE,uCAAuC;;aAGpD,EAAE,EAAE,MAAM;aACV,KAAK,EAAE,MAAM;aACb,WAAW,EAAE,yCAAyC;EAEpD,CAAC"}
|
|
@@ -1,51 +1,164 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getLiveSourceAgentQueryGuide = exports.
|
|
3
|
+
exports.REQUESTABLE_LIVE_INTEGRATIONS = exports.getLiveSourceAgentQueryGuide = exports.getLiveSourceTarget = exports.getLiveIntegrationCatalogEntry = exports.LIVE_INTEGRATION_CATALOG = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
4
5
|
const querySources_1 = require("../types/querySources");
|
|
5
6
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
7
|
+
* Everything the backend, the app and AI agents share about each live
|
|
8
|
+
* integration. One entry per connector; a missing one fails typecheck. The
|
|
9
|
+
* agent guide is read in this order, so add new integrations at the end.
|
|
8
10
|
*/
|
|
9
|
-
exports.
|
|
11
|
+
exports.LIVE_INTEGRATION_CATALOG = {
|
|
10
12
|
[querySources_1.ApiConnectorType.POSTHOG]: {
|
|
13
|
+
id: 'posthog',
|
|
11
14
|
label: 'PostHog',
|
|
15
|
+
messageLabel: 'PostHog',
|
|
12
16
|
agentLabel: 'PostHog',
|
|
17
|
+
description: 'Product events, persons and sessions with HogQL',
|
|
18
|
+
setup: 'posthog',
|
|
19
|
+
settings: zod_1.z.object({
|
|
20
|
+
connector: zod_1.z.literal(querySources_1.ApiConnectorType.POSTHOG),
|
|
21
|
+
projectId: zod_1.z.string(),
|
|
22
|
+
}),
|
|
23
|
+
getTarget: ({ projectId }) => `Project ${projectId}`,
|
|
13
24
|
agentQueryGuide: 'one HogQL SELECT, the ClickHouse SQL dialect, over tables such as events (event, timestamp, distinct_id, person_id, properties), persons (id, created_at, properties) and sessions. Read a property as properties.$browser or properties.plan. Alias every column with AS using letters, digits and underscores. PostHog stops a query after 10 seconds, so aggregate in HogQL rather than fetching raw events. List event names first when unsure which exist.',
|
|
25
|
+
inOnboarding: true,
|
|
14
26
|
},
|
|
15
27
|
[querySources_1.ApiConnectorType.SEARCH_CONSOLE]: {
|
|
16
|
-
|
|
28
|
+
id: 'google_search_console',
|
|
29
|
+
label: 'Google Search Console',
|
|
30
|
+
messageLabel: 'Search Console',
|
|
17
31
|
agentLabel: 'Search Console',
|
|
32
|
+
description: 'Search clicks, impressions, CTR and position',
|
|
33
|
+
setup: 'google',
|
|
34
|
+
settings: zod_1.z.object({
|
|
35
|
+
connector: zod_1.z.literal(querySources_1.ApiConnectorType.SEARCH_CONSOLE),
|
|
36
|
+
siteUrl: zod_1.z.string(),
|
|
37
|
+
}),
|
|
38
|
+
getTarget: ({ siteUrl }) => siteUrl,
|
|
18
39
|
agentQueryGuide: 'one Search Analytics request as a JSON object with startDate and endDate (YYYY-MM-DD, required), dimensions from date, query, page, country, device and searchAppearance, and optionally type (web, image, video, news, discover, googleNews), dimensionFilterGroups and aggregationType. Rows carry the dimensions plus clicks, impressions, ctr and position; ctr and position are averages, so never sum them. Data lags about two days.',
|
|
40
|
+
inOnboarding: true,
|
|
19
41
|
},
|
|
20
42
|
[querySources_1.ApiConnectorType.GA4]: {
|
|
21
|
-
|
|
43
|
+
id: 'google_analytics',
|
|
44
|
+
label: 'Google Analytics 4',
|
|
45
|
+
messageLabel: 'Google Analytics',
|
|
22
46
|
agentLabel: 'Google Analytics 4',
|
|
47
|
+
description: 'Users, sessions, events and revenue for a property',
|
|
48
|
+
setup: 'google',
|
|
49
|
+
settings: zod_1.z.object({
|
|
50
|
+
connector: zod_1.z.literal(querySources_1.ApiConnectorType.GA4),
|
|
51
|
+
propertyId: zod_1.z.string(),
|
|
52
|
+
}),
|
|
53
|
+
getTarget: ({ propertyId }) => `Property ${propertyId}`,
|
|
23
54
|
agentQueryGuide: 'one runReport request as a JSON object with dateRanges (startDate and endDate as YYYY-MM-DD, today, yesterday or NdaysAgo), metrics (1-10, e.g. activeUsers, sessions, screenPageViews, conversions, totalRevenue) and optionally dimensions (up to 9, e.g. date, country, deviceCategory, sessionSource, pagePath, eventName), dimensionFilter, metricFilter and orderBys in the GA4 Data API shape. Columns are the API names, with any character other than letters, digits and underscores replaced by an underscore; date comes back as YYYY-MM-DD. Rate and average metrics such as bounceRate or averageSessionDuration must not be summed. Each report spends hourly quota on the property, so prefer one aggregated report over many.',
|
|
55
|
+
inOnboarding: true,
|
|
24
56
|
},
|
|
25
57
|
[querySources_1.ApiConnectorType.META_ADS]: {
|
|
58
|
+
id: 'meta_ads',
|
|
26
59
|
label: 'Meta Ads',
|
|
60
|
+
messageLabel: 'Meta Ads',
|
|
27
61
|
agentLabel: 'Meta Ads',
|
|
62
|
+
description: 'Facebook and Instagram ad performance',
|
|
63
|
+
setup: 'token',
|
|
64
|
+
settings: zod_1.z.object({
|
|
65
|
+
connector: zod_1.z.literal(querySources_1.ApiConnectorType.META_ADS),
|
|
66
|
+
adAccountId: zod_1.z.string(),
|
|
67
|
+
}),
|
|
68
|
+
getTarget: ({ adAccountId }) => `Ad account ${adAccountId}`,
|
|
28
69
|
agentQueryGuide: 'one Insights request as a JSON object with level (account, campaign, adset or ad), time_range ({since, until} as YYYY-MM-DD), fields (campaign_id, campaign_name, objective, adset_id, adset_name, ad_id, ad_name, spend, impressions, reach, frequency, clicks, inline_link_clicks, ctr, cpc, cpm, and actions:<type>, action_values:<type> or purchase_roas:<type> such as actions:omni_purchase), and optionally time_increment (1, monthly or all_days), breakdowns (age, gender, country, region, publisher_platform, platform_position), filtering ([{field: campaign.name, campaign.id, adset.name, adset.id, ad.name or ad.id, operator: EQUAL, NOT_EQUAL, IN, NOT_IN, CONTAIN or NOT_CONTAIN, value}]) and sort (one entry such as spend_descending). Column names are the field names, plus date_start when time_increment is set; ctr comes back as a fraction. Reach and frequency are deduplicated per row and frequency depends on reach, so never sum them.',
|
|
29
70
|
},
|
|
30
71
|
[querySources_1.ApiConnectorType.GOOGLE_ADS]: {
|
|
72
|
+
id: 'google_ads',
|
|
31
73
|
label: 'Google Ads',
|
|
74
|
+
messageLabel: 'Google Ads',
|
|
32
75
|
agentLabel: 'Google Ads',
|
|
76
|
+
description: 'Campaign spend, clicks and conversions',
|
|
77
|
+
setup: 'google',
|
|
78
|
+
settings: zod_1.z.object({
|
|
79
|
+
connector: zod_1.z.literal(querySources_1.ApiConnectorType.GOOGLE_ADS),
|
|
80
|
+
customerId: zod_1.z.string(),
|
|
81
|
+
loginCustomerId: zod_1.z.string().nullable(),
|
|
82
|
+
}),
|
|
83
|
+
getTarget: ({ customerId }) => `Account ${customerId}`,
|
|
33
84
|
agentQueryGuide: "one GAQL query, SELECT fields FROM resource (customer for account totals, campaign, ad_group) WHERE segments.date BETWEEN 'YYYY-MM-DD' AND 'YYYY-MM-DD'. GAQL returns one row per resource and segment and never groups, so only select attributes that identify that resource, and a segment in WHERE must also be in SELECT, except dates. Conditions combine only with AND. Columns are the GAQL field names; money metrics come back in the account currency, already converted from micros. Rates and impression shares must not be summed.",
|
|
34
85
|
},
|
|
35
86
|
[querySources_1.ApiConnectorType.YOUTUBE_ANALYTICS]: {
|
|
87
|
+
id: 'youtube_analytics',
|
|
36
88
|
label: 'YouTube Analytics',
|
|
89
|
+
messageLabel: 'YouTube Analytics',
|
|
37
90
|
agentLabel: 'YouTube Analytics',
|
|
91
|
+
description: 'Channel views, watch time and subscribers',
|
|
92
|
+
setup: 'google',
|
|
93
|
+
settings: zod_1.z.object({
|
|
94
|
+
connector: zod_1.z.literal(querySources_1.ApiConnectorType.YOUTUBE_ANALYTICS),
|
|
95
|
+
channelId: zod_1.z.string(),
|
|
96
|
+
}),
|
|
97
|
+
getTarget: ({ channelId }) => `Channel ${channelId}`,
|
|
38
98
|
agentQueryGuide: 'one channel report as a JSON object with startDate and endDate (YYYY-MM-DD, required), metrics as a comma-separated string (e.g. views,estimatedMinutesWatched,subscribersGained), and optionally dimensions (one of day, month, country, video, deviceType or insightTrafficSourceType; deviceType and insightTrafficSourceType may be paired with day), filters such as country==US or video==abc, sort such as -views, and maxResults. The channel comes from the source, so never set ids. A video report needs a descending sort on views, estimatedMinutesWatched, subscribersGained or subscribersLost and at most 200 rows. averageViewDuration and averageViewPercentage are averages, so never sum them.',
|
|
39
99
|
},
|
|
40
100
|
[querySources_1.ApiConnectorType.LINKEDIN_ADS]: {
|
|
101
|
+
id: 'linkedin_ads',
|
|
41
102
|
label: 'LinkedIn Ads',
|
|
103
|
+
messageLabel: 'LinkedIn Ads',
|
|
42
104
|
agentLabel: 'LinkedIn Ads',
|
|
105
|
+
description: 'Campaign reach, clicks and leads',
|
|
106
|
+
setup: 'linkedin_ads',
|
|
107
|
+
settings: zod_1.z.object({
|
|
108
|
+
connector: zod_1.z.literal(querySources_1.ApiConnectorType.LINKEDIN_ADS),
|
|
109
|
+
adAccountId: zod_1.z.string(),
|
|
110
|
+
}),
|
|
111
|
+
getTarget: ({ adAccountId }) => `Ad account ${adAccountId}`,
|
|
43
112
|
agentQueryGuide: 'one adAnalytics report as a JSON object with pivot (ACCOUNT, CAMPAIGN_GROUP or CAMPAIGN), timeGranularity (ALL, DAILY, MONTHLY or YEARLY), dateRange ({start, end} as YYYY-MM-DD), fields (1-18 metric names such as impressions, clicks, costInLocalCurrency, oneClickLeads, externalWebsiteConversions), and optionally dimensions (day, month, year, campaign.id, campaign.name, campaign.status, campaign.type, campaign.objectiveType, campaignGroup.id, campaignGroup.name), campaigns and campaignGroups (lists of numeric IDs). The ad account comes from the source, so never set it. This is sponsored Campaign Manager data, not organic Company Page analytics. approximateMemberReach is deduplicated, so never sum it, and works for at most 92 days. A report returns at most 14,999 rows with no pagination, so aggregate rather than asking for every day of every campaign.',
|
|
44
113
|
},
|
|
45
114
|
};
|
|
115
|
+
const getLiveIntegrationCatalogEntry = (connector) => {
|
|
116
|
+
const { settings, ...entry } = exports.LIVE_INTEGRATION_CATALOG[connector];
|
|
117
|
+
return {
|
|
118
|
+
...entry,
|
|
119
|
+
connector,
|
|
120
|
+
// Only ever called with a source of this connector
|
|
121
|
+
getTarget: entry.getTarget,
|
|
122
|
+
};
|
|
123
|
+
};
|
|
124
|
+
exports.getLiveIntegrationCatalogEntry = getLiveIntegrationCatalogEntry;
|
|
125
|
+
/** What a source reads: a PostHog project, a Search Console site, a GA4 property and so on. */
|
|
126
|
+
const getLiveSourceTarget = (apiSource) => (0, exports.getLiveIntegrationCatalogEntry)(apiSource.connector).getTarget(apiSource);
|
|
127
|
+
exports.getLiveSourceTarget = getLiveSourceTarget;
|
|
46
128
|
/** The agent tool's description of its query field, one sentence block per integration. */
|
|
47
|
-
const getLiveSourceAgentQueryGuide = () => Object.entries(exports.
|
|
129
|
+
const getLiveSourceAgentQueryGuide = () => Object.entries(exports.LIVE_INTEGRATION_CATALOG)
|
|
48
130
|
.map(([connector, { agentQueryGuide }]) => `For "${connector}": ${agentQueryGuide}`)
|
|
49
131
|
.join(' ');
|
|
50
132
|
exports.getLiveSourceAgentQueryGuide = getLiveSourceAgentQueryGuide;
|
|
133
|
+
/**
|
|
134
|
+
* APIs that answer reports or their own query language, so they could be
|
|
135
|
+
* queried live; users ask for them and we count the requests.
|
|
136
|
+
*/
|
|
137
|
+
exports.REQUESTABLE_LIVE_INTEGRATIONS = [
|
|
138
|
+
{
|
|
139
|
+
id: 'shopify',
|
|
140
|
+
label: 'Shopify',
|
|
141
|
+
description: 'Orders, products and sales with ShopifyQL',
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
id: 'stripe',
|
|
145
|
+
label: 'Stripe',
|
|
146
|
+
description: 'Payments, subscriptions and revenue',
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
id: 'salesforce',
|
|
150
|
+
label: 'Salesforce',
|
|
151
|
+
description: 'Accounts, opportunities and pipeline with SOQL',
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
id: 'mixpanel',
|
|
155
|
+
label: 'Mixpanel',
|
|
156
|
+
description: 'Product events, funnels and retention',
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
id: 'jira',
|
|
160
|
+
label: 'Jira',
|
|
161
|
+
description: 'Issues, sprints and cycle time with JQL',
|
|
162
|
+
},
|
|
163
|
+
];
|
|
51
164
|
//# sourceMappingURL=liveSourceIntegrations.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"liveSourceIntegrations.js","sourceRoot":"","sources":["../../../src/utils/liveSourceIntegrations.ts"],"names":[],"mappings":";;;AAAA,wDAAyD;
|
|
1
|
+
{"version":3,"file":"liveSourceIntegrations.js","sourceRoot":"","sources":["../../../src/utils/liveSourceIntegrations.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAKxB,wDAAyD;AA8BzD;;;;GAIG;AACU,QAAA,wBAAwB,GAEjC;IACA,CAAC,+BAAgB,CAAC,OAAO,CAAC,EAAE;QACxB,EAAE,EAAE,SAAS;QACb,KAAK,EAAE,SAAS;QAChB,YAAY,EAAE,SAAS;QACvB,UAAU,EAAE,SAAS;QACrB,WAAW,EAAE,iDAAiD;QAC9D,KAAK,EAAE,SAAS;QAChB,QAAQ,EAAE,OAAC,CAAC,MAAM,CAAC;YACf,SAAS,EAAE,OAAC,CAAC,OAAO,CAAC,+BAAgB,CAAC,OAAO,CAAC;YAC9C,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE;SACxB,CAAC;QACF,SAAS,EAAE,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,WAAW,SAAS,EAAE;QACpD,eAAe,EACX,icAAic;QACrc,YAAY,EAAE,IAAI;KACrB;IACD,CAAC,+BAAgB,CAAC,cAAc,CAAC,EAAE;QAC/B,EAAE,EAAE,uBAAuB;QAC3B,KAAK,EAAE,uBAAuB;QAC9B,YAAY,EAAE,gBAAgB;QAC9B,UAAU,EAAE,gBAAgB;QAC5B,WAAW,EAAE,8CAA8C;QAC3D,KAAK,EAAE,QAAQ;QACf,QAAQ,EAAE,OAAC,CAAC,MAAM,CAAC;YACf,SAAS,EAAE,OAAC,CAAC,OA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