@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.
Files changed (105) hide show
  1. package/dist/builds/browser.d.ts +5 -5
  2. package/dist/builds/browser.d.ts.map +1 -1
  3. package/dist/builds/node.d.ts +5 -5
  4. package/dist/builds/node.d.ts.map +1 -1
  5. package/dist/{client-insights.cjs.js → client-insights.cjs} +214 -216
  6. package/dist/client-insights.esm.browser.js +396 -446
  7. package/dist/client-insights.esm.node.js +214 -214
  8. package/dist/client-insights.umd.js +2 -2
  9. package/dist/model/addToCartEvent.d.ts +2 -0
  10. package/dist/model/addToCartEvent.d.ts.map +1 -0
  11. package/dist/model/addedToCartObjectIDs.d.ts +43 -0
  12. package/dist/model/addedToCartObjectIDs.d.ts.map +1 -0
  13. package/dist/model/addedToCartObjectIDsAfterSearch.d.ts +47 -0
  14. package/dist/model/addedToCartObjectIDsAfterSearch.d.ts.map +1 -0
  15. package/dist/model/clickEvent.d.ts +2 -0
  16. package/dist/model/clickEvent.d.ts.map +1 -0
  17. package/dist/model/clickedFilters.d.ts +32 -0
  18. package/dist/model/clickedFilters.d.ts.map +1 -0
  19. package/dist/model/clickedObjectIDs.d.ts +28 -0
  20. package/dist/model/clickedObjectIDs.d.ts.map +1 -0
  21. package/dist/model/clickedObjectIDsAfterSearch.d.ts +40 -0
  22. package/dist/model/clickedObjectIDsAfterSearch.d.ts.map +1 -0
  23. package/dist/model/clientMethodProps.d.ts +60 -60
  24. package/dist/model/clientMethodProps.d.ts.map +1 -1
  25. package/dist/model/conversionEvent.d.ts +2 -0
  26. package/dist/model/conversionEvent.d.ts.map +1 -0
  27. package/dist/model/convertedFilters.d.ts +29 -0
  28. package/dist/model/convertedFilters.d.ts.map +1 -0
  29. package/dist/model/convertedObjectIDs.d.ts +32 -0
  30. package/dist/model/convertedObjectIDs.d.ts.map +1 -0
  31. package/dist/model/convertedObjectIDsAfterSearch.d.ts +36 -0
  32. package/dist/model/convertedObjectIDsAfterSearch.d.ts.map +1 -0
  33. package/dist/model/discount.d.ts +5 -0
  34. package/dist/model/discount.d.ts.map +1 -0
  35. package/dist/model/errorBase.d.ts +6 -6
  36. package/dist/model/errorBase.d.ts.map +1 -1
  37. package/dist/model/eventsItems.d.ts +14 -0
  38. package/dist/model/eventsItems.d.ts.map +1 -0
  39. package/dist/model/eventsResponse.d.ts +14 -0
  40. package/dist/model/eventsResponse.d.ts.map +1 -0
  41. package/dist/model/index.d.ts +26 -6
  42. package/dist/model/index.d.ts.map +1 -1
  43. package/dist/model/insightsEvents.d.ts +8 -0
  44. package/dist/model/insightsEvents.d.ts.map +1 -0
  45. package/dist/model/objectData.d.ts +11 -0
  46. package/dist/model/objectData.d.ts.map +1 -0
  47. package/dist/model/objectDataAfterSearch.d.ts +15 -0
  48. package/dist/model/objectDataAfterSearch.d.ts.map +1 -0
  49. package/dist/model/price.d.ts +5 -0
  50. package/dist/model/price.d.ts.map +1 -0
  51. package/dist/model/purchaseEvent.d.ts +2 -0
  52. package/dist/model/purchaseEvent.d.ts.map +1 -0
  53. package/dist/model/purchasedObjectIDs.d.ts +43 -0
  54. package/dist/model/purchasedObjectIDs.d.ts.map +1 -0
  55. package/dist/model/purchasedObjectIDsAfterSearch.d.ts +47 -0
  56. package/dist/model/purchasedObjectIDsAfterSearch.d.ts.map +1 -0
  57. package/dist/model/viewEvent.d.ts +2 -0
  58. package/dist/model/viewEvent.d.ts.map +1 -0
  59. package/dist/model/viewedFilters.d.ts +32 -0
  60. package/dist/model/viewedFilters.d.ts.map +1 -0
  61. package/dist/model/viewedObjectIDs.d.ts +32 -0
  62. package/dist/model/viewedObjectIDs.d.ts.map +1 -0
  63. package/dist/src/insightsClient.d.ts +85 -85
  64. package/dist/src/insightsClient.d.ts.map +1 -1
  65. package/index.js +1 -1
  66. package/model/addToCartEvent.ts +3 -0
  67. package/model/addedToCartObjectIDs.ts +54 -0
  68. package/model/addedToCartObjectIDsAfterSearch.ts +59 -0
  69. package/model/clickEvent.ts +3 -0
  70. package/model/clickedFilters.ts +40 -0
  71. package/model/clickedObjectIDs.ts +35 -0
  72. package/model/clickedObjectIDsAfterSearch.ts +50 -0
  73. package/model/clientMethodProps.ts +11 -11
  74. package/model/conversionEvent.ts +3 -0
  75. package/model/convertedFilters.ts +37 -0
  76. package/model/convertedObjectIDs.ts +40 -0
  77. package/model/convertedObjectIDsAfterSearch.ts +45 -0
  78. package/model/discount.ts +6 -0
  79. package/model/errorBase.ts +1 -1
  80. package/model/eventsItems.ts +28 -0
  81. package/model/eventsResponse.ts +16 -0
  82. package/model/index.ts +25 -5
  83. package/model/insightsEvents.ts +10 -0
  84. package/model/objectData.ts +15 -0
  85. package/model/objectDataAfterSearch.ts +20 -0
  86. package/model/price.ts +6 -0
  87. package/model/purchaseEvent.ts +3 -0
  88. package/model/purchasedObjectIDs.ts +54 -0
  89. package/model/purchasedObjectIDsAfterSearch.ts +59 -0
  90. package/model/viewEvent.ts +3 -0
  91. package/model/viewedFilters.ts +40 -0
  92. package/model/viewedObjectIDs.ts +40 -0
  93. package/package.json +30 -13
  94. package/dist/model/eventType.d.ts +0 -2
  95. package/dist/model/eventType.d.ts.map +0 -1
  96. package/dist/model/insightEvent.d.ts +0 -40
  97. package/dist/model/insightEvent.d.ts.map +0 -1
  98. package/dist/model/insightEvents.d.ts +0 -11
  99. package/dist/model/insightEvents.d.ts.map +0 -1
  100. package/dist/model/pushEventsResponse.d.ts +0 -7
  101. package/dist/model/pushEventsResponse.d.ts.map +0 -1
  102. package/model/eventType.ts +0 -3
  103. package/model/insightEvent.ts +0 -50
  104. package/model/insightEvents.ts +0 -13
  105. package/model/pushEventsResponse.ts +0 -8
