@letpeoplework/lighthouse-client 1.1.0 → 1.2.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 +511 -351
- package/dist/index.d.cts +51 -1
- package/dist/index.d.ts +51 -1
- package/dist/index.js +510 -351
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -25,6 +25,7 @@ __export(index_exports, {
|
|
|
25
25
|
getClientPackageContract: () => getClientPackageContract,
|
|
26
26
|
getDefaultMetricsDateRange: () => getDefaultMetricsDateRange,
|
|
27
27
|
getStandaloneDiscoveryLockfilePath: () => getStandaloneDiscoveryLockfilePath,
|
|
28
|
+
isServerVersionNewerThan: () => isServerVersionNewerThan,
|
|
28
29
|
loadStandaloneDiscoveryContract: () => loadStandaloneDiscoveryContract,
|
|
29
30
|
parseStandaloneDiscoveryContract: () => parseStandaloneDiscoveryContract,
|
|
30
31
|
pollCliAuthSession: () => pollCliAuthSession,
|
|
@@ -703,6 +704,7 @@ var requestNoContent = async (configuration, dependencies, route, requestOptions
|
|
|
703
704
|
var getResolvedMetricsDateRange = (range) => range ?? getDefaultMetricsDateRange();
|
|
704
705
|
var getMetricsDateRangeQuery = (range) => `startDate=${encodeURIComponent(range.startDate)}&endDate=${encodeURIComponent(range.endDate)}`;
|
|
705
706
|
var getMetricsAsOfDateQuery = (asOfDate) => `asOfDate=${encodeURIComponent(asOfDate)}`;
|
|
707
|
+
var getItemIdsQuerySuffix = (itemIds) => itemIds && itemIds.length > 0 ? itemIds.map((id) => `&itemIds=${encodeURIComponent(id)}`).join("") : "";
|
|
706
708
|
var getViewQuerySuffix = (view) => view === "filtered" ? "&view=filtered" : "";
|
|
707
709
|
var addUtcDays = (dateStr, days) => {
|
|
708
710
|
const d = /* @__PURE__ */ new Date(`${dateStr}T00:00:00Z`);
|
|
@@ -753,408 +755,565 @@ var deriveTotalWorkItemAgeOverTime = (startDate, endDate, wipData) => {
|
|
|
753
755
|
daily.sort((a, b) => a.date.localeCompare(b.date));
|
|
754
756
|
return { startDate, endDate, daily };
|
|
755
757
|
};
|
|
756
|
-
var
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
configuration,
|
|
770
|
-
dependencies,
|
|
771
|
-
"/v1/worktrackingsystemconnections",
|
|
772
|
-
{
|
|
773
|
-
method: "GET"
|
|
774
|
-
}
|
|
775
|
-
),
|
|
776
|
-
getWorkTrackingConnection: async (connectionId) => requestJson(
|
|
777
|
-
configuration,
|
|
778
|
-
dependencies,
|
|
779
|
-
`/v1/worktrackingsystemconnections/${connectionId}`,
|
|
780
|
-
{
|
|
781
|
-
method: "GET"
|
|
782
|
-
}
|
|
783
|
-
),
|
|
784
|
-
createWorkTrackingConnection: async (payload) => requestJson(
|
|
785
|
-
configuration,
|
|
786
|
-
dependencies,
|
|
787
|
-
"/v1/worktrackingsystemconnections",
|
|
788
|
-
{
|
|
789
|
-
method: "POST",
|
|
790
|
-
body: payload
|
|
791
|
-
}
|
|
792
|
-
),
|
|
793
|
-
updateWorkTrackingConnection: async (connectionId, payload) => requestJson(
|
|
794
|
-
configuration,
|
|
795
|
-
dependencies,
|
|
796
|
-
`/v1/worktrackingsystemconnections/${connectionId}`,
|
|
797
|
-
{
|
|
798
|
-
method: "PUT",
|
|
799
|
-
body: payload
|
|
800
|
-
}
|
|
801
|
-
),
|
|
802
|
-
deleteWorkTrackingConnection: async (connectionId) => requestNoContent(
|
|
803
|
-
configuration,
|
|
804
|
-
dependencies,
|
|
805
|
-
`/v1/worktrackingsystemconnections/${connectionId}`,
|
|
806
|
-
{
|
|
807
|
-
method: "DELETE"
|
|
808
|
-
}
|
|
809
|
-
),
|
|
810
|
-
listTeams: async () => requestJson(configuration, dependencies, "/v1/teams", {
|
|
811
|
-
method: "GET"
|
|
812
|
-
}),
|
|
813
|
-
getTeam: async (teamId) => requestJson(configuration, dependencies, `/v1/teams/${teamId}`, {
|
|
814
|
-
method: "GET"
|
|
815
|
-
}),
|
|
816
|
-
createTeam: async (payload) => requestJson(configuration, dependencies, "/v1/teams", {
|
|
817
|
-
method: "POST",
|
|
818
|
-
body: payload
|
|
819
|
-
}),
|
|
820
|
-
updateTeam: async (teamId, payload) => requestJson(configuration, dependencies, `/v1/teams/${teamId}`, {
|
|
821
|
-
method: "PUT",
|
|
822
|
-
body: payload
|
|
823
|
-
}),
|
|
824
|
-
deleteTeam: async (teamId) => requestNoContent(configuration, dependencies, `/v1/teams/${teamId}`, {
|
|
825
|
-
method: "DELETE"
|
|
826
|
-
}),
|
|
827
|
-
refreshTeam: async (teamId) => requestNoContent(configuration, dependencies, `/v1/teams/${teamId}`, {
|
|
828
|
-
method: "POST"
|
|
829
|
-
}),
|
|
830
|
-
listPortfolios: async () => requestJson(
|
|
831
|
-
configuration,
|
|
832
|
-
dependencies,
|
|
833
|
-
"/v1/portfolios",
|
|
834
|
-
{
|
|
835
|
-
method: "GET"
|
|
758
|
+
var FEATURE_REQUIRES_SERVER_NEWER_THAN = {
|
|
759
|
+
cumulativeStateTime: "v26.5.24.10"
|
|
760
|
+
};
|
|
761
|
+
var parseServerVersion = (raw) => {
|
|
762
|
+
const trimmed = raw.trim().replace(/^v/iu, "");
|
|
763
|
+
if (trimmed.length === 0) {
|
|
764
|
+
return null;
|
|
765
|
+
}
|
|
766
|
+
const segments = trimmed.split(".");
|
|
767
|
+
const parsed = [];
|
|
768
|
+
for (const segment of segments) {
|
|
769
|
+
if (!/^\d+$/u.test(segment)) {
|
|
770
|
+
return null;
|
|
836
771
|
}
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
772
|
+
parsed.push(Number(segment));
|
|
773
|
+
}
|
|
774
|
+
return parsed.length > 0 ? parsed : null;
|
|
775
|
+
};
|
|
776
|
+
var isServerVersionNewerThan = (candidate, baseline) => {
|
|
777
|
+
const left = parseServerVersion(candidate);
|
|
778
|
+
const right = parseServerVersion(baseline);
|
|
779
|
+
if (left === null || right === null) {
|
|
780
|
+
return null;
|
|
781
|
+
}
|
|
782
|
+
const length = Math.max(left.length, right.length);
|
|
783
|
+
for (let index = 0; index < length; index += 1) {
|
|
784
|
+
const l = left[index] ?? 0;
|
|
785
|
+
const r = right[index] ?? 0;
|
|
786
|
+
if (l !== r) {
|
|
787
|
+
return l > r;
|
|
844
788
|
}
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
789
|
+
}
|
|
790
|
+
return false;
|
|
791
|
+
};
|
|
792
|
+
var createLighthouseClient = (configuration, dependencies = {}) => {
|
|
793
|
+
let cachedServerVersion;
|
|
794
|
+
const getCachedServerVersion = async () => {
|
|
795
|
+
if (cachedServerVersion === void 0) {
|
|
796
|
+
const result = await requestText(
|
|
797
|
+
configuration,
|
|
798
|
+
dependencies,
|
|
799
|
+
"/v1/version/current"
|
|
800
|
+
);
|
|
801
|
+
cachedServerVersion = result.ok ? result.value : null;
|
|
857
802
|
}
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
method: "DELETE"
|
|
803
|
+
return cachedServerVersion;
|
|
804
|
+
};
|
|
805
|
+
const ensureServerSupports = async (feature) => {
|
|
806
|
+
const version = await getCachedServerVersion();
|
|
807
|
+
if (version === null) {
|
|
808
|
+
return null;
|
|
865
809
|
}
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
`/v1/portfolios/${portfolioId}/refresh`,
|
|
871
|
-
{
|
|
872
|
-
method: "POST"
|
|
810
|
+
const baseline = FEATURE_REQUIRES_SERVER_NEWER_THAN[feature];
|
|
811
|
+
const newer = isServerVersionNewerThan(version, baseline);
|
|
812
|
+
if (newer === null || newer) {
|
|
813
|
+
return null;
|
|
873
814
|
}
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
815
|
+
return {
|
|
816
|
+
ok: false,
|
|
817
|
+
error: {
|
|
818
|
+
category: "misconfigured",
|
|
819
|
+
reason: `This Lighthouse server (${version}) does not support "${feature}" \u2014 it requires a version newer than ${baseline}. Upgrade Lighthouse to use this client feature.`
|
|
820
|
+
}
|
|
821
|
+
};
|
|
822
|
+
};
|
|
823
|
+
return {
|
|
824
|
+
checkConnectivity: async () => {
|
|
825
|
+
const fetchDependency = getFetchDependency(dependencies);
|
|
826
|
+
return validateLighthouseConnectivity(
|
|
827
|
+
configuration.connection,
|
|
828
|
+
{
|
|
829
|
+
fetch: fetchDependency
|
|
830
|
+
},
|
|
831
|
+
getRequestInit(configuration.auth)
|
|
832
|
+
);
|
|
833
|
+
},
|
|
834
|
+
getVersion: async () => requestText(configuration, dependencies, "/v1/version/current"),
|
|
835
|
+
listWorkTrackingConnections: async () => requestJson(
|
|
878
836
|
configuration,
|
|
879
837
|
dependencies,
|
|
880
|
-
|
|
881
|
-
{
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
return requestJson(
|
|
838
|
+
"/v1/worktrackingsystemconnections",
|
|
839
|
+
{
|
|
840
|
+
method: "GET"
|
|
841
|
+
}
|
|
842
|
+
),
|
|
843
|
+
getWorkTrackingConnection: async (connectionId) => requestJson(
|
|
887
844
|
configuration,
|
|
888
845
|
dependencies,
|
|
889
|
-
`/v1/
|
|
890
|
-
{
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
return requestJson(
|
|
846
|
+
`/v1/worktrackingsystemconnections/${connectionId}`,
|
|
847
|
+
{
|
|
848
|
+
method: "GET"
|
|
849
|
+
}
|
|
850
|
+
),
|
|
851
|
+
createWorkTrackingConnection: async (payload) => requestJson(
|
|
896
852
|
configuration,
|
|
897
853
|
dependencies,
|
|
898
|
-
|
|
899
|
-
{
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
`/v1/teams/${teamId}/metrics/wip?${getMetricsAsOfDateQuery(asOfDate)}`,
|
|
906
|
-
{ method: "GET" }
|
|
907
|
-
),
|
|
908
|
-
getTeamCycleTimePercentiles: async (teamId, range) => {
|
|
909
|
-
const r = getResolvedMetricsDateRange(range);
|
|
910
|
-
return requestJson(
|
|
854
|
+
"/v1/worktrackingsystemconnections",
|
|
855
|
+
{
|
|
856
|
+
method: "POST",
|
|
857
|
+
body: payload
|
|
858
|
+
}
|
|
859
|
+
),
|
|
860
|
+
updateWorkTrackingConnection: async (connectionId, payload) => requestJson(
|
|
911
861
|
configuration,
|
|
912
862
|
dependencies,
|
|
913
|
-
`/v1/
|
|
914
|
-
{
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
863
|
+
`/v1/worktrackingsystemconnections/${connectionId}`,
|
|
864
|
+
{
|
|
865
|
+
method: "PUT",
|
|
866
|
+
body: payload
|
|
867
|
+
}
|
|
868
|
+
),
|
|
869
|
+
deleteWorkTrackingConnection: async (connectionId) => requestNoContent(
|
|
920
870
|
configuration,
|
|
921
871
|
dependencies,
|
|
922
|
-
`/v1/
|
|
923
|
-
{
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
return requestJson(
|
|
872
|
+
`/v1/worktrackingsystemconnections/${connectionId}`,
|
|
873
|
+
{
|
|
874
|
+
method: "DELETE"
|
|
875
|
+
}
|
|
876
|
+
),
|
|
877
|
+
listTeams: async () => requestJson(
|
|
929
878
|
configuration,
|
|
930
879
|
dependencies,
|
|
931
|
-
|
|
932
|
-
{
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
configuration,
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
880
|
+
"/v1/teams",
|
|
881
|
+
{
|
|
882
|
+
method: "GET"
|
|
883
|
+
}
|
|
884
|
+
),
|
|
885
|
+
getTeam: async (teamId) => requestJson(configuration, dependencies, `/v1/teams/${teamId}`, {
|
|
886
|
+
method: "GET"
|
|
887
|
+
}),
|
|
888
|
+
createTeam: async (payload) => requestJson(configuration, dependencies, "/v1/teams", {
|
|
889
|
+
method: "POST",
|
|
890
|
+
body: payload
|
|
891
|
+
}),
|
|
892
|
+
updateTeam: async (teamId, payload) => requestJson(configuration, dependencies, `/v1/teams/${teamId}`, {
|
|
893
|
+
method: "PUT",
|
|
894
|
+
body: payload
|
|
895
|
+
}),
|
|
896
|
+
deleteTeam: async (teamId) => requestNoContent(configuration, dependencies, `/v1/teams/${teamId}`, {
|
|
897
|
+
method: "DELETE"
|
|
898
|
+
}),
|
|
899
|
+
refreshTeam: async (teamId) => requestNoContent(configuration, dependencies, `/v1/teams/${teamId}`, {
|
|
900
|
+
method: "POST"
|
|
901
|
+
}),
|
|
902
|
+
listPortfolios: async () => requestJson(
|
|
944
903
|
configuration,
|
|
945
904
|
dependencies,
|
|
946
|
-
|
|
947
|
-
{
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
const wipResult = await requestJson(
|
|
905
|
+
"/v1/portfolios",
|
|
906
|
+
{
|
|
907
|
+
method: "GET"
|
|
908
|
+
}
|
|
909
|
+
),
|
|
910
|
+
getPortfolio: async (portfolioId) => requestJson(
|
|
953
911
|
configuration,
|
|
954
912
|
dependencies,
|
|
955
|
-
`/v1/
|
|
956
|
-
{
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
},
|
|
966
|
-
getTeamTotalWorkItemAgeOverTime: async (teamId, range) => {
|
|
967
|
-
const r = getResolvedMetricsDateRange(range);
|
|
968
|
-
const wipResult = await requestJson(
|
|
913
|
+
`/v1/portfolios/${portfolioId}`,
|
|
914
|
+
{
|
|
915
|
+
method: "GET"
|
|
916
|
+
}
|
|
917
|
+
),
|
|
918
|
+
createPortfolio: async (payload) => requestJson(configuration, dependencies, "/v1/portfolios", {
|
|
919
|
+
method: "POST",
|
|
920
|
+
body: payload
|
|
921
|
+
}),
|
|
922
|
+
updatePortfolio: async (portfolioId, payload) => requestJson(
|
|
969
923
|
configuration,
|
|
970
924
|
dependencies,
|
|
971
|
-
`/v1/
|
|
972
|
-
{
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
ok: true,
|
|
979
|
-
value: deriveTotalWorkItemAgeOverTime(
|
|
980
|
-
r.startDate,
|
|
981
|
-
r.endDate,
|
|
982
|
-
wipResult.value
|
|
983
|
-
)
|
|
984
|
-
};
|
|
985
|
-
},
|
|
986
|
-
getPortfolioThroughput: async (portfolioId, range) => {
|
|
987
|
-
const r = getResolvedMetricsDateRange(range);
|
|
988
|
-
return requestJson(
|
|
925
|
+
`/v1/portfolios/${portfolioId}`,
|
|
926
|
+
{
|
|
927
|
+
method: "PUT",
|
|
928
|
+
body: payload
|
|
929
|
+
}
|
|
930
|
+
),
|
|
931
|
+
deletePortfolio: async (portfolioId) => requestNoContent(
|
|
989
932
|
configuration,
|
|
990
933
|
dependencies,
|
|
991
|
-
`/v1/portfolios/${portfolioId}
|
|
992
|
-
{
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
return requestJson(
|
|
934
|
+
`/v1/portfolios/${portfolioId}`,
|
|
935
|
+
{
|
|
936
|
+
method: "DELETE"
|
|
937
|
+
}
|
|
938
|
+
),
|
|
939
|
+
refreshPortfolio: async (portfolioId) => requestNoContent(
|
|
998
940
|
configuration,
|
|
999
941
|
dependencies,
|
|
1000
|
-
`/v1/portfolios/${portfolioId}/
|
|
1001
|
-
{
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
942
|
+
`/v1/portfolios/${portfolioId}/refresh`,
|
|
943
|
+
{
|
|
944
|
+
method: "POST"
|
|
945
|
+
}
|
|
946
|
+
),
|
|
947
|
+
getTeamThroughput: async (teamId, range, view) => {
|
|
948
|
+
const r = getResolvedMetricsDateRange(range);
|
|
949
|
+
return requestJson(
|
|
950
|
+
configuration,
|
|
951
|
+
dependencies,
|
|
952
|
+
`/v1/teams/${teamId}/metrics/throughput?${getMetricsDateRangeQuery(r)}${getViewQuerySuffix(view)}`,
|
|
953
|
+
{ method: "GET" }
|
|
954
|
+
);
|
|
955
|
+
},
|
|
956
|
+
getTeamArrivals: async (teamId, range) => {
|
|
957
|
+
const r = getResolvedMetricsDateRange(range);
|
|
958
|
+
return requestJson(
|
|
959
|
+
configuration,
|
|
960
|
+
dependencies,
|
|
961
|
+
`/v1/teams/${teamId}/metrics/arrivals?${getMetricsDateRangeQuery(r)}`,
|
|
962
|
+
{ method: "GET" }
|
|
963
|
+
);
|
|
964
|
+
},
|
|
965
|
+
getTeamWipOverTime: async (teamId, range) => {
|
|
966
|
+
const r = getResolvedMetricsDateRange(range);
|
|
967
|
+
return requestJson(
|
|
968
|
+
configuration,
|
|
969
|
+
dependencies,
|
|
970
|
+
`/v1/teams/${teamId}/metrics/wipOverTime?${getMetricsDateRangeQuery(r)}`,
|
|
971
|
+
{ method: "GET" }
|
|
972
|
+
);
|
|
973
|
+
},
|
|
974
|
+
getTeamWip: async (teamId, asOfDate) => requestJson(
|
|
1007
975
|
configuration,
|
|
1008
976
|
dependencies,
|
|
1009
|
-
`/v1/
|
|
977
|
+
`/v1/teams/${teamId}/metrics/wip?${getMetricsAsOfDateQuery(asOfDate)}`,
|
|
1010
978
|
{ method: "GET" }
|
|
1011
|
-
)
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
979
|
+
),
|
|
980
|
+
getTeamCycleTimePercentiles: async (teamId, range) => {
|
|
981
|
+
const r = getResolvedMetricsDateRange(range);
|
|
982
|
+
return requestJson(
|
|
983
|
+
configuration,
|
|
984
|
+
dependencies,
|
|
985
|
+
`/v1/teams/${teamId}/metrics/cycleTimePercentiles?${getMetricsDateRangeQuery(r)}`,
|
|
986
|
+
{ method: "GET" }
|
|
987
|
+
);
|
|
988
|
+
},
|
|
989
|
+
getTeamCycleTimeData: async (teamId, range) => {
|
|
990
|
+
const r = getResolvedMetricsDateRange(range);
|
|
991
|
+
return requestJson(
|
|
992
|
+
configuration,
|
|
993
|
+
dependencies,
|
|
994
|
+
`/v1/teams/${teamId}/metrics/cycleTimeData?${getMetricsDateRangeQuery(r)}`,
|
|
995
|
+
{ method: "GET" }
|
|
996
|
+
);
|
|
997
|
+
},
|
|
998
|
+
getTeamPredictabilityScore: async (teamId, range, view) => {
|
|
999
|
+
const r = getResolvedMetricsDateRange(range);
|
|
1000
|
+
return requestJson(
|
|
1001
|
+
configuration,
|
|
1002
|
+
dependencies,
|
|
1003
|
+
`/v1/teams/${teamId}/metrics/multiitemforecastpredictabilityscore?${getMetricsDateRangeQuery(r)}${getViewQuerySuffix(view)}`,
|
|
1004
|
+
{ method: "GET" }
|
|
1005
|
+
);
|
|
1006
|
+
},
|
|
1007
|
+
getTeamTotalWorkItemAge: async (teamId, asOfDate) => requestJson(
|
|
1016
1008
|
configuration,
|
|
1017
1009
|
dependencies,
|
|
1018
|
-
`/v1/
|
|
1010
|
+
`/v1/teams/${teamId}/metrics/totalWorkItemAge?${getMetricsAsOfDateQuery(asOfDate)}`,
|
|
1019
1011
|
{ method: "GET" }
|
|
1020
|
-
)
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1012
|
+
),
|
|
1013
|
+
getTeamTotalWorkItemAgeInfo: async (teamId, range) => {
|
|
1014
|
+
const r = getResolvedMetricsDateRange(range);
|
|
1015
|
+
return requestJson(
|
|
1016
|
+
configuration,
|
|
1017
|
+
dependencies,
|
|
1018
|
+
`/v1/teams/${teamId}/metrics/totalWorkItemAgeInfo?${getMetricsDateRangeQuery(r)}`,
|
|
1019
|
+
{ method: "GET" }
|
|
1020
|
+
);
|
|
1021
|
+
},
|
|
1022
|
+
getTeamWorkItemAgeOverTime: async (teamId, range) => {
|
|
1023
|
+
const r = getResolvedMetricsDateRange(range);
|
|
1024
|
+
const wipResult = await requestJson(
|
|
1025
|
+
configuration,
|
|
1026
|
+
dependencies,
|
|
1027
|
+
`/v1/teams/${teamId}/metrics/wipOverTime?${getMetricsDateRangeQuery(r)}`,
|
|
1028
|
+
{ method: "GET" }
|
|
1029
|
+
);
|
|
1030
|
+
if (!wipResult.ok) {
|
|
1031
|
+
return wipResult;
|
|
1032
|
+
}
|
|
1033
|
+
return {
|
|
1034
|
+
ok: true,
|
|
1035
|
+
value: deriveWorkItemAgeOverTime(
|
|
1036
|
+
r.startDate,
|
|
1037
|
+
r.endDate,
|
|
1038
|
+
wipResult.value
|
|
1039
|
+
)
|
|
1040
|
+
};
|
|
1041
|
+
},
|
|
1042
|
+
getTeamTotalWorkItemAgeOverTime: async (teamId, range) => {
|
|
1043
|
+
const r = getResolvedMetricsDateRange(range);
|
|
1044
|
+
const wipResult = await requestJson(
|
|
1045
|
+
configuration,
|
|
1046
|
+
dependencies,
|
|
1047
|
+
`/v1/teams/${teamId}/metrics/wipOverTime?${getMetricsDateRangeQuery(r)}`,
|
|
1048
|
+
{ method: "GET" }
|
|
1049
|
+
);
|
|
1050
|
+
if (!wipResult.ok) {
|
|
1051
|
+
return wipResult;
|
|
1052
|
+
}
|
|
1053
|
+
return {
|
|
1054
|
+
ok: true,
|
|
1055
|
+
value: deriveTotalWorkItemAgeOverTime(
|
|
1056
|
+
r.startDate,
|
|
1057
|
+
r.endDate,
|
|
1058
|
+
wipResult.value
|
|
1059
|
+
)
|
|
1060
|
+
};
|
|
1061
|
+
},
|
|
1062
|
+
getPortfolioThroughput: async (portfolioId, range) => {
|
|
1063
|
+
const r = getResolvedMetricsDateRange(range);
|
|
1064
|
+
return requestJson(
|
|
1065
|
+
configuration,
|
|
1066
|
+
dependencies,
|
|
1067
|
+
`/v1/portfolios/${portfolioId}/metrics/throughput?${getMetricsDateRangeQuery(r)}`,
|
|
1068
|
+
{ method: "GET" }
|
|
1069
|
+
);
|
|
1070
|
+
},
|
|
1071
|
+
getPortfolioCycleTimePercentiles: async (portfolioId, range) => {
|
|
1072
|
+
const r = getResolvedMetricsDateRange(range);
|
|
1073
|
+
return requestJson(
|
|
1074
|
+
configuration,
|
|
1075
|
+
dependencies,
|
|
1076
|
+
`/v1/portfolios/${portfolioId}/metrics/cycleTimePercentiles?${getMetricsDateRangeQuery(r)}`,
|
|
1077
|
+
{ method: "GET" }
|
|
1078
|
+
);
|
|
1079
|
+
},
|
|
1080
|
+
getPortfolioArrivals: async (portfolioId, range) => {
|
|
1081
|
+
const r = getResolvedMetricsDateRange(range);
|
|
1082
|
+
return requestJson(
|
|
1083
|
+
configuration,
|
|
1084
|
+
dependencies,
|
|
1085
|
+
`/v1/portfolios/${portfolioId}/metrics/arrivals?${getMetricsDateRangeQuery(r)}`,
|
|
1086
|
+
{ method: "GET" }
|
|
1087
|
+
);
|
|
1088
|
+
},
|
|
1089
|
+
getPortfolioWipOverTime: async (portfolioId, range) => {
|
|
1090
|
+
const r = getResolvedMetricsDateRange(range);
|
|
1091
|
+
return requestJson(
|
|
1092
|
+
configuration,
|
|
1093
|
+
dependencies,
|
|
1094
|
+
`/v1/portfolios/${portfolioId}/metrics/wipOverTime?${getMetricsDateRangeQuery(r)}`,
|
|
1095
|
+
{ method: "GET" }
|
|
1096
|
+
);
|
|
1097
|
+
},
|
|
1098
|
+
getPortfolioWip: async (portfolioId, asOfDate) => requestJson(
|
|
1031
1099
|
configuration,
|
|
1032
1100
|
dependencies,
|
|
1033
|
-
`/v1/portfolios/${portfolioId}/metrics/
|
|
1101
|
+
`/v1/portfolios/${portfolioId}/metrics/wip?${getMetricsAsOfDateQuery(asOfDate)}`,
|
|
1034
1102
|
{ method: "GET" }
|
|
1035
|
-
)
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1103
|
+
),
|
|
1104
|
+
getPortfolioCycleTimeData: async (portfolioId, range) => {
|
|
1105
|
+
const r = getResolvedMetricsDateRange(range);
|
|
1106
|
+
return requestJson(
|
|
1107
|
+
configuration,
|
|
1108
|
+
dependencies,
|
|
1109
|
+
`/v1/portfolios/${portfolioId}/metrics/cycleTimeData?${getMetricsDateRangeQuery(r)}`,
|
|
1110
|
+
{ method: "GET" }
|
|
1111
|
+
);
|
|
1112
|
+
},
|
|
1113
|
+
getPortfolioPredictabilityScore: async (portfolioId, range) => {
|
|
1114
|
+
const r = getResolvedMetricsDateRange(range);
|
|
1115
|
+
return requestJson(
|
|
1116
|
+
configuration,
|
|
1117
|
+
dependencies,
|
|
1118
|
+
`/v1/portfolios/${portfolioId}/metrics/multiitemforecastpredictabilityscore?${getMetricsDateRangeQuery(r)}`,
|
|
1119
|
+
{ method: "GET" }
|
|
1120
|
+
);
|
|
1121
|
+
},
|
|
1122
|
+
getPortfolioTotalWorkItemAge: async (portfolioId, asOfDate) => requestJson(
|
|
1040
1123
|
configuration,
|
|
1041
1124
|
dependencies,
|
|
1042
|
-
`/v1/portfolios/${portfolioId}/metrics/
|
|
1125
|
+
`/v1/portfolios/${portfolioId}/metrics/totalWorkItemAge?${getMetricsAsOfDateQuery(asOfDate)}`,
|
|
1043
1126
|
{ method: "GET" }
|
|
1044
|
-
)
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1127
|
+
),
|
|
1128
|
+
getPortfolioTotalWorkItemAgeInfo: async (portfolioId, range) => {
|
|
1129
|
+
const r = getResolvedMetricsDateRange(range);
|
|
1130
|
+
return requestJson(
|
|
1131
|
+
configuration,
|
|
1132
|
+
dependencies,
|
|
1133
|
+
`/v1/portfolios/${portfolioId}/metrics/totalWorkItemAgeInfo?${getMetricsDateRangeQuery(r)}`,
|
|
1134
|
+
{ method: "GET" }
|
|
1135
|
+
);
|
|
1136
|
+
},
|
|
1137
|
+
getPortfolioWorkItemAgeOverTime: async (portfolioId, range) => {
|
|
1138
|
+
const r = getResolvedMetricsDateRange(range);
|
|
1139
|
+
const wipResult = await requestJson(
|
|
1140
|
+
configuration,
|
|
1141
|
+
dependencies,
|
|
1142
|
+
`/v1/portfolios/${portfolioId}/metrics/wipOverTime?${getMetricsDateRangeQuery(r)}`,
|
|
1143
|
+
{ method: "GET" }
|
|
1144
|
+
);
|
|
1145
|
+
if (!wipResult.ok) {
|
|
1146
|
+
return wipResult;
|
|
1147
|
+
}
|
|
1148
|
+
return {
|
|
1149
|
+
ok: true,
|
|
1150
|
+
value: deriveWorkItemAgeOverTime(
|
|
1151
|
+
r.startDate,
|
|
1152
|
+
r.endDate,
|
|
1153
|
+
wipResult.value
|
|
1154
|
+
)
|
|
1155
|
+
};
|
|
1156
|
+
},
|
|
1157
|
+
getPortfolioTotalWorkItemAgeOverTime: async (portfolioId, range) => {
|
|
1158
|
+
const r = getResolvedMetricsDateRange(range);
|
|
1159
|
+
const wipResult = await requestJson(
|
|
1160
|
+
configuration,
|
|
1161
|
+
dependencies,
|
|
1162
|
+
`/v1/portfolios/${portfolioId}/metrics/wipOverTime?${getMetricsDateRangeQuery(r)}`,
|
|
1163
|
+
{ method: "GET" }
|
|
1164
|
+
);
|
|
1165
|
+
if (!wipResult.ok) {
|
|
1166
|
+
return wipResult;
|
|
1167
|
+
}
|
|
1168
|
+
return {
|
|
1169
|
+
ok: true,
|
|
1170
|
+
value: deriveTotalWorkItemAgeOverTime(
|
|
1171
|
+
r.startDate,
|
|
1172
|
+
r.endDate,
|
|
1173
|
+
wipResult.value
|
|
1174
|
+
)
|
|
1175
|
+
};
|
|
1176
|
+
},
|
|
1177
|
+
getTeamCumulativeStateTime: async (teamId, range, itemIds) => {
|
|
1178
|
+
const unsupported = await ensureServerSupports("cumulativeStateTime");
|
|
1179
|
+
if (unsupported) {
|
|
1180
|
+
return unsupported;
|
|
1181
|
+
}
|
|
1182
|
+
const r = getResolvedMetricsDateRange(range);
|
|
1183
|
+
return requestJson(
|
|
1184
|
+
configuration,
|
|
1185
|
+
dependencies,
|
|
1186
|
+
`/v1/teams/${teamId}/metrics/cumulativeStateTime?${getMetricsDateRangeQuery(r)}${getItemIdsQuerySuffix(itemIds)}`,
|
|
1187
|
+
{ method: "GET" }
|
|
1188
|
+
);
|
|
1189
|
+
},
|
|
1190
|
+
getTeamCumulativeStateTimeItems: async (teamId, state, range, itemIds) => {
|
|
1191
|
+
const unsupported = await ensureServerSupports("cumulativeStateTime");
|
|
1192
|
+
if (unsupported) {
|
|
1193
|
+
return unsupported;
|
|
1194
|
+
}
|
|
1195
|
+
const r = getResolvedMetricsDateRange(range);
|
|
1196
|
+
return requestJson(
|
|
1197
|
+
configuration,
|
|
1198
|
+
dependencies,
|
|
1199
|
+
`/v1/teams/${teamId}/metrics/cumulativeStateTime/items?state=${encodeURIComponent(state)}&${getMetricsDateRangeQuery(r)}${getItemIdsQuerySuffix(itemIds)}`,
|
|
1200
|
+
{ method: "GET" }
|
|
1201
|
+
);
|
|
1202
|
+
},
|
|
1203
|
+
getTeamCumulativeStateTimeCandidates: async (teamId, range) => {
|
|
1204
|
+
const unsupported = await ensureServerSupports("cumulativeStateTime");
|
|
1205
|
+
if (unsupported) {
|
|
1206
|
+
return unsupported;
|
|
1207
|
+
}
|
|
1208
|
+
const r = getResolvedMetricsDateRange(range);
|
|
1209
|
+
return requestJson(
|
|
1210
|
+
configuration,
|
|
1211
|
+
dependencies,
|
|
1212
|
+
`/v1/teams/${teamId}/metrics/cumulativeStateTime/candidates?${getMetricsDateRangeQuery(r)}`,
|
|
1213
|
+
{ method: "GET" }
|
|
1214
|
+
);
|
|
1215
|
+
},
|
|
1216
|
+
getPortfolioCumulativeStateTime: async (portfolioId, range, itemIds) => {
|
|
1217
|
+
const unsupported = await ensureServerSupports("cumulativeStateTime");
|
|
1218
|
+
if (unsupported) {
|
|
1219
|
+
return unsupported;
|
|
1220
|
+
}
|
|
1221
|
+
const r = getResolvedMetricsDateRange(range);
|
|
1222
|
+
return requestJson(
|
|
1223
|
+
configuration,
|
|
1224
|
+
dependencies,
|
|
1225
|
+
`/v1/portfolios/${portfolioId}/metrics/cumulativeStateTime?${getMetricsDateRangeQuery(r)}${getItemIdsQuerySuffix(itemIds)}`,
|
|
1226
|
+
{ method: "GET" }
|
|
1227
|
+
);
|
|
1228
|
+
},
|
|
1229
|
+
getPortfolioCumulativeStateTimeItems: async (portfolioId, state, range, itemIds) => {
|
|
1230
|
+
const unsupported = await ensureServerSupports("cumulativeStateTime");
|
|
1231
|
+
if (unsupported) {
|
|
1232
|
+
return unsupported;
|
|
1233
|
+
}
|
|
1234
|
+
const r = getResolvedMetricsDateRange(range);
|
|
1235
|
+
return requestJson(
|
|
1236
|
+
configuration,
|
|
1237
|
+
dependencies,
|
|
1238
|
+
`/v1/portfolios/${portfolioId}/metrics/cumulativeStateTime/items?state=${encodeURIComponent(state)}&${getMetricsDateRangeQuery(r)}${getItemIdsQuerySuffix(itemIds)}`,
|
|
1239
|
+
{ method: "GET" }
|
|
1240
|
+
);
|
|
1241
|
+
},
|
|
1242
|
+
getPortfolioCumulativeStateTimeCandidates: async (portfolioId, range) => {
|
|
1243
|
+
const unsupported = await ensureServerSupports("cumulativeStateTime");
|
|
1244
|
+
if (unsupported) {
|
|
1245
|
+
return unsupported;
|
|
1246
|
+
}
|
|
1247
|
+
const r = getResolvedMetricsDateRange(range);
|
|
1248
|
+
return requestJson(
|
|
1249
|
+
configuration,
|
|
1250
|
+
dependencies,
|
|
1251
|
+
`/v1/portfolios/${portfolioId}/metrics/cumulativeStateTime/candidates?${getMetricsDateRangeQuery(r)}`,
|
|
1252
|
+
{ method: "GET" }
|
|
1253
|
+
);
|
|
1254
|
+
},
|
|
1255
|
+
getFeaturesByIds: async (ids) => {
|
|
1256
|
+
const queryString = ids.map((id) => `ids=${encodeURIComponent(id)}`).join("&");
|
|
1257
|
+
return requestJson(
|
|
1258
|
+
configuration,
|
|
1259
|
+
dependencies,
|
|
1260
|
+
`/v1/features?${queryString}`,
|
|
1261
|
+
{ method: "GET" }
|
|
1262
|
+
);
|
|
1263
|
+
},
|
|
1264
|
+
getFeaturesByReferences: async (refs) => {
|
|
1265
|
+
const queryString = refs.map((r) => `featureReferences=${encodeURIComponent(r)}`).join("&");
|
|
1266
|
+
return requestJson(
|
|
1267
|
+
configuration,
|
|
1268
|
+
dependencies,
|
|
1269
|
+
`/v1/features/references?${queryString}`,
|
|
1270
|
+
{ method: "GET" }
|
|
1271
|
+
);
|
|
1272
|
+
},
|
|
1273
|
+
getFeatureWorkItems: async (featureId) => requestJson(
|
|
1055
1274
|
configuration,
|
|
1056
1275
|
dependencies,
|
|
1057
|
-
`/v1/
|
|
1276
|
+
`/v1/features/${featureId}/workitems`,
|
|
1058
1277
|
{ method: "GET" }
|
|
1059
|
-
)
|
|
1060
|
-
|
|
1061
|
-
getPortfolioWorkItemAgeOverTime: async (portfolioId, range) => {
|
|
1062
|
-
const r = getResolvedMetricsDateRange(range);
|
|
1063
|
-
const wipResult = await requestJson(
|
|
1278
|
+
),
|
|
1279
|
+
listDeliveries: async (portfolioId) => requestJson(
|
|
1064
1280
|
configuration,
|
|
1065
1281
|
dependencies,
|
|
1066
|
-
`/v1/
|
|
1282
|
+
`/v1/deliveries/portfolio/${portfolioId}`,
|
|
1067
1283
|
{ method: "GET" }
|
|
1068
|
-
)
|
|
1069
|
-
|
|
1070
|
-
return wipResult;
|
|
1071
|
-
}
|
|
1072
|
-
return {
|
|
1073
|
-
ok: true,
|
|
1074
|
-
value: deriveWorkItemAgeOverTime(r.startDate, r.endDate, wipResult.value)
|
|
1075
|
-
};
|
|
1076
|
-
},
|
|
1077
|
-
getPortfolioTotalWorkItemAgeOverTime: async (portfolioId, range) => {
|
|
1078
|
-
const r = getResolvedMetricsDateRange(range);
|
|
1079
|
-
const wipResult = await requestJson(
|
|
1284
|
+
),
|
|
1285
|
+
createDelivery: async (portfolioId, payload) => requestJson(
|
|
1080
1286
|
configuration,
|
|
1081
1287
|
dependencies,
|
|
1082
|
-
`/v1/
|
|
1083
|
-
{ method: "
|
|
1084
|
-
)
|
|
1085
|
-
|
|
1086
|
-
return wipResult;
|
|
1087
|
-
}
|
|
1088
|
-
return {
|
|
1089
|
-
ok: true,
|
|
1090
|
-
value: deriveTotalWorkItemAgeOverTime(
|
|
1091
|
-
r.startDate,
|
|
1092
|
-
r.endDate,
|
|
1093
|
-
wipResult.value
|
|
1094
|
-
)
|
|
1095
|
-
};
|
|
1096
|
-
},
|
|
1097
|
-
getFeaturesByIds: async (ids) => {
|
|
1098
|
-
const queryString = ids.map((id) => `ids=${encodeURIComponent(id)}`).join("&");
|
|
1099
|
-
return requestJson(
|
|
1288
|
+
`/v1/deliveries/portfolio/${portfolioId}`,
|
|
1289
|
+
{ method: "POST", body: payload }
|
|
1290
|
+
),
|
|
1291
|
+
updateDelivery: async (deliveryId, payload) => requestJson(
|
|
1100
1292
|
configuration,
|
|
1101
1293
|
dependencies,
|
|
1102
|
-
`/v1/
|
|
1103
|
-
{ method: "
|
|
1104
|
-
)
|
|
1105
|
-
|
|
1106
|
-
getFeaturesByReferences: async (refs) => {
|
|
1107
|
-
const queryString = refs.map((r) => `featureReferences=${encodeURIComponent(r)}`).join("&");
|
|
1108
|
-
return requestJson(
|
|
1294
|
+
`/v1/deliveries/${deliveryId}`,
|
|
1295
|
+
{ method: "PUT", body: payload }
|
|
1296
|
+
),
|
|
1297
|
+
deleteDelivery: async (deliveryId) => requestNoContent(
|
|
1109
1298
|
configuration,
|
|
1110
1299
|
dependencies,
|
|
1111
|
-
`/v1/
|
|
1112
|
-
{ method: "
|
|
1113
|
-
)
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
configuration,
|
|
1129
|
-
dependencies,
|
|
1130
|
-
`/v1/deliveries/portfolio/${portfolioId}`,
|
|
1131
|
-
{ method: "POST", body: payload }
|
|
1132
|
-
),
|
|
1133
|
-
updateDelivery: async (deliveryId, payload) => requestJson(
|
|
1134
|
-
configuration,
|
|
1135
|
-
dependencies,
|
|
1136
|
-
`/v1/deliveries/${deliveryId}`,
|
|
1137
|
-
{ method: "PUT", body: payload }
|
|
1138
|
-
),
|
|
1139
|
-
deleteDelivery: async (deliveryId) => requestNoContent(
|
|
1140
|
-
configuration,
|
|
1141
|
-
dependencies,
|
|
1142
|
-
`/v1/deliveries/${deliveryId}`,
|
|
1143
|
-
{ method: "DELETE" }
|
|
1144
|
-
),
|
|
1145
|
-
runManualForecast: async (teamId, payload) => requestJson(
|
|
1146
|
-
configuration,
|
|
1147
|
-
dependencies,
|
|
1148
|
-
`/v1/forecast/manual/${teamId}`,
|
|
1149
|
-
{ method: "POST", body: payload }
|
|
1150
|
-
),
|
|
1151
|
-
runBacktest: async (teamId, payload) => requestJson(
|
|
1152
|
-
configuration,
|
|
1153
|
-
dependencies,
|
|
1154
|
-
`/v1/forecast/backtest/${teamId}`,
|
|
1155
|
-
{ method: "POST", body: payload }
|
|
1156
|
-
)
|
|
1157
|
-
});
|
|
1300
|
+
`/v1/deliveries/${deliveryId}`,
|
|
1301
|
+
{ method: "DELETE" }
|
|
1302
|
+
),
|
|
1303
|
+
runManualForecast: async (teamId, payload) => requestJson(
|
|
1304
|
+
configuration,
|
|
1305
|
+
dependencies,
|
|
1306
|
+
`/v1/forecast/manual/${teamId}`,
|
|
1307
|
+
{ method: "POST", body: payload }
|
|
1308
|
+
),
|
|
1309
|
+
runBacktest: async (teamId, payload) => requestJson(
|
|
1310
|
+
configuration,
|
|
1311
|
+
dependencies,
|
|
1312
|
+
`/v1/forecast/backtest/${teamId}`,
|
|
1313
|
+
{ method: "POST", body: payload }
|
|
1314
|
+
)
|
|
1315
|
+
};
|
|
1316
|
+
};
|
|
1158
1317
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1159
1318
|
0 && (module.exports = {
|
|
1160
1319
|
createLighthouseAuthContext,
|
|
@@ -1162,6 +1321,7 @@ var createLighthouseClient = (configuration, dependencies = {}) => ({
|
|
|
1162
1321
|
getClientPackageContract,
|
|
1163
1322
|
getDefaultMetricsDateRange,
|
|
1164
1323
|
getStandaloneDiscoveryLockfilePath,
|
|
1324
|
+
isServerVersionNewerThan,
|
|
1165
1325
|
loadStandaloneDiscoveryContract,
|
|
1166
1326
|
parseStandaloneDiscoveryContract,
|
|
1167
1327
|
pollCliAuthSession,
|