Skip to content

Commit 63d502d

Browse files
author
fern
committed
SDK Generation
1 parent d1c5a00 commit 63d502d

File tree

244 files changed

+3305
-5495
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

244 files changed

+3305
-5495
lines changed

.github/workflows/ci.yml

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,14 @@ jobs:
1313
- name: Set up node
1414
uses: actions/setup-node@v3
1515

16+
- name: Install pnpm
17+
uses: pnpm/action-setup@v4
18+
19+
- name: Install dependencies
20+
run: pnpm install
21+
1622
- name: Compile
17-
run: yarn && yarn build
23+
run: pnpm build
1824

1925
test:
2026
runs-on: ubuntu-latest
@@ -25,9 +31,15 @@ jobs:
2531

2632
- name: Set up node
2733
uses: actions/setup-node@v3
34+
35+
- name: Install pnpm
36+
uses: pnpm/action-setup@v4
2837

29-
- name: Compile
30-
run: yarn && yarn test
38+
- name: Install dependencies
39+
run: pnpm install
40+
41+
- name: Test
42+
run: pnpm test
3143

3244
publish:
3345
needs: [ compile, test ]
@@ -36,12 +48,18 @@ jobs:
3648
steps:
3749
- name: Checkout repo
3850
uses: actions/checkout@v4
51+
3952
- name: Set up node
4053
uses: actions/setup-node@v3
54+
55+
- name: Install pnpm
56+
uses: pnpm/action-setup@v4
57+
4158
- name: Install dependencies
42-
run: yarn install
59+
run: pnpm install
60+
4361
- name: Build
44-
run: yarn build
62+
run: pnpm build
4563

4664
- name: Publish to npm
4765
run: |

.npmignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ tests
44
.gitignore
55
.github
66
.fernignore
7-
.prettierrc.yml
7+
biome.json
88
tsconfig.json
99
yarn.lock
1010
pnpm-lock.yaml

.prettierrc.yml

Lines changed: 0 additions & 2 deletions
This file was deleted.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,4 +186,4 @@ of any court action, you agree to submit to the exclusive jurisdiction of the co
186186
Notwithstanding this, you agree that Anduril shall still be allowed to apply for injunctive remedies (or an equivalent type of urgent legal
187187
relief) in any jurisdiction.
188188

189-
**April 14, 2025**
189+
**April 14, 2025**

README.md

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ For support with this library, please reach out to your Anduril representative.
2828

2929
## Reference
3030

