@markwharton/liquidplanner 1.7.0 → 1.7.1

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/client.d.ts CHANGED
@@ -99,7 +99,7 @@ export declare class LPClient {
99
99
  /**
100
100
  * Get the ancestry chain for an item
101
101
  *
102
- * Returns ancestors from root to immediate parent (excludes the item itself).
102
+ * Returns ancestors from root to immediate parent (root→child order, excludes the item itself).
103
103
  * Uses the items/{itemId}/ancestors endpoint.
104
104
  *
105
105
  * @param itemId - The item ID to get ancestors for
package/dist/client.js CHANGED
@@ -219,7 +219,7 @@ export class LPClient {
219
219
  /**
220
220
  * Get the ancestry chain for an item
221
221
  *
222
- * Returns ancestors from root to immediate parent (excludes the item itself).
222
+ * Returns ancestors from root to immediate parent (root→child order, excludes the item itself).
223
223
  * Uses the items/{itemId}/ancestors endpoint.
224
224
  *
225
225
  * @param itemId - The item ID to get ancestors for
@@ -243,7 +243,7 @@ export class LPClient {
243
243
  id: a.id,
244
244
  name: a.name || null,
245
245
  itemType: normalizeItemType(a.itemType),
246
- }));
246
+ })).reverse(); // LP API returns child→root, normalize to root→child
247
247
  return { ancestors };
248
248
  }
249
249
  catch (error) {
@@ -366,8 +366,7 @@ export class LPClient {
366
366
  // Build hierarchyPath from Project and Folder ancestors
367
367
  // Exclude system containers (Package, WorkspaceRoot) and Tasks
368
368
  const hierarchyAncestors = ancestors
369
- .filter(anc => anc.itemType === 'Project' || anc.itemType === 'Folder')
370
- .reverse(); // LP returns child→root, we want root→child
369
+ .filter(anc => anc.itemType === 'Project' || anc.itemType === 'Folder');
371
370
  if (hierarchyAncestors.length > 0) {
372
371
  result.hierarchyPath = hierarchyAncestors
373
372
  .map(anc => anc.name ?? `[${anc.id}]`)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@markwharton/liquidplanner",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "description": "LiquidPlanner API client for timesheet integration",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",