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