@anduril-industries/lattice-sdk 3.0.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +119 -15
- package/dist/cjs/BaseClient.d.ts +17 -4
- package/dist/cjs/BaseClient.js +59 -0
- package/dist/cjs/Client.d.ts +13 -13
- package/dist/cjs/Client.js +6 -47
- package/dist/cjs/api/errors/BadRequestError.js +5 -1
- package/dist/cjs/api/errors/ContentTooLargeError.js +5 -1
- package/dist/cjs/api/errors/InsufficientStorageError.js +5 -1
- package/dist/cjs/api/errors/InternalServerError.js +5 -1
- package/dist/cjs/api/errors/NotFoundError.js +5 -1
- package/dist/cjs/api/errors/RequestTimeoutError.js +5 -1
- package/dist/cjs/api/errors/TooManyRequestsError.js +5 -1
- package/dist/cjs/api/errors/UnauthorizedError.js +5 -1
- package/dist/cjs/api/resources/entities/client/Client.d.ts +49 -27
- package/dist/cjs/api/resources/entities/client/Client.js +105 -141
- package/dist/cjs/api/resources/entities/client/requests/EntityOverride.d.ts +8 -1
- package/dist/cjs/api/resources/entities/client/requests/GetEntityRequest.d.ts +10 -0
- package/dist/cjs/api/resources/entities/client/requests/RemoveEntityOverrideRequest.d.ts +13 -0
- package/dist/cjs/api/resources/entities/client/requests/RemoveEntityOverrideRequest.js +3 -0
- package/dist/cjs/api/resources/entities/client/requests/index.d.ts +2 -0
- package/dist/cjs/api/resources/objects/client/Client.d.ts +28 -26
- package/dist/cjs/api/resources/objects/client/Client.js +68 -126
- package/dist/cjs/api/resources/objects/client/requests/DeleteObjectRequest.d.ts +10 -0
- package/dist/cjs/api/resources/objects/client/requests/DeleteObjectRequest.js +3 -0
- package/dist/cjs/api/resources/objects/client/requests/GetObjectMetadataRequest.d.ts +10 -0
- package/dist/cjs/api/resources/objects/client/requests/GetObjectMetadataRequest.js +3 -0
- package/dist/cjs/api/resources/objects/client/requests/GetObjectRequest.d.ts +5 -1
- package/dist/cjs/api/resources/objects/client/requests/ListObjectsRequest.d.ts +1 -6
- package/dist/cjs/api/resources/objects/client/requests/index.d.ts +2 -0
- package/dist/cjs/api/resources/tasks/client/Client.d.ts +83 -25
- package/dist/cjs/api/resources/tasks/client/Client.js +130 -120
- package/dist/cjs/api/resources/tasks/client/requests/GetTaskRequest.d.ts +10 -0
- package/dist/cjs/api/resources/tasks/client/requests/GetTaskRequest.js +3 -0
- package/dist/cjs/api/resources/tasks/client/requests/TaskCreation.d.ts +1 -1
- package/dist/cjs/api/resources/tasks/client/requests/TaskQuery.d.ts +1 -1
- package/dist/cjs/api/resources/tasks/client/requests/TaskStatusUpdate.d.ts +5 -1
- package/dist/cjs/api/resources/tasks/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/types/Agent.d.ts +1 -1
- package/dist/cjs/api/types/AgentRequest.d.ts +12 -0
- package/dist/cjs/api/types/Allocation.d.ts +2 -2
- package/dist/cjs/api/types/CancelRequest.d.ts +3 -2
- package/dist/cjs/api/types/CompleteRequest.d.ts +2 -1
- package/dist/cjs/api/types/Entity.d.ts +2 -2
- package/dist/cjs/api/types/EntityManagerPose.d.ts +17 -0
- package/dist/cjs/api/types/EntityManagerPose.js +3 -0
- package/dist/cjs/api/types/{TMat3.d.ts → EntityManagerTMat3.d.ts} +1 -1
- package/dist/cjs/api/types/EntityManagerTMat3.js +3 -0
- package/dist/cjs/api/types/ExecuteRequest.d.ts +3 -2
- package/dist/cjs/api/types/FieldOfView.d.ts +1 -1
- package/dist/cjs/api/types/LocationUncertainty.d.ts +2 -2
- package/dist/cjs/api/types/Owner.d.ts +1 -1
- package/dist/cjs/api/types/Principal.d.ts +1 -1
- package/dist/cjs/api/types/Relations.d.ts +4 -3
- package/dist/cjs/api/types/Replication.d.ts +2 -2
- package/dist/cjs/api/types/System.d.ts +1 -1
- package/dist/cjs/api/types/Task.d.ts +23 -15
- package/dist/cjs/api/types/TaskEntity.d.ts +6 -2
- package/dist/cjs/api/types/TaskError.d.ts +7 -3
- package/dist/cjs/api/types/TaskError.js +1 -1
- package/dist/cjs/api/types/TaskQueryResults.d.ts +9 -0
- package/dist/cjs/api/types/TaskStatus.d.ts +14 -10
- package/dist/cjs/api/types/TaskStatus.js +1 -1
- package/dist/cjs/api/types/TaskVersion.d.ts +14 -4
- package/dist/cjs/api/types/index.d.ts +2 -1
- package/dist/cjs/api/types/index.js +2 -1
- package/dist/cjs/auth/BearerAuthProvider.d.ts +16 -0
- package/dist/cjs/auth/BearerAuthProvider.js +70 -0
- package/dist/cjs/auth/index.d.ts +1 -0
- package/dist/cjs/auth/index.js +5 -0
- package/dist/cjs/core/auth/AuthProvider.d.ts +4 -1
- package/dist/cjs/core/auth/BearerToken.d.ts +3 -1
- package/dist/cjs/core/auth/BearerToken.js +7 -6
- package/dist/cjs/core/auth/NoOpAuthProvider.d.ts +5 -0
- package/dist/cjs/core/auth/NoOpAuthProvider.js +9 -0
- package/dist/cjs/core/auth/index.d.ts +1 -0
- package/dist/cjs/core/auth/index.js +3 -1
- package/dist/cjs/core/exports.d.ts +2 -0
- package/dist/cjs/core/exports.js +2 -0
- package/dist/cjs/core/fetcher/BinaryResponse.d.ts +6 -7
- package/dist/cjs/core/fetcher/Fetcher.d.ts +9 -2
- package/dist/cjs/core/fetcher/Fetcher.js +204 -10
- package/dist/cjs/core/fetcher/getRequestBody.d.ts +1 -1
- package/dist/cjs/core/fetcher/getRequestBody.js +4 -0
- package/dist/cjs/core/fetcher/getResponseBody.js +18 -4
- package/dist/cjs/core/fetcher/makeRequest.d.ts +1 -1
- package/dist/cjs/core/fetcher/makeRequest.js +0 -2
- package/dist/cjs/core/fetcher/requestWithRetries.js +0 -9
- package/dist/cjs/core/fetcher/signals.d.ts +1 -7
- package/dist/cjs/core/fetcher/signals.js +0 -12
- package/dist/cjs/core/headers.js +6 -4
- package/dist/cjs/core/index.d.ts +1 -0
- package/dist/cjs/core/index.js +2 -1
- package/dist/cjs/core/logging/exports.d.ts +18 -0
- package/dist/cjs/core/logging/exports.js +45 -0
- package/dist/cjs/core/logging/index.d.ts +1 -0
- package/dist/cjs/core/logging/index.js +17 -0
- package/dist/cjs/core/logging/logger.d.ts +126 -0
- package/dist/cjs/core/logging/logger.js +144 -0
- package/dist/cjs/core/pagination/CustomPager.d.ts +82 -0
- package/dist/cjs/core/pagination/CustomPager.js +176 -0
- package/dist/cjs/core/pagination/Page.d.ts +7 -6
- package/dist/cjs/core/pagination/Page.js +1 -0
- package/dist/cjs/core/pagination/exports.d.ts +2 -0
- package/dist/cjs/core/pagination/exports.js +5 -0
- package/dist/cjs/core/pagination/index.d.ts +1 -1
- package/dist/cjs/core/pagination/index.js +3 -3
- package/dist/cjs/core/runtime/runtime.js +11 -10
- package/dist/cjs/core/stream/Stream.d.ts +1 -0
- package/dist/cjs/core/stream/Stream.js +8 -5
- package/dist/cjs/core/url/join.js +0 -1
- package/dist/cjs/errors/LatticeError.js +5 -1
- package/dist/cjs/errors/LatticeTimeoutError.js +5 -1
- package/dist/cjs/errors/handleNonStatusCodeError.d.ts +2 -0
- package/dist/cjs/errors/handleNonStatusCodeError.js +65 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.d.mts +17 -4
- package/dist/esm/BaseClient.mjs +24 -1
- package/dist/esm/Client.d.mts +13 -13
- package/dist/esm/Client.mjs +9 -17
- package/dist/esm/api/errors/BadRequestError.mjs +5 -1
- package/dist/esm/api/errors/ContentTooLargeError.mjs +5 -1
- package/dist/esm/api/errors/InsufficientStorageError.mjs +5 -1
- package/dist/esm/api/errors/InternalServerError.mjs +5 -1
- package/dist/esm/api/errors/NotFoundError.mjs +5 -1
- package/dist/esm/api/errors/RequestTimeoutError.mjs +5 -1
- package/dist/esm/api/errors/TooManyRequestsError.mjs +5 -1
- package/dist/esm/api/errors/UnauthorizedError.mjs +5 -1
- package/dist/esm/api/resources/entities/client/Client.d.mts +49 -27
- package/dist/esm/api/resources/entities/client/Client.mjs +104 -140
- package/dist/esm/api/resources/entities/client/requests/EntityOverride.d.mts +8 -1
- package/dist/esm/api/resources/entities/client/requests/GetEntityRequest.d.mts +10 -0
- package/dist/esm/api/resources/entities/client/requests/RemoveEntityOverrideRequest.d.mts +13 -0
- package/dist/esm/api/resources/entities/client/requests/RemoveEntityOverrideRequest.mjs +2 -0
- package/dist/esm/api/resources/entities/client/requests/index.d.mts +2 -0
- package/dist/esm/api/resources/objects/client/Client.d.mts +28 -26
- package/dist/esm/api/resources/objects/client/Client.mjs +66 -124
- package/dist/esm/api/resources/objects/client/requests/DeleteObjectRequest.d.mts +10 -0
- package/dist/esm/api/resources/objects/client/requests/DeleteObjectRequest.mjs +2 -0
- package/dist/esm/api/resources/objects/client/requests/GetObjectMetadataRequest.d.mts +10 -0
- package/dist/esm/api/resources/objects/client/requests/GetObjectMetadataRequest.mjs +2 -0
- package/dist/esm/api/resources/objects/client/requests/GetObjectRequest.d.mts +5 -1
- package/dist/esm/api/resources/objects/client/requests/ListObjectsRequest.d.mts +1 -6
- package/dist/esm/api/resources/objects/client/requests/index.d.mts +2 -0
- package/dist/esm/api/resources/tasks/client/Client.d.mts +83 -25
- package/dist/esm/api/resources/tasks/client/Client.mjs +129 -119
- package/dist/esm/api/resources/tasks/client/requests/GetTaskRequest.d.mts +10 -0
- package/dist/esm/api/resources/tasks/client/requests/GetTaskRequest.mjs +2 -0
- package/dist/esm/api/resources/tasks/client/requests/TaskCreation.d.mts +1 -1
- package/dist/esm/api/resources/tasks/client/requests/TaskQuery.d.mts +1 -1
- package/dist/esm/api/resources/tasks/client/requests/TaskStatusUpdate.d.mts +5 -1
- package/dist/esm/api/resources/tasks/client/requests/index.d.mts +1 -0
- package/dist/esm/api/types/Agent.d.mts +1 -1
- package/dist/esm/api/types/AgentRequest.d.mts +12 -0
- package/dist/esm/api/types/Allocation.d.mts +2 -2
- package/dist/esm/api/types/CancelRequest.d.mts +3 -2
- package/dist/esm/api/types/CompleteRequest.d.mts +2 -1
- package/dist/esm/api/types/Entity.d.mts +2 -2
- package/dist/esm/api/types/EntityManagerPose.d.mts +17 -0
- package/dist/esm/api/types/EntityManagerPose.mjs +2 -0
- package/dist/esm/api/types/{TMat3.d.mts → EntityManagerTMat3.d.mts} +1 -1
- package/dist/esm/api/types/EntityManagerTMat3.mjs +2 -0
- package/dist/esm/api/types/ExecuteRequest.d.mts +3 -2
- package/dist/esm/api/types/FieldOfView.d.mts +1 -1
- package/dist/esm/api/types/LocationUncertainty.d.mts +2 -2
- package/dist/esm/api/types/Owner.d.mts +1 -1
- package/dist/esm/api/types/Principal.d.mts +1 -1
- package/dist/esm/api/types/Relations.d.mts +4 -3
- package/dist/esm/api/types/Replication.d.mts +2 -2
- package/dist/esm/api/types/System.d.mts +1 -1
- package/dist/esm/api/types/Task.d.mts +23 -15
- package/dist/esm/api/types/TaskEntity.d.mts +6 -2
- package/dist/esm/api/types/TaskError.d.mts +7 -3
- package/dist/esm/api/types/TaskError.mjs +1 -1
- package/dist/esm/api/types/TaskQueryResults.d.mts +9 -0
- package/dist/esm/api/types/TaskStatus.d.mts +14 -10
- package/dist/esm/api/types/TaskStatus.mjs +1 -1
- package/dist/esm/api/types/TaskVersion.d.mts +14 -4
- package/dist/esm/api/types/index.d.mts +2 -1
- package/dist/esm/api/types/index.mjs +2 -1
- package/dist/esm/auth/BearerAuthProvider.d.mts +16 -0
- package/dist/esm/auth/BearerAuthProvider.mjs +33 -0
- package/dist/esm/auth/index.d.mts +1 -0
- package/dist/esm/auth/index.mjs +1 -0
- package/dist/esm/core/auth/AuthProvider.d.mts +4 -1
- package/dist/esm/core/auth/BearerToken.d.mts +3 -1
- package/dist/esm/core/auth/BearerToken.mjs +7 -6
- package/dist/esm/core/auth/NoOpAuthProvider.d.mts +5 -0
- package/dist/esm/core/auth/NoOpAuthProvider.mjs +5 -0
- package/dist/esm/core/auth/index.d.mts +1 -0
- package/dist/esm/core/auth/index.mjs +1 -0
- package/dist/esm/core/exports.d.mts +2 -0
- package/dist/esm/core/exports.mjs +2 -0
- package/dist/esm/core/fetcher/BinaryResponse.d.mts +6 -7
- package/dist/esm/core/fetcher/Fetcher.d.mts +9 -2
- package/dist/esm/core/fetcher/Fetcher.mjs +204 -10
- package/dist/esm/core/fetcher/getRequestBody.d.mts +1 -1
- package/dist/esm/core/fetcher/getRequestBody.mjs +4 -0
- package/dist/esm/core/fetcher/getResponseBody.mjs +18 -4
- package/dist/esm/core/fetcher/makeRequest.d.mts +1 -1
- package/dist/esm/core/fetcher/makeRequest.mjs +0 -2
- package/dist/esm/core/fetcher/requestWithRetries.mjs +0 -9
- package/dist/esm/core/fetcher/signals.d.mts +1 -7
- package/dist/esm/core/fetcher/signals.mjs +0 -12
- package/dist/esm/core/headers.mjs +6 -4
- package/dist/esm/core/index.d.mts +1 -0
- package/dist/esm/core/index.mjs +1 -0
- package/dist/esm/core/logging/exports.d.mts +18 -0
- package/dist/esm/core/logging/exports.mjs +9 -0
- package/dist/esm/core/logging/index.d.mts +1 -0
- package/dist/esm/core/logging/index.mjs +1 -0
- package/dist/esm/core/logging/logger.d.mts +126 -0
- package/dist/esm/core/logging/logger.mjs +138 -0
- package/dist/esm/core/pagination/CustomPager.d.mts +82 -0
- package/dist/esm/core/pagination/CustomPager.mjs +172 -0
- package/dist/esm/core/pagination/Page.d.mts +7 -6
- package/dist/esm/core/pagination/Page.mjs +1 -0
- package/dist/esm/core/pagination/exports.d.mts +2 -0
- package/dist/esm/core/pagination/exports.mjs +1 -0
- package/dist/esm/core/pagination/index.d.mts +1 -1
- package/dist/esm/core/pagination/index.mjs +1 -1
- package/dist/esm/core/runtime/runtime.mjs +11 -10
- package/dist/esm/core/stream/Stream.d.mts +1 -0
- package/dist/esm/core/stream/Stream.mjs +8 -5
- package/dist/esm/core/url/join.mjs +0 -1
- package/dist/esm/errors/LatticeError.mjs +5 -1
- package/dist/esm/errors/LatticeTimeoutError.mjs +5 -1
- package/dist/esm/errors/handleNonStatusCodeError.d.mts +2 -0
- package/dist/esm/errors/handleNonStatusCodeError.mjs +29 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +8 -4
- package/reference.md +219 -91
- package/dist/cjs/core/fetcher/ResponseWithBody.d.ts +0 -4
- package/dist/cjs/core/fetcher/ResponseWithBody.js +0 -6
- package/dist/cjs/core/pagination/Pageable.d.ts +0 -14
- package/dist/cjs/core/pagination/Pageable.js +0 -10
- package/dist/esm/core/fetcher/ResponseWithBody.d.mts +0 -4
- package/dist/esm/core/fetcher/ResponseWithBody.mjs +0 -3
- package/dist/esm/core/pagination/Pageable.d.mts +0 -14
- package/dist/esm/core/pagination/Pageable.mjs +0 -6
- /package/dist/cjs/api/{types/TMat3.js → resources/entities/client/requests/GetEntityRequest.js} +0 -0
- /package/dist/esm/api/{types/TMat3.mjs → resources/entities/client/requests/GetEntityRequest.mjs} +0 -0
package/README.md
CHANGED
|
@@ -6,6 +6,30 @@
|
|
|
6
6
|
|
|
7
7
|
The Lattice SDK TypeScript library provides convenient access to the Lattice SDK APIs from TypeScript.
|
|
8
8
|
|
|
9
|
+
## Table of Contents
|
|
10
|
+
|
|
11
|
+
- [Documentation](#documentation)
|
|
12
|
+
- [Requirements](#requirements)
|
|
13
|
+
- [Installation](#installation)
|
|
14
|
+
- [Support](#support)
|
|
15
|
+
- [Reference](#reference)
|
|
16
|
+
- [Usage](#usage)
|
|
17
|
+
- [Request and Response Types](#request-and-response-types)
|
|
18
|
+
- [Exception Handling](#exception-handling)
|
|
19
|
+
- [Streaming Response](#streaming-response)
|
|
20
|
+
- [File Uploads](#file-uploads)
|
|
21
|
+
- [Binary Response](#binary-response)
|
|
22
|
+
- [Pagination](#pagination)
|
|
23
|
+
- [Advanced](#advanced)
|
|
24
|
+
- [Additional Headers](#additional-headers)
|
|
25
|
+
- [Additional Query String Parameters](#additional-query-string-parameters)
|
|
26
|
+
- [Retries](#retries)
|
|
27
|
+
- [Timeouts](#timeouts)
|
|
28
|
+
- [Aborting Requests](#aborting-requests)
|
|
29
|
+
- [Access Raw Response Data](#access-raw-response-data)
|
|
30
|
+
- [Logging](#logging)
|
|
31
|
+
- [Runtime Compatibility](#runtime-compatibility)
|
|
32
|
+
|
|
9
33
|
## Documentation
|
|
10
34
|
|
|
11
35
|
API reference documentation is available [here](https://developer.anduril.com/).
|
|
@@ -43,7 +67,7 @@ await client.entities.longPollEntityEvents({
|
|
|
43
67
|
});
|
|
44
68
|
```
|
|
45
69
|
|
|
46
|
-
## Request
|
|
70
|
+
## Request and Response Types
|
|
47
71
|
|
|
48
72
|
The SDK exports all request and response types as TypeScript interfaces. Simply import them with the
|
|
49
73
|
following namespace:
|
|
@@ -51,7 +75,7 @@ following namespace:
|
|
|
51
75
|
```typescript
|
|
52
76
|
import { Lattice } from "@anduril-industries/lattice-sdk";
|
|
53
77
|
|
|
54
|
-
const request: Lattice.
|
|
78
|
+
const request: Lattice.GetEntityRequest = {
|
|
55
79
|
...
|
|
56
80
|
};
|
|
57
81
|
```
|
|
@@ -76,6 +100,21 @@ try {
|
|
|
76
100
|
}
|
|
77
101
|
```
|
|
78
102
|
|
|
103
|
+
## Streaming Response
|
|
104
|
+
|
|
105
|
+
Some endpoints return streaming responses instead of returning the full response at once.
|
|
106
|
+
The SDK uses async iterators, so you can consume the responses using a `for await...of` loop.
|
|
107
|
+
|
|
108
|
+
```typescript
|
|
109
|
+
import { LatticeClient } from "@anduril-industries/lattice-sdk";
|
|
110
|
+
|
|
111
|
+
const client = new LatticeClient({ token: "YOUR_TOKEN" });
|
|
112
|
+
const response = await client.entities.streamEntities();
|
|
113
|
+
for await (const item of response) {
|
|
114
|
+
console.log(item);
|
|
115
|
+
}
|
|
116
|
+
```
|
|
117
|
+
|
|
79
118
|
## File Uploads
|
|
80
119
|
|
|
81
120
|
You can upload files using the client:
|
|
@@ -518,26 +557,19 @@ List endpoints are paginated. The SDK provides an iterator so that you can simpl
|
|
|
518
557
|
import { LatticeClient } from "@anduril-industries/lattice-sdk";
|
|
519
558
|
|
|
520
559
|
const client = new LatticeClient({ token: "YOUR_TOKEN" });
|
|
521
|
-
const
|
|
522
|
-
|
|
523
|
-
sinceTimestamp: "2024-01-15T09:30:00Z",
|
|
524
|
-
pageToken: "pageToken",
|
|
525
|
-
allObjectsInMesh: true
|
|
526
|
-
});
|
|
527
|
-
for await (const item of response) {
|
|
560
|
+
const pageableResponse = await client.objects.listObjects();
|
|
561
|
+
for await (const item of pageableResponse) {
|
|
528
562
|
console.log(item);
|
|
529
563
|
}
|
|
530
564
|
|
|
531
565
|
// 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
|
-
});
|
|
566
|
+
let page = await client.objects.listObjects();
|
|
538
567
|
while (page.hasNextPage()) {
|
|
539
568
|
page = page.getNextPage();
|
|
540
569
|
}
|
|
570
|
+
|
|
571
|
+
// You can also access the underlying response
|
|
572
|
+
const response = page.response;
|
|
541
573
|
```
|
|
542
574
|
|
|
543
575
|
## Advanced
|
|
@@ -547,6 +579,15 @@ while (page.hasNextPage()) {
|
|
|
547
579
|
If you would like to send additional headers as part of the request, use the `headers` request option.
|
|
548
580
|
|
|
549
581
|
```typescript
|
|
582
|
+
import { LatticeClient } from "@anduril-industries/lattice-sdk";
|
|
583
|
+
|
|
584
|
+
const client = new LatticeClient({
|
|
585
|
+
...
|
|
586
|
+
headers: {
|
|
587
|
+
'X-Custom-Header': 'custom value'
|
|
588
|
+
}
|
|
589
|
+
});
|
|
590
|
+
|
|
550
591
|
const response = await client.entities.longPollEntityEvents(..., {
|
|
551
592
|
headers: {
|
|
552
593
|
'X-Custom-Header': 'custom value'
|
|
@@ -620,6 +661,69 @@ console.log(data);
|
|
|
620
661
|
console.log(rawResponse.headers['X-My-Header']);
|
|
621
662
|
```
|
|
622
663
|
|
|
664
|
+
### Logging
|
|
665
|
+
|
|
666
|
+
The SDK supports logging. You can configure the logger by passing in a `logging` object to the client options.
|
|
667
|
+
|
|
668
|
+
```typescript
|
|
669
|
+
import { LatticeClient, logging } from "@anduril-industries/lattice-sdk";
|
|
670
|
+
|
|
671
|
+
const client = new LatticeClient({
|
|
672
|
+
...
|
|
673
|
+
logging: {
|
|
674
|
+
level: logging.LogLevel.Debug, // defaults to logging.LogLevel.Info
|
|
675
|
+
logger: new logging.ConsoleLogger(), // defaults to ConsoleLogger
|
|
676
|
+
silent: false, // defaults to true, set to false to enable logging
|
|
677
|
+
}
|
|
678
|
+
});
|
|
679
|
+
```
|
|
680
|
+
The `logging` object can have the following properties:
|
|
681
|
+
- `level`: The log level to use. Defaults to `logging.LogLevel.Info`.
|
|
682
|
+
- `logger`: The logger to use. Defaults to a `logging.ConsoleLogger`.
|
|
683
|
+
- `silent`: Whether to silence the logger. Defaults to `true`.
|
|
684
|
+
|
|
685
|
+
The `level` property can be one of the following values:
|
|
686
|
+
- `logging.LogLevel.Debug`
|
|
687
|
+
- `logging.LogLevel.Info`
|
|
688
|
+
- `logging.LogLevel.Warn`
|
|
689
|
+
- `logging.LogLevel.Error`
|
|
690
|
+
|
|
691
|
+
To provide a custom logger, you can pass in an object that implements the `logging.ILogger` interface.
|
|
692
|
+
|
|
693
|
+
<details>
|
|
694
|
+
<summary>Custom logger examples</summary>
|
|
695
|
+
|
|
696
|
+
Here's an example using the popular `winston` logging library.
|
|
697
|
+
```ts
|
|
698
|
+
import winston from 'winston';
|
|
699
|
+
|
|
700
|
+
const winstonLogger = winston.createLogger({...});
|
|
701
|
+
|
|
702
|
+
const logger: logging.ILogger = {
|
|
703
|
+
debug: (msg, ...args) => winstonLogger.debug(msg, ...args),
|
|
704
|
+
info: (msg, ...args) => winstonLogger.info(msg, ...args),
|
|
705
|
+
warn: (msg, ...args) => winstonLogger.warn(msg, ...args),
|
|
706
|
+
error: (msg, ...args) => winstonLogger.error(msg, ...args),
|
|
707
|
+
};
|
|
708
|
+
```
|
|
709
|
+
|
|
710
|
+
Here's an example using the popular `pino` logging library.
|
|
711
|
+
|
|
712
|
+
```ts
|
|
713
|
+
import pino from 'pino';
|
|
714
|
+
|
|
715
|
+
const pinoLogger = pino({...});
|
|
716
|
+
|
|
717
|
+
const logger: logging.ILogger = {
|
|
718
|
+
debug: (msg, ...args) => pinoLogger.debug(args, msg),
|
|
719
|
+
info: (msg, ...args) => pinoLogger.info(args, msg),
|
|
720
|
+
warn: (msg, ...args) => pinoLogger.warn(args, msg),
|
|
721
|
+
error: (msg, ...args) => pinoLogger.error(args, msg),
|
|
722
|
+
};
|
|
723
|
+
```
|
|
724
|
+
</details>
|
|
725
|
+
|
|
726
|
+
|
|
623
727
|
### Runtime Compatibility
|
|
624
728
|
|
|
625
729
|
|
package/dist/cjs/BaseClient.d.ts
CHANGED
|
@@ -1,17 +1,21 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { BearerAuthProvider } from "./auth/BearerAuthProvider.js";
|
|
2
|
+
import * as core from "./core/index.js";
|
|
2
3
|
import type * as environments from "./environments.js";
|
|
3
|
-
export
|
|
4
|
+
export type BaseClientOptions = {
|
|
4
5
|
environment?: core.Supplier<environments.LatticeEnvironment | string>;
|
|
5
6
|
/** Specify a custom URL to connect the client to. */
|
|
6
7
|
baseUrl?: core.Supplier<string>;
|
|
7
|
-
token?: core.Supplier<core.BearerToken | undefined>;
|
|
8
8
|
/** Additional headers to include in requests. */
|
|
9
9
|
headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
|
|
10
10
|
/** The default maximum time to wait for a response in seconds. */
|
|
11
11
|
timeoutInSeconds?: number;
|
|
12
12
|
/** The default number of times to retry the request. Defaults to 2. */
|
|
13
13
|
maxRetries?: number;
|
|
14
|
-
|
|
14
|
+
/** Provide a custom fetch implementation. Useful for platforms that don't have a built-in fetch or need a custom implementation. */
|
|
15
|
+
fetch?: typeof fetch;
|
|
16
|
+
/** Configure logging for the client. */
|
|
17
|
+
logging?: core.logging.LogConfig | core.logging.Logger;
|
|
18
|
+
} & BearerAuthProvider.AuthOptions;
|
|
15
19
|
export interface BaseRequestOptions {
|
|
16
20
|
/** The maximum time to wait for a response in seconds. */
|
|
17
21
|
timeoutInSeconds?: number;
|
|
@@ -24,3 +28,12 @@ export interface BaseRequestOptions {
|
|
|
24
28
|
/** Additional headers to include in the request. */
|
|
25
29
|
headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
|
|
26
30
|
}
|
|
31
|
+
export type NormalizedClientOptions<T extends BaseClientOptions> = T & {
|
|
32
|
+
logging: core.logging.Logger;
|
|
33
|
+
authProvider?: core.AuthProvider;
|
|
34
|
+
};
|
|
35
|
+
export type NormalizedClientOptionsWithAuth<T extends BaseClientOptions> = NormalizedClientOptions<T> & {
|
|
36
|
+
authProvider: core.AuthProvider;
|
|
37
|
+
};
|
|
38
|
+
export declare function normalizeClientOptions<T extends BaseClientOptions>(options: T): NormalizedClientOptions<T>;
|
|
39
|
+
export declare function normalizeClientOptionsWithAuth<T extends BaseClientOptions>(options: T): NormalizedClientOptionsWithAuth<T>;
|
package/dist/cjs/BaseClient.js
CHANGED
|
@@ -1,3 +1,62 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
3
36
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.normalizeClientOptions = normalizeClientOptions;
|
|
38
|
+
exports.normalizeClientOptionsWithAuth = normalizeClientOptionsWithAuth;
|
|
39
|
+
const BearerAuthProvider_js_1 = require("./auth/BearerAuthProvider.js");
|
|
40
|
+
const headers_js_1 = require("./core/headers.js");
|
|
41
|
+
const core = __importStar(require("./core/index.js"));
|
|
42
|
+
function normalizeClientOptions(options) {
|
|
43
|
+
const headers = (0, headers_js_1.mergeHeaders)({
|
|
44
|
+
"X-Fern-Language": "JavaScript",
|
|
45
|
+
"X-Fern-SDK-Name": "@anduril-industries/lattice-sdk",
|
|
46
|
+
"X-Fern-SDK-Version": "4.0.0",
|
|
47
|
+
"User-Agent": "@anduril-industries/lattice-sdk/4.0.0",
|
|
48
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
|
49
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
50
|
+
}, options === null || options === void 0 ? void 0 : options.headers);
|
|
51
|
+
return Object.assign(Object.assign({}, options), { logging: core.logging.createLogger(options === null || options === void 0 ? void 0 : options.logging), headers });
|
|
52
|
+
}
|
|
53
|
+
function normalizeClientOptionsWithAuth(options) {
|
|
54
|
+
var _a;
|
|
55
|
+
const normalized = normalizeClientOptions(options);
|
|
56
|
+
const normalizedWithNoOpAuthProvider = withNoOpAuthProvider(normalized);
|
|
57
|
+
(_a = normalized.authProvider) !== null && _a !== void 0 ? _a : (normalized.authProvider = new BearerAuthProvider_js_1.BearerAuthProvider(normalizedWithNoOpAuthProvider));
|
|
58
|
+
return normalized;
|
|
59
|
+
}
|
|
60
|
+
function withNoOpAuthProvider(options) {
|
|
61
|
+
return Object.assign(Object.assign({}, options), { authProvider: new core.NoOpAuthProvider() });
|
|
62
|
+
}
|
package/dist/cjs/Client.d.ts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { EntitiesClient } from "./api/resources/entities/client/Client.js";
|
|
2
|
+
import { ObjectsClient } from "./api/resources/objects/client/Client.js";
|
|
3
|
+
import { TasksClient } from "./api/resources/tasks/client/Client.js";
|
|
4
4
|
import type { BaseClientOptions, BaseRequestOptions } from "./BaseClient.js";
|
|
5
|
+
import { type NormalizedClientOptionsWithAuth } from "./BaseClient.js";
|
|
5
6
|
export declare namespace LatticeClient {
|
|
6
|
-
|
|
7
|
-
}
|
|
7
|
+
type Options = BaseClientOptions;
|
|
8
8
|
interface RequestOptions extends BaseRequestOptions {
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
11
|
export declare class LatticeClient {
|
|
12
|
-
protected readonly _options: LatticeClient.Options
|
|
13
|
-
protected _entities:
|
|
14
|
-
protected _tasks:
|
|
15
|
-
protected _objects:
|
|
16
|
-
constructor(
|
|
17
|
-
get entities():
|
|
18
|
-
get tasks():
|
|
19
|
-
get objects():
|
|
12
|
+
protected readonly _options: NormalizedClientOptionsWithAuth<LatticeClient.Options>;
|
|
13
|
+
protected _entities: EntitiesClient | undefined;
|
|
14
|
+
protected _tasks: TasksClient | undefined;
|
|
15
|
+
protected _objects: ObjectsClient | undefined;
|
|
16
|
+
constructor(options: LatticeClient.Options);
|
|
17
|
+
get entities(): EntitiesClient;
|
|
18
|
+
get tasks(): TasksClient;
|
|
19
|
+
get objects(): ObjectsClient;
|
|
20
20
|
}
|
package/dist/cjs/Client.js
CHANGED
|
@@ -1,67 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
-
if (k2 === undefined) k2 = k;
|
|
5
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
-
}
|
|
9
|
-
Object.defineProperty(o, k2, desc);
|
|
10
|
-
}) : (function(o, m, k, k2) {
|
|
11
|
-
if (k2 === undefined) k2 = k;
|
|
12
|
-
o[k2] = m[k];
|
|
13
|
-
}));
|
|
14
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
-
}) : function(o, v) {
|
|
17
|
-
o["default"] = v;
|
|
18
|
-
});
|
|
19
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
-
var ownKeys = function(o) {
|
|
21
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
-
var ar = [];
|
|
23
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
-
return ar;
|
|
25
|
-
};
|
|
26
|
-
return ownKeys(o);
|
|
27
|
-
};
|
|
28
|
-
return function (mod) {
|
|
29
|
-
if (mod && mod.__esModule) return mod;
|
|
30
|
-
var result = {};
|
|
31
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
-
__setModuleDefault(result, mod);
|
|
33
|
-
return result;
|
|
34
|
-
};
|
|
35
|
-
})();
|
|
36
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
4
|
exports.LatticeClient = void 0;
|
|
38
5
|
const Client_js_1 = require("./api/resources/entities/client/Client.js");
|
|
39
6
|
const Client_js_2 = require("./api/resources/objects/client/Client.js");
|
|
40
7
|
const Client_js_3 = require("./api/resources/tasks/client/Client.js");
|
|
41
|
-
const
|
|
42
|
-
const core = __importStar(require("./core/index.js"));
|
|
8
|
+
const BaseClient_js_1 = require("./BaseClient.js");
|
|
43
9
|
class LatticeClient {
|
|
44
|
-
constructor(
|
|
45
|
-
this._options =
|
|
46
|
-
"X-Fern-Language": "JavaScript",
|
|
47
|
-
"X-Fern-SDK-Name": "@anduril-industries/lattice-sdk",
|
|
48
|
-
"X-Fern-SDK-Version": "3.0.0",
|
|
49
|
-
"User-Agent": "@anduril-industries/lattice-sdk/3.0.0",
|
|
50
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
51
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
52
|
-
}, _options === null || _options === void 0 ? void 0 : _options.headers) });
|
|
10
|
+
constructor(options) {
|
|
11
|
+
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
53
12
|
}
|
|
54
13
|
get entities() {
|
|
55
14
|
var _a;
|
|
56
|
-
return ((_a = this._entities) !== null && _a !== void 0 ? _a : (this._entities = new Client_js_1.
|
|
15
|
+
return ((_a = this._entities) !== null && _a !== void 0 ? _a : (this._entities = new Client_js_1.EntitiesClient(this._options)));
|
|
57
16
|
}
|
|
58
17
|
get tasks() {
|
|
59
18
|
var _a;
|
|
60
|
-
return ((_a = this._tasks) !== null && _a !== void 0 ? _a : (this._tasks = new Client_js_3.
|
|
19
|
+
return ((_a = this._tasks) !== null && _a !== void 0 ? _a : (this._tasks = new Client_js_3.TasksClient(this._options)));
|
|
61
20
|
}
|
|
62
21
|
get objects() {
|
|
63
22
|
var _a;
|
|
64
|
-
return ((_a = this._objects) !== null && _a !== void 0 ? _a : (this._objects = new Client_js_2.
|
|
23
|
+
return ((_a = this._objects) !== null && _a !== void 0 ? _a : (this._objects = new Client_js_2.ObjectsClient(this._options)));
|
|
65
24
|
}
|
|
66
25
|
}
|
|
67
26
|
exports.LatticeClient = LatticeClient;
|
|
@@ -44,7 +44,11 @@ class BadRequestError extends errors.LatticeError {
|
|
|
44
44
|
body: body,
|
|
45
45
|
rawResponse: rawResponse,
|
|
46
46
|
});
|
|
47
|
-
Object.setPrototypeOf(this,
|
|
47
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
48
|
+
if (Error.captureStackTrace) {
|
|
49
|
+
Error.captureStackTrace(this, this.constructor);
|
|
50
|
+
}
|
|
51
|
+
this.name = this.constructor.name;
|
|
48
52
|
}
|
|
49
53
|
}
|
|
50
54
|
exports.BadRequestError = BadRequestError;
|
|
@@ -44,7 +44,11 @@ class ContentTooLargeError extends errors.LatticeError {
|
|
|
44
44
|
body: body,
|
|
45
45
|
rawResponse: rawResponse,
|
|
46
46
|
});
|
|
47
|
-
Object.setPrototypeOf(this,
|
|
47
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
48
|
+
if (Error.captureStackTrace) {
|
|
49
|
+
Error.captureStackTrace(this, this.constructor);
|
|
50
|
+
}
|
|
51
|
+
this.name = this.constructor.name;
|
|
48
52
|
}
|
|
49
53
|
}
|
|
50
54
|
exports.ContentTooLargeError = ContentTooLargeError;
|
|
@@ -44,7 +44,11 @@ class InsufficientStorageError extends errors.LatticeError {
|
|
|
44
44
|
body: body,
|
|
45
45
|
rawResponse: rawResponse,
|
|
46
46
|
});
|
|
47
|
-
Object.setPrototypeOf(this,
|
|
47
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
48
|
+
if (Error.captureStackTrace) {
|
|
49
|
+
Error.captureStackTrace(this, this.constructor);
|
|
50
|
+
}
|
|
51
|
+
this.name = this.constructor.name;
|
|
48
52
|
}
|
|
49
53
|
}
|
|
50
54
|
exports.InsufficientStorageError = InsufficientStorageError;
|
|
@@ -44,7 +44,11 @@ class InternalServerError extends errors.LatticeError {
|
|
|
44
44
|
body: body,
|
|
45
45
|
rawResponse: rawResponse,
|
|
46
46
|
});
|
|
47
|
-
Object.setPrototypeOf(this,
|
|
47
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
48
|
+
if (Error.captureStackTrace) {
|
|
49
|
+
Error.captureStackTrace(this, this.constructor);
|
|
50
|
+
}
|
|
51
|
+
this.name = this.constructor.name;
|
|
48
52
|
}
|
|
49
53
|
}
|
|
50
54
|
exports.InternalServerError = InternalServerError;
|
|
@@ -44,7 +44,11 @@ class NotFoundError extends errors.LatticeError {
|
|
|
44
44
|
body: body,
|
|
45
45
|
rawResponse: rawResponse,
|
|
46
46
|
});
|
|
47
|
-
Object.setPrototypeOf(this,
|
|
47
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
48
|
+
if (Error.captureStackTrace) {
|
|
49
|
+
Error.captureStackTrace(this, this.constructor);
|
|
50
|
+
}
|
|
51
|
+
this.name = this.constructor.name;
|
|
48
52
|
}
|
|
49
53
|
}
|
|
50
54
|
exports.NotFoundError = NotFoundError;
|
|
@@ -44,7 +44,11 @@ class RequestTimeoutError extends errors.LatticeError {
|
|
|
44
44
|
body: body,
|
|
45
45
|
rawResponse: rawResponse,
|
|
46
46
|
});
|
|
47
|
-
Object.setPrototypeOf(this,
|
|
47
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
48
|
+
if (Error.captureStackTrace) {
|
|
49
|
+
Error.captureStackTrace(this, this.constructor);
|
|
50
|
+
}
|
|
51
|
+
this.name = this.constructor.name;
|
|
48
52
|
}
|
|
49
53
|
}
|
|
50
54
|
exports.RequestTimeoutError = RequestTimeoutError;
|
|
@@ -44,7 +44,11 @@ class TooManyRequestsError extends errors.LatticeError {
|
|
|
44
44
|
body: body,
|
|
45
45
|
rawResponse: rawResponse,
|
|
46
46
|
});
|
|
47
|
-
Object.setPrototypeOf(this,
|
|
47
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
48
|
+
if (Error.captureStackTrace) {
|
|
49
|
+
Error.captureStackTrace(this, this.constructor);
|
|
50
|
+
}
|
|
51
|
+
this.name = this.constructor.name;
|
|
48
52
|
}
|
|
49
53
|
}
|
|
50
54
|
exports.TooManyRequestsError = TooManyRequestsError;
|
|
@@ -44,7 +44,11 @@ class UnauthorizedError extends errors.LatticeError {
|
|
|
44
44
|
body: body,
|
|
45
45
|
rawResponse: rawResponse,
|
|
46
46
|
});
|
|
47
|
-
Object.setPrototypeOf(this,
|
|
47
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
48
|
+
if (Error.captureStackTrace) {
|
|
49
|
+
Error.captureStackTrace(this, this.constructor);
|
|
50
|
+
}
|
|
51
|
+
this.name = this.constructor.name;
|
|
48
52
|
}
|
|
49
53
|
}
|
|
50
54
|
exports.UnauthorizedError = UnauthorizedError;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js";
|
|
2
|
+
import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js";
|
|
2
3
|
import * as core from "../../../../core/index.js";
|
|
3
4
|
import * as Lattice from "../../../index.js";
|
|
4
|
-
export declare namespace
|
|
5
|
-
|
|
6
|
-
}
|
|
5
|
+
export declare namespace EntitiesClient {
|
|
6
|
+
type Options = BaseClientOptions;
|
|
7
7
|
interface RequestOptions extends BaseRequestOptions {
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
/**
|
|
11
11
|
* The Entities API
|
|
12
12
|
*/
|
|
13
|
-
export declare class
|
|
14
|
-
protected readonly _options:
|
|
15
|
-
constructor(
|
|
13
|
+
export declare class EntitiesClient {
|
|
14
|
+
protected readonly _options: NormalizedClientOptionsWithAuth<EntitiesClient.Options>;
|
|
15
|
+
constructor(options: EntitiesClient.Options);
|
|
16
16
|
/**
|
|
17
17
|
* Publish an entity for ingest into the Entities API. Entities created with this method are "owned" by the originator: other sources,
|
|
18
18
|
* such as the UI, may not edit or delete these entities. The server validates entities at API call time and
|
|
@@ -23,7 +23,7 @@ export declare class Entities {
|
|
|
23
23
|
* provenance.sourceUpdateTime is greater than the provenance.sourceUpdateTime of the existing entity.
|
|
24
24
|
*
|
|
25
25
|
* @param {Lattice.Entity} request
|
|
26
|
-
* @param {
|
|
26
|
+
* @param {EntitiesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
27
27
|
*
|
|
28
28
|
* @throws {@link Lattice.BadRequestError}
|
|
29
29
|
* @throws {@link Lattice.UnauthorizedError}
|
|
@@ -31,20 +31,22 @@ export declare class Entities {
|
|
|
31
31
|
* @example
|
|
32
32
|
* await client.entities.publishEntity({})
|
|
33
33
|
*/
|
|
34
|
-
publishEntity(request: Lattice.Entity, requestOptions?:
|
|
34
|
+
publishEntity(request: Lattice.Entity, requestOptions?: EntitiesClient.RequestOptions): core.HttpResponsePromise<Lattice.Entity>;
|
|
35
35
|
private __publishEntity;
|
|
36
36
|
/**
|
|
37
|
-
* @param {
|
|
38
|
-
* @param {
|
|
37
|
+
* @param {Lattice.GetEntityRequest} request
|
|
38
|
+
* @param {EntitiesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
39
39
|
*
|
|
40
40
|
* @throws {@link Lattice.BadRequestError}
|
|
41
41
|
* @throws {@link Lattice.UnauthorizedError}
|
|
42
42
|
* @throws {@link Lattice.NotFoundError}
|
|
43
43
|
*
|
|
44
44
|
* @example
|
|
45
|
-
* await client.entities.getEntity(
|
|
45
|
+
* await client.entities.getEntity({
|
|
46
|
+
* entityId: "entityId"
|
|
47
|
+
* })
|
|
46
48
|
*/
|
|
47
|
-
getEntity(
|
|
49
|
+
getEntity(request: Lattice.GetEntityRequest, requestOptions?: EntitiesClient.RequestOptions): core.HttpResponsePromise<Lattice.Entity>;
|
|
48
50
|
private __getEntity;
|
|
49
51
|
/**
|
|
50
52
|
* Only fields marked with overridable can be overridden. Please refer to our documentation to see the comprehensive
|
|
@@ -55,35 +57,38 @@ export declare class Entities {
|
|
|
55
57
|
* Note that overrides are applied in an eventually consistent manner. If multiple overrides are created
|
|
56
58
|
* concurrently for the same field path, the last writer wins.
|
|
57
59
|
*
|
|
58
|
-
* @param {string} entityId - The unique ID of the entity to override
|
|
59
|
-
* @param {string} fieldPath - fieldPath to override
|
|
60
60
|
* @param {Lattice.EntityOverride} request
|
|
61
|
-
* @param {
|
|
61
|
+
* @param {EntitiesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
62
62
|
*
|
|
63
63
|
* @throws {@link Lattice.BadRequestError}
|
|
64
64
|
* @throws {@link Lattice.UnauthorizedError}
|
|
65
65
|
* @throws {@link Lattice.NotFoundError}
|
|
66
66
|
*
|
|
67
67
|
* @example
|
|
68
|
-
* await client.entities.overrideEntity(
|
|
68
|
+
* await client.entities.overrideEntity({
|
|
69
|
+
* entityId: "entityId",
|
|
70
|
+
* fieldPath: "mil_view.disposition"
|
|
71
|
+
* })
|
|
69
72
|
*/
|
|
70
|
-
overrideEntity(
|
|
73
|
+
overrideEntity(request: Lattice.EntityOverride, requestOptions?: EntitiesClient.RequestOptions): core.HttpResponsePromise<Lattice.Entity>;
|
|
71
74
|
private __overrideEntity;
|
|
72
75
|
/**
|
|
73
76
|
* This operation clears the override value from the specified field path on the entity.
|
|
74
77
|
*
|
|
75
|
-
* @param {
|
|
76
|
-
* @param {
|
|
77
|
-
* @param {Entities.RequestOptions} requestOptions - Request-specific configuration.
|
|
78
|
+
* @param {Lattice.RemoveEntityOverrideRequest} request
|
|
79
|
+
* @param {EntitiesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
78
80
|
*
|
|
79
81
|
* @throws {@link Lattice.BadRequestError}
|
|
80
82
|
* @throws {@link Lattice.UnauthorizedError}
|
|
81
83
|
* @throws {@link Lattice.NotFoundError}
|
|
82
84
|
*
|
|
83
85
|
* @example
|
|
84
|
-
* await client.entities.removeEntityOverride(
|
|
86
|
+
* await client.entities.removeEntityOverride({
|
|
87
|
+
* entityId: "entityId",
|
|
88
|
+
* fieldPath: "mil_view.disposition"
|
|
89
|
+
* })
|
|
85
90
|
*/
|
|
86
|
-
removeEntityOverride(
|
|
91
|
+
removeEntityOverride(request: Lattice.RemoveEntityOverrideRequest, requestOptions?: EntitiesClient.RequestOptions): core.HttpResponsePromise<Lattice.Entity>;
|
|
87
92
|
private __removeEntityOverride;
|
|
88
93
|
/**
|
|
89
94
|
* This is a long polling API that will first return all pre-existing data and then return all new data as
|
|
@@ -97,7 +102,7 @@ export declare class Entities {
|
|
|
97
102
|
* In this case you must start a new session by sending a request with an empty session token.
|
|
98
103
|
*
|
|
99
104
|
* @param {Lattice.EntityEventRequest} request
|
|
100
|
-
* @param {
|
|
105
|
+
* @param {EntitiesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
101
106
|
*
|
|
102
107
|
* @throws {@link Lattice.BadRequestError}
|
|
103
108
|
* @throws {@link Lattice.UnauthorizedError}
|
|
@@ -110,12 +115,29 @@ export declare class Entities {
|
|
|
110
115
|
* sessionToken: "sessionToken"
|
|
111
116
|
* })
|
|
112
117
|
*/
|
|
113
|
-
longPollEntityEvents(request: Lattice.EntityEventRequest, requestOptions?:
|
|
118
|
+
longPollEntityEvents(request: Lattice.EntityEventRequest, requestOptions?: EntitiesClient.RequestOptions): core.HttpResponsePromise<Lattice.EntityEventResponse>;
|
|
114
119
|
private __longPollEntityEvents;
|
|
115
120
|
/**
|
|
116
|
-
* Establishes a
|
|
121
|
+
* Establishes a server-sent events (SSE) connection that streams entity data in real-time.
|
|
122
|
+
* This is a one-way connection from server to client that follows the SSE protocol with text/event-stream content type.
|
|
123
|
+
*
|
|
124
|
+
* This endpoint enables clients to maintain a real-time view of the common operational picture (COP)
|
|
125
|
+
* by first streaming all pre-existing entities that match filter criteria, then continuously delivering
|
|
126
|
+
* updates as entities are created, modified, or deleted.
|
|
127
|
+
*
|
|
128
|
+
* The server first sends events with type PREEXISTING for all live entities matching the filter that existed before the stream was open,
|
|
129
|
+
* then streams CREATE events for newly created entities, UPDATE events when existing entities change, and DELETED events when entities are removed. The stream remains open
|
|
130
|
+
* indefinitely unless preExistingOnly is set to true.
|
|
131
|
+
*
|
|
132
|
+
* Heartbeat messages can be configured to maintain connection health and detect disconnects by setting the heartbeatIntervalMS
|
|
133
|
+
* parameter. These heartbeats help keep the connection alive and allow clients to verify the server is still responsive.
|
|
134
|
+
*
|
|
135
|
+
* Clients can optimize bandwidth usage by specifying which entity components they need populated using the componentsToInclude parameter.
|
|
136
|
+
* This allows receiving only relevant data instead of complete entities.
|
|
137
|
+
*
|
|
138
|
+
* The connection automatically recovers from temporary disconnections, resuming the stream where it left off. Unlike polling approaches,
|
|
139
|
+
* this provides real-time updates with minimal latency and reduced server load.
|
|
117
140
|
*/
|
|
118
|
-
streamEntities(request?: Lattice.EntityStreamRequest, requestOptions?:
|
|
141
|
+
streamEntities(request?: Lattice.EntityStreamRequest, requestOptions?: EntitiesClient.RequestOptions): core.HttpResponsePromise<core.Stream<Lattice.StreamEntitiesResponse>>;
|
|
119
142
|
private __streamEntities;
|
|
120
|
-
protected _getAuthorizationHeader(): Promise<string | undefined>;
|
|
121
143
|
}
|