pulse-ts-sdk 0.0.60 → 0.0.61

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.
@@ -43,8 +43,8 @@ function normalizeClientOptions(options) {
43
43
  const headers = (0, headers_js_1.mergeHeaders)({
44
44
  "X-Fern-Language": "JavaScript",
45
45
  "X-Fern-SDK-Name": "pulse-ts-sdk",
46
- "X-Fern-SDK-Version": "0.0.60",
47
- "User-Agent": "pulse-ts-sdk/0.0.60",
46
+ "X-Fern-SDK-Version": "0.0.61",
47
+ "User-Agent": "pulse-ts-sdk/0.0.61",
48
48
  "X-Fern-Runtime": core.RUNTIME.type,
49
49
  "X-Fern-Runtime-Version": core.RUNTIME.version,
50
50
  }, options === null || options === void 0 ? void 0 : options.headers);
@@ -1,7 +1,7 @@
1
1
  import * as core from "../core/index.js";
2
2
  export declare namespace HeaderAuthProvider {
3
3
  interface AuthOptions {
4
- apiKey?: core.Supplier<string>;
4
+ apiKey?: core.Supplier<string> | undefined;
5
5
  }
6
6
  interface Options extends AuthOptions {
7
7
  }
@@ -51,14 +51,16 @@ class HeaderAuthProvider {
51
51
  this.headerValue = options.apiKey;
52
52
  }
53
53
  static canCreate(options) {
54
- return options.apiKey != null;
54
+ var _a;
55
+ return options.apiKey != null || ((_a = process.env) === null || _a === void 0 ? void 0 : _a.PULSE_API_KEY) != null;
55
56
  }
56
57
  getAuthRequest(_arg) {
57
58
  return __awaiter(this, void 0, void 0, function* () {
58
- const apiKey = yield core.Supplier.get(this.headerValue);
59
+ var _a, _b;
60
+ const apiKey = (_a = (yield core.Supplier.get(this.headerValue))) !== null && _a !== void 0 ? _a : (_b = process.env) === null || _b === void 0 ? void 0 : _b.PULSE_API_KEY;
59
61
  if (apiKey == null) {
60
62
  throw new errors.PulseError({
61
- message: "Please specify a apiKey by passing it in to the constructor",
63
+ message: "Please specify a apiKey by either passing it in to the constructor or initializing a PULSE_API_KEY environment variable",
62
64
  });
63
65
  }
64
66
  const headerValue = apiKey;
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.0.60";
1
+ export declare const SDK_VERSION = "0.0.61";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "0.0.60";
4
+ exports.SDK_VERSION = "0.0.61";
@@ -6,8 +6,8 @@ export function normalizeClientOptions(options) {
6
6
  const headers = mergeHeaders({
7
7
  "X-Fern-Language": "JavaScript",
8
8
  "X-Fern-SDK-Name": "pulse-ts-sdk",
9
- "X-Fern-SDK-Version": "0.0.60",
10
- "User-Agent": "pulse-ts-sdk/0.0.60",
9
+ "X-Fern-SDK-Version": "0.0.61",
10
+ "User-Agent": "pulse-ts-sdk/0.0.61",
11
11
  "X-Fern-Runtime": core.RUNTIME.type,
12
12
  "X-Fern-Runtime-Version": core.RUNTIME.version,
13
13
  }, options === null || options === void 0 ? void 0 : options.headers);
@@ -1,7 +1,7 @@
1
1
  import * as core from "../core/index.mjs";
2
2
  export declare namespace HeaderAuthProvider {
3
3
  interface AuthOptions {
4
- apiKey?: core.Supplier<string>;
4
+ apiKey?: core.Supplier<string> | undefined;
5
5
  }
6
6
  interface Options extends AuthOptions {
7
7
  }
@@ -15,14 +15,16 @@ export class HeaderAuthProvider {
15
15
  this.headerValue = options.apiKey;
16
16
  }
17
17
  static canCreate(options) {
18
- return options.apiKey != null;
18
+ var _a;
19
+ return options.apiKey != null || ((_a = process.env) === null || _a === void 0 ? void 0 : _a.PULSE_API_KEY) != null;
19
20
  }
20
21
  getAuthRequest(_arg) {
21
22
  return __awaiter(this, void 0, void 0, function* () {
22
- const apiKey = yield core.Supplier.get(this.headerValue);
23
+ var _a, _b;
24
+ const apiKey = (_a = (yield core.Supplier.get(this.headerValue))) !== null && _a !== void 0 ? _a : (_b = process.env) === null || _b === void 0 ? void 0 : _b.PULSE_API_KEY;
23
25
  if (apiKey == null) {
24
26
  throw new errors.PulseError({
25
- message: "Please specify a apiKey by passing it in to the constructor",
27
+ message: "Please specify a apiKey by either passing it in to the constructor or initializing a PULSE_API_KEY environment variable",
26
28
  });
27
29
  }
28
30
  const headerValue = apiKey;
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.0.60";
1
+ export declare const SDK_VERSION = "0.0.61";
@@ -1 +1 @@
1
- export const SDK_VERSION = "0.0.60";
1
+ export const SDK_VERSION = "0.0.61";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pulse-ts-sdk",
3
- "version": "0.0.60",
3
+ "version": "0.0.61",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",