@letpeoplework/lighthouse-client 1.3.0 → 1.5.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
@@ -20,6 +20,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  // src/index.ts
21
21
  var index_exports = {};
22
22
  __export(index_exports, {
23
+ FEATURE_REQUIRES_SERVER_NEWER_THAN: () => FEATURE_REQUIRES_SERVER_NEWER_THAN,
23
24
  createLighthouseAuthContext: () => createLighthouseAuthContext,
24
25
  createLighthouseClient: () => createLighthouseClient,
25
26
  getClientPackageContract: () => getClientPackageContract,
@@ -732,6 +733,7 @@ var getMetricsDateRangeQuery = (range) => `startDate=${encodeURIComponent(range.
732
733
  var getMetricsAsOfDateQuery = (asOfDate) => `asOfDate=${encodeURIComponent(asOfDate)}`;
733
734
  var getItemIdsQuerySuffix = (itemIds) => itemIds && itemIds.length > 0 ? itemIds.map((id) => `&itemIds=${encodeURIComponent(id)}`).join("") : "";
734
735
  var getViewQuerySuffix = (view) => view === "filtered" ? "&view=filtered" : "";
736
+ var getDefinitionIdQuerySuffix = (definitionId) => definitionId !== void 0 ? `&definitionId=${encodeURIComponent(definitionId)}` : "";
735
737
  var addUtcDays = (dateStr, days) => {
736
738
  const d = /* @__PURE__ */ new Date(`${dateStr}T00:00:00Z`);
737
739
  d.setUTCDate(d.getUTCDate() + days);
@@ -783,7 +785,9 @@ var deriveTotalWorkItemAgeOverTime = (startDate, endDate, wipData) => {
783
785
  };
784
786
  var FEATURE_REQUIRES_SERVER_NEWER_THAN = {
785
787
  cumulativeStateTime: "v26.5.24.10",
786
- recurringBlackoutRules: "v26.5.29.5"
788
+ recurringBlackoutRules: "v26.5.29.5",
789
+ workItemAgePercentiles: "v26.6.7.1",
790
+ mcpOAuthPassThrough: "v26.6.16.14"
787
791
  };
788
792
  var parseServerVersion = (raw) => {
789
793
  const trimmed = raw.trim().replace(/^v/iu, "");
@@ -1004,12 +1008,25 @@ var createLighthouseClient = (configuration, dependencies = {}) => {
1004
1008
  `/v1/teams/${teamId}/metrics/wip?${getMetricsAsOfDateQuery(asOfDate)}`,
1005
1009
  { method: "GET" }
1006
1010
  ),
1007
- getTeamCycleTimePercentiles: async (teamId, range) => {
1011
+ getTeamCycleTimePercentiles: async (teamId, range, definitionId) => {
1008
1012
  const r = getResolvedMetricsDateRange(range);
1009
1013
  return requestJson(
1010
1014
  configuration,
1011
1015
  dependencies,
1012
- `/v1/teams/${teamId}/metrics/cycleTimePercentiles?${getMetricsDateRangeQuery(r)}`,
1016
+ `/v1/teams/${teamId}/metrics/cycleTimePercentiles?${getMetricsDateRangeQuery(r)}${getDefinitionIdQuerySuffix(definitionId)}`,
1017
+ { method: "GET" }
1018
+ );
1019
+ },
1020
+ getTeamWorkItemAgePercentiles: async (teamId, range) => {
1021
+ const unsupported = await ensureServerSupports("workItemAgePercentiles");
1022
+ if (unsupported) {
1023
+ return unsupported;
1024
+ }
1025
+ const r = getResolvedMetricsDateRange(range);
1026
+ return requestJson(
1027
+ configuration,
1028
+ dependencies,
1029
+ `/v1/teams/${teamId}/metrics/workItemAgePercentiles?${getMetricsDateRangeQuery(r)}`,
1013
1030
  { method: "GET" }
1014
1031
  );
1015
1032
  },
@@ -1095,12 +1112,25 @@ var createLighthouseClient = (configuration, dependencies = {}) => {
1095
1112
  { method: "GET" }
1096
1113
  );
1097
1114
  },
1098
- getPortfolioCycleTimePercentiles: async (portfolioId, range) => {
1115
+ getPortfolioCycleTimePercentiles: async (portfolioId, range, definitionId) => {
1116
+ const r = getResolvedMetricsDateRange(range);
1117
+ return requestJson(
1118
+ configuration,
1119
+ dependencies,
1120
+ `/v1/portfolios/${portfolioId}/metrics/cycleTimePercentiles?${getMetricsDateRangeQuery(r)}${getDefinitionIdQuerySuffix(definitionId)}`,
1121
+ { method: "GET" }
1122
+ );
1123
+ },
1124
+ getPortfolioWorkItemAgePercentiles: async (portfolioId, range) => {
1125
+ const unsupported = await ensureServerSupports("workItemAgePercentiles");
1126
+ if (unsupported) {
1127
+ return unsupported;
1128
+ }
1099
1129
  const r = getResolvedMetricsDateRange(range);
1100
1130
  return requestJson(
1101
1131
  configuration,
1102
1132
  dependencies,
1103
- `/v1/portfolios/${portfolioId}/metrics/cycleTimePercentiles?${getMetricsDateRangeQuery(r)}`,
1133
+ `/v1/portfolios/${portfolioId}/metrics/workItemAgePercentiles?${getMetricsDateRangeQuery(r)}`,
1104
1134
  { method: "GET" }
1105
1135
  );
1106
1136
  },
@@ -1391,6 +1421,7 @@ var createLighthouseClient = (configuration, dependencies = {}) => {
1391
1421
  };
1392
1422
  // Annotate the CommonJS export names for ESM import in node:
1393
1423
  0 && (module.exports = {
1424
+ FEATURE_REQUIRES_SERVER_NEWER_THAN,
1394
1425
  createLighthouseAuthContext,
1395
1426
  createLighthouseClient,
1396
1427
  getClientPackageContract,
package/dist/index.d.cts CHANGED
@@ -298,13 +298,15 @@ type LighthouseClient = {
298
298
  readonly getTeamArrivals: (teamId: number, range?: MetricsDateRange) => Promise<LighthouseApiResult<unknown>>;
299
299
  readonly getTeamWipOverTime: (teamId: number, range?: MetricsDateRange) => Promise<LighthouseApiResult<unknown>>;
300
300
  readonly getTeamWip: (teamId: number, asOfDate: string) => Promise<LighthouseApiResult<readonly unknown[]>>;
301
- readonly getTeamCycleTimePercentiles: (teamId: number, range?: MetricsDateRange) => Promise<LighthouseApiResult<readonly unknown[]>>;
301
+ readonly getTeamCycleTimePercentiles: (teamId: number, range?: MetricsDateRange, definitionId?: number) => Promise<LighthouseApiResult<readonly unknown[]>>;
302
+ readonly getTeamWorkItemAgePercentiles: (teamId: number, range?: MetricsDateRange) => Promise<LighthouseApiResult<readonly unknown[]>>;
302
303
  readonly getTeamCycleTimeData: (teamId: number, range?: MetricsDateRange) => Promise<LighthouseApiResult<readonly unknown[]>>;
303
304
  readonly getTeamPredictabilityScore: (teamId: number, range?: MetricsDateRange, view?: ThroughputFilterView) => Promise<LighthouseApiResult<unknown>>;
304
305
  readonly getTeamTotalWorkItemAge: (teamId: number, asOfDate: string) => Promise<LighthouseApiResult<number>>;
305
306
  readonly getTeamTotalWorkItemAgeInfo: (teamId: number, range?: MetricsDateRange) => Promise<LighthouseApiResult<unknown>>;
306
307
  readonly getPortfolioThroughput: (portfolioId: number, range?: MetricsDateRange) => Promise<LighthouseApiResult<unknown>>;
307
- readonly getPortfolioCycleTimePercentiles: (portfolioId: number, range?: MetricsDateRange) => Promise<LighthouseApiResult<readonly unknown[]>>;
308
+ readonly getPortfolioCycleTimePercentiles: (portfolioId: number, range?: MetricsDateRange, definitionId?: number) => Promise<LighthouseApiResult<readonly unknown[]>>;
309
+ readonly getPortfolioWorkItemAgePercentiles: (portfolioId: number, range?: MetricsDateRange) => Promise<LighthouseApiResult<readonly unknown[]>>;
308
310
  readonly getPortfolioArrivals: (portfolioId: number, range?: MetricsDateRange) => Promise<LighthouseApiResult<unknown>>;
309
311
  readonly getPortfolioWipOverTime: (portfolioId: number, range?: MetricsDateRange) => Promise<LighthouseApiResult<unknown>>;
310
312
  readonly getPortfolioWip: (portfolioId: number, asOfDate: string) => Promise<LighthouseApiResult<readonly unknown[]>>;
@@ -339,6 +341,20 @@ type LighthouseClient = {
339
341
  type LighthouseClientDependencies = {
340
342
  readonly fetch?: (url: string, init?: RequestInit) => Promise<ConnectivityFetchResponse>;
341
343
  };
344
+ /**
345
+ * Server-version gating for endpoints that did not exist in older Lighthouse
346
+ * releases. At development time the NEXT release number is unknown, so each
347
+ * feature records the LAST released version that did NOT have it; the server
348
+ * must report a version STRICTLY NEWER than that baseline for the feature to be
349
+ * callable. Update the baseline to the current latest release whenever a new
350
+ * server-dependent feature is wrapped.
351
+ */
352
+ declare const FEATURE_REQUIRES_SERVER_NEWER_THAN: {
353
+ readonly cumulativeStateTime: "v26.5.24.10";
354
+ readonly recurringBlackoutRules: "v26.5.29.5";
355
+ readonly workItemAgePercentiles: "v26.6.7.1";
356
+ readonly mcpOAuthPassThrough: "v26.6.16.14";
357
+ };
342
358
  /**
343
359
  * Returns true when `candidate` is strictly newer than `baseline`, false when
344
360
  * it is equal-or-older, and null when either string is unparseable (treat as
@@ -347,4 +363,4 @@ type LighthouseClientDependencies = {
347
363
  declare const isServerVersionNewerThan: (candidate: string, baseline: string) => boolean | null;
348
364
  declare const createLighthouseClient: (configuration: LighthouseClientConfiguration, dependencies?: LighthouseClientDependencies) => LighthouseClient;
349
365
 
350
- 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, 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 };
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 };
package/dist/index.d.ts CHANGED
@@ -298,13 +298,15 @@ type LighthouseClient = {
298
298
  readonly getTeamArrivals: (teamId: number, range?: MetricsDateRange) => Promise<LighthouseApiResult<unknown>>;
299
299
  readonly getTeamWipOverTime: (teamId: number, range?: MetricsDateRange) => Promise<LighthouseApiResult<unknown>>;
300
300
  readonly getTeamWip: (teamId: number, asOfDate: string) => Promise<LighthouseApiResult<readonly unknown[]>>;
301
- readonly getTeamCycleTimePercentiles: (teamId: number, range?: MetricsDateRange) => Promise<LighthouseApiResult<readonly unknown[]>>;
301
+ readonly getTeamCycleTimePercentiles: (teamId: number, range?: MetricsDateRange, definitionId?: number) => Promise<LighthouseApiResult<readonly unknown[]>>;
302
+ readonly getTeamWorkItemAgePercentiles: (teamId: number, range?: MetricsDateRange) => Promise<LighthouseApiResult<readonly unknown[]>>;
302
303
  readonly getTeamCycleTimeData: (teamId: number, range?: MetricsDateRange) => Promise<LighthouseApiResult<readonly unknown[]>>;
303
304
  readonly getTeamPredictabilityScore: (teamId: number, range?: MetricsDateRange, view?: ThroughputFilterView) => Promise<LighthouseApiResult<unknown>>;
304
305
  readonly getTeamTotalWorkItemAge: (teamId: number, asOfDate: string) => Promise<LighthouseApiResult<number>>;
305
306
  readonly getTeamTotalWorkItemAgeInfo: (teamId: number, range?: MetricsDateRange) => Promise<LighthouseApiResult<unknown>>;
306
307
  readonly getPortfolioThroughput: (portfolioId: number, range?: MetricsDateRange) => Promise<LighthouseApiResult<unknown>>;
307
- readonly getPortfolioCycleTimePercentiles: (portfolioId: number, range?: MetricsDateRange) => Promise<LighthouseApiResult<readonly unknown[]>>;
308
+ readonly getPortfolioCycleTimePercentiles: (portfolioId: number, range?: MetricsDateRange, definitionId?: number) => Promise<LighthouseApiResult<readonly unknown[]>>;
309
+ readonly getPortfolioWorkItemAgePercentiles: (portfolioId: number, range?: MetricsDateRange) => Promise<LighthouseApiResult<readonly unknown[]>>;
308
310
  readonly getPortfolioArrivals: (portfolioId: number, range?: MetricsDateRange) => Promise<LighthouseApiResult<unknown>>;
309
311
  readonly getPortfolioWipOverTime: (portfolioId: number, range?: MetricsDateRange) => Promise<LighthouseApiResult<unknown>>;
310
312
  readonly getPortfolioWip: (portfolioId: number, asOfDate: string) => Promise<LighthouseApiResult<readonly unknown[]>>;
@@ -339,6 +341,20 @@ type LighthouseClient = {
339
341
  type LighthouseClientDependencies = {
340
342
  readonly fetch?: (url: string, init?: RequestInit) => Promise<ConnectivityFetchResponse>;
341
343
  };
344
+ /**
345
+ * Server-version gating for endpoints that did not exist in older Lighthouse
346
+ * releases. At development time the NEXT release number is unknown, so each
347
+ * feature records the LAST released version that did NOT have it; the server
348
+ * must report a version STRICTLY NEWER than that baseline for the feature to be
349
+ * callable. Update the baseline to the current latest release whenever a new
350
+ * server-dependent feature is wrapped.
351
+ */
352
+ declare const FEATURE_REQUIRES_SERVER_NEWER_THAN: {
353
+ readonly cumulativeStateTime: "v26.5.24.10";
354
+ readonly recurringBlackoutRules: "v26.5.29.5";
355
+ readonly workItemAgePercentiles: "v26.6.7.1";
356
+ readonly mcpOAuthPassThrough: "v26.6.16.14";
357
+ };
342
358
  /**
343
359
  * Returns true when `candidate` is strictly newer than `baseline`, false when
344
360
  * it is equal-or-older, and null when either string is unparseable (treat as
@@ -347,4 +363,4 @@ type LighthouseClientDependencies = {
347
363
  declare const isServerVersionNewerThan: (candidate: string, baseline: string) => boolean | null;
348
364
  declare const createLighthouseClient: (configuration: LighthouseClientConfiguration, dependencies?: LighthouseClientDependencies) => LighthouseClient;
349
365
 
350
- 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, 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 };
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 };
package/dist/index.js CHANGED
@@ -697,6 +697,7 @@ var getMetricsDateRangeQuery = (range) => `startDate=${encodeURIComponent(range.
697
697
  var getMetricsAsOfDateQuery = (asOfDate) => `asOfDate=${encodeURIComponent(asOfDate)}`;
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
+ var getDefinitionIdQuerySuffix = (definitionId) => definitionId !== void 0 ? `&definitionId=${encodeURIComponent(definitionId)}` : "";
700
701
  var addUtcDays = (dateStr, days) => {
701
702
  const d = /* @__PURE__ */ new Date(`${dateStr}T00:00:00Z`);
702
703
  d.setUTCDate(d.getUTCDate() + days);
@@ -748,7 +749,9 @@ var deriveTotalWorkItemAgeOverTime = (startDate, endDate, wipData) => {
748
749
  };
749
750
  var FEATURE_REQUIRES_SERVER_NEWER_THAN = {
750
751
  cumulativeStateTime: "v26.5.24.10",
751
- recurringBlackoutRules: "v26.5.29.5"
752
+ recurringBlackoutRules: "v26.5.29.5",
753
+ workItemAgePercentiles: "v26.6.7.1",
754
+ mcpOAuthPassThrough: "v26.6.16.14"
752
755
  };
753
756
  var parseServerVersion = (raw) => {
754
757
  const trimmed = raw.trim().replace(/^v/iu, "");
@@ -969,12 +972,25 @@ var createLighthouseClient = (configuration, dependencies = {}) => {
969
972
  `/v1/teams/${teamId}/metrics/wip?${getMetricsAsOfDateQuery(asOfDate)}`,
970
973
  { method: "GET" }
971
974
  ),
972
- getTeamCycleTimePercentiles: async (teamId, range) => {
975
+ getTeamCycleTimePercentiles: async (teamId, range, definitionId) => {
973
976
  const r = getResolvedMetricsDateRange(range);
974
977
  return requestJson(
975
978
  configuration,
976
979
  dependencies,
977
- `/v1/teams/${teamId}/metrics/cycleTimePercentiles?${getMetricsDateRangeQuery(r)}`,
980
+ `/v1/teams/${teamId}/metrics/cycleTimePercentiles?${getMetricsDateRangeQuery(r)}${getDefinitionIdQuerySuffix(definitionId)}`,
981
+ { method: "GET" }
982
+ );
983
+ },
984
+ getTeamWorkItemAgePercentiles: async (teamId, range) => {
985
+ const unsupported = await ensureServerSupports("workItemAgePercentiles");
986
+ if (unsupported) {
987
+ return unsupported;
988
+ }
989
+ const r = getResolvedMetricsDateRange(range);
990
+ return requestJson(
991
+ configuration,
992
+ dependencies,
993
+ `/v1/teams/${teamId}/metrics/workItemAgePercentiles?${getMetricsDateRangeQuery(r)}`,
978
994
  { method: "GET" }
979
995
  );
980
996
  },
@@ -1060,12 +1076,25 @@ var createLighthouseClient = (configuration, dependencies = {}) => {
1060
1076
  { method: "GET" }
1061
1077
  );
1062
1078
  },
1063
- getPortfolioCycleTimePercentiles: async (portfolioId, range) => {
1079
+ getPortfolioCycleTimePercentiles: async (portfolioId, range, definitionId) => {
1080
+ const r = getResolvedMetricsDateRange(range);
1081
+ return requestJson(
1082
+ configuration,
1083
+ dependencies,
1084
+ `/v1/portfolios/${portfolioId}/metrics/cycleTimePercentiles?${getMetricsDateRangeQuery(r)}${getDefinitionIdQuerySuffix(definitionId)}`,
1085
+ { method: "GET" }
1086
+ );
1087
+ },
1088
+ getPortfolioWorkItemAgePercentiles: async (portfolioId, range) => {
1089
+ const unsupported = await ensureServerSupports("workItemAgePercentiles");
1090
+ if (unsupported) {
1091
+ return unsupported;
1092
+ }
1064
1093
  const r = getResolvedMetricsDateRange(range);
1065
1094
  return requestJson(
1066
1095
  configuration,
1067
1096
  dependencies,
1068
- `/v1/portfolios/${portfolioId}/metrics/cycleTimePercentiles?${getMetricsDateRangeQuery(r)}`,
1097
+ `/v1/portfolios/${portfolioId}/metrics/workItemAgePercentiles?${getMetricsDateRangeQuery(r)}`,
1069
1098
  { method: "GET" }
1070
1099
  );
1071
1100
  },
@@ -1355,6 +1384,7 @@ var createLighthouseClient = (configuration, dependencies = {}) => {
1355
1384
  };
1356
1385
  };
1357
1386
  export {
1387
+ FEATURE_REQUIRES_SERVER_NEWER_THAN,
1358
1388
  createLighthouseAuthContext,
1359
1389
  createLighthouseClient,
1360
1390
  getClientPackageContract,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@letpeoplework/lighthouse-client",
3
- "version": "1.3.0",
3
+ "version": "1.5.0",
4
4
  "description": "Shared Lighthouse API client contracts",
5
5
  "repository": "https://github.com/LetPeopleWork/lighthouse-clients",
6
6
  "type": "module",