@atlasnpm/atlas-api-helper 0.2.13 → 0.2.14
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/dist/index.cjs +3 -1
- package/dist/index.d.cts +38 -12
- package/dist/index.d.ts +38 -12
- package/dist/index.js +3 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -36,7 +36,9 @@ var KNOWN_ENTITY_COMPONENTS = /* @__PURE__ */ new Set([
|
|
|
36
36
|
"health",
|
|
37
37
|
"sensor_refs",
|
|
38
38
|
"communications",
|
|
39
|
-
"task_queue"
|
|
39
|
+
"task_queue",
|
|
40
|
+
"status",
|
|
41
|
+
"heartbeat"
|
|
40
42
|
]);
|
|
41
43
|
function validateEntityComponents(components) {
|
|
42
44
|
for (const key of Object.keys(components)) {
|
package/dist/index.d.cts
CHANGED
|
@@ -42,7 +42,7 @@ interface MediaRefItem {
|
|
|
42
42
|
/** Object ID in object storage */
|
|
43
43
|
object_id: string;
|
|
44
44
|
/** Role of the media reference */
|
|
45
|
-
role: "camera_feed" | "thumbnail";
|
|
45
|
+
role: "camera_feed" | "thumbnail" | "heatmap_data";
|
|
46
46
|
}
|
|
47
47
|
/**
|
|
48
48
|
* Military tactical classification component.
|
|
@@ -93,6 +93,29 @@ interface TaskQueueComponent {
|
|
|
93
93
|
/** Ordered list of queued task IDs */
|
|
94
94
|
queued_task_ids: string[];
|
|
95
95
|
}
|
|
96
|
+
/**
|
|
97
|
+
* Operational status component.
|
|
98
|
+
*/
|
|
99
|
+
interface StatusComponent {
|
|
100
|
+
/** Current operational status value */
|
|
101
|
+
value: string;
|
|
102
|
+
/** RFC 3339 timestamp of last status update */
|
|
103
|
+
last_update?: string;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Heartbeat timing component.
|
|
107
|
+
*/
|
|
108
|
+
interface HeartbeatComponent {
|
|
109
|
+
/** RFC 3339 timestamp of last heartbeat */
|
|
110
|
+
last_seen: string;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Command component for tasks.
|
|
114
|
+
*/
|
|
115
|
+
interface CommandComponent {
|
|
116
|
+
/** Command type identifier (required) */
|
|
117
|
+
type: string;
|
|
118
|
+
}
|
|
96
119
|
/**
|
|
97
120
|
* All supported entity components with optional fields.
|
|
98
121
|
* Custom components (prefixed with custom_) are allowed via index signature.
|
|
@@ -107,6 +130,8 @@ interface EntityComponents {
|
|
|
107
130
|
sensor_refs?: SensorRefItem[];
|
|
108
131
|
communications?: CommunicationsComponent;
|
|
109
132
|
task_queue?: TaskQueueComponent;
|
|
133
|
+
status?: StatusComponent;
|
|
134
|
+
heartbeat?: HeartbeatComponent;
|
|
110
135
|
/** Custom components must be prefixed with custom_ */
|
|
111
136
|
[key: `custom_${string}`]: unknown;
|
|
112
137
|
}
|
|
@@ -117,8 +142,8 @@ interface TaskParametersComponent {
|
|
|
117
142
|
latitude?: number;
|
|
118
143
|
longitude?: number;
|
|
119
144
|
altitude_m?: number;
|
|
120
|
-
/**
|
|
121
|
-
[key: string]: unknown;
|
|
145
|
+
/** Custom parameters must be prefixed with custom_ */
|
|
146
|
+
[key: `custom_${string}`]: unknown;
|
|
122
147
|
}
|
|
123
148
|
/**
|
|
124
149
|
* Runtime telemetry about task execution.
|
|
@@ -135,10 +160,11 @@ interface TaskProgressComponent {
|
|
|
135
160
|
* All supported task components.
|
|
136
161
|
*/
|
|
137
162
|
interface TaskComponents {
|
|
163
|
+
command?: CommandComponent;
|
|
138
164
|
parameters?: TaskParametersComponent;
|
|
139
165
|
progress?: TaskProgressComponent;
|
|
140
|
-
/**
|
|
141
|
-
[key: string]: unknown;
|
|
166
|
+
/** Custom components must be prefixed with custom_ */
|
|
167
|
+
[key: `custom_${string}`]: unknown;
|
|
142
168
|
}
|
|
143
169
|
/**
|
|
144
170
|
* A reference from an object to an entity or task.
|
|
@@ -174,10 +200,10 @@ declare function validateEntityComponents(components: Record<string, unknown>):
|
|
|
174
200
|
* Convert typed components to a plain object for API transmission.
|
|
175
201
|
* Strips null and undefined values.
|
|
176
202
|
*
|
|
177
|
-
* @param components - Typed component object
|
|
203
|
+
* @param components - Typed component object
|
|
178
204
|
* @returns Plain object suitable for JSON serialization
|
|
179
205
|
*/
|
|
180
|
-
declare function componentsToRecord(components: EntityComponents | TaskComponents |
|
|
206
|
+
declare function componentsToRecord(components: EntityComponents | TaskComponents | undefined): Record<string, unknown> | undefined;
|
|
181
207
|
|
|
182
208
|
interface Entity {
|
|
183
209
|
entity_id: string;
|
|
@@ -365,8 +391,8 @@ declare class AtlasHttpClient {
|
|
|
365
391
|
listEntities(limit?: number, offset?: number): Promise<unknown>;
|
|
366
392
|
getEntity(entityId: string): Promise<unknown>;
|
|
367
393
|
getEntityByAlias(alias: string): Promise<unknown>;
|
|
368
|
-
createEntity(entityId: string, entityType: string, alias: string, subtype: string, components?: EntityComponents
|
|
369
|
-
updateEntity(entityId: string, components?: EntityComponents
|
|
394
|
+
createEntity(entityId: string, entityType: string, alias: string, subtype: string, components?: EntityComponents): Promise<unknown>;
|
|
395
|
+
updateEntity(entityId: string, components?: EntityComponents, options?: {
|
|
370
396
|
subtype?: string;
|
|
371
397
|
}): Promise<unknown>;
|
|
372
398
|
deleteEntity(entityId: string): Promise<unknown>;
|
|
@@ -391,12 +417,12 @@ declare class AtlasHttpClient {
|
|
|
391
417
|
}): Promise<unknown>;
|
|
392
418
|
listTasks(limit?: number, status?: string, offset?: number): Promise<unknown>;
|
|
393
419
|
getTask(taskId: string): Promise<unknown>;
|
|
394
|
-
createTask(taskId: string, components?: TaskComponents
|
|
420
|
+
createTask(taskId: string, components?: TaskComponents, options?: {
|
|
395
421
|
status?: string;
|
|
396
422
|
entity_id?: string;
|
|
397
423
|
extra?: JsonRecord;
|
|
398
424
|
}): Promise<unknown>;
|
|
399
|
-
updateTask(taskId: string, components?: TaskComponents
|
|
425
|
+
updateTask(taskId: string, components?: TaskComponents, options?: {
|
|
400
426
|
status?: string;
|
|
401
427
|
entity_id?: string;
|
|
402
428
|
extra?: JsonRecord;
|
|
@@ -460,4 +486,4 @@ declare class AtlasHttpClient {
|
|
|
460
486
|
}): Promise<unknown>;
|
|
461
487
|
}
|
|
462
488
|
|
|
463
|
-
export { type Asset, AtlasHttpClient, type ChangedSinceOptions, type ChangedSinceResponse, type ClientOptions, type Command, type CommandDefinition, type CommunicationsComponent, type DeletedEntity, type DeletedObject, type DeletedTask, type Entity, type EntityComponents, type Event, type EventType, type FetchImplementation, type FullDatasetOptions, type GeoFeature, type GeometryComponent, type HealthComponent, type JsonRecord, type MediaRefItem, type MilViewComponent, type Model, type ObjectCreate, type ObjectMetadata, type ObjectReference, type ObjectReferenceItem, type ObjectUpdate, type Sensor, type SensorRefItem, type StoredObject, type Task, type TaskCatalogComponent, type TaskComplete, type TaskComponents, type TaskFail, type TaskParametersComponent, type TaskProgressComponent, type TaskQueueComponent, type TaskStart, type TaskStatusUpdate, type Telemetry, type TelemetryComponent, type Track, type TrackTelemetry, componentsToRecord, validateEntityComponents };
|
|
489
|
+
export { type Asset, AtlasHttpClient, type ChangedSinceOptions, type ChangedSinceResponse, type ClientOptions, type Command, type CommandComponent, type CommandDefinition, type CommunicationsComponent, type DeletedEntity, type DeletedObject, type DeletedTask, type Entity, type EntityComponents, type Event, type EventType, type FetchImplementation, type FullDatasetOptions, type GeoFeature, type GeometryComponent, type HealthComponent, type HeartbeatComponent, type JsonRecord, type MediaRefItem, type MilViewComponent, type Model, type ObjectCreate, type ObjectMetadata, type ObjectReference, type ObjectReferenceItem, type ObjectUpdate, type Sensor, type SensorRefItem, type StatusComponent, type StoredObject, type Task, type TaskCatalogComponent, type TaskComplete, type TaskComponents, type TaskFail, type TaskParametersComponent, type TaskProgressComponent, type TaskQueueComponent, type TaskStart, type TaskStatusUpdate, type Telemetry, type TelemetryComponent, type Track, type TrackTelemetry, componentsToRecord, validateEntityComponents };
|
package/dist/index.d.ts
CHANGED
|
@@ -42,7 +42,7 @@ interface MediaRefItem {
|
|
|
42
42
|
/** Object ID in object storage */
|
|
43
43
|
object_id: string;
|
|
44
44
|
/** Role of the media reference */
|
|
45
|
-
role: "camera_feed" | "thumbnail";
|
|
45
|
+
role: "camera_feed" | "thumbnail" | "heatmap_data";
|
|
46
46
|
}
|
|
47
47
|
/**
|
|
48
48
|
* Military tactical classification component.
|
|
@@ -93,6 +93,29 @@ interface TaskQueueComponent {
|
|
|
93
93
|
/** Ordered list of queued task IDs */
|
|
94
94
|
queued_task_ids: string[];
|
|
95
95
|
}
|
|
96
|
+
/**
|
|
97
|
+
* Operational status component.
|
|
98
|
+
*/
|
|
99
|
+
interface StatusComponent {
|
|
100
|
+
/** Current operational status value */
|
|
101
|
+
value: string;
|
|
102
|
+
/** RFC 3339 timestamp of last status update */
|
|
103
|
+
last_update?: string;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Heartbeat timing component.
|
|
107
|
+
*/
|
|
108
|
+
interface HeartbeatComponent {
|
|
109
|
+
/** RFC 3339 timestamp of last heartbeat */
|
|
110
|
+
last_seen: string;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Command component for tasks.
|
|
114
|
+
*/
|
|
115
|
+
interface CommandComponent {
|
|
116
|
+
/** Command type identifier (required) */
|
|
117
|
+
type: string;
|
|
118
|
+
}
|
|
96
119
|
/**
|
|
97
120
|
* All supported entity components with optional fields.
|
|
98
121
|
* Custom components (prefixed with custom_) are allowed via index signature.
|
|
@@ -107,6 +130,8 @@ interface EntityComponents {
|
|
|
107
130
|
sensor_refs?: SensorRefItem[];
|
|
108
131
|
communications?: CommunicationsComponent;
|
|
109
132
|
task_queue?: TaskQueueComponent;
|
|
133
|
+
status?: StatusComponent;
|
|
134
|
+
heartbeat?: HeartbeatComponent;
|
|
110
135
|
/** Custom components must be prefixed with custom_ */
|
|
111
136
|
[key: `custom_${string}`]: unknown;
|
|
112
137
|
}
|
|
@@ -117,8 +142,8 @@ interface TaskParametersComponent {
|
|
|
117
142
|
latitude?: number;
|
|
118
143
|
longitude?: number;
|
|
119
144
|
altitude_m?: number;
|
|
120
|
-
/**
|
|
121
|
-
[key: string]: unknown;
|
|
145
|
+
/** Custom parameters must be prefixed with custom_ */
|
|
146
|
+
[key: `custom_${string}`]: unknown;
|
|
122
147
|
}
|
|
123
148
|
/**
|
|
124
149
|
* Runtime telemetry about task execution.
|
|
@@ -135,10 +160,11 @@ interface TaskProgressComponent {
|
|
|
135
160
|
* All supported task components.
|
|
136
161
|
*/
|
|
137
162
|
interface TaskComponents {
|
|
163
|
+
command?: CommandComponent;
|
|
138
164
|
parameters?: TaskParametersComponent;
|
|
139
165
|
progress?: TaskProgressComponent;
|
|
140
|
-
/**
|
|
141
|
-
[key: string]: unknown;
|
|
166
|
+
/** Custom components must be prefixed with custom_ */
|
|
167
|
+
[key: `custom_${string}`]: unknown;
|
|
142
168
|
}
|
|
143
169
|
/**
|
|
144
170
|
* A reference from an object to an entity or task.
|
|
@@ -174,10 +200,10 @@ declare function validateEntityComponents(components: Record<string, unknown>):
|
|
|
174
200
|
* Convert typed components to a plain object for API transmission.
|
|
175
201
|
* Strips null and undefined values.
|
|
176
202
|
*
|
|
177
|
-
* @param components - Typed component object
|
|
203
|
+
* @param components - Typed component object
|
|
178
204
|
* @returns Plain object suitable for JSON serialization
|
|
179
205
|
*/
|
|
180
|
-
declare function componentsToRecord(components: EntityComponents | TaskComponents |
|
|
206
|
+
declare function componentsToRecord(components: EntityComponents | TaskComponents | undefined): Record<string, unknown> | undefined;
|
|
181
207
|
|
|
182
208
|
interface Entity {
|
|
183
209
|
entity_id: string;
|
|
@@ -365,8 +391,8 @@ declare class AtlasHttpClient {
|
|
|
365
391
|
listEntities(limit?: number, offset?: number): Promise<unknown>;
|
|
366
392
|
getEntity(entityId: string): Promise<unknown>;
|
|
367
393
|
getEntityByAlias(alias: string): Promise<unknown>;
|
|
368
|
-
createEntity(entityId: string, entityType: string, alias: string, subtype: string, components?: EntityComponents
|
|
369
|
-
updateEntity(entityId: string, components?: EntityComponents
|
|
394
|
+
createEntity(entityId: string, entityType: string, alias: string, subtype: string, components?: EntityComponents): Promise<unknown>;
|
|
395
|
+
updateEntity(entityId: string, components?: EntityComponents, options?: {
|
|
370
396
|
subtype?: string;
|
|
371
397
|
}): Promise<unknown>;
|
|
372
398
|
deleteEntity(entityId: string): Promise<unknown>;
|
|
@@ -391,12 +417,12 @@ declare class AtlasHttpClient {
|
|
|
391
417
|
}): Promise<unknown>;
|
|
392
418
|
listTasks(limit?: number, status?: string, offset?: number): Promise<unknown>;
|
|
393
419
|
getTask(taskId: string): Promise<unknown>;
|
|
394
|
-
createTask(taskId: string, components?: TaskComponents
|
|
420
|
+
createTask(taskId: string, components?: TaskComponents, options?: {
|
|
395
421
|
status?: string;
|
|
396
422
|
entity_id?: string;
|
|
397
423
|
extra?: JsonRecord;
|
|
398
424
|
}): Promise<unknown>;
|
|
399
|
-
updateTask(taskId: string, components?: TaskComponents
|
|
425
|
+
updateTask(taskId: string, components?: TaskComponents, options?: {
|
|
400
426
|
status?: string;
|
|
401
427
|
entity_id?: string;
|
|
402
428
|
extra?: JsonRecord;
|
|
@@ -460,4 +486,4 @@ declare class AtlasHttpClient {
|
|
|
460
486
|
}): Promise<unknown>;
|
|
461
487
|
}
|
|
462
488
|
|
|
463
|
-
export { type Asset, AtlasHttpClient, type ChangedSinceOptions, type ChangedSinceResponse, type ClientOptions, type Command, type CommandDefinition, type CommunicationsComponent, type DeletedEntity, type DeletedObject, type DeletedTask, type Entity, type EntityComponents, type Event, type EventType, type FetchImplementation, type FullDatasetOptions, type GeoFeature, type GeometryComponent, type HealthComponent, type JsonRecord, type MediaRefItem, type MilViewComponent, type Model, type ObjectCreate, type ObjectMetadata, type ObjectReference, type ObjectReferenceItem, type ObjectUpdate, type Sensor, type SensorRefItem, type StoredObject, type Task, type TaskCatalogComponent, type TaskComplete, type TaskComponents, type TaskFail, type TaskParametersComponent, type TaskProgressComponent, type TaskQueueComponent, type TaskStart, type TaskStatusUpdate, type Telemetry, type TelemetryComponent, type Track, type TrackTelemetry, componentsToRecord, validateEntityComponents };
|
|
489
|
+
export { type Asset, AtlasHttpClient, type ChangedSinceOptions, type ChangedSinceResponse, type ClientOptions, type Command, type CommandComponent, type CommandDefinition, type CommunicationsComponent, type DeletedEntity, type DeletedObject, type DeletedTask, type Entity, type EntityComponents, type Event, type EventType, type FetchImplementation, type FullDatasetOptions, type GeoFeature, type GeometryComponent, type HealthComponent, type HeartbeatComponent, type JsonRecord, type MediaRefItem, type MilViewComponent, type Model, type ObjectCreate, type ObjectMetadata, type ObjectReference, type ObjectReferenceItem, type ObjectUpdate, type Sensor, type SensorRefItem, type StatusComponent, type StoredObject, type Task, type TaskCatalogComponent, type TaskComplete, type TaskComponents, type TaskFail, type TaskParametersComponent, type TaskProgressComponent, type TaskQueueComponent, type TaskStart, type TaskStatusUpdate, type Telemetry, type TelemetryComponent, type Track, type TrackTelemetry, componentsToRecord, validateEntityComponents };
|
package/dist/index.js
CHANGED
|
@@ -8,7 +8,9 @@ var KNOWN_ENTITY_COMPONENTS = /* @__PURE__ */ new Set([
|
|
|
8
8
|
"health",
|
|
9
9
|
"sensor_refs",
|
|
10
10
|
"communications",
|
|
11
|
-
"task_queue"
|
|
11
|
+
"task_queue",
|
|
12
|
+
"status",
|
|
13
|
+
"heartbeat"
|
|
12
14
|
]);
|
|
13
15
|
function validateEntityComponents(components) {
|
|
14
16
|
for (const key of Object.keys(components)) {
|
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlasnpm/atlas-api-helper",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.14",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "HTTP client for the Atlas Command REST API.",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"main": "dist/index.cjs",
|
|
8
|
-
"module": "dist/index.
|
|
8
|
+
"module": "dist/index.js",
|
|
9
9
|
"types": "dist/index.d.ts",
|
|
10
10
|
"exports": {
|
|
11
11
|
".": {
|
|
12
12
|
"types": "./dist/index.d.ts",
|
|
13
|
-
"import": "./dist/index.
|
|
13
|
+
"import": "./dist/index.js",
|
|
14
14
|
"require": "./dist/index.cjs"
|
|
15
15
|
}
|
|
16
16
|
},
|