@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.
Files changed (105) hide show
  1. package/dist/builds/browser.d.ts +5 -5
  2. package/dist/builds/browser.d.ts.map +1 -1
  3. package/dist/builds/node.d.ts +5 -5
  4. package/dist/builds/node.d.ts.map +1 -1
  5. package/dist/{client-insights.cjs.js → client-insights.cjs} +214 -216
  6. package/dist/client-insights.esm.browser.js +396 -446
  7. package/dist/client-insights.esm.node.js +214 -214
  8. package/dist/client-insights.umd.js +2 -2
  9. package/dist/model/addToCartEvent.d.ts +2 -0
  10. package/dist/model/addToCartEvent.d.ts.map +1 -0
  11. package/dist/model/addedToCartObjectIDs.d.ts +43 -0
  12. package/dist/model/addedToCartObjectIDs.d.ts.map +1 -0
  13. package/dist/model/addedToCartObjectIDsAfterSearch.d.ts +47 -0
  14. package/dist/model/addedToCartObjectIDsAfterSearch.d.ts.map +1 -0
  15. package/dist/model/clickEvent.d.ts +2 -0
  16. package/dist/model/clickEvent.d.ts.map +1 -0
  17. package/dist/model/clickedFilters.d.ts +32 -0
  18. package/dist/model/clickedFilters.d.ts.map +1 -0
  19. package/dist/model/clickedObjectIDs.d.ts +28 -0
  20. package/dist/model/clickedObjectIDs.d.ts.map +1 -0
  21. package/dist/model/clickedObjectIDsAfterSearch.d.ts +40 -0
  22. package/dist/model/clickedObjectIDsAfterSearch.d.ts.map +1 -0
  23. package/dist/model/clientMethodProps.d.ts +60 -60
  24. package/dist/model/clientMethodProps.d.ts.map +1 -1
  25. package/dist/model/conversionEvent.d.ts +2 -0
  26. package/dist/model/conversionEvent.d.ts.map +1 -0
  27. package/dist/model/convertedFilters.d.ts +29 -0
  28. package/dist/model/convertedFilters.d.ts.map +1 -0
  29. package/dist/model/convertedObjectIDs.d.ts +32 -0
  30. package/dist/model/convertedObjectIDs.d.ts.map +1 -0
  31. package/dist/model/convertedObjectIDsAfterSearch.d.ts +36 -0
  32. package/dist/model/convertedObjectIDsAfterSearch.d.ts.map +1 -0
  33. package/dist/model/discount.d.ts +5 -0
  34. package/dist/model/discount.d.ts.map +1 -0
  35. package/dist/model/errorBase.d.ts +6 -6
  36. package/dist/model/errorBase.d.ts.map +1 -1
  37. package/dist/model/eventsItems.d.ts +14 -0
  38. package/dist/model/eventsItems.d.ts.map +1 -0
  39. package/dist/model/eventsResponse.d.ts +14 -0
  40. package/dist/model/eventsResponse.d.ts.map +1 -0
  41. package/dist/model/index.d.ts +26 -6
  42. package/dist/model/index.d.ts.map +1 -1
  43. package/dist/model/insightsEvents.d.ts +8 -0
  44. package/dist/model/insightsEvents.d.ts.map +1 -0
  45. package/dist/model/objectData.d.ts +11 -0
  46. package/dist/model/objectData.d.ts.map +1 -0
  47. package/dist/model/objectDataAfterSearch.d.ts +15 -0
  48. package/dist/model/objectDataAfterSearch.d.ts.map +1 -0
  49. package/dist/model/price.d.ts +5 -0
  50. package/dist/model/price.d.ts.map +1 -0
  51. package/dist/model/purchaseEvent.d.ts +2 -0
  52. package/dist/model/purchaseEvent.d.ts.map +1 -0
  53. package/dist/model/purchasedObjectIDs.d.ts +43 -0
  54. package/dist/model/purchasedObjectIDs.d.ts.map +1 -0
  55. package/dist/model/purchasedObjectIDsAfterSearch.d.ts +47 -0
  56. package/dist/model/purchasedObjectIDsAfterSearch.d.ts.map +1 -0
  57. package/dist/model/viewEvent.d.ts +2 -0
  58. package/dist/model/viewEvent.d.ts.map +1 -0
  59. package/dist/model/viewedFilters.d.ts +32 -0
  60. package/dist/model/viewedFilters.d.ts.map +1 -0
  61. package/dist/model/viewedObjectIDs.d.ts +32 -0
  62. package/dist/model/viewedObjectIDs.d.ts.map +1 -0
  63. package/dist/src/insightsClient.d.ts +85 -85
  64. package/dist/src/insightsClient.d.ts.map +1 -1
  65. package/index.js +1 -1
  66. package/model/addToCartEvent.ts +3 -0
  67. package/model/addedToCartObjectIDs.ts +54 -0
  68. package/model/addedToCartObjectIDsAfterSearch.ts +59 -0
  69. package/model/clickEvent.ts +3 -0
  70. package/model/clickedFilters.ts +40 -0
  71. package/model/clickedObjectIDs.ts +35 -0
  72. package/model/clickedObjectIDsAfterSearch.ts +50 -0
  73. package/model/clientMethodProps.ts +11 -11
  74. package/model/conversionEvent.ts +3 -0
  75. package/model/convertedFilters.ts +37 -0
  76. package/model/convertedObjectIDs.ts +40 -0
  77. package/model/convertedObjectIDsAfterSearch.ts +45 -0
  78. package/model/discount.ts +6 -0
  79. package/model/errorBase.ts +1 -1
  80. package/model/eventsItems.ts +28 -0
  81. package/model/eventsResponse.ts +16 -0
  82. package/model/index.ts +25 -5
  83. package/model/insightsEvents.ts +10 -0
  84. package/model/objectData.ts +15 -0
  85. package/model/objectDataAfterSearch.ts +20 -0
  86. package/model/price.ts +6 -0
  87. package/model/purchaseEvent.ts +3 -0
  88. package/model/purchasedObjectIDs.ts +54 -0
  89. package/model/purchasedObjectIDsAfterSearch.ts +59 -0
  90. package/model/viewEvent.ts +3 -0
  91. package/model/viewedFilters.ts +40 -0
  92. package/model/viewedObjectIDs.ts +40 -0
  93. package/package.json +30 -13
  94. package/dist/model/eventType.d.ts +0 -2
  95. package/dist/model/eventType.d.ts.map +0 -1
  96. package/dist/model/insightEvent.d.ts +0 -40
  97. package/dist/model/insightEvent.d.ts.map +0 -1
  98. package/dist/model/insightEvents.d.ts +0 -11
  99. package/dist/model/insightEvents.d.ts.map +0 -1
  100. package/dist/model/pushEventsResponse.d.ts +0 -7
  101. package/dist/model/pushEventsResponse.d.ts.map +0 -1
  102. package/model/eventType.ts +0 -3
  103. package/model/insightEvent.ts +0 -50
  104. package/model/insightEvents.ts +0 -13
  105. package/model/pushEventsResponse.ts +0 -8
