@algolia/client-insights 5.0.0-alpha.9 → 5.0.0-alpha.90
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/builds/browser.d.ts +5 -5
- package/dist/builds/browser.d.ts.map +1 -1
- package/dist/builds/node.d.ts +5 -5
- package/dist/builds/node.d.ts.map +1 -1
- package/dist/{client-insights.cjs.js → client-insights.cjs} +214 -216
- package/dist/client-insights.esm.browser.js +396 -446
- package/dist/client-insights.esm.node.js +214 -214
- package/dist/client-insights.umd.js +2 -2
- package/dist/model/addToCartEvent.d.ts +2 -0
- package/dist/model/addToCartEvent.d.ts.map +1 -0
- package/dist/model/addedToCartObjectIDs.d.ts +43 -0
- package/dist/model/addedToCartObjectIDs.d.ts.map +1 -0
- package/dist/model/addedToCartObjectIDsAfterSearch.d.ts +47 -0
- package/dist/model/addedToCartObjectIDsAfterSearch.d.ts.map +1 -0
- package/dist/model/clickEvent.d.ts +2 -0
- package/dist/model/clickEvent.d.ts.map +1 -0
- package/dist/model/clickedFilters.d.ts +32 -0
- package/dist/model/clickedFilters.d.ts.map +1 -0
- package/dist/model/clickedObjectIDs.d.ts +28 -0
- package/dist/model/clickedObjectIDs.d.ts.map +1 -0
- package/dist/model/clickedObjectIDsAfterSearch.d.ts +40 -0
- package/dist/model/clickedObjectIDsAfterSearch.d.ts.map +1 -0
- package/dist/model/clientMethodProps.d.ts +60 -60
- package/dist/model/clientMethodProps.d.ts.map +1 -1
- package/dist/model/conversionEvent.d.ts +2 -0
- package/dist/model/conversionEvent.d.ts.map +1 -0
- package/dist/model/convertedFilters.d.ts +29 -0
- package/dist/model/convertedFilters.d.ts.map +1 -0
- package/dist/model/convertedObjectIDs.d.ts +32 -0
- package/dist/model/convertedObjectIDs.d.ts.map +1 -0
- package/dist/model/convertedObjectIDsAfterSearch.d.ts +36 -0
- package/dist/model/convertedObjectIDsAfterSearch.d.ts.map +1 -0
- package/dist/model/discount.d.ts +5 -0
- package/dist/model/discount.d.ts.map +1 -0
- package/dist/model/errorBase.d.ts +6 -6
- package/dist/model/errorBase.d.ts.map +1 -1
- package/dist/model/eventsItems.d.ts +14 -0
- package/dist/model/eventsItems.d.ts.map +1 -0
- package/dist/model/eventsResponse.d.ts +14 -0
- package/dist/model/eventsResponse.d.ts.map +1 -0
- package/dist/model/index.d.ts +26 -6
- package/dist/model/index.d.ts.map +1 -1
- package/dist/model/insightsEvents.d.ts +8 -0
- package/dist/model/insightsEvents.d.ts.map +1 -0
- package/dist/model/objectData.d.ts +11 -0
- package/dist/model/objectData.d.ts.map +1 -0
- package/dist/model/objectDataAfterSearch.d.ts +15 -0
- package/dist/model/objectDataAfterSearch.d.ts.map +1 -0
- package/dist/model/price.d.ts +5 -0
- package/dist/model/price.d.ts.map +1 -0
- package/dist/model/purchaseEvent.d.ts +2 -0
- package/dist/model/purchaseEvent.d.ts.map +1 -0
- package/dist/model/purchasedObjectIDs.d.ts +43 -0
- package/dist/model/purchasedObjectIDs.d.ts.map +1 -0
- package/dist/model/purchasedObjectIDsAfterSearch.d.ts +47 -0
- package/dist/model/purchasedObjectIDsAfterSearch.d.ts.map +1 -0
- package/dist/model/viewEvent.d.ts +2 -0
- package/dist/model/viewEvent.d.ts.map +1 -0
- package/dist/model/viewedFilters.d.ts +32 -0
- package/dist/model/viewedFilters.d.ts.map +1 -0
- package/dist/model/viewedObjectIDs.d.ts +32 -0
- package/dist/model/viewedObjectIDs.d.ts.map +1 -0
- package/dist/src/insightsClient.d.ts +85 -85
- package/dist/src/insightsClient.d.ts.map +1 -1
- package/index.js +1 -1
- package/model/addToCartEvent.ts +3 -0
- package/model/addedToCartObjectIDs.ts +54 -0
- package/model/addedToCartObjectIDsAfterSearch.ts +59 -0
- package/model/clickEvent.ts +3 -0
- package/model/clickedFilters.ts +40 -0
- package/model/clickedObjectIDs.ts +35 -0
- package/model/clickedObjectIDsAfterSearch.ts +50 -0
- package/model/clientMethodProps.ts +11 -11
- package/model/conversionEvent.ts +3 -0
- package/model/convertedFilters.ts +37 -0
- package/model/convertedObjectIDs.ts +40 -0
- package/model/convertedObjectIDsAfterSearch.ts +45 -0
- package/model/discount.ts +6 -0
- package/model/errorBase.ts +1 -1
- package/model/eventsItems.ts +28 -0
- package/model/eventsResponse.ts +16 -0
- package/model/index.ts +25 -5
- package/model/insightsEvents.ts +10 -0
- package/model/objectData.ts +15 -0
- package/model/objectDataAfterSearch.ts +20 -0
- package/model/price.ts +6 -0
- package/model/purchaseEvent.ts +3 -0
- package/model/purchasedObjectIDs.ts +54 -0
- package/model/purchasedObjectIDsAfterSearch.ts +59 -0
- package/model/viewEvent.ts +3 -0
- package/model/viewedFilters.ts +40 -0
- package/model/viewedObjectIDs.ts +40 -0
- package/package.json +30 -13
- package/dist/model/eventType.d.ts +0 -2
- package/dist/model/eventType.d.ts.map +0 -1
- package/dist/model/insightEvent.d.ts +0 -40
- package/dist/model/insightEvent.d.ts.map +0 -1
- package/dist/model/insightEvents.d.ts +0 -11
- package/dist/model/insightEvents.d.ts.map +0 -1
- package/dist/model/pushEventsResponse.d.ts +0 -7
- package/dist/model/pushEventsResponse.d.ts.map +0 -1
- package/model/eventType.ts +0 -3
- package/model/insightEvent.ts +0 -50
- package/model/insightEvents.ts +0 -13
- package/model/pushEventsResponse.ts +0 -8
package/dist/builds/browser.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ClientOptions } from '@algolia/client-common';
|
|
2
|
-
import type { InsightsClient, Region } from '../src/insightsClient';
|
|
3
|
-
export { apiClientVersion, InsightsClient } from '../src/insightsClient';
|
|
4
|
-
export * from '../model';
|
|
5
|
-
export declare function insightsClient(appId: string, apiKey: string, region?: Region, options?: ClientOptions): InsightsClient;
|
|
1
|
+
import type { ClientOptions } from '@algolia/client-common';
|
|
2
|
+
import type { InsightsClient, Region } from '../src/insightsClient';
|
|
3
|
+
export { apiClientVersion, InsightsClient, Region, } from '../src/insightsClient';
|
|
4
|
+
export * from '../model';
|
|
5
|
+
export declare function insightsClient(appId: string, apiKey: string, region?: Region, options?: ClientOptions): InsightsClient;
|
|
6
6
|
//# sourceMappingURL=browser.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../builds/browser.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAW5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAOpE,OAAO,
|
|
1
|
+
{"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../builds/browser.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAW5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAOpE,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,MAAM,GACP,MAAM,uBAAuB,CAAC;AAC/B,cAAc,UAAU,CAAC;AAEzB,wBAAgB,cAAc,CAC5B,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,MAAM,CAAC,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,aAAa,GACtB,cAAc,CAqChB"}
|
package/dist/builds/node.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ClientOptions } from '@algolia/client-common';
|
|
2
|
-
import type { InsightsClient, Region } from '../src/insightsClient';
|
|
3
|
-
export { apiClientVersion, InsightsClient } from '../src/insightsClient';
|
|
4
|
-
export * from '../model';
|
|
5
|
-
export declare function insightsClient(appId: string, apiKey: string, region?: Region, options?: ClientOptions): InsightsClient;
|
|
1
|
+
import type { ClientOptions } from '@algolia/client-common';
|
|
2
|
+
import type { InsightsClient, Region } from '../src/insightsClient';
|
|
3
|
+
export { apiClientVersion, InsightsClient, Region, } from '../src/insightsClient';
|
|
4
|
+
export * from '../model';
|
|
5
|
+
export declare function insightsClient(appId: string, apiKey: string, region?: Region, options?: ClientOptions): InsightsClient;
|
|
6
6
|
//# sourceMappingURL=node.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../builds/node.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAU5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAGpE,OAAO,
|
|
1
|
+
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../builds/node.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAU5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAGpE,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,MAAM,GACP,MAAM,uBAAuB,CAAC;AAC/B,cAAc,UAAU,CAAC;AAEzB,wBAAgB,cAAc,CAC5B,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,MAAM,CAAC,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,aAAa,GACtB,cAAc,CA+BhB"}
|
|
@@ -1,226 +1,224 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
3
|
var clientCommon = require('@algolia/client-common');
|
|
6
4
|
var requesterNodeHttp = require('@algolia/requester-node-http');
|
|
7
5
|
|
|
8
|
-
//
|
|
9
|
-
const apiClientVersion = '5.0.0-alpha.
|
|
10
|
-
const REGIONS = ['de', 'us'];
|
|
11
|
-
function getDefaultHosts(region) {
|
|
12
|
-
const url = !region
|
|
13
|
-
? 'insights.algolia.io'
|
|
14
|
-
: 'insights.{region}.algolia.io'.replace('{region}', region);
|
|
15
|
-
return [{ url, accept: 'readWrite', protocol: 'https' }];
|
|
16
|
-
}
|
|
17
|
-
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
18
|
-
function createInsightsClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, region: regionOption, ...options }) {
|
|
19
|
-
const auth = clientCommon.createAuth(appIdOption, apiKeyOption, authMode);
|
|
20
|
-
const transporter = clientCommon.createTransporter({
|
|
21
|
-
hosts: getDefaultHosts(regionOption),
|
|
22
|
-
...options,
|
|
23
|
-
algoliaAgent: clientCommon.getAlgoliaAgent({
|
|
24
|
-
algoliaAgents,
|
|
25
|
-
client: 'Insights',
|
|
26
|
-
version: apiClientVersion,
|
|
27
|
-
}),
|
|
28
|
-
baseHeaders: {
|
|
29
|
-
'content-type': 'text/plain',
|
|
30
|
-
...auth.headers(),
|
|
31
|
-
...options.baseHeaders,
|
|
32
|
-
},
|
|
33
|
-
baseQueryParameters: {
|
|
34
|
-
...auth.queryParameters(),
|
|
35
|
-
...options.baseQueryParameters,
|
|
36
|
-
},
|
|
37
|
-
});
|
|
38
|
-
return {
|
|
39
|
-
transporter,
|
|
40
|
-
/**
|
|
41
|
-
* The `appId` currently in use.
|
|
42
|
-
*/
|
|
43
|
-
appId: appIdOption,
|
|
44
|
-
/**
|
|
45
|
-
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
|
|
46
|
-
*/
|
|
47
|
-
clearCache() {
|
|
48
|
-
return Promise.all([
|
|
49
|
-
transporter.requestsCache.clear(),
|
|
50
|
-
transporter.responsesCache.clear(),
|
|
51
|
-
]).then(() => undefined);
|
|
52
|
-
},
|
|
53
|
-
/**
|
|
54
|
-
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
|
|
55
|
-
*/
|
|
56
|
-
get _ua() {
|
|
57
|
-
return transporter.algoliaAgent.value;
|
|
58
|
-
},
|
|
59
|
-
/**
|
|
60
|
-
* Adds a `segment` to the `x-algolia-agent` sent with every requests.
|
|
61
|
-
*
|
|
62
|
-
* @param segment - The algolia agent (user-agent) segment to add.
|
|
63
|
-
* @param version - The version of the agent.
|
|
64
|
-
*/
|
|
65
|
-
addAlgoliaAgent(segment, version) {
|
|
66
|
-
transporter.algoliaAgent.add({ segment, version });
|
|
67
|
-
},
|
|
68
|
-
/**
|
|
69
|
-
* This method allow you to send requests to the Algolia REST API.
|
|
70
|
-
*
|
|
71
|
-
* @summary Send requests to the Algolia REST API.
|
|
72
|
-
* @param del - The del object.
|
|
73
|
-
* @param del.path -
|
|
74
|
-
* @param del.parameters - Query parameters to
|
|
75
|
-
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
76
|
-
*/
|
|
77
|
-
del({ path, parameters }, requestOptions) {
|
|
78
|
-
if (!path) {
|
|
79
|
-
throw new Error('Parameter `path` is required when calling `del`.');
|
|
80
|
-
}
|
|
81
|
-
const requestPath = '/1{path}'.replace('{path}', path);
|
|
82
|
-
const headers = {};
|
|
83
|
-
const queryParameters = parameters ? parameters : {};
|
|
84
|
-
const request = {
|
|
85
|
-
method: 'DELETE',
|
|
86
|
-
path: requestPath,
|
|
87
|
-
queryParameters,
|
|
88
|
-
headers,
|
|
89
|
-
};
|
|
90
|
-
return transporter.request(request, requestOptions);
|
|
91
|
-
},
|
|
92
|
-
/**
|
|
93
|
-
* This method allow you to send requests to the Algolia REST API.
|
|
94
|
-
*
|
|
95
|
-
* @summary Send requests to the Algolia REST API.
|
|
96
|
-
* @param get - The get object.
|
|
97
|
-
* @param get.path -
|
|
98
|
-
* @param get.parameters - Query parameters to
|
|
99
|
-
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
100
|
-
*/
|
|
101
|
-
get({ path, parameters }, requestOptions) {
|
|
102
|
-
if (!path) {
|
|
103
|
-
throw new Error('Parameter `path` is required when calling `get`.');
|
|
104
|
-
}
|
|
105
|
-
const requestPath = '/1{path}'.replace('{path}', path);
|
|
106
|
-
const headers = {};
|
|
107
|
-
const queryParameters = parameters ? parameters : {};
|
|
108
|
-
const request = {
|
|
109
|
-
method: 'GET',
|
|
110
|
-
path: requestPath,
|
|
111
|
-
queryParameters,
|
|
112
|
-
headers,
|
|
113
|
-
};
|
|
114
|
-
return transporter.request(request, requestOptions);
|
|
115
|
-
},
|
|
116
|
-
/**
|
|
117
|
-
* This method allow you to send requests to the Algolia REST API.
|
|
118
|
-
*
|
|
119
|
-
* @summary Send requests to the Algolia REST API.
|
|
120
|
-
* @param post - The post object.
|
|
121
|
-
* @param post.path -
|
|
122
|
-
* @param post.parameters - Query parameters to
|
|
123
|
-
* @param post.body -
|
|
124
|
-
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
125
|
-
*/
|
|
126
|
-
post({ path, parameters, body }, requestOptions) {
|
|
127
|
-
if (!path) {
|
|
128
|
-
throw new Error('Parameter `path` is required when calling `post`.');
|
|
129
|
-
}
|
|
130
|
-
const requestPath = '/1{path}'.replace('{path}', path);
|
|
131
|
-
const headers = {};
|
|
132
|
-
const queryParameters = parameters ? parameters : {};
|
|
133
|
-
const request = {
|
|
134
|
-
method: 'POST',
|
|
135
|
-
path: requestPath,
|
|
136
|
-
queryParameters,
|
|
137
|
-
headers,
|
|
138
|
-
data: body ? body : {},
|
|
139
|
-
};
|
|
140
|
-
return transporter.request(request, requestOptions);
|
|
141
|
-
},
|
|
142
|
-
/**
|
|
143
|
-
*
|
|
144
|
-
*
|
|
145
|
-
* @summary
|
|
146
|
-
* @param
|
|
147
|
-
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
148
|
-
*/
|
|
149
|
-
pushEvents(
|
|
150
|
-
if (!
|
|
151
|
-
throw new Error('Parameter `
|
|
152
|
-
}
|
|
153
|
-
if (!
|
|
154
|
-
throw new Error('Parameter `
|
|
155
|
-
}
|
|
156
|
-
const requestPath = '/1/events';
|
|
157
|
-
const headers = {};
|
|
158
|
-
const queryParameters = {};
|
|
159
|
-
const request = {
|
|
160
|
-
method: 'POST',
|
|
161
|
-
path: requestPath,
|
|
162
|
-
queryParameters,
|
|
163
|
-
headers,
|
|
164
|
-
data:
|
|
165
|
-
};
|
|
166
|
-
return transporter.request(request, requestOptions);
|
|
167
|
-
},
|
|
168
|
-
/**
|
|
169
|
-
* This method allow you to send requests to the Algolia REST API.
|
|
170
|
-
*
|
|
171
|
-
* @summary Send requests to the Algolia REST API.
|
|
172
|
-
* @param put - The put object.
|
|
173
|
-
* @param put.path -
|
|
174
|
-
* @param put.parameters - Query parameters to
|
|
175
|
-
* @param put.body -
|
|
176
|
-
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
177
|
-
*/
|
|
178
|
-
put({ path, parameters, body }, requestOptions) {
|
|
179
|
-
if (!path) {
|
|
180
|
-
throw new Error('Parameter `path` is required when calling `put`.');
|
|
181
|
-
}
|
|
182
|
-
const requestPath = '/1{path}'.replace('{path}', path);
|
|
183
|
-
const headers = {};
|
|
184
|
-
const queryParameters = parameters ? parameters : {};
|
|
185
|
-
const request = {
|
|
186
|
-
method: 'PUT',
|
|
187
|
-
path: requestPath,
|
|
188
|
-
queryParameters,
|
|
189
|
-
headers,
|
|
190
|
-
data: body ? body : {},
|
|
191
|
-
};
|
|
192
|
-
return transporter.request(request, requestOptions);
|
|
193
|
-
},
|
|
194
|
-
};
|
|
6
|
+
// 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.
|
|
7
|
+
const apiClientVersion = '5.0.0-alpha.90';
|
|
8
|
+
const REGIONS = ['de', 'us'];
|
|
9
|
+
function getDefaultHosts(region) {
|
|
10
|
+
const url = !region
|
|
11
|
+
? 'insights.algolia.io'
|
|
12
|
+
: 'insights.{region}.algolia.io'.replace('{region}', region);
|
|
13
|
+
return [{ url, accept: 'readWrite', protocol: 'https' }];
|
|
14
|
+
}
|
|
15
|
+
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
16
|
+
function createInsightsClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, region: regionOption, ...options }) {
|
|
17
|
+
const auth = clientCommon.createAuth(appIdOption, apiKeyOption, authMode);
|
|
18
|
+
const transporter = clientCommon.createTransporter({
|
|
19
|
+
hosts: getDefaultHosts(regionOption),
|
|
20
|
+
...options,
|
|
21
|
+
algoliaAgent: clientCommon.getAlgoliaAgent({
|
|
22
|
+
algoliaAgents,
|
|
23
|
+
client: 'Insights',
|
|
24
|
+
version: apiClientVersion,
|
|
25
|
+
}),
|
|
26
|
+
baseHeaders: {
|
|
27
|
+
'content-type': 'text/plain',
|
|
28
|
+
...auth.headers(),
|
|
29
|
+
...options.baseHeaders,
|
|
30
|
+
},
|
|
31
|
+
baseQueryParameters: {
|
|
32
|
+
...auth.queryParameters(),
|
|
33
|
+
...options.baseQueryParameters,
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
return {
|
|
37
|
+
transporter,
|
|
38
|
+
/**
|
|
39
|
+
* The `appId` currently in use.
|
|
40
|
+
*/
|
|
41
|
+
appId: appIdOption,
|
|
42
|
+
/**
|
|
43
|
+
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
|
|
44
|
+
*/
|
|
45
|
+
clearCache() {
|
|
46
|
+
return Promise.all([
|
|
47
|
+
transporter.requestsCache.clear(),
|
|
48
|
+
transporter.responsesCache.clear(),
|
|
49
|
+
]).then(() => undefined);
|
|
50
|
+
},
|
|
51
|
+
/**
|
|
52
|
+
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
|
|
53
|
+
*/
|
|
54
|
+
get _ua() {
|
|
55
|
+
return transporter.algoliaAgent.value;
|
|
56
|
+
},
|
|
57
|
+
/**
|
|
58
|
+
* Adds a `segment` to the `x-algolia-agent` sent with every requests.
|
|
59
|
+
*
|
|
60
|
+
* @param segment - The algolia agent (user-agent) segment to add.
|
|
61
|
+
* @param version - The version of the agent.
|
|
62
|
+
*/
|
|
63
|
+
addAlgoliaAgent(segment, version) {
|
|
64
|
+
transporter.algoliaAgent.add({ segment, version });
|
|
65
|
+
},
|
|
66
|
+
/**
|
|
67
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
68
|
+
*
|
|
69
|
+
* @summary Send requests to the Algolia REST API.
|
|
70
|
+
* @param del - The del object.
|
|
71
|
+
* @param del.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
72
|
+
* @param del.parameters - Query parameters to apply to the current query.
|
|
73
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
74
|
+
*/
|
|
75
|
+
del({ path, parameters }, requestOptions) {
|
|
76
|
+
if (!path) {
|
|
77
|
+
throw new Error('Parameter `path` is required when calling `del`.');
|
|
78
|
+
}
|
|
79
|
+
const requestPath = '/1{path}'.replace('{path}', path);
|
|
80
|
+
const headers = {};
|
|
81
|
+
const queryParameters = parameters ? parameters : {};
|
|
82
|
+
const request = {
|
|
83
|
+
method: 'DELETE',
|
|
84
|
+
path: requestPath,
|
|
85
|
+
queryParameters,
|
|
86
|
+
headers,
|
|
87
|
+
};
|
|
88
|
+
return transporter.request(request, requestOptions);
|
|
89
|
+
},
|
|
90
|
+
/**
|
|
91
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
92
|
+
*
|
|
93
|
+
* @summary Send requests to the Algolia REST API.
|
|
94
|
+
* @param get - The get object.
|
|
95
|
+
* @param get.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
96
|
+
* @param get.parameters - Query parameters to apply to the current query.
|
|
97
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
98
|
+
*/
|
|
99
|
+
get({ path, parameters }, requestOptions) {
|
|
100
|
+
if (!path) {
|
|
101
|
+
throw new Error('Parameter `path` is required when calling `get`.');
|
|
102
|
+
}
|
|
103
|
+
const requestPath = '/1{path}'.replace('{path}', path);
|
|
104
|
+
const headers = {};
|
|
105
|
+
const queryParameters = parameters ? parameters : {};
|
|
106
|
+
const request = {
|
|
107
|
+
method: 'GET',
|
|
108
|
+
path: requestPath,
|
|
109
|
+
queryParameters,
|
|
110
|
+
headers,
|
|
111
|
+
};
|
|
112
|
+
return transporter.request(request, requestOptions);
|
|
113
|
+
},
|
|
114
|
+
/**
|
|
115
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
116
|
+
*
|
|
117
|
+
* @summary Send requests to the Algolia REST API.
|
|
118
|
+
* @param post - The post object.
|
|
119
|
+
* @param post.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
120
|
+
* @param post.parameters - Query parameters to apply to the current query.
|
|
121
|
+
* @param post.body - Parameters to send with the custom request.
|
|
122
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
123
|
+
*/
|
|
124
|
+
post({ path, parameters, body }, requestOptions) {
|
|
125
|
+
if (!path) {
|
|
126
|
+
throw new Error('Parameter `path` is required when calling `post`.');
|
|
127
|
+
}
|
|
128
|
+
const requestPath = '/1{path}'.replace('{path}', path);
|
|
129
|
+
const headers = {};
|
|
130
|
+
const queryParameters = parameters ? parameters : {};
|
|
131
|
+
const request = {
|
|
132
|
+
method: 'POST',
|
|
133
|
+
path: requestPath,
|
|
134
|
+
queryParameters,
|
|
135
|
+
headers,
|
|
136
|
+
data: body ? body : {},
|
|
137
|
+
};
|
|
138
|
+
return transporter.request(request, requestOptions);
|
|
139
|
+
},
|
|
140
|
+
/**
|
|
141
|
+
* 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.
|
|
142
|
+
*
|
|
143
|
+
* @summary Send events.
|
|
144
|
+
* @param insightsEvents - The insightsEvents object.
|
|
145
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
146
|
+
*/
|
|
147
|
+
pushEvents(insightsEvents, requestOptions) {
|
|
148
|
+
if (!insightsEvents) {
|
|
149
|
+
throw new Error('Parameter `insightsEvents` is required when calling `pushEvents`.');
|
|
150
|
+
}
|
|
151
|
+
if (!insightsEvents.events) {
|
|
152
|
+
throw new Error('Parameter `insightsEvents.events` is required when calling `pushEvents`.');
|
|
153
|
+
}
|
|
154
|
+
const requestPath = '/1/events';
|
|
155
|
+
const headers = {};
|
|
156
|
+
const queryParameters = {};
|
|
157
|
+
const request = {
|
|
158
|
+
method: 'POST',
|
|
159
|
+
path: requestPath,
|
|
160
|
+
queryParameters,
|
|
161
|
+
headers,
|
|
162
|
+
data: insightsEvents,
|
|
163
|
+
};
|
|
164
|
+
return transporter.request(request, requestOptions);
|
|
165
|
+
},
|
|
166
|
+
/**
|
|
167
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
168
|
+
*
|
|
169
|
+
* @summary Send requests to the Algolia REST API.
|
|
170
|
+
* @param put - The put object.
|
|
171
|
+
* @param put.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
172
|
+
* @param put.parameters - Query parameters to apply to the current query.
|
|
173
|
+
* @param put.body - Parameters to send with the custom request.
|
|
174
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
175
|
+
*/
|
|
176
|
+
put({ path, parameters, body }, requestOptions) {
|
|
177
|
+
if (!path) {
|
|
178
|
+
throw new Error('Parameter `path` is required when calling `put`.');
|
|
179
|
+
}
|
|
180
|
+
const requestPath = '/1{path}'.replace('{path}', path);
|
|
181
|
+
const headers = {};
|
|
182
|
+
const queryParameters = parameters ? parameters : {};
|
|
183
|
+
const request = {
|
|
184
|
+
method: 'PUT',
|
|
185
|
+
path: requestPath,
|
|
186
|
+
queryParameters,
|
|
187
|
+
headers,
|
|
188
|
+
data: body ? body : {},
|
|
189
|
+
};
|
|
190
|
+
return transporter.request(request, requestOptions);
|
|
191
|
+
},
|
|
192
|
+
};
|
|
195
193
|
}
|
|
196
194
|
|
|
197
|
-
//
|
|
198
|
-
function insightsClient(appId, apiKey, region, options) {
|
|
199
|
-
if (!appId || typeof appId !== 'string') {
|
|
200
|
-
throw new Error('`appId` is missing.');
|
|
201
|
-
}
|
|
202
|
-
if (!apiKey || typeof apiKey !== 'string') {
|
|
203
|
-
throw new Error('`apiKey` is missing.');
|
|
204
|
-
}
|
|
205
|
-
if (region && (typeof region !== 'string' || !REGIONS.includes(region))) {
|
|
206
|
-
throw new Error(`\`region\` must be one of the following: ${REGIONS.join(', ')}`);
|
|
207
|
-
}
|
|
208
|
-
return createInsightsClient({
|
|
209
|
-
appId,
|
|
210
|
-
apiKey,
|
|
211
|
-
region,
|
|
212
|
-
timeouts: {
|
|
213
|
-
connect: clientCommon.DEFAULT_CONNECT_TIMEOUT_NODE,
|
|
214
|
-
read: clientCommon.DEFAULT_READ_TIMEOUT_NODE,
|
|
215
|
-
write: clientCommon.DEFAULT_WRITE_TIMEOUT_NODE,
|
|
216
|
-
},
|
|
217
|
-
requester: requesterNodeHttp.createHttpRequester(),
|
|
218
|
-
algoliaAgents: [{ segment: 'Node.js', version: process.versions.node }],
|
|
219
|
-
responsesCache: clientCommon.createNullCache(),
|
|
220
|
-
requestsCache: clientCommon.createNullCache(),
|
|
221
|
-
hostsCache: clientCommon.createMemoryCache(),
|
|
222
|
-
...options,
|
|
223
|
-
});
|
|
195
|
+
// 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.
|
|
196
|
+
function insightsClient(appId, apiKey, region, options) {
|
|
197
|
+
if (!appId || typeof appId !== 'string') {
|
|
198
|
+
throw new Error('`appId` is missing.');
|
|
199
|
+
}
|
|
200
|
+
if (!apiKey || typeof apiKey !== 'string') {
|
|
201
|
+
throw new Error('`apiKey` is missing.');
|
|
202
|
+
}
|
|
203
|
+
if (region && (typeof region !== 'string' || !REGIONS.includes(region))) {
|
|
204
|
+
throw new Error(`\`region\` must be one of the following: ${REGIONS.join(', ')}`);
|
|
205
|
+
}
|
|
206
|
+
return createInsightsClient({
|
|
207
|
+
appId,
|
|
208
|
+
apiKey,
|
|
209
|
+
region,
|
|
210
|
+
timeouts: {
|
|
211
|
+
connect: clientCommon.DEFAULT_CONNECT_TIMEOUT_NODE,
|
|
212
|
+
read: clientCommon.DEFAULT_READ_TIMEOUT_NODE,
|
|
213
|
+
write: clientCommon.DEFAULT_WRITE_TIMEOUT_NODE,
|
|
214
|
+
},
|
|
215
|
+
requester: requesterNodeHttp.createHttpRequester(),
|
|
216
|
+
algoliaAgents: [{ segment: 'Node.js', version: process.versions.node }],
|
|
217
|
+
responsesCache: clientCommon.createNullCache(),
|
|
218
|
+
requestsCache: clientCommon.createNullCache(),
|
|
219
|
+
hostsCache: clientCommon.createMemoryCache(),
|
|
220
|
+
...options,
|
|
221
|
+
});
|
|
224
222
|
}
|
|
225
223
|
|
|
226
224
|
exports.apiClientVersion = apiClientVersion;
|