@algolia/client-insights 5.20.3 → 5.20.4
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/README.md +4 -4
- package/dist/browser.d.ts +5 -5
- package/dist/builds/browser.js +5 -5
- package/dist/builds/browser.js.map +1 -1
- package/dist/builds/browser.min.js +1 -1
- package/dist/builds/browser.min.js.map +1 -1
- package/dist/builds/browser.umd.js +1 -1
- package/dist/builds/fetch.js +5 -5
- package/dist/builds/fetch.js.map +1 -1
- package/dist/builds/node.cjs +5 -5
- package/dist/builds/node.cjs.map +1 -1
- package/dist/builds/node.js +5 -5
- package/dist/builds/node.js.map +1 -1
- package/dist/builds/worker.js +5 -5
- package/dist/builds/worker.js.map +1 -1
- package/dist/fetch.d.ts +5 -5
- package/dist/node.d.cts +5 -5
- package/dist/node.d.ts +5 -5
- package/dist/src/insightsClient.cjs +5 -5
- package/dist/src/insightsClient.cjs.map +1 -1
- package/dist/src/insightsClient.js +5 -5
- package/dist/src/insightsClient.js.map +1 -1
- package/dist/worker.d.ts +5 -5
- package/package.json +10 -10
package/dist/fetch.d.ts
CHANGED
|
@@ -574,7 +574,7 @@ type DeleteUserTokenProps = {
|
|
|
574
574
|
userToken: string;
|
|
575
575
|
};
|
|
576
576
|
|
|
577
|
-
declare const apiClientVersion = "5.20.
|
|
577
|
+
declare const apiClientVersion = "5.20.4";
|
|
578
578
|
declare const REGIONS: readonly ["de", "us"];
|
|
579
579
|
type Region = (typeof REGIONS)[number];
|
|
580
580
|
type RegionOptions = {
|
|
@@ -615,7 +615,7 @@ declare function createInsightsClient({ appId: appIdOption, apiKey: apiKeyOption
|
|
|
615
615
|
apiKey: string;
|
|
616
616
|
}): void;
|
|
617
617
|
/**
|
|
618
|
-
* This method
|
|
618
|
+
* This method lets you send requests to the Algolia REST API.
|
|
619
619
|
* @param customDelete - The customDelete object.
|
|
620
620
|
* @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
621
621
|
* @param customDelete.parameters - Query parameters to apply to the current query.
|
|
@@ -623,7 +623,7 @@ declare function createInsightsClient({ appId: appIdOption, apiKey: apiKeyOption
|
|
|
623
623
|
*/
|
|
624
624
|
customDelete({ path, parameters }: CustomDeleteProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
|
|
625
625
|
/**
|
|
626
|
-
* This method
|
|
626
|
+
* This method lets you send requests to the Algolia REST API.
|
|
627
627
|
* @param customGet - The customGet object.
|
|
628
628
|
* @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
629
629
|
* @param customGet.parameters - Query parameters to apply to the current query.
|
|
@@ -631,7 +631,7 @@ declare function createInsightsClient({ appId: appIdOption, apiKey: apiKeyOption
|
|
|
631
631
|
*/
|
|
632
632
|
customGet({ path, parameters }: CustomGetProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
|
|
633
633
|
/**
|
|
634
|
-
* This method
|
|
634
|
+
* This method lets you send requests to the Algolia REST API.
|
|
635
635
|
* @param customPost - The customPost object.
|
|
636
636
|
* @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
637
637
|
* @param customPost.parameters - Query parameters to apply to the current query.
|
|
@@ -640,7 +640,7 @@ declare function createInsightsClient({ appId: appIdOption, apiKey: apiKeyOption
|
|
|
640
640
|
*/
|
|
641
641
|
customPost({ path, parameters, body }: CustomPostProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
|
|
642
642
|
/**
|
|
643
|
-
* This method
|
|
643
|
+
* This method lets you send requests to the Algolia REST API.
|
|
644
644
|
* @param customPut - The customPut object.
|
|
645
645
|
* @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
646
646
|
* @param customPut.parameters - Query parameters to apply to the current query.
|
package/dist/node.d.cts
CHANGED
|
@@ -574,7 +574,7 @@ type DeleteUserTokenProps = {
|
|
|
574
574
|
userToken: string;
|
|
575
575
|
};
|
|
576
576
|
|
|
577
|
-
declare const apiClientVersion = "5.20.
|
|
577
|
+
declare const apiClientVersion = "5.20.4";
|
|
578
578
|
declare const REGIONS: readonly ["de", "us"];
|
|
579
579
|
type Region = (typeof REGIONS)[number];
|
|
580
580
|
type RegionOptions = {
|
|
@@ -615,7 +615,7 @@ declare function createInsightsClient({ appId: appIdOption, apiKey: apiKeyOption
|
|
|
615
615
|
apiKey: string;
|
|
616
616
|
}): void;
|
|
617
617
|
/**
|
|
618
|
-
* This method
|
|
618
|
+
* This method lets you send requests to the Algolia REST API.
|
|
619
619
|
* @param customDelete - The customDelete object.
|
|
620
620
|
* @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
621
621
|
* @param customDelete.parameters - Query parameters to apply to the current query.
|
|
@@ -623,7 +623,7 @@ declare function createInsightsClient({ appId: appIdOption, apiKey: apiKeyOption
|
|
|
623
623
|
*/
|
|
624
624
|
customDelete({ path, parameters }: CustomDeleteProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
|
|
625
625
|
/**
|
|
626
|
-
* This method
|
|
626
|
+
* This method lets you send requests to the Algolia REST API.
|
|
627
627
|
* @param customGet - The customGet object.
|
|
628
628
|
* @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
629
629
|
* @param customGet.parameters - Query parameters to apply to the current query.
|
|
@@ -631,7 +631,7 @@ declare function createInsightsClient({ appId: appIdOption, apiKey: apiKeyOption
|
|
|
631
631
|
*/
|
|
632
632
|
customGet({ path, parameters }: CustomGetProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
|
|
633
633
|
/**
|
|
634
|
-
* This method
|
|
634
|
+
* This method lets you send requests to the Algolia REST API.
|
|
635
635
|
* @param customPost - The customPost object.
|
|
636
636
|
* @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
637
637
|
* @param customPost.parameters - Query parameters to apply to the current query.
|
|
@@ -640,7 +640,7 @@ declare function createInsightsClient({ appId: appIdOption, apiKey: apiKeyOption
|
|
|
640
640
|
*/
|
|
641
641
|
customPost({ path, parameters, body }: CustomPostProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
|
|
642
642
|
/**
|
|
643
|
-
* This method
|
|
643
|
+
* This method lets you send requests to the Algolia REST API.
|
|
644
644
|
* @param customPut - The customPut object.
|
|
645
645
|
* @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
646
646
|
* @param customPut.parameters - Query parameters to apply to the current query.
|
package/dist/node.d.ts
CHANGED
|
@@ -574,7 +574,7 @@ type DeleteUserTokenProps = {
|
|
|
574
574
|
userToken: string;
|
|
575
575
|
};
|
|
576
576
|
|
|
577
|
-
declare const apiClientVersion = "5.20.
|
|
577
|
+
declare const apiClientVersion = "5.20.4";
|
|
578
578
|
declare const REGIONS: readonly ["de", "us"];
|
|
579
579
|
type Region = (typeof REGIONS)[number];
|
|
580
580
|
type RegionOptions = {
|
|
@@ -615,7 +615,7 @@ declare function createInsightsClient({ appId: appIdOption, apiKey: apiKeyOption
|
|
|
615
615
|
apiKey: string;
|
|
616
616
|
}): void;
|
|
617
617
|
/**
|
|
618
|
-
* This method
|
|
618
|
+
* This method lets you send requests to the Algolia REST API.
|
|
619
619
|
* @param customDelete - The customDelete object.
|
|
620
620
|
* @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
621
621
|
* @param customDelete.parameters - Query parameters to apply to the current query.
|
|
@@ -623,7 +623,7 @@ declare function createInsightsClient({ appId: appIdOption, apiKey: apiKeyOption
|
|
|
623
623
|
*/
|
|
624
624
|
customDelete({ path, parameters }: CustomDeleteProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
|
|
625
625
|
/**
|
|
626
|
-
* This method
|
|
626
|
+
* This method lets you send requests to the Algolia REST API.
|
|
627
627
|
* @param customGet - The customGet object.
|
|
628
628
|
* @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
629
629
|
* @param customGet.parameters - Query parameters to apply to the current query.
|
|
@@ -631,7 +631,7 @@ declare function createInsightsClient({ appId: appIdOption, apiKey: apiKeyOption
|
|
|
631
631
|
*/
|
|
632
632
|
customGet({ path, parameters }: CustomGetProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
|
|
633
633
|
/**
|
|
634
|
-
* This method
|
|
634
|
+
* This method lets you send requests to the Algolia REST API.
|
|
635
635
|
* @param customPost - The customPost object.
|
|
636
636
|
* @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
637
637
|
* @param customPost.parameters - Query parameters to apply to the current query.
|
|
@@ -640,7 +640,7 @@ declare function createInsightsClient({ appId: appIdOption, apiKey: apiKeyOption
|
|
|
640
640
|
*/
|
|
641
641
|
customPost({ path, parameters, body }: CustomPostProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
|
|
642
642
|
/**
|
|
643
|
-
* This method
|
|
643
|
+
* This method lets you send requests to the Algolia REST API.
|
|
644
644
|
* @param customPut - The customPut object.
|
|
645
645
|
* @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
646
646
|
* @param customPut.parameters - Query parameters to apply to the current query.
|
|
@@ -26,7 +26,7 @@ __export(insightsClient_exports, {
|
|
|
26
26
|
});
|
|
27
27
|
module.exports = __toCommonJS(insightsClient_exports);
|
|
28
28
|
var import_client_common = require("@algolia/client-common");
|
|
29
|
-
var apiClientVersion = "5.20.
|
|
29
|
+
var apiClientVersion = "5.20.4";
|
|
30
30
|
var REGIONS = ["de", "us"];
|
|
31
31
|
function getDefaultHosts(region) {
|
|
32
32
|
const url = !region ? "insights.algolia.io" : "insights.{region}.algolia.io".replace("{region}", region);
|
|
@@ -104,7 +104,7 @@ function createInsightsClient({
|
|
|
104
104
|
}
|
|
105
105
|
},
|
|
106
106
|
/**
|
|
107
|
-
* This method
|
|
107
|
+
* This method lets you send requests to the Algolia REST API.
|
|
108
108
|
* @param customDelete - The customDelete object.
|
|
109
109
|
* @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
110
110
|
* @param customDelete.parameters - Query parameters to apply to the current query.
|
|
@@ -126,7 +126,7 @@ function createInsightsClient({
|
|
|
126
126
|
return transporter.request(request, requestOptions);
|
|
127
127
|
},
|
|
128
128
|
/**
|
|
129
|
-
* This method
|
|
129
|
+
* This method lets you send requests to the Algolia REST API.
|
|
130
130
|
* @param customGet - The customGet object.
|
|
131
131
|
* @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
132
132
|
* @param customGet.parameters - Query parameters to apply to the current query.
|
|
@@ -148,7 +148,7 @@ function createInsightsClient({
|
|
|
148
148
|
return transporter.request(request, requestOptions);
|
|
149
149
|
},
|
|
150
150
|
/**
|
|
151
|
-
* This method
|
|
151
|
+
* This method lets you send requests to the Algolia REST API.
|
|
152
152
|
* @param customPost - The customPost object.
|
|
153
153
|
* @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
154
154
|
* @param customPost.parameters - Query parameters to apply to the current query.
|
|
@@ -172,7 +172,7 @@ function createInsightsClient({
|
|
|
172
172
|
return transporter.request(request, requestOptions);
|
|
173
173
|
},
|
|
174
174
|
/**
|
|
175
|
-
* This method
|
|
175
|
+
* This method lets you send requests to the Algolia REST API.
|
|
176
176
|
* @param customPut - The customPut object.
|
|
177
177
|
* @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
178
178
|
* @param customPut.parameters - Query parameters to apply to the current query.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/insightsClient.ts"],"sourcesContent":["// 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.\n\nimport type {\n CreateClientOptions,\n Headers,\n Host,\n QueryParameters,\n Request,\n RequestOptions,\n} from '@algolia/client-common';\nimport { createAuth, createTransporter, getAlgoliaAgent } from '@algolia/client-common';\n\nimport type { EventsResponse } from '../model/eventsResponse';\nimport type { InsightsEvents } from '../model/insightsEvents';\n\nimport type {\n CustomDeleteProps,\n CustomGetProps,\n CustomPostProps,\n CustomPutProps,\n DeleteUserTokenProps,\n} from '../model/clientMethodProps';\n\nexport const apiClientVersion = '5.20.3';\n\nexport const REGIONS = ['de', 'us'] as const;\nexport type Region = (typeof REGIONS)[number];\nexport type RegionOptions = { region?: Region };\n\nfunction getDefaultHosts(region?: Region): Host[] {\n const url = !region ? 'insights.algolia.io' : 'insights.{region}.algolia.io'.replace('{region}', region);\n\n return [{ url, accept: 'readWrite', protocol: 'https' }];\n}\n\nexport function createInsightsClient({\n appId: appIdOption,\n apiKey: apiKeyOption,\n authMode,\n algoliaAgents,\n region: regionOption,\n ...options\n}: CreateClientOptions & RegionOptions) {\n const auth = createAuth(appIdOption, apiKeyOption, authMode);\n const transporter = createTransporter({\n hosts: getDefaultHosts(regionOption),\n ...options,\n algoliaAgent: getAlgoliaAgent({\n algoliaAgents,\n client: 'Insights',\n version: apiClientVersion,\n }),\n baseHeaders: {\n 'content-type': 'text/plain',\n ...auth.headers(),\n ...options.baseHeaders,\n },\n baseQueryParameters: {\n ...auth.queryParameters(),\n ...options.baseQueryParameters,\n },\n });\n\n return {\n transporter,\n\n /**\n * The `appId` currently in use.\n */\n appId: appIdOption,\n\n /**\n * The `apiKey` currently in use.\n */\n apiKey: apiKeyOption,\n\n /**\n * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.\n */\n clearCache(): Promise<void> {\n return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => undefined);\n },\n\n /**\n * Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.\n */\n get _ua(): string {\n return transporter.algoliaAgent.value;\n },\n\n /**\n * Adds a `segment` to the `x-algolia-agent` sent with every requests.\n *\n * @param segment - The algolia agent (user-agent) segment to add.\n * @param version - The version of the agent.\n */\n addAlgoliaAgent(segment: string, version?: string): void {\n transporter.algoliaAgent.add({ segment, version });\n },\n\n /**\n * Helper method to switch the API key used to authenticate the requests.\n *\n * @param params - Method params.\n * @param params.apiKey - The new API Key to use.\n */\n setClientApiKey({ apiKey }: { apiKey: string }): void {\n if (!authMode || authMode === 'WithinHeaders') {\n transporter.baseHeaders['x-algolia-api-key'] = apiKey;\n } else {\n transporter.baseQueryParameters['x-algolia-api-key'] = apiKey;\n }\n },\n\n /**\n * This method allow you to send requests to the Algolia REST API.\n * @param customDelete - The customDelete object.\n * @param customDelete.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\n * @param customDelete.parameters - Query parameters to apply to the current query.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customDelete(\n { path, parameters }: CustomDeleteProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customDelete`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'DELETE',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * This method allow you to send requests to the Algolia REST API.\n * @param customGet - The customGet object.\n * @param customGet.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\n * @param customGet.parameters - Query parameters to apply to the current query.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customGet({ path, parameters }: CustomGetProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customGet`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * This method allow you to send requests to the Algolia REST API.\n * @param customPost - The customPost object.\n * @param customPost.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\n * @param customPost.parameters - Query parameters to apply to the current query.\n * @param customPost.body - Parameters to send with the custom request.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customPost(\n { path, parameters, body }: CustomPostProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customPost`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: body ? body : {},\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * This method allow you to send requests to the Algolia REST API.\n * @param customPut - The customPut object.\n * @param customPut.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\n * @param customPut.parameters - Query parameters to apply to the current query.\n * @param customPut.body - Parameters to send with the custom request.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customPut(\n { path, parameters, body }: CustomPutProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customPut`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'PUT',\n path: requestPath,\n queryParameters,\n headers,\n data: body ? body : {},\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * 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` in the Personalization API.\n * @param deleteUserToken - The deleteUserToken object.\n * @param deleteUserToken.userToken - User token for which to delete all associated events.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n deleteUserToken({ userToken }: DeleteUserTokenProps, requestOptions?: RequestOptions): Promise<void> {\n if (!userToken) {\n throw new Error('Parameter `userToken` is required when calling `deleteUserToken`.');\n }\n\n const requestPath = '/1/usertokens/{userToken}'.replace('{userToken}', encodeURIComponent(userToken));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'DELETE',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * 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.\n * @param insightsEvents - The insightsEvents object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n pushEvents(insightsEvents: InsightsEvents, requestOptions?: RequestOptions): Promise<EventsResponse> {\n if (!insightsEvents) {\n throw new Error('Parameter `insightsEvents` is required when calling `pushEvents`.');\n }\n\n if (!insightsEvents.events) {\n throw new Error('Parameter `insightsEvents.events` is required when calling `pushEvents`.');\n }\n\n const requestPath = '/1/events';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: insightsEvents,\n };\n\n return transporter.request(request, requestOptions);\n },\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUA,2BAA+D;AAaxD,IAAM,mBAAmB;AAEzB,IAAM,UAAU,CAAC,MAAM,IAAI;AAIlC,SAAS,gBAAgB,QAAyB;AAChD,QAAM,MAAM,CAAC,SAAS,wBAAwB,+BAA+B,QAAQ,YAAY,MAAM;AAEvG,SAAO,CAAC,EAAE,KAAK,QAAQ,aAAa,UAAU,QAAQ,CAAC;AACzD;AAEO,SAAS,qBAAqB;AAAA,EACnC,OAAO;AAAA,EACP,QAAQ;AAAA,EACR;AAAA,EACA;AAAA,EACA,QAAQ;AAAA,EACR,GAAG;AACL,GAAwC;AACtC,QAAM,WAAO,iCAAW,aAAa,cAAc,QAAQ;AAC3D,QAAM,kBAAc,wCAAkB;AAAA,IACpC,OAAO,gBAAgB,YAAY;AAAA,IACnC,GAAG;AAAA,IACH,kBAAc,sCAAgB;AAAA,MAC5B;AAAA,MACA,QAAQ;AAAA,MACR,SAAS;AAAA,IACX,CAAC;AAAA,IACD,aAAa;AAAA,MACX,gBAA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AAM;AAAA,QACN;AAAA,QACA;AAAA,QACA,MAAM,OAAO,OAAO,CAAC;AAAA,MACvB;AAEA,aAAO,YAAY,QAAQ,SAAS,cAAc;AAAA,IACpD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAQA,gBAAgB,EAAE,UAAU,GAAyB,gBAAgD;AACnG,UAAI,CAAC,WAAW;AACd,cAAM,IAAI,MAAM,mEAAmE;AAAA,MACrF;AAEA,YAAM,cAAc,4BAA4B,QAAQ,eAAe,mBAAmB,SAAS,CAAC;AACpG,YAAM,UAAmB,CAAC;AAC1B,YAAM,kBAAmC,CAAC;AAE1C,YAAM,UAAmB;AAAA,QACvB,QAAQ;AAAA,QACR,MAAM;AAAA,QACN;AAAA,QACA;AAAA,MACF;AAEA,aAAO,YAAY,QAAQ,SAAS,cAAc;AAAA,IACpD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,WAAW,gBAAgC,gBAA0D;AACnG,UAAI,CAAC,gBAAgB;AACnB,cAAM,IAAI,MAAM,mEAAmE;AAAA,MACrF;AAEA,UAAI,CAAC,eAAe,QAAQ;AAC1B,cAAM,IAAI,MAAM,0EAA0E;AAAA,MAC5F;AAEA,YAAM,cAAc;AACpB,YAAM,UAAmB,CAAC;AAC1B,YAAM,kBAAmC,CAAC;AAE1C,YAAM,UAAmB;AAAA,QACvB,QAAQ;AAAA,QACR,MAAM;AAAA,QACN;AAAA,QACA;AAAA,QACA,MAAM;AAAA,MACR;AAEA,aAAO,YAAY,QAAQ,SAAS,cAAc;AAAA,IACpD;AAAA,EACF;AACF;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/insightsClient.ts"],"sourcesContent":["// 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.\n\nimport type {\n CreateClientOptions,\n Headers,\n Host,\n QueryParameters,\n Request,\n RequestOptions,\n} from '@algolia/client-common';\nimport { createAuth, createTransporter, getAlgoliaAgent } from '@algolia/client-common';\n\nimport type { EventsResponse } from '../model/eventsResponse';\nimport type { InsightsEvents } from '../model/insightsEvents';\n\nimport type {\n CustomDeleteProps,\n CustomGetProps,\n CustomPostProps,\n CustomPutProps,\n DeleteUserTokenProps,\n} from '../model/clientMethodProps';\n\nexport const apiClientVersion = '5.20.4';\n\nexport const REGIONS = ['de', 'us'] as const;\nexport type Region = (typeof REGIONS)[number];\nexport type RegionOptions = { region?: Region };\n\nfunction getDefaultHosts(region?: Region): Host[] {\n const url = !region ? 'insights.algolia.io' : 'insights.{region}.algolia.io'.replace('{region}', region);\n\n return [{ url, accept: 'readWrite', protocol: 'https' }];\n}\n\nexport function createInsightsClient({\n appId: appIdOption,\n apiKey: apiKeyOption,\n authMode,\n algoliaAgents,\n region: regionOption,\n ...options\n}: CreateClientOptions & RegionOptions) {\n const auth = createAuth(appIdOption, apiKeyOption, authMode);\n const transporter = createTransporter({\n hosts: getDefaultHosts(regionOption),\n ...options,\n algoliaAgent: getAlgoliaAgent({\n algoliaAgents,\n client: 'Insights',\n version: apiClientVersion,\n }),\n baseHeaders: {\n 'content-type': 'text/plain',\n ...auth.headers(),\n ...options.baseHeaders,\n },\n baseQueryParameters: {\n ...auth.queryParameters(),\n ...options.baseQueryParameters,\n },\n });\n\n return {\n transporter,\n\n /**\n * The `appId` currently in use.\n */\n appId: appIdOption,\n\n /**\n * The `apiKey` currently in use.\n */\n apiKey: apiKeyOption,\n\n /**\n * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.\n */\n clearCache(): Promise<void> {\n return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => undefined);\n },\n\n /**\n * Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.\n */\n get _ua(): string {\n return transporter.algoliaAgent.value;\n },\n\n /**\n * Adds a `segment` to the `x-algolia-agent` sent with every requests.\n *\n * @param segment - The algolia agent (user-agent) segment to add.\n * @param version - The version of the agent.\n */\n addAlgoliaAgent(segment: string, version?: string): void {\n transporter.algoliaAgent.add({ segment, version });\n },\n\n /**\n * Helper method to switch the API key used to authenticate the requests.\n *\n * @param params - Method params.\n * @param params.apiKey - The new API Key to use.\n */\n setClientApiKey({ apiKey }: { apiKey: string }): void {\n if (!authMode || authMode === 'WithinHeaders') {\n transporter.baseHeaders['x-algolia-api-key'] = apiKey;\n } else {\n transporter.baseQueryParameters['x-algolia-api-key'] = apiKey;\n }\n },\n\n /**\n * This method lets you send requests to the Algolia REST API.\n * @param customDelete - The customDelete object.\n * @param customDelete.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\n * @param customDelete.parameters - Query parameters to apply to the current query.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customDelete(\n { path, parameters }: CustomDeleteProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customDelete`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'DELETE',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * This method lets you send requests to the Algolia REST API.\n * @param customGet - The customGet object.\n * @param customGet.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\n * @param customGet.parameters - Query parameters to apply to the current query.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customGet({ path, parameters }: CustomGetProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customGet`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * This method lets you send requests to the Algolia REST API.\n * @param customPost - The customPost object.\n * @param customPost.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\n * @param customPost.parameters - Query parameters to apply to the current query.\n * @param customPost.body - Parameters to send with the custom request.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customPost(\n { path, parameters, body }: CustomPostProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customPost`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: body ? body : {},\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * This method lets you send requests to the Algolia REST API.\n * @param customPut - The customPut object.\n * @param customPut.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\n * @param customPut.parameters - Query parameters to apply to the current query.\n * @param customPut.body - Parameters to send with the custom request.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customPut(\n { path, parameters, body }: CustomPutProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customPut`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'PUT',\n path: requestPath,\n queryParameters,\n headers,\n data: body ? body : {},\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * 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` in the Personalization API.\n * @param deleteUserToken - The deleteUserToken object.\n * @param deleteUserToken.userToken - User token for which to delete all associated events.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n deleteUserToken({ userToken }: DeleteUserTokenProps, requestOptions?: RequestOptions): Promise<void> {\n if (!userToken) {\n throw new Error('Parameter `userToken` is required when calling `deleteUserToken`.');\n }\n\n const requestPath = '/1/usertokens/{userToken}'.replace('{userToken}', encodeURIComponent(userToken));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'DELETE',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * 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.\n * @param insightsEvents - The insightsEvents object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n pushEvents(insightsEvents: InsightsEvents, requestOptions?: RequestOptions): Promise<EventsResponse> {\n if (!insightsEvents) {\n throw new Error('Parameter `insightsEvents` is required when calling `pushEvents`.');\n }\n\n if (!insightsEvents.events) {\n throw new Error('Parameter `insightsEvents.events` is required when calling `pushEvents`.');\n }\n\n const requestPath = '/1/events';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: insightsEvents,\n };\n\n return transporter.request(request, requestOptions);\n },\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUA,2BAA+D;AAaxD,IAAM,mBAAmB;AAEzB,IAAM,UAAU,CAAC,MAAM,IAAI;AAIlC,SAAS,gBAAgB,QAAyB;AAChD,QAAM,MAAM,CAAC,SAAS,wBAAwB,+BAA+B,QAAQ,YAAY,MAAM;AAEvG,SAAO,CAAC,EAAE,KAAK,QAAQ,aAAa,UAAU,QAAQ,CAAC;AACzD;AAEO,SAAS,qBAAqB;AAAA,EACnC,OAAO;AAAA,EACP,QAAQ;AAAA,EACR;AAAA,EACA;AAAA,EACA,QAAQ;AAAA,EACR,GAAG;AACL,GAAwC;AACtC,QAAM,WAAO,iCAAW,aAAa,cAAc,QAAQ;AAC3D,QAAM,kBAAc,wCAAkB;AAAA,IACpC,OAAO,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oliaAgent } from "@algolia/client-common";
|
|
3
|
-
var apiClientVersion = "5.20.
|
|
3
|
+
var apiClientVersion = "5.20.4";
|
|
4
4
|
var REGIONS = ["de", "us"];
|
|
5
5
|
function getDefaultHosts(region) {
|
|
6
6
|
const url = !region ? "insights.algolia.io" : "insights.{region}.algolia.io".replace("{region}", region);
|
|
@@ -78,7 +78,7 @@ function createInsightsClient({
|
|
|
78
78
|
}
|
|
79
79
|
},
|
|
80
80
|
/**
|
|
81
|
-
* This method
|
|
81
|
+
* This method lets you send requests to the Algolia REST API.
|
|
82
82
|
* @param customDelete - The customDelete object.
|
|
83
83
|
* @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
84
84
|
* @param customDelete.parameters - Query parameters to apply to the current query.
|
|
@@ -100,7 +100,7 @@ function createInsightsClient({
|
|
|
100
100
|
return transporter.request(request, requestOptions);
|
|
101
101
|
},
|
|
102
102
|
/**
|
|
103
|
-
* This method
|
|
103
|
+
* This method lets you send requests to the Algolia REST API.
|
|
104
104
|
* @param customGet - The customGet object.
|
|
105
105
|
* @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
106
106
|
* @param customGet.parameters - Query parameters to apply to the current query.
|
|
@@ -122,7 +122,7 @@ function createInsightsClient({
|
|
|
122
122
|
return transporter.request(request, requestOptions);
|
|
123
123
|
},
|
|
124
124
|
/**
|
|
125
|
-
* This method
|
|
125
|
+
* This method lets you send requests to the Algolia REST API.
|
|
126
126
|
* @param customPost - The customPost object.
|
|
127
127
|
* @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
128
128
|
* @param customPost.parameters - Query parameters to apply to the current query.
|
|
@@ -146,7 +146,7 @@ function createInsightsClient({
|
|
|
146
146
|
return transporter.request(request, requestOptions);
|
|
147
147
|
},
|
|
148
148
|
/**
|
|
149
|
-
* This method
|
|
149
|
+
* This method lets you send requests to the Algolia REST API.
|
|
150
150
|
* @param customPut - The customPut object.
|
|
151
151
|
* @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
152
152
|
* @param customPut.parameters - Query parameters to apply to the current query.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/insightsClient.ts"],"sourcesContent":["// 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.\n\nimport type {\n CreateClientOptions,\n Headers,\n Host,\n QueryParameters,\n Request,\n RequestOptions,\n} from '@algolia/client-common';\nimport { createAuth, createTransporter, getAlgoliaAgent } from '@algolia/client-common';\n\nimport type { EventsResponse } from '../model/eventsResponse';\nimport type { InsightsEvents } from '../model/insightsEvents';\n\nimport type {\n CustomDeleteProps,\n CustomGetProps,\n CustomPostProps,\n CustomPutProps,\n DeleteUserTokenProps,\n} from '../model/clientMethodProps';\n\nexport const apiClientVersion = '5.20.3';\n\nexport const REGIONS = ['de', 'us'] as const;\nexport type Region = (typeof REGIONS)[number];\nexport type RegionOptions = { region?: Region };\n\nfunction getDefaultHosts(region?: Region): Host[] {\n const url = !region ? 'insights.algolia.io' : 'insights.{region}.algolia.io'.replace('{region}', region);\n\n return [{ url, accept: 'readWrite', protocol: 'https' }];\n}\n\nexport function createInsightsClient({\n appId: appIdOption,\n apiKey: apiKeyOption,\n authMode,\n algoliaAgents,\n region: regionOption,\n ...options\n}: CreateClientOptions & RegionOptions) {\n const auth = createAuth(appIdOption, apiKeyOption, authMode);\n const transporter = createTransporter({\n hosts: getDefaultHosts(regionOption),\n ...options,\n algoliaAgent: getAlgoliaAgent({\n algoliaAgents,\n client: 'Insights',\n version: apiClientVersion,\n }),\n baseHeaders: {\n 'content-type': 'text/plain',\n ...auth.headers(),\n ...options.baseHeaders,\n },\n baseQueryParameters: {\n ...auth.queryParameters(),\n ...options.baseQueryParameters,\n },\n });\n\n return {\n transporter,\n\n /**\n * The `appId` currently in use.\n */\n appId: appIdOption,\n\n /**\n * The `apiKey` currently in use.\n */\n apiKey: apiKeyOption,\n\n /**\n * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.\n */\n clearCache(): Promise<void> {\n return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => undefined);\n },\n\n /**\n * Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.\n */\n get _ua(): string {\n return transporter.algoliaAgent.value;\n },\n\n /**\n * Adds a `segment` to the `x-algolia-agent` sent with every requests.\n *\n * @param segment - The algolia agent (user-agent) segment to add.\n * @param version - The version of the agent.\n */\n addAlgoliaAgent(segment: string, version?: string): void {\n transporter.algoliaAgent.add({ segment, version });\n },\n\n /**\n * Helper method to switch the API key used to authenticate the requests.\n *\n * @param params - Method params.\n * @param params.apiKey - The new API Key to use.\n */\n setClientApiKey({ apiKey }: { apiKey: string }): void {\n if (!authMode || authMode === 'WithinHeaders') {\n transporter.baseHeaders['x-algolia-api-key'] = apiKey;\n } else {\n transporter.baseQueryParameters['x-algolia-api-key'] = apiKey;\n }\n },\n\n /**\n * This method allow you to send requests to the Algolia REST API.\n * @param customDelete - The customDelete object.\n * @param customDelete.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\n * @param customDelete.parameters - Query parameters to apply to the current query.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customDelete(\n { path, parameters }: CustomDeleteProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customDelete`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'DELETE',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * This method allow you to send requests to the Algolia REST API.\n * @param customGet - The customGet object.\n * @param customGet.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\n * @param customGet.parameters - Query parameters to apply to the current query.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customGet({ path, parameters }: CustomGetProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customGet`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * This method allow you to send requests to the Algolia REST API.\n * @param customPost - The customPost object.\n * @param customPost.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\n * @param customPost.parameters - Query parameters to apply to the current query.\n * @param customPost.body - Parameters to send with the custom request.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customPost(\n { path, parameters, body }: CustomPostProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customPost`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: body ? body : {},\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * This method allow you to send requests to the Algolia REST API.\n * @param customPut - The customPut object.\n * @param customPut.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\n * @param customPut.parameters - Query parameters to apply to the current query.\n * @param customPut.body - Parameters to send with the custom request.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customPut(\n { path, parameters, body }: CustomPutProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customPut`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'PUT',\n path: requestPath,\n queryParameters,\n headers,\n data: body ? body : {},\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * 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` in the Personalization API.\n * @param deleteUserToken - The deleteUserToken object.\n * @param deleteUserToken.userToken - User token for which to delete all associated events.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n deleteUserToken({ userToken }: DeleteUserTokenProps, requestOptions?: RequestOptions): Promise<void> {\n if (!userToken) {\n throw new Error('Parameter `userToken` is required when calling `deleteUserToken`.');\n }\n\n const requestPath = '/1/usertokens/{userToken}'.replace('{userToken}', encodeURIComponent(userToken));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'DELETE',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * 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.\n * @param insightsEvents - The insightsEvents object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n pushEvents(insightsEvents: InsightsEvents, requestOptions?: RequestOptions): Promise<EventsResponse> {\n if (!insightsEvents) {\n throw new Error('Parameter `insightsEvents` is required when calling `pushEvents`.');\n }\n\n if (!insightsEvents.events) {\n throw new Error('Parameter `insightsEvents.events` is required when calling `pushEvents`.');\n }\n\n const requestPath = '/1/events';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: insightsEvents,\n };\n\n return transporter.request(request, requestOptions);\n },\n };\n}\n"],"mappings":";AAUA,SAAS,YAAY,mBAAmB,uBAAuB;AAaxD,IAAM,mBAAmB;AAEzB,IAAM,UAAU,CAAC,MAAM,IAAI;AAIlC,SAAS,gBAAgB,QAAyB;AAChD,QAAM,MAAM,CAAC,SAAS,wBAAwB,+BAA+B,QAAQ,YAAY,MA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,YAAM,kBAAmC,CAAC;AAE1C,YAAM,UAAmB;AAAA,QACvB,QAAQ;AAAA,QACR,MAAM;AAAA,QACN;AAAA,QACA;AAAA,QACA,MAAM;AAAA,MACR;AAEA,aAAO,YAAY,QAAQ,SAAS,cAAc;AAAA,IACpD;AAAA,EACF;AACF;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/insightsClient.ts"],"sourcesContent":["// 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.\n\nimport type {\n CreateClientOptions,\n Headers,\n Host,\n QueryParameters,\n Request,\n RequestOptions,\n} from '@algolia/client-common';\nimport { createAuth, createTransporter, getAlgoliaAgent } from '@algolia/client-common';\n\nimport type { EventsResponse } from '../model/eventsResponse';\nimport type { InsightsEvents } from '../model/insightsEvents';\n\nimport type {\n CustomDeleteProps,\n CustomGetProps,\n CustomPostProps,\n CustomPutProps,\n DeleteUserTokenProps,\n} from '../model/clientMethodProps';\n\nexport const apiClientVersion = '5.20.4';\n\nexport const REGIONS = ['de', 'us'] as const;\nexport type Region = (typeof REGIONS)[number];\nexport type RegionOptions = { region?: Region };\n\nfunction getDefaultHosts(region?: Region): Host[] {\n const url = !region ? 'insights.algolia.io' : 'insights.{region}.algolia.io'.replace('{region}', region);\n\n return [{ url, accept: 'readWrite', protocol: 'https' }];\n}\n\nexport function createInsightsClient({\n appId: appIdOption,\n apiKey: apiKeyOption,\n authMode,\n algoliaAgents,\n region: regionOption,\n ...options\n}: CreateClientOptions & RegionOptions) {\n const auth = createAuth(appIdOption, apiKeyOption, authMode);\n const transporter = createTransporter({\n hosts: getDefaultHosts(regionOption),\n ...options,\n algoliaAgent: getAlgoliaAgent({\n algoliaAgents,\n client: 'Insights',\n version: apiClientVersion,\n }),\n baseHeaders: {\n 'content-type': 'text/plain',\n ...auth.headers(),\n ...options.baseHeaders,\n },\n baseQueryParameters: {\n ...auth.queryParameters(),\n ...options.baseQueryParameters,\n },\n });\n\n return {\n transporter,\n\n /**\n * The `appId` currently in use.\n */\n appId: appIdOption,\n\n /**\n * The `apiKey` currently in use.\n */\n apiKey: apiKeyOption,\n\n /**\n * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.\n */\n clearCache(): Promise<void> {\n return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => undefined);\n },\n\n /**\n * Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.\n */\n get _ua(): string {\n return transporter.algoliaAgent.value;\n },\n\n /**\n * Adds a `segment` to the `x-algolia-agent` sent with every requests.\n *\n * @param segment - The algolia agent (user-agent) segment to add.\n * @param version - The version of the agent.\n */\n addAlgoliaAgent(segment: string, version?: string): void {\n transporter.algoliaAgent.add({ segment, version });\n },\n\n /**\n * Helper method to switch the API key used to authenticate the requests.\n *\n * @param params - Method params.\n * @param params.apiKey - The new API Key to use.\n */\n setClientApiKey({ apiKey }: { apiKey: string }): void {\n if (!authMode || authMode === 'WithinHeaders') {\n transporter.baseHeaders['x-algolia-api-key'] = apiKey;\n } else {\n transporter.baseQueryParameters['x-algolia-api-key'] = apiKey;\n }\n },\n\n /**\n * This method lets you send requests to the Algolia REST API.\n * @param customDelete - The customDelete object.\n * @param customDelete.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\n * @param customDelete.parameters - Query parameters to apply to the current query.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customDelete(\n { path, parameters }: CustomDeleteProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customDelete`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'DELETE',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * This method lets you send requests to the Algolia REST API.\n * @param customGet - The customGet object.\n * @param customGet.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\n * @param customGet.parameters - Query parameters to apply to the current query.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customGet({ path, parameters }: CustomGetProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customGet`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * This method lets you send requests to the Algolia REST API.\n * @param customPost - The customPost object.\n * @param customPost.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\n * @param customPost.parameters - Query parameters to apply to the current query.\n * @param customPost.body - Parameters to send with the custom request.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customPost(\n { path, parameters, body }: CustomPostProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customPost`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: body ? body : {},\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * This method lets you send requests to the Algolia REST API.\n * @param customPut - The customPut object.\n * @param customPut.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\n * @param customPut.parameters - Query parameters to apply to the current query.\n * @param customPut.body - Parameters to send with the custom request.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customPut(\n { path, parameters, body }: CustomPutProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customPut`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'PUT',\n path: requestPath,\n queryParameters,\n headers,\n data: body ? body : {},\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * 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` in the Personalization API.\n * @param deleteUserToken - The deleteUserToken object.\n * @param deleteUserToken.userToken - User token for which to delete all associated events.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n deleteUserToken({ userToken }: DeleteUserTokenProps, requestOptions?: RequestOptions): Promise<void> {\n if (!userToken) {\n throw new Error('Parameter `userToken` is required when calling `deleteUserToken`.');\n }\n\n const requestPath = '/1/usertokens/{userToken}'.replace('{userToken}', encodeURIComponent(userToken));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'DELETE',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * 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.\n * @param insightsEvents - The insightsEvents object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n pushEvents(insightsEvents: InsightsEvents, requestOptions?: RequestOptions): Promise<EventsResponse> {\n if (!insightsEvents) {\n throw new Error('Parameter `insightsEvents` is required when calling `pushEvents`.');\n }\n\n if (!insightsEvents.events) {\n throw new Error('Parameter `insightsEvents.events` is required when calling `pushEvents`.');\n }\n\n const requestPath = '/1/events';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: insightsEvents,\n };\n\n return transporter.request(request, requestOptions);\n },\n };\n}\n"],"mappings":";AAUA,SAAS,YAAY,mBAAmB,uBAAuB;AAaxD,IAAM,mBAAmB;AAEzB,IAAM,UAAU,C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AAe,QAAQ;AAC1B,cAAM,IAAI,MAAM,0EAA0E;AAAA,MAC5F;AAEA,YAAM,cAAc;AACpB,YAAM,UAAmB,CAAC;AAC1B,YAAM,kBAAmC,CAAC;AAE1C,YAAM,UAAmB;AAAA,QACvB,QAAQ;AAAA,QACR,MAAM;AAAA,QACN;AAAA,QACA;AAAA,QACA,MAAM;AAAA,MACR;AAEA,aAAO,YAAY,QAAQ,SAAS,cAAc;AAAA,IACpD;AAAA,EACF;AACF;","names":[]}
|
package/dist/worker.d.ts
CHANGED
|
@@ -574,7 +574,7 @@ type DeleteUserTokenProps = {
|
|
|
574
574
|
userToken: string;
|
|
575
575
|
};
|
|
576
576
|
|
|
577
|
-
declare const apiClientVersion = "5.20.
|
|
577
|
+
declare const apiClientVersion = "5.20.4";
|
|
578
578
|
declare const REGIONS: readonly ["de", "us"];
|
|
579
579
|
type Region = (typeof REGIONS)[number];
|
|
580
580
|
type RegionOptions = {
|
|
@@ -615,7 +615,7 @@ declare function createInsightsClient({ appId: appIdOption, apiKey: apiKeyOption
|
|
|
615
615
|
apiKey: string;
|
|
616
616
|
}): void;
|
|
617
617
|
/**
|
|
618
|
-
* This method
|
|
618
|
+
* This method lets you send requests to the Algolia REST API.
|
|
619
619
|
* @param customDelete - The customDelete object.
|
|
620
620
|
* @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
621
621
|
* @param customDelete.parameters - Query parameters to apply to the current query.
|
|
@@ -623,7 +623,7 @@ declare function createInsightsClient({ appId: appIdOption, apiKey: apiKeyOption
|
|
|
623
623
|
*/
|
|
624
624
|
customDelete({ path, parameters }: CustomDeleteProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
|
|
625
625
|
/**
|
|
626
|
-
* This method
|
|
626
|
+
* This method lets you send requests to the Algolia REST API.
|
|
627
627
|
* @param customGet - The customGet object.
|
|
628
628
|
* @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
629
629
|
* @param customGet.parameters - Query parameters to apply to the current query.
|
|
@@ -631,7 +631,7 @@ declare function createInsightsClient({ appId: appIdOption, apiKey: apiKeyOption
|
|
|
631
631
|
*/
|
|
632
632
|
customGet({ path, parameters }: CustomGetProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
|
|
633
633
|
/**
|
|
634
|
-
* This method
|
|
634
|
+
* This method lets you send requests to the Algolia REST API.
|
|
635
635
|
* @param customPost - The customPost object.
|
|
636
636
|
* @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
637
637
|
* @param customPost.parameters - Query parameters to apply to the current query.
|
|
@@ -640,7 +640,7 @@ declare function createInsightsClient({ appId: appIdOption, apiKey: apiKeyOption
|
|
|
640
640
|
*/
|
|
641
641
|
customPost({ path, parameters, body }: CustomPostProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
|
|
642
642
|
/**
|
|
643
|
-
* This method
|
|
643
|
+
* This method lets you send requests to the Algolia REST API.
|
|
644
644
|
* @param customPut - The customPut object.
|
|
645
645
|
* @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
646
646
|
* @param customPut.parameters - Query parameters to apply to the current query.
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "5.20.
|
|
2
|
+
"version": "5.20.4",
|
|
3
3
|
"repository": {
|
|
4
4
|
"type": "git",
|
|
5
5
|
"url": "git+https://github.com/algolia/algoliasearch-client-javascript.git"
|
|
@@ -49,17 +49,17 @@
|
|
|
49
49
|
"index.d.ts"
|
|
50
50
|
],
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@algolia/client-common": "5.20.
|
|
53
|
-
"@algolia/requester-browser-xhr": "5.20.
|
|
54
|
-
"@algolia/requester-fetch": "5.20.
|
|
55
|
-
"@algolia/requester-node-http": "5.20.
|
|
52
|
+
"@algolia/client-common": "5.20.4",
|
|
53
|
+
"@algolia/requester-browser-xhr": "5.20.4",
|
|
54
|
+
"@algolia/requester-fetch": "5.20.4",
|
|
55
|
+
"@algolia/requester-node-http": "5.20.4"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
|
-
"@arethetypeswrong/cli": "0.17.
|
|
59
|
-
"@types/node": "22.13.
|
|
60
|
-
"publint": "0.3.
|
|
61
|
-
"rollup": "4.34.
|
|
62
|
-
"tsup": "8.
|
|
58
|
+
"@arethetypeswrong/cli": "0.17.4",
|
|
59
|
+
"@types/node": "22.13.8",
|
|
60
|
+
"publint": "0.3.7",
|
|
61
|
+
"rollup": "4.34.9",
|
|
62
|
+
"tsup": "8.4.0",
|
|
63
63
|
"typescript": "5.7.3"
|
|
64
64
|
},
|
|
65
65
|
"engines": {
|