31-
A full reference for this library is available [here](https://github.com/anduril/lattice-sdk-javascript/blob/HEAD/./reference.md).
31+
A full reference for this library is available [here](https://github.com/fern-api/lattice-sdk-javascript/blob/HEAD/./reference.md).
3232

3333
## Usage
3434

@@ -39,7 +39,7 @@ import { LatticeClient } from "@anduril-industries/lattice-sdk";
3939

4040
const client = new LatticeClient({ token: "YOUR_TOKEN" });
4141
await client.entities.longPollEntityEvents({
42-
sessionToken: "sessionToken",
42+
sessionToken: "sessionToken"
4343
});
4444
```
4545

@@ -91,39 +91,36 @@ await client.objects.uploadObject(new File(['binary data'], 'file.mp3'), ...);
9191
await client.objects.uploadObject(new ArrayBuffer(8), ...);
9292
await client.objects.uploadObject(new Uint8Array([0, 1, 2]), ...);
9393
```
94-
9594
The client accepts a variety of types for file upload parameters:
96-
97-
- Stream types: `fs.ReadStream`, `stream.Readable`, and `ReadableStream`
98-
- Buffered types: `Buffer`, `Blob`, `File`, `ArrayBuffer`, `ArrayBufferView`, and `Uint8Array`
95+
* Stream types: `fs.ReadStream`, `stream.Readable`, and `ReadableStream`
96+
* Buffered types: `Buffer`, `Blob`, `File`, `ArrayBuffer`, `ArrayBufferView`, and `Uint8Array`
9997

10098
### Metadata
10199

102100
You can configure metadata when uploading a file:
103-
104101
```typescript
105102
const file: Uploadable.WithMetadata = {
106103
data: createReadStream("path/to/file"),
107-
filename: "my-file", // optional
104+
filename: "my-file", // optional
108105
contentType: "audio/mpeg", // optional
109-
contentLength: 1949, // optional
106+
contentLength: 1949, // optional
110107
};
111108
```
112109

113110
Alternatively, you can upload a file directly from a file path:
114-
115111
```typescript
116-
const file: Uploadable.FromPath = {
112+
const file : Uploadable.FromPath = {
117113
path: "path/to/file",
118-
filename: "my-file", // optional
119-
contentType: "audio/mpeg", // optional
120-
contentLength: 1949, // optional
114+
filename: "my-file", // optional
115+
contentType: "audio/mpeg", // optional
116+
contentLength: 1949, // optional
121117
};
122118
```
123119

124120
The metadata is used to set the `Content-Length`, `Content-Type`, and `Content-Disposition` headers. If not provided, the client will attempt to determine them automatically.
125121
For example, `fs.ReadStream` has a `path` property which the SDK uses to retrieve the file size from the filesystem without loading it into memory.
126122

123+
127124
## Binary Response
128125

129126
You can consume binary data from endpoints using the `BinaryResponse` type which lets you choose how to consume the data:
@@ -138,7 +135,6 @@ const stream: ReadableStream<Uint8Array> = response.stream();
138135
// If you want to check if the response body has been used, you can use the following property.
139136
const bodyUsed = response.bodyUsed;
140137
```
141-
142138
<details>
143139
<summary>Save binary response to a file</summary>
144140

@@ -526,7 +522,7 @@ const response = await client.objects.listObjects({
526522
prefix: "prefix",
527523
sinceTimestamp: "2024-01-15T09:30:00Z",
528524
pageToken: "pageToken",
529-
allObjectsInMesh: true,
525+
allObjectsInMesh: true
530526
});
531527
for await (const item of response) {
532528
console.log(item);
@@ -537,7 +533,7 @@ let page = await client.objects.listObjects({
537533
prefix: "prefix",
538534
sinceTimestamp: "2024-01-15T09:30:00Z",
539535
pageToken: "pageToken",
540-
allObjectsInMesh: true,
536+
allObjectsInMesh: true
541537
});
542538
while (page.hasNextPage()) {
543539
page = page.getNextPage();
@@ -626,8 +622,11 @@ console.log(rawResponse.headers['X-My-Header']);
626622

627623
### Runtime Compatibility
628624

625+
629626
The SDK works in the following runtimes:
630627

628+
629+
631630
- Node.js 18+
632631
- Vercel
633632
- Cloudflare Workers

biome.json

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/2.2.5/schema.json",
3+
"root": true,
4+
"vcs": {
5+
"enabled": false
6+
},
7+
"files": {
8+
"ignoreUnknown": true,
9+
"includes": [
10+
"./**",
11+
"!dist",
12+
"!lib",
13+
"!*.tsbuildinfo",
14+
"!_tmp_*",
15+
"!*.tmp",
16+
"!.tmp/",
17+
"!*.log",
18+
"!.DS_Store",
19+
"!Thumbs.db"
20+
]
21+
},
22+
"formatter": {
23+
"enabled": true,
24+
"indentStyle": "space",
25+
"indentWidth": 4,
26+
"lineWidth": 120
27+
},
28+
"javascript": {
29+
"formatter": {
30+
"quoteStyle": "double"
31+
}
32+
},
33+
"assist": {
34+
"enabled": true,
35+
"actions": {
36+
"source": {
37+
"organizeImports": "on"
38+
}
39+
}
40+
},
41+
"linter": {
42+
"rules": {
43+
"style": {
44+
"useNodejsImportProtocol": "off"
45+
},
46+
"suspicious": {
47+
"noAssignInExpressions": "warn",
48+
"noUselessEscapeInString": {
49+
"level": "warn",
50+
"fix": "none",
51+
"options": {}
52+
},
53+
"noThenProperty": "warn",
54+
"useIterableCallbackReturn": "warn",
55+
"noShadowRestrictedNames": "warn",
56+
"noTsIgnore": {
57+
"level": "warn",
58+
"fix": "none",
59+
"options": {}
60+
},
61+
"noConfusingVoidType": {
62+
"level": "warn",
63+
"fix": "none",
64+
"options": {}
65+
}
66+
}
67+
}
68+
}
69+
}

jest.config.mjs

Lines changed: 0 additions & 42 deletions
This file was deleted.

package.json

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
{
22
"name": "@anduril-industries/lattice-sdk",
3-
"version": "2.3.0",
3+
"version": "0.0.0",
44
"private": false,
5-
"repository": "github:anduril/lattice-sdk-javascript",
6-
"license": "See LICENSE",
5+
"repository": "git+fern-api/lattice-sdk-javascript.git",
76
"type": "commonjs",
87
"main": "./dist/cjs/index.js",
98
"module": "./dist/esm/index.mjs",
@@ -30,26 +29,23 @@
3029
"LICENSE"
3130
],
3231
"scripts": {
33-
"format": "prettier . --write --ignore-unknown",
34-
"build": "yarn build:cjs && yarn build:esm",
32+
"format": "biome format --write --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none",
33+
"check": "biome check --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none",
34+
"check:fix": "biome check --fix --unsafe --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none",
35+
"build": "pnpm build:cjs && pnpm build:esm",
3536
"build:cjs": "tsc --project ./tsconfig.cjs.json",
3637
"build:esm": "tsc --project ./tsconfig.esm.json && node scripts/rename-to-esm-files.js dist/esm",
37-
"test": "jest --config jest.config.mjs",
38-
"test:unit": "jest --selectProjects unit",
39-
"test:browser": "jest --selectProjects browser",
40-
"test:wire": "jest --selectProjects wire"
38+
"test": "vitest",
39+
"test:unit": "vitest --project unit",
40+
"test:wire": "vitest --project wire"
4141
},
4242
"devDependencies": {
4343
"webpack": "^5.97.1",
4444
"ts-loader": "^9.5.1",
45-
"jest": "^29.7.0",
46-
"@jest/globals": "^29.7.0",
47-
"@types/jest": "^29.5.14",
48-
"ts-jest": "^29.3.4",
49-
"jest-environment-jsdom": "^29.7.0",
50-
"msw": "^2.8.4",
45+
"vitest": "^3.2.4",
46+
"msw": "2.11.2",
5147
"@types/node": "^18.19.70",
52-
"prettier": "^3.4.2",
48+
"@biomejs/biome": "2.2.5",
5349
"typescript": "~5.7.2"
5450
},
5551
"browser": {
@@ -58,7 +54,7 @@
5854
"path": false,
5955
"stream": false
6056
},
61-
"packageManager": "[email protected]",
57+
"packageManager": "[email protected]",
6258
"engines": {
6359
"node": ">=18.0.0"
6460
},

0 commit comments

Comments
 (0)