Skip to content

Commit

Permalink
fix: set user agent to pack ver (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
ashutosh-ukey authored Dec 2, 2022
1 parent 3bccc9d commit 02c7132
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/generated/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
* Do not edit the class manually.
*/

const packageJson = require("../../package.json");

export interface ConfigurationParameters {
apiKey?:
| string
Expand Down Expand Up @@ -60,7 +62,7 @@ export class Configuration {
if (!this.baseOptions) this.baseOptions = {};
if (!this.baseOptions.headers) this.baseOptions.headers = {};
this.baseOptions.headers = {
["User-Agent"]: `CircleNodeJs/1.2.0`,
["User-Agent"]: `CircleNodeJs/${packageJson.version}`,
...this.baseOptions.headers
};
}
Expand Down
3 changes: 2 additions & 1 deletion templates/typescript-axios/configuration.mustache
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* tslint:disable */
/* eslint-disable */
{{>licenseInfo}}
const packageJson = require('../../package.json')

export interface ConfigurationParameters {
apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);
Expand Down Expand Up @@ -49,7 +50,7 @@ export class Configuration {
if (!this.baseOptions) this.baseOptions = {};
if (!this.baseOptions.headers) this.baseOptions.headers = {};
this.baseOptions.headers = {
['User-Agent']: `CircleNodeJs/{{npmVersion}}`,
['User-Agent']: `CircleNodeJs/${packageJson.version}`,
...this.baseOptions.headers,
}
}
Expand Down

0 comments on commit 02c7132

Please sign in to comment.