@anduril-industries/lattice-sdk 4.3.1 → 4.4.1

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.
package/README.md CHANGED
@@ -14,6 +14,7 @@ The Lattice SDK TypeScript library provides convenient access to the Lattice SDK
14
14
  - [Support](#support)
15
15
  - [Reference](#reference)
16
16
  - [Usage](#usage)
17
+ - [Environments](#environments)
17
18
  - [Authentication](#authentication)
18
19
  - [Request and Response Types](#request-and-response-types)
19
20
  - [Exception Handling](#exception-handling)
@@ -70,6 +71,18 @@ await client.entities.longPollEntityEvents({
70
71
  });
71
72
  ```
72
73
 
74
+ ## Environments
75
+
76
+ This SDK allows you to configure different environments for API requests.
77
+
78
+ ```typescript
79
+ import { LatticeClient, LatticeEnvironment } from "@anduril-industries/lattice-sdk";
80
+
81
+ const client = new LatticeClient({
82
+ environment: LatticeEnvironment.Default,
83
+ });
84
+ ```
85
+
73
86
  ## Authentication
74
87
 
75
88
  The SDK supports OAuth authentication with two options:
@@ -802,17 +815,4 @@ The SDK works in the following runtimes:
802
815
  - Bun 1.0+
803
816
  - React Native
804
817
 
805
- ### Customizing Fetch Client
806
-
807
- The SDK provides a way for you to customize the underlying HTTP client / Fetch function. If you're running in an
808
- unsupported environment, this provides a way for you to break glass and ensure the SDK works.
809
-
810
- ```typescript
811
- import { LatticeClient } from "@anduril-industries/lattice-sdk";
812
-
813
- const client = new LatticeClient({
814
- ...
815
- fetcher: // provide your implementation here
816
- });
817
- ```
818
818
 
@@ -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": "@anduril-industries/lattice-sdk",
46
- "X-Fern-SDK-Version": "4.3.1",
47
- "User-Agent": "@anduril-industries/lattice-sdk/4.3.1",
46
+ "X-Fern-SDK-Version": "4.4.1",
47
+ "User-Agent": "@anduril-industries/lattice-sdk/4.4.1",
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);
@@ -82,9 +82,9 @@ class LatticeClient {
82
82
  */
83
83
  fetch(input, init, requestOptions) {
84
84
  return __awaiter(this, void 0, void 0, function* () {
85
+ var _a;
85
86
  return core.makePassthroughRequest(input, init, {
86
- environment: this._options.environment,
87
- baseUrl: this._options.baseUrl,
87
+ baseUrl: (_a = this._options.baseUrl) !== null && _a !== void 0 ? _a : this._options.environment,
88
88
  headers: this._options.headers,
89
89
  timeoutInSeconds: this._options.timeoutInSeconds,
90
90
  maxRetries: this._options.maxRetries,
@@ -85,7 +85,7 @@ function getFileWithMetadata(file_1) {
85
85
  }
86
86
  if ("path" in file) {
87
87
  const fs = yield Promise.resolve().then(() => __importStar(require("fs")));
88
- if (!fs || !fs.createReadStream) {
88
+ if (!(fs === null || fs === void 0 ? void 0 : fs.createReadStream)) {
89
89
  throw new Error("File path uploads are not supported in this environment.");
90
90
  }
91
91
  const data = fs.createReadStream(file.path);
@@ -126,9 +126,10 @@ function isFileLike(value) {
126
126
  }
127
127
  function tryGetFileSizeFromPath(path) {
128
128
  return __awaiter(this, void 0, void 0, function* () {
129
+ var _a;
129
130
  try {
130
131
  const fs = yield Promise.resolve().then(() => __importStar(require("fs")));
131
- if (!fs || !fs.promises || !fs.promises.stat) {
132
+ if (!((_a = fs === null || fs === void 0 ? void 0 : fs.promises) === null || _a === void 0 ? void 0 : _a.stat)) {
132
133
  return undefined;
133
134
  }
134
135
  const fileStat = yield fs.promises.stat(path);
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "4.3.1";
1
+ export declare const SDK_VERSION = "4.4.1";
@@ -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 = "4.3.1";
4
+ exports.SDK_VERSION = "4.4.1";
@@ -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": "@anduril-industries/lattice-sdk",
9
- "X-Fern-SDK-Version": "4.3.1",
10
- "User-Agent": "@anduril-industries/lattice-sdk/4.3.1",
9
+ "X-Fern-SDK-Version": "4.4.1",
10
+ "User-Agent": "@anduril-industries/lattice-sdk/4.4.1",
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);
@@ -46,9 +46,9 @@ export class LatticeClient {
46
46
  */
47
47
  fetch(input, init, requestOptions) {
48
48
  return __awaiter(this, void 0, void 0, function* () {
49
+ var _a;
49
50
  return core.makePassthroughRequest(input, init, {
50
- environment: this._options.environment,
51
- baseUrl: this._options.baseUrl,
51
+ baseUrl: (_a = this._options.baseUrl) !== null && _a !== void 0 ? _a : this._options.environment,
52
52
  headers: this._options.headers,
53
53
  timeoutInSeconds: this._options.timeoutInSeconds,
54
54
  maxRetries: this._options.maxRetries,
@@ -48,7 +48,7 @@ function getFileWithMetadata(file_1) {
48
48
  }
49
49
  if ("path" in file) {
50
50
  const fs = yield import("fs");
51
- if (!fs || !fs.createReadStream) {
51
+ if (!(fs === null || fs === void 0 ? void 0 : fs.createReadStream)) {
52
52
  throw new Error("File path uploads are not supported in this environment.");
53
53
  }
54
54
  const data = fs.createReadStream(file.path);
@@ -89,9 +89,10 @@ function isFileLike(value) {
89
89
  }
90
90
  function tryGetFileSizeFromPath(path) {
91
91
  return __awaiter(this, void 0, void 0, function* () {
92
+ var _a;
92
93
  try {
93
94
  const fs = yield import("fs");
94
- if (!fs || !fs.promises || !fs.promises.stat) {
95
+ if (!((_a = fs === null || fs === void 0 ? void 0 : fs.promises) === null || _a === void 0 ? void 0 : _a.stat)) {
95
96
  return undefined;
96
97
  }
97
98
  const fileStat = yield fs.promises.stat(path);
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "4.3.1";
1
+ export declare const SDK_VERSION = "4.4.1";
@@ -1 +1 @@
1
- export const SDK_VERSION = "4.3.1";
1
+ export const SDK_VERSION = "4.4.1";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anduril-industries/lattice-sdk",
3
- "version": "4.3.1",
3
+ "version": "4.4.1",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
@@ -91,13 +91,13 @@
91
91
  },
92
92
  "dependencies": {},
93
93
  "devDependencies": {
94
- "webpack": "^5.97.1",
95
- "ts-loader": "^9.5.1",
96
- "vitest": "^3.2.4",
94
+ "webpack": "^5.105.4",
95
+ "ts-loader": "^9.5.4",
96
+ "vitest": "^4.1.1",
97
97
  "msw": "2.11.2",
98
98
  "@types/node": "^18.19.70",
99
- "typescript": "~5.7.2",
100
- "@biomejs/biome": "2.4.3"
99
+ "typescript": "~5.9.3",
100
+ "@biomejs/biome": "2.4.10"
101
101
  },
102
102
  "browser": {
103
103
  "fs": false,
@@ -106,7 +106,7 @@
106
106
  "stream": false,
107
107
  "crypto": false
108
108
  },
109
- "packageManager": "pnpm@10.20.0",
109
+ "packageManager": "pnpm@10.33.0",
110
110
  "engines": {
111
111
  "node": ">=18.0.0"
112
112
  },