Skip to content
Closed
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
89 changes: 37 additions & 52 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,55 +3,40 @@ name: ci
on: [push]

jobs:
compile:
runs-on: ubuntu-latest

steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Set up node
uses: actions/setup-node@v3

- name: Compile
run: yarn && yarn build

test:
runs-on: ubuntu-latest

steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Set up node
uses: actions/setup-node@v3

- name: Compile
run: yarn && yarn test

publish:
needs: [ compile, test ]
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Set up node
uses: actions/setup-node@v3
- name: Install dependencies
run: yarn install
- name: Build
run: yarn build

- name: Publish to npm
run: |
npm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN}
if [[ ${GITHUB_REF} == *alpha* ]]; then
npm publish --access public --tag alpha
elif [[ ${GITHUB_REF} == *beta* ]]; then
npm publish --access public --tag beta
else
npm publish --access public
fi
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
compile:
runs-on: ubuntu-latest

steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Set up node
uses: actions/setup-node@v3

- name: Install pnpm
uses: pnpm/action-setup@v4

- name: Install dependencies
run: pnpm install

- name: Compile
run: pnpm build

test:
runs-on: ubuntu-latest

steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Set up node
uses: actions/setup-node@v3

- name: Install pnpm
uses: pnpm/action-setup@v4

- name: Install dependencies
run: pnpm install

- name: Test
run: pnpm test
9 changes: 9 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
dist
*.tsbuildinfo
_tmp_*
*.tmp
.tmp/
*.log
.DS_Store
Thumbs.db

189 changes: 0 additions & 189 deletions LICENSE

This file was deleted.

26 changes: 8 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,30 @@

![](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)
[![npm shield](https://img.shields.io/npm/v/)](https://www.npmjs.com/package/)

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

## Documentation

API reference documentation is available [here](https://developer.anduril.com/).

## Requirements

To use the SDK please ensure you have the following installed:

- [NodeJS](https://nodejs.org/en/download/package-manager)

## Installation

```sh
npm i -s @anduril-industries/lattice-sdk
npm i -s
```

## Support

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

## Reference

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

## Usage

Instantiate and use the client with the following:

```typescript
import { LatticeClient } from "@anduril-industries/lattice-sdk";
import { LatticeClient } from "";

const client = new LatticeClient({ token: "YOUR_TOKEN" });
await client.entities.longPollEntityEvents({
Expand All @@ -49,7 +39,7 @@ The SDK exports all request and response types as TypeScript interfaces. Simply
following namespace:

```typescript
import { Lattice } from "@anduril-industries/lattice-sdk";
import { Lattice } from "Lattice";

const request: Lattice.EntityOverride = {
...
Expand All @@ -62,7 +52,7 @@ When the API returns a non-success status code (4xx or 5xx response), a subclass
will be thrown.

```typescript
import { LatticeError } from "@anduril-industries/lattice-sdk";
import { LatticeError } from "Lattice";

try {
await client.entities.longPollEntityEvents(...);
Expand Down Expand Up @@ -519,7 +509,7 @@ const text = new TextDecoder().decode(bytes);
List endpoints are paginated. The SDK provides an iterator so that you can simply loop over the items:

```typescript
import { LatticeClient } from "@anduril-industries/lattice-sdk";
import { LatticeClient } from "";

const client = new LatticeClient({ token: "YOUR_TOKEN" });
const response = await client.objects.listObjects({
Expand Down Expand Up @@ -641,7 +631,7 @@ The SDK provides a way for you to customize the underlying HTTP client / Fetch f
unsupported environment, this provides a way for you to break glass and ensure the SDK works.

```typescript
import { LatticeClient } from "@anduril-industries/lattice-sdk";
import { LatticeClient } from "Lattice";

const client = new LatticeClient({
...
Expand Down
42 changes: 0 additions & 42 deletions jest.config.mjs

This file was deleted.

26 changes: 10 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
{
"name": "@anduril-industries/lattice-sdk",
"version": "2.3.0",
"name": "",
"version": "0.0.1",
"private": false,
"repository": "github:anduril/lattice-sdk-javascript",
"license": "See LICENSE",
"repository": "git+fern-api/lattice-sdk-javascript.git",
"type": "commonjs",
"main": "./dist/cjs/index.js",
"module": "./dist/esm/index.mjs",
Expand Down Expand Up @@ -31,23 +30,18 @@
],
"scripts": {
"format": "prettier . --write --ignore-unknown",
"build": "yarn build:cjs && yarn build:esm",
"build": "pnpm build:cjs && pnpm build:esm",
"build:cjs": "tsc --project ./tsconfig.cjs.json",
"build:esm": "tsc --project ./tsconfig.esm.json && node scripts/rename-to-esm-files.js dist/esm",
"test": "jest --config jest.config.mjs",
"test:unit": "jest --selectProjects unit",
"test:browser": "jest --selectProjects browser",
"test:wire": "jest --selectProjects wire"
"test": "vitest",
"test:unit": "vitest --project unit",
"test:wire": "vitest --project wire"
},
"devDependencies": {
"webpack": "^5.97.1",
"ts-loader": "^9.5.1",
"jest": "^29.7.0",
"@jest/globals": "^29.7.0",
"@types/jest": "^29.5.14",
"ts-jest": "^29.3.4",
"jest-environment-jsdom": "^29.7.0",
"msw": "^2.8.4",
"vitest": "^3.2.4",
"msw": "2.11.2",
"@types/node": "^18.19.70",
"prettier": "^3.4.2",
"typescript": "~5.7.2"
Expand All @@ -58,7 +52,7 @@
"path": false,
"stream": false
},
"packageManager": "[email protected]",
"packageManager": "[email protected]",
"engines": {
"node": ">=18.0.0"
},
Expand Down
Loading
Loading