Skip to content

Commit

Permalink
feat(javascript): expose current apiKey on the client instance [skip-…
Browse files Browse the repository at this point in the history
…bc] (generated)

algolia/api-clients-automation#4285

Co-authored-by: algolia-bot <accounts+algolia-api-client-bot@algolia.com>
Co-authored-by: Haroen Viaene <hello@haroen.me>
  • Loading branch information
algolia-bot and Haroenv committed Dec 24, 2024
1 parent c8a275c commit 3df88c8
Show file tree
Hide file tree
Showing 12 changed files with 59 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/algoliasearch/__tests__/algoliasearch.common.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ describe('api', () => {
expect(client.appId).toEqual('APP_ID');
});

test('exposes the `apiKey` currently in use at the root of the API', () => {
expect(client.apiKey).toEqual('API_KEY');
});

test('provides a `clearCache` method', () => {
expect(client.clearCache).not.toBeUndefined();
expect(() => client.clearCache()).not.toThrow();
Expand Down
5 changes: 5 additions & 0 deletions packages/algoliasearch/lite/src/liteClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ export function createLiteClient({
*/
appId: appIdOption,

/**
* The `apiKey` currently in use.
*/
apiKey: apiKeyOption,

/**
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
*/
Expand Down
5 changes: 5 additions & 0 deletions packages/client-abtesting/src/abtestingClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ export function createAbtestingClient({
*/
appId: appIdOption,

/**
* The `apiKey` currently in use.
*/
apiKey: apiKeyOption,

/**
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
*/
Expand Down
5 changes: 5 additions & 0 deletions packages/client-analytics/src/analyticsClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,11 @@ export function createAnalyticsClient({
*/
appId: appIdOption,

/**
* The `apiKey` currently in use.
*/
apiKey: apiKeyOption,

/**
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
*/
Expand Down
5 changes: 5 additions & 0 deletions packages/client-composition/src/compositionClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,11 @@ export function createCompositionClient({
*/
appId: appIdOption,

/**
* The `apiKey` currently in use.
*/
apiKey: apiKeyOption,

/**
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
*/
Expand Down
5 changes: 5 additions & 0 deletions packages/client-insights/src/insightsClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ export function createInsightsClient({
*/
appId: appIdOption,

/**
* The `apiKey` currently in use.
*/
apiKey: apiKeyOption,

/**
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
*/
Expand Down
5 changes: 5 additions & 0 deletions packages/client-personalization/src/personalizationClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ export function createPersonalizationClient({
*/
appId: appIdOption,

/**
* The `apiKey` currently in use.
*/
apiKey: apiKeyOption,

/**
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ export function createQuerySuggestionsClient({
*/
appId: appIdOption,

/**
* The `apiKey` currently in use.
*/
apiKey: apiKeyOption,

/**
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
*/
Expand Down
5 changes: 5 additions & 0 deletions packages/client-search/src/searchClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,11 @@ export function createSearchClient({
*/
appId: appIdOption,

/**
* The `apiKey` currently in use.
*/
apiKey: apiKeyOption,

/**
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
*/
Expand Down
5 changes: 5 additions & 0 deletions packages/ingestion/src/ingestionClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,11 @@ export function createIngestionClient({
*/
appId: appIdOption,

/**
* The `apiKey` currently in use.
*/
apiKey: apiKeyOption,

/**
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
*/
Expand Down
5 changes: 5 additions & 0 deletions packages/monitoring/src/monitoringClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ export function createMonitoringClient({
*/
appId: appIdOption,

/**
* The `apiKey` currently in use.
*/
apiKey: apiKeyOption,

/**
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
*/
Expand Down
5 changes: 5 additions & 0 deletions packages/recommend/src/recommendClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,11 @@ export function createRecommendClient({
*/
appId: appIdOption,

/**
* The `apiKey` currently in use.
*/
apiKey: apiKeyOption,

/**
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
*/
Expand Down

0 comments on commit 3df88c8

Please sign in to comment.