@letpeoplework/lighthouse-client 1.0.1 → 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 +512 -351
- package/dist/index.d.cts +79 -4
- package/dist/index.d.ts +79 -4
- package/dist/index.js +511 -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,8 @@ 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("") : "";
|
|
708
|
+
var getViewQuerySuffix = (view) => view === "filtered" ? "&view=filtered" : "";
|
|
706
709
|
var addUtcDays = (dateStr, days) => {
|
|
707
710
|
const d = /* @__PURE__ */ new Date(`${dateStr}T00:00:00Z`);
|
|
708
711
|
d.setUTCDate(d.getUTCDate() + days);
|
|
@@ -752,408 +755,565 @@ var deriveTotalWorkItemAgeOverTime = (startDate, endDate, wipData) => {
|
|
|
752
755
|
daily.sort((a, b) => a.date.localeCompare(b.date));
|
|
753
756
|
return { startDate, endDate, daily };
|
|
754
757
|
};
|
|
755
|
-
var
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
configuration,
|
|
769
|
-
dependencies,
|
|
770
|
-
"/v1/worktrackingsystemconnections",
|
|
771
|
-
{
|
|
772
|
-
method: "GET"
|
|
773
|
-
}
|
|
774
|
-
),
|
|
775
|
-
getWorkTrackingConnection: async (connectionId) => requestJson(
|
|
776
|
-
configuration,
|
|
777
|
-
dependencies,
|
|
778
|
-
`/v1/worktrackingsystemconnections/${connectionId}`,
|
|
779
|
-
{
|
|
780
|
-
method: "GET"
|
|
781
|
-
}
|
|
782
|
-
),
|
|
783
|
-
createWorkTrackingConnection: async (payload) => requestJson(
|
|
784
|
-
configuration,
|
|
785
|
-
dependencies,
|
|
786
|
-
"/v1/worktrackingsystemconnections",
|
|
787
|
-
{
|
|
788
|
-
method: "POST",
|
|
789
|
-
body: payload
|
|
790
|
-
}
|
|
791
|
-
),
|
|
792
|
-
updateWorkTrackingConnection: async (connectionId, payload) => requestJson(
|
|
793
|
-
configuration,
|
|
794
|
-
dependencies,
|
|
795
|
-
`/v1/worktrackingsystemconnections/${connectionId}`,
|
|
796
|
-
{
|
|
797
|
-
method: "PUT",
|
|
798
|
-
body: payload
|
|
799
|
-
}
|
|
800
|
-
),
|
|
801
|
-
deleteWorkTrackingConnection: async (connectionId) => requestNoContent(
|
|
802
|
-
configuration,
|
|
803
|
-
dependencies,
|
|
804
|
-
`/v1/worktrackingsystemconnections/${connectionId}`,
|
|
805
|
-
{
|
|
806
|
-
method: "DELETE"
|
|
807
|
-
}
|
|
808
|
-
),
|
|
809
|
-
listTeams: async () => requestJson(configuration, dependencies, "/v1/teams", {
|
|
810
|
-
method: "GET"
|
|
811
|
-
}),
|
|
812
|
-
getTeam: async (teamId) => requestJson(configuration, dependencies, `/v1/teams/${teamId}`, {
|
|
813
|
-
method: "GET"
|
|
814
|
-
}),
|
|
815
|
-
createTeam: async (payload) => requestJson(configuration, dependencies, "/v1/teams", {
|
|
816
|
-
method: "POST",
|
|
817
|
-
body: payload
|
|
818
|
-
}),
|
|
819
|
-
updateTeam: async (teamId, payload) => requestJson(configuration, dependencies, `/v1/teams/${teamId}`, {
|
|
820
|
-
method: "PUT",
|
|
821
|
-
body: payload
|
|
822
|
-
}),
|
|
823
|
-
deleteTeam: async (teamId) => requestNoContent(configuration, dependencies, `/v1/teams/${teamId}`, {
|
|
824
|
-
method: "DELETE"
|
|
825
|
-
}),
|
|
826
|
-
refreshTeam: async (teamId) => requestNoContent(configuration, dependencies, `/v1/teams/${teamId}`, {
|
|
827
|
-
method: "POST"
|
|
828
|
-
}),
|
|
829
|
-
listPortfolios: async () => requestJson(
|
|
830
|
-
configuration,
|
|
831
|
-
dependencies,
|
|
832
|
-
"/v1/portfolios",
|
|
833
|
-
{
|
|
834
|
-
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;
|
|
835
771
|
}
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
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;
|
|
843
788
|
}
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
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;
|
|
856
802
|
}
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
method: "DELETE"
|
|
803
|
+
return cachedServerVersion;
|
|
804
|
+
};
|
|
805
|
+
const ensureServerSupports = async (feature) => {
|
|
806
|
+
const version = await getCachedServerVersion();
|
|
807
|
+
if (version === null) {
|
|
808
|
+
return null;
|
|
864
809
|
}
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
`/v1/portfolios/${portfolioId}/refresh`,
|
|
870
|
-
{
|
|
871
|
-
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;
|
|
872
814
|
}
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
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(
|
|
877
836
|
configuration,
|
|
878
837
|
dependencies,
|
|
879
|
-
|
|
880
|
-
{
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
return requestJson(
|
|
838
|
+
"/v1/worktrackingsystemconnections",
|
|
839
|
+
{
|
|
840
|
+
method: "GET"
|
|
841
|
+
}
|
|
842
|
+
),
|
|
843
|
+
getWorkTrackingConnection: async (connectionId) => requestJson(
|
|
886
844
|
configuration,
|
|
887
845
|
dependencies,
|
|
888
|
-
`/v1/
|
|
889
|
-
{
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
return requestJson(
|
|
846
|
+
`/v1/worktrackingsystemconnections/${connectionId}`,
|
|
847
|
+
{
|
|
848
|
+
method: "GET"
|
|
849
|
+
}
|
|
850
|
+
),
|
|
851
|
+
createWorkTrackingConnection: async (payload) => requestJson(
|
|
895
852
|
configuration,
|
|
896
853
|
dependencies,
|
|
897
|
-
|
|
898
|
-
{
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
`/v1/teams/${teamId}/metrics/wip?${getMetricsAsOfDateQuery(asOfDate)}`,
|
|
905
|
-
{ method: "GET" }
|
|
906
|
-
),
|
|
907
|
-
getTeamCycleTimePercentiles: async (teamId, range) => {
|
|
908
|
-
const r = getResolvedMetricsDateRange(range);
|
|
909
|
-
return requestJson(
|
|
854
|
+
"/v1/worktrackingsystemconnections",
|
|
855
|
+
{
|
|
856
|
+
method: "POST",
|
|
857
|
+
body: payload
|
|
858
|
+
}
|
|
859
|
+
),
|
|
860
|
+
updateWorkTrackingConnection: async (connectionId, payload) => requestJson(
|
|
910
861
|
configuration,
|
|
911
862
|
dependencies,
|
|
912
|
-
`/v1/
|
|
913
|
-
{
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
863
|
+
`/v1/worktrackingsystemconnections/${connectionId}`,
|
|
864
|
+
{
|
|
865
|
+
method: "PUT",
|
|
866
|
+
body: payload
|
|
867
|
+
}
|
|
868
|
+
),
|
|
869
|
+
deleteWorkTrackingConnection: async (connectionId) => requestNoContent(
|
|
919
870
|
configuration,
|
|
920
871
|
dependencies,
|
|
921
|
-
`/v1/
|
|
922
|
-
{
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
return requestJson(
|
|
872
|
+
`/v1/worktrackingsystemconnections/${connectionId}`,
|
|
873
|
+
{
|
|
874
|
+
method: "DELETE"
|
|
875
|
+
}
|
|
876
|
+
),
|
|
877
|
+
listTeams: async () => requestJson(
|
|
928
878
|
configuration,
|
|
929
879
|
dependencies,
|
|
930
|
-
|
|
931
|
-
{
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
configuration,
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
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(
|
|
943
903
|
configuration,
|
|
944
904
|
dependencies,
|
|
945
|
-
|
|
946
|
-
{
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
const wipResult = await requestJson(
|
|
905
|
+
"/v1/portfolios",
|
|
906
|
+
{
|
|
907
|
+
method: "GET"
|
|
908
|
+
}
|
|
909
|
+
),
|
|
910
|
+
getPortfolio: async (portfolioId) => requestJson(
|
|
952
911
|
configuration,
|
|
953
912
|
dependencies,
|
|
954
|
-
`/v1/
|
|
955
|
-
{
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
},
|
|
965
|
-
getTeamTotalWorkItemAgeOverTime: async (teamId, range) => {
|
|
966
|
-
const r = getResolvedMetricsDateRange(range);
|
|
967
|
-
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(
|
|
968
923
|
configuration,
|
|
969
924
|
dependencies,
|
|
970
|
-
`/v1/
|
|
971
|
-
{
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
ok: true,
|
|
978
|
-
value: deriveTotalWorkItemAgeOverTime(
|
|
979
|
-
r.startDate,
|
|
980
|
-
r.endDate,
|
|
981
|
-
wipResult.value
|
|
982
|
-
)
|
|
983
|
-
};
|
|
984
|
-
},
|
|
985
|
-
getPortfolioThroughput: async (portfolioId, range) => {
|
|
986
|
-
const r = getResolvedMetricsDateRange(range);
|
|
987
|
-
return requestJson(
|
|
925
|
+
`/v1/portfolios/${portfolioId}`,
|
|
926
|
+
{
|
|
927
|
+
method: "PUT",
|
|
928
|
+
body: payload
|
|
929
|
+
}
|
|
930
|
+
),
|
|
931
|
+
deletePortfolio: async (portfolioId) => requestNoContent(
|
|
988
932
|
configuration,
|
|
989
933
|
dependencies,
|
|
990
|
-
`/v1/portfolios/${portfolioId}
|
|
991
|
-
{
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
return requestJson(
|
|
934
|
+
`/v1/portfolios/${portfolioId}`,
|
|
935
|
+
{
|
|
936
|
+
method: "DELETE"
|
|
937
|
+
}
|
|
938
|
+
),
|
|
939
|
+
refreshPortfolio: async (portfolioId) => requestNoContent(
|
|
997
940
|
configuration,
|
|
998
941
|
dependencies,
|
|
999
|
-
`/v1/portfolios/${portfolioId}/
|
|
1000
|
-
{
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
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(
|
|
1006
975
|
configuration,
|
|
1007
976
|
dependencies,
|
|
1008
|
-
`/v1/
|
|
977
|
+
`/v1/teams/${teamId}/metrics/wip?${getMetricsAsOfDateQuery(asOfDate)}`,
|
|
1009
978
|
{ method: "GET" }
|
|
1010
|
-
)
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
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(
|
|
1015
1008
|
configuration,
|
|
1016
1009
|
dependencies,
|
|
1017
|
-
`/v1/
|
|
1010
|
+
`/v1/teams/${teamId}/metrics/totalWorkItemAge?${getMetricsAsOfDateQuery(asOfDate)}`,
|
|
1018
1011
|
{ method: "GET" }
|
|
1019
|
-
)
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
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(
|
|
1030
1099
|
configuration,
|
|
1031
1100
|
dependencies,
|
|
1032
|
-
`/v1/portfolios/${portfolioId}/metrics/
|
|
1101
|
+
`/v1/portfolios/${portfolioId}/metrics/wip?${getMetricsAsOfDateQuery(asOfDate)}`,
|
|
1033
1102
|
{ method: "GET" }
|
|
1034
|
-
)
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
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(
|
|
1039
1123
|
configuration,
|
|
1040
1124
|
dependencies,
|
|
1041
|
-
`/v1/portfolios/${portfolioId}/metrics/
|
|
1125
|
+
`/v1/portfolios/${portfolioId}/metrics/totalWorkItemAge?${getMetricsAsOfDateQuery(asOfDate)}`,
|
|
1042
1126
|
{ method: "GET" }
|
|
1043
|
-
)
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
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(
|
|
1054
1274
|
configuration,
|
|
1055
1275
|
dependencies,
|
|
1056
|
-
`/v1/
|
|
1276
|
+
`/v1/features/${featureId}/workitems`,
|
|
1057
1277
|
{ method: "GET" }
|
|
1058
|
-
)
|
|
1059
|
-
|
|
1060
|
-
getPortfolioWorkItemAgeOverTime: async (portfolioId, range) => {
|
|
1061
|
-
const r = getResolvedMetricsDateRange(range);
|
|
1062
|
-
const wipResult = await requestJson(
|
|
1278
|
+
),
|
|
1279
|
+
listDeliveries: async (portfolioId) => requestJson(
|
|
1063
1280
|
configuration,
|
|
1064
1281
|
dependencies,
|
|
1065
|
-
`/v1/
|
|
1282
|
+
`/v1/deliveries/portfolio/${portfolioId}`,
|
|
1066
1283
|
{ method: "GET" }
|
|
1067
|
-
)
|
|
1068
|
-
|
|
1069
|
-
return wipResult;
|
|
1070
|
-
}
|
|
1071
|
-
return {
|
|
1072
|
-
ok: true,
|
|
1073
|
-
value: deriveWorkItemAgeOverTime(r.startDate, r.endDate, wipResult.value)
|
|
1074
|
-
};
|
|
1075
|
-
},
|
|
1076
|
-
getPortfolioTotalWorkItemAgeOverTime: async (portfolioId, range) => {
|
|
1077
|
-
const r = getResolvedMetricsDateRange(range);
|
|
1078
|
-
const wipResult = await requestJson(
|
|
1284
|
+
),
|
|
1285
|
+
createDelivery: async (portfolioId, payload) => requestJson(
|
|
1079
1286
|
configuration,
|
|
1080
1287
|
dependencies,
|
|
1081
|
-
`/v1/
|
|
1082
|
-
{ method: "
|
|
1083
|
-
)
|
|
1084
|
-
|
|
1085
|
-
return wipResult;
|
|
1086
|
-
}
|
|
1087
|
-
return {
|
|
1088
|
-
ok: true,
|
|
1089
|
-
value: deriveTotalWorkItemAgeOverTime(
|
|
1090
|
-
r.startDate,
|
|
1091
|
-
r.endDate,
|
|
1092
|
-
wipResult.value
|
|
1093
|
-
)
|
|
1094
|
-
};
|
|
1095
|
-
},
|
|
1096
|
-
getFeaturesByIds: async (ids) => {
|
|
1097
|
-
const queryString = ids.map((id) => `ids=${encodeURIComponent(id)}`).join("&");
|
|
1098
|
-
return requestJson(
|
|
1288
|
+
`/v1/deliveries/portfolio/${portfolioId}`,
|
|
1289
|
+
{ method: "POST", body: payload }
|
|
1290
|
+
),
|
|
1291
|
+
updateDelivery: async (deliveryId, payload) => requestJson(
|
|
1099
1292
|
configuration,
|
|
1100
1293
|
dependencies,
|
|
1101
|
-
`/v1/
|
|
1102
|
-
{ method: "
|
|
1103
|
-
)
|
|
1104
|
-
|
|
1105
|
-
getFeaturesByReferences: async (refs) => {
|
|
1106
|
-
const queryString = refs.map((r) => `featureReferences=${encodeURIComponent(r)}`).join("&");
|
|
1107
|
-
return requestJson(
|
|
1294
|
+
`/v1/deliveries/${deliveryId}`,
|
|
1295
|
+
{ method: "PUT", body: payload }
|
|
1296
|
+
),
|
|
1297
|
+
deleteDelivery: async (deliveryId) => requestNoContent(
|
|
1108
1298
|
configuration,
|
|
1109
1299
|
dependencies,
|
|
1110
|
-
`/v1/
|
|
1111
|
-
{ method: "
|
|
1112
|
-
)
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
configuration,
|
|
1128
|
-
dependencies,
|
|
1129
|
-
`/v1/deliveries/portfolio/${portfolioId}`,
|
|
1130
|
-
{ method: "POST", body: payload }
|
|
1131
|
-
),
|
|
1132
|
-
updateDelivery: async (deliveryId, payload) => requestJson(
|
|
1133
|
-
configuration,
|
|
1134
|
-
dependencies,
|
|
1135
|
-
`/v1/deliveries/${deliveryId}`,
|
|
1136
|
-
{ method: "PUT", body: payload }
|
|
1137
|
-
),
|
|
1138
|
-
deleteDelivery: async (deliveryId) => requestNoContent(
|
|
1139
|
-
configuration,
|
|
1140
|
-
dependencies,
|
|
1141
|
-
`/v1/deliveries/${deliveryId}`,
|
|
1142
|
-
{ method: "DELETE" }
|
|
1143
|
-
),
|
|
1144
|
-
runManualForecast: async (teamId, payload) => requestJson(
|
|
1145
|
-
configuration,
|
|
1146
|
-
dependencies,
|
|
1147
|
-
`/v1/forecast/manual/${teamId}`,
|
|
1148
|
-
{ method: "POST", body: payload }
|
|
1149
|
-
),
|
|
1150
|
-
runBacktest: async (teamId, payload) => requestJson(
|
|
1151
|
-
configuration,
|
|
1152
|
-
dependencies,
|
|
1153
|
-
`/v1/forecast/backtest/${teamId}`,
|
|
1154
|
-
{ method: "POST", body: payload }
|
|
1155
|
-
)
|
|
1156
|
-
});
|
|
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
|
+
};
|
|
1157
1317
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1158
1318
|
0 && (module.exports = {
|
|
1159
1319
|
createLighthouseAuthContext,
|
|
@@ -1161,6 +1321,7 @@ var createLighthouseClient = (configuration, dependencies = {}) => ({
|
|
|
1161
1321
|
getClientPackageContract,
|
|
1162
1322
|
getDefaultMetricsDateRange,
|
|
1163
1323
|
getStandaloneDiscoveryLockfilePath,
|
|
1324
|
+
isServerVersionNewerThan,
|
|
1164
1325
|
loadStandaloneDiscoveryContract,
|
|
1165
1326
|
parseStandaloneDiscoveryContract,
|
|
1166
1327
|
pollCliAuthSession,
|