@intlayer/api 9.7.3 → 9.8.0-canary.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/getIntlayerAPI/analytics.cjs +54 -0
- package/dist/cjs/getIntlayerAPI/analytics.cjs.map +1 -1
- package/dist/esm/getIntlayerAPI/analytics.mjs +54 -0
- package/dist/esm/getIntlayerAPI/analytics.mjs.map +1 -1
- package/dist/types/getIntlayerAPI/analytics.d.ts +19 -1
- package/dist/types/getIntlayerAPI/analytics.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -44,6 +44,22 @@ const analyticsEndpoints = {
|
|
|
44
44
|
getPageMetadata: {
|
|
45
45
|
method: "GET",
|
|
46
46
|
path: "/page-metadata"
|
|
47
|
+
},
|
|
48
|
+
getAnalyticsSchema: {
|
|
49
|
+
method: "GET",
|
|
50
|
+
path: "/schema"
|
|
51
|
+
},
|
|
52
|
+
runAnalyticsReport: {
|
|
53
|
+
method: "POST",
|
|
54
|
+
path: "/report"
|
|
55
|
+
},
|
|
56
|
+
runAnalyticsRealtimeReport: {
|
|
57
|
+
method: "POST",
|
|
58
|
+
path: "/realtime-report"
|
|
59
|
+
},
|
|
60
|
+
getAnalyticsAnnotations: {
|
|
61
|
+
method: "GET",
|
|
62
|
+
path: "/annotations"
|
|
47
63
|
}
|
|
48
64
|
};
|
|
49
65
|
const getAnalyticsAPI = (authAPIOptions = {}, intlayerConfig) => {
|
|
@@ -113,8 +129,46 @@ const getAnalyticsAPI = (authAPIOptions = {}, intlayerConfig) => {
|
|
|
113
129
|
method: analyticsEndpoints.getPageMetadata.method,
|
|
114
130
|
params: { url }
|
|
115
131
|
});
|
|
132
|
+
/**
|
|
133
|
+
* What can be reported on: dimensions, metrics and their compatibility,
|
|
134
|
+
* retention, the project's locales and its experiments.
|
|
135
|
+
*/
|
|
136
|
+
const getSchema = async (otherOptions = {}) => await require_fetcher.fetcher((0, _intlayer_backend_contract_defineRoute.buildRouteURL)(backendURL, analyticsGroup, analyticsEndpoints.getAnalyticsSchema), authAPIOptions, otherOptions, { method: analyticsEndpoints.getAnalyticsSchema.method });
|
|
137
|
+
/**
|
|
138
|
+
* Aggregated report: metrics broken down by dimensions over date ranges.
|
|
139
|
+
* @param body - Date ranges, dimensions, metrics, filters, order, paging.
|
|
140
|
+
*/
|
|
141
|
+
const runReport = async (body, otherOptions = {}) => await require_fetcher.fetcher((0, _intlayer_backend_contract_defineRoute.buildRouteURL)(backendURL, analyticsGroup, analyticsEndpoints.runAnalyticsReport), authAPIOptions, otherOptions, {
|
|
142
|
+
method: analyticsEndpoints.runAnalyticsReport.method,
|
|
143
|
+
body
|
|
144
|
+
});
|
|
145
|
+
/**
|
|
146
|
+
* Aggregated activity of the last minutes (up to one hour).
|
|
147
|
+
* @param body - Dimensions, metrics, window and filters.
|
|
148
|
+
*/
|
|
149
|
+
const runRealtimeReport = async (body, otherOptions = {}) => await require_fetcher.fetcher((0, _intlayer_backend_contract_defineRoute.buildRouteURL)(backendURL, analyticsGroup, analyticsEndpoints.runAnalyticsRealtimeReport), authAPIOptions, otherOptions, {
|
|
150
|
+
method: analyticsEndpoints.runAnalyticsRealtimeReport.method,
|
|
151
|
+
body
|
|
152
|
+
});
|
|
153
|
+
/**
|
|
154
|
+
* Dated content and traffic events, to explain report changes.
|
|
155
|
+
* @param query - Window (`YYYY-MM-DD`, `today`, `NdaysAgo`), types, limit.
|
|
156
|
+
*/
|
|
157
|
+
const getAnnotations = async (query = {}, otherOptions = {}) => await require_fetcher.fetcher((0, _intlayer_backend_contract_defineRoute.buildRouteURL)(backendURL, analyticsGroup, analyticsEndpoints.getAnalyticsAnnotations), authAPIOptions, otherOptions, {
|
|
158
|
+
method: analyticsEndpoints.getAnalyticsAnnotations.method,
|
|
159
|
+
params: {
|
|
160
|
+
...query.startDate && { startDate: query.startDate },
|
|
161
|
+
...query.endDate && { endDate: query.endDate },
|
|
162
|
+
...query.types?.length && { types: query.types.join(",") },
|
|
163
|
+
...query.limit !== void 0 && { limit: String(query.limit) }
|
|
164
|
+
}
|
|
165
|
+
});
|
|
116
166
|
return {
|
|
117
167
|
sendEvents,
|
|
168
|
+
getSchema,
|
|
169
|
+
runReport,
|
|
170
|
+
runRealtimeReport,
|
|
171
|
+
getAnnotations,
|
|
118
172
|
getOverview,
|
|
119
173
|
getAudience,
|
|
120
174
|
getLiveVisitorFlow,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analytics.cjs","names":["editor","BACKEND_URL","fetcher","buildRouteURL","createEndpoint"],"sources":["../../../src/getIntlayerAPI/analytics.ts"],"sourcesContent":["import type {\n AnalyticsRoutes,\n AudienceRange,\n analyticsContract,\n GetAnalyticsOverviewResult,\n GetAudienceResult,\n GetContentStatsResult,\n GetExperimentResultsResult,\n GetLiveVisitorFlowResult,\n GetPageFlowResult,\n GetPageMetadataResult,\n IngestAnalyticsBody,\n IngestAnalyticsResult,\n} from '@intlayer/backend-contract/analytics';\nimport type { RouteEndpoints } from '@intlayer/backend-contract/defineRoute';\nimport { buildRouteURL } from '@intlayer/backend-contract/defineRoute';\nimport { editor } from '@intlayer/config/built';\nimport { BACKEND_URL } from '@intlayer/config/defaultValues';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport { createEndpoint } from '../cms/createIntlayerCMS';\nimport { type FetcherOptions, fetcher } from '../fetcher';\n\n/** Prefix of the routes, checked against the backend contract. */\nconst analyticsGroup = {\n prefix: '/api/analytics',\n} as const satisfies Pick<typeof analyticsContract, 'prefix'>;\n\n/**\n * Method and path of every route, checked against the backend contract at\n * compile time (the contract's zod schemas are never loaded).\n */\nconst analyticsEndpoints = {\n ingestAnalyticsEvents: { method: 'POST', path: '/events' },\n getAnalyticsOverview: { method: 'GET', path: '/overview' },\n getAnalyticsAudience: { method: 'GET', path: '/audience' },\n getPageFlow: { method: 'GET', path: '/page-flow' },\n getLiveVisitorFlow: {\n method: 'GET',\n path: '/audience/live/visitors/:visitorId',\n },\n getContentStats: { method: 'GET', path: '/content-stats' },\n getExperimentResults: { method: 'GET', path: '/experiments/:experimentKey' },\n getPageMetadata: { method: 'GET', path: '/page-metadata' },\n} as const satisfies RouteEndpoints<AnalyticsRoutes>;\n\nexport const getAnalyticsAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig?: IntlayerConfig\n) => {\n const backendURL =\n intlayerConfig?.editor?.backendURL ?? editor.backendURL ?? BACKEND_URL;\n\n /**\n * Ingest a batch of analytics events. Public — attribution is by the\n * project's `clientId` in the body.\n * @param body - Session id, sdk version, and the collected events.\n * @returns The number of accepted events.\n */\n const sendEvents = async (\n body: IngestAnalyticsBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<IngestAnalyticsResult>(\n buildRouteURL(\n backendURL,\n analyticsGroup,\n analyticsEndpoints.ingestAnalyticsEvents\n ),\n authAPIOptions,\n otherOptions,\n {\n method: analyticsEndpoints.ingestAnalyticsEvents.method,\n body,\n }\n );\n\n /**\n * Page/locale totals for the authenticated project.\n * @returns Views grouped by url and locale.\n */\n const getOverview = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<GetAnalyticsOverviewResult>(\n buildRouteURL(\n backendURL,\n analyticsGroup,\n analyticsEndpoints.getAnalyticsOverview\n ),\n authAPIOptions,\n otherOptions,\n { method: analyticsEndpoints.getAnalyticsOverview.method }\n );\n\n /**\n * Audience report: distinct visitors (today / 7d / window), page views, the\n * evolution series, and locale + country breakdowns.\n * @param range - Rolling window, either a named range (`1h`, `24h`, `7d`,\n * `30d`, `90d`, `6mo`, `1y`, `3y`) or a number of days (default 30).\n * @returns The audience statistics.\n */\n const getAudience = async (\n range: AudienceRange | number = 30,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetAudienceResult>(\n buildRouteURL(\n backendURL,\n analyticsGroup,\n analyticsEndpoints.getAnalyticsAudience\n ),\n authAPIOptions,\n otherOptions,\n {\n method: analyticsEndpoints.getAnalyticsAudience.method,\n params: typeof range === 'number' ? { days: String(range) } : { range },\n }\n );\n\n /**\n * Per-content exposure totals — \"which content is actually shown\".\n * @returns Exposures grouped by dictionary key, key path, and locale.\n */\n const getContentStats = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<GetContentStatsResult>(\n buildRouteURL(\n backendURL,\n analyticsGroup,\n analyticsEndpoints.getContentStats\n ),\n authAPIOptions,\n otherOptions,\n { method: analyticsEndpoints.getContentStats.method }\n );\n\n /**\n * A/B experiment results with per-variant conversion rates and significance.\n * @param experimentKey - The experiment to evaluate.\n * @returns The experiment result set.\n */\n const getExperimentResults = async (\n experimentKey: string,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetExperimentResultsResult>(\n buildRouteURL(\n backendURL,\n analyticsGroup,\n analyticsEndpoints.getExperimentResults,\n { experimentKey }\n ),\n authAPIOptions,\n otherOptions,\n { method: analyticsEndpoints.getExperimentResults.method }\n );\n\n /**\n * Averaged page-to-page navigation flow from a starting page.\n * @param range - Rolling window of the report.\n * @param startUrl - Starting page pathname (default `/`).\n * @returns The flow steps and the links between them.\n */\n const getPageFlow = async (\n range: AudienceRange,\n startUrl: string,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetPageFlowResult>(\n buildRouteURL(backendURL, analyticsGroup, analyticsEndpoints.getPageFlow),\n authAPIOptions,\n otherOptions,\n {\n method: analyticsEndpoints.getPageFlow.method,\n params: { range, startUrl },\n }\n );\n\n /**\n * Page journey of a visitor active in the last 30 minutes.\n * @param visitorId - The visitor id from the `live` audience report.\n * @returns The visitor and its steps (`visitor: null` once it went quiet).\n */\n const getLiveVisitorFlow = async (\n visitorId: string,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetLiveVisitorFlowResult>(\n buildRouteURL(\n backendURL,\n analyticsGroup,\n analyticsEndpoints.getLiveVisitorFlow,\n { visitorId }\n ),\n authAPIOptions,\n otherOptions,\n { method: analyticsEndpoints.getLiveVisitorFlow.method }\n );\n\n /**\n * Page metadata (title and meta description) for a given url.\n * @param url - The page url to inspect.\n * @returns Title and description of the page.\n */\n const getPageMetadata = async (\n url: string,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetPageMetadataResult>(\n buildRouteURL(\n backendURL,\n analyticsGroup,\n analyticsEndpoints.getPageMetadata\n ),\n authAPIOptions,\n otherOptions,\n {\n method: analyticsEndpoints.getPageMetadata.method,\n params: { url },\n }\n );\n\n return {\n sendEvents,\n getOverview,\n getAudience,\n getLiveVisitorFlow,\n getPageFlow,\n getContentStats,\n getExperimentResults,\n getPageMetadata,\n };\n};\n\n/**\n * Authenticated `analytics` endpoint bound to an Intlayer CMS authenticator.\n *\n * Pass an authenticator created with `createIntlayerCMS`, or omit it to use\n * the build-time configuration (`@intlayer/config/built`).\n */\nexport const analyticsEndpoint = createEndpoint(getAnalyticsAPI);\n"],"mappings":";;;;;;;;;AAuBA,MAAM,iBAAiB,EACrB,QAAQ,iBACV;;;;;AAMA,MAAM,qBAAqB;CACzB,uBAAuB;EAAE,QAAQ;EAAQ,MAAM;CAAU;CACzD,sBAAsB;EAAE,QAAQ;EAAO,MAAM;CAAY;CACzD,sBAAsB;EAAE,QAAQ;EAAO,MAAM;CAAY;CACzD,aAAa;EAAE,QAAQ;EAAO,MAAM;CAAa;CACjD,oBAAoB;EAClB,QAAQ;EACR,MAAM;CACR;CACA,iBAAiB;EAAE,QAAQ;EAAO,MAAM;CAAiB;CACzD,sBAAsB;EAAE,QAAQ;EAAO,MAAM;CAA8B;CAC3E,iBAAiB;EAAE,QAAQ;EAAO,MAAM;CAAiB;AAC3D;AAEA,MAAa,mBACX,iBAAiC,CAAC,GAClC,mBACG;CACH,MAAM,aACJ,gBAAgB,QAAQ,cAAcA,8BAAO,cAAcC;;;;;;;CAQ7D,MAAM,aAAa,OACjB,MACA,eAA+B,CAAC,MAEhC,MAAMC,4BACJC,sDACE,YACA,gBACA,mBAAmB,qBACrB,GACA,gBACA,cACA;EACE,QAAQ,mBAAmB,sBAAsB;EACjD;CACF,CACF;;;;;C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E,QAAQ,mBAAmB,gBAAgB;EAC3C,QAAQ,EAAE,IAAI;CAChB,CACF;CAEF,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;AACF;;;;;;;AAQA,MAAa,oBAAoBC,6CAAe,eAAe"}
|
|
1
|
+
{"version":3,"file":"analytics.cjs","names":["editor","BACKEND_URL","fetcher","buildRouteURL","createEndpoint"],"sources":["../../../src/getIntlayerAPI/analytics.ts"],"sourcesContent":["import type {\n AnalyticsAnnotationType,\n AnalyticsRoutes,\n AudienceRange,\n analyticsContract,\n GetAnalyticsAnnotationsResult,\n GetAnalyticsOverviewResult,\n GetAnalyticsSchemaResult,\n GetAudienceResult,\n GetContentStatsResult,\n GetExperimentResultsResult,\n GetLiveVisitorFlowResult,\n GetPageFlowResult,\n GetPageMetadataResult,\n IngestAnalyticsBody,\n IngestAnalyticsResult,\n RunAnalyticsRealtimeReportBody,\n RunAnalyticsReportBody,\n RunAnalyticsReportResult,\n} from '@intlayer/backend-contract/analytics';\nimport type { RouteEndpoints } from '@intlayer/backend-contract/defineRoute';\nimport { buildRouteURL } from '@intlayer/backend-contract/defineRoute';\nimport { editor } from '@intlayer/config/built';\nimport { BACKEND_URL } from '@intlayer/config/defaultValues';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport { createEndpoint } from '../cms/createIntlayerCMS';\nimport { type FetcherOptions, fetcher } from '../fetcher';\n\n/** Prefix of the routes, checked against the backend contract. */\nconst analyticsGroup = {\n prefix: '/api/analytics',\n} as const satisfies Pick<typeof analyticsContract, 'prefix'>;\n\n/**\n * Method and path of every route, checked against the backend contract at\n * compile time (the contract's zod schemas are never loaded).\n */\nconst analyticsEndpoints = {\n ingestAnalyticsEvents: { method: 'POST', path: '/events' },\n getAnalyticsOverview: { method: 'GET', path: '/overview' },\n getAnalyticsAudience: { method: 'GET', path: '/audience' },\n getPageFlow: { method: 'GET', path: '/page-flow' },\n getLiveVisitorFlow: {\n method: 'GET',\n path: '/audience/live/visitors/:visitorId',\n },\n getContentStats: { method: 'GET', path: '/content-stats' },\n getExperimentResults: { method: 'GET', path: '/experiments/:experimentKey' },\n getPageMetadata: { method: 'GET', path: '/page-metadata' },\n getAnalyticsSchema: { method: 'GET', path: '/schema' },\n runAnalyticsReport: { method: 'POST', path: '/report' },\n runAnalyticsRealtimeReport: { method: 'POST', path: '/realtime-report' },\n getAnalyticsAnnotations: { method: 'GET', path: '/annotations' },\n} as const satisfies RouteEndpoints<AnalyticsRoutes>;\n\nexport const getAnalyticsAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig?: IntlayerConfig\n) => {\n const backendURL =\n intlayerConfig?.editor?.backendURL ?? editor.backendURL ?? BACKEND_URL;\n\n /**\n * Ingest a batch of analytics events. Public — attribution is by the\n * project's `clientId` in the body.\n * @param body - Session id, sdk version, and the collected events.\n * @returns The number of accepted events.\n */\n const sendEvents = async (\n body: IngestAnalyticsBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<IngestAnalyticsResult>(\n buildRouteURL(\n backendURL,\n analyticsGroup,\n analyticsEndpoints.ingestAnalyticsEvents\n ),\n authAPIOptions,\n otherOptions,\n {\n method: analyticsEndpoints.ingestAnalyticsEvents.method,\n body,\n }\n );\n\n /**\n * Page/locale totals for the authenticated project.\n * @returns Views grouped by url and locale.\n */\n const getOverview = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<GetAnalyticsOverviewResult>(\n buildRouteURL(\n backendURL,\n analyticsGroup,\n analyticsEndpoints.getAnalyticsOverview\n ),\n authAPIOptions,\n otherOptions,\n { method: analyticsEndpoints.getAnalyticsOverview.method }\n );\n\n /**\n * Audience report: distinct visitors (today / 7d / window), page views, the\n * evolution series, and locale + country breakdowns.\n * @param range - Rolling window, either a named range (`1h`, `24h`, `7d`,\n * `30d`, `90d`, `6mo`, `1y`, `3y`) or a number of days (default 30).\n * @returns The audience statistics.\n */\n const getAudience = async (\n range: AudienceRange | number = 30,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetAudienceResult>(\n buildRouteURL(\n backendURL,\n analyticsGroup,\n analyticsEndpoints.getAnalyticsAudience\n ),\n authAPIOptions,\n otherOptions,\n {\n method: analyticsEndpoints.getAnalyticsAudience.method,\n params: typeof range === 'number' ? { days: String(range) } : { range },\n }\n );\n\n /**\n * Per-content exposure totals — \"which content is actually shown\".\n * @returns Exposures grouped by dictionary key, key path, and locale.\n */\n const getContentStats = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<GetContentStatsResult>(\n buildRouteURL(\n backendURL,\n analyticsGroup,\n analyticsEndpoints.getContentStats\n ),\n authAPIOptions,\n otherOptions,\n { method: analyticsEndpoints.getContentStats.method }\n );\n\n /**\n * A/B experiment results with per-variant conversion rates and significance.\n * @param experimentKey - The experiment to evaluate.\n * @returns The experiment result set.\n */\n const getExperimentResults = async (\n experimentKey: string,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetExperimentResultsResult>(\n buildRouteURL(\n backendURL,\n analyticsGroup,\n analyticsEndpoints.getExperimentResults,\n { experimentKey }\n ),\n authAPIOptions,\n otherOptions,\n { method: analyticsEndpoints.getExperimentResults.method }\n );\n\n /**\n * Averaged page-to-page navigation flow from a starting page.\n * @param range - Rolling window of the report.\n * @param startUrl - Starting page pathname (default `/`).\n * @returns The flow steps and the links between them.\n */\n const getPageFlow = async (\n range: AudienceRange,\n startUrl: string,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetPageFlowResult>(\n buildRouteURL(backendURL, analyticsGroup, analyticsEndpoints.getPageFlow),\n authAPIOptions,\n otherOptions,\n {\n method: analyticsEndpoints.getPageFlow.method,\n params: { range, startUrl },\n }\n );\n\n /**\n * Page journey of a visitor active in the last 30 minutes.\n * @param visitorId - The visitor id from the `live` audience report.\n * @returns The visitor and its steps (`visitor: null` once it went quiet).\n */\n const getLiveVisitorFlow = async (\n visitorId: string,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetLiveVisitorFlowResult>(\n buildRouteURL(\n backendURL,\n analyticsGroup,\n analyticsEndpoints.getLiveVisitorFlow,\n { visitorId }\n ),\n authAPIOptions,\n otherOptions,\n { method: analyticsEndpoints.getLiveVisitorFlow.method }\n );\n\n /**\n * Page metadata (title and meta description) for a given url.\n * @param url - The page url to inspect.\n * @returns Title and description of the page.\n */\n const getPageMetadata = async (\n url: string,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetPageMetadataResult>(\n buildRouteURL(\n backendURL,\n analyticsGroup,\n analyticsEndpoints.getPageMetadata\n ),\n authAPIOptions,\n otherOptions,\n {\n method: analyticsEndpoints.getPageMetadata.method,\n params: { url },\n }\n );\n\n /**\n * What can be reported on: dimensions, metrics and their compatibility,\n * retention, the project's locales and its experiments.\n */\n const getSchema = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<GetAnalyticsSchemaResult>(\n buildRouteURL(\n backendURL,\n analyticsGroup,\n analyticsEndpoints.getAnalyticsSchema\n ),\n authAPIOptions,\n otherOptions,\n { method: analyticsEndpoints.getAnalyticsSchema.method }\n );\n\n /**\n * Aggregated report: metrics broken down by dimensions over date ranges.\n * @param body - Date ranges, dimensions, metrics, filters, order, paging.\n */\n const runReport = async (\n body: RunAnalyticsReportBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<RunAnalyticsReportResult>(\n buildRouteURL(\n backendURL,\n analyticsGroup,\n analyticsEndpoints.runAnalyticsReport\n ),\n authAPIOptions,\n otherOptions,\n { method: analyticsEndpoints.runAnalyticsReport.method, body }\n );\n\n /**\n * Aggregated activity of the last minutes (up to one hour).\n * @param body - Dimensions, metrics, window and filters.\n */\n const runRealtimeReport = async (\n body: RunAnalyticsRealtimeReportBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<RunAnalyticsReportResult>(\n buildRouteURL(\n backendURL,\n analyticsGroup,\n analyticsEndpoints.runAnalyticsRealtimeReport\n ),\n authAPIOptions,\n otherOptions,\n { method: analyticsEndpoints.runAnalyticsRealtimeReport.method, body }\n );\n\n /**\n * Dated content and traffic events, to explain report changes.\n * @param query - Window (`YYYY-MM-DD`, `today`, `NdaysAgo`), types, limit.\n */\n const getAnnotations = async (\n query: {\n startDate?: string;\n endDate?: string;\n types?: AnalyticsAnnotationType[];\n limit?: number;\n } = {},\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetAnalyticsAnnotationsResult>(\n buildRouteURL(\n backendURL,\n analyticsGroup,\n analyticsEndpoints.getAnalyticsAnnotations\n ),\n authAPIOptions,\n otherOptions,\n {\n method: analyticsEndpoints.getAnalyticsAnnotations.method,\n params: {\n ...(query.startDate && { startDate: query.startDate }),\n ...(query.endDate && { endDate: query.endDate }),\n ...(query.types?.length && { types: query.types.join(',') }),\n ...(query.limit !== undefined && { limit: String(query.limit) }),\n },\n }\n );\n\n return {\n sendEvents,\n getSchema,\n runReport,\n runRealtimeReport,\n getAnnotations,\n getOverview,\n getAudience,\n getLiveVisitorFlow,\n getPageFlow,\n getContentStats,\n getExperimentResults,\n getPageMetadata,\n };\n};\n\n/**\n * Authenticated `analytics` endpoint bound to an Intlayer CMS authenticator.\n *\n * Pass an authenticator created with `createIntlayerCMS`, or omit it to use\n * the build-time configuration (`@intlayer/config/built`).\n */\nexport const analyticsEndpoint = createEndpoint(getAnalyticsAPI);\n"],"mappings":";;;;;;;;;AA6BA,MAAM,iBAAiB,EACrB,QAAQ,iBACV;;;;;AAMA,MAAM,qBAAqB;CACzB,uBAAuB;EAAE,QAAQ;EAAQ,MAAM;CAAU;CACzD,sBAAsB;EAAE,QAAQ;EAAO,MAAM;CAAY;CACzD,sBAAsB;EAAE,QAAQ;EAAO,MAAM;CAAY;CACzD,aAAa;EAAE,QAAQ;EAAO,MAAM;CAAa;CACjD,oBAAoB;EAClB,QAAQ;EACR,MAAM;CACR;CACA,iBAAiB;EAAE,QAAQ;EAAO,MAAM;CAAiB;CACzD,sBAAsB;EAAE,QAAQ;EAAO,MAAM;CAA8B;CAC3E,iBAAiB;EAAE,QAAQ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EAAE,WAAW,MAAM,UAAU;GACpD,GAAI,MAAM,WAAW,EAAE,SAAS,MAAM,QAAQ;GAC9C,GAAI,MAAM,OAAO,UAAU,EAAE,OAAO,MAAM,MAAM,KAAK,GAAG,EAAE;GAC1D,GAAI,MAAM,UAAU,UAAa,EAAE,OAAO,OAAO,MAAM,KAAK,EAAE;EAChE;CACF,CACF;CAEF,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;AACF;;;;;;;AAQA,MAAa,oBAAoBC,6CAAe,eAAe"}
|
|
@@ -43,6 +43,22 @@ const analyticsEndpoints = {
|
|
|
43
43
|
getPageMetadata: {
|
|
44
44
|
method: "GET",
|
|
45
45
|
path: "/page-metadata"
|
|
46
|
+
},
|
|
47
|
+
getAnalyticsSchema: {
|
|
48
|
+
method: "GET",
|
|
49
|
+
path: "/schema"
|
|
50
|
+
},
|
|
51
|
+
runAnalyticsReport: {
|
|
52
|
+
method: "POST",
|
|
53
|
+
path: "/report"
|
|
54
|
+
},
|
|
55
|
+
runAnalyticsRealtimeReport: {
|
|
56
|
+
method: "POST",
|
|
57
|
+
path: "/realtime-report"
|
|
58
|
+
},
|
|
59
|
+
getAnalyticsAnnotations: {
|
|
60
|
+
method: "GET",
|
|
61
|
+
path: "/annotations"
|
|
46
62
|
}
|
|
47
63
|
};
|
|
48
64
|
const getAnalyticsAPI = (authAPIOptions = {}, intlayerConfig) => {
|
|
@@ -112,8 +128,46 @@ const getAnalyticsAPI = (authAPIOptions = {}, intlayerConfig) => {
|
|
|
112
128
|
method: analyticsEndpoints.getPageMetadata.method,
|
|
113
129
|
params: { url }
|
|
114
130
|
});
|
|
131
|
+
/**
|
|
132
|
+
* What can be reported on: dimensions, metrics and their compatibility,
|
|
133
|
+
* retention, the project's locales and its experiments.
|
|
134
|
+
*/
|
|
135
|
+
const getSchema = async (otherOptions = {}) => await fetcher(buildRouteURL(backendURL, analyticsGroup, analyticsEndpoints.getAnalyticsSchema), authAPIOptions, otherOptions, { method: analyticsEndpoints.getAnalyticsSchema.method });
|
|
136
|
+
/**
|
|
137
|
+
* Aggregated report: metrics broken down by dimensions over date ranges.
|
|
138
|
+
* @param body - Date ranges, dimensions, metrics, filters, order, paging.
|
|
139
|
+
*/
|
|
140
|
+
const runReport = async (body, otherOptions = {}) => await fetcher(buildRouteURL(backendURL, analyticsGroup, analyticsEndpoints.runAnalyticsReport), authAPIOptions, otherOptions, {
|
|
141
|
+
method: analyticsEndpoints.runAnalyticsReport.method,
|
|
142
|
+
body
|
|
143
|
+
});
|
|
144
|
+
/**
|
|
145
|
+
* Aggregated activity of the last minutes (up to one hour).
|
|
146
|
+
* @param body - Dimensions, metrics, window and filters.
|
|
147
|
+
*/
|
|
148
|
+
const runRealtimeReport = async (body, otherOptions = {}) => await fetcher(buildRouteURL(backendURL, analyticsGroup, analyticsEndpoints.runAnalyticsRealtimeReport), authAPIOptions, otherOptions, {
|
|
149
|
+
method: analyticsEndpoints.runAnalyticsRealtimeReport.method,
|
|
150
|
+
body
|
|
151
|
+
});
|
|
152
|
+
/**
|
|
153
|
+
* Dated content and traffic events, to explain report changes.
|
|
154
|
+
* @param query - Window (`YYYY-MM-DD`, `today`, `NdaysAgo`), types, limit.
|
|
155
|
+
*/
|
|
156
|
+
const getAnnotations = async (query = {}, otherOptions = {}) => await fetcher(buildRouteURL(backendURL, analyticsGroup, analyticsEndpoints.getAnalyticsAnnotations), authAPIOptions, otherOptions, {
|
|
157
|
+
method: analyticsEndpoints.getAnalyticsAnnotations.method,
|
|
158
|
+
params: {
|
|
159
|
+
...query.startDate && { startDate: query.startDate },
|
|
160
|
+
...query.endDate && { endDate: query.endDate },
|
|
161
|
+
...query.types?.length && { types: query.types.join(",") },
|
|
162
|
+
...query.limit !== void 0 && { limit: String(query.limit) }
|
|
163
|
+
}
|
|
164
|
+
});
|
|
115
165
|
return {
|
|
116
166
|
sendEvents,
|
|
167
|
+
getSchema,
|
|
168
|
+
runReport,
|
|
169
|
+
runRealtimeReport,
|
|
170
|
+
getAnnotations,
|
|
117
171
|
getOverview,
|
|
118
172
|
getAudience,
|
|
119
173
|
getLiveVisitorFlow,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analytics.mjs","names":[],"sources":["../../../src/getIntlayerAPI/analytics.ts"],"sourcesContent":["import type {\n AnalyticsRoutes,\n AudienceRange,\n analyticsContract,\n GetAnalyticsOverviewResult,\n GetAudienceResult,\n GetContentStatsResult,\n GetExperimentResultsResult,\n GetLiveVisitorFlowResult,\n GetPageFlowResult,\n GetPageMetadataResult,\n IngestAnalyticsBody,\n IngestAnalyticsResult,\n} from '@intlayer/backend-contract/analytics';\nimport type { RouteEndpoints } from '@intlayer/backend-contract/defineRoute';\nimport { buildRouteURL } from '@intlayer/backend-contract/defineRoute';\nimport { editor } from '@intlayer/config/built';\nimport { BACKEND_URL } from '@intlayer/config/defaultValues';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport { createEndpoint } from '../cms/createIntlayerCMS';\nimport { type FetcherOptions, fetcher } from '../fetcher';\n\n/** Prefix of the routes, checked against the backend contract. */\nconst analyticsGroup = {\n prefix: '/api/analytics',\n} as const satisfies Pick<typeof analyticsContract, 'prefix'>;\n\n/**\n * Method and path of every route, checked against the backend contract at\n * compile time (the contract's zod schemas are never loaded).\n */\nconst analyticsEndpoints = {\n ingestAnalyticsEvents: { method: 'POST', path: '/events' },\n getAnalyticsOverview: { method: 'GET', path: '/overview' },\n getAnalyticsAudience: { method: 'GET', path: '/audience' },\n getPageFlow: { method: 'GET', path: '/page-flow' },\n getLiveVisitorFlow: {\n method: 'GET',\n path: '/audience/live/visitors/:visitorId',\n },\n getContentStats: { method: 'GET', path: '/content-stats' },\n getExperimentResults: { method: 'GET', path: '/experiments/:experimentKey' },\n getPageMetadata: { method: 'GET', path: '/page-metadata' },\n} as const satisfies RouteEndpoints<AnalyticsRoutes>;\n\nexport const getAnalyticsAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig?: IntlayerConfig\n) => {\n const backendURL =\n intlayerConfig?.editor?.backendURL ?? editor.backendURL ?? BACKEND_URL;\n\n /**\n * Ingest a batch of analytics events. Public — attribution is by the\n * project's `clientId` in the body.\n * @param body - Session id, sdk version, and the collected events.\n * @returns The number of accepted events.\n */\n const sendEvents = async (\n body: IngestAnalyticsBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<IngestAnalyticsResult>(\n buildRouteURL(\n backendURL,\n analyticsGroup,\n analyticsEndpoints.ingestAnalyticsEvents\n ),\n authAPIOptions,\n otherOptions,\n {\n method: analyticsEndpoints.ingestAnalyticsEvents.method,\n body,\n }\n );\n\n /**\n * Page/locale totals for the authenticated project.\n * @returns Views grouped by url and locale.\n */\n const getOverview = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<GetAnalyticsOverviewResult>(\n buildRouteURL(\n backendURL,\n analyticsGroup,\n analyticsEndpoints.getAnalyticsOverview\n ),\n authAPIOptions,\n otherOptions,\n { method: analyticsEndpoints.getAnalyticsOverview.method }\n );\n\n /**\n * Audience report: distinct visitors (today / 7d / window), page views, the\n * evolution series, and locale + country breakdowns.\n * @param range - Rolling window, either a named range (`1h`, `24h`, `7d`,\n * `30d`, `90d`, `6mo`, `1y`, `3y`) or a number of days (default 30).\n * @returns The audience statistics.\n */\n const getAudience = async (\n range: AudienceRange | number = 30,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetAudienceResult>(\n buildRouteURL(\n backendURL,\n analyticsGroup,\n analyticsEndpoints.getAnalyticsAudience\n ),\n authAPIOptions,\n otherOptions,\n {\n method: analyticsEndpoints.getAnalyticsAudience.method,\n params: typeof range === 'number' ? { days: String(range) } : { range },\n }\n );\n\n /**\n * Per-content exposure totals — \"which content is actually shown\".\n * @returns Exposures grouped by dictionary key, key path, and locale.\n */\n const getContentStats = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<GetContentStatsResult>(\n buildRouteURL(\n backendURL,\n analyticsGroup,\n analyticsEndpoints.getContentStats\n ),\n authAPIOptions,\n otherOptions,\n { method: analyticsEndpoints.getContentStats.method }\n );\n\n /**\n * A/B experiment results with per-variant conversion rates and significance.\n * @param experimentKey - The experiment to evaluate.\n * @returns The experiment result set.\n */\n const getExperimentResults = async (\n experimentKey: string,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetExperimentResultsResult>(\n buildRouteURL(\n backendURL,\n analyticsGroup,\n analyticsEndpoints.getExperimentResults,\n { experimentKey }\n ),\n authAPIOptions,\n otherOptions,\n { method: analyticsEndpoints.getExperimentResults.method }\n );\n\n /**\n * Averaged page-to-page navigation flow from a starting page.\n * @param range - Rolling window of the report.\n * @param startUrl - Starting page pathname (default `/`).\n * @returns The flow steps and the links between them.\n */\n const getPageFlow = async (\n range: AudienceRange,\n startUrl: string,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetPageFlowResult>(\n buildRouteURL(backendURL, analyticsGroup, analyticsEndpoints.getPageFlow),\n authAPIOptions,\n otherOptions,\n {\n method: analyticsEndpoints.getPageFlow.method,\n params: { range, startUrl },\n }\n );\n\n /**\n * Page journey of a visitor active in the last 30 minutes.\n * @param visitorId - The visitor id from the `live` audience report.\n * @returns The visitor and its steps (`visitor: null` once it went quiet).\n */\n const getLiveVisitorFlow = async (\n visitorId: string,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetLiveVisitorFlowResult>(\n buildRouteURL(\n backendURL,\n analyticsGroup,\n analyticsEndpoints.getLiveVisitorFlow,\n { visitorId }\n ),\n authAPIOptions,\n otherOptions,\n { method: analyticsEndpoints.getLiveVisitorFlow.method }\n );\n\n /**\n * Page metadata (title and meta description) for a given url.\n * @param url - The page url to inspect.\n * @returns Title and description of the page.\n */\n const getPageMetadata = async (\n url: string,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetPageMetadataResult>(\n buildRouteURL(\n backendURL,\n analyticsGroup,\n analyticsEndpoints.getPageMetadata\n ),\n authAPIOptions,\n otherOptions,\n {\n method: analyticsEndpoints.getPageMetadata.method,\n params: { url },\n }\n );\n\n return {\n sendEvents,\n getOverview,\n getAudience,\n getLiveVisitorFlow,\n getPageFlow,\n getContentStats,\n getExperimentResults,\n getPageMetadata,\n };\n};\n\n/**\n * Authenticated `analytics` endpoint bound to an Intlayer CMS authenticator.\n *\n * Pass an authenticator created with `createIntlayerCMS`, or omit it to use\n * the build-time configuration (`@intlayer/config/built`).\n */\nexport const analyticsEndpoint = createEndpoint(getAnalyticsAPI);\n"],"mappings":";;;;;;;;AAuBA,MAAM,iBAAiB,EACrB,QAAQ,iBACV;;;;;AAMA,MAAM,qBAAqB;CACzB,uBAAuB;EAAE,QAAQ;EAAQ,MAAM;CAAU;CACzD,sBAAsB;EAAE,QAAQ;EAAO,MAAM;CAAY;CACzD,sBAAsB;EAAE,QAAQ;EAAO,MAAM;CAAY;CACzD,aAAa;EAAE,QAAQ;EAAO,MAAM;CAAa;CACjD,oBAAoB;EAClB,QAAQ;EACR,MAAM;CACR;CACA,iBAAiB;EAAE,QAAQ;EAAO,MAAM;CAAiB;CACzD,sBAAsB;EAAE,QAAQ;EAAO,MAAM;CAA8B;CAC3E,iBAAiB;EAAE,QAAQ;EAAO,MAAM;CAAiB;AAC3D;AAEA,MAAa,mBACX,iBAAiC,CAAC,GAClC,mBACG;CACH,MAAM,aACJ,gBAAgB,QAAQ,cAAc,OAAO,cAAc;;;;;;;CAQ7D,MAAM,aAAa,OACjB,MACA,eAA+B,CAAC,MAEhC,MAAM,QACJ,cACE,YACA,gBACA,mBAAmB,qBACrB,GACA,gBACA,cACA;EACE,QAAQ,mBAAmB,sBAAsB;EACjD;CACF,CACF;;;;;CAMF,MAAM,cAAc,OAAO,eAA+B,CAAC,MACzD,MAAM,QACJ,cACE,YACA,gBACA,mBAAmB,oBACrB,GACA,gBACA,cACA,EAAE,QAAQ,mBAAmB,qBAAqB,OAAO,CAC3D;;;;;;;;CASF,MAAM,cAAc,OAClB,QAAgC,IAChC,eAA+B,CAAC,MAEhC,MAAM,QACJ,cACE,YACA,gBACA,mBAAmB,oBACrB,GACA,gBACA,cACA;EACE,QAAQ,mBAAmB,qBAAqB;EAChD,QAAQ,OAAO,UAAU,WAAW,EAAE,MAAM,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM;CACxE,CACF;;;;;CAMF,MAAM,kBAAkB,OAAO,eAA+B,CAAC,MAC7D,MAAM,QACJ,cACE,YACA,gBACA,mBAAmB,eACrB,GACA,gBACA,cACA,EAAE,QAAQ,mBAAmB,gBAAgB,OAAO,CACtD;;;;;;CAOF,MAAM,uBAAuB,OAC3B,eACA,eAA+B,CAAC,MAEhC,MAAM,QACJ,cACE,YACA,gBACA,mBAAmB,sBACnB,EAAE,cAAc,CAClB,GACA,gBACA,cACA,EAAE,QAAQ,mBAAmB,qBAAqB,OAAO,CAC3D;;;;;;;CAQF,MAAM,cAAc,OAClB,OACA,UACA,eAA+B,CAAC,MAEhC,MAAM,QACJ,cAAc,YAAY,gBAAgB,mBAAmB,WAAW,GACxE,gBACA,cACA;EACE,QAAQ,mBAAmB,YAAY;EACvC,QAAQ;GAAE;GAAO;EAAS;CAC5B,CACF;;;;;;CAOF,MAAM,qBAAqB,OACzB,WACA,eAA+B,CAAC,MAEhC,MAAM,QACJ,cACE,YACA,gBACA,mBAAmB,oBACnB,EAAE,UAAU,CACd,GACA,gBACA,cACA,EAAE,QAAQ,mBAAmB,mBAAmB,OAAO,CACzD;;;;;;CAOF,MAAM,kBAAkB,OACtB,KACA,eAA+B,CAAC,MAEhC,MAAM,QACJ,cACE,YACA,gBACA,mBAAmB,eACrB,GACA,gBACA,cACA;EACE,QAAQ,mBAAmB,gBAAgB;EAC3C,QAAQ,EAAE,IAAI;CAChB,CACF;CAEF,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;AACF;;;;;;;AAQA,MAAa,oBAAoB,eAAe,eAAe"}
|
|
1
|
+
{"version":3,"file":"analytics.mjs","names":[],"sources":["../../../src/getIntlayerAPI/analytics.ts"],"sourcesContent":["import type {\n AnalyticsAnnotationType,\n AnalyticsRoutes,\n AudienceRange,\n analyticsContract,\n GetAnalyticsAnnotationsResult,\n GetAnalyticsOverviewResult,\n GetAnalyticsSchemaResult,\n GetAudienceResult,\n GetContentStatsResult,\n GetExperimentResultsResult,\n GetLiveVisitorFlowResult,\n GetPageFlowResult,\n GetPageMetadataResult,\n IngestAnalyticsBody,\n IngestAnalyticsResult,\n RunAnalyticsRealtimeReportBody,\n RunAnalyticsReportBody,\n RunAnalyticsReportResult,\n} from '@intlayer/backend-contract/analytics';\nimport type { RouteEndpoints } from '@intlayer/backend-contract/defineRoute';\nimport { buildRouteURL } from '@intlayer/backend-contract/defineRoute';\nimport { editor } from '@intlayer/config/built';\nimport { BACKEND_URL } from '@intlayer/config/defaultValues';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport { createEndpoint } from '../cms/createIntlayerCMS';\nimport { type FetcherOptions, fetcher } from '../fetcher';\n\n/** Prefix of the routes, checked against the backend contract. */\nconst analyticsGroup = {\n prefix: '/api/analytics',\n} as const satisfies Pick<typeof analyticsContract, 'prefix'>;\n\n/**\n * Method and path of every route, checked against the backend contract at\n * compile time (the contract's zod schemas are never loaded).\n */\nconst analyticsEndpoints = {\n ingestAnalyticsEvents: { method: 'POST', path: '/events' },\n getAnalyticsOverview: { method: 'GET', path: '/overview' },\n getAnalyticsAudience: { method: 'GET', path: '/audience' },\n getPageFlow: { method: 'GET', path: '/page-flow' },\n getLiveVisitorFlow: {\n method: 'GET',\n path: '/audience/live/visitors/:visitorId',\n },\n getContentStats: { method: 'GET', path: '/content-stats' },\n getExperimentResults: { method: 'GET', path: '/experiments/:experimentKey' },\n getPageMetadata: { method: 'GET', path: '/page-metadata' },\n getAnalyticsSchema: { method: 'GET', path: '/schema' },\n runAnalyticsReport: { method: 'POST', path: '/report' },\n runAnalyticsRealtimeReport: { method: 'POST', path: '/realtime-report' },\n getAnalyticsAnnotations: { method: 'GET', path: '/annotations' },\n} as const satisfies RouteEndpoints<AnalyticsRoutes>;\n\nexport const getAnalyticsAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig?: IntlayerConfig\n) => {\n const backendURL =\n intlayerConfig?.editor?.backendURL ?? editor.backendURL ?? BACKEND_URL;\n\n /**\n * Ingest a batch of analytics events. Public — attribution is by the\n * project's `clientId` in the body.\n * @param body - Session id, sdk version, and the collected events.\n * @returns The number of accepted events.\n */\n const sendEvents = async (\n body: IngestAnalyticsBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<IngestAnalyticsResult>(\n buildRouteURL(\n backendURL,\n analyticsGroup,\n analyticsEndpoints.ingestAnalyticsEvents\n ),\n authAPIOptions,\n otherOptions,\n {\n method: analyticsEndpoints.ingestAnalyticsEvents.method,\n body,\n }\n );\n\n /**\n * Page/locale totals for the authenticated project.\n * @returns Views grouped by url and locale.\n */\n const getOverview = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<GetAnalyticsOverviewResult>(\n buildRouteURL(\n backendURL,\n analyticsGroup,\n analyticsEndpoints.getAnalyticsOverview\n ),\n authAPIOptions,\n otherOptions,\n { method: analyticsEndpoints.getAnalyticsOverview.method }\n );\n\n /**\n * Audience report: distinct visitors (today / 7d / window), page views, the\n * evolution series, and locale + country breakdowns.\n * @param range - Rolling window, either a named range (`1h`, `24h`, `7d`,\n * `30d`, `90d`, `6mo`, `1y`, `3y`) or a number of days (default 30).\n * @returns The audience statistics.\n */\n const getAudience = async (\n range: AudienceRange | number = 30,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetAudienceResult>(\n buildRouteURL(\n backendURL,\n analyticsGroup,\n analyticsEndpoints.getAnalyticsAudience\n ),\n authAPIOptions,\n otherOptions,\n {\n method: analyticsEndpoints.getAnalyticsAudience.method,\n params: typeof range === 'number' ? { days: String(range) } : { range },\n }\n );\n\n /**\n * Per-content exposure totals — \"which content is actually shown\".\n * @returns Exposures grouped by dictionary key, key path, and locale.\n */\n const getContentStats = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<GetContentStatsResult>(\n buildRouteURL(\n backendURL,\n analyticsGroup,\n analyticsEndpoints.getContentStats\n ),\n authAPIOptions,\n otherOptions,\n { method: analyticsEndpoints.getContentStats.method }\n );\n\n /**\n * A/B experiment results with per-variant conversion rates and significance.\n * @param experimentKey - The experiment to evaluate.\n * @returns The experiment result set.\n */\n const getExperimentResults = async (\n experimentKey: string,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetExperimentResultsResult>(\n buildRouteURL(\n backendURL,\n analyticsGroup,\n analyticsEndpoints.getExperimentResults,\n { experimentKey }\n ),\n authAPIOptions,\n otherOptions,\n { method: analyticsEndpoints.getExperimentResults.method }\n );\n\n /**\n * Averaged page-to-page navigation flow from a starting page.\n * @param range - Rolling window of the report.\n * @param startUrl - Starting page pathname (default `/`).\n * @returns The flow steps and the links between them.\n */\n const getPageFlow = async (\n range: AudienceRange,\n startUrl: string,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetPageFlowResult>(\n buildRouteURL(backendURL, analyticsGroup, analyticsEndpoints.getPageFlow),\n authAPIOptions,\n otherOptions,\n {\n method: analyticsEndpoints.getPageFlow.method,\n params: { range, startUrl },\n }\n );\n\n /**\n * Page journey of a visitor active in the last 30 minutes.\n * @param visitorId - The visitor id from the `live` audience report.\n * @returns The visitor and its steps (`visitor: null` once it went quiet).\n */\n const getLiveVisitorFlow = async (\n visitorId: string,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetLiveVisitorFlowResult>(\n buildRouteURL(\n backendURL,\n analyticsGroup,\n analyticsEndpoints.getLiveVisitorFlow,\n { visitorId }\n ),\n authAPIOptions,\n otherOptions,\n { method: analyticsEndpoints.getLiveVisitorFlow.method }\n );\n\n /**\n * Page metadata (title and meta description) for a given url.\n * @param url - The page url to inspect.\n * @returns Title and description of the page.\n */\n const getPageMetadata = async (\n url: string,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetPageMetadataResult>(\n buildRouteURL(\n backendURL,\n analyticsGroup,\n analyticsEndpoints.getPageMetadata\n ),\n authAPIOptions,\n otherOptions,\n {\n method: analyticsEndpoints.getPageMetadata.method,\n params: { url },\n }\n );\n\n /**\n * What can be reported on: dimensions, metrics and their compatibility,\n * retention, the project's locales and its experiments.\n */\n const getSchema = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<GetAnalyticsSchemaResult>(\n buildRouteURL(\n backendURL,\n analyticsGroup,\n analyticsEndpoints.getAnalyticsSchema\n ),\n authAPIOptions,\n otherOptions,\n { method: analyticsEndpoints.getAnalyticsSchema.method }\n );\n\n /**\n * Aggregated report: metrics broken down by dimensions over date ranges.\n * @param body - Date ranges, dimensions, metrics, filters, order, paging.\n */\n const runReport = async (\n body: RunAnalyticsReportBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<RunAnalyticsReportResult>(\n buildRouteURL(\n backendURL,\n analyticsGroup,\n analyticsEndpoints.runAnalyticsReport\n ),\n authAPIOptions,\n otherOptions,\n { method: analyticsEndpoints.runAnalyticsReport.method, body }\n );\n\n /**\n * Aggregated activity of the last minutes (up to one hour).\n * @param body - Dimensions, metrics, window and filters.\n */\n const runRealtimeReport = async (\n body: RunAnalyticsRealtimeReportBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<RunAnalyticsReportResult>(\n buildRouteURL(\n backendURL,\n analyticsGroup,\n analyticsEndpoints.runAnalyticsRealtimeReport\n ),\n authAPIOptions,\n otherOptions,\n { method: analyticsEndpoints.runAnalyticsRealtimeReport.method, body }\n );\n\n /**\n * Dated content and traffic events, to explain report changes.\n * @param query - Window (`YYYY-MM-DD`, `today`, `NdaysAgo`), types, limit.\n */\n const getAnnotations = async (\n query: {\n startDate?: string;\n endDate?: string;\n types?: AnalyticsAnnotationType[];\n limit?: number;\n } = {},\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetAnalyticsAnnotationsResult>(\n buildRouteURL(\n backendURL,\n analyticsGroup,\n analyticsEndpoints.getAnalyticsAnnotations\n ),\n authAPIOptions,\n otherOptions,\n {\n method: analyticsEndpoints.getAnalyticsAnnotations.method,\n params: {\n ...(query.startDate && { startDate: query.startDate }),\n ...(query.endDate && { endDate: query.endDate }),\n ...(query.types?.length && { types: query.types.join(',') }),\n ...(query.limit !== undefined && { limit: String(query.limit) }),\n },\n }\n );\n\n return {\n sendEvents,\n getSchema,\n runReport,\n runRealtimeReport,\n getAnnotations,\n getOverview,\n getAudience,\n getLiveVisitorFlow,\n getPageFlow,\n getContentStats,\n getExperimentResults,\n getPageMetadata,\n };\n};\n\n/**\n * Authenticated `analytics` endpoint bound to an Intlayer CMS authenticator.\n *\n * Pass an authenticator created with `createIntlayerCMS`, or omit it to use\n * the build-time configuration (`@intlayer/config/built`).\n */\nexport const analyticsEndpoint = createEndpoint(getAnalyticsAPI);\n"],"mappings":";;;;;;;;AA6BA,MAAM,iBAAiB,EACrB,QAAQ,iBACV;;;;;AAMA,MAAM,qBAAqB;CACzB,uBAAuB;EAAE,QAAQ;EAAQ,MAAM;CAAU;CACzD,sBAAsB;EAAE,QAAQ;EAAO,MAAM;CAAY;CACzD,sBAAsB;EAAE,QAAQ;EAAO,MAAM;CAAY;CACzD,aAAa;EAAE,QAAQ;EAAO,MAAM;CAAa;CACjD,oBAAoB;EAClB,QAAQ;EACR,MAAM;CACR;CACA,iBAAiB;EAAE,QAAQ;EAAO,MAAM;CAAiB;CACzD,sBAAsB;EAAE,QAAQ;EAAO,MAAM;CAA8B;CAC3E,iBAAiB;EAAE,QAAQ;EAAO,MAAM;CAAiB;CACzD,oBAAoB;EAAE,QAAQ;EAAO,MAAM;CAAU;CACrD,oBAAoB;EAAE,QAAQ;EAAQ,MAAM;CAAU;CACtD,4BAA4B;EAAE,QAAQ;EAAQ,MAAM;CAAmB;CACvE,yBAAyB;EAAE,QAAQ;EAAO,MAAM;CAAe;AACjE;AAEA,MAAa,mBACX,iBAAiC,CAAC,GAClC,mBACG;CACH,M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;;;;;AAQA,MAAa,oBAAoB,eAAe,eAAe"}
|
|
@@ -2,9 +2,18 @@ import "../index.js";
|
|
|
2
2
|
import { CMSEndpoint } from "../cms/createIntlayerCMS.js";
|
|
3
3
|
import { FetcherOptions } from "../fetcher.js";
|
|
4
4
|
import { IntlayerConfig } from "@intlayer/types/config";
|
|
5
|
-
import { AudienceRange, GetAnalyticsOverviewResult, GetAudienceResult, GetContentStatsResult, GetExperimentResultsResult, GetLiveVisitorFlowResult, GetPageFlowResult, GetPageMetadataResult, IngestAnalyticsBody, IngestAnalyticsResult } from "@intlayer/backend-contract/analytics";
|
|
5
|
+
import { AnalyticsAnnotationType, AudienceRange, GetAnalyticsAnnotationsResult, GetAnalyticsOverviewResult, GetAnalyticsSchemaResult, GetAudienceResult, GetContentStatsResult, GetExperimentResultsResult, GetLiveVisitorFlowResult, GetPageFlowResult, GetPageMetadataResult, IngestAnalyticsBody, IngestAnalyticsResult, RunAnalyticsRealtimeReportBody, RunAnalyticsReportBody, RunAnalyticsReportResult } from "@intlayer/backend-contract/analytics";
|
|
6
6
|
export declare const getAnalyticsAPI: (authAPIOptions?: FetcherOptions, intlayerConfig?: IntlayerConfig) => {
|
|
7
7
|
sendEvents: (body: IngestAnalyticsBody, otherOptions?: FetcherOptions) => Promise<IngestAnalyticsResult>;
|
|
8
|
+
getSchema: (otherOptions?: FetcherOptions) => Promise<GetAnalyticsSchemaResult>;
|
|
9
|
+
runReport: (body: RunAnalyticsReportBody, otherOptions?: FetcherOptions) => Promise<RunAnalyticsReportResult>;
|
|
10
|
+
runRealtimeReport: (body: RunAnalyticsRealtimeReportBody, otherOptions?: FetcherOptions) => Promise<RunAnalyticsReportResult>;
|
|
11
|
+
getAnnotations: (query?: {
|
|
12
|
+
startDate?: string;
|
|
13
|
+
endDate?: string;
|
|
14
|
+
types?: AnalyticsAnnotationType[];
|
|
15
|
+
limit?: number;
|
|
16
|
+
}, otherOptions?: FetcherOptions) => Promise<GetAnalyticsAnnotationsResult>;
|
|
8
17
|
getOverview: (otherOptions?: FetcherOptions) => Promise<GetAnalyticsOverviewResult>;
|
|
9
18
|
getAudience: (range?: AudienceRange | number, otherOptions?: FetcherOptions) => Promise<GetAudienceResult>;
|
|
10
19
|
getLiveVisitorFlow: (visitorId: string, otherOptions?: FetcherOptions) => Promise<GetLiveVisitorFlowResult>;
|
|
@@ -21,6 +30,15 @@ export declare const getAnalyticsAPI: (authAPIOptions?: FetcherOptions, intlayer
|
|
|
21
30
|
*/
|
|
22
31
|
export declare const analyticsEndpoint: CMSEndpoint<{
|
|
23
32
|
sendEvents: (body: IngestAnalyticsBody, otherOptions?: FetcherOptions) => Promise<IngestAnalyticsResult>;
|
|
33
|
+
getSchema: (otherOptions?: FetcherOptions) => Promise<GetAnalyticsSchemaResult>;
|
|
34
|
+
runReport: (body: RunAnalyticsReportBody, otherOptions?: FetcherOptions) => Promise<RunAnalyticsReportResult>;
|
|
35
|
+
runRealtimeReport: (body: RunAnalyticsRealtimeReportBody, otherOptions?: FetcherOptions) => Promise<RunAnalyticsReportResult>;
|
|
36
|
+
getAnnotations: (query?: {
|
|
37
|
+
startDate?: string;
|
|
38
|
+
endDate?: string;
|
|
39
|
+
types?: AnalyticsAnnotationType[];
|
|
40
|
+
limit?: number;
|
|
41
|
+
}, otherOptions?: FetcherOptions) => Promise<GetAnalyticsAnnotationsResult>;
|
|
24
42
|
getOverview: (otherOptions?: FetcherOptions) => Promise<GetAnalyticsOverviewResult>;
|
|
25
43
|
getAudience: (range?: AudienceRange | number, otherOptions?: FetcherOptions) => Promise<GetAudienceResult>;
|
|
26
44
|
getLiveVisitorFlow: (visitorId: string, otherOptions?: FetcherOptions) => Promise<GetLiveVisitorFlowResult>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analytics.d.ts","names":["_$__0.CMSEndpoint"],"sources":["../../../src/getIntlayerAPI/analytics.ts"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"analytics.d.ts","names":["_$__0.CMSEnd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2
|
"name": "@intlayer/api",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.8.0-canary.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "SDK for interacting with the Intlayer API, enabling content auditing, and managing organizations, projects, and users.",
|
|
6
6
|
"keywords": [
|
|
@@ -281,9 +281,9 @@
|
|
|
281
281
|
"typecheck": "tsc --noEmit --project tsconfig.types.json"
|
|
282
282
|
},
|
|
283
283
|
"dependencies": {
|
|
284
|
-
"@intlayer/backend-contract": "9.
|
|
285
|
-
"@intlayer/config": "9.
|
|
286
|
-
"@intlayer/types": "9.
|
|
284
|
+
"@intlayer/backend-contract": "9.8.0-canary.0",
|
|
285
|
+
"@intlayer/config": "9.8.0-canary.0",
|
|
286
|
+
"@intlayer/types": "9.8.0-canary.0",
|
|
287
287
|
"defu": "6.1.7"
|
|
288
288
|
},
|
|
289
289
|
"devDependencies": {
|