Skip to content

Commit 68cfb08

Browse files
committed
chore: update Fern SDK generator configuration and dependencies
Updated the SDK to use the latest Fern generator configuration with improved TypeScript generation capabilities. This includes enhanced logging support, better header handling, form data serialization, and streaming response improvements. Key changes: - Added Fern metadata configuration with generator version 3.31.1 - Enhanced CI/CD pipeline with Node.js v4 and improved npm publishing - Upgraded biome linter from 2.2.5 to 2.3.1 with expanded file filtering - Added comprehensive logging framework with debug/info/warn/error levels - Implemented request/response redaction for sensitive data in logs - Added form-urlencoded request body support - Improved streaming response handling with shared TextDecoder - Enhanced pagination API with better type safety - Updated package manager to pnpm 10.20.0 - Restructured test files with better organization and coverage 🌿 Generated with Fern
1 parent 2394016 commit 68cfb08

File tree

227 files changed

+5483
-1492
lines changed

Some content is hidden

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

227 files changed

+5483
-1492
lines changed

.fern/metadata.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"cliVersion": "0.0.0",
3+
"generatorName": "fernapi/fern-typescript-sdk",
4+
"generatorVersion": "3.31.1",
5+
"generatorConfig": {
6+
"namespaceExport": "Lattice"
7+
}
8+
}

.github/workflows/ci.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
uses: actions/checkout@v4
1212

1313
- name: Set up node
14-
uses: actions/setup-node@v3
14+
uses: actions/setup-node@v4
1515

1616
- name: Install pnpm
1717
uses: pnpm/action-setup@v4
@@ -30,7 +30,7 @@ jobs:
3030
uses: actions/checkout@v4
3131

3232
- name: Set up node
33-
uses: actions/setup-node@v3
33+
uses: actions/setup-node@v4
3434

3535
- name: Install pnpm
3636
uses: pnpm/action-setup@v4
@@ -50,7 +50,7 @@ jobs:
5050
uses: actions/checkout@v4
5151

5252
- name: Set up node
53-
uses: actions/setup-node@v3
53+
uses: actions/setup-node@v4
5454

5555
- name: Install pnpm
5656
uses: pnpm/action-setup@v4
@@ -64,12 +64,15 @@ jobs:
6464
- name: Publish to npm
6565
run: |
6666
npm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN}
67+
publish() { # use latest npm to ensure OIDC support
68+
npx -y npm@latest publish "$@"
69+
}
6770
if [[ ${GITHUB_REF} == *alpha* ]]; then
68-
npm publish --access public --tag alpha
71+
publish --access public --tag alpha
6972
elif [[ ${GITHUB_REF} == *beta* ]]; then
70-
npm publish --access public --tag beta
73+
publish --access public --tag beta
7174
else
72-
npm publish --access public
75+
publish --access public
7376
fi
7477
env:
7578
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.npmignore

Lines changed: 0 additions & 10 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: 86 additions & 15 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

@@ -51,7 +51,7 @@ following namespace:
5151
```typescript
5252
import { Lattice } from "@anduril-industries/lattice-sdk";
5353

54-
const request: Lattice.EntityOverride = {
54+
const request: Lattice.GetEntityRequest = {
5555
...
5656
};
5757
```
@@ -76,6 +76,21 @@ try {
7676
}
7777
```
7878

79+
## Streaming Response
80+
81+
Some endpoints return streaming responses instead of returning the full response at once.
82+
The SDK uses async iterators, so you can consume the responses using a `for await...of` loop.
83+
84+
```typescript
85+
import { LatticeClient } from "@anduril-industries/lattice-sdk";
86+
87+
const client = new LatticeClient({ token: "YOUR_TOKEN" });
88+
const response = await client.entities.streamEntities();
89+
for await (const item of response) {
90+
console.log(item);
91+
}
92+
```
93+
7994
## File Uploads
8095

8196
You can upload files using the client:
@@ -518,26 +533,19 @@ List endpoints are paginated. The SDK provides an iterator so that you can simpl
518533
import { LatticeClient } from "@anduril-industries/lattice-sdk";
519534

520535
const client = new LatticeClient({ token: "YOUR_TOKEN" });
521-
const response = await client.objects.listObjects({
522-
prefix: "prefix",
523-
sinceTimestamp: "2024-01-15T09:30:00Z",
524-
pageToken: "pageToken",
525-
allObjectsInMesh: true
526-
});
527-
for await (const item of response) {
536+
const pageableResponse = await client.objects.listObjects();
537+
for await (const item of pageableResponse) {
528538
console.log(item);
529539
}
530540

531541
// Or you can manually iterate page-by-page
532-
let page = await client.objects.listObjects({
533-
prefix: "prefix",
534-
sinceTimestamp: "2024-01-15T09:30:00Z",
535-
pageToken: "pageToken",
536-
allObjectsInMesh: true
537-
});
542+
let page = await client.objects.listObjects();
538543
while (page.hasNextPage()) {
539544
page = page.getNextPage();
540545
}
546+
547+
// You can also access the underlying response
548+
const response = page.response;
541549
```
542550

