@pagebridge/core 0.3.0 → 0.3.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.
@@ -9,6 +9,13 @@ export interface QuickWinPageSummary {
9
9
  queryCount: number;
10
10
  totalImpressions: number;
11
11
  avgPosition: number;
12
+ queries: {
13
+ query: string;
14
+ clicks: number;
15
+ impressions: number;
16
+ ctr: number;
17
+ position: number;
18
+ }[];
12
19
  }
13
20
  export declare class InsightWriter {
14
21
  private sanity;
@@ -1 +1 @@
1
- {"version":3,"file":"insight-writer.d.ts","sourceRoot":"","sources":["../src/insight-writer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAC1E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAG7D,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,MAAM,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,qBAAa,aAAa;IACZ,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,YAAY;IAExC;;;;OAIG;IACG,KAAK,CACT,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,eAAe,EACrB,qBAAqB,EAAE,oBAAoB,EAAE,EAC7C,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,EAC9D,SAAS,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,aAAa,EAAE,CAAC,GACvC,OAAO,CAAC,IAAI,CAAC;CA8EjB"}
1
+ {"version":3,"file":"insight-writer.d.ts","sourceRoot":"","sources":["../src/insight-writer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAC1E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAG7D,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,MAAM,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAClG;AAED,qBAAa,aAAa;IACZ,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,YAAY;IAExC;;;;OAIG;IACG,KAAK,CACT,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,eAAe,EACrB,qBAAqB,EAAE,oBAAoB,EAAE,EAC7C,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,EAC9D,SAAS,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,aAAa,EAAE,CAAC,GACvC,OAAO,CAAC,IAAI,CAAC;CAsFjB"}
@@ -27,6 +27,14 @@ export class InsightWriter {
27
27
  queryCount: queries.length,
28
28
  totalImpressions,
29
29
  avgPosition,
30
+ queries: queries.map((q) => ({
31
+ _key: sanityKey(`qwq:${page}:${q.query}`),
32
+ query: q.query,
33
+ clicks: q.clicks,
34
+ impressions: q.impressions,
35
+ ctr: q.ctr,
36
+ position: q.position,
37
+ })),
30
38
  });
31
39
  }
32
40
  quickWinPages.sort((a, b) => b.totalImpressions - a.totalImpressions);
@@ -28,11 +28,11 @@ export class URLMatcher {
28
28
  const slugToDocMap = new Map();
29
29
  const allSlugs = [];
30
30
  for (const urlConfig of this.normalizedConfigs) {
31
- const query = `*[_type == $type]{
32
- _id,
33
- _type,
34
- "${urlConfig.slugField}": ${urlConfig.slugField}.current,
35
- _createdAt
31
+ const query = `*[_type == $type]{
32
+ _id,
33
+ _type,
34
+ "${urlConfig.slugField}": ${urlConfig.slugField}.current,
35
+ _createdAt
36
36
  }`;
37
37
  const documents = await this.sanityClient.fetch(query, {
38
38
  type: urlConfig.contentType,
@@ -59,8 +59,8 @@ export class URLMatcher {
59
59
  async getAvailableSlugs() {
60
60
  const allSlugs = [];
61
61
  for (const urlConfig of this.normalizedConfigs) {
62
- const query = `*[_type == $type]{
63
- "${urlConfig.slugField}": ${urlConfig.slugField}.current
62
+ const query = `*[_type == $type]{
63
+ "${urlConfig.slugField}": ${urlConfig.slugField}.current
64
64
  }`;
65
65
  const documents = await this.sanityClient.fetch(query, {
66
66
  type: urlConfig.contentType,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pagebridge/core",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "Core engine for PageBridge — GSC sync, URL matching, content decay detection, and task generation",
5
5
  "license": "MIT",
6
6
  "private": false,