conductor-node 3.5.6 → 3.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -16,6 +16,7 @@ export default class Client {
16
16
  private readonly gqlClient;
17
17
  private readonly verbose;
18
18
  constructor(apiKey: string, { verbose, environment }?: ClientOptions);
19
+ private static getUserAgent;
19
20
  integrationUserConnections(): Promise<object[]>;
20
21
  integrationRequest(integrationRequestParams: IntegrationRequestParams): Promise<object>;
21
22
  }
@@ -17,11 +17,23 @@ class Client {
17
17
  this.serverURL = (0, environment_1.envToBaseServerURL)(environment);
18
18
  this.gqlClient = new graphql_request_1.GraphQLClient(`${this.serverURL}/graphql`, {
19
19
  headers: {
20
- authorization: `Bearer ${apiKey}`,
20
+ Authorization: `Bearer ${apiKey}`,
21
+ "User-Agent": Client.getUserAgent(),
21
22
  },
22
23
  });
23
24
  this.qbd = new QbdClient_1.default(this);
24
25
  }
26
+ static getUserAgent() {
27
+ const packageName = process.env["npm_package_name"];
28
+ if (packageName === undefined) {
29
+ throw new Error("Package name not found");
30
+ }
31
+ const clientVersion = process.env["npm_package_version"];
32
+ if (clientVersion === undefined) {
33
+ throw new Error("Client version not found");
34
+ }
35
+ return `${packageName}/${clientVersion} (Node.js ${process.version})`;
36
+ }
25
37
  async integrationUserConnections() {
26
38
  const data = await this.gqlClient.request(`#graphql
27
39
  query {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "conductor-node",
3
- "version": "3.5.6",
3
+ "version": "3.6.0",
4
4
  "description": "Conductor API wrapper",
5
5
  "author": "Danny Nemer <hi@DannyNemer.com>",
6
6
  "license": "MIT",