@lunnoa/client 0.0.0-development → 1.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/dist/react.cjs CHANGED
@@ -1530,12 +1530,42 @@ var QueueItemsResource = class {
1530
1530
  `/api/queues/${queueId}/items/${itemId}`
1531
1531
  );
1532
1532
  }
1533
- /** Adds an item to a queue. */
1533
+ /** Adds an item to a queue. Pass `objectId` to link the item to an entity. */
1534
1534
  create(queueId, data) {
1535
1535
  return this.http.post(`/api/queues/${queueId}/items`, {
1536
1536
  body: data
1537
1537
  });
1538
1538
  }
1539
+ /**
1540
+ * Lists queue items linked to an Object across all queues in the workspace.
1541
+ * Use for Object detail "Work" panels.
1542
+ */
1543
+ listByObject(objectId, options = {}) {
1544
+ return this.http.get(
1545
+ `/api/objects/${objectId}/queue-items`,
1546
+ {
1547
+ query: {
1548
+ status: options.status,
1549
+ limit: options.limit,
1550
+ offset: options.offset,
1551
+ expansion: serializeCsv(options.expansion)
1552
+ }
1553
+ }
1554
+ );
1555
+ }
1556
+ /** Async-iterates every queue item linked to an Object. */
1557
+ iterateByObject(objectId, options = {}) {
1558
+ return iterateOffset(async (offset) => {
1559
+ const result = await this.listByObject(objectId, {
1560
+ ...options,
1561
+ offset
1562
+ });
1563
+ return {
1564
+ items: result.items ?? [],
1565
+ pagination: result.pagination
1566
+ };
1567
+ });
1568
+ }
1539
1569
  /** Adds many items to a queue in one call. */
1540
1570
  bulkCreate(queueId, data) {
1541
1571
  return this.http.post(