543551
## Advanced
@@ -620,6 +628,69 @@ console.log(data);
620628
console.log(rawResponse.headers['X-My-Header']);
621629
```
622630

631+
### Logging
632+
633+
The SDK supports logging. You can configure the logger by passing in a `logging` object to the client options.
634+
635+
```typescript
636+
import { LatticeClient, logging } from "@anduril-industries/lattice-sdk";
637+
638+
const client = new LatticeClient({
639+
...
640+
logging: {
641+
level: logging.LogLevel.Debug, // defaults to logging.LogLevel.Info
642+
logger: new logging.ConsoleLogger(), // defaults to ConsoleLogger
643+
silent: false, // defaults to true, set to false to enable logging
644+
}
645+
});
646+
```
647+
The `logging` object can have the following properties:
648+
- `level`: The log level to use. Defaults to `logging.LogLevel.Info`.
649+
- `logger`: The logger to use. Defaults to a `logging.ConsoleLogger`.
650+
- `silent`: Whether to silence the logger. Defaults to `true`.
651+
652+
The `level` property can be one of the following values:
653+
- `logging.LogLevel.Debug`
654+
- `logging.LogLevel.Info`
655+
- `logging.LogLevel.Warn`
656+
- `logging.LogLevel.Error`
657+
658+
To provide a custom logger, you can pass in an object that implements the `logging.ILogger` interface.
659+
660+
<details>
661+
<summary>Custom logger examples</summary>
662+
663+
Here's an example using the popular `winston` logging library.
664+
```ts
665+
import winston from 'winston';
666+
667+
const winstonLogger = winston.createLogger({...});
668+
669+
const logger: logging.ILogger = {
670+
debug: (msg, ...args) => winstonLogger.debug(msg, ...args),
671+
info: (msg, ...args) => winstonLogger.info(msg, ...args),
672+
warn: (msg, ...args) => winstonLogger.warn(msg, ...args),
673+
error: (msg, ...args) => winstonLogger.error(msg, ...args),
674+
};
675+
```
676+
677+
Here's an example using the popular `pino` logging library.
678+
679+
```ts
680+
import pino from 'pino';
681+
682+
const pinoLogger = pino({...});
683+
684+
const logger: logging.ILogger = {
685+
debug: (msg, ...args) => pinoLogger.debug(args, msg),
686+
info: (msg, ...args) => pinoLogger.info(args, msg),
687+
warn: (msg, ...args) => pinoLogger.warn(args, msg),
688+
error: (msg, ...args) => pinoLogger.error(args, msg),
689+
};
690+
```
691+
</details>
692+
693+
623694
### Runtime Compatibility
624695

625696

biome.json

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,27 @@
11
{
2-
"$schema": "https://biomejs.dev/schemas/2.2.5/schema.json",
2+
"$schema": "https://biomejs.dev/schemas/2.3.1/schema.json",
33
"root": true,
44
"vcs": {
55
"enabled": false
66
},
77
"files": {
88
"ignoreUnknown": true,
99
"includes": [
10-
"./**",
11-
"!dist",
12-
"!lib",
13-
"!*.tsbuildinfo",
14-
"!_tmp_*",
15-
"!*.tmp",
16-
"!.tmp/",
17-
"!*.log",
18-
"!.DS_Store",
19-
"!Thumbs.db"
10+
"**",
11+
"!!dist",
12+
"!!**/dist",
13+
"!!lib",
14+
"!!**/lib",
15+
"!!_tmp_*",
16+
"!!**/_tmp_*",
17+
"!!*.tmp",
18+
"!!**/*.tmp",
19+
"!!.tmp/",
20+
"!!**/.tmp/",
21+
"!!*.log",
22+
"!!**/*.log",
23+
"!!**/.DS_Store",
24+
"!!**/Thumbs.db"
2025
]
2126
},
2227
"formatter": {

package.json

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "@anduril-industries/lattice-sdk",
3-
"version": "3.0.0",
3+
"version": "3.1.0",
44
"private": false,
5-
"repository": "github:anduril/lattice-sdk-javascript",
5+
"repository": "github:fern-api/lattice-sdk-javascript",
66
"license": "See LICENSE",
77
"type": "commonjs",
88
"main": "./dist/cjs/index.js",
@@ -31,6 +31,9 @@
3131
],
3232
"scripts": {
3333
"format": "biome format --write --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none",
34+
"format:check": "biome format --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none",
35+
"lint": "biome lint --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none",
36+
"lint:fix": "biome lint --fix --unsafe --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none",
3437
"check": "biome check --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none",
3538
"check:fix": "biome check --fix --unsafe --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none",
3639
"build": "pnpm build:cjs && pnpm build:esm",
@@ -40,22 +43,23 @@
4043
"test:unit": "vitest --project unit",
4144
"test:wire": "vitest --project wire"
4245
},
46+
"dependencies": {},
4347
"devDependencies": {
4448
"webpack": "^5.97.1",
4549
"ts-loader": "^9.5.1",
4650
"vitest": "^3.2.4",
4751
"msw": "2.11.2",
4852
"@types/node": "^18.19.70",
49-
"@biomejs/biome": "2.2.5",
50-
"typescript": "~5.7.2"
53+
"typescript": "~5.7.2",
54+
"@biomejs/biome": "2.3.1"
5155
},
5256
"browser": {
5357
"fs": false,
5458
"os": false,
5559
"path": false,
5660
"stream": false
5761
},
58-
"packageManager": "pnpm@10.14.0",
62+
"packageManager": "pnpm@10.20.0",
5963
"engines": {
6064
"node": ">=18.0.0"
6165
},

0 commit comments

Comments
 (0)