@@ -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,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACzE,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"}
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"}
@@ -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,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACzE,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
+ {"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
- // This file is generated, manual changes will be lost - read more on https://github.com/algolia/api-clients-automation.
9
- const apiClientVersion = '5.0.0-alpha.9';
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 - The path of the API endpoint to target, anything after the /1 needs to be specified.
74
- * @param del.parameters - Query parameters to be applied to the current query.
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 - The path of the API endpoint to target, anything after the /1 needs to be specified.
98
- * @param get.parameters - Query parameters to be applied to the current query.
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 - The path of the API endpoint to target, anything after the /1 needs to be specified.
122
- * @param post.parameters - Query parameters to be applied to the current query.
123
- * @param post.body - The parameters to send with the custom request.
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
- * This command pushes an array of events. An event is - an action: `eventName` - performed in a context: `eventType` - at some point in time provided: `timestamp` - by an end user: `userToken` - on something: `index` Notes: - To be accepted, all events sent must be valid. - The size of the body must be *less than 2 MB*. - When an event is tied to an Algolia search, it must also provide a `queryID`. If that event is a `click`, their absolute `positions` should also be passed. - We consider that an `index` provides access to 2 resources: objects and filters. An event can only interact with a single resource type, but not necessarily on a single item. As such an event will accept an array of `objectIDs` or `filters`.
144
- *
145
- * @summary Push events.
146
- * @param insightEvents - The insightEvents object.
147
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
148
- */
149
- pushEvents(insightEvents, requestOptions) {
150
- if (!insightEvents) {
151
- throw new Error('Parameter `insightEvents` is required when calling `pushEvents`.');
152
- }
153
- if (!insightEvents.events) {
154
- throw new Error('Parameter `insightEvents.events` is required when calling `pushEvents`.');
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: insightEvents,
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 - The path of the API endpoint to target, anything after the /1 needs to be specified.
174
- * @param put.parameters - Query parameters to be applied to the current query.
175
- * @param put.body - The parameters to send with the custom request.
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
- // This file is generated, manual changes will be lost - read more on https://github.com/algolia/api-clients-automation.
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;