Skip to content

fix(js): add version to user agent #105

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ 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 class AbtestingApi {
protected authentications = {
apiKey: 'Algolia-API-Key',
Expand Down Expand Up @@ -60,7 +62,7 @@ export class AbtestingApi {
baseHeaders: {
'content-type': 'application/x-www-form-urlencoded',
},
userAgent: 'Algolia for Javascript',
userAgent: 'Algolia for Javascript (5.0.0)',
timeouts: {
connect: 2,
read: 5,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ 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 class AnalyticsApi {
protected authentications = {
apiKey: 'Algolia-API-Key',
Expand Down Expand Up @@ -75,7 +77,7 @@ export class AnalyticsApi {
baseHeaders: {
'content-type': 'application/x-www-form-urlencoded',
},
userAgent: 'Algolia for Javascript',
userAgent: 'Algolia for Javascript (5.0.0)',
timeouts: {
connect: 2,
read: 5,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import type {
import type { InsightEvents } from '../model/insightEvents';
import type { PushEventsResponse } from '../model/pushEventsResponse';

export const version = '5.0.0';

export class InsightsApi {
protected authentications = {
apiKey: 'Algolia-API-Key',
Expand Down Expand Up @@ -57,7 +59,7 @@ export class InsightsApi {
baseHeaders: {
'content-type': 'application/x-www-form-urlencoded',
},
userAgent: 'Algolia for Javascript',
userAgent: 'Algolia for Javascript (5.0.0)',
timeouts: {
connect: 2,
read: 5,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ 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 class PersonalizationApi {
protected authentications = {
apiKey: 'Algolia-API-Key',
Expand Down Expand Up @@ -60,7 +62,7 @@ export class PersonalizationApi {
baseHeaders: {
'content-type': 'application/x-www-form-urlencoded',
},
userAgent: 'Algolia for Javascript',
userAgent: 'Algolia for Javascript (5.0.0)',
timeouts: {
connect: 2,
read: 5,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ 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 class QuerySuggestionsApi {
protected authentications = {
apiKey: 'Algolia-API-Key',
Expand Down Expand Up @@ -62,7 +64,7 @@ export class QuerySuggestionsApi {
baseHeaders: {
'content-type': 'application/x-www-form-urlencoded',
},
userAgent: 'Algolia for Javascript',
userAgent: 'Algolia for Javascript (5.0.0)',
timeouts: {
connect: 2,
read: 5,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ 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 class SearchApi {
protected authentications = {
apiKey: 'Algolia-API-Key',
Expand Down Expand Up @@ -111,7 +113,7 @@ export class SearchApi {
baseHeaders: {
'content-type': 'application/x-www-form-urlencoded',
},
userAgent: 'Algolia for Javascript',
userAgent: 'Algolia for Javascript (5.0.0)',
timeouts: {
connect: 2,
read: 5,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import type {
import type { PostIngestUrlResponse } from '../model/postIngestUrlResponse';
import type { PostURLJob } from '../model/postURLJob';

export const version = '0.0.1';

export class SourcesApi {
protected authentications = {
apiKey: 'Algolia-API-Key',
Expand Down Expand Up @@ -58,7 +60,7 @@ export class SourcesApi {
baseHeaders: {
'content-type': 'application/x-www-form-urlencoded',
},
userAgent: 'Algolia for Javascript',
userAgent: 'Algolia for Javascript (0.0.1)',
timeouts: {
connect: 2,
read: 5,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import type {
import type { GetRecommendations } from '../model/getRecommendations';
import type { GetRecommendationsResponse } from '../model/getRecommendationsResponse';

export const version = '5.0.0';

export class RecommendApi {
protected authentications = {
apiKey: 'Algolia-API-Key',
Expand Down Expand Up @@ -57,7 +59,7 @@ export class RecommendApi {
baseHeaders: {
'content-type': 'application/x-www-form-urlencoded',
},
userAgent: 'Algolia for Javascript',
userAgent: 'Algolia for Javascript (5.0.0)',
timeouts: {
connect: 2,
read: 5,
Expand Down
16 changes: 8 additions & 8 deletions openapitools.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"modelPropertyNaming": "original",
"supportsES6": true,
"npmName": "@algolia/client-search",
"npmVersion": "5.0.0",
"packageVersion": "5.0.0",

"packageName": "@algolia/client-search",
"isSearchHost": true
Expand All @@ -39,7 +39,7 @@
"modelPropertyNaming": "original",
"supportsES6": true,
"npmName": "@algolia/recommend",
"npmVersion": "5.0.0",
"packageVersion": "5.0.0",

"packageName": "@algolia/recommend",
"isSearchHost": true
Expand All @@ -59,7 +59,7 @@
"modelPropertyNaming": "original",
"supportsES6": true,
"npmName": "@algolia/client-personalization",
"npmVersion": "5.0.0",
"packageVersion": "5.0.0",

"packageName": "@algolia/client-personalization",
"hasRegionalHost": true,
Expand All @@ -81,7 +81,7 @@
"modelPropertyNaming": "original",
"supportsES6": true,
"npmName": "@algolia/client-analytics",
"npmVersion": "5.0.0",
"packageVersion": "5.0.0",

"packageName": "@algolia/client-analytics",
"hasRegionalHost": true,
Expand All @@ -103,7 +103,7 @@
"modelPropertyNaming": "original",
"supportsES6": true,
"npmName": "@algolia/client-insights",
"npmVersion": "5.0.0",
"packageVersion": "5.0.0",

"packageName": "@algolia/client-insights",
"host": "insights"
Expand All @@ -123,7 +123,7 @@
"modelPropertyNaming": "original",
"supportsES6": true,
"npmName": "@algolia/client-abtesting",
"npmVersion": "5.0.0",
"packageVersion": "5.0.0",

"packageName": "@algolia/client-abtesting",
"hasRegionalHost": true,
Expand All @@ -145,7 +145,7 @@
"modelPropertyNaming": "original",
"supportsES6": true,
"npmName": "@algolia/client-query-suggestions",
"npmVersion": "5.0.0",
"packageVersion": "5.0.0",

"packageName": "@algolia/client-query-suggestions",
"hasRegionalHost": true,
Expand All @@ -167,7 +167,7 @@
"modelPropertyNaming": "original",
"supportsES6": true,
"npmName": "@algolia/client-sources",
"npmVersion": "0.0.1",
"packageVersion": "0.0.1",

"packageName": "@algolia/client-sources",
"hasRegionalHost": true,
Expand Down
4 changes: 3 additions & 1 deletion templates/javascript/api-single.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import type { Headers, Requester, Host, Request, RequestOptions } from '@algolia
import { {{classname}} } from '{{filename}}';
{{/imports}}

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

{{#operations}}
{{#description}}
/**
Expand Down Expand Up @@ -65,7 +67,7 @@ export class {{classname}} {
baseHeaders: {
'content-type': 'application/x-www-form-urlencoded'
},
userAgent: 'Algolia for Javascript',
userAgent: 'Algolia for Javascript ({{packageVersion}})',
timeouts: {
connect: 2,
read: 5,
Expand Down
2 changes: 1 addition & 1 deletion templates/javascript/package.mustache
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "{{packageName}}",
"version": "{{npmVersion}}",
"version": "{{packageVersion}}",
"description": "JavaScript client for {{packageName}}",
"repository": "{{gitUserId}}/{{gitRepoId}}",
"author": "Algolia",
Expand Down