@intlayer/api 9.3.2 → 9.4.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/README.md CHANGED
@@ -327,4 +327,4 @@ Contribute on [GitHub](https://github.com/aymericzip/intlayer), [GitLab](https:/
327
327
 
328
328
  If you like Intlayer, give us a ⭐ on GitHub. It helps others discover the project! [See why GitHub Stars matter](https://github.com/aymericzip/intlayer/blob/main/CONTRIBUTING.md#why-github-stars-matter-).
329
329
 
330
- [![Star History Chart](https://api.star-history.com/svg?repos=aymericzip/intlayer&type=Date)](https://star-history.com/#aymericzip/intlayer&Date)
330
+ [![Star History Chart](https://star-history.dera.page/svg?repos=aymericzip/intlayer&type=Date)](https://star-history.dera.page/#aymericzip/intlayer&Date)
@@ -23,13 +23,14 @@ const getAnalyticsAPI = (authAPIOptions = {}, intlayerConfig) => {
23
23
  const getOverview = async (otherOptions = {}) => await require_fetcher.fetcher(`${ANALYTICS_API_ROUTE}/overview`, authAPIOptions, otherOptions, { method: "GET" });
24
24
  /**
25
25
  * Audience report: distinct visitors (today / 7d / window), page views, the
26
- * daily evolution series, and locale + country breakdowns.
27
- * @param days - Rolling window size in days (default 30).
26
+ * evolution series, and locale + country breakdowns.
27
+ * @param range - Rolling window, either a named range (`1h`, `24h`, `7d`,
28
+ * `30d`, `90d`, `6mo`, `1y`, `3y`) or a number of days (default 30).
28
29
  * @returns The audience statistics.
29
30
  */
30
- const getAudience = async (days = 30, otherOptions = {}) => await require_fetcher.fetcher(`${ANALYTICS_API_ROUTE}/audience`, authAPIOptions, otherOptions, {
31
+ const getAudience = async (range = 30, otherOptions = {}) => await require_fetcher.fetcher(`${ANALYTICS_API_ROUTE}/audience`, authAPIOptions, otherOptions, {
31
32
  method: "GET",
32
- params: { days: String(days) }
33
+ params: typeof range === "number" ? { days: String(range) } : { range }
33
34
  });
34
35
  /**
35
36
  * Per-content exposure totals — "which content is actually shown".
@@ -1 +1 @@
1
- {"version":3,"file":"analytics.cjs","names":["editor","fetcher","createEndpoint"],"sources":["../../../src/getIntlayerAPI/analytics.ts"],"sourcesContent":["import type {\n GetAnalyticsOverviewResult,\n GetAudienceResult,\n GetContentStatsResult,\n GetExperimentResultsResult,\n IngestAnalyticsBody,\n IngestAnalyticsResult,\n} from '@intlayer/backend';\nimport { editor } from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport { createEndpoint } from '../cms/createIntlayerCMS';\nimport { type FetcherOptions, fetcher } from '../fetcher';\n\nexport const getAnalyticsAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig?: IntlayerConfig\n) => {\n const backendURL = intlayerConfig?.editor?.backendURL ?? editor.backendURL;\n\n const ANALYTICS_API_ROUTE = `${backendURL}/api/analytics`;\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 `${ANALYTICS_API_ROUTE}/events`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\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 `${ANALYTICS_API_ROUTE}/overview`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n\n /**\n * Audience report: distinct visitors (today / 7d / window), page views, the\n * daily evolution series, and locale + country breakdowns.\n * @param days - Rolling window size in days (default 30).\n * @returns The audience statistics.\n */\n const getAudience = async (days = 30, otherOptions: FetcherOptions = {}) =>\n await fetcher<GetAudienceResult>(\n `${ANALYTICS_API_ROUTE}/audience`,\n authAPIOptions,\n otherOptions,\n {\n method: 'GET',\n params: { days: String(days) },\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 `${ANALYTICS_API_ROUTE}/content-stats`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\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 `${ANALYTICS_API_ROUTE}/experiments/${experimentKey}`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n\n return {\n sendEvents,\n getOverview,\n getAudience,\n getContentStats,\n getExperimentResults,\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":";;;;;;AAaA,MAAa,mBACX,iBAAiC,CAAC,GAClC,mBACG;CAGH,MAAM,sBAAsB,GAFT,gBAAgB,QAAQ,cAAcA,8BAAO,WAEtB;;;;;;;CAQ1C,MAAM,aAAa,OACjB,MACA,eAA+B,CAAC,MAEhC,MAAMC,wBACJ,GAAG,oBAAoB,UACvB,gBACA,cACA;EACE,QAAQ;EACR;CACF,CACF;;;;;CAMF,MAAM,cAAc,OAAO,eAA+B,CAAC,MACzD,MAAMA,wBACJ,GAAG,oBAAoB,YACvB,gBACA,cACA,EAAE,QAAQ,MAAM,CAClB;;;;;;;CAQF,MAAM,cAAc,OAAO,OAAO,IAAI,eAA+B,CAAC,MACpE,MAAMA,wBACJ,GAAG,oBAAoB,YACvB,gBACA,cACA;EACE,QAAQ;EACR,QAAQ,EAAE,MAAM,OAAO,IAAI,EAAE;CAC/B,CACF;;;;;CAMF,MAAM,kBAAkB,OAAO,eAA+B,CAAC,MAC7D,MAAMA,wBACJ,GAAG,oBAAoB,iBACvB,gBACA,cACA,EAAE,QAAQ,MAAM,CAClB;;;;;;CAOF,MAAM,uBAAuB,OAC3B,eACA,eAA+B,CAAC,MAEhC,MAAMA,wBACJ,GAAG,oBAAoB,eAAe,iBACtC,gBACA,cACA,EAAE,QAAQ,MAAM,CAClB;CAEF,OAAO;EACL;EACA;EACA;EACA;EACA;CACF;AACF;;;;;;;AAQA,MAAa,oBAAoBC,6CAAe,eAAe"}
1
+ {"version":3,"file":"analytics.cjs","names":["editor","fetcher","createEndpoint"],"sources":["../../../src/getIntlayerAPI/analytics.ts"],"sourcesContent":["import type {\n AudienceRange,\n GetAnalyticsOverviewResult,\n GetAudienceResult,\n GetContentStatsResult,\n GetExperimentResultsResult,\n IngestAnalyticsBody,\n IngestAnalyticsResult,\n} from '@intlayer/backend';\nimport { editor } from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport { createEndpoint } from '../cms/createIntlayerCMS';\nimport { type FetcherOptions, fetcher } from '../fetcher';\n\nexport const getAnalyticsAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig?: IntlayerConfig\n) => {\n const backendURL = intlayerConfig?.editor?.backendURL ?? editor.backendURL;\n\n const ANALYTICS_API_ROUTE = `${backendURL}/api/analytics`;\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 `${ANALYTICS_API_ROUTE}/events`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\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 `${ANALYTICS_API_ROUTE}/overview`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\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 `${ANALYTICS_API_ROUTE}/audience`,\n authAPIOptions,\n otherOptions,\n {\n method: 'GET',\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 `${ANALYTICS_API_ROUTE}/content-stats`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\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 `${ANALYTICS_API_ROUTE}/experiments/${experimentKey}`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n\n return {\n sendEvents,\n getOverview,\n getAudience,\n getContentStats,\n getExperimentResults,\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":";;;;;;AAcA,MAAa,mBACX,iBAAiC,CAAC,GAClC,mBACG;CAGH,MAAM,sBAAsB,GAFT,gBAAgB,QAAQ,cAAcA,8BAAO,WAEtB;;;;;;;CAQ1C,MAAM,aAAa,OACjB,MACA,eAA+B,CAAC,MAEhC,MAAMC,wBACJ,GAAG,oBAAoB,UACvB,gBACA,cACA;EACE,QAAQ;EACR;CACF,CACF;;;;;CAMF,MAAM,cAAc,OAAO,eAA+B,CAAC,MACzD,MAAMA,wBACJ,GAAG,oBAAoB,YACvB,gBACA,cACA,EAAE,QAAQ,MAAM,CAClB;;;;;;;;CASF,MAAM,cAAc,OAClB,QAAgC,IAChC,eAA+B,CAAC,MAEhC,MAAMA,wBACJ,GAAG,oBAAoB,YACvB,gBACA,cACA;EACE,QAAQ;EACR,QAAQ,OAAO,UAAU,WAAW,EAAE,MAAM,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM;CACxE,CACF;;;;;CAMF,MAAM,kBAAkB,OAAO,eAA+B,CAAC,MAC7D,MAAMA,wBACJ,GAAG,oBAAoB,iBACvB,gBACA,cACA,EAAE,QAAQ,MAAM,CAClB;;;;;;CAOF,MAAM,uBAAuB,OAC3B,eACA,eAA+B,CAAC,MAEhC,MAAMA,wBACJ,GAAG,oBAAoB,eAAe,iBACtC,gBACA,cACA,EAAE,QAAQ,MAAM,CAClB;CAEF,OAAO;EACL;EACA;EACA;EACA;EACA;CACF;AACF;;;;;;;AAQA,MAAa,oBAAoBC,6CAAe,eAAe"}
@@ -22,13 +22,14 @@ const getAnalyticsAPI = (authAPIOptions = {}, intlayerConfig) => {
22
22
  const getOverview = async (otherOptions = {}) => await fetcher(`${ANALYTICS_API_ROUTE}/overview`, authAPIOptions, otherOptions, { method: "GET" });
23
23
  /**
24
24
  * Audience report: distinct visitors (today / 7d / window), page views, the
25
- * daily evolution series, and locale + country breakdowns.
26
- * @param days - Rolling window size in days (default 30).
25
+ * evolution series, and locale + country breakdowns.
26
+ * @param range - Rolling window, either a named range (`1h`, `24h`, `7d`,
27
+ * `30d`, `90d`, `6mo`, `1y`, `3y`) or a number of days (default 30).
27
28
  * @returns The audience statistics.
28
29
  */
29
- const getAudience = async (days = 30, otherOptions = {}) => await fetcher(`${ANALYTICS_API_ROUTE}/audience`, authAPIOptions, otherOptions, {
30
+ const getAudience = async (range = 30, otherOptions = {}) => await fetcher(`${ANALYTICS_API_ROUTE}/audience`, authAPIOptions, otherOptions, {
30
31
  method: "GET",
31
- params: { days: String(days) }
32
+ params: typeof range === "number" ? { days: String(range) } : { range }
32
33
  });
33
34
  /**
34
35
  * Per-content exposure totals — "which content is actually shown".
@@ -1 +1 @@
1
- {"version":3,"file":"analytics.mjs","names":[],"sources":["../../../src/getIntlayerAPI/analytics.ts"],"sourcesContent":["import type {\n GetAnalyticsOverviewResult,\n GetAudienceResult,\n GetContentStatsResult,\n GetExperimentResultsResult,\n IngestAnalyticsBody,\n IngestAnalyticsResult,\n} from '@intlayer/backend';\nimport { editor } from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport { createEndpoint } from '../cms/createIntlayerCMS';\nimport { type FetcherOptions, fetcher } from '../fetcher';\n\nexport const getAnalyticsAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig?: IntlayerConfig\n) => {\n const backendURL = intlayerConfig?.editor?.backendURL ?? editor.backendURL;\n\n const ANALYTICS_API_ROUTE = `${backendURL}/api/analytics`;\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 `${ANALYTICS_API_ROUTE}/events`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\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 `${ANALYTICS_API_ROUTE}/overview`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n\n /**\n * Audience report: distinct visitors (today / 7d / window), page views, the\n * daily evolution series, and locale + country breakdowns.\n * @param days - Rolling window size in days (default 30).\n * @returns The audience statistics.\n */\n const getAudience = async (days = 30, otherOptions: FetcherOptions = {}) =>\n await fetcher<GetAudienceResult>(\n `${ANALYTICS_API_ROUTE}/audience`,\n authAPIOptions,\n otherOptions,\n {\n method: 'GET',\n params: { days: String(days) },\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 `${ANALYTICS_API_ROUTE}/content-stats`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\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 `${ANALYTICS_API_ROUTE}/experiments/${experimentKey}`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n\n return {\n sendEvents,\n getOverview,\n getAudience,\n getContentStats,\n getExperimentResults,\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":";;;;;AAaA,MAAa,mBACX,iBAAiC,CAAC,GAClC,mBACG;CAGH,MAAM,sBAAsB,GAFT,gBAAgB,QAAQ,cAAc,OAAO,WAEtB;;;;;;;CAQ1C,MAAM,aAAa,OACjB,MACA,eAA+B,CAAC,MAEhC,MAAM,QACJ,GAAG,oBAAoB,UACvB,gBACA,cACA;EACE,QAAQ;EACR;CACF,CACF;;;;;CAMF,MAAM,cAAc,OAAO,eAA+B,CAAC,MACzD,MAAM,QACJ,GAAG,oBAAoB,YACvB,gBACA,cACA,EAAE,QAAQ,MAAM,CAClB;;;;;;;CAQF,MAAM,cAAc,OAAO,OAAO,IAAI,eAA+B,CAAC,MACpE,MAAM,QACJ,GAAG,oBAAoB,YACvB,gBACA,cACA;EACE,QAAQ;EACR,QAAQ,EAAE,MAAM,OAAO,IAAI,EAAE;CAC/B,CACF;;;;;CAMF,MAAM,kBAAkB,OAAO,eAA+B,CAAC,MAC7D,MAAM,QACJ,GAAG,oBAAoB,iBACvB,gBACA,cACA,EAAE,QAAQ,MAAM,CAClB;;;;;;CAOF,MAAM,uBAAuB,OAC3B,eACA,eAA+B,CAAC,MAEhC,MAAM,QACJ,GAAG,oBAAoB,eAAe,iBACtC,gBACA,cACA,EAAE,QAAQ,MAAM,CAClB;CAEF,OAAO;EACL;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 AudienceRange,\n GetAnalyticsOverviewResult,\n GetAudienceResult,\n GetContentStatsResult,\n GetExperimentResultsResult,\n IngestAnalyticsBody,\n IngestAnalyticsResult,\n} from '@intlayer/backend';\nimport { editor } from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport { createEndpoint } from '../cms/createIntlayerCMS';\nimport { type FetcherOptions, fetcher } from '../fetcher';\n\nexport const getAnalyticsAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig?: IntlayerConfig\n) => {\n const backendURL = intlayerConfig?.editor?.backendURL ?? editor.backendURL;\n\n const ANALYTICS_API_ROUTE = `${backendURL}/api/analytics`;\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 `${ANALYTICS_API_ROUTE}/events`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\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 `${ANALYTICS_API_ROUTE}/overview`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\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 `${ANALYTICS_API_ROUTE}/audience`,\n authAPIOptions,\n otherOptions,\n {\n method: 'GET',\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 `${ANALYTICS_API_ROUTE}/content-stats`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\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 `${ANALYTICS_API_ROUTE}/experiments/${experimentKey}`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n\n return {\n sendEvents,\n getOverview,\n getAudience,\n getContentStats,\n getExperimentResults,\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":";;;;;AAcA,MAAa,mBACX,iBAAiC,CAAC,GAClC,mBACG;CAGH,MAAM,sBAAsB,GAFT,gBAAgB,QAAQ,cAAc,OAAO,WAEtB;;;;;;;CAQ1C,MAAM,aAAa,OACjB,MACA,eAA+B,CAAC,MAEhC,MAAM,QACJ,GAAG,oBAAoB,UACvB,gBACA,cACA;EACE,QAAQ;EACR;CACF,CACF;;;;;CAMF,MAAM,cAAc,OAAO,eAA+B,CAAC,MACzD,MAAM,QACJ,GAAG,oBAAoB,YACvB,gBACA,cACA,EAAE,QAAQ,MAAM,CAClB;;;;;;;;CASF,MAAM,cAAc,OAClB,QAAgC,IAChC,eAA+B,CAAC,MAEhC,MAAM,QACJ,GAAG,oBAAoB,YACvB,gBACA,cACA;EACE,QAAQ;EACR,QAAQ,OAAO,UAAU,WAAW,EAAE,MAAM,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM;CACxE,CACF;;;;;CAMF,MAAM,kBAAkB,OAAO,eAA+B,CAAC,MAC7D,MAAM,QACJ,GAAG,oBAAoB,iBACvB,gBACA,cACA,EAAE,QAAQ,MAAM,CAClB;;;;;;CAOF,MAAM,uBAAuB,OAC3B,eACA,eAA+B,CAAC,MAEhC,MAAM,QACJ,GAAG,oBAAoB,eAAe,iBACtC,gBACA,cACA,EAAE,QAAQ,MAAM,CAClB;CAEF,OAAO;EACL;EACA;EACA;EACA;EACA;CACF;AACF;;;;;;;AAQA,MAAa,oBAAoB,eAAe,eAAe"}
@@ -2,12 +2,12 @@ import { FetcherOptions } from "../fetcher.js";
2
2
  import { CMSEndpoint } from "../cms/createIntlayerCMS.js";
3
3
  import "../index.js";
4
4
  import { IntlayerConfig } from "@intlayer/types/config";
5
- import { IngestAnalyticsBody } from "@intlayer/backend";
5
+ import { AudienceRange, IngestAnalyticsBody } from "@intlayer/backend";
6
6
  //#region src/getIntlayerAPI/analytics.d.ts
7
7
  declare const getAnalyticsAPI: (authAPIOptions?: FetcherOptions, intlayerConfig?: IntlayerConfig) => {
8
8
  sendEvents: (body: IngestAnalyticsBody, otherOptions?: FetcherOptions) => Promise<IngestAnalyticsResult>;
9
9
  getOverview: (otherOptions?: FetcherOptions) => Promise<GetAnalyticsOverviewResult>;
10
- getAudience: (days?: number, otherOptions?: FetcherOptions) => Promise<GetAudienceResult>;
10
+ getAudience: (range?: AudienceRange | number, otherOptions?: FetcherOptions) => Promise<GetAudienceResult>;
11
11
  getContentStats: (otherOptions?: FetcherOptions) => Promise<GetContentStatsResult>;
12
12
  getExperimentResults: (experimentKey: string, otherOptions?: FetcherOptions) => Promise<GetExperimentResultsResult>;
13
13
  };
@@ -20,7 +20,7 @@ declare const getAnalyticsAPI: (authAPIOptions?: FetcherOptions, intlayerConfig?
20
20
  declare const analyticsEndpoint: CMSEndpoint<{
21
21
  sendEvents: (body: IngestAnalyticsBody, otherOptions?: FetcherOptions) => Promise<IngestAnalyticsResult>;
22
22
  getOverview: (otherOptions?: FetcherOptions) => Promise<GetAnalyticsOverviewResult>;
23
- getAudience: (days?: number, otherOptions?: FetcherOptions) => Promise<GetAudienceResult>;
23
+ getAudience: (range?: AudienceRange | number, otherOptions?: FetcherOptions) => Promise<GetAudienceResult>;
24
24
  getContentStats: (otherOptions?: FetcherOptions) => Promise<GetContentStatsResult>;
25
25
  getExperimentResults: (experimentKey: string, otherOptions?: FetcherOptions) => Promise<GetExperimentResultsResult>;
26
26
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"analytics.d.ts","names":[],"sources":["../../../src/getIntlayerAPI/analytics.ts"],"mappings":";;;;;;cAaa,kBAAe,iBACV,gBAAc,iBACb;EAaT,aAAA,MAAA,qBAAmB,eACX,mBAAc,QAAA;EAgBW,cAAA,eAAA,mBAAc,QAAA;EAcH,cAAA,eAAA,eAAA,mBAAc,QAAA;EAerB,kBAAA,eAAA,mBAAc,QAAA;EAc1C,uBAAA,uBAAM,eACP,mBAAc,QAAA;;;;;;;;cAwBnB,mBAxBmB;EA7DtB,aAAA,MAAA,qBAAmB,eACX,mBAAc,QAAA;EAgBW,cAAA,eAAA,mBAAc,QAAA;EAcH,cAAA,eAAA,eAAA,mBAAc,QAAA;EAerB,kBAAA,eAAA,mBAAc,QAAA;EAc1C,uBAAA,uBAAM,eACP,mBAAc,QAAA"}
1
+ {"version":3,"file":"analytics.d.ts","names":[],"sources":["../../../src/getIntlayerAPI/analytics.ts"],"mappings":";;;;;;cAca,kBAAe,iBACV,gBAAc,iBACb;EAaT,aAAA,MAAA,qBAAmB,eACX,mBAAc,QAAA;EAgBW,cAAA,eAAA,mBAAc,QAAA;EAgB9C,cAAA,QAAA,wBAAsB,eACf,mBAAc,QAAA;EAgBe,kBAAA,eAAA,mBAAc,QAAA;EAc1C,uBAAA,uBAAM,eACP,mBAAc,QAAA;;;;;;;;cAwBnB,mBAxBmB;EAjEtB,aAAA,MAAA,qBAAmB,eACX,mBAAc,QAAA;EAgBW,cAAA,eAAA,mBAAc,QAAA;EAgB9C,cAAA,QAAA,wBAAsB,eACf,mBAAc,QAAA;EAgBe,kBAAA,eAAA,mBAAc,QAAA;EAc1C,uBAAA,uBAAM,eACP,mBAAc,QAAA"}
@@ -1,6 +1,6 @@
1
1
  import { ResponseData } from "../utils/responseData.js";
2
2
  import { IntlayerConfig } from "@intlayer/types/config";
3
- import "/Users/aymericpineau/Documents/intlayer_/node_modules/.bun/fastify@5.12.0/node_modules/fastify/fastify.js";
3
+ import "/Users/aymericpineau/Documents/intlayer_/node_modules/.bun/fastify@5.12.1/node_modules/fastify/fastify.js";
4
4
  //#region ../../intlayer-editor/server/dist/controllers/configuration.controller.d.ts
5
5
  //#region src/controllers/configuration.controller.d.ts
6
6
  type GetConfigurationResult = ResponseData<IntlayerConfig>;
@@ -1,6 +1,6 @@
1
1
  import { ResponseData } from "../utils/responseData.js";
2
2
  import { UnmergedDictionaries } from "../../../../@intlayer/unmerged-dictionaries-entry/dist/types/index.js";
3
- import "/Users/aymericpineau/Documents/intlayer_/node_modules/.bun/fastify@5.12.0/node_modules/fastify/fastify.js";
3
+ import "/Users/aymericpineau/Documents/intlayer_/node_modules/.bun/fastify@5.12.1/node_modules/fastify/fastify.js";
4
4
  import { DictionaryStatus } from "@intlayer/engine/build";
5
5
  import { Dictionary } from "@intlayer/types/dictionary";
6
6
  //#region ../../intlayer-editor/server/dist/controllers/dictionary.controller.d.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intlayer/api",
3
- "version": "9.3.2",
3
+ "version": "9.4.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": [
@@ -256,8 +256,8 @@
256
256
  "typecheck": "tsc --noEmit --project tsconfig.types.json"
257
257
  },
258
258
  "dependencies": {
259
- "@intlayer/config": "9.3.2",
260
- "@intlayer/types": "9.3.2",
259
+ "@intlayer/config": "9.4.0-canary.0",
260
+ "@intlayer/types": "9.4.0-canary.0",
261
261
  "defu": "6.1.7"
262
262
  },
263
263
  "devDependencies": {
@@ -268,7 +268,7 @@
268
268
  "rimraf": "6.1.3",
269
269
  "tsdown": "0.22.14",
270
270
  "typescript": "7.0.2",
271
- "vitest": "4.1.10"
271
+ "vitest": "4.1.11"
272
272
  },
273
273
  "engines": {
274
274
  "node": ">=14.18"