@reactionary/algolia 0.9.2 → 0.9.4
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.
|
@@ -18,6 +18,9 @@ class AlgoliaAnalyticsCapability extends AnalyticsCapability {
|
|
|
18
18
|
this.authenticatedUserToken = hash("sha256", requestContext.session.identityContext.identity.id.userId);
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
+
getResourceName() {
|
|
22
|
+
return "algolia-analytics";
|
|
23
|
+
}
|
|
21
24
|
async processProductAddToCart(event) {
|
|
22
25
|
if (event.source && event.source.type === "search") {
|
|
23
26
|
const algoliaEvent = {
|
|
@@ -33,7 +36,9 @@ class AlgoliaAnalyticsCapability extends AnalyticsCapability {
|
|
|
33
36
|
await this.client.pushEvents({
|
|
34
37
|
events: [algoliaEvent]
|
|
35
38
|
});
|
|
39
|
+
return this.accepted();
|
|
36
40
|
}
|
|
41
|
+
return this.rejected();
|
|
37
42
|
}
|
|
38
43
|
async processProductSummaryClick(event) {
|
|
39
44
|
if (event.source && event.source.type === "search") {
|
|
@@ -50,7 +55,9 @@ class AlgoliaAnalyticsCapability extends AnalyticsCapability {
|
|
|
50
55
|
await this.client.pushEvents({
|
|
51
56
|
events: [algoliaEvent]
|
|
52
57
|
});
|
|
58
|
+
return this.accepted();
|
|
53
59
|
}
|
|
60
|
+
return this.rejected();
|
|
54
61
|
}
|
|
55
62
|
async processProductSummaryView(event) {
|
|
56
63
|
if (event.source && event.source.type === "search") {
|
|
@@ -65,7 +72,9 @@ class AlgoliaAnalyticsCapability extends AnalyticsCapability {
|
|
|
65
72
|
await this.client.pushEvents({
|
|
66
73
|
events: [algoliaEvent]
|
|
67
74
|
});
|
|
75
|
+
return this.accepted();
|
|
68
76
|
}
|
|
77
|
+
return this.rejected();
|
|
69
78
|
}
|
|
70
79
|
async processPurchase(event) {
|
|
71
80
|
const algoliaEvent = {
|
|
@@ -80,6 +89,7 @@ class AlgoliaAnalyticsCapability extends AnalyticsCapability {
|
|
|
80
89
|
await this.client.pushEvents({
|
|
81
90
|
events: [algoliaEvent]
|
|
82
91
|
});
|
|
92
|
+
return this.accepted();
|
|
83
93
|
}
|
|
84
94
|
}
|
|
85
95
|
export {
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reactionary/algolia",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"types": "./src/index.d.ts",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@reactionary/core": "0.9.
|
|
8
|
+
"@reactionary/core": "0.9.4",
|
|
9
9
|
"zod": "4.1.9",
|
|
10
10
|
"algoliasearch": "^5.48.0",
|
|
11
11
|
"vitest": "^4.0.9",
|
|
@@ -6,8 +6,9 @@ export declare class AlgoliaAnalyticsCapability extends AnalyticsCapability {
|
|
|
6
6
|
protected config: AlgoliaConfiguration;
|
|
7
7
|
protected authenticatedUserToken: string | undefined;
|
|
8
8
|
constructor(cache: Cache, requestContext: RequestContext, config: AlgoliaConfiguration);
|
|
9
|
-
protected
|
|
10
|
-
protected
|
|
11
|
-
protected
|
|
12
|
-
protected
|
|
9
|
+
protected getResourceName(): string;
|
|
10
|
+
protected processProductAddToCart(event: AnalyticsMutationProductAddToCartEvent): Promise<import("@reactionary/core").AnalyticsResult>;
|
|
11
|
+
protected processProductSummaryClick(event: AnalyticsMutationProductSummaryClickEvent): Promise<import("@reactionary/core").AnalyticsResult>;
|
|
12
|
+
protected processProductSummaryView(event: AnalyticsMutationProductSummaryViewEvent): Promise<import("@reactionary/core").AnalyticsResult>;
|
|
13
|
+
protected processPurchase(event: AnalyticsMutationPurchaseEvent): Promise<import("@reactionary/core").AnalyticsResult>;
|
|
13
14
|
}
|