@letpeoplework/lighthouse-client 1.0.0 → 1.1.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/index.cjs CHANGED
@@ -703,6 +703,7 @@ var requestNoContent = async (configuration, dependencies, route, requestOptions
703
703
  var getResolvedMetricsDateRange = (range) => range ?? getDefaultMetricsDateRange();
704
704
  var getMetricsDateRangeQuery = (range) => `startDate=${encodeURIComponent(range.startDate)}&endDate=${encodeURIComponent(range.endDate)}`;
705
705
  var getMetricsAsOfDateQuery = (asOfDate) => `asOfDate=${encodeURIComponent(asOfDate)}`;
706
+ var getViewQuerySuffix = (view) => view === "filtered" ? "&view=filtered" : "";
706
707
  var addUtcDays = (dateStr, days) => {
707
708
  const d = /* @__PURE__ */ new Date(`${dateStr}T00:00:00Z`);
708
709
  d.setUTCDate(d.getUTCDate() + days);
@@ -710,7 +711,8 @@ var addUtcDays = (dateStr, days) => {
710
711
  };
711
712
  var computeItemAge = (dayDate, startedDate) => {
712
713
  const day = Date.parse(`${dayDate}T00:00:00Z`);
713
- const started = Date.parse(startedDate);
714
+ const startedDateOnly = startedDate.substring(0, 10);
715
+ const started = Date.parse(`${startedDateOnly}T00:00:00Z`);
714
716
  const diffDays = Math.floor((day - started) / 864e5);
715
717
  return Math.max(1, diffDays + 1);
716
718
  };
@@ -870,12 +872,12 @@ var createLighthouseClient = (configuration, dependencies = {}) => ({
870
872
  method: "POST"
871
873
  }
872
874
  ),
873
- getTeamThroughput: async (teamId, range) => {
875
+ getTeamThroughput: async (teamId, range, view) => {
874
876
  const r = getResolvedMetricsDateRange(range);
875
877
  return requestJson(
876
878
  configuration,
877
879
  dependencies,
878
- `/v1/teams/${teamId}/metrics/throughput?${getMetricsDateRangeQuery(r)}`,
880
+ `/v1/teams/${teamId}/metrics/throughput?${getMetricsDateRangeQuery(r)}${getViewQuerySuffix(view)}`,
879
881
  { method: "GET" }
880
882
  );
881
883
  },
@@ -921,12 +923,12 @@ var createLighthouseClient = (configuration, dependencies = {}) => ({
921
923
  { method: "GET" }
922
924
  );
923
925
  },
924
- getTeamPredictabilityScore: async (teamId, range) => {
926
+ getTeamPredictabilityScore: async (teamId, range, view) => {
925
927
  const r = getResolvedMetricsDateRange(range);
926
928
  return requestJson(
927
929
  configuration,
928
930
  dependencies,
929
- `/v1/teams/${teamId}/metrics/multiitemforecastpredictabilityscore?${getMetricsDateRangeQuery(r)}`,
931
+ `/v1/teams/${teamId}/metrics/multiitemforecastpredictabilityscore?${getMetricsDateRangeQuery(r)}${getViewQuerySuffix(view)}`,
930
932
  { method: "GET" }
931
933
  );
932
934
  },
package/dist/index.d.cts CHANGED
@@ -162,13 +162,38 @@ declare const getDefaultMetricsDateRange: () => MetricsDateRange;
162
162
  type ManualForecastInput = {
163
163
  readonly remainingItems?: number;
164
164
  readonly targetDate?: string;
165
+ /**
166
+ * Override the team's forecast-filter setting for this forecast call:
167
+ * - `true` — apply the team's exclusion rule (filtered throughput).
168
+ * - `false` — skip the team's exclusion rule (raw throughput).
169
+ * - omit — respect the team's current setting (default).
170
+ *
171
+ * Lighthouse v26.5.24.10+. Older servers ignore this field.
172
+ */
173
+ readonly applyFilterOverride?: boolean;
165
174
  };
166
175
  type BacktestInput = {
167
176
  readonly startDate: string;
168
177
  readonly endDate: string;
169
178
  readonly historicalStartDate: string;
170
179
  readonly historicalEndDate: string;
171
- };
180
+ /**
181
+ * Override the team's forecast-filter setting for this backtest call:
182
+ * - `true` — apply the team's exclusion rule (filtered throughput).
183
+ * - `false` — skip the team's exclusion rule (raw throughput).
184
+ * - omit — respect the team's current setting (default).
185
+ *
186
+ * Lighthouse v26.5.24.10+. Older servers ignore this field.
187
+ */
188
+ readonly applyFilterOverride?: boolean;
189
+ };
190
+ /**
191
+ * Forecast-filter view for team-level throughput / PBC / predictability metrics.
192
+ * Lighthouse v26.5.24.10+ ignores unknown values and falls back to raw.
193
+ * - `"filtered"` — apply the team's exclusion rule.
194
+ * - `"raw"` / omit — return unfiltered data (default).
195
+ */
196
+ type ThroughputFilterView = "raw" | "filtered";
172
197
  type WorkItemAgeEntry = {
173
198
  readonly id: number;
174
199
  readonly name: string;
@@ -214,13 +239,13 @@ type LighthouseClient = {
214
239
  readonly updatePortfolio: (portfolioId: number, payload: LighthouseWritePayload) => Promise<LighthouseApiResult<unknown>>;
215
240
  readonly deletePortfolio: (portfolioId: number) => Promise<LighthouseApiResult<void>>;
216
241
  readonly refreshPortfolio: (portfolioId: number) => Promise<LighthouseApiResult<void>>;
217
- readonly getTeamThroughput: (teamId: number, range?: MetricsDateRange) => Promise<LighthouseApiResult<unknown>>;
242
+ readonly getTeamThroughput: (teamId: number, range?: MetricsDateRange, view?: ThroughputFilterView) => Promise<LighthouseApiResult<unknown>>;
218
243
  readonly getTeamArrivals: (teamId: number, range?: MetricsDateRange) => Promise<LighthouseApiResult<unknown>>;
219
244
  readonly getTeamWipOverTime: (teamId: number, range?: MetricsDateRange) => Promise<LighthouseApiResult<unknown>>;
220
245
  readonly getTeamWip: (teamId: number, asOfDate: string) => Promise<LighthouseApiResult<readonly unknown[]>>;
221
246
  readonly getTeamCycleTimePercentiles: (teamId: number, range?: MetricsDateRange) => Promise<LighthouseApiResult<readonly unknown[]>>;
222
247
  readonly getTeamCycleTimeData: (teamId: number, range?: MetricsDateRange) => Promise<LighthouseApiResult<readonly unknown[]>>;
223
- readonly getTeamPredictabilityScore: (teamId: number, range?: MetricsDateRange) => Promise<LighthouseApiResult<unknown>>;
248
+ readonly getTeamPredictabilityScore: (teamId: number, range?: MetricsDateRange, view?: ThroughputFilterView) => Promise<LighthouseApiResult<unknown>>;
224
249
  readonly getTeamTotalWorkItemAge: (teamId: number, asOfDate: string) => Promise<LighthouseApiResult<number>>;
225
250
  readonly getTeamTotalWorkItemAgeInfo: (teamId: number, range?: MetricsDateRange) => Promise<LighthouseApiResult<unknown>>;
226
251
  readonly getPortfolioThroughput: (portfolioId: number, range?: MetricsDateRange) => Promise<LighthouseApiResult<unknown>>;
@@ -251,4 +276,4 @@ type LighthouseClientDependencies = {
251
276
  };
252
277
  declare const createLighthouseClient: (configuration: LighthouseClientConfiguration, dependencies?: LighthouseClientDependencies) => LighthouseClient;
253
278
 
254
- export { type BacktestInput, type CliAuthSessionPollResult, type CliAuthSessionStartError, type CliAuthSessionStartOutcome, type CliAuthSessionStartResult, type CliConnection, type CliServerAuthMode, type CliServerConnection, type CliStandaloneConnection, type ClientCapability, type ClientPackageContract, type ConnectivityCategory, type ConnectivityDependencies, type ConnectivityFetchResponse, type ConnectivityValidationResult, type DailyTotalWorkItemAge, type DailyWorkItemAge, type LighthouseApiError, type LighthouseApiResult, type LighthouseAuthContext, type LighthouseAuthOverrides, type LighthouseAuthStatus, type LighthouseAuthStore, type LighthouseClient, type LighthouseClientAuth, type LighthouseClientConfiguration, type LighthouseClientDependencies, type LighthouseConnectionConfiguration, type LighthouseWritePayload, type ManualForecastInput, type MetricsDateRange, type ResolvedLighthouseEndpoint, type ServerAuthModeResult, type StandaloneDiscoveryContract, type StandaloneDiscoveryContractParseResult, type StoredLighthouseAuth, type TotalWorkItemAgeOverTimeResult, type WorkItemAgeEntry, type WorkItemAgeOverTimeResult, createLighthouseAuthContext, createLighthouseClient, getClientPackageContract, getDefaultMetricsDateRange, getStandaloneDiscoveryLockfilePath, loadStandaloneDiscoveryContract, parseStandaloneDiscoveryContract, pollCliAuthSession, queryServerAuthMode, startCliAuthSession, validateLighthouseConnectivity };
279
+ export { type BacktestInput, type CliAuthSessionPollResult, type CliAuthSessionStartError, type CliAuthSessionStartOutcome, type CliAuthSessionStartResult, type CliConnection, type CliServerAuthMode, type CliServerConnection, type CliStandaloneConnection, type ClientCapability, type ClientPackageContract, type ConnectivityCategory, type ConnectivityDependencies, type ConnectivityFetchResponse, type ConnectivityValidationResult, type DailyTotalWorkItemAge, type DailyWorkItemAge, type LighthouseApiError, type LighthouseApiResult, type LighthouseAuthContext, type LighthouseAuthOverrides, type LighthouseAuthStatus, type LighthouseAuthStore, type LighthouseClient, type LighthouseClientAuth, type LighthouseClientConfiguration, type LighthouseClientDependencies, type LighthouseConnectionConfiguration, type LighthouseWritePayload, type ManualForecastInput, type MetricsDateRange, type ResolvedLighthouseEndpoint, type ServerAuthModeResult, type StandaloneDiscoveryContract, type StandaloneDiscoveryContractParseResult, type StoredLighthouseAuth, type ThroughputFilterView, type TotalWorkItemAgeOverTimeResult, type WorkItemAgeEntry, type WorkItemAgeOverTimeResult, createLighthouseAuthContext, createLighthouseClient, getClientPackageContract, getDefaultMetricsDateRange, getStandaloneDiscoveryLockfilePath, loadStandaloneDiscoveryContract, parseStandaloneDiscoveryContract, pollCliAuthSession, queryServerAuthMode, startCliAuthSession, validateLighthouseConnectivity };
package/dist/index.d.ts CHANGED
@@ -162,13 +162,38 @@ declare const getDefaultMetricsDateRange: () => MetricsDateRange;
162
162
  type ManualForecastInput = {
163
163
  readonly remainingItems?: number;
164
164
  readonly targetDate?: string;
165
+ /**
166
+ * Override the team's forecast-filter setting for this forecast call:
167
+ * - `true` — apply the team's exclusion rule (filtered throughput).
168
+ * - `false` — skip the team's exclusion rule (raw throughput).
169
+ * - omit — respect the team's current setting (default).
170
+ *
171
+ * Lighthouse v26.5.24.10+. Older servers ignore this field.
172
+ */
173
+ readonly applyFilterOverride?: boolean;
165
174
  };
166
175
  type BacktestInput = {
167
176
  readonly startDate: string;
168
177
  readonly endDate: string;
169
178
  readonly historicalStartDate: string;
170
179
  readonly historicalEndDate: string;
171
- };
180
+ /**
181
+ * Override the team's forecast-filter setting for this backtest call:
182
+ * - `true` — apply the team's exclusion rule (filtered throughput).
183
+ * - `false` — skip the team's exclusion rule (raw throughput).
184
+ * - omit — respect the team's current setting (default).
185
+ *
186
+ * Lighthouse v26.5.24.10+. Older servers ignore this field.
187
+ */
188
+ readonly applyFilterOverride?: boolean;
189
+ };
190
+ /**
191
+ * Forecast-filter view for team-level throughput / PBC / predictability metrics.
192
+ * Lighthouse v26.5.24.10+ ignores unknown values and falls back to raw.
193
+ * - `"filtered"` — apply the team's exclusion rule.
194
+ * - `"raw"` / omit — return unfiltered data (default).
195
+ */
196
+ type ThroughputFilterView = "raw" | "filtered";
172
197
  type WorkItemAgeEntry = {
173
198
  readonly id: number;
174
199
  readonly name: string;
@@ -214,13 +239,13 @@ type LighthouseClient = {
214
239
  readonly updatePortfolio: (portfolioId: number, payload: LighthouseWritePayload) => Promise<LighthouseApiResult<unknown>>;
215
240
  readonly deletePortfolio: (portfolioId: number) => Promise<LighthouseApiResult<void>>;
216
241
  readonly refreshPortfolio: (portfolioId: number) => Promise<LighthouseApiResult<void>>;
217
- readonly getTeamThroughput: (teamId: number, range?: MetricsDateRange) => Promise<LighthouseApiResult<unknown>>;
242
+ readonly getTeamThroughput: (teamId: number, range?: MetricsDateRange, view?: ThroughputFilterView) => Promise<LighthouseApiResult<unknown>>;
218
243
  readonly getTeamArrivals: (teamId: number, range?: MetricsDateRange) => Promise<LighthouseApiResult<unknown>>;
219
244
  readonly getTeamWipOverTime: (teamId: number, range?: MetricsDateRange) => Promise<LighthouseApiResult<unknown>>;
220
245
  readonly getTeamWip: (teamId: number, asOfDate: string) => Promise<LighthouseApiResult<readonly unknown[]>>;
221
246
  readonly getTeamCycleTimePercentiles: (teamId: number, range?: MetricsDateRange) => Promise<LighthouseApiResult<readonly unknown[]>>;
222
247
  readonly getTeamCycleTimeData: (teamId: number, range?: MetricsDateRange) => Promise<LighthouseApiResult<readonly unknown[]>>;
223
- readonly getTeamPredictabilityScore: (teamId: number, range?: MetricsDateRange) => Promise<LighthouseApiResult<unknown>>;
248
+ readonly getTeamPredictabilityScore: (teamId: number, range?: MetricsDateRange, view?: ThroughputFilterView) => Promise<LighthouseApiResult<unknown>>;
224
249
  readonly getTeamTotalWorkItemAge: (teamId: number, asOfDate: string) => Promise<LighthouseApiResult<number>>;
225
250
  readonly getTeamTotalWorkItemAgeInfo: (teamId: number, range?: MetricsDateRange) => Promise<LighthouseApiResult<unknown>>;
226
251
  readonly getPortfolioThroughput: (portfolioId: number, range?: MetricsDateRange) => Promise<LighthouseApiResult<unknown>>;
@@ -251,4 +276,4 @@ type LighthouseClientDependencies = {
251
276
  };
252
277
  declare const createLighthouseClient: (configuration: LighthouseClientConfiguration, dependencies?: LighthouseClientDependencies) => LighthouseClient;
253
278
 
254
- export { type BacktestInput, type CliAuthSessionPollResult, type CliAuthSessionStartError, type CliAuthSessionStartOutcome, type CliAuthSessionStartResult, type CliConnection, type CliServerAuthMode, type CliServerConnection, type CliStandaloneConnection, type ClientCapability, type ClientPackageContract, type ConnectivityCategory, type ConnectivityDependencies, type ConnectivityFetchResponse, type ConnectivityValidationResult, type DailyTotalWorkItemAge, type DailyWorkItemAge, type LighthouseApiError, type LighthouseApiResult, type LighthouseAuthContext, type LighthouseAuthOverrides, type LighthouseAuthStatus, type LighthouseAuthStore, type LighthouseClient, type LighthouseClientAuth, type LighthouseClientConfiguration, type LighthouseClientDependencies, type LighthouseConnectionConfiguration, type LighthouseWritePayload, type ManualForecastInput, type MetricsDateRange, type ResolvedLighthouseEndpoint, type ServerAuthModeResult, type StandaloneDiscoveryContract, type StandaloneDiscoveryContractParseResult, type StoredLighthouseAuth, type TotalWorkItemAgeOverTimeResult, type WorkItemAgeEntry, type WorkItemAgeOverTimeResult, createLighthouseAuthContext, createLighthouseClient, getClientPackageContract, getDefaultMetricsDateRange, getStandaloneDiscoveryLockfilePath, loadStandaloneDiscoveryContract, parseStandaloneDiscoveryContract, pollCliAuthSession, queryServerAuthMode, startCliAuthSession, validateLighthouseConnectivity };
279
+ export { type BacktestInput, type CliAuthSessionPollResult, type CliAuthSessionStartError, type CliAuthSessionStartOutcome, type CliAuthSessionStartResult, type CliConnection, type CliServerAuthMode, type CliServerConnection, type CliStandaloneConnection, type ClientCapability, type ClientPackageContract, type ConnectivityCategory, type ConnectivityDependencies, type ConnectivityFetchResponse, type ConnectivityValidationResult, type DailyTotalWorkItemAge, type DailyWorkItemAge, type LighthouseApiError, type LighthouseApiResult, type LighthouseAuthContext, type LighthouseAuthOverrides, type LighthouseAuthStatus, type LighthouseAuthStore, type LighthouseClient, type LighthouseClientAuth, type LighthouseClientConfiguration, type LighthouseClientDependencies, type LighthouseConnectionConfiguration, type LighthouseWritePayload, type ManualForecastInput, type MetricsDateRange, type ResolvedLighthouseEndpoint, type ServerAuthModeResult, type StandaloneDiscoveryContract, type StandaloneDiscoveryContractParseResult, type StoredLighthouseAuth, type ThroughputFilterView, type TotalWorkItemAgeOverTimeResult, type WorkItemAgeEntry, type WorkItemAgeOverTimeResult, createLighthouseAuthContext, createLighthouseClient, getClientPackageContract, getDefaultMetricsDateRange, getStandaloneDiscoveryLockfilePath, loadStandaloneDiscoveryContract, parseStandaloneDiscoveryContract, pollCliAuthSession, queryServerAuthMode, startCliAuthSession, validateLighthouseConnectivity };
package/dist/index.js CHANGED
@@ -669,6 +669,7 @@ var requestNoContent = async (configuration, dependencies, route, requestOptions
669
669
  var getResolvedMetricsDateRange = (range) => range ?? getDefaultMetricsDateRange();
670
670
  var getMetricsDateRangeQuery = (range) => `startDate=${encodeURIComponent(range.startDate)}&endDate=${encodeURIComponent(range.endDate)}`;
671
671
  var getMetricsAsOfDateQuery = (asOfDate) => `asOfDate=${encodeURIComponent(asOfDate)}`;
672
+ var getViewQuerySuffix = (view) => view === "filtered" ? "&view=filtered" : "";
672
673
  var addUtcDays = (dateStr, days) => {
673
674
  const d = /* @__PURE__ */ new Date(`${dateStr}T00:00:00Z`);
674
675
  d.setUTCDate(d.getUTCDate() + days);
@@ -676,7 +677,8 @@ var addUtcDays = (dateStr, days) => {
676
677
  };
677
678
  var computeItemAge = (dayDate, startedDate) => {
678
679
  const day = Date.parse(`${dayDate}T00:00:00Z`);
679
- const started = Date.parse(startedDate);
680
+ const startedDateOnly = startedDate.substring(0, 10);
681
+ const started = Date.parse(`${startedDateOnly}T00:00:00Z`);
680
682
  const diffDays = Math.floor((day - started) / 864e5);
681
683
  return Math.max(1, diffDays + 1);
682
684
  };
@@ -836,12 +838,12 @@ var createLighthouseClient = (configuration, dependencies = {}) => ({
836
838
  method: "POST"
837
839
  }
838
840
  ),
839
- getTeamThroughput: async (teamId, range) => {
841
+ getTeamThroughput: async (teamId, range, view) => {
840
842
  const r = getResolvedMetricsDateRange(range);
841
843
  return requestJson(
842
844
  configuration,
843
845
  dependencies,
844
- `/v1/teams/${teamId}/metrics/throughput?${getMetricsDateRangeQuery(r)}`,
846
+ `/v1/teams/${teamId}/metrics/throughput?${getMetricsDateRangeQuery(r)}${getViewQuerySuffix(view)}`,
845
847
  { method: "GET" }
846
848
  );
847
849
  },
@@ -887,12 +889,12 @@ var createLighthouseClient = (configuration, dependencies = {}) => ({
887
889
  { method: "GET" }
888
890
  );
889
891
  },
890
- getTeamPredictabilityScore: async (teamId, range) => {
892
+ getTeamPredictabilityScore: async (teamId, range, view) => {
891
893
  const r = getResolvedMetricsDateRange(range);
892
894
  return requestJson(
893
895
  configuration,
894
896
  dependencies,
895
- `/v1/teams/${teamId}/metrics/multiitemforecastpredictabilityscore?${getMetricsDateRangeQuery(r)}`,
897
+ `/v1/teams/${teamId}/metrics/multiitemforecastpredictabilityscore?${getMetricsDateRangeQuery(r)}${getViewQuerySuffix(view)}`,
896
898
  { method: "GET" }
897
899
  );
898
900
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@letpeoplework/lighthouse-client",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "Shared Lighthouse API client contracts",
5
5
  "repository": "https://github.com/LetPeopleWork/lighthouse-clients",
6
6
  "type": "module",