@yourbright/emdash-analytics-plugin 0.1.1 → 0.1.2
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/admin.js +860 -0
- package/dist/index.js +1560 -0
- package/package.json +8 -5
- package/src/admin.tsx +0 -1138
- package/src/config-validation.ts +0 -153
- package/src/config.ts +0 -90
- package/src/constants.ts +0 -55
- package/src/content.ts +0 -133
- package/src/google.ts +0 -518
- package/src/index.ts +0 -270
- package/src/scoring.ts +0 -83
- package/src/sync.ts +0 -749
- package/src/types.ts +0 -193
package/src/types.ts
DELETED
|
@@ -1,193 +0,0 @@
|
|
|
1
|
-
export type PageKind =
|
|
2
|
-
| "blog_post"
|
|
3
|
-
| "blog_archive"
|
|
4
|
-
| "tag"
|
|
5
|
-
| "author"
|
|
6
|
-
| "landing"
|
|
7
|
-
| "other";
|
|
8
|
-
|
|
9
|
-
export type OpportunityTag =
|
|
10
|
-
| "high-impression-low-ctr"
|
|
11
|
-
| "ranking-near-page-1"
|
|
12
|
-
| "traffic-decline"
|
|
13
|
-
| "weak-engagement"
|
|
14
|
-
| "query-capture-gap";
|
|
15
|
-
|
|
16
|
-
export interface GoogleServiceAccount {
|
|
17
|
-
client_email: string;
|
|
18
|
-
private_key: string;
|
|
19
|
-
token_uri?: string;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export interface SavedPluginConfig {
|
|
23
|
-
siteOrigin: string;
|
|
24
|
-
ga4PropertyId: string;
|
|
25
|
-
gscSiteUrl: string;
|
|
26
|
-
serviceAccountJson: string;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export interface PluginConfigSummary {
|
|
30
|
-
siteOrigin: string;
|
|
31
|
-
ga4PropertyId: string;
|
|
32
|
-
gscSiteUrl: string;
|
|
33
|
-
hasServiceAccount: boolean;
|
|
34
|
-
serviceAccountEmail?: string;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export interface FreshnessState {
|
|
38
|
-
lastSyncedAt: string | null;
|
|
39
|
-
lastGscDate: string | null;
|
|
40
|
-
lastGaDate: string | null;
|
|
41
|
-
lastStatus: "idle" | "success" | "degraded" | "error";
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export interface SiteSummary {
|
|
45
|
-
window: {
|
|
46
|
-
gscCurrent: { startDate: string; endDate: string };
|
|
47
|
-
gscPrevious: { startDate: string; endDate: string };
|
|
48
|
-
gaCurrent: { startDate: string; endDate: string };
|
|
49
|
-
gaPrevious: { startDate: string; endDate: string };
|
|
50
|
-
};
|
|
51
|
-
totals: {
|
|
52
|
-
gscClicks28d: number;
|
|
53
|
-
gscImpressions28d: number;
|
|
54
|
-
gaViews28d: number;
|
|
55
|
-
gaUsers28d: number;
|
|
56
|
-
gaSessions28d: number;
|
|
57
|
-
managedOpportunities: number;
|
|
58
|
-
trackedPages: number;
|
|
59
|
-
};
|
|
60
|
-
trend: Array<{
|
|
61
|
-
date: string;
|
|
62
|
-
gscClicks: number;
|
|
63
|
-
gscImpressions: number;
|
|
64
|
-
gaViews: number;
|
|
65
|
-
gaSessions: number;
|
|
66
|
-
gaUsers: number;
|
|
67
|
-
}>;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
export interface ManagedContentRef {
|
|
71
|
-
collection: "posts";
|
|
72
|
-
id: string;
|
|
73
|
-
slug: string | null;
|
|
74
|
-
urlPath: string;
|
|
75
|
-
title: string;
|
|
76
|
-
excerpt?: string;
|
|
77
|
-
seoDescription?: string;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
export interface PageAggregateRecord {
|
|
81
|
-
urlPath: string;
|
|
82
|
-
host: string;
|
|
83
|
-
pageKind: PageKind;
|
|
84
|
-
managed: boolean;
|
|
85
|
-
title: string;
|
|
86
|
-
contentCollection: string | null;
|
|
87
|
-
contentId: string | null;
|
|
88
|
-
contentSlug: string | null;
|
|
89
|
-
gscClicks28d: number;
|
|
90
|
-
gscImpressions28d: number;
|
|
91
|
-
gscCtr28d: number;
|
|
92
|
-
gscPosition28d: number;
|
|
93
|
-
gscClicksPrev28d: number;
|
|
94
|
-
gscImpressionsPrev28d: number;
|
|
95
|
-
gaViews28d: number;
|
|
96
|
-
gaUsers28d: number;
|
|
97
|
-
gaSessions28d: number;
|
|
98
|
-
gaEngagementRate28d: number;
|
|
99
|
-
gaBounceRate28d: number;
|
|
100
|
-
gaAvgSessionDuration28d: number;
|
|
101
|
-
gaViewsPrev28d: number;
|
|
102
|
-
gaUsersPrev28d: number;
|
|
103
|
-
gaSessionsPrev28d: number;
|
|
104
|
-
opportunityScore: number;
|
|
105
|
-
opportunityTags: OpportunityTag[];
|
|
106
|
-
lastSyncedAt: string;
|
|
107
|
-
lastGscDate: string | null;
|
|
108
|
-
lastGaDate: string | null;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
export interface PageQueryRecord {
|
|
112
|
-
urlPath: string;
|
|
113
|
-
query: string;
|
|
114
|
-
clicks28d: number;
|
|
115
|
-
impressions28d: number;
|
|
116
|
-
ctr28d: number;
|
|
117
|
-
position28d: number;
|
|
118
|
-
updatedAt: string;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
export interface DailyMetricRecord {
|
|
122
|
-
source: "gsc" | "ga";
|
|
123
|
-
scope: "all_public";
|
|
124
|
-
date: string;
|
|
125
|
-
clicks: number;
|
|
126
|
-
impressions: number;
|
|
127
|
-
views: number;
|
|
128
|
-
sessions: number;
|
|
129
|
-
users: number;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
export interface SyncRunRecord {
|
|
133
|
-
jobType: "sync-base" | "enrich-managed-queries" | "manual";
|
|
134
|
-
status: "running" | "success" | "degraded" | "error";
|
|
135
|
-
startedAt: string;
|
|
136
|
-
finishedAt: string | null;
|
|
137
|
-
summary: Record<string, unknown> | null;
|
|
138
|
-
error: string | null;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
export interface AgentKeyRecord {
|
|
142
|
-
prefix: string;
|
|
143
|
-
hash: string;
|
|
144
|
-
label: string;
|
|
145
|
-
createdAt: string;
|
|
146
|
-
lastUsedAt: string | null;
|
|
147
|
-
revokedAt: string | null;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
export interface OpportunityEvidence {
|
|
151
|
-
tag: OpportunityTag;
|
|
152
|
-
reason: string;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
export interface ContentContextResponse {
|
|
156
|
-
content: {
|
|
157
|
-
collection: "posts";
|
|
158
|
-
id: string;
|
|
159
|
-
slug: string | null;
|
|
160
|
-
title: string;
|
|
161
|
-
urlPath: string;
|
|
162
|
-
url: string;
|
|
163
|
-
excerpt: string | null;
|
|
164
|
-
seoDescription: string | null;
|
|
165
|
-
};
|
|
166
|
-
analytics: {
|
|
167
|
-
window: SiteSummary["window"];
|
|
168
|
-
page: PageAggregateRecord & {
|
|
169
|
-
gscClicksDelta: number;
|
|
170
|
-
gscImpressionsDelta: number;
|
|
171
|
-
gaViewsDelta: number;
|
|
172
|
-
gaUsersDelta: number;
|
|
173
|
-
gaSessionsDelta: number;
|
|
174
|
-
};
|
|
175
|
-
searchQueries: PageQueryRecord[];
|
|
176
|
-
opportunities: OpportunityEvidence[];
|
|
177
|
-
freshness: FreshnessState;
|
|
178
|
-
};
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
export interface PageListFilters {
|
|
182
|
-
managed?: "all" | "managed" | "unmanaged";
|
|
183
|
-
hasOpportunity?: boolean;
|
|
184
|
-
pageKind?: PageKind | "all";
|
|
185
|
-
limit?: number;
|
|
186
|
-
cursor?: string;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
export interface PageListResponse {
|
|
190
|
-
items: Array<PageAggregateRecord>;
|
|
191
|
-
cursor?: string;
|
|
192
|
-
hasMore: boolean;
|
|
193
|
-
}
|