@algolia/client-insights 5.0.0-alpha.10 → 5.0.0-alpha.100
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/builds/browser.d.ts +5 -5
- package/dist/builds/browser.d.ts.map +1 -1
- package/dist/builds/node.d.ts +5 -5
- package/dist/builds/node.d.ts.map +1 -1
- package/dist/{client-insights.cjs.js → client-insights.cjs} +231 -216
- package/dist/client-insights.esm.browser.js +442 -451
- package/dist/client-insights.esm.node.js +231 -214
- package/dist/client-insights.umd.js +2 -2
- package/dist/model/addToCartEvent.d.ts +2 -0
- package/dist/model/addToCartEvent.d.ts.map +1 -0
- package/dist/model/addedToCartObjectIDs.d.ts +45 -0
- package/dist/model/addedToCartObjectIDs.d.ts.map +1 -0
- package/dist/model/addedToCartObjectIDsAfterSearch.d.ts +49 -0
- package/dist/model/addedToCartObjectIDsAfterSearch.d.ts.map +1 -0
- package/dist/model/clickEvent.d.ts +2 -0
- package/dist/model/clickEvent.d.ts.map +1 -0
- package/dist/model/clickedFilters.d.ts +32 -0
- package/dist/model/clickedFilters.d.ts.map +1 -0
- package/dist/model/clickedObjectIDs.d.ts +32 -0
- package/dist/model/clickedObjectIDs.d.ts.map +1 -0
- package/dist/model/clickedObjectIDsAfterSearch.d.ts +40 -0
- package/dist/model/clickedObjectIDsAfterSearch.d.ts.map +1 -0
- package/dist/model/clientMethodProps.d.ts +69 -60
- package/dist/model/clientMethodProps.d.ts.map +1 -1
- package/dist/model/conversionEvent.d.ts +2 -0
- package/dist/model/conversionEvent.d.ts.map +1 -0
- package/dist/model/convertedFilters.d.ts +29 -0
- package/dist/model/convertedFilters.d.ts.map +1 -0
- package/dist/model/convertedObjectIDs.d.ts +32 -0
- package/dist/model/convertedObjectIDs.d.ts.map +1 -0
- package/dist/model/convertedObjectIDsAfterSearch.d.ts +36 -0
- package/dist/model/convertedObjectIDsAfterSearch.d.ts.map +1 -0
- package/dist/model/discount.d.ts +5 -0
- package/dist/model/discount.d.ts.map +1 -0
- package/dist/model/errorBase.d.ts +6 -6
- package/dist/model/errorBase.d.ts.map +1 -1
- package/dist/model/eventsItems.d.ts +14 -0
- package/dist/model/eventsItems.d.ts.map +1 -0
- package/dist/model/eventsResponse.d.ts +14 -0
- package/dist/model/eventsResponse.d.ts.map +1 -0
- package/dist/model/index.d.ts +27 -6
- package/dist/model/index.d.ts.map +1 -1
- package/dist/model/insightsEvents.d.ts +8 -0
- package/dist/model/insightsEvents.d.ts.map +1 -0
- package/dist/model/objectData.d.ts +11 -0
- package/dist/model/objectData.d.ts.map +1 -0
- package/dist/model/objectDataAfterSearch.d.ts +15 -0
- package/dist/model/objectDataAfterSearch.d.ts.map +1 -0
- package/dist/model/price.d.ts +5 -0
- package/dist/model/price.d.ts.map +1 -0
- package/dist/model/purchaseEvent.d.ts +2 -0
- package/dist/model/purchaseEvent.d.ts.map +1 -0
- package/dist/model/purchasedObjectIDs.d.ts +45 -0
- package/dist/model/purchasedObjectIDs.d.ts.map +1 -0
- package/dist/model/purchasedObjectIDsAfterSearch.d.ts +45 -0
- package/dist/model/purchasedObjectIDsAfterSearch.d.ts.map +1 -0
- package/dist/model/value.d.ts +5 -0
- package/dist/model/value.d.ts.map +1 -0
- package/dist/model/viewEvent.d.ts +2 -0
- package/dist/model/viewEvent.d.ts.map +1 -0
- package/dist/model/viewedFilters.d.ts +32 -0
- package/dist/model/viewedFilters.d.ts.map +1 -0
- package/dist/model/viewedObjectIDs.d.ts +32 -0
- package/dist/model/viewedObjectIDs.d.ts.map +1 -0
- package/dist/src/insightsClient.d.ts +88 -85
- package/dist/src/insightsClient.d.ts.map +1 -1
- package/index.js +1 -1
- package/model/addToCartEvent.ts +3 -0
- package/model/addedToCartObjectIDs.ts +57 -0
- package/model/addedToCartObjectIDsAfterSearch.ts +62 -0
- package/model/clickEvent.ts +3 -0
- package/model/clickedFilters.ts +40 -0
- package/model/clickedObjectIDs.ts +40 -0
- package/model/clickedObjectIDsAfterSearch.ts +50 -0
- package/model/clientMethodProps.ts +29 -19
- package/model/conversionEvent.ts +3 -0
- package/model/convertedFilters.ts +37 -0
- package/model/convertedObjectIDs.ts +40 -0
- package/model/convertedObjectIDsAfterSearch.ts +45 -0
- package/model/discount.ts +6 -0
- package/model/errorBase.ts +1 -1
- package/model/eventsItems.ts +28 -0
- package/model/eventsResponse.ts +16 -0
- package/model/index.ts +26 -5
- package/model/insightsEvents.ts +10 -0
- package/model/objectData.ts +15 -0
- package/model/objectDataAfterSearch.ts +20 -0
- package/model/price.ts +6 -0
- package/model/purchaseEvent.ts +3 -0
- package/model/purchasedObjectIDs.ts +57 -0
- package/model/purchasedObjectIDsAfterSearch.ts +57 -0
- package/model/value.ts +6 -0
- package/model/viewEvent.ts +3 -0
- package/model/viewedFilters.ts +40 -0
- package/model/viewedObjectIDs.ts +40 -0
- package/package.json +30 -13
- package/dist/model/eventType.d.ts +0 -2
- package/dist/model/eventType.d.ts.map +0 -1
- package/dist/model/insightEvent.d.ts +0 -40
- package/dist/model/insightEvent.d.ts.map +0 -1
- package/dist/model/insightEvents.d.ts +0 -11
- package/dist/model/insightEvents.d.ts.map +0 -1
- package/dist/model/pushEventsResponse.d.ts +0 -7
- package/dist/model/pushEventsResponse.d.ts.map +0 -1
- package/model/eventType.ts +0 -3
- package/model/insightEvent.ts +0 -50
- package/model/insightEvents.ts +0 -13
- package/model/pushEventsResponse.ts +0 -8
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { ConversionEvent } from './conversionEvent';
|
|
2
|
+
import type { ObjectDataAfterSearch } from './objectDataAfterSearch';
|
|
3
|
+
import type { PurchaseEvent } from './purchaseEvent';
|
|
4
|
+
import type { Value } from './value';
|
|
5
|
+
/**
|
|
6
|
+
* Use this event to track when users make a purchase after a previous Algolia request. If you\'re building your category pages with Algolia, you\'ll also use this event.
|
|
7
|
+
*/
|
|
8
|
+
export type PurchasedObjectIDsAfterSearch = {
|
|
9
|
+
/**
|
|
10
|
+
* The name of the event, up to 64 ASCII characters. Consider naming events consistently—for example, by adopting Segment\'s [object-action](https://segment.com/academy/collecting-data/naming-conventions-for-clean-data/#the-object-action-framework) framework.
|
|
11
|
+
*/
|
|
12
|
+
eventName: string;
|
|
13
|
+
eventType: ConversionEvent;
|
|
14
|
+
eventSubtype: PurchaseEvent;
|
|
15
|
+
/**
|
|
16
|
+
* The name of an Algolia index.
|
|
17
|
+
*/
|
|
18
|
+
index: string;
|
|
19
|
+
/**
|
|
20
|
+
* The object IDs of the records that are part of the event.
|
|
21
|
+
*/
|
|
22
|
+
objectIDs: string[];
|
|
23
|
+
/**
|
|
24
|
+
* An anonymous or pseudonymous user identifier. > **Note**: Never include personally identifiable information in user tokens.
|
|
25
|
+
*/
|
|
26
|
+
userToken: string;
|
|
27
|
+
/**
|
|
28
|
+
* An identifier for authenticated users. > **Note**: Never include personally identifiable information in user tokens.
|
|
29
|
+
*/
|
|
30
|
+
authenticatedUserToken?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Three-letter [currency code](https://www.iso.org/iso-4217-currency-codes.html).
|
|
33
|
+
*/
|
|
34
|
+
currency?: string;
|
|
35
|
+
/**
|
|
36
|
+
* Extra information about the records involved in a purchase or add-to-cart events. If provided, it must be the same length as `objectIDs`.
|
|
37
|
+
*/
|
|
38
|
+
objectData?: ObjectDataAfterSearch[];
|
|
39
|
+
/**
|
|
40
|
+
* The timestamp of the event in milliseconds in [Unix epoch time](https://wikipedia.org/wiki/Unix_time). By default, the Insights API uses the time it receives an event as its timestamp.
|
|
41
|
+
*/
|
|
42
|
+
timestamp?: number;
|
|
43
|
+
value?: Value;
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=purchasedObjectIDsAfterSearch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"purchasedObjectIDsAfterSearch.d.ts","sourceRoot":"","sources":["../../model/purchasedObjectIDsAfterSearch.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAErC;;GAEG;AACH,MAAM,MAAM,6BAA6B,GAAG;IAC1C;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB,SAAS,EAAE,eAAe,CAAC;IAE3B,YAAY,EAAE,aAAa,CAAC;IAE5B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,SAAS,EAAE,MAAM,EAAE,CAAC;IAEpB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAEhC;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,UAAU,CAAC,EAAE,qBAAqB,EAAE,CAAC;IAErC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,KAAK,CAAC,EAAE,KAAK,CAAC;CACf,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"value.d.ts","sourceRoot":"","sources":["../../model/value.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,MAAM,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"viewEvent.d.ts","sourceRoot":"","sources":["../../model/viewEvent.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { ViewEvent } from './viewEvent';
|
|
2
|
+
/**
|
|
3
|
+
* Use this method to capture active filters. For example, when browsing a category page, users see content filtered on that specific category.
|
|
4
|
+
*/
|
|
5
|
+
export type ViewedFilters = {
|
|
6
|
+
/**
|
|
7
|
+
* The name of the event, up to 64 ASCII characters. Consider naming events consistently—for example, by adopting Segment\'s [object-action](https://segment.com/academy/collecting-data/naming-conventions-for-clean-data/#the-object-action-framework) framework.
|
|
8
|
+
*/
|
|
9
|
+
eventName: string;
|
|
10
|
+
eventType: ViewEvent;
|
|
11
|
+
/**
|
|
12
|
+
* The name of an Algolia index.
|
|
13
|
+
*/
|
|
14
|
+
index: string;
|
|
15
|
+
/**
|
|
16
|
+
* Facet filters. Each facet filter string must be URL-encoded, such as, `discount:10%25`.
|
|
17
|
+
*/
|
|
18
|
+
filters: string[];
|
|
19
|
+
/**
|
|
20
|
+
* An anonymous or pseudonymous user identifier. > **Note**: Never include personally identifiable information in user tokens.
|
|
21
|
+
*/
|
|
22
|
+
userToken: string;
|
|
23
|
+
/**
|
|
24
|
+
* An identifier for authenticated users. > **Note**: Never include personally identifiable information in user tokens.
|
|
25
|
+
*/
|
|
26
|
+
authenticatedUserToken?: string;
|
|
27
|
+
/**
|
|
28
|
+
* The timestamp of the event in milliseconds in [Unix epoch time](https://wikipedia.org/wiki/Unix_time). By default, the Insights API uses the time it receives an event as its timestamp.
|
|
29
|
+
*/
|
|
30
|
+
timestamp?: number;
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=viewedFilters.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"viewedFilters.d.ts","sourceRoot":"","sources":["../../model/viewedFilters.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB,SAAS,EAAE,SAAS,CAAC;IAErB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,OAAO,EAAE,MAAM,EAAE,CAAC;IAElB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAEhC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { ViewEvent } from './viewEvent';
|
|
2
|
+
/**
|
|
3
|
+
* Use this event to track when users viewed items in the search results.
|
|
4
|
+
*/
|
|
5
|
+
export type ViewedObjectIDs = {
|
|
6
|
+
/**
|
|
7
|
+
* The name of the event, up to 64 ASCII characters. Consider naming events consistently—for example, by adopting Segment\'s [object-action](https://segment.com/academy/collecting-data/naming-conventions-for-clean-data/#the-object-action-framework) framework.
|
|
8
|
+
*/
|
|
9
|
+
eventName: string;
|
|
10
|
+
eventType: ViewEvent;
|
|
11
|
+
/**
|
|
12
|
+
* The name of an Algolia index.
|
|
13
|
+
*/
|
|
14
|
+
index: string;
|
|
15
|
+
/**
|
|
16
|
+
* The object IDs of the records that are part of the event.
|
|
17
|
+
*/
|
|
18
|
+
objectIDs: string[];
|
|
19
|
+
/**
|
|
20
|
+
* An anonymous or pseudonymous user identifier. > **Note**: Never include personally identifiable information in user tokens.
|
|
21
|
+
*/
|
|
22
|
+
userToken: string;
|
|
23
|
+
/**
|
|
24
|
+
* An identifier for authenticated users. > **Note**: Never include personally identifiable information in user tokens.
|
|
25
|
+
*/
|
|
26
|
+
authenticatedUserToken?: string;
|
|
27
|
+
/**
|
|
28
|
+
* The timestamp of the event in milliseconds in [Unix epoch time](https://wikipedia.org/wiki/Unix_time). By default, the Insights API uses the time it receives an event as its timestamp.
|
|
29
|
+
*/
|
|
30
|
+
timestamp?: number;
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=viewedObjectIDs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"viewedObjectIDs.d.ts","sourceRoot":"","sources":["../../model/viewedObjectIDs.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB,SAAS,EAAE,SAAS,CAAC;IAErB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,SAAS,EAAE,MAAM,EAAE,CAAC;IAEpB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAEhC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC"}
|
|
@@ -1,86 +1,89 @@
|
|
|
1
|
-
import type { CreateClientOptions, RequestOptions } from '@algolia/client-common';
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
5
|
-
export declare const apiClientVersion = "5.0.0-alpha.
|
|
6
|
-
export declare const REGIONS: readonly ["de", "us"];
|
|
7
|
-
export
|
|
8
|
-
export declare function createInsightsClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, region: regionOption, ...options }: CreateClientOptions & {
|
|
9
|
-
region?: Region;
|
|
10
|
-
}): {
|
|
11
|
-
transporter: import("@algolia/client-common").Transporter;
|
|
12
|
-
/**
|
|
13
|
-
* The `appId` currently in use.
|
|
14
|
-
*/
|
|
15
|
-
appId: string;
|
|
16
|
-
/**
|
|
17
|
-
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
|
|
18
|
-
*/
|
|
19
|
-
clearCache(): Promise<void>;
|
|
20
|
-
/**
|
|
21
|
-
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
|
|
22
|
-
*/
|
|
23
|
-
readonly _ua: string;
|
|
24
|
-
/**
|
|
25
|
-
* Adds a `segment` to the `x-algolia-agent` sent with every requests.
|
|
26
|
-
*
|
|
27
|
-
* @param segment - The algolia agent (user-agent) segment to add.
|
|
28
|
-
* @param version - The version of the agent.
|
|
29
|
-
*/
|
|
30
|
-
addAlgoliaAgent(segment: string, version?: string): void;
|
|
31
|
-
/**
|
|
32
|
-
* This method allow you to send requests to the Algolia REST API.
|
|
33
|
-
*
|
|
34
|
-
* @
|
|
35
|
-
* @param
|
|
36
|
-
* @param
|
|
37
|
-
* @param
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
* @
|
|
45
|
-
* @param
|
|
46
|
-
* @param
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
* @
|
|
55
|
-
* @param
|
|
56
|
-
* @param
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
* @
|
|
66
|
-
* @param
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
* @
|
|
74
|
-
* @param
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
*
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
1
|
+
import type { CreateClientOptions, RequestOptions } from '@algolia/client-common';
|
|
2
|
+
import type { CustomDeleteProps, CustomGetProps, CustomPostProps, CustomPutProps, DeleteUserTokenProps } from '../model/clientMethodProps';
|
|
3
|
+
import type { EventsResponse } from '../model/eventsResponse';
|
|
4
|
+
import type { InsightsEvents } from '../model/insightsEvents';
|
|
5
|
+
export declare const apiClientVersion = "5.0.0-alpha.100";
|
|
6
|
+
export declare const REGIONS: readonly ["de", "us"];
|
|
7
|
+
export type Region = (typeof REGIONS)[number];
|
|
8
|
+
export declare function createInsightsClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, region: regionOption, ...options }: CreateClientOptions & {
|
|
9
|
+
region?: Region;
|
|
10
|
+
}): {
|
|
11
|
+
transporter: import("@algolia/client-common").Transporter;
|
|
12
|
+
/**
|
|
13
|
+
* The `appId` currently in use.
|
|
14
|
+
*/
|
|
15
|
+
appId: string;
|
|
16
|
+
/**
|
|
17
|
+
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
|
|
18
|
+
*/
|
|
19
|
+
clearCache(): Promise<void>;
|
|
20
|
+
/**
|
|
21
|
+
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
|
|
22
|
+
*/
|
|
23
|
+
readonly _ua: string;
|
|
24
|
+
/**
|
|
25
|
+
* Adds a `segment` to the `x-algolia-agent` sent with every requests.
|
|
26
|
+
*
|
|
27
|
+
* @param segment - The algolia agent (user-agent) segment to add.
|
|
28
|
+
* @param version - The version of the agent.
|
|
29
|
+
*/
|
|
30
|
+
addAlgoliaAgent(segment: string, version?: string): void;
|
|
31
|
+
/**
|
|
32
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
33
|
+
*
|
|
34
|
+
* @param customDelete - The customDelete object.
|
|
35
|
+
* @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
36
|
+
* @param customDelete.parameters - Query parameters to apply to the current query.
|
|
37
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
38
|
+
*/
|
|
39
|
+
customDelete({ path, parameters }: CustomDeleteProps, requestOptions?: RequestOptions): Promise<Record<string, any>>;
|
|
40
|
+
/**
|
|
41
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
42
|
+
*
|
|
43
|
+
* @param customGet - The customGet object.
|
|
44
|
+
* @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
45
|
+
* @param customGet.parameters - Query parameters to apply to the current query.
|
|
46
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
47
|
+
*/
|
|
48
|
+
customGet({ path, parameters }: CustomGetProps, requestOptions?: RequestOptions): Promise<Record<string, any>>;
|
|
49
|
+
/**
|
|
50
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
51
|
+
*
|
|
52
|
+
* @param customPost - The customPost object.
|
|
53
|
+
* @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
54
|
+
* @param customPost.parameters - Query parameters to apply to the current query.
|
|
55
|
+
* @param customPost.body - Parameters to send with the custom request.
|
|
56
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
57
|
+
*/
|
|
58
|
+
customPost({ path, parameters, body }: CustomPostProps, requestOptions?: RequestOptions): Promise<Record<string, any>>;
|
|
59
|
+
/**
|
|
60
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
61
|
+
*
|
|
62
|
+
* @param customPut - The customPut object.
|
|
63
|
+
* @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
64
|
+
* @param customPut.parameters - Query parameters to apply to the current query.
|
|
65
|
+
* @param customPut.body - Parameters to send with the custom request.
|
|
66
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
67
|
+
*/
|
|
68
|
+
customPut({ path, parameters, body }: CustomPutProps, requestOptions?: RequestOptions): Promise<Record<string, any>>;
|
|
69
|
+
/**
|
|
70
|
+
* Delete all events related to a certain user token from events metrics and analytics. To delete a personalization user profile, see [Delete a user profile](https://www.algolia.com/doc/rest-api/personalization/#delete-a-user-profile).
|
|
71
|
+
*
|
|
72
|
+
* @param deleteUserToken - The deleteUserToken object.
|
|
73
|
+
* @param deleteUserToken.userToken - The user token for which to delete all associated events.
|
|
74
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
75
|
+
*/
|
|
76
|
+
deleteUserToken({ userToken }: DeleteUserTokenProps, requestOptions?: RequestOptions): Promise<void>;
|
|
77
|
+
/**
|
|
78
|
+
* Send a list of events to the Insights API. You can include up to 1,000 events in a single request, but the request body must be smaller than 2 MB.
|
|
79
|
+
*
|
|
80
|
+
* @param insightsEvents - The insightsEvents object.
|
|
81
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
82
|
+
*/
|
|
83
|
+
pushEvents(insightsEvents: InsightsEvents, requestOptions?: RequestOptions): Promise<EventsResponse>;
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* The client type.
|
|
87
|
+
*/
|
|
88
|
+
export type InsightsClient = ReturnType<typeof createInsightsClient>;
|
|
86
89
|
//# sourceMappingURL=insightsClient.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"insightsClient.d.ts","sourceRoot":"","sources":["../../src/insightsClient.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,mBAAmB,EAInB,cAAc,EAEf,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EACV,
|
|
1
|
+
{"version":3,"file":"insightsClient.d.ts","sourceRoot":"","sources":["../../src/insightsClient.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,mBAAmB,EAInB,cAAc,EAEf,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EACV,iBAAiB,EACjB,cAAc,EACd,eAAe,EACf,cAAc,EACd,oBAAoB,EACrB,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAE9D,eAAO,MAAM,gBAAgB,oBAAoB,CAAC;AAElD,eAAO,MAAM,OAAO,uBAAwB,CAAC;AAC7C,MAAM,MAAM,MAAM,GAAG,CAAC,OAAO,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC;AAW9C,wBAAgB,oBAAoB,CAAC,EACnC,KAAK,EAAE,WAAW,EAClB,MAAM,EAAE,YAAY,EACpB,QAAQ,EACR,aAAa,EACb,MAAM,EAAE,YAAY,EACpB,GAAG,OAAO,EACX,EAAE,mBAAmB,GAAG;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE;;IAwBxC;;OAEG;;IAGH;;OAEG;kBACW,QAAQ,IAAI,CAAC;IAO3B;;OAEG;;IAKH;;;;;OAKG;6BACsB,MAAM,YAAY,MAAM,GAAG,IAAI;IAIxD;;;;;;;OAOG;uCAEqB,iBAAiB,mBACtB,cAAc,GAC9B,QAAQ,OAAO,MAAM,EAAE,GAAG,CAAC,CAAC;IAqB/B;;;;;;;OAOG;oCAEqB,cAAc,mBACnB,cAAc,GAC9B,QAAQ,OAAO,MAAM,EAAE,GAAG,CAAC,CAAC;IAqB/B;;;;;;;;OAQG;2CAE2B,eAAe,mBAC1B,cAAc,GAC9B,QAAQ,OAAO,MAAM,EAAE,GAAG,CAAC,CAAC;IAsB/B;;;;;;;;OAQG;0CAE2B,cAAc,mBACzB,cAAc,GAC9B,QAAQ,OAAO,MAAM,EAAE,GAAG,CAAC,CAAC;IAsB/B;;;;;;OAMG;mCAEc,oBAAoB,mBAClB,cAAc,GAC9B,QAAQ,IAAI,CAAC;IAwBhB;;;;;OAKG;+BAEe,cAAc,mBACb,cAAc,GAC9B,QAAQ,cAAc,CAAC;EA4B7B;AAED;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
|
package/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// eslint-disable-next-line import/no-commonjs,import/extensions
|
|
2
|
-
module.exports = require('./dist/client-insights.cjs
|
|
2
|
+
module.exports = require('./dist/client-insights.cjs');
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
|
|
2
|
+
|
|
3
|
+
import type { AddToCartEvent } from './addToCartEvent';
|
|
4
|
+
import type { ConversionEvent } from './conversionEvent';
|
|
5
|
+
import type { ObjectData } from './objectData';
|
|
6
|
+
import type { Value } from './value';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Use this event to track when users add items to their shopping cart unrelated to a previous Algolia request. For example, if you don\'t use Algolia to build your category pages, use this event. To track add-to-cart events related to Algolia requests, use the \"Added to cart object IDs after search\" event.
|
|
10
|
+
*/
|
|
11
|
+
export type AddedToCartObjectIDs = {
|
|
12
|
+
/**
|
|
13
|
+
* The name of the event, up to 64 ASCII characters. Consider naming events consistently—for example, by adopting Segment\'s [object-action](https://segment.com/academy/collecting-data/naming-conventions-for-clean-data/#the-object-action-framework) framework.
|
|
14
|
+
*/
|
|
15
|
+
eventName: string;
|
|
16
|
+
|
|
17
|
+
eventType: ConversionEvent;
|
|
18
|
+
|
|
19
|
+
eventSubtype: AddToCartEvent;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* The name of an Algolia index.
|
|
23
|
+
*/
|
|
24
|
+
index: string;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* The object IDs of the records that are part of the event.
|
|
28
|
+
*/
|
|
29
|
+
objectIDs: string[];
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* An anonymous or pseudonymous user identifier. > **Note**: Never include personally identifiable information in user tokens.
|
|
33
|
+
*/
|
|
34
|
+
userToken: string;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* An identifier for authenticated users. > **Note**: Never include personally identifiable information in user tokens.
|
|
38
|
+
*/
|
|
39
|
+
authenticatedUserToken?: string;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Three-letter [currency code](https://www.iso.org/iso-4217-currency-codes.html).
|
|
43
|
+
*/
|
|
44
|
+
currency?: string;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Extra information about the records involved in a purchase or add-to-cart event. If specified, it must have the same length as `objectIDs`.
|
|
48
|
+
*/
|
|
49
|
+
objectData?: ObjectData[];
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* The timestamp of the event in milliseconds in [Unix epoch time](https://wikipedia.org/wiki/Unix_time). By default, the Insights API uses the time it receives an event as its timestamp.
|
|
53
|
+
*/
|
|
54
|
+
timestamp?: number;
|
|
55
|
+
|
|
56
|
+
value?: Value;
|
|
57
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
|
|
2
|
+
|
|
3
|
+
import type { AddToCartEvent } from './addToCartEvent';
|
|
4
|
+
import type { ConversionEvent } from './conversionEvent';
|
|
5
|
+
import type { ObjectDataAfterSearch } from './objectDataAfterSearch';
|
|
6
|
+
import type { Value } from './value';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Use this event to track when users add items to their shopping cart after a previous Algolia request. If you\'re building your category pages with Algolia, you\'ll also use this event.
|
|
10
|
+
*/
|
|
11
|
+
export type AddedToCartObjectIDsAfterSearch = {
|
|
12
|
+
/**
|
|
13
|
+
* The name of the event, up to 64 ASCII characters. Consider naming events consistently—for example, by adopting Segment\'s [object-action](https://segment.com/academy/collecting-data/naming-conventions-for-clean-data/#the-object-action-framework) framework.
|
|
14
|
+
*/
|
|
15
|
+
eventName: string;
|
|
16
|
+
|
|
17
|
+
eventType: ConversionEvent;
|
|
18
|
+
|
|
19
|
+
eventSubtype: AddToCartEvent;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* The name of an Algolia index.
|
|
23
|
+
*/
|
|
24
|
+
index: string;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Unique identifier for a search query. The query ID is required for events related to search or browse requests. If you add `clickAnalytics: true` as a search request parameter, the query ID is included in the API response.
|
|
28
|
+
*/
|
|
29
|
+
queryID: string;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* The object IDs of the records that are part of the event.
|
|
33
|
+
*/
|
|
34
|
+
objectIDs: string[];
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* An anonymous or pseudonymous user identifier. > **Note**: Never include personally identifiable information in user tokens.
|
|
38
|
+
*/
|
|
39
|
+
userToken: string;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* An identifier for authenticated users. > **Note**: Never include personally identifiable information in user tokens.
|
|
43
|
+
*/
|
|
44
|
+
authenticatedUserToken?: string;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Three-letter [currency code](https://www.iso.org/iso-4217-currency-codes.html).
|
|
48
|
+
*/
|
|
49
|
+
currency?: string;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Extra information about the records involved in a purchase or add-to-cart events. If provided, it must be the same length as `objectIDs`.
|
|
53
|
+
*/
|
|
54
|
+
objectData?: ObjectDataAfterSearch[];
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* The timestamp of the event in milliseconds in [Unix epoch time](https://wikipedia.org/wiki/Unix_time). By default, the Insights API uses the time it receives an event as its timestamp.
|
|
58
|
+
*/
|
|
59
|
+
timestamp?: number;
|
|
60
|
+
|
|
61
|
+
value?: Value;
|
|
62
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
|
|
2
|
+
|
|
3
|
+
import type { ClickEvent } from './clickEvent';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Use this event to track when users click facet filters in your user interface.
|
|
7
|
+
*/
|
|
8
|
+
export type ClickedFilters = {
|
|
9
|
+
/**
|
|
10
|
+
* The name of the event, up to 64 ASCII characters. Consider naming events consistently—for example, by adopting Segment\'s [object-action](https://segment.com/academy/collecting-data/naming-conventions-for-clean-data/#the-object-action-framework) framework.
|
|
11
|
+
*/
|
|
12
|
+
eventName: string;
|
|
13
|
+
|
|
14
|
+
eventType: ClickEvent;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* The name of an Algolia index.
|
|
18
|
+
*/
|
|
19
|
+
index: string;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Facet filters. Each facet filter string must be URL-encoded, such as, `discount:10%25`.
|
|
23
|
+
*/
|
|
24
|
+
filters: string[];
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* An anonymous or pseudonymous user identifier. > **Note**: Never include personally identifiable information in user tokens.
|
|
28
|
+
*/
|
|
29
|
+
userToken: string;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* An identifier for authenticated users. > **Note**: Never include personally identifiable information in user tokens.
|
|
33
|
+
*/
|
|
34
|
+
authenticatedUserToken?: string;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* The timestamp of the event in milliseconds in [Unix epoch time](https://wikipedia.org/wiki/Unix_time). By default, the Insights API uses the time it receives an event as its timestamp.
|
|
38
|
+
*/
|
|
39
|
+
timestamp?: number;
|
|
40
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
|
|
2
|
+
|
|
3
|
+
import type { ClickEvent } from './clickEvent';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Use this event to track when users click items unrelated to a previous Algolia request. For example, if you don\'t use Algolia to build your category pages, use this event. To track click events related to Algolia requests, use the \"Clicked object IDs after search\" event.
|
|
7
|
+
*/
|
|
8
|
+
export type ClickedObjectIDs = {
|
|
9
|
+
/**
|
|
10
|
+
* The name of the event, up to 64 ASCII characters. Consider naming events consistently—for example, by adopting Segment\'s [object-action](https://segment.com/academy/collecting-data/naming-conventions-for-clean-data/#the-object-action-framework) framework.
|
|
11
|
+
*/
|
|
12
|
+
eventName: string;
|
|
13
|
+
|
|
14
|
+
eventType: ClickEvent;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* The name of an Algolia index.
|
|
18
|
+
*/
|
|
19
|
+
index: string;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* The object IDs of the records that are part of the event.
|
|
23
|
+
*/
|
|
24
|
+
objectIDs: string[];
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* An anonymous or pseudonymous user identifier. > **Note**: Never include personally identifiable information in user tokens.
|
|
28
|
+
*/
|
|
29
|
+
userToken: string;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* An identifier for authenticated users. > **Note**: Never include personally identifiable information in user tokens.
|
|
33
|
+
*/
|
|
34
|
+
authenticatedUserToken?: string;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* The timestamp of the event in milliseconds in [Unix epoch time](https://wikipedia.org/wiki/Unix_time). By default, the Insights API uses the time it receives an event as its timestamp.
|
|
38
|
+
*/
|
|
39
|
+
timestamp?: number;
|
|
40
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
|
|
2
|
+
|
|
3
|
+
import type { ClickEvent } from './clickEvent';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Click event after an Algolia request. Use this event to track when users click items in the search results. If you\'re building your category pages with Algolia, you\'ll also use this event.
|
|
7
|
+
*/
|
|
8
|
+
export type ClickedObjectIDsAfterSearch = {
|
|
9
|
+
/**
|
|
10
|
+
* The name of the event, up to 64 ASCII characters. Consider naming events consistently—for example, by adopting Segment\'s [object-action](https://segment.com/academy/collecting-data/naming-conventions-for-clean-data/#the-object-action-framework) framework.
|
|
11
|
+
*/
|
|
12
|
+
eventName: string;
|
|
13
|
+
|
|
14
|
+
eventType: ClickEvent;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* The name of an Algolia index.
|
|
18
|
+
*/
|
|
19
|
+
index: string;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* The object IDs of the records that are part of the event.
|
|
23
|
+
*/
|
|
24
|
+
objectIDs: string[];
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* The position of the clicked item the search results. The first search result has a position of 1 (not 0). You must provide 1 `position` for each `objectID`.
|
|
28
|
+
*/
|
|
29
|
+
positions: number[];
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Unique identifier for a search query. The query ID is required for events related to search or browse requests. If you add `clickAnalytics: true` as a search request parameter, the query ID is included in the API response.
|
|
33
|
+
*/
|
|
34
|
+
queryID: string;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* An anonymous or pseudonymous user identifier. > **Note**: Never include personally identifiable information in user tokens.
|
|
38
|
+
*/
|
|
39
|
+
userToken: string;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* An identifier for authenticated users. > **Note**: Never include personally identifiable information in user tokens.
|
|
43
|
+
*/
|
|
44
|
+
authenticatedUserToken?: string;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* The timestamp of the event in milliseconds in [Unix epoch time](https://wikipedia.org/wiki/Unix_time). By default, the Insights API uses the time it receives an event as its timestamp.
|
|
48
|
+
*/
|
|
49
|
+
timestamp?: number;
|
|
50
|
+
};
|