@atlasnpm/atlas-api-helper 0.2.12 → 0.2.13

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 CHANGED
@@ -45,6 +45,14 @@ interface ClientOptions {
45
45
  }
46
46
  ```
47
47
 
48
+ ## Service Operations
49
+
50
+ ```ts
51
+ getRoot(): Promise<JsonRecord>
52
+ getHealth(): Promise<JsonRecord>
53
+ getReadiness(): Promise<JsonRecord>
54
+ ```
55
+
48
56
  ## Entity Operations
49
57
 
50
58
  ### Creating Entities
@@ -207,10 +215,10 @@ await client.failTask("mission-2", "Calibration failed", { code: "CAL-01" });
207
215
 
208
216
  | Method | Description |
209
217
  |--------|-------------|
210
- | `listTasks(limit?, status?)` | List tasks with optional status filter (default limit: 25) |
218
+ | `listTasks(limit?, status?, offset?)` | List tasks with optional status filter (default limit: 25) and offset (default: 0) |
211
219
  | `getTask(taskId)` | Get task by ID |
212
220
  | `deleteTask(taskId)` | Delete a task |
213
- | `getTasksByEntity(entityId, limit?, status?)` | Get tasks for an entity |
221
+ | `getTasksByEntity(entityId, limit?, status?, offset?)` | Get tasks for an entity with optional offset (default: 0) |
214
222
 
215
223
  ## Object Operations
216
224
 
@@ -234,6 +242,24 @@ const stored = await client.createObject(videoBlob, "mission-video", "mission_re
234
242
  ]);
235
243
  ```
236
244
 
245
+ ### Creating Object Metadata
246
+
247
+ ```ts
248
+ createObjectMetadata(
249
+ objectId: string,
250
+ options?: {
251
+ path?: string;
252
+ bucket?: string;
253
+ size_bytes?: number;
254
+ content_type?: string;
255
+ type?: string;
256
+ usage_hints?: string[];
257
+ referenced_by?: Array<{ entity_id?: string; task_id?: string }>;
258
+ extra?: JsonRecord;
259
+ }
260
+ ): Promise<StoredObject>
261
+ ```
262
+
237
263
  ### Updating Object Metadata
238
264
 
