Skip to content

Commit

Permalink
fix(javascript): prevent conflict with version variable (#141)
Browse files Browse the repository at this point in the history
  • Loading branch information
shortcuts authored Feb 17, 2022
1 parent 452f0a4 commit 9eb7ec7
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import type { ABTestResponse } from '../model/aBTestResponse';
import type { AddABTestsRequest } from '../model/addABTestsRequest';
import type { ListABTestsResponse } from '../model/listABTestsResponse';

export const version = '5.0.0';
export const apiClientVersion = '5.0.0';

export type Region = 'de' | 'us';

Expand Down Expand Up @@ -42,7 +42,7 @@ export const createAbtestingApi = (
userAgent: getUserAgent({
userAgents: options.userAgents,
client: 'Abtesting',
version,
version: apiClientVersion,
}),
timeouts: options.timeouts,
requester: options.requester,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import type { GetTopSearchesResponse } from '../model/getTopSearchesResponse';
import type { GetTopSearchesResponseWithAnalytics } from '../model/getTopSearchesResponseWithAnalytics';
import type { GetUsersCountResponse } from '../model/getUsersCountResponse';

export const version = '5.0.0';
export const apiClientVersion = '5.0.0';

export type Region = 'de' | 'us';

Expand Down Expand Up @@ -57,7 +57,7 @@ export const createAnalyticsApi = (
userAgent: getUserAgent({
userAgents: options.userAgents,
client: 'Analytics',
version,
version: apiClientVersion,
}),
timeouts: options.timeouts,
requester: options.requester,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import type {
import type { InsightEvents } from '../model/insightEvents';
import type { PushEventsResponse } from '../model/pushEventsResponse';

export const version = '5.0.0';
export const apiClientVersion = '5.0.0';

export type Region = 'de' | 'us';

Expand Down Expand Up @@ -40,7 +40,7 @@ export const createInsightsApi = (
userAgent: getUserAgent({
userAgents: options.userAgents,
client: 'Insights',
version,
version: apiClientVersion,
}),
timeouts: options.timeouts,
requester: options.requester,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import type { GetUserTokenResponse } from '../model/getUserTokenResponse';
import type { PersonalizationStrategyParams } from '../model/personalizationStrategyParams';
import type { SetPersonalizationStrategyResponse } from '../model/setPersonalizationStrategyResponse';

export const version = '5.0.0';
export const apiClientVersion = '5.0.0';

export type Region = 'eu' | 'us';

Expand Down Expand Up @@ -40,7 +40,7 @@ export const createPersonalizationApi = (
userAgent: getUserAgent({
userAgents: options.userAgents,
client: 'Personalization',
version,
version: apiClientVersion,
}),
timeouts: options.timeouts,
requester: options.requester,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import type {
import type { FetchUserProfileResponse } from '../model/fetchUserProfileResponse';
import type { Params } from '../model/params';

export const version = '0.0.1';
export const apiClientVersion = '0.0.1';

function getDefaultHosts(): Host[] {
return [
Expand All @@ -34,7 +34,7 @@ export const createPredictApi = (options: CreateClientOptions) => {
userAgent: getUserAgent({
userAgents: options.userAgents,
client: 'Predict',
version,
version: apiClientVersion,
}),
timeouts: options.timeouts,
requester: options.requester,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import type { QuerySuggestionsIndexWithIndexParam } from '../model/querySuggesti
import type { Status } from '../model/status';
import type { SucessResponse } from '../model/sucessResponse';

export const version = '5.0.0';
export const apiClientVersion = '5.0.0';

export type Region = 'eu' | 'us';

Expand Down Expand Up @@ -42,7 +42,7 @@ export const createQuerySuggestionsApi = (
userAgent: getUserAgent({
userAgents: options.userAgents,
client: 'QuerySuggestions',
version,
version: apiClientVersion,
}),
timeouts: options.timeouts,
requester: options.requester,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ import type { UpdatedAtWithObjectIdResponse } from '../model/updatedAtWithObject
import type { UpdatedRuleResponse } from '../model/updatedRuleResponse';
import type { UserId } from '../model/userId';

export const version = '5.0.0';
export const apiClientVersion = '5.0.0';

function getDefaultHosts(appId: string): Host[] {
return (
Expand Down Expand Up @@ -118,7 +118,7 @@ export const createSearchApi = (options: CreateClientOptions) => {
userAgent: getUserAgent({
userAgents: options.userAgents,
client: 'Search',
version,
version: apiClientVersion,
}),
timeouts: options.timeouts,
requester: options.requester,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import type {
import type { PostIngestUrlResponse } from '../model/postIngestUrlResponse';
import type { PostURLJob } from '../model/postURLJob';

export const version = '0.0.1';
export const apiClientVersion = '0.0.1';

export type Region = 'de' | 'us';

Expand Down Expand Up @@ -38,7 +38,7 @@ export const createSourcesApi = (
userAgent: getUserAgent({
userAgents: options.userAgents,
client: 'Sources',
version,
version: apiClientVersion,
}),
timeouts: options.timeouts,
requester: options.requester,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import type {
import type { GetRecommendationsParams } from '../model/getRecommendationsParams';
import type { GetRecommendationsResponse } from '../model/getRecommendationsResponse';

export const version = '5.0.0';
export const apiClientVersion = '5.0.0';

function getDefaultHosts(appId: string): Host[] {
return (
Expand Down Expand Up @@ -64,7 +64,7 @@ export const createRecommendApi = (options: CreateClientOptions) => {
userAgent: getUserAgent({
userAgents: options.userAgents,
client: 'Recommend',
version,
version: apiClientVersion,
}),
timeouts: options.timeouts,
requester: options.requester,
Expand Down
4 changes: 2 additions & 2 deletions templates/javascript/api-single.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type { CreateClientOptions, Headers, Host, Request } from '@algolia/clien
import { {{classname}} } from '{{filename}}';
{{/imports}}

export const version = '{{packageVersion}}';
export const apiClientVersion = '{{packageVersion}}';

{{#operations}}
{{#description}}
Expand Down Expand Up @@ -82,7 +82,7 @@ export const create{{capitalizedApiName}}Api = (options: CreateClientOptions{{#h
userAgent: getUserAgent({
userAgents: options.userAgents,
client: '{{{capitalizedApiName}}}',
version,
version: apiClientVersion,
}),
timeouts: options.timeouts,
requester: options.requester,
Expand Down

0 comments on commit 9eb7ec7

Please sign in to comment.