@pomeloanalytics/api 0.1.0-beta.5 → 0.1.0-beta.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.0-beta.6
4
+
5
+ - Add paginated lists. `reports.content`, `reports.acquisition` and
6
+ `metrics.breakdown` accept `list`, `listLimit`, `offset`, `sort`, `order` and
7
+ `search`; the page is `current.lists.<list>` (`rows`, `next_offset`,
8
+ `total_rows`, `totals`, `other`), or `page` on a breakdown. `other` is `null`
9
+ (under 10) when a hidden part of 1 to 9 is all that is left, never `0`.
10
+ Additive: without `list`, responses are unchanged.
11
+
3
12
  ## 0.1.0-beta.5
4
13
 
5
14
  - **Type break.** `quotas` of `/v1/me`, and `meta.usage` and `meta.billable_overage`
package/README.md CHANGED
@@ -119,6 +119,12 @@ The server owns defaults, period validation, entitlements, and numeric limits;
119
119
  the SDK does not choose content depth, clamp limits, or change a requested range.
120
120
  Content `include` accepts `summary` or `full`.
121
121
 
122
+ Lists are read page by page with `list`, `limit` or `listLimit`, `offset`, `sort`,
123
+ `order` and `search` on `reports.content`, `reports.acquisition` and
124
+ `metrics.breakdown`. The page is in `current.lists.<list>` (`rows`, `next_offset`,
125
+ `total_rows`, `totals`, `other`); a count of 1 to 9 on a protected list is `null`
126
+ (under 10), never zero. Follow `next_offset` until it is `null`.
127
+
122
128
  Full Content responses can include `current.metric_method` and
123
129
  `current.pages[].performance.n_lcp`, `n_fcp`, `n_inp`, `n_cls` and `n_ttfb`.
124
130
  These optional fields identify the selected measurement method and each metric's
