Skip to content

Commit

Permalink
feat(javascript): add every APIs (generated)
Browse files Browse the repository at this point in the history
algolia/api-clients-automation#3942

Co-authored-by: algolia-bot <accounts+algolia-api-client-bot@algolia.com>
  • Loading branch information
algolia-bot committed Oct 14, 2024
1 parent 02ef8ca commit e035c93
Show file tree
Hide file tree
Showing 36 changed files with 339 additions and 118 deletions.
10 changes: 5 additions & 5 deletions bundlesize.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
"files": [
{
"path": "packages/algoliasearch/dist/algoliasearch.umd.js",
"maxSize": "9.50KB"
"maxSize": "12.60KB"
},
{
"path": "packages/algoliasearch/dist/lite/builds/browser.umd.js",
"maxSize": "3.95KB"
},
{
"path": "packages/client-abtesting/dist/builds/browser.umd.js",
"maxSize": "4.10KB"
"maxSize": "4.15KB"
},
{
"path": "packages/client-analytics/dist/builds/browser.umd.js",
"maxSize": "4.75KB"
"maxSize": "4.85KB"
},
{
"path": "packages/client-insights/dist/builds/browser.umd.js",
Expand All @@ -30,7 +30,7 @@
},
{
"path": "packages/client-search/dist/builds/browser.umd.js",
"maxSize": "7.15KB"
"maxSize": "7.25KB"
},
{
"path": "packages/ingestion/dist/builds/browser.umd.js",
Expand All @@ -42,7 +42,7 @@
},
{
"path": "packages/recommend/dist/builds/browser.umd.js",
"maxSize": "4.10KB"
"maxSize": "4.15KB"
}
]
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
],
"scripts": {
"build:all": "lerna run build --include-dependencies",
"build:many": "lerna run build --scope '@algolia/requester-testing' --scope ${0:-'{@algolia/*,algoliasearch}'} --include-dependencies",
"build:many": "lerna run build --scope '@algolia/requester-testing' --scope '@algolia/logger-console' --scope ${0:-'{@algolia/*,algoliasearch}'} --include-dependencies",
"clean": "lerna run clean",
"release:bump": "lerna version ${0:-patch} --no-changelog --no-git-tag-version --no-push --exact --force-publish --yes",
"release:publish": "tsc --project scripts/tsconfig.json && node scripts/dist/scripts/publish.js",
Expand Down
89 changes: 69 additions & 20 deletions packages/algoliasearch/builds/browser.ts
Original file line number Diff line number Diff line change
@@ -1,29 +1,47 @@
// 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.

import type { AbtestingClient, Region as AbtestingRegion } from '@algolia/client-abtesting';
import type { AnalyticsClient, Region as AnalyticsRegion } from '@algolia/client-analytics';
import type { ClientOptions } from '@algolia/client-common';
import type { PersonalizationClient, Region as PersonalizationRegion } from '@algolia/client-personalization';
import type { SearchClient } from '@algolia/client-search';
import type { RecommendClient } from '@algolia/recommend';
import { searchClient } from '@algolia/client-search';

import type { AbtestingClient } from '@algolia/client-abtesting';
import { abtestingClient } from '@algolia/client-abtesting';
import type { AnalyticsClient } from '@algolia/client-analytics';
import { analyticsClient } from '@algolia/client-analytics';
import type { InsightsClient } from '@algolia/client-insights';
import { insightsClient } from '@algolia/client-insights';
import type { PersonalizationClient } from '@algolia/client-personalization';
import { personalizationClient } from '@algolia/client-personalization';
import { searchClient } from '@algolia/client-search';
import type { QuerySuggestionsClient } from '@algolia/client-query-suggestions';
import { querySuggestionsClient } from '@algolia/client-query-suggestions';
import type { IngestionClient } from '@algolia/ingestion';
import { ingestionClient } from '@algolia/ingestion';
import type { MonitoringClient } from '@algolia/monitoring';
import { monitoringClient } from '@algolia/monitoring';
import type { RecommendClient } from '@algolia/recommend';
import { recommendClient } from '@algolia/recommend';

import type { InitClientOptions, InitClientRegion } from './models';
import type {
AbtestingRegionOptions,
AnalyticsRegionOptions,
IngestionRegionOptions,
InitClientOptions,
InsightsRegionOptions,
PersonalizationRegionOptions,
QuerySuggestionsRegionOptions,
} from './models';

export * from './models';

export type Algoliasearch = SearchClient & {
initRecommend: (initOptions?: InitClientOptions) => RecommendClient;
initAnalytics: (initOptions?: InitClientOptions & InitClientRegion<AnalyticsRegion>) => AnalyticsClient;
initAbtesting: (initOptions?: InitClientOptions & InitClientRegion<AbtestingRegion>) => AbtestingClient;
initPersonalization: (
initOptions: InitClientOptions & Required<InitClientRegion<PersonalizationRegion>>,
) => PersonalizationClient;
initAbtesting: (initOptions: InitClientOptions & AbtestingRegionOptions) => AbtestingClient;
initAnalytics: (initOptions: InitClientOptions & AnalyticsRegionOptions) => AnalyticsClient;
initIngestion: (initOptions: InitClientOptions & IngestionRegionOptions) => IngestionClient;
initInsights: (initOptions: InitClientOptions & InsightsRegionOptions) => InsightsClient;
initMonitoring: (initOptions: InitClientOptions) => MonitoringClient;
initPersonalization: (initOptions: InitClientOptions & PersonalizationRegionOptions) => PersonalizationClient;
initQuerySuggestions: (initOptions: InitClientOptions & QuerySuggestionsRegionOptions) => QuerySuggestionsClient;
initRecommend: (initOptions: InitClientOptions) => RecommendClient;
};

export function algoliasearch(appId: string, apiKey: string, options?: ClientOptions): Algoliasearch {
Expand All @@ -39,17 +57,24 @@ export function algoliasearch(appId: string, apiKey: string, options?: ClientOpt

return {
...client,

/**
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
*/
get _ua(): string {
return client.transporter.algoliaAgent.value;
},
initRecommend: (initOptions: InitClientOptions = {}): RecommendClient => {
return recommendClient(initOptions.appId || appId, initOptions.apiKey || apiKey, initOptions.options);

initAbtesting: (initOptions: InitClientOptions & AbtestingRegionOptions): AbtestingClient => {
return abtestingClient(
initOptions.appId || appId,
initOptions.apiKey || apiKey,
initOptions.region,
initOptions.options,
);
},

initAnalytics: (initOptions: InitClientOptions & InitClientRegion<AnalyticsRegion> = {}): AnalyticsClient => {
initAnalytics: (initOptions: InitClientOptions & AnalyticsRegionOptions): AnalyticsClient => {
return analyticsClient(
initOptions.appId || appId,
initOptions.apiKey || apiKey,
Expand All @@ -58,24 +83,48 @@ export function algoliasearch(appId: string, apiKey: string, options?: ClientOpt
);
},

initAbtesting: (initOptions: InitClientOptions & InitClientRegion<AbtestingRegion> = {}): AbtestingClient => {
return abtestingClient(
initIngestion: (initOptions: InitClientOptions & IngestionRegionOptions): IngestionClient => {
return ingestionClient(
initOptions.appId || appId,
initOptions.apiKey || apiKey,
initOptions.region,
initOptions.options,
);
},

initPersonalization: (
initOptions: InitClientOptions & Required<InitClientRegion<PersonalizationRegion>>,
): PersonalizationClient => {
initInsights: (initOptions: InitClientOptions & InsightsRegionOptions): InsightsClient => {
return insightsClient(
initOptions.appId || appId,
initOptions.apiKey || apiKey,
initOptions.region,
initOptions.options,
);
},

initMonitoring: (initOptions: InitClientOptions): MonitoringClient => {
return monitoringClient(initOptions.appId || appId, initOptions.apiKey || apiKey, initOptions.options);
},

initPersonalization: (initOptions: InitClientOptions & PersonalizationRegionOptions): PersonalizationClient => {
return personalizationClient(
initOptions.appId || appId,
initOptions.apiKey || apiKey,
initOptions.region,
initOptions.options,
);
},

initQuerySuggestions: (initOptions: InitClientOptions & QuerySuggestionsRegionOptions): QuerySuggestionsClient => {
return querySuggestionsClient(
initOptions.appId || appId,
initOptions.apiKey || apiKey,
initOptions.region,
initOptions.options,
);
},

initRecommend: (initOptions: InitClientOptions): RecommendClient => {
return recommendClient(initOptions.appId || appId, initOptions.apiKey || apiKey, initOptions.options);
},
};
}
89 changes: 69 additions & 20 deletions packages/algoliasearch/builds/fetch.ts
Original file line number Diff line number Diff line change
@@ -1,29 +1,47 @@
// 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.

import type { AbtestingClient, Region as AbtestingRegion } from '@algolia/client-abtesting';
import type { AnalyticsClient, Region as AnalyticsRegion } from '@algolia/client-analytics';
import type { ClientOptions } from '@algolia/client-common';
import type { PersonalizationClient, Region as PersonalizationRegion } from '@algolia/client-personalization';
import type { SearchClient } from '@algolia/client-search';
import type { RecommendClient } from '@algolia/recommend';
import { searchClient } from '@algolia/client-search';

import type { AbtestingClient } from '@algolia/client-abtesting';
import { abtestingClient } from '@algolia/client-abtesting';
import type { AnalyticsClient } from '@algolia/client-analytics';
import { analyticsClient } from '@algolia/client-analytics';
import type { InsightsClient } from '@algolia/client-insights';
import { insightsClient } from '@algolia/client-insights';
import type { PersonalizationClient } from '@algolia/client-personalization';
import { personalizationClient } from '@algolia/client-personalization';
import { searchClient } from '@algolia/client-search';
import type { QuerySuggestionsClient } from '@algolia/client-query-suggestions';
import { querySuggestionsClient } from '@algolia/client-query-suggestions';
import type { IngestionClient } from '@algolia/ingestion';
import { ingestionClient } from '@algolia/ingestion';
import type { MonitoringClient } from '@algolia/monitoring';
import { monitoringClient } from '@algolia/monitoring';
import type { RecommendClient } from '@algolia/recommend';
import { recommendClient } from '@algolia/recommend';

import type { InitClientOptions, InitClientRegion } from './models';
import type {
AbtestingRegionOptions,
AnalyticsRegionOptions,
IngestionRegionOptions,
InitClientOptions,
InsightsRegionOptions,
PersonalizationRegionOptions,
QuerySuggestionsRegionOptions,
} from './models';

export * from './models';

export type Algoliasearch = SearchClient & {
initRecommend: (initOptions?: InitClientOptions) => RecommendClient;
initAnalytics: (initOptions?: InitClientOptions & InitClientRegion<AnalyticsRegion>) => AnalyticsClient;
initAbtesting: (initOptions?: InitClientOptions & InitClientRegion<AbtestingRegion>) => AbtestingClient;
initPersonalization: (
initOptions: InitClientOptions & Required<InitClientRegion<PersonalizationRegion>>,
) => PersonalizationClient;
initAbtesting: (initOptions: InitClientOptions & AbtestingRegionOptions) => AbtestingClient;
initAnalytics: (initOptions: InitClientOptions & AnalyticsRegionOptions) => AnalyticsClient;
initIngestion: (initOptions: InitClientOptions & IngestionRegionOptions) => IngestionClient;
initInsights: (initOptions: InitClientOptions & InsightsRegionOptions) => InsightsClient;
initMonitoring: (initOptions: InitClientOptions) => MonitoringClient;
initPersonalization: (initOptions: InitClientOptions & PersonalizationRegionOptions) => PersonalizationClient;
initQuerySuggestions: (initOptions: InitClientOptions & QuerySuggestionsRegionOptions) => QuerySuggestionsClient;
initRecommend: (initOptions: InitClientOptions) => RecommendClient;
};

export function algoliasearch(appId: string, apiKey: string, options?: ClientOptions): Algoliasearch {
Expand All @@ -39,17 +57,24 @@ export function algoliasearch(appId: string, apiKey: string, options?: ClientOpt

return {
...client,

/**
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
*/
get _ua(): string {
return client.transporter.algoliaAgent.value;
},
initRecommend: (initOptions: InitClientOptions = {}): RecommendClient => {
return recommendClient(initOptions.appId || appId, initOptions.apiKey || apiKey, initOptions.options);

initAbtesting: (initOptions: InitClientOptions & AbtestingRegionOptions): AbtestingClient => {
return abtestingClient(
initOptions.appId || appId,
initOptions.apiKey || apiKey,
initOptions.region,
initOptions.options,
);
},

initAnalytics: (initOptions: InitClientOptions & InitClientRegion<AnalyticsRegion> = {}): AnalyticsClient => {
initAnalytics: (initOptions: InitClientOptions & AnalyticsRegionOptions): AnalyticsClient => {
return analyticsClient(
initOptions.appId || appId,
initOptions.apiKey || apiKey,
Expand All @@ -58,24 +83,48 @@ export function algoliasearch(appId: string, apiKey: string, options?: ClientOpt
);
},

initAbtesting: (initOptions: InitClientOptions & InitClientRegion<AbtestingRegion> = {}): AbtestingClient => {
return abtestingClient(
initIngestion: (initOptions: InitClientOptions & IngestionRegionOptions): IngestionClient => {
return ingestionClient(
initOptions.appId || appId,
initOptions.apiKey || apiKey,
initOptions.region,
initOptions.options,
);
},

initPersonalization: (
initOptions: InitClientOptions & Required<InitClientRegion<PersonalizationRegion>>,
): PersonalizationClient => {
initInsights: (initOptions: InitClientOptions & InsightsRegionOptions): InsightsClient => {
return insightsClient(
initOptions.appId || appId,
initOptions.apiKey || apiKey,
initOptions.region,
initOptions.options,
);
},

initMonitoring: (initOptions: InitClientOptions): MonitoringClient => {
return monitoringClient(initOptions.appId || appId, initOptions.apiKey || apiKey, initOptions.options);
},

initPersonalization: (initOptions: InitClientOptions & PersonalizationRegionOptions): PersonalizationClient => {
return personalizationClient(
initOptions.appId || appId,
initOptions.apiKey || apiKey,
initOptions.region,
initOptions.options,
);
},

initQuerySuggestions: (initOptions: InitClientOptions & QuerySuggestionsRegionOptions): QuerySuggestionsClient => {
return querySuggestionsClient(
initOptions.appId || appId,
initOptions.apiKey || apiKey,
initOptions.region,
initOptions.options,
);
},

initRecommend: (initOptions: InitClientOptions): RecommendClient => {
return recommendClient(initOptions.appId || appId, initOptions.apiKey || apiKey, initOptions.options);
},
};
}
Loading

0 comments on commit e035c93

Please sign in to comment.