@pomeloanalytics/api 0.1.0-beta.0 → 0.1.0-beta.1
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 +9 -0
- package/README.md +49 -2
- package/dist/generated/openapi.d.ts +33 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.0-beta.1
|
|
4
|
+
|
|
5
|
+
- Sync the reviewed public contract for optional Acquisition `goalId` selection
|
|
6
|
+
with `include: 'details'`, transmitted as `goal_id` by the existing client.
|
|
7
|
+
- Add generated dimension impact types for sources, mediums and campaigns,
|
|
8
|
+
preserving API field names, conditional impact and complete response metadata.
|
|
9
|
+
- Verify goal selection and dimension impacts in typed, wire and isolated
|
|
10
|
+
tarball consumers; document candidate and published beta versions separately.
|
|
11
|
+
|
|
3
12
|
## 0.1.0-beta.0
|
|
4
13
|
|
|
5
14
|
- Prepare the server-side API client with injected fetch, request cancellation,
|
package/README.md
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Server-side TypeScript client for the Pomelo Analytics API.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
This package uses the `beta` prerelease line. Its exact version is recorded in
|
|
6
|
+
[package.json](package.json). MIT licensed.
|
|
6
7
|
|
|
7
8
|
Use Node.js 22.13+ on the Node 22 release line or Node.js 24. The package uses ESM
|
|
8
9
|
and has no runtime dependencies. CommonJS consumers on these supported Node
|
|
@@ -17,6 +18,15 @@ fetch is called.
|
|
|
17
18
|
npm install @pomeloanalytics/api@beta
|
|
18
19
|
```
|
|
19
20
|
|
|
21
|
+
Check the registry versions and dist-tags before choosing an installation:
|
|
22
|
+
|
|
23
|
+
```sh
|
|
24
|
+
npm view @pomeloanalytics/api dist-tags versions --json
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
A source checkout or local tarball may contain an unpublished candidate.
|
|
28
|
+
Registry metadata determines which versions are available from npm.
|
|
29
|
+
|
|
20
30
|
## Usage
|
|
21
31
|
|
|
22
32
|
```ts
|
|
@@ -109,6 +119,43 @@ deprecated alias for `full`. Actions accepts `summary`, `full`, and `details`
|
|
|
109
119
|
using its single response schema; summary leaves detail lists empty on the server.
|
|
110
120
|
Omitting `include` leaves the server's selection unchanged.
|
|
111
121
|
|
|
122
|
+
### Acquisition goal impact
|
|
123
|
+
|
|
124
|
+
The typed `goalId` option and source, medium and campaign impact fields require
|
|
125
|
+
`0.1.0-beta.1` or later. The optional `goalId` is used with `include: 'details'`
|
|
126
|
+
and sent as `goal_id`. It selects one configured goal belonging to the site. Omitting it
|
|
127
|
+
leaves the server's union of configured goals unchanged. An unknown goal or use
|
|
128
|
+
with another report variant is rejected by the server as `INVALID_PARAMS`.
|
|
129
|
+
|
|
130
|
+
```ts
|
|
131
|
+
const { data } = await pomelo.reports.acquisition({
|
|
132
|
+
siteId: 'site-test', from: '2026-10-01', to: '2026-10-24',
|
|
133
|
+
include: 'details', goalId: 'goal-test',
|
|
134
|
+
});
|
|
135
|
+
if ('dimensions' in data.current && data.current.impact) {
|
|
136
|
+
const { sources, mediums, campaigns } = data.current.impact;
|
|
137
|
+
// Items retain value, converted_sessions and session_conversion_rate.
|
|
138
|
+
}
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
Impact is conditional on the server response and Extended data. It reports
|
|
142
|
+
distinct converted visits using first-pageview attribution; repeated goal
|
|
143
|
+
matches count once. Check availability as well as the optional impact object.
|
|
144
|
+
The SDK supplies no impact defaults or enrichment.
|
|
145
|
+
|
|
146
|
+
The API can also be read directly over HTTP without this package. From a server
|
|
147
|
+
shell with `POMELO_API_TOKEN` configured outside the source tree:
|
|
148
|
+
|
|
149
|
+
```sh
|
|
150
|
+
curl --get 'https://api.pomeloanalytics.com/v1/reports/acquisition' \
|
|
151
|
+
--header "Authorization: Bearer ${POMELO_API_TOKEN}" \
|
|
152
|
+
--data-urlencode 'site_id=site-test' \
|
|
153
|
+
--data-urlencode 'from=2026-10-01' \
|
|
154
|
+
--data-urlencode 'to=2026-10-24' \
|
|
155
|
+
--data-urlencode 'include=details' \
|
|
156
|
+
--data-urlencode 'goal_id=goal-test'
|
|
157
|
+
```
|
|
158
|
+
|
|
112
159
|
HTTP 200 on a mixed route means its strict-safe baseline succeeded. Check
|
|
113
160
|
`availability.sections` for sections that remain locked or only partially
|
|
114
161
|
available. Tenant-scoped reads use a stable opaque `tenantId`; the server checks
|
|
@@ -148,7 +195,7 @@ npm pack --workspace @pomeloanalytics/api --ignore-scripts --pack-destination .a
|
|
|
148
195
|
```
|
|
149
196
|
|
|
150
197
|
Install that tarball into another Node ESM project with
|
|
151
|
-
`npm install /path/to/pomeloanalytics-api-0.1.0-beta.
|
|
198
|
+
`npm install /path/to/pomeloanalytics-api-0.1.0-beta.1.tgz`.
|
|
152
199
|
|
|
153
200
|
The repository includes a server example and a runnable synthetic consumer.
|
|
154
201
|
The package audit compiles and executes the synthetic consumer in a fresh
|
|
@@ -344,6 +344,10 @@ export interface paths {
|
|
|
344
344
|
* `full` returns `current.by_channel` and top lists. `details` returns
|
|
345
345
|
* dimensions, landing pages and optional goal impact; it is a distinct
|
|
346
346
|
* Acquisition variant, not the Content alias for full.
|
|
347
|
+
* `goal_id` optionally selects one configured site goal for `details`
|
|
348
|
+
* impact. Impact reports distinct converted visits and rates by channel,
|
|
349
|
+
* landing page, source, medium and campaign using first-pageview
|
|
350
|
+
* attribution; omission uses the union of the site's configured goals.
|
|
347
351
|
*/
|
|
348
352
|
get: {
|
|
349
353
|
parameters: {
|
|
@@ -352,6 +356,13 @@ export interface paths {
|
|
|
352
356
|
compare?: components["parameters"]["CompareParam"];
|
|
353
357
|
/** @description Inclusive UTC start date (YYYY-MM-DD). Pass explicit from and to dates to bound the requested period. */
|
|
354
358
|
from?: components["parameters"]["FromDate"];
|
|
359
|
+
/**
|
|
360
|
+
* @description Acquisition `include=details` only. Selects one configured goal belonging
|
|
361
|
+
* to the requested site for conversion impact. Omission uses the union
|
|
362
|
+
* of all configured goals. An unknown goal or another report variant
|
|
363
|
+
* returns `INVALID_PARAMS` without charging usage.
|
|
364
|
+
*/
|
|
365
|
+
goal_id?: components["parameters"]["AcquisitionGoalId"];
|
|
355
366
|
/** @description Report depth for Acquisition and Actions. When report include selection is enabled, omission selects summary; otherwise the handler uses full even when include is supplied. No unconditional default is declared here. */
|
|
356
367
|
include?: components["parameters"]["ReportInclude"];
|
|
357
368
|
/** @description Number of rows returned by top lists for report endpoints. */
|
|
@@ -878,6 +889,11 @@ export interface components {
|
|
|
878
889
|
compare: components["schemas"]["UserApiAcquisitionDetailsCurrent"] | null;
|
|
879
890
|
current: components["schemas"]["UserApiAcquisitionDetailsCurrent"];
|
|
880
891
|
};
|
|
892
|
+
AcquisitionDimensionImpactItem: {
|
|
893
|
+
converted_sessions: number;
|
|
894
|
+
session_conversion_rate: number;
|
|
895
|
+
value: string;
|
|
896
|
+
};
|
|
881
897
|
AcquisitionDimensionItem: components["schemas"]["AcquisitionSummaryTotals"] & {
|
|
882
898
|
favicon_url?: string | null;
|
|
883
899
|
share: number;
|
|
@@ -886,7 +902,15 @@ export interface components {
|
|
|
886
902
|
AcquisitionFullReportResponse: components["schemas"]["UserApiAcquisitionEnvelope"] & {
|
|
887
903
|
meta: components["schemas"]["MeteredMeta"];
|
|
888
904
|
};
|
|
905
|
+
/**
|
|
906
|
+
* @description Extended-only goal impact. Each dimension comes from the visit's
|
|
907
|
+
* canonical first pageview in the requested scope. A converted visit
|
|
908
|
+
* matches at least one selected goal through an eligible Extended event;
|
|
909
|
+
* repeated matches count once. Rates divide converted visits by eligible
|
|
910
|
+
* Extended visits in the same dimension, period and traffic scope.
|
|
911
|
+
*/
|
|
889
912
|
AcquisitionImpact: {
|
|
913
|
+
campaigns: components["schemas"]["AcquisitionDimensionImpactItem"][];
|
|
890
914
|
channels: {
|
|
891
915
|
/** @enum {string} */
|
|
892
916
|
channel: "Direct" | "Search" | "Referral" | "Social" | "Email" | "Paid" | "Other";
|
|
@@ -898,6 +922,8 @@ export interface components {
|
|
|
898
922
|
path_canon: string | null;
|
|
899
923
|
session_conversion_rate: number;
|
|
900
924
|
}[];
|
|
925
|
+
mediums: components["schemas"]["AcquisitionDimensionImpactItem"][];
|
|
926
|
+
sources: components["schemas"]["AcquisitionDimensionImpactItem"][];
|
|
901
927
|
};
|
|
902
928
|
AcquisitionLandingPageSummaryItem: components["schemas"]["AcquisitionSummaryTotals"] & {
|
|
903
929
|
page_title?: string | null;
|
|
@@ -1814,6 +1840,13 @@ export interface components {
|
|
|
1814
1840
|
};
|
|
1815
1841
|
};
|
|
1816
1842
|
parameters: {
|
|
1843
|
+
/**
|
|
1844
|
+
* @description Acquisition `include=details` only. Selects one configured goal belonging
|
|
1845
|
+
* to the requested site for conversion impact. Omission uses the union
|
|
1846
|
+
* of all configured goals. An unknown goal or another report variant
|
|
1847
|
+
* returns `INVALID_PARAMS` without charging usage.
|
|
1848
|
+
*/
|
|
1849
|
+
AcquisitionGoalId: string;
|
|
1817
1850
|
/** @description Filter action reports by normalized action family. */
|
|
1818
1851
|
ActionFamily: "goals" | "forms" | "outbound" | "downloads" | "errors" | "custom" | "instrumentation";
|
|
1819
1852
|
/** @description Filter action reports by normalized action key. */
|