@@ -192,6 +192,22 @@ export interface paths {
192
192
  from?: components["parameters"]["FromDate"];
193
193
  /** @description Number of rows returned by breakdown endpoint. */
194
194
  limit?: components["parameters"]["BreakdownLimit"];
195
+ /**
196
+ * @description Reads the breakdown as the paginated list of its dimension (`device`:
197
+ * `devices`, `referrer`: `referrers`, `page`: `pages`, `browser`:
198
+ * `browsers`, `os`: `systems`, `country`: `countries`). Whole site, no
199
+ * `filters` and no `tenant_id`. `rows[].value` is the main measure of the
200
+ * list (pageviews for `pages`, visits for the others); a `metric` other
201
+ * than `pageviews` for `pages` or `sessions` for the others is refused and `page` carries `next_offset`, `total_rows`, `totals` and
202
+ * `other`.
203
+ */
204
+ list?: components["parameters"]["BreakdownListParam"];
205
+ /**
206
+ * @description Page size of `list`, when it is not `limit`. Without it `limit` is the
207
+ * page size (25 when `limit` is absent too); `offset + page size` is at
208
+ * most 10 000.
209
+ */
210
+ list_limit?: components["parameters"]["ListPageSize"];
195
211
  /**
196
212
  * @description Metric to aggregate (default `pageviews`). `sessions` uses the same
197
213
  * visit model as the dashboard: a `visit_id` starts from the
@@ -199,7 +215,22 @@ export interface paths {
199
215
  * inactivity.
200
216
  */
201
217
  metric?: components["parameters"]["Metric"];
218
+ /** @description Rank of the first row of the page of `list`. */
219
+ offset?: components["parameters"]["ListOffset"];
220
+ /** @description Order of `sort` (`desc` for a measure, `asc` for `value`). */
221
+ order?: components["parameters"]["ListOrder"];
222
+ /**
223
+ * @description Rows of `list` whose value (path, domain, name) or title contains the
224
+ * text, case-insensitive, accents significant. A value under ten visits
225
+ * that the list hides is never found. `other` is null with a search.
226
+ */
227
+ search?: components["parameters"]["ListSearch"];
202
228
  site_id: components["parameters"]["SiteId"];
229
+ /**
230
+ * @description Sort of `list`: one of its measures or `value` (alphabetical). The
231
+ * default is its main measure, descending, ties broken by the value.
232
+ */
233
+ sort?: components["parameters"]["ListSort"];
203
234
  /**
204
235
  * @description Stable tenant identifier. Use this for tenant-scoped analytics and
205
236
  * tenant-scoped access control. `site_id` identifies the shared product,
@@ -385,7 +416,37 @@ export interface paths {
385
416
  include?: components["parameters"]["ReportInclude"];
386
417
  /** @description Number of rows returned by top lists for report endpoints. */
387
418
  limit?: components["parameters"]["ReportLimit"];
419
+ /**
420
+ * @description A list of the report read page by page (see Pagination). Content serves
421
+ * `pages`, `entry_pages` and `exit_pages`; Acquisition serves
422
+ * `landing_pages`, `referrers` and the Campagnes lists. The page is
423
+ * returned in `current.lists.<list>` next to the report, which keeps its
424
+ * own arrays. Needs `include=full` (the default when `list` is given);
425
+ * not served with a client space (`tenant_id`).
426
+ */
427
+ list?: components["parameters"]["ListParam"];
428
+ /**
429
+ * @description Page size of `list`, when it is not `limit`. Without it `limit` is the
430
+ * page size (25 when `limit` is absent too); `offset + page size` is at
431
+ * most 10 000.
432
+ */
433
+ list_limit?: components["parameters"]["ListPageSize"];
434
+ /** @description Rank of the first row of the page of `list`. */
435
+ offset?: components["parameters"]["ListOffset"];
436
+ /** @description Order of `sort` (`desc` for a measure, `asc` for `value`). */
437
+ order?: components["parameters"]["ListOrder"];
438
+ /**
439
+ * @description Rows of `list` whose value (path, domain, name) or title contains the
440
+ * text, case-insensitive, accents significant. A value under ten visits
441
+ * that the list hides is never found. `other` is null with a search.
442
+ */
443
+ search?: components["parameters"]["ListSearch"];
388
444
  site_id: components["parameters"]["SiteId"];
445
+ /**
446
+ * @description Sort of `list`: one of its measures or `value` (alphabetical). The
447
+ * default is its main measure, descending, ties broken by the value.
448
+ */
449
+ sort?: components["parameters"]["ListSort"];
389
450
  /**
390
451
  * @description Stable tenant identifier. Use this for tenant-scoped analytics and
391
452
  * tenant-scoped access control. `site_id` identifies the shared product,
@@ -555,7 +616,37 @@ export interface paths {
555
616
  include?: components["parameters"]["ContentInclude"];
556
617
  /** @description Number of rows returned by top lists for report endpoints. */
557
618
  limit?: components["parameters"]["ReportLimit"];
619
+ /**
620
+ * @description A list of the report read page by page (see Pagination). Content serves
621
+ * `pages`, `entry_pages` and `exit_pages`; Acquisition serves
622
+ * `landing_pages`, `referrers` and the Campagnes lists. The page is
623
+ * returned in `current.lists.<list>` next to the report, which keeps its
624
+ * own arrays. Needs `include=full` (the default when `list` is given);
625
+ * not served with a client space (`tenant_id`).
626
+ */
627
+ list?: components["parameters"]["ListParam"];
628
+ /**
629
+ * @description Page size of `list`, when it is not `limit`. Without it `limit` is the
630
+ * page size (25 when `limit` is absent too); `offset + page size` is at
631
+ * most 10 000.
632
+ */
633
+ list_limit?: components["parameters"]["ListPageSize"];
634
+ /** @description Rank of the first row of the page of `list`. */
635
+ offset?: components["parameters"]["ListOffset"];
636
+ /** @description Order of `sort` (`desc` for a measure, `asc` for `value`). */
637
+ order?: components["parameters"]["ListOrder"];
638
+ /**
639
+ * @description Rows of `list` whose value (path, domain, name) or title contains the
640
+ * text, case-insensitive, accents significant. A value under ten visits
641
+ * that the list hides is never found. `other` is null with a search.
642
+ */
643
+ search?: components["parameters"]["ListSearch"];
558
644
  site_id: components["parameters"]["SiteId"];
645
+ /**
646
+ * @description Sort of `list`: one of its measures or `value` (alphabetical). The
647
+ * default is its main measure, descending, ties broken by the value.
648
+ */
649
+ sort?: components["parameters"]["ListSort"];
559
650
  /**
560
651
  * @description Stable tenant identifier. Use this for tenant-scoped analytics and
561
652
  * tenant-scoped access control. `site_id` identifies the shared product,
@@ -1128,6 +1219,7 @@ export interface components {
1128
1219
  BreakdownResponse: {
1129
1220
  availability: components["schemas"]["ReportAvailability"];
1130
1221
  meta: components["schemas"]["MeteredMeta"];
1222
+ page?: components["schemas"]["ReportListPaging"];
1131
1223
  /**
1132
1224
  * @description Values of ten visits or more, except the whole-site breakdowns
1133
1225
  * exact from 1. With a filter, a client space or a raw referrer, the
@@ -1168,6 +1260,7 @@ export interface components {
1168
1260
  }[];
1169
1261
  /** @enum {string} */
1170
1262
  include: "full";
1263
+ lists?: components["schemas"]["ReportLists"];
1171
1264
  /**
1172
1265
  * @description The only Web Vitals measurement method served.
1173
1266
  * @enum {string}
@@ -1565,6 +1658,42 @@ export interface components {
1565
1658
  ReportAvailabilitySectionId: string;
1566
1659
  /** @enum {string} */
1567
1660
  ReportAvailabilityStatus: "available" | "partially_available_outside_source_coverage" | "not_available_for_requested_period";
1661
+ /** @description Counts by measure; `null` is "< 10". */
1662
+ ReportListMeasures: {
1663
+ [key: string]: number | null;
1664
+ };
1665
+ ReportListPage: components["schemas"]["ReportListPaging"] & {
1666
+ rows: components["schemas"]["ReportListRow"][];
1667
+ };
1668
+ /**
1669
+ * @description Paging of a list, present when `list` is given. `totals` is the total
1670
+ * of the whole list. `other` is `totals` minus the rows of ranks 1 to
1671
+ * `offset` + page size; a hidden part of 1 to 9 that would leave it at
1672
+ * zero is published "< 10" (`null`), never a zero; it is `null` with a
1673
+ * `search`. Present with `list` on `GET /v1/metrics/breakdown` as `page`.
1674
+ */
1675
+ ReportListPaging: {
1676
+ /** @description Offset of the next page; null on the last one. */
1677
+ next_offset: number | null;
1678
+ other: components["schemas"]["ReportListMeasures"] | null;
1679
+ /**
1680
+ * @description Rows after masking and search; null when the head of the ranking
1681
+ * proves the order without counting the rest.
1682
+ */
1683
+ total_rows: number | null;
1684
+ totals: components["schemas"]["ReportListMeasures"];
1685
+ };
1686
+ ReportListRow: {
1687
+ measures: components["schemas"]["ReportListMeasures"];
1688
+ previous?: components["schemas"]["ReportListMeasures"] | null;
1689
+ title: string | null;
1690
+ /** @description Path, domain or name. */
1691
+ value: string;
1692
+ };
1693
+ /** @description The page of the list asked by `list`, keyed by its identifier. */
1694
+ ReportLists: {
1695
+ [key: string]: components["schemas"]["ReportListPage"];
1696
+ };
1568
1697
  ReportPeriodAvailability: {
1569
1698
  /** Format: date-time */
1570
1699
  compatibleEnd: string | null;
@@ -1801,6 +1930,7 @@ export interface components {
1801
1930
  campaigns_enabled: boolean;
1802
1931
  /** @description Visits with Campagnes consent in the period, published like the other counts. `0` when the option is off. */
1803
1932
  consented_sessions: number | null;
1933
+ lists?: components["schemas"]["ReportLists"];
1804
1934
  /**
1805
1935
  * @description Visits with consent by campaign (Campagnes option, section
1806
1936
  * `acquisition_attribution`); empty without the option.
@@ -2063,6 +2193,16 @@ export interface components {
2063
2193
  BreakdownDimension: "device" | "referrer" | "page" | "browser" | "os" | "country" | "tenant";
2064
2194
  /** @description Number of rows returned by breakdown endpoint. */
2065
2195
  BreakdownLimit: number;
2196
+ /**
2197
+ * @description Reads the breakdown as the paginated list of its dimension (`device`:
2198
+ * `devices`, `referrer`: `referrers`, `page`: `pages`, `browser`:
2199
+ * `browsers`, `os`: `systems`, `country`: `countries`). Whole site, no
2200
+ * `filters` and no `tenant_id`. `rows[].value` is the main measure of the
2201
+ * list (pageviews for `pages`, visits for the others); a `metric` other
2202
+ * than `pageviews` for `pages` or `sessions` for the others is refused and `page` carries `next_offset`, `total_rows`, `totals` and
2203
+ * `other`.
2204
+ */
2205
+ BreakdownListParam: "devices" | "referrers" | "pages" | "browsers" | "systems" | "countries";
2066
2206
  /** @description Compare current range against the previous equivalent period. */
2067
2207
  CompareParam: "prev_period";
2068
2208
  /**
@@ -2082,6 +2222,36 @@ export interface components {
2082
2222
  FromDate: string;
2083
2223
  /** @description Granularity (`day` or `hour`, on every plan with API access). */
2084
2224
  Interval: "day" | "hour";
2225
+ /** @description Rank of the first row of the page of `list`. */
2226
+ ListOffset: number;
2227
+ /** @description Order of `sort` (`desc` for a measure, `asc` for `value`). */
2228
+ ListOrder: "asc" | "desc";
2229
+ /**
2230
+ * @description Page size of `list`, when it is not `limit`. Without it `limit` is the
2231
+ * page size (25 when `limit` is absent too); `offset + page size` is at
2232
+ * most 10 000.
2233
+ */
2234
+ ListPageSize: number;
2235
+ /**
2236
+ * @description A list of the report read page by page (see Pagination). Content serves
2237
+ * `pages`, `entry_pages` and `exit_pages`; Acquisition serves
2238
+ * `landing_pages`, `referrers` and the Campagnes lists. The page is
2239
+ * returned in `current.lists.<list>` next to the report, which keeps its
2240
+ * own arrays. Needs `include=full` (the default when `list` is given);
2241
+ * not served with a client space (`tenant_id`).
2242
+ */
2243
+ ListParam: "pages" | "entry_pages" | "exit_pages" | "landing_pages" | "referrers" | "campaign_channels" | "campaign_sources" | "campaign_mediums" | "campaigns" | "campaign_contents" | "campaign_terms";
2244
+ /**
2245
+ * @description Rows of `list` whose value (path, domain, name) or title contains the
2246
+ * text, case-insensitive, accents significant. A value under ten visits
2247
+ * that the list hides is never found. `other` is null with a search.
2248
+ */
2249
+ ListSearch: string;
2250
+ /**
2251
+ * @description Sort of `list`: one of its measures or `value` (alphabetical). The
2252
+ * default is its main measure, descending, ties broken by the value.
2253
+ */
2254
+ ListSort: string;
2085
2255
  /**
2086
2256
  * @description Metric to aggregate (default `pageviews`). `sessions` uses the same
2087
2257
  * visit model as the dashboard: a `visit_id` starts from the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pomeloanalytics/api",
3
- "version": "0.1.0-beta.5",
3
+ "version": "0.1.0-beta.6",
4
4
  "description": "TypeScript client for reading Pomelo Analytics reports, sites and goals from Node.js servers.",
5
5
  "homepage": "https://www.pomeloanalytics.com/",
6
6
  "keywords": ["pomelo", "analytics", "web-analytics", "typescript", "nodejs", "sdk", "api-client"],