@letpeoplework/lighthouse-client 1.5.0 → 1.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/index.cjs +88 -1
- package/dist/index.d.cts +81 -1
- package/dist/index.d.ts +81 -1
- package/dist/index.js +88 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -734,6 +734,12 @@ var getMetricsAsOfDateQuery = (asOfDate) => `asOfDate=${encodeURIComponent(asOfD
|
|
|
734
734
|
var getItemIdsQuerySuffix = (itemIds) => itemIds && itemIds.length > 0 ? itemIds.map((id) => `&itemIds=${encodeURIComponent(id)}`).join("") : "";
|
|
735
735
|
var getViewQuerySuffix = (view) => view === "filtered" ? "&view=filtered" : "";
|
|
736
736
|
var getDefinitionIdQuerySuffix = (definitionId) => definitionId !== void 0 ? `&definitionId=${encodeURIComponent(definitionId)}` : "";
|
|
737
|
+
var getPercentilesOverTimeQuerySuffix = (metricType, horizon) => {
|
|
738
|
+
const metricTypePart = metricType === void 0 ? "" : `&metricType=${encodeURIComponent(metricType)}`;
|
|
739
|
+
const horizonPart = horizon === void 0 ? "" : `&horizon=${encodeURIComponent(horizon)}`;
|
|
740
|
+
return `${metricTypePart}${horizonPart}`;
|
|
741
|
+
};
|
|
742
|
+
var getProcessBehaviorTypeQuerySuffix = (metricType) => metricType === void 0 ? "" : `&type=${encodeURIComponent(metricType)}`;
|
|
737
743
|
var addUtcDays = (dateStr, days) => {
|
|
738
744
|
const d = /* @__PURE__ */ new Date(`${dateStr}T00:00:00Z`);
|
|
739
745
|
d.setUTCDate(d.getUTCDate() + days);
|
|
@@ -787,7 +793,10 @@ var FEATURE_REQUIRES_SERVER_NEWER_THAN = {
|
|
|
787
793
|
cumulativeStateTime: "v26.5.24.10",
|
|
788
794
|
recurringBlackoutRules: "v26.5.29.5",
|
|
789
795
|
workItemAgePercentiles: "v26.6.7.1",
|
|
790
|
-
mcpOAuthPassThrough: "v26.6.16.14"
|
|
796
|
+
mcpOAuthPassThrough: "v26.6.16.14",
|
|
797
|
+
blockedCountHistory: "v26.7.3.1",
|
|
798
|
+
percentilesOverTime: "v26.7.11.4",
|
|
799
|
+
processBehaviorOverTime: "v26.7.11.4"
|
|
791
800
|
};
|
|
792
801
|
var parseServerVersion = (raw) => {
|
|
793
802
|
const trimmed = raw.trim().replace(/^v/iu, "");
|
|
@@ -1231,6 +1240,84 @@ var createLighthouseClient = (configuration, dependencies = {}) => {
|
|
|
1231
1240
|
)
|
|
1232
1241
|
};
|
|
1233
1242
|
},
|
|
1243
|
+
getTeamBlockedCountHistory: async (teamId, range) => {
|
|
1244
|
+
const unsupported = await ensureServerSupports("blockedCountHistory");
|
|
1245
|
+
if (unsupported) {
|
|
1246
|
+
return unsupported;
|
|
1247
|
+
}
|
|
1248
|
+
const r = getResolvedMetricsDateRange(range);
|
|
1249
|
+
return requestJson(
|
|
1250
|
+
configuration,
|
|
1251
|
+
dependencies,
|
|
1252
|
+
`/v1/teams/${teamId}/metrics/blockedCountHistory?${getMetricsDateRangeQuery(r)}`,
|
|
1253
|
+
{ method: "GET" }
|
|
1254
|
+
);
|
|
1255
|
+
},
|
|
1256
|
+
getPortfolioBlockedCountHistory: async (portfolioId, range) => {
|
|
1257
|
+
const unsupported = await ensureServerSupports("blockedCountHistory");
|
|
1258
|
+
if (unsupported) {
|
|
1259
|
+
return unsupported;
|
|
1260
|
+
}
|
|
1261
|
+
const r = getResolvedMetricsDateRange(range);
|
|
1262
|
+
return requestJson(
|
|
1263
|
+
configuration,
|
|
1264
|
+
dependencies,
|
|
1265
|
+
`/v1/portfolios/${portfolioId}/metrics/blockedCountHistory?${getMetricsDateRangeQuery(r)}`,
|
|
1266
|
+
{ method: "GET" }
|
|
1267
|
+
);
|
|
1268
|
+
},
|
|
1269
|
+
getTeamPercentilesOverTime: async (teamId, range, metricType, horizon) => {
|
|
1270
|
+
const unsupported = await ensureServerSupports("percentilesOverTime");
|
|
1271
|
+
if (unsupported) {
|
|
1272
|
+
return unsupported;
|
|
1273
|
+
}
|
|
1274
|
+
const r = getResolvedMetricsDateRange(range);
|
|
1275
|
+
return requestJson(
|
|
1276
|
+
configuration,
|
|
1277
|
+
dependencies,
|
|
1278
|
+
`/v1/teams/${teamId}/metrics/percentiles-over-time?${getMetricsDateRangeQuery(r)}${getPercentilesOverTimeQuerySuffix(metricType, horizon)}`,
|
|
1279
|
+
{ method: "GET" }
|
|
1280
|
+
);
|
|
1281
|
+
},
|
|
1282
|
+
getPortfolioPercentilesOverTime: async (portfolioId, range, metricType, horizon) => {
|
|
1283
|
+
const unsupported = await ensureServerSupports("percentilesOverTime");
|
|
1284
|
+
if (unsupported) {
|
|
1285
|
+
return unsupported;
|
|
1286
|
+
}
|
|
1287
|
+
const r = getResolvedMetricsDateRange(range);
|
|
1288
|
+
return requestJson(
|
|
1289
|
+
configuration,
|
|
1290
|
+
dependencies,
|
|
1291
|
+
`/v1/portfolios/${portfolioId}/metrics/percentiles-over-time?${getMetricsDateRangeQuery(r)}${getPercentilesOverTimeQuerySuffix(metricType, horizon)}`,
|
|
1292
|
+
{ method: "GET" }
|
|
1293
|
+
);
|
|
1294
|
+
},
|
|
1295
|
+
getTeamProcessBehaviorOverTime: async (teamId, range, metricType) => {
|
|
1296
|
+
const unsupported = await ensureServerSupports("processBehaviorOverTime");
|
|
1297
|
+
if (unsupported) {
|
|
1298
|
+
return unsupported;
|
|
1299
|
+
}
|
|
1300
|
+
const r = getResolvedMetricsDateRange(range);
|
|
1301
|
+
return requestJson(
|
|
1302
|
+
configuration,
|
|
1303
|
+
dependencies,
|
|
1304
|
+
`/v1/teams/${teamId}/metrics/process-behavior-over-time?${getMetricsDateRangeQuery(r)}${getProcessBehaviorTypeQuerySuffix(metricType)}`,
|
|
1305
|
+
{ method: "GET" }
|
|
1306
|
+
);
|
|
1307
|
+
},
|
|
1308
|
+
getPortfolioProcessBehaviorOverTime: async (portfolioId, range, metricType) => {
|
|
1309
|
+
const unsupported = await ensureServerSupports("processBehaviorOverTime");
|
|
1310
|
+
if (unsupported) {
|
|
1311
|
+
return unsupported;
|
|
1312
|
+
}
|
|
1313
|
+
const r = getResolvedMetricsDateRange(range);
|
|
1314
|
+
return requestJson(
|
|
1315
|
+
configuration,
|
|
1316
|
+
dependencies,
|
|
1317
|
+
`/v1/portfolios/${portfolioId}/metrics/process-behavior-over-time?${getMetricsDateRangeQuery(r)}${getProcessBehaviorTypeQuerySuffix(metricType)}`,
|
|
1318
|
+
{ method: "GET" }
|
|
1319
|
+
);
|
|
1320
|
+
},
|
|
1234
1321
|
getTeamCumulativeStateTime: async (teamId, range, itemIds) => {
|
|
1235
1322
|
const unsupported = await ensureServerSupports("cumulativeStateTime");
|
|
1236
1323
|
if (unsupported) {
|
package/dist/index.d.cts
CHANGED
|
@@ -219,6 +219,77 @@ type TotalWorkItemAgeOverTimeResult = {
|
|
|
219
219
|
readonly endDate: string;
|
|
220
220
|
readonly daily: readonly DailyTotalWorkItemAge[];
|
|
221
221
|
};
|
|
222
|
+
/**
|
|
223
|
+
* One captured point on the blocked-items-over-time trend: how many items were
|
|
224
|
+
* blocked on {@link recordedAt}. Returned by the team/portfolio
|
|
225
|
+
* `blockedCountHistory` metric. `recordedAt` is an ISO date string.
|
|
226
|
+
*
|
|
227
|
+
* The complementary "what is blocked right now, and for how long" view rides on
|
|
228
|
+
* the existing WIP snapshot (`getTeamWip` / `getPortfolioWip`): from Lighthouse
|
|
229
|
+
* newer than v26.7.3.1 each WIP work item carries `isBlocked` and, when blocked,
|
|
230
|
+
* a `blockedSince` timestamp.
|
|
231
|
+
*/
|
|
232
|
+
type BlockedCountSnapshot = {
|
|
233
|
+
readonly recordedAt: string;
|
|
234
|
+
readonly blockedCount: number;
|
|
235
|
+
};
|
|
236
|
+
/**
|
|
237
|
+
* Percentile family recorded by the percentiles-over-time pipeline. Sent as the
|
|
238
|
+
* `metricType` query parameter, and echoed back on every returned row.
|
|
239
|
+
*/
|
|
240
|
+
type PercentilesOverTimeMetricType = "CycleTime" | "WorkItemAge";
|
|
241
|
+
/**
|
|
242
|
+
* One captured day on the percentiles-over-time trend: the percentile quartet
|
|
243
|
+
* recorded for {@link recordedAt} (an ISO date string, one row per calendar day,
|
|
244
|
+
* ascending).
|
|
245
|
+
*
|
|
246
|
+
* Recording is FORWARD-ONLY — Lighthouse starts capturing the day the feature is
|
|
247
|
+
* first deployed and never backfills history it did not observe, so a freshly
|
|
248
|
+
* upgraded server legitimately returns an empty array until the first refresh.
|
|
249
|
+
*
|
|
250
|
+
* `CycleTime` is recorded per horizon (30/60/90 days); `WorkItemAge` is always
|
|
251
|
+
* "as of today" and therefore has no horizon dimension, so a horizon sent
|
|
252
|
+
* alongside it is ignored in favour of the horizon-less series.
|
|
253
|
+
*
|
|
254
|
+
* SHARP EDGE: a `CycleTime` request that omits `horizon` is not filtered to one
|
|
255
|
+
* horizon — it returns every recorded horizon interleaved, and because this row
|
|
256
|
+
* shape carries no horizon field they cannot be told apart. Pass an explicit
|
|
257
|
+
* horizon whenever you ask for `CycleTime`.
|
|
258
|
+
*/
|
|
259
|
+
type PercentilesOverTimeSnapshot = {
|
|
260
|
+
readonly recordedAt: string;
|
|
261
|
+
readonly metricType: PercentilesOverTimeMetricType;
|
|
262
|
+
readonly p50: number;
|
|
263
|
+
readonly p70: number;
|
|
264
|
+
readonly p85: number;
|
|
265
|
+
readonly p95: number;
|
|
266
|
+
};
|
|
267
|
+
/**
|
|
268
|
+
* Process-behaviour family recorded by the natural-process-limits over-time
|
|
269
|
+
* pipeline. Sent as the `type` query parameter.
|
|
270
|
+
*
|
|
271
|
+
* `FeatureSize` is PORTFOLIO-ONLY: it has no team-level equivalent, so a team
|
|
272
|
+
* never records it. The server answers a team asking for it with an empty
|
|
273
|
+
* series rather than an error.
|
|
274
|
+
*/
|
|
275
|
+
type ProcessBehaviorMetricType = "Throughput" | "WorkItemAge" | "Wip" | "CycleTime" | "Arrivals" | "FeatureSize";
|
|
276
|
+
/**
|
|
277
|
+
* One captured day on the process-behaviour-over-time trend: the natural process
|
|
278
|
+
* limit triple recorded for {@link recordedAt} (an ISO date string, one row per
|
|
279
|
+
* calendar day, ascending). The family is carried by the request's `type`
|
|
280
|
+
* parameter, not repeated per row.
|
|
281
|
+
*
|
|
282
|
+
* Recording is FORWARD-ONLY, and a day is only recorded when the underlying
|
|
283
|
+
* chart had a usable baseline — days where it did not are absent from the
|
|
284
|
+
* series rather than present as a zeroed triple, so an empty array means
|
|
285
|
+
* "nothing recorded yet", never "a process pinned at zero".
|
|
286
|
+
*/
|
|
287
|
+
type ProcessBehaviorSnapshot = {
|
|
288
|
+
readonly recordedAt: string;
|
|
289
|
+
readonly unpl: number;
|
|
290
|
+
readonly average: number;
|
|
291
|
+
readonly lnpl: number;
|
|
292
|
+
};
|
|
222
293
|
type CumulativeStateTimeStateRow = {
|
|
223
294
|
readonly state: string;
|
|
224
295
|
readonly workflowOrder: number;
|
|
@@ -318,6 +389,12 @@ type LighthouseClient = {
|
|
|
318
389
|
readonly getPortfolioTotalWorkItemAgeInfo: (portfolioId: number, range?: MetricsDateRange) => Promise<LighthouseApiResult<unknown>>;
|
|
319
390
|
readonly getPortfolioWorkItemAgeOverTime: (portfolioId: number, range?: MetricsDateRange) => Promise<LighthouseApiResult<WorkItemAgeOverTimeResult>>;
|
|
320
391
|
readonly getPortfolioTotalWorkItemAgeOverTime: (portfolioId: number, range?: MetricsDateRange) => Promise<LighthouseApiResult<TotalWorkItemAgeOverTimeResult>>;
|
|
392
|
+
readonly getTeamBlockedCountHistory: (teamId: number, range?: MetricsDateRange) => Promise<LighthouseApiResult<readonly BlockedCountSnapshot[]>>;
|
|
393
|
+
readonly getPortfolioBlockedCountHistory: (portfolioId: number, range?: MetricsDateRange) => Promise<LighthouseApiResult<readonly BlockedCountSnapshot[]>>;
|
|
394
|
+
readonly getTeamPercentilesOverTime: (teamId: number, range?: MetricsDateRange, metricType?: PercentilesOverTimeMetricType, horizon?: number) => Promise<LighthouseApiResult<readonly PercentilesOverTimeSnapshot[]>>;
|
|
395
|
+
readonly getPortfolioPercentilesOverTime: (portfolioId: number, range?: MetricsDateRange, metricType?: PercentilesOverTimeMetricType, horizon?: number) => Promise<LighthouseApiResult<readonly PercentilesOverTimeSnapshot[]>>;
|
|
396
|
+
readonly getTeamProcessBehaviorOverTime: (teamId: number, range?: MetricsDateRange, metricType?: ProcessBehaviorMetricType) => Promise<LighthouseApiResult<readonly ProcessBehaviorSnapshot[]>>;
|
|
397
|
+
readonly getPortfolioProcessBehaviorOverTime: (portfolioId: number, range?: MetricsDateRange, metricType?: ProcessBehaviorMetricType) => Promise<LighthouseApiResult<readonly ProcessBehaviorSnapshot[]>>;
|
|
321
398
|
readonly getTeamCumulativeStateTime: (teamId: number, range?: MetricsDateRange, itemIds?: readonly number[]) => Promise<LighthouseApiResult<CumulativeStateTimeResult>>;
|
|
322
399
|
readonly getTeamCumulativeStateTimeItems: (teamId: number, state: string, range?: MetricsDateRange, itemIds?: readonly number[]) => Promise<LighthouseApiResult<CumulativeStateTimeItemsResult>>;
|
|
323
400
|
readonly getTeamCumulativeStateTimeCandidates: (teamId: number, range?: MetricsDateRange) => Promise<LighthouseApiResult<CumulativeStateTimeCandidatesResult>>;
|
|
@@ -354,6 +431,9 @@ declare const FEATURE_REQUIRES_SERVER_NEWER_THAN: {
|
|
|
354
431
|
readonly recurringBlackoutRules: "v26.5.29.5";
|
|
355
432
|
readonly workItemAgePercentiles: "v26.6.7.1";
|
|
356
433
|
readonly mcpOAuthPassThrough: "v26.6.16.14";
|
|
434
|
+
readonly blockedCountHistory: "v26.7.3.1";
|
|
435
|
+
readonly percentilesOverTime: "v26.7.11.4";
|
|
436
|
+
readonly processBehaviorOverTime: "v26.7.11.4";
|
|
357
437
|
};
|
|
358
438
|
/**
|
|
359
439
|
* Returns true when `candidate` is strictly newer than `baseline`, false when
|
|
@@ -363,4 +443,4 @@ declare const FEATURE_REQUIRES_SERVER_NEWER_THAN: {
|
|
|
363
443
|
declare const isServerVersionNewerThan: (candidate: string, baseline: string) => boolean | null;
|
|
364
444
|
declare const createLighthouseClient: (configuration: LighthouseClientConfiguration, dependencies?: LighthouseClientDependencies) => LighthouseClient;
|
|
365
445
|
|
|
366
|
-
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 CumulativeStateTimeCandidateRow, type CumulativeStateTimeCandidatesResult, type CumulativeStateTimeItemRow, type CumulativeStateTimeItemsResult, type CumulativeStateTimeResult, type CumulativeStateTimeStateRow, type DailyTotalWorkItemAge, type DailyWorkItemAge, type DayOfWeek, FEATURE_REQUIRES_SERVER_NEWER_THAN, 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 RecurringBlackoutRule, type RecurringBlackoutRuleInput, type ResolvedLighthouseEndpoint, type ServerAuthModeResult, type StandaloneDiscoveryContract, type StandaloneDiscoveryContractParseResult, type StoredLighthouseAuth, type ThroughputFilterView, type TotalWorkItemAgeOverTimeResult, type WorkItemAgeEntry, type WorkItemAgeOverTimeResult, createLighthouseAuthContext, createLighthouseClient, getClientPackageContract, getDefaultMetricsDateRange, getStandaloneDiscoveryLockfilePath, isServerVersionNewerThan, loadStandaloneDiscoveryContract, parseStandaloneDiscoveryContract, pollCliAuthSession, queryServerAuthMode, startCliAuthSession, validateLighthouseConnectivity };
|
|
446
|
+
export { type BacktestInput, type BlockedCountSnapshot, 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 CumulativeStateTimeCandidateRow, type CumulativeStateTimeCandidatesResult, type CumulativeStateTimeItemRow, type CumulativeStateTimeItemsResult, type CumulativeStateTimeResult, type CumulativeStateTimeStateRow, type DailyTotalWorkItemAge, type DailyWorkItemAge, type DayOfWeek, FEATURE_REQUIRES_SERVER_NEWER_THAN, 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 PercentilesOverTimeMetricType, type PercentilesOverTimeSnapshot, type ProcessBehaviorMetricType, type ProcessBehaviorSnapshot, type RecurringBlackoutRule, type RecurringBlackoutRuleInput, type ResolvedLighthouseEndpoint, type ServerAuthModeResult, type StandaloneDiscoveryContract, type StandaloneDiscoveryContractParseResult, type StoredLighthouseAuth, type ThroughputFilterView, type TotalWorkItemAgeOverTimeResult, type WorkItemAgeEntry, type WorkItemAgeOverTimeResult, createLighthouseAuthContext, createLighthouseClient, getClientPackageContract, getDefaultMetricsDateRange, getStandaloneDiscoveryLockfilePath, isServerVersionNewerThan, loadStandaloneDiscoveryContract, parseStandaloneDiscoveryContract, pollCliAuthSession, queryServerAuthMode, startCliAuthSession, validateLighthouseConnectivity };
|
package/dist/index.d.ts
CHANGED
|
@@ -219,6 +219,77 @@ type TotalWorkItemAgeOverTimeResult = {
|
|
|
219
219
|
readonly endDate: string;
|
|
220
220
|
readonly daily: readonly DailyTotalWorkItemAge[];
|
|
221
221
|
};
|
|
222
|
+
/**
|
|
223
|
+
* One captured point on the blocked-items-over-time trend: how many items were
|
|
224
|
+
* blocked on {@link recordedAt}. Returned by the team/portfolio
|
|
225
|
+
* `blockedCountHistory` metric. `recordedAt` is an ISO date string.
|
|
226
|
+
*
|
|
227
|
+
* The complementary "what is blocked right now, and for how long" view rides on
|
|
228
|
+
* the existing WIP snapshot (`getTeamWip` / `getPortfolioWip`): from Lighthouse
|
|
229
|
+
* newer than v26.7.3.1 each WIP work item carries `isBlocked` and, when blocked,
|
|
230
|
+
* a `blockedSince` timestamp.
|
|
231
|
+
*/
|
|
232
|
+
type BlockedCountSnapshot = {
|
|
233
|
+
readonly recordedAt: string;
|
|
234
|
+
readonly blockedCount: number;
|
|
235
|
+
};
|
|
236
|
+
/**
|
|
237
|
+
* Percentile family recorded by the percentiles-over-time pipeline. Sent as the
|
|
238
|
+
* `metricType` query parameter, and echoed back on every returned row.
|
|
239
|
+
*/
|
|
240
|
+
type PercentilesOverTimeMetricType = "CycleTime" | "WorkItemAge";
|
|
241
|
+
/**
|
|
242
|
+
* One captured day on the percentiles-over-time trend: the percentile quartet
|
|
243
|
+
* recorded for {@link recordedAt} (an ISO date string, one row per calendar day,
|
|
244
|
+
* ascending).
|
|
245
|
+
*
|
|
246
|
+
* Recording is FORWARD-ONLY — Lighthouse starts capturing the day the feature is
|
|
247
|
+
* first deployed and never backfills history it did not observe, so a freshly
|
|
248
|
+
* upgraded server legitimately returns an empty array until the first refresh.
|
|
249
|
+
*
|
|
250
|
+
* `CycleTime` is recorded per horizon (30/60/90 days); `WorkItemAge` is always
|
|
251
|
+
* "as of today" and therefore has no horizon dimension, so a horizon sent
|
|
252
|
+
* alongside it is ignored in favour of the horizon-less series.
|
|
253
|
+
*
|
|
254
|
+
* SHARP EDGE: a `CycleTime` request that omits `horizon` is not filtered to one
|
|
255
|
+
* horizon — it returns every recorded horizon interleaved, and because this row
|
|
256
|
+
* shape carries no horizon field they cannot be told apart. Pass an explicit
|
|
257
|
+
* horizon whenever you ask for `CycleTime`.
|
|
258
|
+
*/
|
|
259
|
+
type PercentilesOverTimeSnapshot = {
|
|
260
|
+
readonly recordedAt: string;
|
|
261
|
+
readonly metricType: PercentilesOverTimeMetricType;
|
|
262
|
+
readonly p50: number;
|
|
263
|
+
readonly p70: number;
|
|
264
|
+
readonly p85: number;
|
|
265
|
+
readonly p95: number;
|
|
266
|
+
};
|
|
267
|
+
/**
|
|
268
|
+
* Process-behaviour family recorded by the natural-process-limits over-time
|
|
269
|
+
* pipeline. Sent as the `type` query parameter.
|
|
270
|
+
*
|
|
271
|
+
* `FeatureSize` is PORTFOLIO-ONLY: it has no team-level equivalent, so a team
|
|
272
|
+
* never records it. The server answers a team asking for it with an empty
|
|
273
|
+
* series rather than an error.
|
|
274
|
+
*/
|
|
275
|
+
type ProcessBehaviorMetricType = "Throughput" | "WorkItemAge" | "Wip" | "CycleTime" | "Arrivals" | "FeatureSize";
|
|
276
|
+
/**
|
|
277
|
+
* One captured day on the process-behaviour-over-time trend: the natural process
|
|
278
|
+
* limit triple recorded for {@link recordedAt} (an ISO date string, one row per
|
|
279
|
+
* calendar day, ascending). The family is carried by the request's `type`
|
|
280
|
+
* parameter, not repeated per row.
|
|
281
|
+
*
|
|
282
|
+
* Recording is FORWARD-ONLY, and a day is only recorded when the underlying
|
|
283
|
+
* chart had a usable baseline — days where it did not are absent from the
|
|
284
|
+
* series rather than present as a zeroed triple, so an empty array means
|
|
285
|
+
* "nothing recorded yet", never "a process pinned at zero".
|
|
286
|
+
*/
|
|
287
|
+
type ProcessBehaviorSnapshot = {
|
|
288
|
+
readonly recordedAt: string;
|
|
289
|
+
readonly unpl: number;
|
|
290
|
+
readonly average: number;
|
|
291
|
+
readonly lnpl: number;
|
|
292
|
+
};
|
|
222
293
|
type CumulativeStateTimeStateRow = {
|
|
223
294
|
readonly state: string;
|
|
224
295
|
readonly workflowOrder: number;
|
|
@@ -318,6 +389,12 @@ type LighthouseClient = {
|
|
|
318
389
|
readonly getPortfolioTotalWorkItemAgeInfo: (portfolioId: number, range?: MetricsDateRange) => Promise<LighthouseApiResult<unknown>>;
|
|
319
390
|
readonly getPortfolioWorkItemAgeOverTime: (portfolioId: number, range?: MetricsDateRange) => Promise<LighthouseApiResult<WorkItemAgeOverTimeResult>>;
|
|
320
391
|
readonly getPortfolioTotalWorkItemAgeOverTime: (portfolioId: number, range?: MetricsDateRange) => Promise<LighthouseApiResult<TotalWorkItemAgeOverTimeResult>>;
|
|
392
|
+
readonly getTeamBlockedCountHistory: (teamId: number, range?: MetricsDateRange) => Promise<LighthouseApiResult<readonly BlockedCountSnapshot[]>>;
|
|
393
|
+
readonly getPortfolioBlockedCountHistory: (portfolioId: number, range?: MetricsDateRange) => Promise<LighthouseApiResult<readonly BlockedCountSnapshot[]>>;
|
|
394
|
+
readonly getTeamPercentilesOverTime: (teamId: number, range?: MetricsDateRange, metricType?: PercentilesOverTimeMetricType, horizon?: number) => Promise<LighthouseApiResult<readonly PercentilesOverTimeSnapshot[]>>;
|
|
395
|
+
readonly getPortfolioPercentilesOverTime: (portfolioId: number, range?: MetricsDateRange, metricType?: PercentilesOverTimeMetricType, horizon?: number) => Promise<LighthouseApiResult<readonly PercentilesOverTimeSnapshot[]>>;
|
|
396
|
+
readonly getTeamProcessBehaviorOverTime: (teamId: number, range?: MetricsDateRange, metricType?: ProcessBehaviorMetricType) => Promise<LighthouseApiResult<readonly ProcessBehaviorSnapshot[]>>;
|
|
397
|
+
readonly getPortfolioProcessBehaviorOverTime: (portfolioId: number, range?: MetricsDateRange, metricType?: ProcessBehaviorMetricType) => Promise<LighthouseApiResult<readonly ProcessBehaviorSnapshot[]>>;
|
|
321
398
|
readonly getTeamCumulativeStateTime: (teamId: number, range?: MetricsDateRange, itemIds?: readonly number[]) => Promise<LighthouseApiResult<CumulativeStateTimeResult>>;
|
|
322
399
|
readonly getTeamCumulativeStateTimeItems: (teamId: number, state: string, range?: MetricsDateRange, itemIds?: readonly number[]) => Promise<LighthouseApiResult<CumulativeStateTimeItemsResult>>;
|
|
323
400
|
readonly getTeamCumulativeStateTimeCandidates: (teamId: number, range?: MetricsDateRange) => Promise<LighthouseApiResult<CumulativeStateTimeCandidatesResult>>;
|
|
@@ -354,6 +431,9 @@ declare const FEATURE_REQUIRES_SERVER_NEWER_THAN: {
|
|
|
354
431
|
readonly recurringBlackoutRules: "v26.5.29.5";
|
|
355
432
|
readonly workItemAgePercentiles: "v26.6.7.1";
|
|
356
433
|
readonly mcpOAuthPassThrough: "v26.6.16.14";
|
|
434
|
+
readonly blockedCountHistory: "v26.7.3.1";
|
|
435
|
+
readonly percentilesOverTime: "v26.7.11.4";
|
|
436
|
+
readonly processBehaviorOverTime: "v26.7.11.4";
|
|
357
437
|
};
|
|
358
438
|
/**
|
|
359
439
|
* Returns true when `candidate` is strictly newer than `baseline`, false when
|
|
@@ -363,4 +443,4 @@ declare const FEATURE_REQUIRES_SERVER_NEWER_THAN: {
|
|
|
363
443
|
declare const isServerVersionNewerThan: (candidate: string, baseline: string) => boolean | null;
|
|
364
444
|
declare const createLighthouseClient: (configuration: LighthouseClientConfiguration, dependencies?: LighthouseClientDependencies) => LighthouseClient;
|
|
365
445
|
|
|
366
|
-
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 CumulativeStateTimeCandidateRow, type CumulativeStateTimeCandidatesResult, type CumulativeStateTimeItemRow, type CumulativeStateTimeItemsResult, type CumulativeStateTimeResult, type CumulativeStateTimeStateRow, type DailyTotalWorkItemAge, type DailyWorkItemAge, type DayOfWeek, FEATURE_REQUIRES_SERVER_NEWER_THAN, 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 RecurringBlackoutRule, type RecurringBlackoutRuleInput, type ResolvedLighthouseEndpoint, type ServerAuthModeResult, type StandaloneDiscoveryContract, type StandaloneDiscoveryContractParseResult, type StoredLighthouseAuth, type ThroughputFilterView, type TotalWorkItemAgeOverTimeResult, type WorkItemAgeEntry, type WorkItemAgeOverTimeResult, createLighthouseAuthContext, createLighthouseClient, getClientPackageContract, getDefaultMetricsDateRange, getStandaloneDiscoveryLockfilePath, isServerVersionNewerThan, loadStandaloneDiscoveryContract, parseStandaloneDiscoveryContract, pollCliAuthSession, queryServerAuthMode, startCliAuthSession, validateLighthouseConnectivity };
|
|
446
|
+
export { type BacktestInput, type BlockedCountSnapshot, 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 CumulativeStateTimeCandidateRow, type CumulativeStateTimeCandidatesResult, type CumulativeStateTimeItemRow, type CumulativeStateTimeItemsResult, type CumulativeStateTimeResult, type CumulativeStateTimeStateRow, type DailyTotalWorkItemAge, type DailyWorkItemAge, type DayOfWeek, FEATURE_REQUIRES_SERVER_NEWER_THAN, 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 PercentilesOverTimeMetricType, type PercentilesOverTimeSnapshot, type ProcessBehaviorMetricType, type ProcessBehaviorSnapshot, type RecurringBlackoutRule, type RecurringBlackoutRuleInput, type ResolvedLighthouseEndpoint, type ServerAuthModeResult, type StandaloneDiscoveryContract, type StandaloneDiscoveryContractParseResult, type StoredLighthouseAuth, type ThroughputFilterView, type TotalWorkItemAgeOverTimeResult, type WorkItemAgeEntry, type WorkItemAgeOverTimeResult, createLighthouseAuthContext, createLighthouseClient, getClientPackageContract, getDefaultMetricsDateRange, getStandaloneDiscoveryLockfilePath, isServerVersionNewerThan, loadStandaloneDiscoveryContract, parseStandaloneDiscoveryContract, pollCliAuthSession, queryServerAuthMode, startCliAuthSession, validateLighthouseConnectivity };
|
package/dist/index.js
CHANGED
|
@@ -698,6 +698,12 @@ var getMetricsAsOfDateQuery = (asOfDate) => `asOfDate=${encodeURIComponent(asOfD
|
|
|
698
698
|
var getItemIdsQuerySuffix = (itemIds) => itemIds && itemIds.length > 0 ? itemIds.map((id) => `&itemIds=${encodeURIComponent(id)}`).join("") : "";
|
|
699
699
|
var getViewQuerySuffix = (view) => view === "filtered" ? "&view=filtered" : "";
|
|
700
700
|
var getDefinitionIdQuerySuffix = (definitionId) => definitionId !== void 0 ? `&definitionId=${encodeURIComponent(definitionId)}` : "";
|
|
701
|
+
var getPercentilesOverTimeQuerySuffix = (metricType, horizon) => {
|
|
702
|
+
const metricTypePart = metricType === void 0 ? "" : `&metricType=${encodeURIComponent(metricType)}`;
|
|
703
|
+
const horizonPart = horizon === void 0 ? "" : `&horizon=${encodeURIComponent(horizon)}`;
|
|
704
|
+
return `${metricTypePart}${horizonPart}`;
|
|
705
|
+
};
|
|
706
|
+
var getProcessBehaviorTypeQuerySuffix = (metricType) => metricType === void 0 ? "" : `&type=${encodeURIComponent(metricType)}`;
|
|
701
707
|
var addUtcDays = (dateStr, days) => {
|
|
702
708
|
const d = /* @__PURE__ */ new Date(`${dateStr}T00:00:00Z`);
|
|
703
709
|
d.setUTCDate(d.getUTCDate() + days);
|
|
@@ -751,7 +757,10 @@ var FEATURE_REQUIRES_SERVER_NEWER_THAN = {
|
|
|
751
757
|
cumulativeStateTime: "v26.5.24.10",
|
|
752
758
|
recurringBlackoutRules: "v26.5.29.5",
|
|
753
759
|
workItemAgePercentiles: "v26.6.7.1",
|
|
754
|
-
mcpOAuthPassThrough: "v26.6.16.14"
|
|
760
|
+
mcpOAuthPassThrough: "v26.6.16.14",
|
|
761
|
+
blockedCountHistory: "v26.7.3.1",
|
|
762
|
+
percentilesOverTime: "v26.7.11.4",
|
|
763
|
+
processBehaviorOverTime: "v26.7.11.4"
|
|
755
764
|
};
|
|
756
765
|
var parseServerVersion = (raw) => {
|
|
757
766
|
const trimmed = raw.trim().replace(/^v/iu, "");
|
|
@@ -1195,6 +1204,84 @@ var createLighthouseClient = (configuration, dependencies = {}) => {
|
|
|
1195
1204
|
)
|
|
1196
1205
|
};
|
|
1197
1206
|
},
|
|
1207
|
+
getTeamBlockedCountHistory: async (teamId, range) => {
|
|
1208
|
+
const unsupported = await ensureServerSupports("blockedCountHistory");
|
|
1209
|
+
if (unsupported) {
|
|
1210
|
+
return unsupported;
|
|
1211
|
+
}
|
|
1212
|
+
const r = getResolvedMetricsDateRange(range);
|
|
1213
|
+
return requestJson(
|
|
1214
|
+
configuration,
|
|
1215
|
+
dependencies,
|
|
1216
|
+
`/v1/teams/${teamId}/metrics/blockedCountHistory?${getMetricsDateRangeQuery(r)}`,
|
|
1217
|
+
{ method: "GET" }
|
|
1218
|
+
);
|
|
1219
|
+
},
|
|
1220
|
+
getPortfolioBlockedCountHistory: async (portfolioId, range) => {
|
|
1221
|
+
const unsupported = await ensureServerSupports("blockedCountHistory");
|
|
1222
|
+
if (unsupported) {
|
|
1223
|
+
return unsupported;
|
|
1224
|
+
}
|
|
1225
|
+
const r = getResolvedMetricsDateRange(range);
|
|
1226
|
+
return requestJson(
|
|
1227
|
+
configuration,
|
|
1228
|
+
dependencies,
|
|
1229
|
+
`/v1/portfolios/${portfolioId}/metrics/blockedCountHistory?${getMetricsDateRangeQuery(r)}`,
|
|
1230
|
+
{ method: "GET" }
|
|
1231
|
+
);
|
|
1232
|
+
},
|
|
1233
|
+
getTeamPercentilesOverTime: async (teamId, range, metricType, horizon) => {
|
|
1234
|
+
const unsupported = await ensureServerSupports("percentilesOverTime");
|
|
1235
|
+
if (unsupported) {
|
|
1236
|
+
return unsupported;
|
|
1237
|
+
}
|
|
1238
|
+
const r = getResolvedMetricsDateRange(range);
|
|
1239
|
+
return requestJson(
|
|
1240
|
+
configuration,
|
|
1241
|
+
dependencies,
|
|
1242
|
+
`/v1/teams/${teamId}/metrics/percentiles-over-time?${getMetricsDateRangeQuery(r)}${getPercentilesOverTimeQuerySuffix(metricType, horizon)}`,
|
|
1243
|
+
{ method: "GET" }
|
|
1244
|
+
);
|
|
1245
|
+
},
|
|
1246
|
+
getPortfolioPercentilesOverTime: async (portfolioId, range, metricType, horizon) => {
|
|
1247
|
+
const unsupported = await ensureServerSupports("percentilesOverTime");
|
|
1248
|
+
if (unsupported) {
|
|
1249
|
+
return unsupported;
|
|
1250
|
+
}
|
|
1251
|
+
const r = getResolvedMetricsDateRange(range);
|
|
1252
|
+
return requestJson(
|
|
1253
|
+
configuration,
|
|
1254
|
+
dependencies,
|
|
1255
|
+
`/v1/portfolios/${portfolioId}/metrics/percentiles-over-time?${getMetricsDateRangeQuery(r)}${getPercentilesOverTimeQuerySuffix(metricType, horizon)}`,
|
|
1256
|
+
{ method: "GET" }
|
|
1257
|
+
);
|
|
1258
|
+
},
|
|
1259
|
+
getTeamProcessBehaviorOverTime: async (teamId, range, metricType) => {
|
|
1260
|
+
const unsupported = await ensureServerSupports("processBehaviorOverTime");
|
|
1261
|
+
if (unsupported) {
|
|
1262
|
+
return unsupported;
|
|
1263
|
+
}
|
|
1264
|
+
const r = getResolvedMetricsDateRange(range);
|
|
1265
|
+
return requestJson(
|
|
1266
|
+
configuration,
|
|
1267
|
+
dependencies,
|
|
1268
|
+
`/v1/teams/${teamId}/metrics/process-behavior-over-time?${getMetricsDateRangeQuery(r)}${getProcessBehaviorTypeQuerySuffix(metricType)}`,
|
|
1269
|
+
{ method: "GET" }
|
|
1270
|
+
);
|
|
1271
|
+
},
|
|
1272
|
+
getPortfolioProcessBehaviorOverTime: async (portfolioId, range, metricType) => {
|
|
1273
|
+
const unsupported = await ensureServerSupports("processBehaviorOverTime");
|
|
1274
|
+
if (unsupported) {
|
|
1275
|
+
return unsupported;
|
|
1276
|
+
}
|
|
1277
|
+
const r = getResolvedMetricsDateRange(range);
|
|
1278
|
+
return requestJson(
|
|
1279
|
+
configuration,
|
|
1280
|
+
dependencies,
|
|
1281
|
+
`/v1/portfolios/${portfolioId}/metrics/process-behavior-over-time?${getMetricsDateRangeQuery(r)}${getProcessBehaviorTypeQuerySuffix(metricType)}`,
|
|
1282
|
+
{ method: "GET" }
|
|
1283
|
+
);
|
|
1284
|
+
},
|
|
1198
1285
|
getTeamCumulativeStateTime: async (teamId, range, itemIds) => {
|
|
1199
1286
|
const unsupported = await ensureServerSupports("cumulativeStateTime");
|
|
1200
1287
|
if (unsupported) {
|
package/package.json
CHANGED