@algolia/client-insights 5.0.0-alpha.9 → 5.0.0-alpha.91
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} +214 -216
- package/dist/client-insights.esm.browser.js +396 -446
- package/dist/client-insights.esm.node.js +214 -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 +43 -0
- package/dist/model/addedToCartObjectIDs.d.ts.map +1 -0
- package/dist/model/addedToCartObjectIDsAfterSearch.d.ts +47 -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 +28 -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 +60 -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 +26 -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 +43 -0
- package/dist/model/purchasedObjectIDs.d.ts.map +1 -0
- package/dist/model/purchasedObjectIDsAfterSearch.d.ts +47 -0
- package/dist/model/purchasedObjectIDsAfterSearch.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 +85 -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 +54 -0
- package/model/addedToCartObjectIDsAfterSearch.ts +59 -0
- package/model/clickEvent.ts +3 -0
- package/model/clickedFilters.ts +40 -0
- package/model/clickedObjectIDs.ts +35 -0
- package/model/clickedObjectIDsAfterSearch.ts +50 -0
- package/model/clientMethodProps.ts +11 -11
- 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 +25 -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 +54 -0
- package/model/purchasedObjectIDsAfterSearch.ts +59 -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,47 @@
|
|
|
1
|
+
import type { ConversionEvent } from './conversionEvent';
|
|
2
|
+
import type { ObjectDataAfterSearch } from './objectDataAfterSearch';
|
|
3
|
+
import type { PurchaseEvent } from './purchaseEvent';
|
|
4
|
+
/**
|
|
5
|
+
* 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.
|
|
6
|
+
*/
|
|
7
|
+
export type PurchasedObjectIDsAfterSearch = {
|
|
8
|
+
/**
|
|
9
|
+
* Can contain 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.
|
|
10
|
+
*/
|
|
11
|
+
eventName: string;
|
|
12
|
+
eventType: ConversionEvent;
|
|
13
|
+
eventSubtype: PurchaseEvent;
|
|
14
|
+
/**
|
|
15
|
+
* Name of the Algolia index.
|
|
16
|
+
*/
|
|
17
|
+
index: string;
|
|
18
|
+
/**
|
|
19
|
+
* 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.
|
|
20
|
+
*/
|
|
21
|
+
queryID: string;
|
|
22
|
+
/**
|
|
23
|
+
* List of object identifiers for items of an Algolia index.
|
|
24
|
+
*/
|
|
25
|
+
objectIDs: string[];
|
|
26
|
+
/**
|
|
27
|
+
* Extra information about the records involved in the event—for example, to add price and quantities of purchased products. If provided, must be the same length as `objectIDs`.
|
|
28
|
+
*/
|
|
29
|
+
objectData?: ObjectDataAfterSearch[];
|
|
30
|
+
/**
|
|
31
|
+
* If you include pricing information in the `objectData` parameter, you must also specify the currency as ISO-4217 currency code, such as USD or EUR.
|
|
32
|
+
*/
|
|
33
|
+
currency?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Anonymous or pseudonymous user identifier. > **Note**: Never include personally identifiable information in user tokens.
|
|
36
|
+
*/
|
|
37
|
+
userToken: string;
|
|
38
|
+
/**
|
|
39
|
+
* Time 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.
|
|
40
|
+
*/
|
|
41
|
+
timestamp?: number;
|
|
42
|
+
/**
|
|
43
|
+
* User token for authenticated users.
|
|
44
|
+
*/
|
|
45
|
+
authenticatedUserToken?: string;
|
|
46
|
+
};
|
|
47
|
+
//# 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;AAErD;;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,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,SAAS,EAAE,MAAM,EAAE,CAAC;IAEpB;;OAEG;IACH,UAAU,CAAC,EAAE,qBAAqB,EAAE,CAAC;IAErC;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACjC,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
|
+
* Can contain 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
|
+
* Name of the 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
|
+
* Anonymous or pseudonymous user identifier. > **Note**: Never include personally identifiable information in user tokens.
|
|
21
|
+
*/
|
|
22
|
+
userToken: string;
|
|
23
|
+
/**
|
|
24
|
+
* Time 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.
|
|
25
|
+
*/
|
|
26
|
+
timestamp?: number;
|
|
27
|
+
/**
|
|
28
|
+
* User token for authenticated users.
|
|
29
|
+
*/
|
|
30
|
+
authenticatedUserToken?: string;
|
|
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,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACjC,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
|
+
* Can contain 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
|
+
* Name of the Algolia index.
|
|
13
|
+
*/
|
|
14
|
+
index: string;
|
|
15
|
+
/**
|
|
16
|
+
* List of object identifiers for items of an Algolia index.
|
|
17
|
+
*/
|
|
18
|
+
objectIDs: string[];
|
|
19
|
+
/**
|
|
20
|
+
* Anonymous or pseudonymous user identifier. > **Note**: Never include personally identifiable information in user tokens.
|
|
21
|
+
*/
|
|
22
|
+
userToken: string;
|
|
23
|
+
/**
|
|
24
|
+
* Time 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.
|
|
25
|
+
*/
|
|
26
|
+
timestamp?: number;
|
|
27
|
+
/**
|
|
28
|
+
* User token for authenticated users.
|
|
29
|
+
*/
|
|
30
|
+
authenticatedUserToken?: string;
|
|
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,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACjC,CAAC"}
|
|
@@ -1,86 +1,86 @@
|
|
|
1
|
-
import type { CreateClientOptions, RequestOptions } from '@algolia/client-common';
|
|
2
|
-
import type { DelProps, GetProps, PostProps, PutProps } from '../model/clientMethodProps';
|
|
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
|
-
* @summary Send requests to the Algolia REST API.
|
|
35
|
-
* @param del - The del object.
|
|
36
|
-
* @param del.path -
|
|
37
|
-
* @param del.parameters - Query parameters to
|
|
38
|
-
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
39
|
-
*/
|
|
40
|
-
del({ path, parameters }: DelProps, requestOptions?: RequestOptions): Promise<Record<string, any>>;
|
|
41
|
-
/**
|
|
42
|
-
* This method allow you to send requests to the Algolia REST API.
|
|
43
|
-
*
|
|
44
|
-
* @summary Send requests to the Algolia REST API.
|
|
45
|
-
* @param get - The get object.
|
|
46
|
-
* @param get.path -
|
|
47
|
-
* @param get.parameters - Query parameters to
|
|
48
|
-
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
49
|
-
*/
|
|
50
|
-
get({ path, parameters }: GetProps, requestOptions?: RequestOptions): Promise<Record<string, any>>;
|
|
51
|
-
/**
|
|
52
|
-
* This method allow you to send requests to the Algolia REST API.
|
|
53
|
-
*
|
|
54
|
-
* @summary Send requests to the Algolia REST API.
|
|
55
|
-
* @param post - The post object.
|
|
56
|
-
* @param post.path -
|
|
57
|
-
* @param post.parameters - Query parameters to
|
|
58
|
-
* @param post.body -
|
|
59
|
-
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
60
|
-
*/
|
|
61
|
-
post({ path, parameters, body }: PostProps, requestOptions?: RequestOptions): Promise<Record<string, any>>;
|
|
62
|
-
/**
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
* @summary
|
|
66
|
-
* @param
|
|
67
|
-
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
68
|
-
*/
|
|
69
|
-
pushEvents(
|
|
70
|
-
/**
|
|
71
|
-
* This method allow you to send requests to the Algolia REST API.
|
|
72
|
-
*
|
|
73
|
-
* @summary Send requests to the Algolia REST API.
|
|
74
|
-
* @param put - The put object.
|
|
75
|
-
* @param put.path -
|
|
76
|
-
* @param put.parameters - Query parameters to
|
|
77
|
-
* @param put.body -
|
|
78
|
-
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
79
|
-
*/
|
|
80
|
-
put({ path, parameters, body }: PutProps, requestOptions?: RequestOptions): Promise<Record<string, any>>;
|
|
81
|
-
};
|
|
82
|
-
/**
|
|
83
|
-
* The client type.
|
|
84
|
-
*/
|
|
85
|
-
export
|
|
1
|
+
import type { CreateClientOptions, RequestOptions } from '@algolia/client-common';
|
|
2
|
+
import type { DelProps, GetProps, PostProps, PutProps } 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.91";
|
|
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
|
+
* @summary Send requests to the Algolia REST API.
|
|
35
|
+
* @param del - The del object.
|
|
36
|
+
* @param del.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
37
|
+
* @param del.parameters - Query parameters to apply to the current query.
|
|
38
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
39
|
+
*/
|
|
40
|
+
del({ path, parameters }: DelProps, requestOptions?: RequestOptions): Promise<Record<string, any>>;
|
|
41
|
+
/**
|
|
42
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
43
|
+
*
|
|
44
|
+
* @summary Send requests to the Algolia REST API.
|
|
45
|
+
* @param get - The get object.
|
|
46
|
+
* @param get.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
47
|
+
* @param get.parameters - Query parameters to apply to the current query.
|
|
48
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
49
|
+
*/
|
|
50
|
+
get({ path, parameters }: GetProps, requestOptions?: RequestOptions): Promise<Record<string, any>>;
|
|
51
|
+
/**
|
|
52
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
53
|
+
*
|
|
54
|
+
* @summary Send requests to the Algolia REST API.
|
|
55
|
+
* @param post - The post object.
|
|
56
|
+
* @param post.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
57
|
+
* @param post.parameters - Query parameters to apply to the current query.
|
|
58
|
+
* @param post.body - Parameters to send with the custom request.
|
|
59
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
60
|
+
*/
|
|
61
|
+
post({ path, parameters, body }: PostProps, requestOptions?: RequestOptions): Promise<Record<string, any>>;
|
|
62
|
+
/**
|
|
63
|
+
* 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.
|
|
64
|
+
*
|
|
65
|
+
* @summary Send events.
|
|
66
|
+
* @param insightsEvents - The insightsEvents object.
|
|
67
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
68
|
+
*/
|
|
69
|
+
pushEvents(insightsEvents: InsightsEvents, requestOptions?: RequestOptions): Promise<EventsResponse>;
|
|
70
|
+
/**
|
|
71
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
72
|
+
*
|
|
73
|
+
* @summary Send requests to the Algolia REST API.
|
|
74
|
+
* @param put - The put object.
|
|
75
|
+
* @param put.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
76
|
+
* @param put.parameters - Query parameters to apply to the current query.
|
|
77
|
+
* @param put.body - Parameters to send with the custom request.
|
|
78
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
79
|
+
*/
|
|
80
|
+
put({ path, parameters, body }: PutProps, requestOptions?: RequestOptions): Promise<Record<string, any>>;
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* The client type.
|
|
84
|
+
*/
|
|
85
|
+
export type InsightsClient = ReturnType<typeof createInsightsClient>;
|
|
86
86
|
//# 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,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,QAAQ,EACT,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,
|
|
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,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,QAAQ,EACT,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,mBAAmB,CAAC;AAEjD,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;;;;;;;;OAQG;8BAEqB,QAAQ,mBACb,cAAc,GAC9B,QAAQ,OAAO,MAAM,EAAE,GAAG,CAAC,CAAC;IAmB/B;;;;;;;;OAQG;8BAEqB,QAAQ,mBACb,cAAc,GAC9B,QAAQ,OAAO,MAAM,EAAE,GAAG,CAAC,CAAC;IAmB/B;;;;;;;;;OASG;qCAE2B,SAAS,mBACpB,cAAc,GAC9B,QAAQ,OAAO,MAAM,EAAE,GAAG,CAAC,CAAC;IAoB/B;;;;;;OAMG;+BAEe,cAAc,mBACb,cAAc,GAC9B,QAAQ,cAAc,CAAC;IA4B1B;;;;;;;;;OASG;oCAE2B,QAAQ,mBACnB,cAAc,GAC9B,QAAQ,OAAO,MAAM,EAAE,GAAG,CAAC,CAAC;EAoBlC;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,54 @@
|
|
|
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
|
+
|
|
7
|
+
/**
|
|
8
|
+
* 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.
|
|
9
|
+
*/
|
|
10
|
+
export type AddedToCartObjectIDs = {
|
|
11
|
+
/**
|
|
12
|
+
* Can contain 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.
|
|
13
|
+
*/
|
|
14
|
+
eventName: string;
|
|
15
|
+
|
|
16
|
+
eventType: ConversionEvent;
|
|
17
|
+
|
|
18
|
+
eventSubtype: AddToCartEvent;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Name of the Algolia index.
|
|
22
|
+
*/
|
|
23
|
+
index: string;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* List of object identifiers for items of an Algolia index.
|
|
27
|
+
*/
|
|
28
|
+
objectIDs: string[];
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Extra information about the records involved in the event—for example, to add price and quantities of purchased products. If provided, must be the same length as `objectIDs`.
|
|
32
|
+
*/
|
|
33
|
+
objectData?: ObjectData[];
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* If you include pricing information in the `objectData` parameter, you must also specify the currency as ISO-4217 currency code, such as USD or EUR.
|
|
37
|
+
*/
|
|
38
|
+
currency?: string;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Anonymous or pseudonymous user identifier. > **Note**: Never include personally identifiable information in user tokens.
|
|
42
|
+
*/
|
|
43
|
+
userToken: string;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Time 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.
|
|
47
|
+
*/
|
|
48
|
+
timestamp?: number;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* User token for authenticated users.
|
|
52
|
+
*/
|
|
53
|
+
authenticatedUserToken?: string;
|
|
54
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
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
|
+
|
|
7
|
+
/**
|
|
8
|
+
* 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.
|
|
9
|
+
*/
|
|
10
|
+
export type AddedToCartObjectIDsAfterSearch = {
|
|
11
|
+
/**
|
|
12
|
+
* Can contain 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.
|
|
13
|
+
*/
|
|
14
|
+
eventName: string;
|
|
15
|
+
|
|
16
|
+
eventType: ConversionEvent;
|
|
17
|
+
|
|
18
|
+
eventSubtype: AddToCartEvent;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Name of the Algolia index.
|
|
22
|
+
*/
|
|
23
|
+
index: string;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* 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.
|
|
27
|
+
*/
|
|
28
|
+
queryID: string;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* List of object identifiers for items of an Algolia index.
|
|
32
|
+
*/
|
|
33
|
+
objectIDs: string[];
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Extra information about the records involved in the event—for example, to add price and quantities of purchased products. If provided, must be the same length as `objectIDs`.
|
|
37
|
+
*/
|
|
38
|
+
objectData?: ObjectDataAfterSearch[];
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* If you include pricing information in the `objectData` parameter, you must also specify the currency as ISO-4217 currency code, such as USD or EUR.
|
|
42
|
+
*/
|
|
43
|
+
currency?: string;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Anonymous or pseudonymous user identifier. > **Note**: Never include personally identifiable information in user tokens.
|
|
47
|
+
*/
|
|
48
|
+
userToken: string;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Time 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.
|
|
52
|
+
*/
|
|
53
|
+
timestamp?: number;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* User token for authenticated users.
|
|
57
|
+
*/
|
|
58
|
+
authenticatedUserToken?: string;
|
|
59
|
+
};
|
|
@@ -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
|
+
* Can contain 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
|
+
* Name of the 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
|
+
* Anonymous or pseudonymous user identifier. > **Note**: Never include personally identifiable information in user tokens.
|
|
28
|
+
*/
|
|
29
|
+
userToken: string;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Time 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.
|
|
33
|
+
*/
|
|
34
|
+
timestamp?: number;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* User token for authenticated users.
|
|
38
|
+
*/
|
|
39
|
+
authenticatedUserToken?: string;
|
|
40
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
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
|
+
* Can contain 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
|
+
* Name of the Algolia index.
|
|
18
|
+
*/
|
|
19
|
+
index: string;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* List of object identifiers for items of an Algolia index.
|
|
23
|
+
*/
|
|
24
|
+
objectIDs: string[];
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Anonymous or pseudonymous user identifier. > **Note**: Never include personally identifiable information in user tokens.
|
|
28
|
+
*/
|
|
29
|
+
userToken: string;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Time 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.
|
|
33
|
+
*/
|
|
34
|
+
timestamp?: number;
|
|
35
|
+
};
|
|
@@ -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
|
+
* Can contain 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
|
+
* Name of the Algolia index.
|
|
18
|
+
*/
|
|
19
|
+
index: string;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* List of object identifiers for items of an Algolia index.
|
|
23
|
+
*/
|
|
24
|
+
objectIDs: string[];
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Position of the clicked objects in 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
|
+
* Anonymous or pseudonymous user identifier. > **Note**: Never include personally identifiable information in user tokens.
|
|
38
|
+
*/
|
|
39
|
+
userToken: string;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Time 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.
|
|
43
|
+
*/
|
|
44
|
+
timestamp?: number;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* User token for authenticated users.
|
|
48
|
+
*/
|
|
49
|
+
authenticatedUserToken?: string;
|
|
50
|
+
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
//
|
|
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
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Properties for the `del` method.
|
|
5
5
|
*/
|
|
6
6
|
export type DelProps = {
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* Path of the endpoint, anything after \"/1\" must be specified.
|
|
9
9
|
*/
|
|
10
10
|
path: string;
|
|
11
11
|
/**
|
|
12
|
-
* Query parameters to
|
|
12
|
+
* Query parameters to apply to the current query.
|
|
13
13
|
*/
|
|
14
14
|
parameters?: Record<string, any>;
|
|
15
15
|
};
|
|
@@ -19,11 +19,11 @@ export type DelProps = {
|
|
|
19
19
|
*/
|
|
20
20
|
export type GetProps = {
|
|
21
21
|
/**
|
|
22
|
-
*
|
|
22
|
+
* Path of the endpoint, anything after \"/1\" must be specified.
|
|
23
23
|
*/
|
|
24
24
|
path: string;
|
|
25
25
|
/**
|
|
26
|
-
* Query parameters to
|
|
26
|
+
* Query parameters to apply to the current query.
|
|
27
27
|
*/
|
|
28
28
|
parameters?: Record<string, any>;
|
|
29
29
|
};
|
|
@@ -33,15 +33,15 @@ export type GetProps = {
|
|
|
33
33
|
*/
|
|
34
34
|
export type PostProps = {
|
|
35
35
|
/**
|
|
36
|
-
*
|
|
36
|
+
* Path of the endpoint, anything after \"/1\" must be specified.
|
|
37
37
|
*/
|
|
38
38
|
path: string;
|
|
39
39
|
/**
|
|
40
|
-
* Query parameters to
|
|
40
|
+
* Query parameters to apply to the current query.
|
|
41
41
|
*/
|
|
42
42
|
parameters?: Record<string, any>;
|
|
43
43
|
/**
|
|
44
|
-
*
|
|
44
|
+
* Parameters to send with the custom request.
|
|
45
45
|
*/
|
|
46
46
|
body?: Record<string, any>;
|
|
47
47
|
};
|
|
@@ -51,15 +51,15 @@ export type PostProps = {
|
|
|
51
51
|
*/
|
|
52
52
|
export type PutProps = {
|
|
53
53
|
/**
|
|
54
|
-
*
|
|
54
|
+
* Path of the endpoint, anything after \"/1\" must be specified.
|
|
55
55
|
*/
|
|
56
56
|
path: string;
|
|
57
57
|
/**
|
|
58
|
-
* Query parameters to
|
|
58
|
+
* Query parameters to apply to the current query.
|
|
59
59
|
*/
|
|
60
60
|
parameters?: Record<string, any>;
|
|
61
61
|
/**
|
|
62
|
-
*
|
|
62
|
+
* Parameters to send with the custom request.
|
|
63
63
|
*/
|
|
64
64
|
body?: Record<string, any>;
|
|
65
65
|
};
|