@markwharton/liquidplanner 2.5.0 → 2.7.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/client.d.ts CHANGED
@@ -96,6 +96,10 @@ export declare class LPClient {
96
96
  getWorkspaces(): Promise<Result<LPWorkspace[]>>;
97
97
  /**
98
98
  * Get all members in the workspace
99
+ *
100
+ * Returns only users with userType "member" — excludes resources and
101
+ * placeholders. The full user list is cached; member filtering is applied
102
+ * post-cache per the cache-then-filter convention.
99
103
  */
100
104
  getWorkspaceMembers(): Promise<Result<LPMember[]>>;
101
105
  /**
package/dist/client.js CHANGED
@@ -263,9 +263,13 @@ export class LPClient {
263
263
  // ============================================================================
264
264
  /**
265
265
  * Get all members in the workspace
266
+ *
267
+ * Returns only users with userType "member" — excludes resources and
268
+ * placeholders. The full user list is cached; member filtering is applied
269
+ * post-cache per the cache-then-filter convention.
266
270
  */
267
271
  async getWorkspaceMembers() {
268
- return this.cached('members', this.cacheTtl.membersTtl, async () => {
272
+ const result = await this.cached('members', this.cacheTtl.membersTtl, async () => {
269
273
  const baseUrl = this.workspaceUrl('users/v1');
270
274
  return paginatedFetch({
271
275
  fetchFn: (url) => this.fetch(url),
@@ -280,6 +284,9 @@ export class LPClient {
280
284
  })),
281
285
  });
282
286
  });
287
+ if (!result.ok)
288
+ return result;
289
+ return ok(result.data.filter(m => m.userType === 'member'));
283
290
  }
284
291
  // ============================================================================
285
292
  // Items
package/dist/index.d.ts CHANGED
@@ -32,7 +32,7 @@ export { LPClient } from './client.js';
32
32
  export { resolveTaskToAssignment } from './workflows.js';
33
33
  export type { LPConfig, LPCacheConfig, LPRetryConfig, LPItemType, LPHierarchyItem, LPItem, LPAncestor, LPWorkspace, LPMember, LPCostCode, LPSyncResult, LPTimesheetEntry, LPTaskResolution, LPUpsertOptions, LPAssignment, LPFindItemsOptions, LPTreeNode, LPWorkspaceTree, } from './types.js';
34
34
  export type { AccessTier } from './types.js';
35
- export { METHOD_TIERS } from './types.js';
35
+ export { METHOD_TIERS, ENTITIES } from './types.js';
36
36
  export { ok, err, getErrorMessage, TTLCache, MemoryCacheStore, LayeredCache } from '@markwharton/api-core';
37
37
  export type { Result, RetryConfig, OnRequestCallback, ClientConfig, Cache, CacheStore, CacheGetOptions } from '@markwharton/api-core';
38
38
  export { hoursToMinutes, normalizeItemType, buildAuthHeader, filterIs, filterIsNot, filterIn, filterGt, filterLt, filterAfter, filterBefore, joinFilters, paginatedFetch, } from './utils.js';
package/dist/index.js CHANGED
@@ -32,7 +32,7 @@
32
32
  export { LPClient } from './client.js';
33
33
  // Workflows
34
34
  export { resolveTaskToAssignment } from './workflows.js';
35
- export { METHOD_TIERS } from './types.js';
35
+ export { METHOD_TIERS, ENTITIES } from './types.js';
36
36
  // Re-exported from @markwharton/api-core
37
37
  export { ok, err, getErrorMessage, TTLCache, MemoryCacheStore, LayeredCache } from '@markwharton/api-core';
38
38
  // Utilities
package/dist/types.d.ts CHANGED
@@ -4,7 +4,7 @@
4
4
  * These types define the data structures used when interacting with
5
5
  * the LiquidPlanner API.
6
6
  */
7
- import type { Result, RetryConfig, ClientConfig } from '@markwharton/api-core';
7
+ import type { Result, RetryConfig, ClientConfig, EntityDef } from '@markwharton/api-core';
8
8
  /**
9
9
  * LiquidPlanner item types in the hierarchy
10
10
  */
@@ -133,6 +133,14 @@ export interface LPWorkspace {
133
133
  }
134
134
  /**
135
135
  * A workspace member from LiquidPlanner
136
+ *
137
+ * Represents LP users with userType "member" only. Resources and placeholders
138
+ * are excluded by getWorkspaceMembers(). The LP API endpoint is /api/users/v1
139
+ * but this library filters to members — the active users who log time and
140
+ * are assigned to work.
141
+ *
142
+ * Roadmap: LPUser type and getUsers() method for all user types (member,
143
+ * resource, placeholder) when the need arises.
136
144
  */
137
145
  export interface LPMember {
138
146
  /** Unique identifier */
@@ -340,3 +348,10 @@ export type AccessTier = 'standard' | 'restricted';
340
348
  * Utility methods (validate, clear, invalidate) are not included.
341
349
  */
342
350
  export declare const METHOD_TIERS: Record<string, AccessTier>;
351
+ /**
352
+ * Entity registry — maps interface names to API path segments and documentation refs.
353
+ *
354
+ * LP entities do not use field filtering (all properties are always included),
355
+ * so `fields` is omitted. The `apiRef` links to api-docs.liquidplanner.com.
356
+ */
357
+ export declare const ENTITIES: Record<string, EntityDef>;
package/dist/types.js CHANGED
@@ -27,3 +27,19 @@ export const METHOD_TIERS = {
27
27
  updateTimesheetEntry: 'standard',
28
28
  upsertTimesheetEntry: 'standard',
29
29
  };
30
+ // ============================================================================
31
+ // Entity Registry
32
+ // ============================================================================
33
+ /**
34
+ * Entity registry — maps interface names to API path segments and documentation refs.
35
+ *
36
+ * LP entities do not use field filtering (all properties are always included),
37
+ * so `fields` is omitted. The `apiRef` links to api-docs.liquidplanner.com.
38
+ */
39
+ export const ENTITIES = {
40
+ LPMember: { path: 'users/v1', apiRef: 'users' },
41
+ LPItem: { path: 'items/v1', apiRef: 'item' },
42
+ LPAncestor: { path: 'items/v1/{id}/ancestors', apiRef: 'item' },
43
+ LPCostCode: { path: 'cost-codes/v1', apiRef: 'cost-codes' },
44
+ LPTimesheetEntry: { path: 'logged-time-entries/v1', apiRef: 'logged-time-entry' },
45
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@markwharton/liquidplanner",
3
- "version": "2.5.0",
3
+ "version": "2.7.0",
4
4
  "description": "LiquidPlanner API client for timesheet integration",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -16,7 +16,7 @@
16
16
  "clean": "rm -rf dist"
17
17
  },
18
18
  "dependencies": {
19
- "@markwharton/api-core": "^1.3.0"
19
+ "@markwharton/api-core": "^1.5.0"
20
20
  },
21
21
  "devDependencies": {
22
22
  "@types/node": "^20.10.0",