@@ -0,0 +1,3 @@
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
+ export type ConversionEvent = 'conversion';
@@ -0,0 +1,37 @@
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 { ConversionEvent } from './conversionEvent';
4
+
5
+ export type ConvertedFilters = {
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
+
11
+ eventType: ConversionEvent;
12
+
13
+ /**
14
+ * Name of the Algolia index.
15
+ */
16
+ index: string;
17
+
18
+ /**
19
+ * Facet filters. Each facet filter string must be URL-encoded, such as, `discount:10%25`.
20
+ */
21
+ filters: string[];
22
+
23
+ /**
24
+ * Anonymous or pseudonymous user identifier. > **Note**: Never include personally identifiable information in user tokens.
25
+ */
26
+ userToken: string;
27
+
28
+ /**
29
+ * 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.
30
+ */
31
+ timestamp?: number;
32
+
33
+ /**
34
+ * User token for authenticated users.
35
+ */
36
+ authenticatedUserToken?: string;
37
+ };
@@ -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 { ConversionEvent } from './conversionEvent';
4
+
5
+ /**
6
+ * Use this event to track when users convert on 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 conversion events related to Algolia requests, use the \"Converted object IDs after search\" event.
7
+ */
8
+ export type ConvertedObjectIDs = {
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: ConversionEvent;
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
+
36
+ /**
37
+ * User token for authenticated users.
38
+ */
39
+ authenticatedUserToken?: string;
40
+ };
@@ -0,0 +1,45 @@
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 { ConversionEvent } from './conversionEvent';
4
+
5
+ /**
6
+ * Use this event to track when users convert after a previous Algolia request. For example, a user clicks on an item in the search results to view the product detail page. Then, the user adds the item to their shopping cart. If you\'re building your category pages with Algolia, you\'ll also use this event.
7
+ */
8
+ export type ConvertedObjectIDsAfterSearch = {
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: ConversionEvent;
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
+ * 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
+ * Anonymous or pseudonymous user identifier. > **Note**: Never include personally identifiable information in user tokens.
33
+ */
34
+ userToken: string;
35
+
36
+ /**
37
+ * 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.
38
+ */
39
+ timestamp?: number;
40
+
41
+ /**
42
+ * User token for authenticated users.
43
+ */
44
+ authenticatedUserToken?: string;
45
+ };
@@ -0,0 +1,6 @@
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
+ /**
4
+ * Absolute value of the discount in effect for this object, measured in `currency`.
5
+ */
6
+ export type Discount = number | string;
@@ -1,4 +1,4 @@
1
- // This file is generated, manual changes will be lost - read more on https://github.com/algolia/api-clients-automation.
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
  * Error.