239
265
  ```ts
@@ -269,9 +295,10 @@ await client.updateObject("mission-video", ["final_recording", "approved"], [
269
295
  |--------|-------------|
270
296
  | `listObjects(limit?, offset?, contentType?, type?)` | List objects with filters |
271
297
  | `getObject(objectId)` | Get object by ID |
298
+ | `viewObject(objectId)` | Fetch viewable object content inline |
272
299
  | `deleteObject(objectId)` | Delete an object |
273
- | `getObjectsByEntity(entityId, limit?)` | Get objects referenced by an entity |
274
- | `getObjectsByTask(taskId, limit?)` | Get objects referenced by a task |
300
+ | `getObjectsByEntity(entityId, limit?, offset?)` | Get objects referenced by an entity |
301
+ | `getObjectsByTask(taskId, limit?, offset?)` | Get objects referenced by a task |
275
302
  | `findOrphanedObjects(limit?)` | Find objects with no references |
276
303
 
277
304
  ## Query Operations
package/dist/index.cjs CHANGED
@@ -48,22 +48,34 @@ function validateEntityComponents(components) {
48
48
  }
49
49
  }
50
50
  function stripNulls(obj) {
51
- const result = {};
52
- for (const [key, value] of Object.entries(obj)) {
51
+ const stripValue = (value) => {
53
52
  if (value === null || value === void 0) {
54
- continue;
53
+ return void 0;
55
54
  }
56
55
  if (Array.isArray(value)) {
57
- result[key] = value.map(
58
- (item) => typeof item === "object" && item !== null ? stripNulls(item) : item
59
- );
60
- } else if (typeof value === "object") {
61
- result[key] = stripNulls(value);
62
- } else {
63
- result[key] = value;
56
+ return value.map((item) => {
57
+ if (item === null || item === void 0) {
58
+ return item;
59
+ }
60
+ return stripValue(item);
61
+ });
64
62
  }
65
- }
66
- return result;
63
+ if (typeof value === "object") {
64
+ const nested = {};
65
+ for (const [key, innerValue] of Object.entries(value)) {
66
+ if (innerValue === null || innerValue === void 0) {
67
+ continue;
68
+ }
69
+ const stripped = stripValue(innerValue);
70
+ if (stripped !== void 0) {
71
+ nested[key] = stripped;
72
+ }
73
+ }
74
+ return nested;
75
+ }
76
+ return value;
77
+ };
78
+ return stripValue(obj);
67
79
  }
68
80
  function componentsToRecord(components) {
69
81
  if (components === void 0) {
@@ -137,6 +149,16 @@ var AtlasHttpClient = class {
137
149
  }
138
150
  return await response.json();
139
151
  }
152
+ // Service ------------------------------------------------------------------
153
+ getRoot() {
154
+ return this.request("GET", "/");
155
+ }
156
+ getHealth() {
157
+ return this.request("GET", "/health");
158
+ }
159
+ getReadiness() {
160
+ return this.request("GET", "/readiness");
161
+ }
140
162
  // Entities ------------------------------------------------------------------
141
163
  listEntities(limit = 100, offset = 0) {
142
164
  return this.request("GET", "/entities", null, { limit, offset });
@@ -185,16 +207,24 @@ var AtlasHttpClient = class {
185
207
  return this.request("PATCH", `/entities/${entityId}/telemetry`, payload);
186
208
  }
187
209
  checkinEntity(entityId, telemetry, options) {
210
+ const payload = { ...telemetry };
211
+ if (options?.status !== void 0) {
212
+ payload.status = options.status;
213
+ }
188
214
  const params = {
189
215
  status_filter: options?.status_filter ?? "pending,in_progress",
190
216
  limit: options?.limit ?? 10,
191
217
  since: options?.since
192
218
  };
193
- return this.request("POST", `/entities/${entityId}/checkin`, telemetry, params);
219
+ return this.request("POST", `/entities/${entityId}/checkin`, payload, params);
194
220
  }
195
221
  // Tasks ---------------------------------------------------------------------
196
- listTasks(limit = 25, status) {
197
- return this.request("GET", "/tasks", null, { limit, status });
222
+ listTasks(limit = 25, status, offset = 0) {
223
+ return this.request("GET", "/tasks", null, {
224
+ limit,
225
+ status,
226
+ offset
227
+ });
198
228
  }
199
229
  getTask(taskId) {
200
230
  return this.request("GET", `/tasks/${taskId}`);
@@ -225,8 +255,12 @@ var AtlasHttpClient = class {
225
255
  deleteTask(taskId) {
226
256
  return this.request("DELETE", `/tasks/${taskId}`);
227
257
  }
228
- getTasksByEntity(entityId, limit = 25, status) {
229
- return this.request("GET", `/entities/${entityId}/tasks`, null, { limit, status });
258
+ getTasksByEntity(entityId, limit = 25, status, offset = 0) {
259
+ return this.request("GET", `/entities/${entityId}/tasks`, null, {
260
+ limit,
261
+ status,
262
+ offset
263
+ });
230
264
  }
231
265
  startTask(taskId) {
232
266
  return this.request("POST", `/tasks/${taskId}/start`, {});
@@ -267,6 +301,21 @@ var AtlasHttpClient = class {
267
301
  const contentLength = lengthHeader && !Number.isNaN(Number(lengthHeader)) ? Number(lengthHeader) : void 0;
268
302
  return { data: new Uint8Array(buffer), contentType, contentLength };
269
303
  }
304
+ async viewObject(objectId) {
305
+ const url = new URL(`${this.baseUrl}/objects/${objectId}/view`);
306
+ const response = await this.fetchImpl(url.toString(), {
307
+ method: "GET",
308
+ headers: this.headers()
309
+ });
310
+ if (!response.ok) {
311
+ const detail = await response.text();
312
+ throw new Error(`HTTP ${response.status}: ${detail}`);
313
+ }
314
+ const contentType = response.headers.get("content-type") || void 0;
315
+ const lengthHeader = response.headers.get("content-length");
316
+ const contentLength = lengthHeader && !Number.isNaN(Number(lengthHeader)) ? Number(lengthHeader) : void 0;
317
+ return { data: await response.text(), contentType, contentLength };
318
+ }
270
319
  listObjects(limit = 100, offset = 0, contentType, type) {
271
320
  return this.request("GET", "/objects", null, { limit, offset, content_type: contentType, type });
272
321
  }
@@ -274,6 +323,10 @@ var AtlasHttpClient = class {
274
323
  return this.request("GET", `/objects/${objectId}`);
275
324
  }
276
325
  async createObject(file, objectId, usageHint, referencedBy) {
326
+ const contentType = "type" in file ? file.type : "";
327
+ if (!contentType) {
328
+ throw new Error("AtlasHttpClient.createObject requires a content type.");
329
+ }
277
330
  const formData = new FormData();
278
331
  formData.append("object_id", objectId);
279
332
  const filename = file.name ?? "upload.bin";
@@ -294,10 +347,26 @@ var AtlasHttpClient = class {
294
347
  }
295
348
  return stored;
296
349
  }
350
+ createObjectMetadata(objectId, options) {
351
+ const payload = {
352
+ object_id: objectId,
353
+ path: options?.path,
354
+ bucket: options?.bucket,
355
+ size_bytes: options?.size_bytes,
356
+ content_type: options?.content_type,
357
+ type: options?.type,
358
+ usage_hints: options?.usage_hints,
359
+ referenced_by: options?.referenced_by,
360
+ extra: options?.extra
361
+ };
362
+ return this.request("POST", "/objects", payload);
363
+ }
297
364
  updateObject(objectId, usageHints, referencedBy) {
298
365
  if (usageHints === void 0 && referencedBy === void 0) {
299
- throw new Error(
300
- "AtlasHttpClient.updateObject requires usageHints or referencedBy to make an update."
366
+ return Promise.reject(
367
+ new Error(
368
+ "AtlasHttpClient.updateObject requires usageHints or referencedBy to make an update."
369
+ )
301
370
  );
302
371
  }
303
372
  const payload = {};
@@ -308,11 +377,11 @@ var AtlasHttpClient = class {
308
377
  deleteObject(objectId) {
309
378
  return this.request("DELETE", `/objects/${objectId}`);
310
379
  }
311
- getObjectsByEntity(entityId, limit = 50) {
312
- return this.request("GET", `/entities/${entityId}/objects`, null, { limit });
380
+ getObjectsByEntity(entityId, limit = 50, offset = 0) {
381
+ return this.request("GET", `/entities/${entityId}/objects`, null, { limit, offset });
313
382
  }
314
- getObjectsByTask(taskId, limit = 50) {
315
- return this.request("GET", `/tasks/${taskId}/objects`, null, { limit });
383
+ getObjectsByTask(taskId, limit = 50, offset = 0) {
384
+ return this.request("GET", `/tasks/${taskId}/objects`, null, { limit, offset });
316
385
  }
317
386
  addObjectReference(objectId, entityId, taskId) {
318
387
  const payload = {};
package/dist/index.d.cts CHANGED
@@ -359,6 +359,9 @@ declare class AtlasHttpClient {
359
359
  private multipartHeaders;
360
360
  private request;
361
361
  private multipartRequest;
362
+ getRoot(): Promise<unknown>;
363
+ getHealth(): Promise<unknown>;
364
+ getReadiness(): Promise<unknown>;
362
365
  listEntities(limit?: number, offset?: number): Promise<unknown>;
363
366
  getEntity(entityId: string): Promise<unknown>;
364
367
  getEntityByAlias(alias: string): Promise<unknown>;
@@ -381,11 +384,12 @@ declare class AtlasHttpClient {
381
384
  speed_m_s?: number;
382
385
  heading_deg?: number;
383
386
  }, options?: {
387
+ status?: string;
384
388
  status_filter?: string;
385
389
  limit?: number;
386
390
  since?: string;
387
391
  }): Promise<unknown>;
388
- listTasks(limit?: number, status?: string): Promise<unknown>;
392
+ listTasks(limit?: number, status?: string, offset?: number): Promise<unknown>;
389
393
  getTask(taskId: string): Promise<unknown>;
390
394
  createTask(taskId: string, components?: TaskComponents | JsonRecord, options?: {
391
395
  status?: string;
@@ -398,7 +402,7 @@ declare class AtlasHttpClient {
398
402
  extra?: JsonRecord;
399
403
  }): Promise<unknown>;
400
404
  deleteTask(taskId: string): Promise<unknown>;
401
- getTasksByEntity(entityId: string, limit?: number, status?: string): Promise<unknown>;
405
+ getTasksByEntity(entityId: string, limit?: number, status?: string, offset?: number): Promise<unknown>;
402
406
  startTask(taskId: string): Promise<unknown>;
403
407
  completeTask(taskId: string, result?: JsonRecord): Promise<unknown>;
404
408
  transitionTaskStatus(taskId: string, status: string, options?: {
@@ -411,19 +415,37 @@ declare class AtlasHttpClient {
411
415
  contentType?: string;
412
416
  contentLength?: number;
413
417
  }>;
418
+ viewObject(objectId: string): Promise<{
419
+ data: string;
420
+ contentType?: string;
421
+ contentLength?: number;
422
+ }>;
414
423
  listObjects(limit?: number, offset?: number, contentType?: string, type?: string): Promise<unknown>;
415
424
  getObject(objectId: string): Promise<unknown>;
416
425
  createObject(file: Blob | File, objectId: string, usageHint?: string, referencedBy?: Array<{
417
426
  entity_id?: string;
418
427
  task_id?: string;
419
428
  }>): Promise<JsonRecord>;
429
+ createObjectMetadata(objectId: string, options?: {
430
+ path?: string;
431
+ bucket?: string;
432
+ size_bytes?: number;
433
+ content_type?: string;
434
+ type?: string;
435
+ usage_hints?: string[];
436
+ referenced_by?: Array<{
437
+ entity_id?: string;
438
+ task_id?: string;
439
+ }>;
440
+ extra?: JsonRecord;
441
+ }): Promise<unknown>;
420
442
  updateObject(objectId: string, usageHints?: string[], referencedBy?: Array<{
421
443
  entity_id?: string;
422
444
  task_id?: string;
423
445
  }>): Promise<unknown>;
424
446
  deleteObject(objectId: string): Promise<unknown>;
425
- getObjectsByEntity(entityId: string, limit?: number): Promise<unknown>;
426
- getObjectsByTask(taskId: string, limit?: number): Promise<unknown>;
447
+ getObjectsByEntity(entityId: string, limit?: number, offset?: number): Promise<unknown>;
448
+ getObjectsByTask(taskId: string, limit?: number, offset?: number): Promise<unknown>;
427
449
  addObjectReference(objectId: string, entityId?: string, taskId?: string): Promise<unknown>;
428
450
  removeObjectReference(objectId: string, entityId?: string, taskId?: string): Promise<unknown>;
429
451
  findOrphanedObjects(limit?: number): Promise<unknown>;
package/dist/index.d.ts CHANGED
@@ -359,6 +359,9 @@ declare class AtlasHttpClient {
359
359
  private multipartHeaders;
360
360
  private request;
361
361
  private multipartRequest;
362
+ getRoot(): Promise<unknown>;
363
+ getHealth(): Promise<unknown>;
364
+ getReadiness(): Promise<unknown>;
362
365
  listEntities(limit?: number, offset?: number): Promise<unknown>;
363
366
  getEntity(entityId: string): Promise<unknown>;
364
367
  getEntityByAlias(alias: string): Promise<unknown>;
@@ -381,11 +384,12 @@ declare class AtlasHttpClient {
381
384
  speed_m_s?: number;
382
385
  heading_deg?: number;
383
386
  }, options?: {
387
+ status?: string;
384
388
  status_filter?: string;
385
389
  limit?: number;
386
390
  since?: string;
387
391
  }): Promise<unknown>;
388
- listTasks(limit?: number, status?: string): Promise<unknown>;
392
+ listTasks(limit?: number, status?: string, offset?: number): Promise<unknown>;
389
393
  getTask(taskId: string): Promise<unknown>;
390
394
  createTask(taskId: string, components?: TaskComponents | JsonRecord, options?: {
391
395
  status?: string;
@@ -398,7 +402,7 @@ declare class AtlasHttpClient {
398
402
  extra?: JsonRecord;
399
403
  }): Promise<unknown>;
400
404
  deleteTask(taskId: string): Promise<unknown>;
401
- getTasksByEntity(entityId: string, limit?: number, status?: string): Promise<unknown>;
405
+ getTasksByEntity(entityId: string, limit?: number, status?: string, offset?: number): Promise<unknown>;
402
406
  startTask(taskId: string): Promise<unknown>;
403
407
  completeTask(taskId: string, result?: JsonRecord): Promise<unknown>;
404
408
  transitionTaskStatus(taskId: string, status: string, options?: {
@@ -411,19 +415,37 @@ declare class AtlasHttpClient {
411
415
  contentType?: string;
412
416
  contentLength?: number;
413
417
  }>;
418
+ viewObject(objectId: string): Promise<{
419
+ data: string;
420
+ contentType?: string;
421
+ contentLength?: number;
422
+ }>;
414
423
  listObjects(limit?: number, offset?: number, contentType?: string, type?: string): Promise<unknown>;
415
424
  getObject(objectId: string): Promise<unknown>;
416
425
  createObject(file: Blob | File, objectId: string, usageHint?: string, referencedBy?: Array<{
417
426
  entity_id?: string;
418
427
  task_id?: string;
419
428
  }>): Promise<JsonRecord>;
429
+ createObjectMetadata(objectId: string, options?: {
430
+ path?: string;
431
+ bucket?: string;
432
+ size_bytes?: number;
433
+ content_type?: string;
434
+ type?: string;
435
+ usage_hints?: string[];
436
+ referenced_by?: Array<{
437
+ entity_id?: string;
438
+ task_id?: string;
439
+ }>;
440
+ extra?: JsonRecord;
441
+ }): Promise<unknown>;
420
442
  updateObject(objectId: string, usageHints?: string[], referencedBy?: Array<{
421
443
  entity_id?: string;
422
444
  task_id?: string;
423
445
  }>): Promise<unknown>;
424
446
  deleteObject(objectId: string): Promise<unknown>;
425
- getObjectsByEntity(entityId: string, limit?: number): Promise<unknown>;
426
- getObjectsByTask(taskId: string, limit?: number): Promise<unknown>;
447
+ getObjectsByEntity(entityId: string, limit?: number, offset?: number): Promise<unknown>;
448
+ getObjectsByTask(taskId: string, limit?: number, offset?: number): Promise<unknown>;
427
449
  addObjectReference(objectId: string, entityId?: string, taskId?: string): Promise<unknown>;
428
450
  removeObjectReference(objectId: string, entityId?: string, taskId?: string): Promise<unknown>;
429
451
  findOrphanedObjects(limit?: number): Promise<unknown>;
package/dist/index.js CHANGED
@@ -20,22 +20,34 @@ function validateEntityComponents(components) {
20
20
  }
21
21
  }
22
22
  function stripNulls(obj) {
23
- const result = {};
24
- for (const [key, value] of Object.entries(obj)) {
23
+ const stripValue = (value) => {
25
24
  if (value === null || value === void 0) {
26
- continue;
25
+ return void 0;
27
26
  }
28
27
  if (Array.isArray(value)) {
29
- result[key] = value.map(
30
- (item) => typeof item === "object" && item !== null ? stripNulls(item) : item
31
- );
32
- } else if (typeof value === "object") {
33
- result[key] = stripNulls(value);
34
- } else {
35
- result[key] = value;
28
+ return value.map((item) => {
29
+ if (item === null || item === void 0) {
30
+ return item;
31
+ }
32
+ return stripValue(item);
33
+ });
36
34
  }
37
- }
38
- return result;
35
+ if (typeof value === "object") {
36
+ const nested = {};
37
+ for (const [key, innerValue] of Object.entries(value)) {
38
+ if (innerValue === null || innerValue === void 0) {
39
+ continue;
40
+ }
41
+ const stripped = stripValue(innerValue);
42
+ if (stripped !== void 0) {
43
+ nested[key] = stripped;
44
+ }
45
+ }
46
+ return nested;
47
+ }
48
+ return value;
49
+ };
50
+ return stripValue(obj);
39
51
  }
40
52
  function componentsToRecord(components) {
41
53
  if (components === void 0) {
@@ -109,6 +121,16 @@ var AtlasHttpClient = class {
109
121
  }
110
122
  return await response.json();
111
123
  }
124
+ // Service ------------------------------------------------------------------
125
+ getRoot() {
126
+ return this.request("GET", "/");
127
+ }
128
+ getHealth() {
129
+ return this.request("GET", "/health");
130
+ }
131
+ getReadiness() {
132
+ return this.request("GET", "/readiness");
133
+ }
112
134
  // Entities ------------------------------------------------------------------
113
135
  listEntities(limit = 100, offset = 0) {
114
136
  return this.request("GET", "/entities", null, { limit, offset });
@@ -157,16 +179,24 @@ var AtlasHttpClient = class {
157
179
  return this.request("PATCH", `/entities/${entityId}/telemetry`, payload);
158
180
  }
159
181
  checkinEntity(entityId, telemetry, options) {
182
+ const payload = { ...telemetry };
183
+ if (options?.status !== void 0) {
184
+ payload.status = options.status;
185
+ }
160
186
  const params = {
161
187
  status_filter: options?.status_filter ?? "pending,in_progress",
162
188
  limit: options?.limit ?? 10,
163
189
  since: options?.since
164
190
  };
165
- return this.request("POST", `/entities/${entityId}/checkin`, telemetry, params);
191
+ return this.request("POST", `/entities/${entityId}/checkin`, payload, params);
166
192
  }
167
193
  // Tasks ---------------------------------------------------------------------
168
- listTasks(limit = 25, status) {
169
- return this.request("GET", "/tasks", null, { limit, status });
194
+ listTasks(limit = 25, status, offset = 0) {
195
+ return this.request("GET", "/tasks", null, {
196
+ limit,
197
+ status,
198
+ offset
199
+ });
170
200
  }
171
201
  getTask(taskId) {
172
202
  return this.request("GET", `/tasks/${taskId}`);
@@ -197,8 +227,12 @@ var AtlasHttpClient = class {
197
227
  deleteTask(taskId) {
198
228
  return this.request("DELETE", `/tasks/${taskId}`);
199
229
  }
200
- getTasksByEntity(entityId, limit = 25, status) {
201
- return this.request("GET", `/entities/${entityId}/tasks`, null, { limit, status });
230
+ getTasksByEntity(entityId, limit = 25, status, offset = 0) {
231
+ return this.request("GET", `/entities/${entityId}/tasks`, null, {
232
+ limit,
233
+ status,
234
+ offset
235
+ });
202
236
  }
203
237
  startTask(taskId) {
204
238
  return this.request("POST", `/tasks/${taskId}/start`, {});
@@ -239,6 +273,21 @@ var AtlasHttpClient = class {
239
273
  const contentLength = lengthHeader && !Number.isNaN(Number(lengthHeader)) ? Number(lengthHeader) : void 0;
240
274
  return { data: new Uint8Array(buffer), contentType, contentLength };
241
275
  }
276
+ async viewObject(objectId) {
277
+ const url = new URL(`${this.baseUrl}/objects/${objectId}/view`);
278
+ const response = await this.fetchImpl(url.toString(), {
279
+ method: "GET",
280
+ headers: this.headers()
281
+ });
282
+ if (!response.ok) {
283
+ const detail = await response.text();
284
+ throw new Error(`HTTP ${response.status}: ${detail}`);
285
+ }
286
+ const contentType = response.headers.get("content-type") || void 0;
287
+ const lengthHeader = response.headers.get("content-length");
288
+ const contentLength = lengthHeader && !Number.isNaN(Number(lengthHeader)) ? Number(lengthHeader) : void 0;
289
+ return { data: await response.text(), contentType, contentLength };
290
+ }
242
291
  listObjects(limit = 100, offset = 0, contentType, type) {
243
292
  return this.request("GET", "/objects", null, { limit, offset, content_type: contentType, type });
244
293
  }
@@ -246,6 +295,10 @@ var AtlasHttpClient = class {
246
295
  return this.request("GET", `/objects/${objectId}`);
247
296
  }
248
297
  async createObject(file, objectId, usageHint, referencedBy) {
298
+ const contentType = "type" in file ? file.type : "";
299
+ if (!contentType) {
300
+ throw new Error("AtlasHttpClient.createObject requires a content type.");
301
+ }
249
302
  const formData = new FormData();
250
303
  formData.append("object_id", objectId);
251
304
  const filename = file.name ?? "upload.bin";
@@ -266,10 +319,26 @@ var AtlasHttpClient = class {
266
319
  }
267
320
  return stored;
268
321
  }
322
+ createObjectMetadata(objectId, options) {
323
+ const payload = {
324
+ object_id: objectId,
325
+ path: options?.path,
326
+ bucket: options?.bucket,
327
+ size_bytes: options?.size_bytes,
328
+ content_type: options?.content_type,
329
+ type: options?.type,
330
+ usage_hints: options?.usage_hints,
331
+ referenced_by: options?.referenced_by,
332
+ extra: options?.extra
333
+ };
334
+ return this.request("POST", "/objects", payload);
335
+ }
269
336
  updateObject(objectId, usageHints, referencedBy) {
270
337
  if (usageHints === void 0 && referencedBy === void 0) {
271
- throw new Error(
272
- "AtlasHttpClient.updateObject requires usageHints or referencedBy to make an update."
338
+ return Promise.reject(
339
+ new Error(
340
+ "AtlasHttpClient.updateObject requires usageHints or referencedBy to make an update."
341
+ )
273
342
  );
274
343
  }
275
344
  const payload = {};
@@ -280,11 +349,11 @@ var AtlasHttpClient = class {
280
349
  deleteObject(objectId) {
281
350
  return this.request("DELETE", `/objects/${objectId}`);
282
351
  }
283
- getObjectsByEntity(entityId, limit = 50) {
284
- return this.request("GET", `/entities/${entityId}/objects`, null, { limit });
352
+ getObjectsByEntity(entityId, limit = 50, offset = 0) {
353
+ return this.request("GET", `/entities/${entityId}/objects`, null, { limit, offset });
285
354
  }
286
- getObjectsByTask(taskId, limit = 50) {
287
- return this.request("GET", `/tasks/${taskId}/objects`, null, { limit });
355
+ getObjectsByTask(taskId, limit = 50, offset = 0) {
356
+ return this.request("GET", `/tasks/${taskId}/objects`, null, { limit, offset });
288
357
  }
289
358
  addObjectReference(objectId, entityId, taskId) {
290
359
  const payload = {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlasnpm/atlas-api-helper",
3
- "version": "0.2.12",
3
+ "version": "0.2.13",
4
4
  "type": "module",
5
5
  "description": "HTTP client for the Atlas Command REST API.",
6
6
  "license": "MIT",