Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 3 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
# Anduril Lattice SDK TypeScript
# Lattice SDK TypeScript Library

![](https://www.anduril.com/lattice-sdk/)

[![npm shield](https://img.shields.io/npm/v/@anduril-industries/lattice-sdk)](https://www.npmjs.com/package/@anduril-industries/lattice-sdk)

The Anduril TypeScript library provides convenient access to the Anduril API from TypeScript.
The Lattice SDK TypeScript library provides convenient access to the Lattice API from TypeScript.

## Documentation

Expand All @@ -24,7 +22,7 @@ npm i -s @anduril-industries/lattice-sdk

## Support

For support with this library please reach out to your Anduril representative.
For support with this library, please reach out to your Anduril representative.

## Reference

Expand Down Expand Up @@ -536,18 +534,6 @@ while (page.hasNextPage()) {

## Advanced

### Additional Headers

If you would like to send additional headers as part of the request, use the `headers` request option.

```typescript
const response = await client.entities.longPollEntityEvents(..., {
headers: {
'X-Custom-Header': 'custom value'
}
});
```

### Retries

The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long
Expand All @@ -568,16 +554,6 @@ const response = await client.entities.longPollEntityEvents(..., {
});
```

### Timeouts

The SDK defaults to a 60 second timeout. Use the `timeoutInSeconds` option to configure this behavior.

```typescript
const response = await client.entities.longPollEntityEvents(..., {
timeoutInSeconds: 30 // override timeout to 30s
});
```

### Aborting Requests

The SDK allows users to abort requests at any point by passing in an abort signal.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@anduril-industries/lattice-sdk",
"version": "2.0.0",
"version": "2.1.0",
"private": false,
"repository": "github:anduril/lattice-sdk-javascript",
"license": "See LICENSE",
Expand Down
6 changes: 3 additions & 3 deletions reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ await client.entities.longPollEntityEvents({
</dl>
</details>

<details><summary><code>client.entities.<a href="/src/api/resources/entities/client/Client.ts">sseEntityEvents</a>({ ...params }) -> core.Stream<Lattice.SseEntityEventsResponse></code></summary>
<details><summary><code>client.entities.<a href="/src/api/resources/entities/client/Client.ts">streamEntities</a>({ ...params }) -> core.Stream<Lattice.StreamEntitiesResponse></code></summary>
<dl>
<dd>

Expand All @@ -360,7 +360,7 @@ await client.entities.longPollEntityEvents({
<dl>
<dd>

This SSE API establishes a persistent connection to stream entity events as they occur.
Establishes a persistent connection to stream entity events as they occur.

</dd>
</dl>
Expand All @@ -376,7 +376,7 @@ This SSE API establishes a persistent connection to stream entity events as they
<dd>

```typescript
const response = await client.entities.sseEntityEvents();
const response = await client.entities.streamEntities();
for await (const item of response) {
console.log(item);
}
Expand Down
4 changes: 2 additions & 2 deletions src/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ export class LatticeClient {
{
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@anduril-industries/lattice-sdk",
"X-Fern-SDK-Version": "2.0.0",
"User-Agent": "@anduril-industries/lattice-sdk/2.0.0",
"X-Fern-SDK-Version": "2.1.0",
"User-Agent": "@anduril-industries/lattice-sdk/2.1.0",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down
12 changes: 6 additions & 6 deletions src/api/resources/entities/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -483,19 +483,19 @@ export class Entities {
}

/**
* This SSE API establishes a persistent connection to stream entity events as they occur.
* Establishes a persistent connection to stream entity events as they occur.
*/
public sseEntityEvents(
public streamEntities(
request: Lattice.EntityStreamRequest = {},
requestOptions?: Entities.RequestOptions,
): core.HttpResponsePromise<core.Stream<Lattice.SseEntityEventsResponse>> {
return core.HttpResponsePromise.fromPromise(this.__sseEntityEvents(request, requestOptions));
): core.HttpResponsePromise<core.Stream<Lattice.StreamEntitiesResponse>> {
return core.HttpResponsePromise.fromPromise(this.__streamEntities(request, requestOptions));
}

private async __sseEntityEvents(
private async __streamEntities(
request: Lattice.EntityStreamRequest = {},
requestOptions?: Entities.RequestOptions,
): Promise<core.WithRawResponse<core.Stream<Lattice.SseEntityEventsResponse>>> {
): Promise<core.WithRawResponse<core.Stream<Lattice.StreamEntitiesResponse>>> {
const _response = await core.fetcher<ReadableStream>({
url: core.url.join(
(await core.Supplier.get(this._options.baseUrl)) ??
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@
import * as Lattice from "../../../index.js";

/**
* stream event response.
* The stream event response.
*/
export type SseEntityEventsResponse =
| Lattice.SseEntityEventsResponse.Heartbeat
| Lattice.SseEntityEventsResponse.Entity;
export type StreamEntitiesResponse = Lattice.StreamEntitiesResponse.Heartbeat | Lattice.StreamEntitiesResponse.Entity;

export namespace SseEntityEventsResponse {
export namespace StreamEntitiesResponse {
export interface Heartbeat extends Lattice.EntityStreamHeartbeat {
event: "heartbeat";
}
Expand Down
2 changes: 1 addition & 1 deletion src/api/resources/entities/types/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from "./SseEntityEventsResponse.js";
export * from "./StreamEntitiesResponse.js";
2 changes: 1 addition & 1 deletion src/api/resources/objects/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ export class Objects {
}

/**
* Uploads an object using multiform data. The object must be 1 GiB or smaller.
* Uploads an object. The object must be 1 GiB or smaller.
*
* @param {core.file.Uploadable} uploadable
* @param {string} objectPath
Expand Down
4 changes: 1 addition & 3 deletions src/api/types/EntityStreamEvent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,4 @@

import * as Lattice from "../index.js";

export interface EntityStreamEvent {
data: Lattice.EntityEvent;
}
export interface EntityStreamEvent extends Lattice.EntityEvent {}
11 changes: 2 additions & 9 deletions src/api/types/EntityStreamHeartbeat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,6 @@
* This file was auto-generated by Fern from our API Definition.
*/

export interface EntityStreamHeartbeat {
data: EntityStreamHeartbeat.Data;
}
import * as Lattice from "../index.js";

export namespace EntityStreamHeartbeat {
export interface Data {
/** timestamp of the heartbeat */
timestamp?: string;
}
}
export interface EntityStreamHeartbeat extends Lattice.HeartbeatObject {}
8 changes: 8 additions & 0 deletions src/api/types/HeartbeatObject.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

export interface HeartbeatObject {
/** timestamp of the heartbeat */
timestamp?: string;
}
3 changes: 2 additions & 1 deletion src/api/types/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
export * from "./Timestamp.js";
export * from "./EntityEventResponse.js";
export * from "./EntityStreamHeartbeat.js";
export * from "./HeartbeatObject.js";
export * from "./EntityStreamEvent.js";
export * from "./EntityEvent.js";
export * from "./GoogleProtobufAny.js";
export * from "./Status.js";
export * from "./Position.js";
Expand Down Expand Up @@ -114,7 +116,6 @@ export * from "./MeanKeplerianElements.js";
export * from "./TleParameters.js";
export * from "./OrbitMeanElements.js";
export * from "./Orbit.js";
export * from "./EntityEvent.js";
export * from "./TaskQueryResults.js";
export * from "./EntityIdsSelector.js";
export * from "./AgentRequest.js";
Expand Down
2 changes: 1 addition & 1 deletion src/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const SDK_VERSION = "2.0.0";
export const SDK_VERSION = "2.1.0";
Loading