@@ -0,0 +1,28 @@
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 { AddedToCartObjectIDs } from './addedToCartObjectIDs';
4
+ import type { AddedToCartObjectIDsAfterSearch } from './addedToCartObjectIDsAfterSearch';
5
+ import type { ClickedFilters } from './clickedFilters';
6
+ import type { ClickedObjectIDs } from './clickedObjectIDs';
7
+ import type { ClickedObjectIDsAfterSearch } from './clickedObjectIDsAfterSearch';
8
+ import type { ConvertedFilters } from './convertedFilters';
9
+ import type { ConvertedObjectIDs } from './convertedObjectIDs';
10
+ import type { ConvertedObjectIDsAfterSearch } from './convertedObjectIDsAfterSearch';
11
+ import type { PurchasedObjectIDs } from './purchasedObjectIDs';
12
+ import type { PurchasedObjectIDsAfterSearch } from './purchasedObjectIDsAfterSearch';
13
+ import type { ViewedFilters } from './viewedFilters';
14
+ import type { ViewedObjectIDs } from './viewedObjectIDs';
15
+
16
+ export type EventsItems =
17
+ | AddedToCartObjectIDs
18
+ | AddedToCartObjectIDsAfterSearch
19
+ | ClickedFilters
20
+ | ClickedObjectIDs
21
+ | ClickedObjectIDsAfterSearch
22
+ | ConvertedFilters
23
+ | ConvertedObjectIDs
24
+ | ConvertedObjectIDsAfterSearch
25
+ | PurchasedObjectIDs
26
+ | PurchasedObjectIDsAfterSearch
27
+ | ViewedFilters
28
+ | ViewedObjectIDs;
@@ -0,0 +1,16 @@
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
+ /**
4
+ * The response of the Insights API.
5
+ */
6
+ export type EventsResponse = {
7
+ /**
8
+ * Details about the response, such as error messages.
9
+ */
10
+ message?: string;
11
+
12
+ /**
13
+ * The HTTP status code of the response.
14
+ */
15
+ status?: number;
16
+ };
package/model/index.ts CHANGED
@@ -1,8 +1,28 @@
1
- // This file is generated, manual changes will be lost - read more on https://github.com/algolia/api-clients-automation.
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
+ export * from './addToCartEvent';
4
+ export * from './addedToCartObjectIDs';
5
+ export * from './addedToCartObjectIDsAfterSearch';
6
+ export * from './clickEvent';
7
+ export * from './clickedFilters';
8
+ export * from './clickedObjectIDs';
9
+ export * from './clickedObjectIDsAfterSearch';
10
+ export * from './conversionEvent';
11
+ export * from './convertedFilters';
12
+ export * from './convertedObjectIDs';
13
+ export * from './convertedObjectIDsAfterSearch';
14
+ export * from './discount';
3
15
  export * from './errorBase';
4
- export * from './eventType';
5
- export * from './insightEvent';
6
- export * from './insightEvents';
7
- export * from './pushEventsResponse';
16
+ export * from './eventsItems';
17
+ export * from './eventsResponse';
18
+ export * from './insightsEvents';
19
+ export * from './objectData';
20
+ export * from './objectDataAfterSearch';
21
+ export * from './price';
22
+ export * from './purchaseEvent';
23
+ export * from './purchasedObjectIDs';
24
+ export * from './purchasedObjectIDsAfterSearch';
25
+ export * from './viewEvent';
26
+ export * from './viewedFilters';
27
+ export * from './viewedObjectIDs';
8
28
  export * from './clientMethodProps';
