Skip to content

Commit cca8ce7

Browse files
SDK regeneration
1 parent 2394016 commit cca8ce7

File tree

33 files changed

+1466
-275
lines changed

33 files changed

+1466
-275
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.108.0",
3+
"generatorName": "fernapi/fern-typescript-sdk",
4+
"generatorVersion": "3.28.0",
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: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ tests
44
.gitignore
55
.github
66
.fernignore
7+
.prettierrc.yml
78
biome.json
89
tsconfig.json
910
yarn.lock

CONTRIBUTING.md

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
# Contributing
2+
3+
Thanks for your interest in contributing to this SDK! This document provides guidelines for contributing to the project.
4+
5+
## Getting Started
6+
7+
### Prerequisites
8+
9+
- Node.js 20 or higher
10+
- pnpm package manager
11+
12+
### Installation
13+
14+
Install the project dependencies:
15+
16+
```bash
17+
pnpm install
18+
```
19+
20+
### Building
21+
22+
Build the project:
23+
24+
```bash
25+
pnpm build
26+
```
27+
28+
### Testing
29+
30+
Run the test suite:
31+
32+
```bash
33+
pnpm test
34+
```
35+
36+
Run specific test types:
37+
- `pnpm test:unit` - Run unit tests
38+
- `pnpm test:wire` - Run wire/integration tests
39+
40+
### Linting and Formatting
41+
42+
Check code style:
43+
44+
```bash
45+
pnpm run lint
46+
pnpm run format:check
47+
```
48+
49+
Fix code style issues:
50+
51+
```bash
52+
pnpm run lint:fix
53+
pnpm run format:fix
54+
```
55+
56+
Or use the combined check command:
57+
58+
```bash
59+
pnpm run check:fix
60+
```
61+
62+
## About Generated Code
63+
64+
**Important**: Most files in this SDK are automatically generated by [Fern](https://buildwithfern.com) from the API definition. Direct modifications to generated files will be overwritten the next time the SDK is generated.
65+
66+
### Generated Files
67+
68+
The following directories contain generated code:
69+
- `src/api/` - API client classes and types
70+
- `src/serialization/` - Serialization/deserialization logic
71+
- Most TypeScript files in `src/`
72+
73+
### How to Customize
74+
75+
If you need to customize the SDK, you have two options:
76+
77+
#### Option 1: Use `.fernignore`
78+
79+
For custom code that should persist across SDK regenerations:
80+
81+
1. Create a `.fernignore` file in the project root
82+
2. Add file patterns for files you want to preserve (similar to `.gitignore` syntax)
83+
3. Add your custom code to those files
84+
85+
Files listed in `.fernignore` will not be overwritten when the SDK is regenerated.
86+
87+
For more information, see the [Fern documentation on custom code](https://buildwithfern.com/learn/sdks/overview/custom-code).
88+
89+
#### Option 2: Contribute to the Generator
90+
91+
If you want to change how code is generated for all users of this SDK:
92+
93+
1. The TypeScript SDK generator lives in the [Fern repository](https://github.com/fern-api/fern)
94+
2. Generator code is located at `generators/typescript/sdk/`
95+
3. Follow the [Fern contributing guidelines](https://github.com/fern-api/fern/blob/main/CONTRIBUTING.md)
96+
4. Submit a pull request with your changes to the generator
97+
98+
This approach is best for:
99+
- Bug fixes in generated code
100+
- New features that would benefit all users
101+
- Improvements to code generation patterns
102+
103+
## Making Changes
104+
105+
### Workflow
106+
107+
1. Create a new branch for your changes
108+
2. Make your modifications
109+
3. Run tests to ensure nothing breaks: `pnpm test`
110+
4. Run linting and formatting: `pnpm run check:fix`
111+
5. Build the project: `pnpm build`
112+
6. Commit your changes with a clear commit message
113+
7. Push your branch and create a pull request
114+
115+
### Commit Messages
116+
117+
Write clear, descriptive commit messages that explain what changed and why.
118+
119+
### Code Style
120+
121+
This project uses automated code formatting and linting. Run `pnpm run check:fix` before committing to ensure your code meets the project's style guidelines.
122+
123+
## Questions or Issues?
124+
125+
If you have questions or run into issues:
126+
127+
1. Check the [Fern documentation](https://buildwithfern.com)
128+
2. Search existing [GitHub issues](https://github.com/fern-api/fern/issues)
129+
3. Open a new issue if your question hasn't been addressed
130+
131+
## License
132+
133+
By contributing to this project, you agree that your contributions will be licensed under the same license as the project.

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: 84 additions & 3 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

@@ -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,13 +533,13 @@ 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({
536+
const pageableResponse = await client.objects.listObjects({
522537
prefix: "prefix",
523538
sinceTimestamp: "2024-01-15T09:30:00Z",
524539
pageToken: "pageToken",
525540
allObjectsInMesh: true
526541
});
527-
for await (const item of response) {
542+
for await (const item of pageableResponse) {
528543
console.log(item);
529544
}
530545

@@ -538,6 +553,9 @@ let page = await client.objects.listObjects({
538553
while (page.hasNextPage()) {
539554
page = page.getNextPage();
540555
}
556+
557+
// You can also access the underlying response
558+
const response = page.response;
541559
```
542560

543561
## Advanced
@@ -620,6 +638,69 @@ console.log(data);
620638
console.log(rawResponse.headers['X-My-Header']);
621639
```
622640

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

625706

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": {

0 commit comments

Comments
 (0)