@letpeoplework/lighthouse-client 1.1.0 → 1.3.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.d.cts CHANGED
@@ -4,7 +4,7 @@ type ClientPackageContract = {
4
4
  readonly capabilities: readonly ClientCapability[];
5
5
  };
6
6
  declare const getClientPackageContract: () => ClientPackageContract;
7
- type ConnectivityCategory = "success" | "unreachable" | "misconfigured" | "unauthorized" | "dependency-failure" | "unexpected";
7
+ type ConnectivityCategory = "success" | "unreachable" | "misconfigured" | "unauthorized" | "dependency-failure" | "concurrency-conflict" | "unexpected";
8
8
  type StandaloneDiscoveryContract = {
9
9
  readonly contractVersion: 1;
10
10
  readonly lighthouseUrl: string;
@@ -219,6 +219,61 @@ type TotalWorkItemAgeOverTimeResult = {
219
219
  readonly endDate: string;
220
220
  readonly daily: readonly DailyTotalWorkItemAge[];
221
221
  };
222
+ type CumulativeStateTimeStateRow = {
223
+ readonly state: string;
224
+ readonly workflowOrder: number;
225
+ readonly totalDays: number;
226
+ readonly completedContributionDays: number;
227
+ readonly ongoingContributionDays: number;
228
+ readonly itemCount: number;
229
+ readonly completedItemCount: number;
230
+ readonly ongoingItemCount: number;
231
+ readonly meanDays: number;
232
+ readonly medianDays: number | null;
233
+ };
234
+ type CumulativeStateTimeResult = {
235
+ readonly states: readonly CumulativeStateTimeStateRow[];
236
+ };
237
+ type CumulativeStateTimeItemRow = {
238
+ readonly workItemId: number;
239
+ readonly referenceId: string;
240
+ readonly title: string;
241
+ readonly type: string;
242
+ readonly state: string;
243
+ readonly stateCategory: string;
244
+ readonly url: string | null;
245
+ readonly daysContributed: number;
246
+ };
247
+ type CumulativeStateTimeItemsResult = {
248
+ readonly state: string;
249
+ readonly items: readonly CumulativeStateTimeItemRow[];
250
+ };
251
+ type CumulativeStateTimeCandidateRow = {
252
+ readonly workItemId: number;
253
+ readonly referenceId: string;
254
+ readonly title: string;
255
+ readonly workItemType: string;
256
+ };
257
+ type CumulativeStateTimeCandidatesResult = {
258
+ readonly items: readonly CumulativeStateTimeCandidateRow[];
259
+ };
260
+ type DayOfWeek = "Sunday" | "Monday" | "Tuesday" | "Wednesday" | "Thursday" | "Friday" | "Saturday";
261
+ type RecurringBlackoutRule = {
262
+ readonly id: number;
263
+ readonly weekdays: readonly DayOfWeek[];
264
+ readonly intervalWeeks: number;
265
+ readonly start: string;
266
+ readonly end: string | null;
267
+ readonly description: string;
268
+ readonly summary: string;
269
+ };
270
+ type RecurringBlackoutRuleInput = {
271
+ readonly weekdays: readonly DayOfWeek[];
272
+ readonly intervalWeeks: number;
273
+ readonly start: string;
274
+ readonly end: string | null;
275
+ readonly description: string;
276
+ };
222
277
  type LighthouseClient = {
223
278
  readonly checkConnectivity: () => Promise<ConnectivityValidationResult>;
224
279
  readonly getVersion: () => Promise<LighthouseApiResult<string>>;
@@ -261,6 +316,12 @@ type LighthouseClient = {
261
316
  readonly getPortfolioTotalWorkItemAgeInfo: (portfolioId: number, range?: MetricsDateRange) => Promise<LighthouseApiResult<unknown>>;
262
317
  readonly getPortfolioWorkItemAgeOverTime: (portfolioId: number, range?: MetricsDateRange) => Promise<LighthouseApiResult<WorkItemAgeOverTimeResult>>;
263
318
  readonly getPortfolioTotalWorkItemAgeOverTime: (portfolioId: number, range?: MetricsDateRange) => Promise<LighthouseApiResult<TotalWorkItemAgeOverTimeResult>>;
319
+ readonly getTeamCumulativeStateTime: (teamId: number, range?: MetricsDateRange, itemIds?: readonly number[]) => Promise<LighthouseApiResult<CumulativeStateTimeResult>>;
320
+ readonly getTeamCumulativeStateTimeItems: (teamId: number, state: string, range?: MetricsDateRange, itemIds?: readonly number[]) => Promise<LighthouseApiResult<CumulativeStateTimeItemsResult>>;
321
+ readonly getTeamCumulativeStateTimeCandidates: (teamId: number, range?: MetricsDateRange) => Promise<LighthouseApiResult<CumulativeStateTimeCandidatesResult>>;
322
+ readonly getPortfolioCumulativeStateTime: (portfolioId: number, range?: MetricsDateRange, itemIds?: readonly number[]) => Promise<LighthouseApiResult<CumulativeStateTimeResult>>;
323
+ readonly getPortfolioCumulativeStateTimeItems: (portfolioId: number, state: string, range?: MetricsDateRange, itemIds?: readonly number[]) => Promise<LighthouseApiResult<CumulativeStateTimeItemsResult>>;
324
+ readonly getPortfolioCumulativeStateTimeCandidates: (portfolioId: number, range?: MetricsDateRange) => Promise<LighthouseApiResult<CumulativeStateTimeCandidatesResult>>;
264
325
  readonly getFeaturesByIds: (ids: readonly number[]) => Promise<LighthouseApiResult<readonly unknown[]>>;
265
326
  readonly getFeaturesByReferences: (refs: readonly string[]) => Promise<LighthouseApiResult<readonly unknown[]>>;
266
327
  readonly getFeatureWorkItems: (featureId: number) => Promise<LighthouseApiResult<readonly unknown[]>>;
@@ -268,12 +329,22 @@ type LighthouseClient = {
268
329
  readonly createDelivery: (portfolioId: number, payload: LighthouseWritePayload) => Promise<LighthouseApiResult<unknown>>;
269
330
  readonly updateDelivery: (deliveryId: number, payload: LighthouseWritePayload) => Promise<LighthouseApiResult<unknown>>;
270
331
  readonly deleteDelivery: (deliveryId: number) => Promise<LighthouseApiResult<undefined>>;
332
+ readonly getRecurringBlackoutRules: () => Promise<LighthouseApiResult<readonly RecurringBlackoutRule[]>>;
333
+ readonly createRecurringBlackoutRule: (payload: LighthouseWritePayload) => Promise<LighthouseApiResult<RecurringBlackoutRule>>;
334
+ readonly updateRecurringBlackoutRule: (id: number, payload: LighthouseWritePayload) => Promise<LighthouseApiResult<RecurringBlackoutRule>>;
335
+ readonly deleteRecurringBlackoutRule: (id: number) => Promise<LighthouseApiResult<undefined>>;
271
336
  readonly runManualForecast: (teamId: number, payload: ManualForecastInput) => Promise<LighthouseApiResult<unknown>>;
272
337
  readonly runBacktest: (teamId: number, payload: BacktestInput) => Promise<LighthouseApiResult<unknown>>;
273
338
  };
274
339
  type LighthouseClientDependencies = {
275
340
  readonly fetch?: (url: string, init?: RequestInit) => Promise<ConnectivityFetchResponse>;
276
341
  };
342
+ /**
343
+ * Returns true when `candidate` is strictly newer than `baseline`, false when
344
+ * it is equal-or-older, and null when either string is unparseable (treat as
345
+ * "unknown — do not block").
346
+ */
347
+ declare const isServerVersionNewerThan: (candidate: string, baseline: string) => boolean | null;
277
348
  declare const createLighthouseClient: (configuration: LighthouseClientConfiguration, dependencies?: LighthouseClientDependencies) => LighthouseClient;
278
349
 
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 };
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 };
package/dist/index.d.ts CHANGED
@@ -4,7 +4,7 @@ type ClientPackageContract = {
4
4
  readonly capabilities: readonly ClientCapability[];
5
5
  };
6
6
  declare const getClientPackageContract: () => ClientPackageContract;
7
- type ConnectivityCategory = "success" | "unreachable" | "misconfigured" | "unauthorized" | "dependency-failure" | "unexpected";
7
+ type ConnectivityCategory = "success" | "unreachable" | "misconfigured" | "unauthorized" | "dependency-failure" | "concurrency-conflict" | "unexpected";
8
8
  type StandaloneDiscoveryContract = {
9
9
  readonly contractVersion: 1;
10
10
  readonly lighthouseUrl: string;
@@ -219,6 +219,61 @@ type TotalWorkItemAgeOverTimeResult = {
219
219
  readonly endDate: string;
220
220
  readonly daily: readonly DailyTotalWorkItemAge[];
221
221
  };
222
+ type CumulativeStateTimeStateRow = {
223
+ readonly state: string;
224
+ readonly workflowOrder: number;
225
+ readonly totalDays: number;
226
+ readonly completedContributionDays: number;
227
+ readonly ongoingContributionDays: number;
228
+ readonly itemCount: number;
229
+ readonly completedItemCount: number;
230
+ readonly ongoingItemCount: number;
231
+ readonly meanDays: number;
232
+ readonly medianDays: number | null;
233
+ };
234
+ type CumulativeStateTimeResult = {
235
+ readonly states: readonly CumulativeStateTimeStateRow[];
236
+ };
237
+ type CumulativeStateTimeItemRow = {
238
+ readonly workItemId: number;
239
+ readonly referenceId: string;
240
+ readonly title: string;
241
+ readonly type: string;
242
+ readonly state: string;
243
+ readonly stateCategory: string;
244
+ readonly url: string | null;
245
+ readonly daysContributed: number;
246
+ };
247
+ type CumulativeStateTimeItemsResult = {
248
+ readonly state: string;
249
+ readonly items: readonly CumulativeStateTimeItemRow[];
250
+ };
251
+ type CumulativeStateTimeCandidateRow = {
252
+ readonly workItemId: number;
253
+ readonly referenceId: string;
254
+ readonly title: string;
255
+ readonly workItemType: string;
256
+ };
257
+ type CumulativeStateTimeCandidatesResult = {
258
+ readonly items: readonly CumulativeStateTimeCandidateRow[];
259
+ };
260
+ type DayOfWeek = "Sunday" | "Monday" | "Tuesday" | "Wednesday" | "Thursday" | "Friday" | "Saturday";
261
+ type RecurringBlackoutRule = {
262
+ readonly id: number;
263
+ readonly weekdays: readonly DayOfWeek[];
264
+ readonly intervalWeeks: number;
265
+ readonly start: string;
266
+ readonly end: string | null;
267
+ readonly description: string;
268
+ readonly summary: string;
269
+ };
270
+ type RecurringBlackoutRuleInput = {
271
+ readonly weekdays: readonly DayOfWeek[];
272
+ readonly intervalWeeks: number;
273
+ readonly start: string;
274
+ readonly end: string | null;
275
+ readonly description: string;
276
+ };
222
277
  type LighthouseClient = {
223
278
  readonly checkConnectivity: () => Promise<ConnectivityValidationResult>;
224
279
  readonly getVersion: () => Promise<LighthouseApiResult<string>>;
@@ -261,6 +316,12 @@ type LighthouseClient = {
261
316
  readonly getPortfolioTotalWorkItemAgeInfo: (portfolioId: number, range?: MetricsDateRange) => Promise<LighthouseApiResult<unknown>>;
262
317
  readonly getPortfolioWorkItemAgeOverTime: (portfolioId: number, range?: MetricsDateRange) => Promise<LighthouseApiResult<WorkItemAgeOverTimeResult>>;
263
318
  readonly getPortfolioTotalWorkItemAgeOverTime: (portfolioId: number, range?: MetricsDateRange) => Promise<LighthouseApiResult<TotalWorkItemAgeOverTimeResult>>;
319
+ readonly getTeamCumulativeStateTime: (teamId: number, range?: MetricsDateRange, itemIds?: readonly number[]) => Promise<LighthouseApiResult<CumulativeStateTimeResult>>;
320
+ readonly getTeamCumulativeStateTimeItems: (teamId: number, state: string, range?: MetricsDateRange, itemIds?: readonly number[]) => Promise<LighthouseApiResult<CumulativeStateTimeItemsResult>>;
321
+ readonly getTeamCumulativeStateTimeCandidates: (teamId: number, range?: MetricsDateRange) => Promise<LighthouseApiResult<CumulativeStateTimeCandidatesResult>>;
322
+ readonly getPortfolioCumulativeStateTime: (portfolioId: number, range?: MetricsDateRange, itemIds?: readonly number[]) => Promise<LighthouseApiResult<CumulativeStateTimeResult>>;
323
+ readonly getPortfolioCumulativeStateTimeItems: (portfolioId: number, state: string, range?: MetricsDateRange, itemIds?: readonly number[]) => Promise<LighthouseApiResult<CumulativeStateTimeItemsResult>>;
324
+ readonly getPortfolioCumulativeStateTimeCandidates: (portfolioId: number, range?: MetricsDateRange) => Promise<LighthouseApiResult<CumulativeStateTimeCandidatesResult>>;
264
325
  readonly getFeaturesByIds: (ids: readonly number[]) => Promise<LighthouseApiResult<readonly unknown[]>>;
265
326
  readonly getFeaturesByReferences: (refs: readonly string[]) => Promise<LighthouseApiResult<readonly unknown[]>>;
266
327
  readonly getFeatureWorkItems: (featureId: number) => Promise<LighthouseApiResult<readonly unknown[]>>;
@@ -268,12 +329,22 @@ type LighthouseClient = {
268
329
  readonly createDelivery: (portfolioId: number, payload: LighthouseWritePayload) => Promise<LighthouseApiResult<unknown>>;
269
330
  readonly updateDelivery: (deliveryId: number, payload: LighthouseWritePayload) => Promise<LighthouseApiResult<unknown>>;
270
331
  readonly deleteDelivery: (deliveryId: number) => Promise<LighthouseApiResult<undefined>>;
332
+ readonly getRecurringBlackoutRules: () => Promise<LighthouseApiResult<readonly RecurringBlackoutRule[]>>;
333
+ readonly createRecurringBlackoutRule: (payload: LighthouseWritePayload) => Promise<LighthouseApiResult<RecurringBlackoutRule>>;
334
+ readonly updateRecurringBlackoutRule: (id: number, payload: LighthouseWritePayload) => Promise<LighthouseApiResult<RecurringBlackoutRule>>;
335
+ readonly deleteRecurringBlackoutRule: (id: number) => Promise<LighthouseApiResult<undefined>>;
271
336
  readonly runManualForecast: (teamId: number, payload: ManualForecastInput) => Promise<LighthouseApiResult<unknown>>;
272
337
  readonly runBacktest: (teamId: number, payload: BacktestInput) => Promise<LighthouseApiResult<unknown>>;
273
338
  };
274
339
  type LighthouseClientDependencies = {
275
340
  readonly fetch?: (url: string, init?: RequestInit) => Promise<ConnectivityFetchResponse>;
276
341
  };
342
+ /**
343
+ * Returns true when `candidate` is strictly newer than `baseline`, false when
344
+ * it is equal-or-older, and null when either string is unparseable (treat as
345
+ * "unknown — do not block").
346
+ */
347
+ declare const isServerVersionNewerThan: (candidate: string, baseline: string) => boolean | null;
277
348
  declare const createLighthouseClient: (configuration: LighthouseClientConfiguration, dependencies?: LighthouseClientDependencies) => LighthouseClient;
278
349
 
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 };
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 };