@@ -0,0 +1,10 @@
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 { EventsItems } from './eventsItems';
4
+
5
+ export type InsightsEvents = {
6
+ /**
7
+ * List of click and conversion events. An event is an object representing a user interaction. Events have attributes that describe the interaction, such as an event name, a type, or a user token. Some attributes require other attributes to be declared, and some attributes can\'t be declared at the same time. **All** events must be valid, otherwise the API returns an error.
8
+ */
9
+ events: EventsItems[];
10
+ };
@@ -0,0 +1,15 @@
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 { Discount } from './discount';
4
+ import type { Price } from './price';
5
+
6
+ export type ObjectData = {
7
+ price?: Price;
8
+
9
+ /**
10
+ * The quantity of the purchased or added-to-cart item. The total value of a purchase is the sum of `quantity` multiplied with the `price` for each purchased item.
11
+ */
12
+ quantity?: number;
13
+
14
+ discount?: Discount;
15
+ };
@@ -0,0 +1,20 @@
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 { Discount } from './discount';
4
+ import type { Price } from './price';
5
+
6
+ export type ObjectDataAfterSearch = {
7
+ /**
8
+ * ID of the query that this specific record is attributable to. Used to track purchase events with multiple items originating from different searches.
9
+ */
10
+ queryID?: string;
11
+
12
+ price?: Price;
13
+
14
+ /**
15
+ * The quantity of the purchased or added-to-cart item. The total value of a purchase is the sum of `quantity` multiplied with the `price` for each purchased item.
16
+ */
17
+ quantity?: number;
18
+
19
+ discount?: Discount;
20
+ };
package/model/price.ts ADDED
@@ -0,0 +1,6 @@
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
+ /**
4
+ * The price of the item. This should be the final price, inclusive of any discounts in effect.
5
+ */
6
+ export type Price = number | string;
@@ -0,0 +1,3 @@
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
+ export type PurchaseEvent = 'purchase';
@@ -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 { ConversionEvent } from './conversionEvent';
4
+ import type { ObjectData } from './objectData';
5
+ import type { PurchaseEvent } from './purchaseEvent';
6
+
7
+ /**
8
+ * Use this event to track when users make a purchase unrelated to a previous Algolia request. For example, if you don\'t use Algolia to build your category pages, use this event. To track purchase events related to Algolia requests, use the \"Purchased object IDs after search\" event.
9
+ */
10
+ export type PurchasedObjectIDs = {
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: PurchaseEvent;
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 { ConversionEvent } from './conversionEvent';
4
+ import type { ObjectDataAfterSearch } from './objectDataAfterSearch';
5
+ import type { PurchaseEvent } from './purchaseEvent';
6
+
7
+ /**
8
+ * 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.
9
+ */
10
+ export type PurchasedObjectIDsAfterSearch = {
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: PurchaseEvent;
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,3 @@
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
+ export type ViewEvent = 'view';
@@ -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 { ViewEvent } from './viewEvent';
4
+
5
+ /**
6
+ * Use this method to capture active filters. For example, when browsing a category page, users see content filtered on that specific category.
7
+ */
8
+ export type ViewedFilters = {
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: ViewEvent;
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,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 { ViewEvent } from './viewEvent';
4
+
5
+ /**
6
+ * Use this event to track when users viewed items in the search results.
7
+ */
8
+ export type ViewedObjectIDs = {
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: ViewEvent;
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
+
36
+ /**
37
+ * User token for authenticated users.
38
+ */
39
+ authenticatedUserToken?: string;
40
+ };
package/package.json CHANGED
@@ -1,16 +1,33 @@
1
1
  {
2
2
  "name": "@algolia/client-insights",
3
- "version": "5.0.0-alpha.9",
3
+ "version": "5.0.0-alpha.91",
4
4
  "description": "JavaScript client for client-insights",
5
5
  "repository": "algolia/algoliasearch-client-javascript",
6
6
  "license": "MIT",
7
7
  "author": "Algolia",
8
- "main": "index.js",
9
- "jsdelivr": "dist/client-insights.umd.js",
10
- "unpkg": "dist/client-insights.umd.js",
11
- "module": "dist/client-insights.esm.node.js",
12
- "browser": "dist/client-insights.umd.js",
13
- "types": "index.d.ts",
8
+ "type": "module",
9
+ "exports": {
10
+ ".": {
11
+ "node": {
12
+ "import": "./dist/client-insights.esm.node.js",
13
+ "module": "./dist/client-insights.esm.node.js",
14
+ "require": "./dist/client-insights.cjs",
15
+ "default": "./dist/client-insights.cjs"
16
+ },
17
+ "default": {
18
+ "umd": "./dist/client-insights.umd.js",
19
+ "module": "./dist/client-insights.esm.browser.js",
20
+ "import": "./dist/client-insights.esm.browser.js",
21
+ "default": "./dist/client-insights.umd.js"
22
+ }
23
+ },
24
+ "./src/*": "./src/*.ts",
25
+ "./model": "./model/index.ts"
26
+ },
27
+ "jsdelivr": "./dist/client-insights.umd.js",
28
+ "unpkg": "./dist/client-insights.umd.js",
29
+ "browser": "./dist/client-insights.umd.js",
30
+ "types": "./index.d.ts",
14
31
  "files": [
15
32
  "dist",
16
33
  "model",
@@ -22,14 +39,14 @@
22
39
  "clean": "rm -rf ./dist || true"
23
40
  },
24
41
  "dependencies": {
25
- "@algolia/client-common": "5.0.0-alpha.9",
26
- "@algolia/requester-browser-xhr": "5.0.0-alpha.9",
27
- "@algolia/requester-node-http": "5.0.0-alpha.9"
42
+ "@algolia/client-common": "5.0.0-alpha.92",
43
+ "@algolia/requester-browser-xhr": "5.0.0-alpha.92",
44
+ "@algolia/requester-node-http": "5.0.0-alpha.92"
28
45
  },
29
46
  "devDependencies": {
30
- "@types/node": "16.11.47",
31
- "rollup": "2.77.2",
32
- "typescript": "4.7.4"
47
+ "@types/node": "20.9.0",
48
+ "rollup": "4.3.0",
49
+ "typescript": "5.2.2"
33
50
  },
34
51
  "engines": {
35
52
  "node": ">= 14.0.0"
@@ -1,2 +0,0 @@
1
- export declare type EventType = 'click' | 'conversion' | 'view';
2
- //# sourceMappingURL=eventType.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"eventType.d.ts","sourceRoot":"","sources":["../../model/eventType.ts"],"names":[],"mappings":"AAEA,oBAAY,SAAS,GAAG,OAAO,GAAG,YAAY,GAAG,MAAM,CAAC"}
@@ -1,40 +0,0 @@
1
- import type { EventType } from './eventType';
2
- /**
3
- * Insights event.
4
- */
5
- export declare type InsightEvent = {
6
- eventType: EventType;
7
- /**
8
- * A user-defined string used to categorize events.
9
- */
10
- eventName: string;
11
- /**
12
- * Name of the targeted index.
13
- */
14
- index: string;
15
- /**
16
- * A user identifier. Depending if the user is logged-in or not, several strategies can be used from a sessionId to a technical identifier. You should always send pseudonymous or anonymous userTokens.
17
- */
18
- userToken: string;
19
- /**
20
- * Time of the event expressed in milliseconds since the Unix epoch.
21
- */
22
- timestamp?: number;
23
- /**
24
- * Algolia queryID. This is required when an event is tied to a search.
25
- */
26
- queryID?: string;
27
- /**
28
- * An array of index objectID. Limited to 20 objects. An event can’t have both objectIDs and filters at the same time.
29
- */
30
- objectIDs?: string[];
31
- /**
32
- * An array of filters. Limited to 10 filters. An event can’t have both objectIDs and filters at the same time.
33
- */
34
- filters?: string[];
35
- /**
36
- * Position of the click in the list of Algolia search results. This field is required if a queryID is provided. One position must be provided for each objectID.
37
- */
38
- positions?: number[];
39
- };
40
- //# sourceMappingURL=insightEvent.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"insightEvent.d.ts","sourceRoot":"","sources":["../../model/insightEvent.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C;;GAEG;AACH,oBAAY,YAAY,GAAG;IACzB,SAAS,EAAE,SAAS,CAAC;IAErB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IAErB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IAEnB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB,CAAC"}
@@ -1,11 +0,0 @@
1
- import type { InsightEvent } from './insightEvent';
2
- /**
3
- * Object containing the events sent.
4
- */
5
- export declare type InsightEvents = {
6
- /**
7
- * Array of events sent.
8
- */
9
- events: InsightEvent[];
10
- };
11
- //# sourceMappingURL=insightEvents.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"insightEvents.d.ts","sourceRoot":"","sources":["../../model/insightEvents.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD;;GAEG;AACH,oBAAY,aAAa,GAAG;IAC1B;;OAEG;IACH,MAAM,EAAE,YAAY,EAAE,CAAC;CACxB,CAAC"}
@@ -1,7 +0,0 @@
1
- export declare type PushEventsResponse = {
2
- /**
3
- * A message confirming the event push.
4
- */
5
- message: string;
6
- };
7
- //# sourceMappingURL=pushEventsResponse.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pushEventsResponse.d.ts","sourceRoot":"","sources":["../../model/pushEventsResponse.ts"],"names":[],"mappings":"AAEA,oBAAY,kBAAkB,GAAG;IAC/B;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC"}
@@ -1,3 +0,0 @@
1
- // This file is generated, manual changes will be lost - read more on https://github.com/algolia/api-clients-automation.
2
-
3
- export type EventType = 'click' | 'conversion' | 'view';