@algolia/client-insights 5.2.3 → 5.2.4-beta.3
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/browser.d.ts +598 -0
- package/dist/builds/browser.js +255 -0
- package/dist/builds/browser.js.map +1 -0
- package/dist/builds/browser.min.js +2 -0
- package/dist/builds/browser.min.js.map +1 -0
- package/dist/builds/browser.umd.js +12 -0
- package/dist/builds/node.cjs +273 -0
- package/dist/builds/node.cjs.map +1 -0
- package/dist/builds/node.js +253 -0
- package/dist/builds/node.js.map +1 -0
- package/dist/model/addToCartEvent.cjs +19 -0
- package/dist/model/addToCartEvent.cjs.map +1 -0
- package/dist/model/addToCartEvent.js +1 -0
- package/dist/model/addToCartEvent.js.map +1 -0
- package/dist/model/addedToCartObjectIDs.cjs +19 -0
- package/dist/model/addedToCartObjectIDs.cjs.map +1 -0
- package/dist/model/addedToCartObjectIDs.js +1 -0
- package/dist/model/addedToCartObjectIDs.js.map +1 -0
- package/dist/model/addedToCartObjectIDsAfterSearch.cjs +19 -0
- package/dist/model/addedToCartObjectIDsAfterSearch.cjs.map +1 -0
- package/dist/model/addedToCartObjectIDsAfterSearch.js +1 -0
- package/dist/model/addedToCartObjectIDsAfterSearch.js.map +1 -0
- package/dist/model/clickEvent.cjs +19 -0
- package/dist/model/clickEvent.cjs.map +1 -0
- package/dist/model/clickEvent.js +1 -0
- package/dist/model/clickEvent.js.map +1 -0
- package/dist/model/clickedFilters.cjs +19 -0
- package/dist/model/clickedFilters.cjs.map +1 -0
- package/dist/model/clickedFilters.js +1 -0
- package/dist/model/clickedFilters.js.map +1 -0
- package/dist/model/clickedObjectIDs.cjs +19 -0
- package/dist/model/clickedObjectIDs.cjs.map +1 -0
- package/dist/model/clickedObjectIDs.js +1 -0
- package/dist/model/clickedObjectIDs.js.map +1 -0
- package/dist/model/clickedObjectIDsAfterSearch.cjs +19 -0
- package/dist/model/clickedObjectIDsAfterSearch.cjs.map +1 -0
- package/dist/model/clickedObjectIDsAfterSearch.js +1 -0
- package/dist/model/clickedObjectIDsAfterSearch.js.map +1 -0
- package/dist/model/clientMethodProps.cjs +19 -0
- package/dist/model/clientMethodProps.cjs.map +1 -0
- package/dist/model/clientMethodProps.js +1 -0
- package/dist/model/clientMethodProps.js.map +1 -0
- package/dist/model/conversionEvent.cjs +19 -0
- package/dist/model/conversionEvent.cjs.map +1 -0
- package/dist/model/conversionEvent.js +1 -0
- package/dist/model/conversionEvent.js.map +1 -0
- package/dist/model/convertedFilters.cjs +19 -0
- package/dist/model/convertedFilters.cjs.map +1 -0
- package/dist/model/convertedFilters.js +1 -0
- package/dist/model/convertedFilters.js.map +1 -0
- package/dist/model/convertedObjectIDs.cjs +19 -0
- package/dist/model/convertedObjectIDs.cjs.map +1 -0
- package/dist/model/convertedObjectIDs.js +1 -0
- package/dist/model/convertedObjectIDs.js.map +1 -0
- package/dist/model/convertedObjectIDsAfterSearch.cjs +19 -0
- package/dist/model/convertedObjectIDsAfterSearch.cjs.map +1 -0
- package/dist/model/convertedObjectIDsAfterSearch.js +1 -0
- package/dist/model/convertedObjectIDsAfterSearch.js.map +1 -0
- package/dist/model/discount.cjs +19 -0
- package/dist/model/discount.cjs.map +1 -0
- package/dist/model/discount.js +1 -0
- package/dist/model/discount.js.map +1 -0
- package/dist/model/errorBase.cjs +19 -0
- package/dist/model/errorBase.cjs.map +1 -0
- package/dist/model/errorBase.js +1 -0
- package/dist/model/errorBase.js.map +1 -0
- package/dist/model/eventsItems.cjs +19 -0
- package/dist/model/eventsItems.cjs.map +1 -0
- package/dist/model/eventsItems.js +1 -0
- package/dist/model/eventsItems.js.map +1 -0
- package/dist/model/eventsResponse.cjs +19 -0
- package/dist/model/eventsResponse.cjs.map +1 -0
- package/dist/model/eventsResponse.js +1 -0
- package/dist/model/eventsResponse.js.map +1 -0
- package/dist/model/index.cjs +19 -0
- package/dist/model/index.cjs.map +1 -0
- package/dist/model/index.js +1 -0
- package/dist/model/index.js.map +1 -0
- package/dist/model/insightsEvents.cjs +19 -0
- package/dist/model/insightsEvents.cjs.map +1 -0
- package/dist/model/insightsEvents.js +1 -0
- package/dist/model/insightsEvents.js.map +1 -0
- package/dist/model/objectData.cjs +19 -0
- package/dist/model/objectData.cjs.map +1 -0
- package/dist/model/objectData.js +1 -0
- package/dist/model/objectData.js.map +1 -0
- package/dist/model/objectDataAfterSearch.cjs +19 -0
- package/dist/model/objectDataAfterSearch.cjs.map +1 -0
- package/dist/model/objectDataAfterSearch.js +1 -0
- package/dist/model/objectDataAfterSearch.js.map +1 -0
- package/dist/model/price.cjs +19 -0
- package/dist/model/price.cjs.map +1 -0
- package/dist/model/price.js +1 -0
- package/dist/model/price.js.map +1 -0
- package/dist/model/purchaseEvent.cjs +19 -0
- package/dist/model/purchaseEvent.cjs.map +1 -0
- package/dist/model/purchaseEvent.js +1 -0
- package/dist/model/purchaseEvent.js.map +1 -0
- package/dist/model/purchasedObjectIDs.cjs +19 -0
- package/dist/model/purchasedObjectIDs.cjs.map +1 -0
- package/dist/model/purchasedObjectIDs.js +1 -0
- package/dist/model/purchasedObjectIDs.js.map +1 -0
- package/dist/model/purchasedObjectIDsAfterSearch.cjs +19 -0
- package/dist/model/purchasedObjectIDsAfterSearch.cjs.map +1 -0
- package/dist/model/purchasedObjectIDsAfterSearch.js +1 -0
- package/dist/model/purchasedObjectIDsAfterSearch.js.map +1 -0
- package/dist/model/value.cjs +19 -0
- package/dist/model/value.cjs.map +1 -0
- package/dist/model/value.js +1 -0
- package/dist/model/value.js.map +1 -0
- package/dist/model/viewEvent.cjs +19 -0
- package/dist/model/viewEvent.cjs.map +1 -0
- package/dist/model/viewEvent.js +1 -0
- package/dist/model/viewEvent.js.map +1 -0
- package/dist/model/viewedFilters.cjs +19 -0
- package/dist/model/viewedFilters.cjs.map +1 -0
- package/dist/model/viewedFilters.js +1 -0
- package/dist/model/viewedFilters.js.map +1 -0
- package/dist/model/viewedObjectIDs.cjs +19 -0
- package/dist/model/viewedObjectIDs.cjs.map +1 -0
- package/dist/model/viewedObjectIDs.js +1 -0
- package/dist/model/viewedObjectIDs.js.map +1 -0
- package/dist/node.d.cts +598 -0
- package/dist/node.d.ts +598 -0
- package/dist/src/insightsClient.cjs +240 -0
- package/dist/src/insightsClient.cjs.map +1 -0
- package/dist/src/insightsClient.js +213 -0
- package/dist/src/insightsClient.js.map +1 -0
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/package.json +33 -30
- package/dist/builds/browser.d.ts +0 -22
- package/dist/builds/browser.d.ts.map +0 -1
- package/dist/builds/node.d.ts +0 -22
- package/dist/builds/node.d.ts.map +0 -1
- package/dist/client-insights.cjs +0 -240
- package/dist/client-insights.esm.browser.js +0 -914
- package/dist/client-insights.esm.node.js +0 -237
- package/dist/client-insights.umd.js +0 -2
- package/dist/model/addToCartEvent.d.ts +0 -2
- package/dist/model/addToCartEvent.d.ts.map +0 -1
- package/dist/model/addedToCartObjectIDs.d.ts +0 -45
- package/dist/model/addedToCartObjectIDs.d.ts.map +0 -1
- package/dist/model/addedToCartObjectIDsAfterSearch.d.ts +0 -49
- package/dist/model/addedToCartObjectIDsAfterSearch.d.ts.map +0 -1
- package/dist/model/clickEvent.d.ts +0 -2
- package/dist/model/clickEvent.d.ts.map +0 -1
- package/dist/model/clickedFilters.d.ts +0 -32
- package/dist/model/clickedFilters.d.ts.map +0 -1
- package/dist/model/clickedObjectIDs.d.ts +0 -32
- package/dist/model/clickedObjectIDs.d.ts.map +0 -1
- package/dist/model/clickedObjectIDsAfterSearch.d.ts +0 -40
- package/dist/model/clickedObjectIDsAfterSearch.d.ts.map +0 -1
- package/dist/model/clientMethodProps.d.ts +0 -70
- package/dist/model/clientMethodProps.d.ts.map +0 -1
- package/dist/model/conversionEvent.d.ts +0 -2
- package/dist/model/conversionEvent.d.ts.map +0 -1
- package/dist/model/convertedFilters.d.ts +0 -29
- package/dist/model/convertedFilters.d.ts.map +0 -1
- package/dist/model/convertedObjectIDs.d.ts +0 -32
- package/dist/model/convertedObjectIDs.d.ts.map +0 -1
- package/dist/model/convertedObjectIDsAfterSearch.d.ts +0 -36
- package/dist/model/convertedObjectIDsAfterSearch.d.ts.map +0 -1
- package/dist/model/discount.d.ts +0 -5
- package/dist/model/discount.d.ts.map +0 -1
- package/dist/model/errorBase.d.ts +0 -7
- package/dist/model/errorBase.d.ts.map +0 -1
- package/dist/model/eventsItems.d.ts +0 -14
- package/dist/model/eventsItems.d.ts.map +0 -1
- package/dist/model/eventsResponse.d.ts +0 -14
- package/dist/model/eventsResponse.d.ts.map +0 -1
- package/dist/model/index.d.ts +0 -28
- package/dist/model/index.d.ts.map +0 -1
- package/dist/model/insightsEvents.d.ts +0 -8
- package/dist/model/insightsEvents.d.ts.map +0 -1
- package/dist/model/objectData.d.ts +0 -11
- package/dist/model/objectData.d.ts.map +0 -1
- package/dist/model/objectDataAfterSearch.d.ts +0 -15
- package/dist/model/objectDataAfterSearch.d.ts.map +0 -1
- package/dist/model/price.d.ts +0 -5
- package/dist/model/price.d.ts.map +0 -1
- package/dist/model/purchaseEvent.d.ts +0 -2
- package/dist/model/purchaseEvent.d.ts.map +0 -1
- package/dist/model/purchasedObjectIDs.d.ts +0 -45
- package/dist/model/purchasedObjectIDs.d.ts.map +0 -1
- package/dist/model/purchasedObjectIDsAfterSearch.d.ts +0 -45
- package/dist/model/purchasedObjectIDsAfterSearch.d.ts.map +0 -1
- package/dist/model/value.d.ts +0 -5
- package/dist/model/value.d.ts.map +0 -1
- package/dist/model/viewEvent.d.ts +0 -2
- package/dist/model/viewEvent.d.ts.map +0 -1
- package/dist/model/viewedFilters.d.ts +0 -32
- package/dist/model/viewedFilters.d.ts.map +0 -1
- package/dist/model/viewedObjectIDs.d.ts +0 -32
- package/dist/model/viewedObjectIDs.d.ts.map +0 -1
- package/dist/src/insightsClient.d.ts +0 -85
- package/dist/src/insightsClient.d.ts.map +0 -1
|
@@ -1,237 +0,0 @@
|
|
|
1
|
-
import { createAuth, createTransporter, getAlgoliaAgent, DEFAULT_CONNECT_TIMEOUT_NODE, DEFAULT_READ_TIMEOUT_NODE, DEFAULT_WRITE_TIMEOUT_NODE, createNullCache, createMemoryCache } from '@algolia/client-common';
|
|
2
|
-
import { createHttpRequester } from '@algolia/requester-node-http';
|
|
3
|
-
|
|
4
|
-
// 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.
|
|
5
|
-
const apiClientVersion = '5.2.3';
|
|
6
|
-
const REGIONS = ['de', 'us'];
|
|
7
|
-
function getDefaultHosts(region) {
|
|
8
|
-
const url = !region ? 'insights.algolia.io' : 'insights.{region}.algolia.io'.replace('{region}', region);
|
|
9
|
-
return [{ url, accept: 'readWrite', protocol: 'https' }];
|
|
10
|
-
}
|
|
11
|
-
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
12
|
-
function createInsightsClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, region: regionOption, ...options }) {
|
|
13
|
-
const auth = createAuth(appIdOption, apiKeyOption, authMode);
|
|
14
|
-
const transporter = createTransporter({
|
|
15
|
-
hosts: getDefaultHosts(regionOption),
|
|
16
|
-
...options,
|
|
17
|
-
algoliaAgent: getAlgoliaAgent({
|
|
18
|
-
algoliaAgents,
|
|
19
|
-
client: 'Insights',
|
|
20
|
-
version: apiClientVersion,
|
|
21
|
-
}),
|
|
22
|
-
baseHeaders: {
|
|
23
|
-
'content-type': 'text/plain',
|
|
24
|
-
...auth.headers(),
|
|
25
|
-
...options.baseHeaders,
|
|
26
|
-
},
|
|
27
|
-
baseQueryParameters: {
|
|
28
|
-
...auth.queryParameters(),
|
|
29
|
-
...options.baseQueryParameters,
|
|
30
|
-
},
|
|
31
|
-
});
|
|
32
|
-
return {
|
|
33
|
-
transporter,
|
|
34
|
-
/**
|
|
35
|
-
* The `appId` currently in use.
|
|
36
|
-
*/
|
|
37
|
-
appId: appIdOption,
|
|
38
|
-
/**
|
|
39
|
-
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
|
|
40
|
-
*/
|
|
41
|
-
clearCache() {
|
|
42
|
-
return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => undefined);
|
|
43
|
-
},
|
|
44
|
-
/**
|
|
45
|
-
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
|
|
46
|
-
*/
|
|
47
|
-
get _ua() {
|
|
48
|
-
return transporter.algoliaAgent.value;
|
|
49
|
-
},
|
|
50
|
-
/**
|
|
51
|
-
* Adds a `segment` to the `x-algolia-agent` sent with every requests.
|
|
52
|
-
*
|
|
53
|
-
* @param segment - The algolia agent (user-agent) segment to add.
|
|
54
|
-
* @param version - The version of the agent.
|
|
55
|
-
*/
|
|
56
|
-
addAlgoliaAgent(segment, version) {
|
|
57
|
-
transporter.algoliaAgent.add({ segment, version });
|
|
58
|
-
},
|
|
59
|
-
/**
|
|
60
|
-
* This method allow you to send requests to the Algolia REST API.
|
|
61
|
-
*
|
|
62
|
-
* @param customDelete - The customDelete object.
|
|
63
|
-
* @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
64
|
-
* @param customDelete.parameters - Query parameters to apply to the current query.
|
|
65
|
-
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
66
|
-
*/
|
|
67
|
-
customDelete({ path, parameters }, requestOptions) {
|
|
68
|
-
if (!path) {
|
|
69
|
-
throw new Error('Parameter `path` is required when calling `customDelete`.');
|
|
70
|
-
}
|
|
71
|
-
const requestPath = '/{path}'.replace('{path}', path);
|
|
72
|
-
const headers = {};
|
|
73
|
-
const queryParameters = parameters ? parameters : {};
|
|
74
|
-
const request = {
|
|
75
|
-
method: 'DELETE',
|
|
76
|
-
path: requestPath,
|
|
77
|
-
queryParameters,
|
|
78
|
-
headers,
|
|
79
|
-
};
|
|
80
|
-
return transporter.request(request, requestOptions);
|
|
81
|
-
},
|
|
82
|
-
/**
|
|
83
|
-
* This method allow you to send requests to the Algolia REST API.
|
|
84
|
-
*
|
|
85
|
-
* @param customGet - The customGet object.
|
|
86
|
-
* @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
87
|
-
* @param customGet.parameters - Query parameters to apply to the current query.
|
|
88
|
-
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
89
|
-
*/
|
|
90
|
-
customGet({ path, parameters }, requestOptions) {
|
|
91
|
-
if (!path) {
|
|
92
|
-
throw new Error('Parameter `path` is required when calling `customGet`.');
|
|
93
|
-
}
|
|
94
|
-
const requestPath = '/{path}'.replace('{path}', path);
|
|
95
|
-
const headers = {};
|
|
96
|
-
const queryParameters = parameters ? parameters : {};
|
|
97
|
-
const request = {
|
|
98
|
-
method: 'GET',
|
|
99
|
-
path: requestPath,
|
|
100
|
-
queryParameters,
|
|
101
|
-
headers,
|
|
102
|
-
};
|
|
103
|
-
return transporter.request(request, requestOptions);
|
|
104
|
-
},
|
|
105
|
-
/**
|
|
106
|
-
* This method allow you to send requests to the Algolia REST API.
|
|
107
|
-
*
|
|
108
|
-
* @param customPost - The customPost object.
|
|
109
|
-
* @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
110
|
-
* @param customPost.parameters - Query parameters to apply to the current query.
|
|
111
|
-
* @param customPost.body - Parameters to send with the custom request.
|
|
112
|
-
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
113
|
-
*/
|
|
114
|
-
customPost({ path, parameters, body }, requestOptions) {
|
|
115
|
-
if (!path) {
|
|
116
|
-
throw new Error('Parameter `path` is required when calling `customPost`.');
|
|
117
|
-
}
|
|
118
|
-
const requestPath = '/{path}'.replace('{path}', path);
|
|
119
|
-
const headers = {};
|
|
120
|
-
const queryParameters = parameters ? parameters : {};
|
|
121
|
-
const request = {
|
|
122
|
-
method: 'POST',
|
|
123
|
-
path: requestPath,
|
|
124
|
-
queryParameters,
|
|
125
|
-
headers,
|
|
126
|
-
data: body ? body : {},
|
|
127
|
-
};
|
|
128
|
-
return transporter.request(request, requestOptions);
|
|
129
|
-
},
|
|
130
|
-
/**
|
|
131
|
-
* This method allow you to send requests to the Algolia REST API.
|
|
132
|
-
*
|
|
133
|
-
* @param customPut - The customPut object.
|
|
134
|
-
* @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
135
|
-
* @param customPut.parameters - Query parameters to apply to the current query.
|
|
136
|
-
* @param customPut.body - Parameters to send with the custom request.
|
|
137
|
-
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
138
|
-
*/
|
|
139
|
-
customPut({ path, parameters, body }, requestOptions) {
|
|
140
|
-
if (!path) {
|
|
141
|
-
throw new Error('Parameter `path` is required when calling `customPut`.');
|
|
142
|
-
}
|
|
143
|
-
const requestPath = '/{path}'.replace('{path}', path);
|
|
144
|
-
const headers = {};
|
|
145
|
-
const queryParameters = parameters ? parameters : {};
|
|
146
|
-
const request = {
|
|
147
|
-
method: 'PUT',
|
|
148
|
-
path: requestPath,
|
|
149
|
-
queryParameters,
|
|
150
|
-
headers,
|
|
151
|
-
data: body ? body : {},
|
|
152
|
-
};
|
|
153
|
-
return transporter.request(request, requestOptions);
|
|
154
|
-
},
|
|
155
|
-
/**
|
|
156
|
-
* Deletes all events related to the specified user token from events metrics and analytics. The deletion is asynchronous, and processed within 48 hours. To delete a personalization user profile, see [Delete a user profile](/specs/personalization#tag/profiles/operation/deleteUserProfile).
|
|
157
|
-
*
|
|
158
|
-
* @param deleteUserToken - The deleteUserToken object.
|
|
159
|
-
* @param deleteUserToken.userToken - User token for which to delete all associated events.
|
|
160
|
-
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
161
|
-
*/
|
|
162
|
-
deleteUserToken({ userToken }, requestOptions) {
|
|
163
|
-
if (!userToken) {
|
|
164
|
-
throw new Error('Parameter `userToken` is required when calling `deleteUserToken`.');
|
|
165
|
-
}
|
|
166
|
-
const requestPath = '/1/usertokens/{userToken}'.replace('{userToken}', encodeURIComponent(userToken));
|
|
167
|
-
const headers = {};
|
|
168
|
-
const queryParameters = {};
|
|
169
|
-
const request = {
|
|
170
|
-
method: 'DELETE',
|
|
171
|
-
path: requestPath,
|
|
172
|
-
queryParameters,
|
|
173
|
-
headers,
|
|
174
|
-
};
|
|
175
|
-
return transporter.request(request, requestOptions);
|
|
176
|
-
},
|
|
177
|
-
/**
|
|
178
|
-
* Sends 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.
|
|
179
|
-
*
|
|
180
|
-
* @param insightsEvents - The insightsEvents object.
|
|
181
|
-
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
182
|
-
*/
|
|
183
|
-
pushEvents(insightsEvents, requestOptions) {
|
|
184
|
-
if (!insightsEvents) {
|
|
185
|
-
throw new Error('Parameter `insightsEvents` is required when calling `pushEvents`.');
|
|
186
|
-
}
|
|
187
|
-
if (!insightsEvents.events) {
|
|
188
|
-
throw new Error('Parameter `insightsEvents.events` is required when calling `pushEvents`.');
|
|
189
|
-
}
|
|
190
|
-
const requestPath = '/1/events';
|
|
191
|
-
const headers = {};
|
|
192
|
-
const queryParameters = {};
|
|
193
|
-
const request = {
|
|
194
|
-
method: 'POST',
|
|
195
|
-
path: requestPath,
|
|
196
|
-
queryParameters,
|
|
197
|
-
headers,
|
|
198
|
-
data: insightsEvents,
|
|
199
|
-
};
|
|
200
|
-
return transporter.request(request, requestOptions);
|
|
201
|
-
},
|
|
202
|
-
};
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
// 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.
|
|
206
|
-
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
207
|
-
function insightsClient(appId, apiKey, region, options) {
|
|
208
|
-
if (!appId || typeof appId !== 'string') {
|
|
209
|
-
throw new Error('`appId` is missing.');
|
|
210
|
-
}
|
|
211
|
-
if (!apiKey || typeof apiKey !== 'string') {
|
|
212
|
-
throw new Error('`apiKey` is missing.');
|
|
213
|
-
}
|
|
214
|
-
if (region && (typeof region !== 'string' || !REGIONS.includes(region))) {
|
|
215
|
-
throw new Error(`\`region\` must be one of the following: ${REGIONS.join(', ')}`);
|
|
216
|
-
}
|
|
217
|
-
return {
|
|
218
|
-
...createInsightsClient({
|
|
219
|
-
appId,
|
|
220
|
-
apiKey,
|
|
221
|
-
region,
|
|
222
|
-
timeouts: {
|
|
223
|
-
connect: DEFAULT_CONNECT_TIMEOUT_NODE,
|
|
224
|
-
read: DEFAULT_READ_TIMEOUT_NODE,
|
|
225
|
-
write: DEFAULT_WRITE_TIMEOUT_NODE,
|
|
226
|
-
},
|
|
227
|
-
requester: createHttpRequester(),
|
|
228
|
-
algoliaAgents: [{ segment: 'Node.js', version: process.versions.node }],
|
|
229
|
-
responsesCache: createNullCache(),
|
|
230
|
-
requestsCache: createNullCache(),
|
|
231
|
-
hostsCache: createMemoryCache(),
|
|
232
|
-
...options,
|
|
233
|
-
}),
|
|
234
|
-
};
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
export { apiClientVersion, insightsClient };
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! client-insights.umd.js | 5.2.3 | © Algolia, inc. | https://github.com/algolia/algoliasearch-client-javascript */
|
|
2
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["@algolia/client-insights"]={})}(this,(function(e){"use strict";function t(e){let t;const r=`algolia-client-js-${e.key}`;function s(){return void 0===t&&(t=e.localStorage||window.localStorage),t}function a(){return JSON.parse(s().getItem(r)||"{}")}function n(e){s().setItem(r,JSON.stringify(e))}return{get:(t,r,s={miss:()=>Promise.resolve()})=>Promise.resolve().then((()=>(function(){const t=e.timeToLive?1e3*e.timeToLive:null,r=a(),s=Object.fromEntries(Object.entries(r).filter((([,e])=>void 0!==e.timestamp)));if(n(s),!t)return;n(Object.fromEntries(Object.entries(s).filter((([,e])=>{const r=(new Date).getTime();return!(e.timestamp+t<r)}))))}(),a()[JSON.stringify(t)]))).then((e=>Promise.all([e?e.value:r(),void 0!==e]))).then((([e,t])=>Promise.all([e,t||s.miss(e)]))).then((([e])=>e)),set:(e,t)=>Promise.resolve().then((()=>{const n=a();return n[JSON.stringify(e)]={timestamp:(new Date).getTime(),value:t},s().setItem(r,JSON.stringify(n)),t})),delete:e=>Promise.resolve().then((()=>{const t=a();delete t[JSON.stringify(e)],s().setItem(r,JSON.stringify(t))})),clear:()=>Promise.resolve().then((()=>{s().removeItem(r)}))}}function r(e){const t=[...e.caches],s=t.shift();return void 0===s?{get:(e,t,r={miss:()=>Promise.resolve()})=>t().then((e=>Promise.all([e,r.miss(e)]))).then((([e])=>e)),set:(e,t)=>Promise.resolve(t),delete:e=>Promise.resolve(),clear:()=>Promise.resolve()}:{get:(e,a,n={miss:()=>Promise.resolve()})=>s.get(e,a,n).catch((()=>r({caches:t}).get(e,a,n))),set:(e,a)=>s.set(e,a).catch((()=>r({caches:t}).set(e,a))),delete:e=>s.delete(e).catch((()=>r({caches:t}).delete(e))),clear:()=>s.clear().catch((()=>r({caches:t}).clear()))}}function s(e={serializable:!0}){let t={};return{get(r,s,a={miss:()=>Promise.resolve()}){const n=JSON.stringify(r);if(n in t)return Promise.resolve(e.serializable?JSON.parse(t[n]):t[n]);const o=s();return o.then((e=>a.miss(e))).then((()=>o))},set:(r,s)=>(t[JSON.stringify(r)]=e.serializable?JSON.stringify(s):s,Promise.resolve(s)),delete:e=>(delete t[JSON.stringify(e)],Promise.resolve()),clear:()=>(t={},Promise.resolve())}}const a=12e4;function n(e,t="up"){const r=Date.now();return{...e,status:t,lastUpdate:r,isUp:function(){return"up"===t||Date.now()-r>a},isTimedOut:function(){return"timed out"===t&&Date.now()-r<=a}}}function o(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var s=r.call(e,t||"default");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class i extends Error{constructor(e,t){super(e),o(this,"name","AlgoliaError"),t&&(this.name=t)}}class u extends i{constructor(e,t,r){super(e,r),o(this,"stackTrace",void 0),this.stackTrace=t}}class c extends u{constructor(e){super("Unreachable hosts - your application id may be incorrect. If the error persists, please reach out to the Algolia Support team: https://alg.li/support.",e,"RetryError")}}class l extends u{constructor(e,t,r,s="ApiError"){super(e,r,s),o(this,"status",void 0),this.status=t}}class h extends i{constructor(e,t){super(e,"DeserializationError"),o(this,"response",void 0),this.response=t}}class m extends l{constructor(e,t,r,s){super(e,t,s,"DetailedApiError"),o(this,"error",void 0),this.error=r}}function d(e,t,r){const s=(a=r,Object.keys(a).filter((e=>void 0!==a[e])).sort().map((e=>`${e}=${encodeURIComponent("[object Array]"===Object.prototype.toString.call(a[e])?a[e].join(","):a[e]).replaceAll("+","%20")}`)).join("&"));var a;let n=`${e.protocol}://${e.url}${e.port?`:${e.port}`:""}/${"/"===t.charAt(0)?t.substring(1):t}`;return s.length&&(n+=`?${s}`),n}function p(e){const t=e.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return{...e,request:{...e.request,headers:{...e.request.headers,...t}}}}function g({hosts:e,hostsCache:t,baseHeaders:r,baseQueryParameters:s,algoliaAgent:a,timeouts:o,requester:i,requestsCache:u,responsesCache:g}){async function f(u,g,f=!0){const y=[],v=function(e,t){if("GET"===e.method||void 0===e.data&&void 0===t.data)return;const r=Array.isArray(e.data)?e.data:{...e.data,...t.data};return JSON.stringify(r)}(u,g),P=function(e,t,r){const s={Accept:"application/json",...e,...t,...r},a={};return Object.keys(s).forEach((e=>{const t=s[e];a[e.toLowerCase()]=t})),a}(r,u.headers,g.headers),w="GET"===u.method?{...u.data,...g.data}:{},T={...s,...u.queryParameters,...w};if(a.value&&(T["x-algolia-agent"]=a.value),g&&g.queryParameters)for(const e of Object.keys(g.queryParameters))g.queryParameters[e]&&"[object Object]"!==Object.prototype.toString.call(g.queryParameters[e])?T[e]=g.queryParameters[e].toString():T[e]=g.queryParameters[e];let b=0;const q=async(e,r)=>{const s=e.pop();if(void 0===s)throw new c(function(e){return e.map((e=>p(e)))}(y));const a={...o,...g.timeouts},w={data:v,headers:P,method:u.method,url:d(s,u.path,T),connectTimeout:r(b,a.connect),responseTimeout:r(b,f?a.read:a.write)},O=t=>{const r={request:w,response:t,host:s,triesLeft:e.length};return y.push(r),r},E=await i.send(w);if(function({isTimedOut:e,status:t}){return e||function({isTimedOut:e,status:t}){return!e&&!~~t}({isTimedOut:e,status:t})||2!=~~(t/100)&&4!=~~(t/100)}(E)){const a=O(E);return E.isTimedOut&&b++,console.log("Retryable failure",p(a)),await t.set(s,n(s,E.isTimedOut?"timed out":"down")),q(e,r)}if(function({status:e}){return 2==~~(e/100)}(E))return function(e){try{return JSON.parse(e.content)}catch(t){throw new h(t.message,e)}}(E);throw O(E),function({content:e,status:t},r){try{const s=JSON.parse(e);return"error"in s?new m(s.message,t,s.error,r):new l(s.message,t,r)}catch{}return new l(e,t,r)}(E,y)},O=e.filter((e=>"readWrite"===e.accept||(f?"read"===e.accept:"write"===e.accept))),E=await async function(e){const r=await Promise.all(e.map((e=>t.get(e,(()=>Promise.resolve(n(e))))))),s=r.filter((e=>e.isUp())),a=r.filter((e=>e.isTimedOut())),o=[...s,...a];return{hosts:o.length>0?o:e,getTimeout:(e,t)=>(0===a.length&&0===e?1:a.length+3+e)*t}}(O);return q([...E.hosts].reverse(),E.getTimeout)}return{hostsCache:t,requester:i,timeouts:o,algoliaAgent:a,baseHeaders:r,baseQueryParameters:s,hosts:e,request:function(e,t={}){const a=e.useReadTransporter||"GET"===e.method;if(!a)return f(e,t,a);const n=()=>f(e,t);if(!0!==(t.cacheable||e.cacheable))return n();const o={request:e,requestOptions:t,transporter:{queryParameters:s,headers:r}};return g.get(o,(()=>u.get(o,(()=>u.set(o,n()).then((e=>Promise.all([u.delete(o),e])),(e=>Promise.all([u.delete(o),Promise.reject(e)]))).then((([e,t])=>t))))),{miss:e=>g.set(o,e)})},requestsCache:u,responsesCache:g}}function f({algoliaAgents:e,client:t,version:r}){const s=function(e){const t={value:`Algolia for JavaScript (${e})`,add(e){const r=`; ${e.segment}${void 0!==e.version?` (${e.version})`:""}`;return-1===t.value.indexOf(r)&&(t.value=`${t.value}${r}`),t}};return t}(r).add({segment:t,version:r});return e.forEach((e=>s.add(e))),s}const y="5.2.3",v=["de","us"];e.apiClientVersion=y,e.insightsClient=function(e,a,n,o){if(!e||"string"!=typeof e)throw new Error("`appId` is missing.");if(!a||"string"!=typeof a)throw new Error("`apiKey` is missing.");if(n&&("string"!=typeof n||!v.includes(n)))throw new Error(`\`region\` must be one of the following: ${v.join(", ")}`);return function({appId:e,apiKey:t,authMode:r,algoliaAgents:s,region:a,...n}){const o=function(e,t,r="WithinHeaders"){const s={"x-algolia-api-key":t,"x-algolia-application-id":e};return{headers:()=>"WithinHeaders"===r?s:{},queryParameters:()=>"WithinQueryParameters"===r?s:{}}}(e,t,r),i=g({hosts:(u=a,[{url:u?"insights.{region}.algolia.io".replace("{region}",u):"insights.algolia.io",accept:"readWrite",protocol:"https"}]),...n,algoliaAgent:f({algoliaAgents:s,client:"Insights",version:y}),baseHeaders:{"content-type":"text/plain",...o.headers(),...n.baseHeaders},baseQueryParameters:{...o.queryParameters(),...n.baseQueryParameters}});var u;return{transporter:i,appId:e,clearCache:()=>Promise.all([i.requestsCache.clear(),i.responsesCache.clear()]).then((()=>{})),get _ua(){return i.algoliaAgent.value},addAlgoliaAgent(e,t){i.algoliaAgent.add({segment:e,version:t})},customDelete({path:e,parameters:t},r){if(!e)throw new Error("Parameter `path` is required when calling `customDelete`.");const s={method:"DELETE",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{}};return i.request(s,r)},customGet({path:e,parameters:t},r){if(!e)throw new Error("Parameter `path` is required when calling `customGet`.");const s={method:"GET",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{}};return i.request(s,r)},customPost({path:e,parameters:t,body:r},s){if(!e)throw new Error("Parameter `path` is required when calling `customPost`.");const a={method:"POST",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:r||{}};return i.request(a,s)},customPut({path:e,parameters:t,body:r},s){if(!e)throw new Error("Parameter `path` is required when calling `customPut`.");const a={method:"PUT",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:r||{}};return i.request(a,s)},deleteUserToken({userToken:e},t){if(!e)throw new Error("Parameter `userToken` is required when calling `deleteUserToken`.");const r={method:"DELETE",path:"/1/usertokens/{userToken}".replace("{userToken}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(r,t)},pushEvents(e,t){if(!e)throw new Error("Parameter `insightsEvents` is required when calling `pushEvents`.");if(!e.events)throw new Error("Parameter `insightsEvents.events` is required when calling `pushEvents`.");const r={method:"POST",path:"/1/events",queryParameters:{},headers:{},data:e};return i.request(r,t)}}}({appId:e,apiKey:a,region:n,timeouts:{connect:1e3,read:2e3,write:3e4},requester:{send:function(e){return new Promise((t=>{const r=new XMLHttpRequest;r.open(e.method,e.url,!0),Object.keys(e.headers).forEach((t=>r.setRequestHeader(t,e.headers[t])));const s=(e,s)=>setTimeout((()=>{r.abort(),t({status:0,content:s,isTimedOut:!0})}),e),a=s(e.connectTimeout,"Connection timeout");let n;r.onreadystatechange=()=>{r.readyState>r.OPENED&&void 0===n&&(clearTimeout(a),n=s(e.responseTimeout,"Socket timeout"))},r.onerror=()=>{0===r.status&&(clearTimeout(a),clearTimeout(n),t({content:r.responseText||"Network request failed",status:r.status,isTimedOut:!1}))},r.onload=()=>{clearTimeout(a),clearTimeout(n),t({content:r.responseText,status:r.status,isTimedOut:!1})},r.send(e.data)}))}},algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:s(),requestsCache:s({serializable:!1}),hostsCache:r({caches:[t({key:`${y}-${e}`}),s()]}),...o})}}));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"addToCartEvent.d.ts","sourceRoot":"","sources":["../../model/addToCartEvent.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,cAAc,GAAG,WAAW,CAAC"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import type { AddToCartEvent } from './addToCartEvent';
|
|
2
|
-
import type { ConversionEvent } from './conversionEvent';
|
|
3
|
-
import type { ObjectData } from './objectData';
|
|
4
|
-
import type { Value } from './value';
|
|
5
|
-
/**
|
|
6
|
-
* 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.
|
|
7
|
-
*/
|
|
8
|
-
export type AddedToCartObjectIDs = {
|
|
9
|
-
/**
|
|
10
|
-
* Event name, up to 64 ASCII characters. Consider naming events consistently—for example, by adopting Segment\'s [object-action](https://segment.com/academy/collecting-data/naming-conventions-for-clean-data/#the-object-action-framework) framework.
|
|
11
|
-
*/
|
|
12
|
-
eventName: string;
|
|
13
|
-
eventType: ConversionEvent;
|
|
14
|
-
eventSubtype: AddToCartEvent;
|
|
15
|
-
/**
|
|
16
|
-
* Index name (case-sensitive) to which the event\'s items belong.
|
|
17
|
-
*/
|
|
18
|
-
index: string;
|
|
19
|
-
/**
|
|
20
|
-
* Object IDs of the records that are part of the event.
|
|
21
|
-
*/
|
|
22
|
-
objectIDs: string[];
|
|
23
|
-
/**
|
|
24
|
-
* Anonymous or pseudonymous user identifier. Don\'t use personally identifiable information in user tokens. For more information, see [User token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken/).
|
|
25
|
-
*/
|
|
26
|
-
userToken: string;
|
|
27
|
-
/**
|
|
28
|
-
* Identifier for authenticated users. When the user signs in, you can get an identifier from your system and send it as `authenticatedUserToken`. This lets you keep using the `userToken` from before the user signed in, while providing a reliable way to identify users across sessions. Don\'t use personally identifiable information in user tokens. For more information, see [User token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken/).
|
|
29
|
-
*/
|
|
30
|
-
authenticatedUserToken?: string;
|
|
31
|
-
/**
|
|
32
|
-
* Three-letter [currency code](https://www.iso.org/iso-4217-currency-codes.html).
|
|
33
|
-
*/
|
|
34
|
-
currency?: string;
|
|
35
|
-
/**
|
|
36
|
-
* Extra information about the records involved in a purchase or add-to-cart event. If specified, it must have the same length as `objectIDs`.
|
|
37
|
-
*/
|
|
38
|
-
objectData?: ObjectData[];
|
|
39
|
-
/**
|
|
40
|
-
* Timestamp of the event, measured in milliseconds since the Unix epoch. By default, the Insights API uses the time it receives an event as its timestamp.
|
|
41
|
-
*/
|
|
42
|
-
timestamp?: number;
|
|
43
|
-
value?: Value;
|
|
44
|
-
};
|
|
45
|
-
//# sourceMappingURL=addedToCartObjectIDs.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"addedToCartObjectIDs.d.ts","sourceRoot":"","sources":["../../model/addedToCartObjectIDs.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAErC;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB,SAAS,EAAE,eAAe,CAAC;IAE3B,YAAY,EAAE,cAAc,CAAC;IAE7B;;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,49 +0,0 @@
|
|
|
1
|
-
import type { AddToCartEvent } from './addToCartEvent';
|
|
2
|
-
import type { ConversionEvent } from './conversionEvent';
|
|
3
|
-
import type { ObjectDataAfterSearch } from './objectDataAfterSearch';
|
|
4
|
-
import type { Value } from './value';
|
|
5
|
-
/**
|
|
6
|
-
* 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.
|
|
7
|
-
*/
|
|
8
|
-
export type AddedToCartObjectIDsAfterSearch = {
|
|
9
|
-
/**
|
|
10
|
-
* Event name, up to 64 ASCII characters. Consider naming events consistently—for example, by adopting Segment\'s [object-action](https://segment.com/academy/collecting-data/naming-conventions-for-clean-data/#the-object-action-framework) framework.
|
|
11
|
-
*/
|
|
12
|
-
eventName: string;
|
|
13
|
-
eventType: ConversionEvent;
|
|
14
|
-
eventSubtype: AddToCartEvent;
|
|
15
|
-
/**
|
|
16
|
-
* Index name (case-sensitive) to which the event\'s items belong.
|
|
17
|
-
*/
|
|
18
|
-
index: string;
|
|
19
|
-
/**
|
|
20
|
-
* 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.
|
|
21
|
-
*/
|
|
22
|
-
queryID: string;
|
|
23
|
-
/**
|
|
24
|
-
* Object IDs of the records that are part of the event.
|
|
25
|
-
*/
|
|
26
|
-
objectIDs: string[];
|
|
27
|
-
/**
|
|
28
|
-
* Anonymous or pseudonymous user identifier. Don\'t use personally identifiable information in user tokens. For more information, see [User token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken/).
|
|
29
|
-
*/
|
|
30
|
-
userToken: string;
|
|
31
|
-
/**
|
|
32
|
-
* Identifier for authenticated users. When the user signs in, you can get an identifier from your system and send it as `authenticatedUserToken`. This lets you keep using the `userToken` from before the user signed in, while providing a reliable way to identify users across sessions. Don\'t use personally identifiable information in user tokens. For more information, see [User token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken/).
|
|
33
|
-
*/
|
|
34
|
-
authenticatedUserToken?: string;
|
|
35
|
-
/**
|
|
36
|
-
* Three-letter [currency code](https://www.iso.org/iso-4217-currency-codes.html).
|
|
37
|
-
*/
|
|
38
|
-
currency?: string;
|
|
39
|
-
/**
|
|
40
|
-
* Extra information about the records involved in a purchase or add-to-cart events. If provided, it must be the same length as `objectIDs`.
|
|
41
|
-
*/
|
|
42
|
-
objectData?: ObjectDataAfterSearch[];
|
|
43
|
-
/**
|
|
44
|
-
* Timestamp of the event, measured in milliseconds since the Unix epoch. By default, the Insights API uses the time it receives an event as its timestamp.
|
|
45
|
-
*/
|
|
46
|
-
timestamp?: number;
|
|
47
|
-
value?: Value;
|
|
48
|
-
};
|
|
49
|
-
//# sourceMappingURL=addedToCartObjectIDsAfterSearch.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"addedToCartObjectIDsAfterSearch.d.ts","sourceRoot":"","sources":["../../model/addedToCartObjectIDsAfterSearch.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAErC;;GAEG;AACH,MAAM,MAAM,+BAA+B,GAAG;IAC5C;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB,SAAS,EAAE,eAAe,CAAC;IAE3B,YAAY,EAAE,cAAc,CAAC;IAE7B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"clickEvent.d.ts","sourceRoot":"","sources":["../../model/clickEvent.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,UAAU,GAAG,OAAO,CAAC"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import type { ClickEvent } from './clickEvent';
|
|
2
|
-
/**
|
|
3
|
-
* Use this event to track when users click facet filters in your user interface.
|
|
4
|
-
*/
|
|
5
|
-
export type ClickedFilters = {
|
|
6
|
-
/**
|
|
7
|
-
* Event name, 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: ClickEvent;
|
|
11
|
-
/**
|
|
12
|
-
* Index name (case-sensitive) to which the event\'s items belong.
|
|
13
|
-
*/
|
|
14
|
-
index: string;
|
|
15
|
-
/**
|
|
16
|
-
* Applied facet filters. Facet filters are `facet:value` pairs. Facet values must be URL-encoded, such as, `discount:10%25`.
|
|
17
|
-
*/
|
|
18
|
-
filters: string[];
|
|
19
|
-
/**
|
|
20
|
-
* Anonymous or pseudonymous user identifier. Don\'t use personally identifiable information in user tokens. For more information, see [User token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken/).
|
|
21
|
-
*/
|
|
22
|
-
userToken: string;
|
|
23
|
-
/**
|
|
24
|
-
* Identifier for authenticated users. When the user signs in, you can get an identifier from your system and send it as `authenticatedUserToken`. This lets you keep using the `userToken` from before the user signed in, while providing a reliable way to identify users across sessions. Don\'t use personally identifiable information in user tokens. For more information, see [User token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken/).
|
|
25
|
-
*/
|
|
26
|
-
authenticatedUserToken?: string;
|
|
27
|
-
/**
|
|
28
|
-
* Timestamp of the event, measured in milliseconds since the Unix epoch. By default, the Insights API uses the time it receives an event as its timestamp.
|
|
29
|
-
*/
|
|
30
|
-
timestamp?: number;
|
|
31
|
-
};
|
|
32
|
-
//# sourceMappingURL=clickedFilters.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"clickedFilters.d.ts","sourceRoot":"","sources":["../../model/clickedFilters.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB,SAAS,EAAE,UAAU,CAAC;IAEtB;;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"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import type { ClickEvent } from './clickEvent';
|
|
2
|
-
/**
|
|
3
|
-
* 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.
|
|
4
|
-
*/
|
|
5
|
-
export type ClickedObjectIDs = {
|
|
6
|
-
/**
|
|
7
|
-
* Event name, 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: ClickEvent;
|
|
11
|
-
/**
|
|
12
|
-
* Index name (case-sensitive) to which the event\'s items belong.
|
|
13
|
-
*/
|
|
14
|
-
index: string;
|
|
15
|
-
/**
|
|
16
|
-
* Object IDs of the records that are part of the event.
|
|
17
|
-
*/
|
|
18
|
-
objectIDs: string[];
|
|
19
|
-
/**
|
|
20
|
-
* Anonymous or pseudonymous user identifier. Don\'t use personally identifiable information in user tokens. For more information, see [User token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken/).
|
|
21
|
-
*/
|
|
22
|
-
userToken: string;
|
|
23
|
-
/**
|
|
24
|
-
* Identifier for authenticated users. When the user signs in, you can get an identifier from your system and send it as `authenticatedUserToken`. This lets you keep using the `userToken` from before the user signed in, while providing a reliable way to identify users across sessions. Don\'t use personally identifiable information in user tokens. For more information, see [User token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken/).
|
|
25
|
-
*/
|
|
26
|
-
authenticatedUserToken?: string;
|
|
27
|
-
/**
|
|
28
|
-
* Timestamp of the event, measured in milliseconds since the Unix epoch. By default, the Insights API uses the time it receives an event as its timestamp.
|
|
29
|
-
*/
|
|
30
|
-
timestamp?: number;
|
|
31
|
-
};
|
|
32
|
-
//# sourceMappingURL=clickedObjectIDs.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"clickedObjectIDs.d.ts","sourceRoot":"","sources":["../../model/clickedObjectIDs.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB,SAAS,EAAE,UAAU,CAAC;IAEtB;;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,40 +0,0 @@
|
|
|
1
|
-
import type { ClickEvent } from './clickEvent';
|
|
2
|
-
/**
|
|
3
|
-
* 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.
|
|
4
|
-
*/
|
|
5
|
-
export type ClickedObjectIDsAfterSearch = {
|
|
6
|
-
/**
|
|
7
|
-
* Event name, 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: ClickEvent;
|
|
11
|
-
/**
|
|
12
|
-
* Index name (case-sensitive) to which the event\'s items belong.
|
|
13
|
-
*/
|
|
14
|
-
index: string;
|
|
15
|
-
/**
|
|
16
|
-
* Object IDs of the records that are part of the event.
|
|
17
|
-
*/
|
|
18
|
-
objectIDs: string[];
|
|
19
|
-
/**
|
|
20
|
-
* Position of the clicked item the search results. You must provide 1 `position` for each `objectID`.
|
|
21
|
-
*/
|
|
22
|
-
positions: number[];
|
|
23
|
-
/**
|
|
24
|
-
* 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.
|
|
25
|
-
*/
|
|
26
|
-
queryID: string;
|
|
27
|
-
/**
|
|
28
|
-
* Anonymous or pseudonymous user identifier. Don\'t use personally identifiable information in user tokens. For more information, see [User token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken/).
|
|
29
|
-
*/
|
|
30
|
-
userToken: string;
|
|
31
|
-
/**
|
|
32
|
-
* Identifier for authenticated users. When the user signs in, you can get an identifier from your system and send it as `authenticatedUserToken`. This lets you keep using the `userToken` from before the user signed in, while providing a reliable way to identify users across sessions. Don\'t use personally identifiable information in user tokens. For more information, see [User token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken/).
|
|
33
|
-
*/
|
|
34
|
-
authenticatedUserToken?: string;
|
|
35
|
-
/**
|
|
36
|
-
* Timestamp of the event, measured in milliseconds since the Unix epoch. By default, the Insights API uses the time it receives an event as its timestamp.
|
|
37
|
-
*/
|
|
38
|
-
timestamp?: number;
|
|
39
|
-
};
|
|
40
|
-
//# sourceMappingURL=clickedObjectIDsAfterSearch.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"clickedObjectIDsAfterSearch.d.ts","sourceRoot":"","sources":["../../model/clickedObjectIDsAfterSearch.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C;;GAEG;AACH,MAAM,MAAM,2BAA2B,GAAG;IACxC;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB,SAAS,EAAE,UAAU,CAAC;IAEtB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,SAAS,EAAE,MAAM,EAAE,CAAC;IAEpB;;OAEG;IACH,SAAS,EAAE,MAAM,EAAE,CAAC;IAEpB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;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,70 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Properties for the `customDelete` method.
|
|
3
|
-
*/
|
|
4
|
-
export type CustomDeleteProps = {
|
|
5
|
-
/**
|
|
6
|
-
* Path of the endpoint, anything after \"/1\" must be specified.
|
|
7
|
-
*/
|
|
8
|
-
path: string;
|
|
9
|
-
/**
|
|
10
|
-
* Query parameters to apply to the current query.
|
|
11
|
-
*/
|
|
12
|
-
parameters?: Record<string, any>;
|
|
13
|
-
};
|
|
14
|
-
/**
|
|
15
|
-
* Properties for the `customGet` method.
|
|
16
|
-
*/
|
|
17
|
-
export type CustomGetProps = {
|
|
18
|
-
/**
|
|
19
|
-
* Path of the endpoint, anything after \"/1\" must be specified.
|
|
20
|
-
*/
|
|
21
|
-
path: string;
|
|
22
|
-
/**
|
|
23
|
-
* Query parameters to apply to the current query.
|
|
24
|
-
*/
|
|
25
|
-
parameters?: Record<string, any>;
|
|
26
|
-
};
|
|
27
|
-
/**
|
|
28
|
-
* Properties for the `customPost` method.
|
|
29
|
-
*/
|
|
30
|
-
export type CustomPostProps = {
|
|
31
|
-
/**
|
|
32
|
-
* Path of the endpoint, anything after \"/1\" must be specified.
|
|
33
|
-
*/
|
|
34
|
-
path: string;
|
|
35
|
-
/**
|
|
36
|
-
* Query parameters to apply to the current query.
|
|
37
|
-
*/
|
|
38
|
-
parameters?: Record<string, any>;
|
|
39
|
-
/**
|
|
40
|
-
* Parameters to send with the custom request.
|
|
41
|
-
*/
|
|
42
|
-
body?: Record<string, unknown>;
|
|
43
|
-
};
|
|
44
|
-
/**
|
|
45
|
-
* Properties for the `customPut` method.
|
|
46
|
-
*/
|
|
47
|
-
export type CustomPutProps = {
|
|
48
|
-
/**
|
|
49
|
-
* Path of the endpoint, anything after \"/1\" must be specified.
|
|
50
|
-
*/
|
|
51
|
-
path: string;
|
|
52
|
-
/**
|
|
53
|
-
* Query parameters to apply to the current query.
|
|
54
|
-
*/
|
|
55
|
-
parameters?: Record<string, any>;
|
|
56
|
-
/**
|
|
57
|
-
* Parameters to send with the custom request.
|
|
58
|
-
*/
|
|
59
|
-
body?: Record<string, unknown>;
|
|
60
|
-
};
|
|
61
|
-
/**
|
|
62
|
-
* Properties for the `deleteUserToken` method.
|
|
63
|
-
*/
|
|
64
|
-
export type DeleteUserTokenProps = {
|
|
65
|
-
/**
|
|
66
|
-
* User token for which to delete all associated events.
|
|
67
|
-
*/
|
|
68
|
-
userToken: string;
|
|
69
|
-
};
|
|
70
|
-
//# sourceMappingURL=clientMethodProps.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"clientMethodProps.d.ts","sourceRoot":"","sources":["../../model/clientMethodProps.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAClC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAClC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACjC;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACjC;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"conversionEvent.d.ts","sourceRoot":"","sources":["../../model/conversionEvent.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,eAAe,GAAG,YAAY,CAAC"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { ConversionEvent } from './conversionEvent';
|
|
2
|
-
export type ConvertedFilters = {
|
|
3
|
-
/**
|
|
4
|
-
* Event name, 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.
|
|
5
|
-
*/
|
|
6
|
-
eventName: string;
|
|
7
|
-
eventType: ConversionEvent;
|
|
8
|
-
/**
|
|
9
|
-
* Index name (case-sensitive) to which the event\'s items belong.
|
|
10
|
-
*/
|
|
11
|
-
index: string;
|
|
12
|
-
/**
|
|
13
|
-
* Applied facet filters. Facet filters are `facet:value` pairs. Facet values must be URL-encoded, such as, `discount:10%25`.
|
|
14
|
-
*/
|
|
15
|
-
filters: string[];
|
|
16
|
-
/**
|
|
17
|
-
* Anonymous or pseudonymous user identifier. Don\'t use personally identifiable information in user tokens. For more information, see [User token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken/).
|
|
18
|
-
*/
|
|
19
|
-
userToken: string;
|
|
20
|
-
/**
|
|
21
|
-
* Identifier for authenticated users. When the user signs in, you can get an identifier from your system and send it as `authenticatedUserToken`. This lets you keep using the `userToken` from before the user signed in, while providing a reliable way to identify users across sessions. Don\'t use personally identifiable information in user tokens. For more information, see [User token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken/).
|
|
22
|
-
*/
|
|
23
|
-
authenticatedUserToken?: string;
|
|
24
|
-
/**
|
|
25
|
-
* Timestamp of the event, measured in milliseconds since the Unix epoch. By default, the Insights API uses the time it receives an event as its timestamp.
|
|
26
|
-
*/
|
|
27
|
-
timestamp?: number;
|
|
28
|
-
};
|
|
29
|
-
//# sourceMappingURL=convertedFilters.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"convertedFilters.d.ts","sourceRoot":"","sources":["../../model/convertedFilters.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEzD,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB,SAAS,EAAE,eAAe,CAAC;IAE3B;;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"}
|