@algolia/client-insights 5.0.0-alpha.91 → 5.0.0-alpha.97
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/client-insights.cjs +64 -41
- package/dist/client-insights.esm.browser.js +107 -60
- package/dist/client-insights.esm.node.js +64 -41
- package/dist/client-insights.umd.js +2 -2
- package/dist/model/addedToCartObjectIDs.d.ts +15 -13
- package/dist/model/addedToCartObjectIDs.d.ts.map +1 -1
- package/dist/model/addedToCartObjectIDsAfterSearch.d.ts +15 -13
- package/dist/model/addedToCartObjectIDsAfterSearch.d.ts.map +1 -1
- package/dist/model/clickedFilters.d.ts +7 -7
- package/dist/model/clickedFilters.d.ts.map +1 -1
- package/dist/model/clickedObjectIDs.d.ts +9 -5
- package/dist/model/clickedObjectIDs.d.ts.map +1 -1
- package/dist/model/clickedObjectIDsAfterSearch.d.ts +9 -9
- package/dist/model/clickedObjectIDsAfterSearch.d.ts.map +1 -1
- package/dist/model/clientMethodProps.d.ts +17 -8
- package/dist/model/clientMethodProps.d.ts.map +1 -1
- package/dist/model/convertedFilters.d.ts +7 -7
- package/dist/model/convertedFilters.d.ts.map +1 -1
- package/dist/model/convertedObjectIDs.d.ts +8 -8
- package/dist/model/convertedObjectIDs.d.ts.map +1 -1
- package/dist/model/convertedObjectIDsAfterSearch.d.ts +8 -8
- package/dist/model/convertedObjectIDsAfterSearch.d.ts.map +1 -1
- package/dist/model/discount.d.ts +1 -1
- package/dist/model/index.d.ts +1 -0
- package/dist/model/index.d.ts.map +1 -1
- package/dist/model/insightsEvents.d.ts +1 -1
- package/dist/model/objectData.d.ts +1 -1
- package/dist/model/objectDataAfterSearch.d.ts +2 -2
- package/dist/model/price.d.ts +1 -1
- package/dist/model/purchasedObjectIDs.d.ts +15 -13
- package/dist/model/purchasedObjectIDs.d.ts.map +1 -1
- package/dist/model/purchasedObjectIDsAfterSearch.d.ts +14 -16
- package/dist/model/purchasedObjectIDsAfterSearch.d.ts.map +1 -1
- package/dist/model/value.d.ts +5 -0
- package/dist/model/value.d.ts.map +1 -0
- package/dist/model/viewedFilters.d.ts +7 -7
- package/dist/model/viewedFilters.d.ts.map +1 -1
- package/dist/model/viewedObjectIDs.d.ts +8 -8
- package/dist/model/viewedObjectIDs.d.ts.map +1 -1
- package/dist/src/insightsClient.d.ts +35 -26
- package/dist/src/insightsClient.d.ts.map +1 -1
- package/model/addedToCartObjectIDs.ts +16 -13
- package/model/addedToCartObjectIDsAfterSearch.ts +16 -13
- package/model/clickedFilters.ts +7 -7
- package/model/clickedObjectIDs.ts +10 -5
- package/model/clickedObjectIDsAfterSearch.ts +9 -9
- package/model/clientMethodProps.ts +18 -8
- package/model/convertedFilters.ts +7 -7
- package/model/convertedObjectIDs.ts +8 -8
- package/model/convertedObjectIDsAfterSearch.ts +8 -8
- package/model/discount.ts +1 -1
- package/model/index.ts +1 -0
- package/model/insightsEvents.ts +1 -1
- package/model/objectData.ts +1 -1
- package/model/objectDataAfterSearch.ts +2 -2
- package/model/price.ts +1 -1
- package/model/purchasedObjectIDs.ts +16 -13
- package/model/purchasedObjectIDsAfterSearch.ts +14 -16
- package/model/value.ts +6 -0
- package/model/viewedFilters.ts +7 -7
- package/model/viewedObjectIDs.ts +8 -8
- package/package.json +7 -7
|
@@ -2,12 +2,12 @@ import type { Discount } from './discount';
|
|
|
2
2
|
import type { Price } from './price';
|
|
3
3
|
export type ObjectDataAfterSearch = {
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* Unique identifier for a search query, used to track purchase events with multiple records that originate from different searches.
|
|
6
6
|
*/
|
|
7
7
|
queryID?: string;
|
|
8
8
|
price?: Price;
|
|
9
9
|
/**
|
|
10
|
-
* The quantity of
|
|
10
|
+
* The quantity of a product that has been purchased or added to the cart. The total value of a purchase is the sum of `quantity` multiplied with the `price` for each purchased item.
|
|
11
11
|
*/
|
|
12
12
|
quantity?: number;
|
|
13
13
|
discount?: Discount;
|
package/dist/model/price.d.ts
CHANGED
|
@@ -1,43 +1,45 @@
|
|
|
1
1
|
import type { ConversionEvent } from './conversionEvent';
|
|
2
2
|
import type { ObjectData } from './objectData';
|
|
3
3
|
import type { PurchaseEvent } from './purchaseEvent';
|
|
4
|
+
import type { Value } from './value';
|
|
4
5
|
/**
|
|
5
6
|
* 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.
|
|
6
7
|
*/
|
|
7
8
|
export type PurchasedObjectIDs = {
|
|
8
9
|
/**
|
|
9
|
-
*
|
|
10
|
+
* The name of the event, up to 64 ASCII characters. Consider naming events consistently—for example, by adopting Segment\'s [object-action](https://segment.com/academy/collecting-data/naming-conventions-for-clean-data/#the-object-action-framework) framework.
|
|
10
11
|
*/
|
|
11
12
|
eventName: string;
|
|
12
13
|
eventType: ConversionEvent;
|
|
13
14
|
eventSubtype: PurchaseEvent;
|
|
14
15
|
/**
|
|
15
|
-
*
|
|
16
|
+
* The name of an Algolia index.
|
|
16
17
|
*/
|
|
17
18
|
index: string;
|
|
18
19
|
/**
|
|
19
|
-
*
|
|
20
|
+
* The object IDs of the records that are part of the event.
|
|
20
21
|
*/
|
|
21
22
|
objectIDs: string[];
|
|
22
23
|
/**
|
|
23
|
-
*
|
|
24
|
+
* An anonymous or pseudonymous user identifier. > **Note**: Never include personally identifiable information in user tokens.
|
|
24
25
|
*/
|
|
25
|
-
|
|
26
|
+
userToken: string;
|
|
26
27
|
/**
|
|
27
|
-
*
|
|
28
|
+
* An identifier for authenticated users. > **Note**: Never include personally identifiable information in user tokens.
|
|
28
29
|
*/
|
|
29
|
-
|
|
30
|
+
authenticatedUserToken?: string;
|
|
30
31
|
/**
|
|
31
|
-
*
|
|
32
|
+
* Three-letter [currency code](https://www.iso.org/iso-4217-currency-codes.html).
|
|
32
33
|
*/
|
|
33
|
-
|
|
34
|
+
currency?: string;
|
|
34
35
|
/**
|
|
35
|
-
*
|
|
36
|
+
* Extra information about the records involved in a purchase or add-to-cart event. If specified, it must have the same length as `objectIDs`.
|
|
36
37
|
*/
|
|
37
|
-
|
|
38
|
+
objectData?: ObjectData[];
|
|
38
39
|
/**
|
|
39
|
-
*
|
|
40
|
+
* The timestamp of the event in milliseconds in [Unix epoch time](https://wikipedia.org/wiki/Unix_time). By default, the Insights API uses the time it receives an event as its timestamp.
|
|
40
41
|
*/
|
|
41
|
-
|
|
42
|
+
timestamp?: number;
|
|
43
|
+
value?: Value;
|
|
42
44
|
};
|
|
43
45
|
//# sourceMappingURL=purchasedObjectIDs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"purchasedObjectIDs.d.ts","sourceRoot":"","sources":["../../model/purchasedObjectIDs.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"purchasedObjectIDs.d.ts","sourceRoot":"","sources":["../../model/purchasedObjectIDs.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAErC;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB,SAAS,EAAE,eAAe,CAAC;IAE3B,YAAY,EAAE,aAAa,CAAC;IAE5B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,SAAS,EAAE,MAAM,EAAE,CAAC;IAEpB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAEhC;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,UAAU,CAAC,EAAE,UAAU,EAAE,CAAC;IAE1B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,KAAK,CAAC,EAAE,KAAK,CAAC;CACf,CAAC"}
|
|
@@ -1,47 +1,45 @@
|
|
|
1
1
|
import type { ConversionEvent } from './conversionEvent';
|
|
2
2
|
import type { ObjectDataAfterSearch } from './objectDataAfterSearch';
|
|
3
3
|
import type { PurchaseEvent } from './purchaseEvent';
|
|
4
|
+
import type { Value } from './value';
|
|
4
5
|
/**
|
|
5
6
|
* Use this event to track when users make a purchase after a previous Algolia request. If you\'re building your category pages with Algolia, you\'ll also use this event.
|
|
6
7
|
*/
|
|
7
8
|
export type PurchasedObjectIDsAfterSearch = {
|
|
8
9
|
/**
|
|
9
|
-
*
|
|
10
|
+
* The name of the event, up to 64 ASCII characters. Consider naming events consistently—for example, by adopting Segment\'s [object-action](https://segment.com/academy/collecting-data/naming-conventions-for-clean-data/#the-object-action-framework) framework.
|
|
10
11
|
*/
|
|
11
12
|
eventName: string;
|
|
12
13
|
eventType: ConversionEvent;
|
|
13
14
|
eventSubtype: PurchaseEvent;
|
|
14
15
|
/**
|
|
15
|
-
*
|
|
16
|
+
* The name of an Algolia index.
|
|
16
17
|
*/
|
|
17
18
|
index: string;
|
|
18
19
|
/**
|
|
19
|
-
*
|
|
20
|
+
* The object IDs of the records that are part of the event.
|
|
20
21
|
*/
|
|
21
|
-
|
|
22
|
+
objectIDs: string[];
|
|
22
23
|
/**
|
|
23
|
-
*
|
|
24
|
+
* An anonymous or pseudonymous user identifier. > **Note**: Never include personally identifiable information in user tokens.
|
|
24
25
|
*/
|
|
25
|
-
|
|
26
|
+
userToken: string;
|
|
26
27
|
/**
|
|
27
|
-
*
|
|
28
|
+
* An identifier for authenticated users. > **Note**: Never include personally identifiable information in user tokens.
|
|
28
29
|
*/
|
|
29
|
-
|
|
30
|
+
authenticatedUserToken?: string;
|
|
30
31
|
/**
|
|
31
|
-
*
|
|
32
|
+
* Three-letter [currency code](https://www.iso.org/iso-4217-currency-codes.html).
|
|
32
33
|
*/
|
|
33
34
|
currency?: string;
|
|
34
35
|
/**
|
|
35
|
-
*
|
|
36
|
+
* Extra information about the records involved in a purchase or add-to-cart events. If provided, it must be the same length as `objectIDs`.
|
|
36
37
|
*/
|
|
37
|
-
|
|
38
|
+
objectData?: ObjectDataAfterSearch[];
|
|
38
39
|
/**
|
|
39
|
-
*
|
|
40
|
+
* The timestamp of the event in milliseconds in [Unix epoch time](https://wikipedia.org/wiki/Unix_time). By default, the Insights API uses the time it receives an event as its timestamp.
|
|
40
41
|
*/
|
|
41
42
|
timestamp?: number;
|
|
42
|
-
|
|
43
|
-
* User token for authenticated users.
|
|
44
|
-
*/
|
|
45
|
-
authenticatedUserToken?: string;
|
|
43
|
+
value?: Value;
|
|
46
44
|
};
|
|
47
45
|
//# sourceMappingURL=purchasedObjectIDsAfterSearch.d.ts.map
|
|
@@ -1 +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;
|
|
1
|
+
{"version":3,"file":"purchasedObjectIDsAfterSearch.d.ts","sourceRoot":"","sources":["../../model/purchasedObjectIDsAfterSearch.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAErC;;GAEG;AACH,MAAM,MAAM,6BAA6B,GAAG;IAC1C;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB,SAAS,EAAE,eAAe,CAAC;IAE3B,YAAY,EAAE,aAAa,CAAC;IAE5B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,SAAS,EAAE,MAAM,EAAE,CAAC;IAEpB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAEhC;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,UAAU,CAAC,EAAE,qBAAqB,EAAE,CAAC;IAErC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,KAAK,CAAC,EAAE,KAAK,CAAC;CACf,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"value.d.ts","sourceRoot":"","sources":["../../model/value.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,MAAM,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC"}
|
|
@@ -4,12 +4,12 @@ import type { ViewEvent } from './viewEvent';
|
|
|
4
4
|
*/
|
|
5
5
|
export type ViewedFilters = {
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
7
|
+
* The name of the event, up to 64 ASCII characters. Consider naming events consistently—for example, by adopting Segment\'s [object-action](https://segment.com/academy/collecting-data/naming-conventions-for-clean-data/#the-object-action-framework) framework.
|
|
8
8
|
*/
|
|
9
9
|
eventName: string;
|
|
10
10
|
eventType: ViewEvent;
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
12
|
+
* The name of an Algolia index.
|
|
13
13
|
*/
|
|
14
14
|
index: string;
|
|
15
15
|
/**
|
|
@@ -17,16 +17,16 @@ export type ViewedFilters = {
|
|
|
17
17
|
*/
|
|
18
18
|
filters: string[];
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
20
|
+
* An anonymous or pseudonymous user identifier. > **Note**: Never include personally identifiable information in user tokens.
|
|
21
21
|
*/
|
|
22
22
|
userToken: string;
|
|
23
23
|
/**
|
|
24
|
-
*
|
|
24
|
+
* An identifier for authenticated users. > **Note**: Never include personally identifiable information in user tokens.
|
|
25
25
|
*/
|
|
26
|
-
|
|
26
|
+
authenticatedUserToken?: string;
|
|
27
27
|
/**
|
|
28
|
-
*
|
|
28
|
+
* The timestamp of the event in milliseconds in [Unix epoch time](https://wikipedia.org/wiki/Unix_time). By default, the Insights API uses the time it receives an event as its timestamp.
|
|
29
29
|
*/
|
|
30
|
-
|
|
30
|
+
timestamp?: number;
|
|
31
31
|
};
|
|
32
32
|
//# sourceMappingURL=viewedFilters.d.ts.map
|
|
@@ -1 +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,
|
|
1
|
+
{"version":3,"file":"viewedFilters.d.ts","sourceRoot":"","sources":["../../model/viewedFilters.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB,SAAS,EAAE,SAAS,CAAC;IAErB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,OAAO,EAAE,MAAM,EAAE,CAAC;IAElB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAEhC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC"}
|
|
@@ -4,29 +4,29 @@ import type { ViewEvent } from './viewEvent';
|
|
|
4
4
|
*/
|
|
5
5
|
export type ViewedObjectIDs = {
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
7
|
+
* The name of the event, up to 64 ASCII characters. Consider naming events consistently—for example, by adopting Segment\'s [object-action](https://segment.com/academy/collecting-data/naming-conventions-for-clean-data/#the-object-action-framework) framework.
|
|
8
8
|
*/
|
|
9
9
|
eventName: string;
|
|
10
10
|
eventType: ViewEvent;
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
12
|
+
* The name of an Algolia index.
|
|
13
13
|
*/
|
|
14
14
|
index: string;
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
16
|
+
* The object IDs of the records that are part of the event.
|
|
17
17
|
*/
|
|
18
18
|
objectIDs: string[];
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
20
|
+
* An anonymous or pseudonymous user identifier. > **Note**: Never include personally identifiable information in user tokens.
|
|
21
21
|
*/
|
|
22
22
|
userToken: string;
|
|
23
23
|
/**
|
|
24
|
-
*
|
|
24
|
+
* An identifier for authenticated users. > **Note**: Never include personally identifiable information in user tokens.
|
|
25
25
|
*/
|
|
26
|
-
|
|
26
|
+
authenticatedUserToken?: string;
|
|
27
27
|
/**
|
|
28
|
-
*
|
|
28
|
+
* The timestamp of the event in milliseconds in [Unix epoch time](https://wikipedia.org/wiki/Unix_time). By default, the Insights API uses the time it receives an event as its timestamp.
|
|
29
29
|
*/
|
|
30
|
-
|
|
30
|
+
timestamp?: number;
|
|
31
31
|
};
|
|
32
32
|
//# sourceMappingURL=viewedObjectIDs.d.ts.map
|
|
@@ -1 +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,
|
|
1
|
+
{"version":3,"file":"viewedObjectIDs.d.ts","sourceRoot":"","sources":["../../model/viewedObjectIDs.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB,SAAS,EAAE,SAAS,CAAC;IAErB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,SAAS,EAAE,MAAM,EAAE,CAAC;IAEpB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAEhC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { CreateClientOptions, RequestOptions } from '@algolia/client-common';
|
|
2
|
-
import type {
|
|
2
|
+
import type { CustomDeleteProps, CustomGetProps, CustomPostProps, CustomPutProps, DeleteUserTokenProps } from '../model/clientMethodProps';
|
|
3
3
|
import type { EventsResponse } from '../model/eventsResponse';
|
|
4
4
|
import type { InsightsEvents } from '../model/insightsEvents';
|
|
5
|
-
export declare const apiClientVersion = "5.0.0-alpha.
|
|
5
|
+
export declare const apiClientVersion = "5.0.0-alpha.97";
|
|
6
6
|
export declare const REGIONS: readonly ["de", "us"];
|
|
7
7
|
export type Region = (typeof REGIONS)[number];
|
|
8
8
|
export declare function createInsightsClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, region: regionOption, ...options }: CreateClientOptions & {
|
|
@@ -32,52 +32,61 @@ export declare function createInsightsClient({ appId: appIdOption, apiKey: apiKe
|
|
|
32
32
|
* This method allow you to send requests to the Algolia REST API.
|
|
33
33
|
*
|
|
34
34
|
* @summary Send requests to the Algolia REST API.
|
|
35
|
-
* @param
|
|
36
|
-
* @param
|
|
37
|
-
* @param
|
|
35
|
+
* @param customDelete - The customDelete object.
|
|
36
|
+
* @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
37
|
+
* @param customDelete.parameters - Query parameters to apply to the current query.
|
|
38
38
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
39
39
|
*/
|
|
40
|
-
|
|
40
|
+
customDelete({ path, parameters }: CustomDeleteProps, requestOptions?: RequestOptions): Promise<Record<string, any>>;
|
|
41
41
|
/**
|
|
42
42
|
* This method allow you to send requests to the Algolia REST API.
|
|
43
43
|
*
|
|
44
44
|
* @summary Send requests to the Algolia REST API.
|
|
45
|
-
* @param
|
|
46
|
-
* @param
|
|
47
|
-
* @param
|
|
45
|
+
* @param customGet - The customGet object.
|
|
46
|
+
* @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
47
|
+
* @param customGet.parameters - Query parameters to apply to the current query.
|
|
48
48
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
49
49
|
*/
|
|
50
|
-
|
|
50
|
+
customGet({ path, parameters }: CustomGetProps, requestOptions?: RequestOptions): Promise<Record<string, any>>;
|
|
51
51
|
/**
|
|
52
52
|
* This method allow you to send requests to the Algolia REST API.
|
|
53
53
|
*
|
|
54
54
|
* @summary Send requests to the Algolia REST API.
|
|
55
|
-
* @param
|
|
56
|
-
* @param
|
|
57
|
-
* @param
|
|
58
|
-
* @param
|
|
55
|
+
* @param customPost - The customPost object.
|
|
56
|
+
* @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
57
|
+
* @param customPost.parameters - Query parameters to apply to the current query.
|
|
58
|
+
* @param customPost.body - Parameters to send with the custom request.
|
|
59
59
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
60
60
|
*/
|
|
61
|
-
|
|
61
|
+
customPost({ path, parameters, body }: CustomPostProps, requestOptions?: RequestOptions): Promise<Record<string, any>>;
|
|
62
62
|
/**
|
|
63
|
-
*
|
|
63
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
64
64
|
*
|
|
65
|
-
* @summary Send
|
|
66
|
-
* @param
|
|
65
|
+
* @summary Send requests to the Algolia REST API.
|
|
66
|
+
* @param customPut - The customPut object.
|
|
67
|
+
* @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
68
|
+
* @param customPut.parameters - Query parameters to apply to the current query.
|
|
69
|
+
* @param customPut.body - Parameters to send with the custom request.
|
|
67
70
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
68
71
|
*/
|
|
69
|
-
|
|
72
|
+
customPut({ path, parameters, body }: CustomPutProps, requestOptions?: RequestOptions): Promise<Record<string, any>>;
|
|
70
73
|
/**
|
|
71
|
-
*
|
|
74
|
+
* Delete all events related to a certain user token from events metrics and analytics. To delete a personalization user profile, see [Delete a user profile](https://www.algolia.com/doc/rest-api/personalization/#delete-a-user-profile).
|
|
72
75
|
*
|
|
73
|
-
* @summary
|
|
74
|
-
* @param
|
|
75
|
-
* @param
|
|
76
|
-
* @param put.parameters - Query parameters to apply to the current query.
|
|
77
|
-
* @param put.body - Parameters to send with the custom request.
|
|
76
|
+
* @summary Delete user token.
|
|
77
|
+
* @param deleteUserToken - The deleteUserToken object.
|
|
78
|
+
* @param deleteUserToken.userToken - The user token for which to delete all associated events.
|
|
78
79
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
79
80
|
*/
|
|
80
|
-
|
|
81
|
+
deleteUserToken({ userToken }: DeleteUserTokenProps, requestOptions?: RequestOptions): Promise<void>;
|
|
82
|
+
/**
|
|
83
|
+
* 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.
|
|
84
|
+
*
|
|
85
|
+
* @summary Send events.
|
|
86
|
+
* @param insightsEvents - The insightsEvents object.
|
|
87
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
88
|
+
*/
|
|
89
|
+
pushEvents(insightsEvents: InsightsEvents, requestOptions?: RequestOptions): Promise<EventsResponse>;
|
|
81
90
|
};
|
|
82
91
|
/**
|
|
83
92
|
* The client type.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"insightsClient.d.ts","sourceRoot":"","sources":["../../src/insightsClient.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,mBAAmB,EAInB,cAAc,EAEf,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EACV,
|
|
1
|
+
{"version":3,"file":"insightsClient.d.ts","sourceRoot":"","sources":["../../src/insightsClient.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,mBAAmB,EAInB,cAAc,EAEf,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EACV,iBAAiB,EACjB,cAAc,EACd,eAAe,EACf,cAAc,EACd,oBAAoB,EACrB,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAE9D,eAAO,MAAM,gBAAgB,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;uCAEqB,iBAAiB,mBACtB,cAAc,GAC9B,QAAQ,OAAO,MAAM,EAAE,GAAG,CAAC,CAAC;IAqB/B;;;;;;;;OAQG;oCAEqB,cAAc,mBACnB,cAAc,GAC9B,QAAQ,OAAO,MAAM,EAAE,GAAG,CAAC,CAAC;IAqB/B;;;;;;;;;OASG;2CAE2B,eAAe,mBAC1B,cAAc,GAC9B,QAAQ,OAAO,MAAM,EAAE,GAAG,CAAC,CAAC;IAsB/B;;;;;;;;;OASG;0CAE2B,cAAc,mBACzB,cAAc,GAC9B,QAAQ,OAAO,MAAM,EAAE,GAAG,CAAC,CAAC;IAsB/B;;;;;;;OAOG;mCAEc,oBAAoB,mBAClB,cAAc,GAC9B,QAAQ,IAAI,CAAC;IAwBhB;;;;;;OAMG;+BAEe,cAAc,mBACb,cAAc,GAC9B,QAAQ,cAAc,CAAC;EA4B7B;AAED;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
|
|
@@ -3,13 +3,14 @@
|
|
|
3
3
|
import type { AddToCartEvent } from './addToCartEvent';
|
|
4
4
|
import type { ConversionEvent } from './conversionEvent';
|
|
5
5
|
import type { ObjectData } from './objectData';
|
|
6
|
+
import type { Value } from './value';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Use this event to track when users add items to their shopping cart unrelated to a previous Algolia request. For example, if you don\'t use Algolia to build your category pages, use this event. To track add-to-cart events related to Algolia requests, use the \"Added to cart object IDs after search\" event.
|
|
9
10
|
*/
|
|
10
11
|
export type AddedToCartObjectIDs = {
|
|
11
12
|
/**
|
|
12
|
-
*
|
|
13
|
+
* The name of the event, up to 64 ASCII characters. Consider naming events consistently—for example, by adopting Segment\'s [object-action](https://segment.com/academy/collecting-data/naming-conventions-for-clean-data/#the-object-action-framework) framework.
|
|
13
14
|
*/
|
|
14
15
|
eventName: string;
|
|
15
16
|
|
|
@@ -18,37 +19,39 @@ export type AddedToCartObjectIDs = {
|
|
|
18
19
|
eventSubtype: AddToCartEvent;
|
|
19
20
|
|
|
20
21
|
/**
|
|
21
|
-
*
|
|
22
|
+
* The name of an Algolia index.
|
|
22
23
|
*/
|
|
23
24
|
index: string;
|
|
24
25
|
|
|
25
26
|
/**
|
|
26
|
-
*
|
|
27
|
+
* The object IDs of the records that are part of the event.
|
|
27
28
|
*/
|
|
28
29
|
objectIDs: string[];
|
|
29
30
|
|
|
30
31
|
/**
|
|
31
|
-
*
|
|
32
|
+
* An anonymous or pseudonymous user identifier. > **Note**: Never include personally identifiable information in user tokens.
|
|
32
33
|
*/
|
|
33
|
-
|
|
34
|
+
userToken: string;
|
|
34
35
|
|
|
35
36
|
/**
|
|
36
|
-
*
|
|
37
|
+
* An identifier for authenticated users. > **Note**: Never include personally identifiable information in user tokens.
|
|
37
38
|
*/
|
|
38
|
-
|
|
39
|
+
authenticatedUserToken?: string;
|
|
39
40
|
|
|
40
41
|
/**
|
|
41
|
-
*
|
|
42
|
+
* Three-letter [currency code](https://www.iso.org/iso-4217-currency-codes.html).
|
|
42
43
|
*/
|
|
43
|
-
|
|
44
|
+
currency?: string;
|
|
44
45
|
|
|
45
46
|
/**
|
|
46
|
-
*
|
|
47
|
+
* Extra information about the records involved in a purchase or add-to-cart event. If specified, it must have the same length as `objectIDs`.
|
|
47
48
|
*/
|
|
48
|
-
|
|
49
|
+
objectData?: ObjectData[];
|
|
49
50
|
|
|
50
51
|
/**
|
|
51
|
-
*
|
|
52
|
+
* The timestamp of the event in milliseconds in [Unix epoch time](https://wikipedia.org/wiki/Unix_time). By default, the Insights API uses the time it receives an event as its timestamp.
|
|
52
53
|
*/
|
|
53
|
-
|
|
54
|
+
timestamp?: number;
|
|
55
|
+
|
|
56
|
+
value?: Value;
|
|
54
57
|
};
|
|
@@ -3,13 +3,14 @@
|
|
|
3
3
|
import type { AddToCartEvent } from './addToCartEvent';
|
|
4
4
|
import type { ConversionEvent } from './conversionEvent';
|
|
5
5
|
import type { ObjectDataAfterSearch } from './objectDataAfterSearch';
|
|
6
|
+
import type { Value } from './value';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Use this event to track when users add items to their shopping cart after a previous Algolia request. If you\'re building your category pages with Algolia, you\'ll also use this event.
|
|
9
10
|
*/
|
|
10
11
|
export type AddedToCartObjectIDsAfterSearch = {
|
|
11
12
|
/**
|
|
12
|
-
*
|
|
13
|
+
* The name of the event, up to 64 ASCII characters. Consider naming events consistently—for example, by adopting Segment\'s [object-action](https://segment.com/academy/collecting-data/naming-conventions-for-clean-data/#the-object-action-framework) framework.
|
|
13
14
|
*/
|
|
14
15
|
eventName: string;
|
|
15
16
|
|
|
@@ -18,7 +19,7 @@ export type AddedToCartObjectIDsAfterSearch = {
|
|
|
18
19
|
eventSubtype: AddToCartEvent;
|
|
19
20
|
|
|
20
21
|
/**
|
|
21
|
-
*
|
|
22
|
+
* The name of an Algolia index.
|
|
22
23
|
*/
|
|
23
24
|
index: string;
|
|
24
25
|
|
|
@@ -28,32 +29,34 @@ export type AddedToCartObjectIDsAfterSearch = {
|
|
|
28
29
|
queryID: string;
|
|
29
30
|
|
|
30
31
|
/**
|
|
31
|
-
*
|
|
32
|
+
* The object IDs of the records that are part of the event.
|
|
32
33
|
*/
|
|
33
34
|
objectIDs: string[];
|
|
34
35
|
|
|
35
36
|
/**
|
|
36
|
-
*
|
|
37
|
+
* An anonymous or pseudonymous user identifier. > **Note**: Never include personally identifiable information in user tokens.
|
|
37
38
|
*/
|
|
38
|
-
|
|
39
|
+
userToken: string;
|
|
39
40
|
|
|
40
41
|
/**
|
|
41
|
-
*
|
|
42
|
+
* An identifier for authenticated users. > **Note**: Never include personally identifiable information in user tokens.
|
|
42
43
|
*/
|
|
43
|
-
|
|
44
|
+
authenticatedUserToken?: string;
|
|
44
45
|
|
|
45
46
|
/**
|
|
46
|
-
*
|
|
47
|
+
* Three-letter [currency code](https://www.iso.org/iso-4217-currency-codes.html).
|
|
47
48
|
*/
|
|
48
|
-
|
|
49
|
+
currency?: string;
|
|
49
50
|
|
|
50
51
|
/**
|
|
51
|
-
*
|
|
52
|
+
* Extra information about the records involved in a purchase or add-to-cart events. If provided, it must be the same length as `objectIDs`.
|
|
52
53
|
*/
|
|
53
|
-
|
|
54
|
+
objectData?: ObjectDataAfterSearch[];
|
|
54
55
|
|
|
55
56
|
/**
|
|
56
|
-
*
|
|
57
|
+
* The timestamp of the event in milliseconds in [Unix epoch time](https://wikipedia.org/wiki/Unix_time). By default, the Insights API uses the time it receives an event as its timestamp.
|
|
57
58
|
*/
|
|
58
|
-
|
|
59
|
+
timestamp?: number;
|
|
60
|
+
|
|
61
|
+
value?: Value;
|
|
59
62
|
};
|
package/model/clickedFilters.ts
CHANGED
|
@@ -7,14 +7,14 @@ import type { ClickEvent } from './clickEvent';
|
|
|
7
7
|
*/
|
|
8
8
|
export type ClickedFilters = {
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* The name of the event, up to 64 ASCII characters. Consider naming events consistently—for example, by adopting Segment\'s [object-action](https://segment.com/academy/collecting-data/naming-conventions-for-clean-data/#the-object-action-framework) framework.
|
|
11
11
|
*/
|
|
12
12
|
eventName: string;
|
|
13
13
|
|
|
14
14
|
eventType: ClickEvent;
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
17
|
+
* The name of an Algolia index.
|
|
18
18
|
*/
|
|
19
19
|
index: string;
|
|
20
20
|
|
|
@@ -24,17 +24,17 @@ export type ClickedFilters = {
|
|
|
24
24
|
filters: string[];
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
|
-
*
|
|
27
|
+
* An anonymous or pseudonymous user identifier. > **Note**: Never include personally identifiable information in user tokens.
|
|
28
28
|
*/
|
|
29
29
|
userToken: string;
|
|
30
30
|
|
|
31
31
|
/**
|
|
32
|
-
*
|
|
32
|
+
* An identifier for authenticated users. > **Note**: Never include personally identifiable information in user tokens.
|
|
33
33
|
*/
|
|
34
|
-
|
|
34
|
+
authenticatedUserToken?: string;
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
|
-
*
|
|
37
|
+
* The timestamp of the event in milliseconds in [Unix epoch time](https://wikipedia.org/wiki/Unix_time). By default, the Insights API uses the time it receives an event as its timestamp.
|
|
38
38
|
*/
|
|
39
|
-
|
|
39
|
+
timestamp?: number;
|
|
40
40
|
};
|
|
@@ -7,29 +7,34 @@ import type { ClickEvent } from './clickEvent';
|
|
|
7
7
|
*/
|
|
8
8
|
export type ClickedObjectIDs = {
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* The name of the event, up to 64 ASCII characters. Consider naming events consistently—for example, by adopting Segment\'s [object-action](https://segment.com/academy/collecting-data/naming-conventions-for-clean-data/#the-object-action-framework) framework.
|
|
11
11
|
*/
|
|
12
12
|
eventName: string;
|
|
13
13
|
|
|
14
14
|
eventType: ClickEvent;
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
17
|
+
* The name of an Algolia index.
|
|
18
18
|
*/
|
|
19
19
|
index: string;
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
|
-
*
|
|
22
|
+
* The object IDs of the records that are part of the event.
|
|
23
23
|
*/
|
|
24
24
|
objectIDs: string[];
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
|
-
*
|
|
27
|
+
* An anonymous or pseudonymous user identifier. > **Note**: Never include personally identifiable information in user tokens.
|
|
28
28
|
*/
|
|
29
29
|
userToken: string;
|
|
30
30
|
|
|
31
31
|
/**
|
|
32
|
-
*
|
|
32
|
+
* An identifier for authenticated users. > **Note**: Never include personally identifiable information in user tokens.
|
|
33
|
+
*/
|
|
34
|
+
authenticatedUserToken?: string;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* The timestamp of the event in milliseconds in [Unix epoch time](https://wikipedia.org/wiki/Unix_time). By default, the Insights API uses the time it receives an event as its timestamp.
|
|
33
38
|
*/
|
|
34
39
|
timestamp?: number;
|
|
35
40
|
};
|