@rockcarver/frodo-cli 3.0.6 → 3.0.7
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/CHANGELOG.md +9 -1
- package/dist/app.cjs +131 -89
- package/dist/app.cjs.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- log fetch now repects the log API request limit (1 per second)
|
|
13
|
+
- log fetch and log tail default to ALL levels by default
|
|
14
|
+
|
|
15
|
+
## [3.0.6] - 2025-06-18
|
|
16
|
+
|
|
10
17
|
## [3.0.5] - 2025-04-07
|
|
11
18
|
|
|
12
19
|
### Fixed
|
|
@@ -2073,7 +2080,8 @@ Frodo CLI 2.x automatically refreshes session and access tokens before they expi
|
|
|
2073
2080
|
- Fixed problem with adding connection profiles
|
|
2074
2081
|
- Miscellaneous bug fixes
|
|
2075
2082
|
|
|
2076
|
-
[unreleased]: https://github.com/rockcarver/frodo-cli/compare/v3.0.
|
|
2083
|
+
[unreleased]: https://github.com/rockcarver/frodo-cli/compare/v3.0.6...HEAD
|
|
2084
|
+
[3.0.6]: https://github.com/rockcarver/frodo-cli/compare/v3.0.5...v3.0.6
|
|
2077
2085
|
[3.0.5]: https://github.com/rockcarver/frodo-cli/compare/v3.0.4...v3.0.5
|
|
2078
2086
|
[3.0.4]: https://github.com/rockcarver/frodo-cli/compare/v3.0.4-1...v3.0.4
|
|
2079
2087
|
[3.0.4-1]: https://github.com/rockcarver/frodo-cli/compare/v3.0.4-0...v3.0.4-1
|
package/dist/app.cjs
CHANGED
|
@@ -106883,7 +106883,7 @@ function stringify(obj) {
|
|
|
106883
106883
|
}
|
|
106884
106884
|
var package_default = {
|
|
106885
106885
|
name: "@rockcarver/frodo-lib",
|
|
106886
|
-
version: "3.3.
|
|
106886
|
+
version: "3.3.1",
|
|
106887
106887
|
type: "commonjs",
|
|
106888
106888
|
main: "./dist/index.js",
|
|
106889
106889
|
module: "./dist/index.mjs",
|
|
@@ -124661,6 +124661,26 @@ function generateLogApi({
|
|
|
124661
124661
|
requestOverride
|
|
124662
124662
|
);
|
|
124663
124663
|
const request = createAxiosInstance(state2, requestConfig);
|
|
124664
|
+
request.interceptors.response.use(
|
|
124665
|
+
(response) => {
|
|
124666
|
+
return response;
|
|
124667
|
+
},
|
|
124668
|
+
async (error2) => {
|
|
124669
|
+
const originalRequest = error2.config;
|
|
124670
|
+
const status = error2.response ? error2.response.status : null;
|
|
124671
|
+
if (status === 429 && error2.response.headers["retry-after"] && !originalRequest._retry) {
|
|
124672
|
+
originalRequest._retry = true;
|
|
124673
|
+
const retryAfterSeconds = parseInt(
|
|
124674
|
+
error2.response.headers["retry-after"],
|
|
124675
|
+
10
|
|
124676
|
+
);
|
|
124677
|
+
const delayMs = (retryAfterSeconds + 1) * 1e3;
|
|
124678
|
+
await new Promise((resolve52) => setTimeout(resolve52, delayMs));
|
|
124679
|
+
return request(originalRequest);
|
|
124680
|
+
}
|
|
124681
|
+
return Promise.reject(error2);
|
|
124682
|
+
}
|
|
124683
|
+
);
|
|
124664
124684
|
if (state2.getCurlirize()) {
|
|
124665
124685
|
curlirize(request, state2);
|
|
124666
124686
|
}
|
|
@@ -143780,7 +143800,7 @@ async function getEsvCount2({
|
|
|
143780
143800
|
}
|
|
143781
143801
|
}
|
|
143782
143802
|
var logsTailURLTemplate = "%s/monitoring/logs/tail?source=%s";
|
|
143783
|
-
var logsFetchURLTemplate = "%s/monitoring/logs?source=%s
|
|
143803
|
+
var logsFetchURLTemplate = "%s/monitoring/logs?source=%s";
|
|
143784
143804
|
var logsSourcesURLTemplate = "%s/monitoring/logs/sources";
|
|
143785
143805
|
var logsCreateAPIKeyAndSecretURLTemplate = "%s/keys?_action=create";
|
|
143786
143806
|
var logsGetAPIKeysURLTemplate = "%s/keys";
|
|
@@ -143887,15 +143907,25 @@ async function fetch2({
|
|
|
143887
143907
|
startTs,
|
|
143888
143908
|
endTs,
|
|
143889
143909
|
cookie,
|
|
143910
|
+
txid,
|
|
143911
|
+
filter: filter2,
|
|
143890
143912
|
state: state2
|
|
143891
143913
|
}) {
|
|
143892
143914
|
let urlString = _util2.default.format(
|
|
143893
143915
|
logsFetchURLTemplate,
|
|
143894
143916
|
getHostOnlyUrl(state2.getHost()),
|
|
143895
|
-
encodeURIComponent(source)
|
|
143896
|
-
startTs,
|
|
143897
|
-
endTs
|
|
143917
|
+
encodeURIComponent(source)
|
|
143898
143918
|
);
|
|
143919
|
+
if (startTs && endTs) {
|
|
143920
|
+
urlString += `&beginTime=${startTs}&endTime=${endTs}`;
|
|
143921
|
+
}
|
|
143922
|
+
if (txid) {
|
|
143923
|
+
urlString += `&transactionId=${txid}`;
|
|
143924
|
+
}
|
|
143925
|
+
if (filter2) {
|
|
143926
|
+
const filterParam = `_queryFilter=${filter2}`;
|
|
143927
|
+
urlString += `&${encodeURIComponent(filterParam)}`;
|
|
143928
|
+
}
|
|
143899
143929
|
if (cookie) {
|
|
143900
143930
|
urlString += `&_pagedResultsCookie=${encodeURIComponent(cookie)}`;
|
|
143901
143931
|
}
|
|
@@ -143940,8 +143970,8 @@ var LogOps_default = (state2) => {
|
|
|
143940
143970
|
tail(source, cookie) {
|
|
143941
143971
|
return tail2({ source, cookie, state: state2 });
|
|
143942
143972
|
},
|
|
143943
|
-
async fetch(source, startTs, endTs, cookie) {
|
|
143944
|
-
return fetch3({ source, startTs, endTs, cookie, state: state2 });
|
|
143973
|
+
async fetch(source, startTs, endTs, cookie, txid, filter2) {
|
|
143974
|
+
return fetch3({ source, startTs, endTs, cookie, txid, filter: filter2, state: state2 });
|
|
143945
143975
|
}
|
|
143946
143976
|
};
|
|
143947
143977
|
};
|
|
@@ -144260,10 +144290,12 @@ async function fetch3({
|
|
|
144260
144290
|
startTs,
|
|
144261
144291
|
endTs,
|
|
144262
144292
|
cookie,
|
|
144293
|
+
txid,
|
|
144294
|
+
filter: filter2,
|
|
144263
144295
|
state: state2
|
|
144264
144296
|
}) {
|
|
144265
144297
|
try {
|
|
144266
|
-
return fetch2({ source, startTs, endTs, cookie, state: state2 });
|
|
144298
|
+
return fetch2({ source, startTs, endTs, cookie, txid, filter: filter2, state: state2 });
|
|
144267
144299
|
} catch (error2) {
|
|
144268
144300
|
throw new FrodoError(`Error fetching logs`, error2);
|
|
144269
144301
|
}
|
|
@@ -169292,18 +169324,23 @@ async function tailLogs(source, levels, txid, cookie, nf) {
|
|
|
169292
169324
|
printError2(error2);
|
|
169293
169325
|
}
|
|
169294
169326
|
}
|
|
169295
|
-
async function fetchLogs(source, startTs, endTs, levels, txid, ffString, cookie, nf) {
|
|
169327
|
+
async function fetchLogs(source, startTs, endTs, levels, txid, filter2, ffString, cookie, nf) {
|
|
169296
169328
|
try {
|
|
169297
|
-
const logsObject = await fetch4(
|
|
169329
|
+
const logsObject = await fetch4(
|
|
169330
|
+
source,
|
|
169331
|
+
startTs,
|
|
169332
|
+
endTs,
|
|
169333
|
+
cookie,
|
|
169334
|
+
txid,
|
|
169335
|
+
filter2
|
|
169336
|
+
);
|
|
169298
169337
|
let filteredLogs = [];
|
|
169299
169338
|
const noiseFilter = nf == null ? getDefaultNoiseFilter3() : nf;
|
|
169300
169339
|
if (Array.isArray(logsObject.result)) {
|
|
169301
169340
|
filteredLogs = logsObject.result.filter(
|
|
169302
169341
|
(el) => !noiseFilter.includes(
|
|
169303
169342
|
el.payload.logger
|
|
169304
|
-
) && !noiseFilter.includes(el.type) && (levels[0] === "ALL" || levels.includes(resolvePayloadLevel2(el)))
|
|
169305
|
-
txid
|
|
169306
|
-
)]))
|
|
169343
|
+
) && !noiseFilter.includes(el.type) && (levels[0] === "ALL" || levels.includes(resolvePayloadLevel2(el)))
|
|
169307
169344
|
);
|
|
169308
169345
|
}
|
|
169309
169346
|
filteredLogs.forEach((e) => {
|
|
@@ -169317,12 +169354,14 @@ async function fetchLogs(source, startTs, endTs, levels, txid, ffString, cookie,
|
|
|
169317
169354
|
}
|
|
169318
169355
|
});
|
|
169319
169356
|
if (logsObject.pagedResultsCookie != null) {
|
|
169357
|
+
await new Promise((resolve7) => setTimeout(resolve7, 1e3));
|
|
169320
169358
|
await fetchLogs(
|
|
169321
169359
|
source,
|
|
169322
169360
|
startTs,
|
|
169323
169361
|
endTs,
|
|
169324
169362
|
levels,
|
|
169325
169363
|
txid,
|
|
169364
|
+
filter2,
|
|
169326
169365
|
ffString,
|
|
169327
169366
|
logsObject.pagedResultsCookie,
|
|
169328
169367
|
nf
|
|
@@ -169455,9 +169494,9 @@ function setup79() {
|
|
|
169455
169494
|
`Created log API key ${creds.api_key_id} and secret.`
|
|
169456
169495
|
);
|
|
169457
169496
|
} catch (error2) {
|
|
169458
|
-
printMessage2(_optionalChain([error2, 'access',
|
|
169497
|
+
printMessage2(_optionalChain([error2, 'access', _382 => _382.response, 'optionalAccess', _383 => _383.data]), "error");
|
|
169459
169498
|
printMessage2(
|
|
169460
|
-
`Error creating log API key and secret: ${_optionalChain([error2, 'access',
|
|
169499
|
+
`Error creating log API key and secret: ${_optionalChain([error2, 'access', _384 => _384.response, 'optionalAccess', _385 => _385.data, 'optionalAccess', _386 => _386.message])}`,
|
|
169461
169500
|
"error"
|
|
169462
169501
|
);
|
|
169463
169502
|
process.exitCode = 1;
|
|
@@ -170163,7 +170202,7 @@ function setup86() {
|
|
|
170163
170202
|
printMessage2(updatesTable.toString(), "data");
|
|
170164
170203
|
}
|
|
170165
170204
|
if (!options.checkOnly) {
|
|
170166
|
-
if (_optionalChain([updates, 'access',
|
|
170205
|
+
if (_optionalChain([updates, 'access', _387 => _387.secrets, 'optionalAccess', _388 => _388.length]) || _optionalChain([updates, 'access', _389 => _389.variables, 'optionalAccess', _390 => _390.length]) || options.force) {
|
|
170167
170206
|
const ok = options.yes || await (0, import_yesno.default)({
|
|
170168
170207
|
question: `
|
|
170169
170208
|
Changes may take up to 10 minutes to propagate, during which time you will not be able to make further updates.
|
|
@@ -173872,7 +173911,7 @@ function getNodeClassificationMd(nodeType) {
|
|
|
173872
173911
|
function getOneLineDescription5(nodeObj, nodeRef) {
|
|
173873
173912
|
const description = `[${nodeObj._id["brightCyan"]}] (${getNodeClassification2(
|
|
173874
173913
|
nodeObj._type._id
|
|
173875
|
-
).join(", ")}) ${nodeObj._type._id}${nodeRef ? " - " + _optionalChain([nodeRef, 'optionalAccess',
|
|
173914
|
+
).join(", ")}) ${nodeObj._type._id}${nodeRef ? " - " + _optionalChain([nodeRef, 'optionalAccess', _391 => _391.displayName]) : ""}`;
|
|
173876
173915
|
return description;
|
|
173877
173916
|
}
|
|
173878
173917
|
function getTableHeaderMd5() {
|
|
@@ -174608,7 +174647,7 @@ async function listJourneys(long = false, analyze = false) {
|
|
|
174608
174647
|
table.push([
|
|
174609
174648
|
`${journeyStub._id}`,
|
|
174610
174649
|
journeyStub.enabled === false ? "disabled"["brightRed"] : "enabled"["brightGreen"],
|
|
174611
|
-
_optionalChain([journeyStub, 'access',
|
|
174650
|
+
_optionalChain([journeyStub, 'access', _392 => _392.uiConfig, 'optionalAccess', _393 => _393.categories]) ? wordwrap(
|
|
174612
174651
|
JSON.parse(journeyStub.uiConfig.categories).join(", "),
|
|
174613
174652
|
60
|
|
174614
174653
|
) : ""
|
|
@@ -174650,7 +174689,7 @@ async function listJourneys(long = false, analyze = false) {
|
|
|
174650
174689
|
`${journeyExport.tree._id}`,
|
|
174651
174690
|
journeyExport.tree.enabled === false ? "disabled"["brightRed"] : "enabled"["brightGreen"],
|
|
174652
174691
|
getJourneyClassification2(journeyExport).join(", "),
|
|
174653
|
-
_optionalChain([journeyExport, 'access',
|
|
174692
|
+
_optionalChain([journeyExport, 'access', _394 => _394.tree, 'access', _395 => _395.uiConfig, 'optionalAccess', _396 => _396.categories]) ? wordwrap(
|
|
174654
174693
|
JSON.parse(journeyExport.tree.uiConfig.categories).join(
|
|
174655
174694
|
", "
|
|
174656
174695
|
),
|
|
@@ -175062,7 +175101,7 @@ async function describeJourney(journeyData, resolveTreeExport = onlineTreeExport
|
|
|
175062
175101
|
nodeTypeMap[nodeData._type._id] = 1;
|
|
175063
175102
|
}
|
|
175064
175103
|
}
|
|
175065
|
-
if (!state.getAmVersion() && _optionalChain([journeyData, 'access',
|
|
175104
|
+
if (!state.getAmVersion() && _optionalChain([journeyData, 'access', _397 => _397.meta, 'optionalAccess', _398 => _398.originAmVersion])) {
|
|
175066
175105
|
state.setAmVersion(journeyData.meta.originAmVersion);
|
|
175067
175106
|
}
|
|
175068
175107
|
printMessage2(`${getOneLineDescription8(journeyData.tree)}`, "data");
|
|
@@ -175086,7 +175125,7 @@ ${getJourneyClassification2(journeyData).join(", ")}`,
|
|
|
175086
175125
|
"data"
|
|
175087
175126
|
);
|
|
175088
175127
|
}
|
|
175089
|
-
if (_optionalChain([journeyData, 'access',
|
|
175128
|
+
if (_optionalChain([journeyData, 'access', _399 => _399.tree, 'access', _400 => _400.uiConfig, 'optionalAccess', _401 => _401.categories]) && journeyData.tree.uiConfig.categories != "[]") {
|
|
175090
175129
|
printMessage2("\nCategories/Tags", "data");
|
|
175091
175130
|
printMessage2(
|
|
175092
175131
|
`${JSON.parse(journeyData.tree.uiConfig.categories).join(", ")}`,
|
|
@@ -175128,7 +175167,7 @@ Nodes (${Object.entries(allNodes).length}):`, "data");
|
|
|
175128
175167
|
);
|
|
175129
175168
|
}
|
|
175130
175169
|
}
|
|
175131
|
-
if (_optionalChain([journeyData, 'access',
|
|
175170
|
+
if (_optionalChain([journeyData, 'access', _402 => _402.themes, 'optionalAccess', _403 => _403.length])) {
|
|
175132
175171
|
printMessage2(`
|
|
175133
175172
|
Themes (${journeyData.themes.length}):`, "data");
|
|
175134
175173
|
for (const themeData of journeyData.themes) {
|
|
@@ -175222,14 +175261,14 @@ async function describeJourneyMd(journeyData, resolveTreeExport = onlineTreeExpo
|
|
|
175222
175261
|
nodeTypeMap[nodeData._type._id] = 1;
|
|
175223
175262
|
}
|
|
175224
175263
|
}
|
|
175225
|
-
if (!state.getAmVersion() && _optionalChain([journeyData, 'access',
|
|
175264
|
+
if (!state.getAmVersion() && _optionalChain([journeyData, 'access', _404 => _404.meta, 'optionalAccess', _405 => _405.originAmVersion])) {
|
|
175226
175265
|
state.setAmVersion(journeyData.meta.originAmVersion);
|
|
175227
175266
|
}
|
|
175228
175267
|
printMessage2(
|
|
175229
175268
|
`# ${getOneLineDescriptionMd(journeyData.tree)} - ${journeyData.tree.enabled === false ? ":o: `disabled`" : ":white_check_mark: `enabled`"}, ${getJourneyClassificationMd(journeyData).join(", ")}`,
|
|
175230
175269
|
"data"
|
|
175231
175270
|
);
|
|
175232
|
-
if (_optionalChain([journeyData, 'access',
|
|
175271
|
+
if (_optionalChain([journeyData, 'access', _406 => _406.tree, 'access', _407 => _407.uiConfig, 'optionalAccess', _408 => _408.categories]) && journeyData.tree.uiConfig.categories != "[]") {
|
|
175233
175272
|
printMessage2(
|
|
175234
175273
|
`\`${JSON.parse(journeyData.tree.uiConfig.categories).join("`, `")}\``,
|
|
175235
175274
|
"data"
|
|
@@ -175273,7 +175312,7 @@ ${journeyData.tree.description}`, "data");
|
|
|
175273
175312
|
);
|
|
175274
175313
|
}
|
|
175275
175314
|
}
|
|
175276
|
-
if (_optionalChain([journeyData, 'access',
|
|
175315
|
+
if (_optionalChain([journeyData, 'access', _409 => _409.themes, 'optionalAccess', _410 => _410.length])) {
|
|
175277
175316
|
printMessage2(`## Themes (${journeyData.themes.length})`, "data");
|
|
175278
175317
|
printMessage2(getTableHeaderMd7(), "data");
|
|
175279
175318
|
for (const themeData of journeyData.themes) {
|
|
@@ -175546,9 +175585,9 @@ function setup127() {
|
|
|
175546
175585
|
journeyData = fileData.trees[options.journeyId];
|
|
175547
175586
|
} else if (typeof options.journeyId === "undefined" && fileData.trees) {
|
|
175548
175587
|
[journeyData] = Object.values(fileData.trees);
|
|
175549
|
-
} else if (typeof options.journeyId !== "undefined" && options.journeyId === _optionalChain([fileData, 'access',
|
|
175588
|
+
} else if (typeof options.journeyId !== "undefined" && options.journeyId === _optionalChain([fileData, 'access', _411 => _411.tree, 'optionalAccess', _412 => _412._id])) {
|
|
175550
175589
|
journeyData = fileData;
|
|
175551
|
-
} else if (typeof options.journeyId === "undefined" && _optionalChain([fileData, 'access',
|
|
175590
|
+
} else if (typeof options.journeyId === "undefined" && _optionalChain([fileData, 'access', _413 => _413.tree, 'optionalAccess', _414 => _414._id])) {
|
|
175552
175591
|
journeyData = fileData;
|
|
175553
175592
|
} else {
|
|
175554
175593
|
throw new Error(
|
|
@@ -175985,7 +176024,6 @@ var { getConnectionProfile: getConnectionProfile2, saveConnectionProfile: saveCo
|
|
|
175985
176024
|
var SECONDS_IN_30_DAYS = 2592e3;
|
|
175986
176025
|
var SECONDS_IN_1_HOUR = 3600;
|
|
175987
176026
|
var LOG_TIME_WINDOW_MAX = SECONDS_IN_30_DAYS;
|
|
175988
|
-
var LOG_TIME_WINDOW_INCREMENT = 1;
|
|
175989
176027
|
var deploymentTypes48 = ["cloud"];
|
|
175990
176028
|
function setup135() {
|
|
175991
176029
|
const program2 = new FrodoCommand(
|
|
@@ -175999,9 +176037,14 @@ function setup135() {
|
|
|
175999
176037
|
new Option(
|
|
176000
176038
|
"-l, --level <level>",
|
|
176001
176039
|
"Set log level filter. You can specify the level as a number or a string. Following values are possible (values on the same line are equivalent): \n0, SEVERE, FATAL, or ERROR\n1, WARNING, WARN or CONFIG \n2, INFO or INFORMATION\n3, DEBUG, FINE, FINER or FINEST \n4 or ALL"
|
|
176002
|
-
).default("
|
|
176040
|
+
).default("ALL", `${resolveLevel2("ALL")}`)
|
|
176003
176041
|
).addOption(
|
|
176004
176042
|
new Option("-t, --transaction-id <txid>", "Filter by transactionId")
|
|
176043
|
+
).addOption(
|
|
176044
|
+
new Option(
|
|
176045
|
+
"-f, --query-filter <filter exp>",
|
|
176046
|
+
"Filter using a query expression"
|
|
176047
|
+
)
|
|
176005
176048
|
).addOption(
|
|
176006
176049
|
new Option(
|
|
176007
176050
|
"-b, --begin-timestamp <beginTs>",
|
|
@@ -176063,65 +176106,64 @@ function setup135() {
|
|
|
176063
176106
|
if (foundCredentials) {
|
|
176064
176107
|
const now = Date.now() / 1e3;
|
|
176065
176108
|
const nowString = new Date(now * 1e3).toISOString();
|
|
176066
|
-
|
|
176067
|
-
|
|
176068
|
-
|
|
176069
|
-
|
|
176070
|
-
|
|
176071
|
-
|
|
176072
|
-
options.
|
|
176073
|
-
|
|
176074
|
-
|
|
176075
|
-
|
|
176076
|
-
|
|
176077
|
-
|
|
176078
|
-
|
|
176079
|
-
|
|
176080
|
-
|
|
176081
|
-
|
|
176082
|
-
|
|
176083
|
-
|
|
176084
|
-
|
|
176085
|
-
|
|
176086
|
-
|
|
176087
|
-
|
|
176088
|
-
|
|
176089
|
-
|
|
176090
|
-
|
|
176091
|
-
);
|
|
176092
|
-
|
|
176093
|
-
|
|
176094
|
-
|
|
176095
|
-
|
|
176096
|
-
|
|
176097
|
-
|
|
176098
|
-
|
|
176099
|
-
|
|
176100
|
-
|
|
176101
|
-
|
|
176109
|
+
let beginTs = -1;
|
|
176110
|
+
let endTs = -1;
|
|
176111
|
+
if ((typeof options.beginTimestamp === "undefined" || !options.beginTimestamp) && (typeof options.endTimestamp === "undefined" || !options.endTimestamp)) {
|
|
176112
|
+
beginTs = -1;
|
|
176113
|
+
endTs = -1;
|
|
176114
|
+
} else {
|
|
176115
|
+
if (typeof options.beginTimestamp === "undefined" || !options.beginTimestamp) {
|
|
176116
|
+
const tempStartDate = /* @__PURE__ */ new Date();
|
|
176117
|
+
tempStartDate.setTime((now - SECONDS_IN_1_HOUR) * 1e3);
|
|
176118
|
+
options.beginTimestamp = tempStartDate.toISOString();
|
|
176119
|
+
const tempEndDate = /* @__PURE__ */ new Date();
|
|
176120
|
+
tempEndDate.setTime(now * 1e3);
|
|
176121
|
+
options.endTimestamp = tempEndDate;
|
|
176122
|
+
printMessage2(
|
|
176123
|
+
"No begin timestamp specified, defaulting to logs from 1 hour ago",
|
|
176124
|
+
"info"
|
|
176125
|
+
);
|
|
176126
|
+
}
|
|
176127
|
+
if (typeof options.endTimestamp === "undefined" || !options.endTimestamp) {
|
|
176128
|
+
options.endTimestamp = nowString;
|
|
176129
|
+
printMessage2(
|
|
176130
|
+
'No end timestamp specified, defaulting end timestamp to "now"',
|
|
176131
|
+
"info"
|
|
176132
|
+
);
|
|
176133
|
+
}
|
|
176134
|
+
beginTs = Date.parse(options.beginTimestamp) / 1e3;
|
|
176135
|
+
endTs = Date.parse(options.endTimestamp) / 1e3;
|
|
176136
|
+
if (endTs < beginTs) {
|
|
176137
|
+
printMessage2(
|
|
176138
|
+
"End timestamp can not be before begin timestamp",
|
|
176139
|
+
"error"
|
|
176140
|
+
);
|
|
176141
|
+
process.exitCode = 1;
|
|
176142
|
+
return;
|
|
176143
|
+
}
|
|
176144
|
+
if (now - beginTs > LOG_TIME_WINDOW_MAX) {
|
|
176145
|
+
printMessage2(
|
|
176146
|
+
"Begin timestamp can not be more than 30 days in the past",
|
|
176147
|
+
"error"
|
|
176148
|
+
);
|
|
176149
|
+
process.exitCode = 1;
|
|
176150
|
+
return;
|
|
176151
|
+
}
|
|
176102
176152
|
}
|
|
176103
|
-
let intermediateEndTs = 0;
|
|
176104
176153
|
printMessage2(
|
|
176105
176154
|
`Fetching ID Cloud logs from the following sources: ${command.opts().sources} and levels [${resolveLevel2(command.opts().level)}] of ${conn.tenant}...`
|
|
176106
176155
|
);
|
|
176107
|
-
|
|
176108
|
-
|
|
176109
|
-
|
|
176110
|
-
|
|
176111
|
-
|
|
176112
|
-
|
|
176113
|
-
|
|
176114
|
-
|
|
176115
|
-
|
|
176116
|
-
|
|
176117
|
-
|
|
176118
|
-
command.opts().transactionId,
|
|
176119
|
-
command.opts().searchString,
|
|
176120
|
-
null,
|
|
176121
|
-
getNoiseFilters(options.defaults)
|
|
176122
|
-
);
|
|
176123
|
-
beginTs = intermediateEndTs;
|
|
176124
|
-
} while (intermediateEndTs < endTs);
|
|
176156
|
+
await fetchLogs(
|
|
176157
|
+
command.opts().sources,
|
|
176158
|
+
beginTs == -1 ? null : new Date(beginTs * 1e3).toISOString(),
|
|
176159
|
+
endTs == -1 ? null : new Date(endTs * 1e3).toISOString(),
|
|
176160
|
+
resolveLevel2(command.opts().level),
|
|
176161
|
+
command.opts().transactionId,
|
|
176162
|
+
command.opts().queryFilter,
|
|
176163
|
+
command.opts().searchString,
|
|
176164
|
+
null,
|
|
176165
|
+
getNoiseFilters(options.defaults)
|
|
176166
|
+
);
|
|
176125
176167
|
} else {
|
|
176126
176168
|
printMessage2("No log api credentials found!");
|
|
176127
176169
|
program2.help();
|
|
@@ -176360,7 +176402,7 @@ function setup141() {
|
|
|
176360
176402
|
new Option(
|
|
176361
176403
|
"-l, --level <level>",
|
|
176362
176404
|
"Set log level filter. You can specify the level as a number or a string. Following values are possible (values on the same line are equivalent): \n0, SEVERE, FATAL, or ERROR\n1, WARNING, WARN or CONFIG \n2, INFO or INFORMATION\n3, DEBUG, FINE, FINER or FINEST \n4 or ALL"
|
|
176363
|
-
).default("
|
|
176405
|
+
).default("ALL", `${resolveLevel3("ALL")}`)
|
|
176364
176406
|
).addOption(
|
|
176365
176407
|
new Option("-t, --transaction-id <txid>", "Filter by transactionId")
|
|
176366
176408
|
).addOption(
|
|
@@ -177424,7 +177466,7 @@ async function importServiceFromFile(serviceId, file, options = {
|
|
|
177424
177466
|
);
|
|
177425
177467
|
const data2 = fs35.default.readFileSync(filePath, "utf8");
|
|
177426
177468
|
const importData = JSON.parse(data2);
|
|
177427
|
-
if (_optionalChain([importData, 'optionalAccess',
|
|
177469
|
+
if (_optionalChain([importData, 'optionalAccess', _415 => _415.service, 'access', _416 => _416[serviceId]])) {
|
|
177428
177470
|
await importService2(serviceId, importData, options);
|
|
177429
177471
|
stopProgressIndicator2(
|
|
177430
177472
|
indicatorId,
|
|
@@ -178641,7 +178683,7 @@ async function listRealms(long = false) {
|
|
|
178641
178683
|
} catch (error2) {
|
|
178642
178684
|
printMessage2(error2, "error");
|
|
178643
178685
|
printMessage2(`Error listing realms: ${error2.message}`, "error");
|
|
178644
|
-
printMessage2(_optionalChain([error2, 'access',
|
|
178686
|
+
printMessage2(_optionalChain([error2, 'access', _417 => _417.response, 'optionalAccess', _418 => _418.data]), "error");
|
|
178645
178687
|
}
|
|
178646
178688
|
}
|
|
178647
178689
|
async function exportRealmById(realmId, file, includeMeta = true) {
|
|
@@ -181438,7 +181480,7 @@ var compareVersions = (v12, v2) => {
|
|
|
181438
181480
|
// package.json
|
|
181439
181481
|
var package_default2 = {
|
|
181440
181482
|
name: "@rockcarver/frodo-cli",
|
|
181441
|
-
version: "3.0.
|
|
181483
|
+
version: "3.0.7",
|
|
181442
181484
|
type: "module",
|
|
181443
181485
|
description: "A command line interface to manage ForgeRock Identity Cloud tenants, ForgeOps deployments, and classic deployments.",
|
|
181444
181486
|
keywords: [
|
|
@@ -181553,7 +181595,7 @@ var package_default2 = {
|
|
|
181553
181595
|
]
|
|
181554
181596
|
},
|
|
181555
181597
|
devDependencies: {
|
|
181556
|
-
"@rockcarver/frodo-lib": "3.3.
|
|
181598
|
+
"@rockcarver/frodo-lib": "3.3.1",
|
|
181557
181599
|
"@types/colors": "^1.2.1",
|
|
181558
181600
|
"@types/fs-extra": "^11.0.1",
|
|
181559
181601
|
"@types/jest": "^29.2.3",
|