@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,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,2 @@
1
+ export type ViewEvent = 'view';
2
+ //# sourceMappingURL=viewEvent.d.ts.map
@@ -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 { InsightEvents } from '../model/insightEvents';
4
- import type { PushEventsResponse } from '../model/pushEventsResponse';
5
- export declare const apiClientVersion = "5.0.0-alpha.9";
6
- export declare const REGIONS: readonly ["de", "us"];
7
- export declare 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 - The path of the API endpoint to target, anything after the /1 needs to be specified.
37
- * @param del.parameters - Query parameters to be applied 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 - The path of the API endpoint to target, anything after the /1 needs to be specified.
47
- * @param get.parameters - Query parameters to be applied 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 - The path of the API endpoint to target, anything after the /1 needs to be specified.
57
- * @param post.parameters - Query parameters to be applied to the current query.
58
- * @param post.body - The 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
- * This command pushes an array of events. An event is - an action: `eventName` - performed in a context: `eventType` - at some point in time provided: `timestamp` - by an end user: `userToken` - on something: `index` Notes: - To be accepted, all events sent must be valid. - The size of the body must be *less than 2 MB*. - When an event is tied to an Algolia search, it must also provide a `queryID`. If that event is a `click`, their absolute `positions` should also be passed. - We consider that an `index` provides access to 2 resources: objects and filters. An event can only interact with a single resource type, but not necessarily on a single item. As such an event will accept an array of `objectIDs` or `filters`.
64
- *
65
- * @summary Push events.
66
- * @param insightEvents - The insightEvents object.
67
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
68
- */
69
- pushEvents(insightEvents: InsightEvents, requestOptions?: RequestOptions): Promise<PushEventsResponse>;
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 - The path of the API endpoint to target, anything after the /1 needs to be specified.
76
- * @param put.parameters - Query parameters to be applied to the current query.
77
- * @param put.body - The 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 declare type InsightsClient = ReturnType<typeof createInsightsClient>;
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&nbsp;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,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAEtE,eAAO,MAAM,gBAAgB,kBAAkB,CAAC;AAEhD,eAAO,MAAM,OAAO,uBAAwB,CAAC;AAC7C,oBAAY,MAAM,GAAG,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC;AAW5C,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;8BAEc,aAAa,mBACX,cAAc,GAC9B,QAAQ,kBAAkB,CAAC;IA4B9B;;;;;;;;;OASG;oCAE2B,QAAQ,mBACnB,cAAc,GAC9B,QAAQ,OAAO,MAAM,EAAE,GAAG,CAAC,CAAC;EAoBlC;AAED;;GAEG;AACH,oBAAY,cAAc,GAAG,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
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.js');
2
+ module.exports = require('./dist/client-insights.cjs');
@@ -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 AddToCartEvent = 'addToCart';
@@ -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,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 ClickEvent = 'click';
@@ -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
- // 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
  * Properties for the `del` method.
5
5
  */
6
6
  export type DelProps = {
7
7
  /**
8
- * The path of the API endpoint to target, anything after the /1 needs to be specified.
8
+ * Path of the endpoint, anything after \"/1\" must be specified.
9
9
  */
10
10
  path: string;
11
11
  /**
12
- * Query parameters to be applied to the current query.
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
- * The path of the API endpoint to target, anything after the /1 needs to be specified.
22
+ * Path of the endpoint, anything after \"/1\" must be specified.
23
23
  */
24
24
  path: string;
25
25
  /**
26
- * Query parameters to be applied to the current query.
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
- * The path of the API endpoint to target, anything after the /1 needs to be specified.
36
+ * Path of the endpoint, anything after \"/1\" must be specified.
37
37
  */
38
38
  path: string;
39
39
  /**
40
- * Query parameters to be applied to the current query.
40
+ * Query parameters to apply to the current query.
41
41
  */
42
42
  parameters?: Record<string, any>;
43
43
  /**
44
- * The parameters to send with the custom request.
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
- * The path of the API endpoint to target, anything after the /1 needs to be specified.
54
+ * Path of the endpoint, anything after \"/1\" must be specified.
55
55
  */
56
56
  path: string;
57
57
  /**
58
- * Query parameters to be applied to the current query.
58
+ * Query parameters to apply to the current query.
59
59
  */
60
60
  parameters?: Record<string, any>;
61
61
  /**
62
- * The parameters to send with the custom request.
62
+ * Parameters to send with the custom request.
63
63
  */
64
64
  body?: Record<string, any>;
65
65
  };