@rockcarver/frodo-cli 4.0.0 → 4.0.1-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/CHANGELOG.md +4 -1
- package/dist/app.cjs +813 -596
- package/dist/app.cjs.map +1 -1
- package/package.json +6 -2
package/dist/app.cjs
CHANGED
|
@@ -156058,7 +156058,7 @@ function stringify(obj) {
|
|
|
156058
156058
|
}
|
|
156059
156059
|
var package_default = {
|
|
156060
156060
|
name: "@rockcarver/frodo-lib",
|
|
156061
|
-
version: "4.0.
|
|
156061
|
+
version: "4.0.1-6",
|
|
156062
156062
|
type: "commonjs",
|
|
156063
156063
|
main: "./dist/index.js",
|
|
156064
156064
|
module: "./dist/index.mjs",
|
|
@@ -177317,8 +177317,8 @@ var ScriptOps_default = (state2) => {
|
|
|
177317
177317
|
createScriptExportTemplate() {
|
|
177318
177318
|
return createScriptExportTemplate({ state: state2 });
|
|
177319
177319
|
},
|
|
177320
|
-
async readScripts() {
|
|
177321
|
-
return readScripts({ state: state2 });
|
|
177320
|
+
async readScripts(filter2) {
|
|
177321
|
+
return readScripts({ filter: filter2, state: state2 });
|
|
177322
177322
|
},
|
|
177323
177323
|
getLibraryScriptNames(scriptObj) {
|
|
177324
177324
|
return getLibraryScriptNames(scriptObj);
|
|
@@ -177341,8 +177341,8 @@ var ScriptOps_default = (state2) => {
|
|
|
177341
177341
|
async deleteScriptByName(scriptName) {
|
|
177342
177342
|
return deleteScriptByName2({ scriptName, state: state2 });
|
|
177343
177343
|
},
|
|
177344
|
-
async deleteScripts(resultCallback
|
|
177345
|
-
return deleteScripts({ resultCallback, state: state2 });
|
|
177344
|
+
async deleteScripts(resultCallback, filter2) {
|
|
177345
|
+
return deleteScripts({ filter: filter2, resultCallback, state: state2 });
|
|
177346
177346
|
},
|
|
177347
177347
|
async exportScript(scriptId, options = {
|
|
177348
177348
|
deps: true,
|
|
@@ -177391,11 +177391,12 @@ function createScriptExportTemplate({
|
|
|
177391
177391
|
};
|
|
177392
177392
|
}
|
|
177393
177393
|
async function readScripts({
|
|
177394
|
+
filter: filter2,
|
|
177394
177395
|
state: state2
|
|
177395
177396
|
}) {
|
|
177396
177397
|
try {
|
|
177397
177398
|
const { result } = await getScripts({ state: state2 });
|
|
177398
|
-
return result;
|
|
177399
|
+
return applyScriptFilter(result, filter2);
|
|
177399
177400
|
} catch (error49) {
|
|
177400
177401
|
throw new FrodoError(
|
|
177401
177402
|
`Error reading ${getCurrentRealmName(state2) + " realm"} scripts`,
|
|
@@ -177571,10 +177572,11 @@ async function deleteScriptByName2({
|
|
|
177571
177572
|
}
|
|
177572
177573
|
}
|
|
177573
177574
|
async function deleteScripts({
|
|
177574
|
-
|
|
177575
|
+
filter: filter2,
|
|
177576
|
+
resultCallback,
|
|
177575
177577
|
state: state2
|
|
177576
177578
|
}) {
|
|
177577
|
-
const result = await readScripts({ state: state2 });
|
|
177579
|
+
const result = await readScripts({ filter: filter2, state: state2 });
|
|
177578
177580
|
const scripts = result.filter((s4) => !s4.default);
|
|
177579
177581
|
const deletedScripts = [];
|
|
177580
177582
|
for (const script of scripts) {
|
|
@@ -177646,8 +177648,8 @@ async function exportScripts({
|
|
|
177646
177648
|
resultCallback = void 0,
|
|
177647
177649
|
state: state2
|
|
177648
177650
|
}) {
|
|
177649
|
-
const { includeDefault, useStringArrays } = options;
|
|
177650
|
-
let scriptList = await readScripts({ state: state2 });
|
|
177651
|
+
const { includeDefault, useStringArrays, filter: filter2 } = options;
|
|
177652
|
+
let scriptList = await readScripts({ filter: filter2, state: state2 });
|
|
177651
177653
|
if (!includeDefault)
|
|
177652
177654
|
scriptList = scriptList.filter((script) => !script.default);
|
|
177653
177655
|
const exportData = createScriptExportTemplate({ state: state2 });
|
|
@@ -177701,9 +177703,10 @@ async function importScripts2({
|
|
|
177701
177703
|
for (const existingId of Object.keys(importData.script)) {
|
|
177702
177704
|
try {
|
|
177703
177705
|
const scriptData = importData.script[existingId];
|
|
177706
|
+
const doesNotMatchFilter = options.filter && !matchesScriptFilter(scriptData, options.filter);
|
|
177704
177707
|
const isDefault = !options.includeDefault && scriptData.default;
|
|
177705
177708
|
const shouldNotImportScript = !options.deps && (scriptId && scriptId !== scriptData._id || !scriptId && scriptName && scriptName !== scriptData.name);
|
|
177706
|
-
if (isDefault || shouldNotImportScript) continue;
|
|
177709
|
+
if (isDefault || shouldNotImportScript || doesNotMatchFilter) continue;
|
|
177707
177710
|
debugMessage({
|
|
177708
177711
|
message: `ScriptOps.importScripts: Importing script ${scriptData.name} (${existingId})`,
|
|
177709
177712
|
state: state2
|
|
@@ -177747,6 +177750,54 @@ async function importScripts2({
|
|
|
177747
177750
|
debugMessage({ message: `ScriptOps.importScripts: end`, state: state2 });
|
|
177748
177751
|
return response;
|
|
177749
177752
|
}
|
|
177753
|
+
function applyScriptFilter(scripts, filter2) {
|
|
177754
|
+
if (!filter2) return scripts;
|
|
177755
|
+
return scripts.filter((script) => matchesScriptFilter(script, filter2));
|
|
177756
|
+
}
|
|
177757
|
+
function matchesScriptFilter(script, filter2) {
|
|
177758
|
+
if (!filter2) return true;
|
|
177759
|
+
if ("filters" in filter2) {
|
|
177760
|
+
const filters = _nullishCoalesce(filter2.filters, () => ( []));
|
|
177761
|
+
const operator = _nullishCoalesce(filter2.operator, () => ( "AND"));
|
|
177762
|
+
if (filters.length === 0) return true;
|
|
177763
|
+
return operator === "OR" ? filters.some(
|
|
177764
|
+
(nestedFilter) => matchesScriptFilter(script, nestedFilter)
|
|
177765
|
+
) : filters.every(
|
|
177766
|
+
(nestedFilter) => matchesScriptFilter(script, nestedFilter)
|
|
177767
|
+
);
|
|
177768
|
+
}
|
|
177769
|
+
const expectedValues = normalizeFilterValues(filter2.value);
|
|
177770
|
+
const actualValues = getScriptFilterValues(script, filter2.field);
|
|
177771
|
+
return actualValues.some(
|
|
177772
|
+
(actualValue) => expectedValues.includes(actualValue)
|
|
177773
|
+
);
|
|
177774
|
+
}
|
|
177775
|
+
function getScriptFilterValues(script, field) {
|
|
177776
|
+
const normalizedField = field.trim().toUpperCase();
|
|
177777
|
+
switch (normalizedField) {
|
|
177778
|
+
case "LANGUAGE":
|
|
177779
|
+
return normalizeFilterValues(script.language);
|
|
177780
|
+
case "CONTEXT":
|
|
177781
|
+
case "USE":
|
|
177782
|
+
return normalizeFilterValues(script.context);
|
|
177783
|
+
case "EVALUATORVERSION":
|
|
177784
|
+
return normalizeFilterValues(_nullishCoalesce(script.evaluatorVersion, () => ( "1.0")));
|
|
177785
|
+
default: {
|
|
177786
|
+
const rawValue = _optionalChain([Object, 'access', _177 => _177.entries, 'call', _178 => _178(script), 'access', _179 => _179.find, 'call', _180 => _180(
|
|
177787
|
+
([key]) => key.toUpperCase() === normalizedField
|
|
177788
|
+
), 'optionalAccess', _181 => _181[1]]);
|
|
177789
|
+
return normalizeFilterValues(rawValue);
|
|
177790
|
+
}
|
|
177791
|
+
}
|
|
177792
|
+
}
|
|
177793
|
+
function normalizeFilterValues(value) {
|
|
177794
|
+
if (Array.isArray(value)) {
|
|
177795
|
+
return value.flatMap((entry) => normalizeFilterValues(entry));
|
|
177796
|
+
}
|
|
177797
|
+
if (value === null || value === void 0) return [];
|
|
177798
|
+
const normalizedValue = String(value).trim().toUpperCase();
|
|
177799
|
+
return normalizedValue ? [normalizedValue] : [];
|
|
177800
|
+
}
|
|
177750
177801
|
async function prepareScriptExport({
|
|
177751
177802
|
scriptData,
|
|
177752
177803
|
options = {
|
|
@@ -177857,7 +177908,7 @@ async function readOAuth2Clients({
|
|
|
177857
177908
|
const clients = (await getOAuth2Clients({ state: state2 })).result;
|
|
177858
177909
|
return clients;
|
|
177859
177910
|
} catch (error49) {
|
|
177860
|
-
if (_optionalChain([error49, 'access',
|
|
177911
|
+
if (_optionalChain([error49, 'access', _182 => _182.response, 'optionalAccess', _183 => _183.status]) === 403 && _optionalChain([error49, 'access', _184 => _184.response, 'optionalAccess', _185 => _185.data, 'optionalAccess', _186 => _186.message]) === "This operation is not available in PingOne Advanced Identity Cloud.") {
|
|
177861
177912
|
return [];
|
|
177862
177913
|
} else {
|
|
177863
177914
|
throw new FrodoError(
|
|
@@ -177926,7 +177977,7 @@ async function updateOAuth2Client({
|
|
|
177926
177977
|
debugMessage({ message: `OAuth2ClientOps.putOAuth2Client: end`, state: state2 });
|
|
177927
177978
|
return response;
|
|
177928
177979
|
} catch (error49) {
|
|
177929
|
-
if (_optionalChain([error49, 'access',
|
|
177980
|
+
if (_optionalChain([error49, 'access', _187 => _187.response, 'optionalAccess', _188 => _188.status]) === 400 && _optionalChain([error49, 'access', _189 => _189.response, 'optionalAccess', _190 => _190.data, 'optionalAccess', _191 => _191.message]) === "Invalid attribute specified.") {
|
|
177930
177981
|
try {
|
|
177931
177982
|
const { validAttributes } = error49.response.data.detail;
|
|
177932
177983
|
sanitizeOAuth2ClientInvalidAttributes({
|
|
@@ -178710,7 +178761,7 @@ async function readOAuth2TrustedJwtIssuers({
|
|
|
178710
178761
|
const issuers = (await getOAuth2TrustedJwtIssuers({ state: state2 })).result;
|
|
178711
178762
|
return issuers;
|
|
178712
178763
|
} catch (error49) {
|
|
178713
|
-
if (_optionalChain([error49, 'access',
|
|
178764
|
+
if (_optionalChain([error49, 'access', _192 => _192.response, 'optionalAccess', _193 => _193.status]) === 403 && _optionalChain([error49, 'access', _194 => _194.response, 'optionalAccess', _195 => _195.data, 'optionalAccess', _196 => _196.message]) === "This operation is not available in PingOne Advanced Identity Cloud.") {
|
|
178714
178765
|
return [];
|
|
178715
178766
|
} else {
|
|
178716
178767
|
throw new FrodoError(
|
|
@@ -178788,7 +178839,7 @@ async function updateOAuth2TrustedJwtIssuer({
|
|
|
178788
178839
|
});
|
|
178789
178840
|
return response;
|
|
178790
178841
|
} catch (error49) {
|
|
178791
|
-
if (_optionalChain([error49, 'access',
|
|
178842
|
+
if (_optionalChain([error49, 'access', _197 => _197.response, 'optionalAccess', _198 => _198.status]) === 400 && _optionalChain([error49, 'access', _199 => _199.response, 'optionalAccess', _200 => _200.data, 'optionalAccess', _201 => _201.message]) === "Invalid attribute specified.") {
|
|
178792
178843
|
try {
|
|
178793
178844
|
const { validAttributes } = error49.response.data.detail;
|
|
178794
178845
|
validAttributes.push("_id");
|
|
@@ -180659,13 +180710,13 @@ async function countManagedObjects({
|
|
|
180659
180710
|
const { data: data2 } = await generateIdmApi({ requestOverride: {}, state: state2 }).get(
|
|
180660
180711
|
urlString
|
|
180661
180712
|
);
|
|
180662
|
-
if (typeof _optionalChain([data2, 'optionalAccess',
|
|
180713
|
+
if (typeof _optionalChain([data2, 'optionalAccess', _202 => _202.totalPagedResults]) === "number" && data2.totalPagedResults >= 0) {
|
|
180663
180714
|
return data2.totalPagedResults;
|
|
180664
180715
|
}
|
|
180665
|
-
if (typeof _optionalChain([data2, 'optionalAccess',
|
|
180716
|
+
if (typeof _optionalChain([data2, 'optionalAccess', _203 => _203.resultCount]) === "number" && data2.resultCount >= 0) {
|
|
180666
180717
|
return data2.resultCount;
|
|
180667
180718
|
}
|
|
180668
|
-
return Array.isArray(_optionalChain([data2, 'optionalAccess',
|
|
180719
|
+
return Array.isArray(_optionalChain([data2, 'optionalAccess', _204 => _204.result])) ? data2.result.length : 0;
|
|
180669
180720
|
}
|
|
180670
180721
|
async function queryAllManagedObjectsByType({
|
|
180671
180722
|
type,
|
|
@@ -180827,7 +180878,7 @@ async function readManagedObjectSchema({
|
|
|
180827
180878
|
if (options.excludeRelationships) {
|
|
180828
180879
|
for (const prop in schema.properties) {
|
|
180829
180880
|
if (schema.properties[prop]["type"] === "relationship" || schema.properties[prop]["type"] === "array" && schema.properties[prop]["items"] && schema.properties[prop]["items"]["type"] === "relationship") {
|
|
180830
|
-
const resourcePath = _optionalChain([schema, 'access',
|
|
180881
|
+
const resourcePath = _optionalChain([schema, 'access', _205 => _205.properties, 'access', _206 => _206[prop], 'access', _207 => _207["resourceCollection"], 'optionalAccess', _208 => _208[0], 'optionalAccess', _209 => _209["path"]]);
|
|
180831
180882
|
debugMessage({
|
|
180832
180883
|
message: `ManagedObjectOps.readManagedObjectSchema: Found relationship property "${prop}" with resource path "${resourcePath}" in schema for type "${type}"`,
|
|
180833
180884
|
state: state2
|
|
@@ -181448,7 +181499,7 @@ function sanitizeAIAgentPayload(agentData) {
|
|
|
181448
181499
|
return sanitized;
|
|
181449
181500
|
}
|
|
181450
181501
|
function isAlreadyExistsError(error49) {
|
|
181451
|
-
return _optionalChain([error49, 'optionalAccess',
|
|
181502
|
+
return _optionalChain([error49, 'optionalAccess', _210 => _210.httpStatus]) === 409 || _optionalChain([error49, 'optionalAccess', _211 => _211.httpStatus]) === 412 || _optionalChain([error49, 'optionalAccess', _212 => _212.response, 'optionalAccess', _213 => _213.status]) === 409 || _optionalChain([error49, 'optionalAccess', _214 => _214.response, 'optionalAccess', _215 => _215.status]) === 412;
|
|
181452
181503
|
}
|
|
181453
181504
|
var AgentTypeItemCache = [];
|
|
181454
181505
|
var AgentTypeBlacklist = ["OAuth2Client"];
|
|
@@ -181479,7 +181530,7 @@ async function readAgentTypes({
|
|
|
181479
181530
|
debugMessage({ message: `AgentOps.readAgentTypes: end`, state: state2 });
|
|
181480
181531
|
return agentTypeItems.map((item) => item._id);
|
|
181481
181532
|
} catch (error49) {
|
|
181482
|
-
if (_optionalChain([error49, 'access',
|
|
181533
|
+
if (_optionalChain([error49, 'access', _216 => _216.response, 'optionalAccess', _217 => _217.status]) === 403 && _optionalChain([error49, 'access', _218 => _218.response, 'optionalAccess', _219 => _219.data, 'optionalAccess', _220 => _220.message]) === "This operation is not available in PingOne Advanced Identity Cloud." || _optionalChain([error49, 'access', _221 => _221.response, 'optionalAccess', _222 => _222.status]) === 404) {
|
|
181483
181534
|
return [];
|
|
181484
181535
|
} else {
|
|
181485
181536
|
throw new FrodoError(
|
|
@@ -181514,7 +181565,7 @@ async function readAgents({
|
|
|
181514
181565
|
debugMessage({ message: `AgentOps.readAgents: end`, state: state2 });
|
|
181515
181566
|
return agents;
|
|
181516
181567
|
} catch (error49) {
|
|
181517
|
-
if (_optionalChain([error49, 'access',
|
|
181568
|
+
if (_optionalChain([error49, 'access', _223 => _223.response, 'optionalAccess', _224 => _224.status]) === 403 && _optionalChain([error49, 'access', _225 => _225.response, 'optionalAccess', _226 => _226.data, 'optionalAccess', _227 => _227.message]) === "This operation is not available in PingOne Advanced Identity Cloud." || _optionalChain([error49, 'access', _228 => _228.response, 'optionalAccess', _229 => _229.status]) === 404) {
|
|
181518
181569
|
return [];
|
|
181519
181570
|
} else {
|
|
181520
181571
|
throw new FrodoError(
|
|
@@ -181717,7 +181768,7 @@ async function importAgents({
|
|
|
181717
181768
|
})
|
|
181718
181769
|
);
|
|
181719
181770
|
} catch (error49) {
|
|
181720
|
-
if (error49.httpStatus !== 501 && _optionalChain([error49, 'access',
|
|
181771
|
+
if (error49.httpStatus !== 501 && _optionalChain([error49, 'access', _230 => _230.response, 'optionalAccess', _231 => _231.status]) !== 501) {
|
|
181721
181772
|
errors.push(
|
|
181722
181773
|
new FrodoError(
|
|
181723
181774
|
`Error importing ${getCurrentRealmName(state2) + " realm"} agent ${agentId} of type ${agentType}`,
|
|
@@ -181753,7 +181804,7 @@ async function importAgent({
|
|
|
181753
181804
|
}) {
|
|
181754
181805
|
try {
|
|
181755
181806
|
debugMessage({ message: `AgentOps.importAgent: start`, state: state2 });
|
|
181756
|
-
const agentType = _optionalChain([importData, 'access',
|
|
181807
|
+
const agentType = _optionalChain([importData, 'access', _232 => _232.agent, 'access', _233 => _233[agentId], 'optionalAccess', _234 => _234._type, 'access', _235 => _235._id]);
|
|
181757
181808
|
if (agentType === "SoapSTSAgent" && state2.getDeploymentType() !== Constants_default.CLASSIC_DEPLOYMENT_TYPE_KEY) {
|
|
181758
181809
|
throw new FrodoError(
|
|
181759
181810
|
`Can't import Soap STS agents for '${state2.getDeploymentType()}' deployment type.`
|
|
@@ -182126,7 +182177,7 @@ async function importIdentityGatewayAgent({
|
|
|
182126
182177
|
message: `AgentOps.importIdentityGatewayAgent: start`,
|
|
182127
182178
|
state: state2
|
|
182128
182179
|
});
|
|
182129
|
-
const agentType = _optionalChain([importData, 'access',
|
|
182180
|
+
const agentType = _optionalChain([importData, 'access', _236 => _236.agent, 'access', _237 => _237[agentId], 'optionalAccess', _238 => _238._type, 'access', _239 => _239._id]);
|
|
182130
182181
|
if (agentType !== "IdentityGatewayAgent")
|
|
182131
182182
|
throw new FrodoError(
|
|
182132
182183
|
`Wrong agent type! Expected 'IdentityGatewayAgent' but got '${agentType}'.`
|
|
@@ -182433,7 +182484,7 @@ async function importJavaAgent({
|
|
|
182433
182484
|
}) {
|
|
182434
182485
|
try {
|
|
182435
182486
|
debugMessage({ message: `AgentOps.importJavaAgent: start`, state: state2 });
|
|
182436
|
-
const agentType = _optionalChain([importData, 'access',
|
|
182487
|
+
const agentType = _optionalChain([importData, 'access', _240 => _240.agent, 'access', _241 => _241[agentId], 'optionalAccess', _242 => _242._type, 'access', _243 => _243._id]);
|
|
182437
182488
|
if (agentType !== "J2EEAgent")
|
|
182438
182489
|
throw new FrodoError(
|
|
182439
182490
|
`Wrong agent type! Expected 'J2EEAgent' but got '${agentType}'.`
|
|
@@ -182735,7 +182786,7 @@ async function importWebAgent({
|
|
|
182735
182786
|
}) {
|
|
182736
182787
|
try {
|
|
182737
182788
|
debugMessage({ message: `AgentOps.importWebAgent: start`, state: state2 });
|
|
182738
|
-
const agentType = _optionalChain([importData, 'access',
|
|
182789
|
+
const agentType = _optionalChain([importData, 'access', _244 => _244.agent, 'access', _245 => _245[agentId], 'optionalAccess', _246 => _246._type, 'access', _247 => _247._id]);
|
|
182739
182790
|
if (agentType !== "WebAgent")
|
|
182740
182791
|
throw new FrodoError(
|
|
182741
182792
|
`Wrong agent type! Expected 'WebAgent' but got '${agentType}'.`
|
|
@@ -183446,7 +183497,7 @@ async function importAIAgent({
|
|
|
183446
183497
|
message: `AgentOps.importAIAgent: start [includeAgentIdentity=${includeAgentIdentity}]`,
|
|
183447
183498
|
state: state2
|
|
183448
183499
|
});
|
|
183449
|
-
const agentType = _optionalChain([importData, 'access',
|
|
183500
|
+
const agentType = _optionalChain([importData, 'access', _248 => _248.agent, 'access', _249 => _249[agentId], 'optionalAccess', _250 => _250._type, 'access', _251 => _251._id]);
|
|
183450
183501
|
if (agentType !== "AIAgent") {
|
|
183451
183502
|
throw new FrodoError(
|
|
183452
183503
|
`Wrong agent type! Expected 'AIAgent' but got '${agentType}'.`
|
|
@@ -183494,7 +183545,7 @@ async function readAgentGroups({
|
|
|
183494
183545
|
const { result } = await getAgentGroups({ state: state2 });
|
|
183495
183546
|
return result;
|
|
183496
183547
|
} catch (error49) {
|
|
183497
|
-
if (_optionalChain([error49, 'access',
|
|
183548
|
+
if (_optionalChain([error49, 'access', _252 => _252.response, 'optionalAccess', _253 => _253.status]) === 403 && _optionalChain([error49, 'access', _254 => _254.response, 'optionalAccess', _255 => _255.data, 'optionalAccess', _256 => _256.message]) === "This operation is not available in PingOne Advanced Identity Cloud.") {
|
|
183498
183549
|
return [];
|
|
183499
183550
|
} else {
|
|
183500
183551
|
throw new FrodoError(
|
|
@@ -183597,7 +183648,7 @@ async function importAgentGroups({
|
|
|
183597
183648
|
})
|
|
183598
183649
|
);
|
|
183599
183650
|
} catch (error49) {
|
|
183600
|
-
if (error49.httpStatus !== 501 && _optionalChain([error49, 'access',
|
|
183651
|
+
if (error49.httpStatus !== 501 && _optionalChain([error49, 'access', _257 => _257.response, 'optionalAccess', _258 => _258.status]) !== 501) {
|
|
183601
183652
|
errors.push(
|
|
183602
183653
|
new FrodoError(
|
|
183603
183654
|
`Error importing ${getCurrentRealmName(state2) + " realm"} agent group ${agentGroupId} of type ${agentType}`,
|
|
@@ -183632,7 +183683,7 @@ async function importAgentGroup({
|
|
|
183632
183683
|
}) {
|
|
183633
183684
|
try {
|
|
183634
183685
|
debugMessage({ message: `AgentOps.importAgentGroup: start`, state: state2 });
|
|
183635
|
-
const agentType = _optionalChain([importData, 'access',
|
|
183686
|
+
const agentType = _optionalChain([importData, 'access', _259 => _259.agentGroup, 'access', _260 => _260[agentGroupId], 'optionalAccess', _261 => _261._type, 'access', _262 => _262._id]);
|
|
183636
183687
|
if (agentType === "SoapSTSAgent" && state2.getDeploymentType() !== Constants_default.CLASSIC_DEPLOYMENT_TYPE_KEY) {
|
|
183637
183688
|
throw new FrodoError(
|
|
183638
183689
|
`Can't import Soap STS agent groups for '${state2.getDeploymentType()}' deployment type.`
|
|
@@ -184838,7 +184889,7 @@ async function readSaml2ProviderStubs({
|
|
|
184838
184889
|
} catch (error49) {
|
|
184839
184890
|
if (
|
|
184840
184891
|
// operation is not available in PingOne Advanced Identity Cloud
|
|
184841
|
-
_optionalChain([error49, 'access',
|
|
184892
|
+
_optionalChain([error49, 'access', _263 => _263.response, 'optionalAccess', _264 => _264.status]) === 403 && _optionalChain([error49, 'access', _265 => _265.response, 'optionalAccess', _266 => _266.data, 'optionalAccess', _267 => _267.message]) === "This operation is not available in PingOne Advanced Identity Cloud."
|
|
184842
184893
|
) {
|
|
184843
184894
|
return [];
|
|
184844
184895
|
} else {
|
|
@@ -185615,7 +185666,7 @@ async function createCircleOfTrust2({
|
|
|
185615
185666
|
const response = await createCircleOfTrust({ cotData, state: state2 });
|
|
185616
185667
|
return response;
|
|
185617
185668
|
} catch (createError) {
|
|
185618
|
-
if (_optionalChain([createError, 'access',
|
|
185669
|
+
if (_optionalChain([createError, 'access', _268 => _268.response, 'optionalAccess', _269 => _269.data, 'optionalAccess', _270 => _270.code]) === 500 && _optionalChain([createError, 'access', _271 => _271.response, 'optionalAccess', _272 => _272.data, 'optionalAccess', _273 => _273.message]) === "Unable to update entity provider's circle of trust") {
|
|
185619
185670
|
try {
|
|
185620
185671
|
const response = await updateCircleOfTrust({ cotId, cotData, state: state2 });
|
|
185621
185672
|
return response;
|
|
@@ -185642,7 +185693,7 @@ async function updateCircleOfTrust2({
|
|
|
185642
185693
|
const response = await updateCircleOfTrust({ cotId, cotData, state: state2 });
|
|
185643
185694
|
return response || cotData;
|
|
185644
185695
|
} catch (error49) {
|
|
185645
|
-
if (_optionalChain([error49, 'access',
|
|
185696
|
+
if (_optionalChain([error49, 'access', _274 => _274.response, 'optionalAccess', _275 => _275.data, 'optionalAccess', _276 => _276.code]) === 500 && (_optionalChain([error49, 'access', _277 => _277.response, 'optionalAccess', _278 => _278.data, 'optionalAccess', _279 => _279.message]) === "Unable to update entity provider's circle of trust" || _optionalChain([error49, 'access', _280 => _280.response, 'optionalAccess', _281 => _281.data, 'optionalAccess', _282 => _282.message]) === "An error occurred while updating the COT memberships")) {
|
|
185646
185697
|
try {
|
|
185647
185698
|
const response = await updateCircleOfTrust({ cotId, cotData, state: state2 });
|
|
185648
185699
|
return response || cotData;
|
|
@@ -186067,7 +186118,7 @@ ${providers.map((it) => it.split("|")[0]).join("\n")}.`,
|
|
|
186067
186118
|
}
|
|
186068
186119
|
} catch (error49) {
|
|
186069
186120
|
debugMessage({
|
|
186070
|
-
message: `Error ${_optionalChain([error49, 'access',
|
|
186121
|
+
message: `Error ${_optionalChain([error49, 'access', _283 => _283.response, 'optionalAccess', _284 => _284.status])} creating/updating ${getCurrentRealmName(state2) + " realm"} circle of trust: ${_optionalChain([error49, 'access', _285 => _285.response, 'optionalAccess', _286 => _286.data, 'optionalAccess', _287 => _287.message])}`,
|
|
186071
186122
|
state: state2
|
|
186072
186123
|
});
|
|
186073
186124
|
errors.push(error49);
|
|
@@ -186400,7 +186451,7 @@ async function importGlossarySchemas({
|
|
|
186400
186451
|
state: state2
|
|
186401
186452
|
});
|
|
186402
186453
|
} catch (error49) {
|
|
186403
|
-
if (_optionalChain([error49, 'access',
|
|
186454
|
+
if (_optionalChain([error49, 'access', _288 => _288.response, 'optionalAccess', _289 => _289.status]) === 500 && _optionalChain([error49, 'access', _290 => _290.response, 'optionalAccess', _291 => _291.data, 'optionalAccess', _292 => _292.message]) === `Cannot read properties of undefined (reading '_source')`) {
|
|
186404
186455
|
result = await createGlossarySchema2({
|
|
186405
186456
|
glossarySchemaData: glossarySchema,
|
|
186406
186457
|
state: state2
|
|
@@ -186669,7 +186720,7 @@ async function createRequestType2({
|
|
|
186669
186720
|
state: state2
|
|
186670
186721
|
}) {
|
|
186671
186722
|
try {
|
|
186672
|
-
if (Array.isArray(_optionalChain([typeData, 'access',
|
|
186723
|
+
if (Array.isArray(_optionalChain([typeData, 'access', _293 => _293.validation, 'optionalAccess', _294 => _294.source]))) {
|
|
186673
186724
|
typeData.validation.source = typeData.validation.source.join("\n");
|
|
186674
186725
|
}
|
|
186675
186726
|
return await createRequestType({ typeData, state: state2 });
|
|
@@ -186831,7 +186882,7 @@ async function updateRequestType({
|
|
|
186831
186882
|
state: state2
|
|
186832
186883
|
}) {
|
|
186833
186884
|
try {
|
|
186834
|
-
if (Array.isArray(_optionalChain([typeData, 'access',
|
|
186885
|
+
if (Array.isArray(_optionalChain([typeData, 'access', _295 => _295.validation, 'optionalAccess', _296 => _296.source]))) {
|
|
186835
186886
|
typeData.validation.source = typeData.validation.source.join("\n");
|
|
186836
186887
|
}
|
|
186837
186888
|
return await putRequestType({
|
|
@@ -187907,7 +187958,7 @@ async function importEvents({
|
|
|
187907
187958
|
state: state2
|
|
187908
187959
|
});
|
|
187909
187960
|
} catch (error49) {
|
|
187910
|
-
if (_optionalChain([error49, 'access',
|
|
187961
|
+
if (_optionalChain([error49, 'access', _297 => _297.response, 'optionalAccess', _298 => _298.status]) === 404 && _optionalChain([error49, 'access', _299 => _299.response, 'optionalAccess', _300 => _300.data, 'optionalAccess', _301 => _301.message]) && error49.response.data.message.startsWith("Cannot find event with id")) {
|
|
187911
187962
|
result = await createEvent2({
|
|
187912
187963
|
eventData,
|
|
187913
187964
|
state: state2
|
|
@@ -187985,7 +188036,7 @@ async function prepareEventForExport({
|
|
|
187985
188036
|
const exportData = createEventExportTemplate({ state: state2 });
|
|
187986
188037
|
if (options.deps) {
|
|
187987
188038
|
const templates = await getIGANotificationEmailTemplateDependencies(
|
|
187988
|
-
_optionalChain([eventData, 'access',
|
|
188039
|
+
_optionalChain([eventData, 'access', _302 => _302.action, 'optionalAccess', _303 => _303.template]),
|
|
187989
188040
|
state2
|
|
187990
188041
|
);
|
|
187991
188042
|
exportData.emailTemplate = Object.fromEntries(
|
|
@@ -188371,12 +188422,12 @@ async function importWorkflows({
|
|
|
188371
188422
|
state: state2
|
|
188372
188423
|
});
|
|
188373
188424
|
if (!workflow.draft) {
|
|
188374
|
-
workflow.draft = _optionalChain([serverWorkflows, 'access',
|
|
188425
|
+
workflow.draft = _optionalChain([serverWorkflows, 'access', _304 => _304[workflow.published.id], 'optionalAccess', _305 => _305.draft]);
|
|
188375
188426
|
}
|
|
188376
188427
|
if (workflow.published) {
|
|
188377
188428
|
fillCoordinates(
|
|
188378
188429
|
workflow.published,
|
|
188379
|
-
_optionalChain([serverWorkflows, 'access',
|
|
188430
|
+
_optionalChain([serverWorkflows, 'access', _306 => _306[workflow.published.id], 'optionalAccess', _307 => _307.published])
|
|
188380
188431
|
);
|
|
188381
188432
|
const result = await updateWorkflow({
|
|
188382
188433
|
workflowId: workflow.published.id,
|
|
@@ -188391,7 +188442,7 @@ async function importWorkflows({
|
|
|
188391
188442
|
if (workflow.draft) {
|
|
188392
188443
|
fillCoordinates(
|
|
188393
188444
|
workflow.draft,
|
|
188394
|
-
_optionalChain([serverWorkflows, 'access',
|
|
188445
|
+
_optionalChain([serverWorkflows, 'access', _308 => _308[workflow.draft.id], 'optionalAccess', _309 => _309.draft])
|
|
188395
188446
|
);
|
|
188396
188447
|
const result = await updateWorkflow({
|
|
188397
188448
|
workflowId: workflow.draft.id,
|
|
@@ -188669,13 +188720,13 @@ async function readGroupedWorkflows({
|
|
|
188669
188720
|
try {
|
|
188670
188721
|
workflow.draft = await getDraftWorkflow({ workflowId, state: state2 });
|
|
188671
188722
|
} catch (e) {
|
|
188672
|
-
if (_optionalChain([e, 'access',
|
|
188723
|
+
if (_optionalChain([e, 'access', _310 => _310.response, 'optionalAccess', _311 => _311.status]) !== 404)
|
|
188673
188724
|
throw new FrodoError(`Error reading draft workflow ${workflowId}`, e);
|
|
188674
188725
|
}
|
|
188675
188726
|
try {
|
|
188676
188727
|
workflow.published = await getPublishedWorkflow({ workflowId, state: state2 });
|
|
188677
188728
|
} catch (e) {
|
|
188678
|
-
if (_optionalChain([e, 'access',
|
|
188729
|
+
if (_optionalChain([e, 'access', _312 => _312.response, 'optionalAccess', _313 => _313.status]) !== 404)
|
|
188679
188730
|
throw new FrodoError(`Error reading published workflow ${workflowId}`, e);
|
|
188680
188731
|
}
|
|
188681
188732
|
return { [workflowId]: workflow };
|
|
@@ -189290,8 +189341,8 @@ function noLegacySyncMappings(error49) {
|
|
|
189290
189341
|
continue;
|
|
189291
189342
|
}
|
|
189292
189343
|
visited.add(current);
|
|
189293
|
-
const status = _optionalChain([current, 'access',
|
|
189294
|
-
const url42 = _optionalChain([current, 'access',
|
|
189344
|
+
const status = _optionalChain([current, 'access', _314 => _314.response, 'optionalAccess', _315 => _315.status]);
|
|
189345
|
+
const url42 = _optionalChain([current, 'access', _316 => _316.config, 'optionalAccess', _317 => _317.url]);
|
|
189295
189346
|
if (status === 404 && typeof url42 === "string" && /\/openidm\/config\/sync(?:\?|$)/.test(url42)) {
|
|
189296
189347
|
return true;
|
|
189297
189348
|
}
|
|
@@ -189774,7 +189825,7 @@ async function importFirstMapping({
|
|
|
189774
189825
|
const imported = [];
|
|
189775
189826
|
const mappingIds = Object.keys(importData.mapping);
|
|
189776
189827
|
let mappingId;
|
|
189777
|
-
if (_optionalChain([importData, 'access',
|
|
189828
|
+
if (_optionalChain([importData, 'access', _318 => _318.sync, 'optionalAccess', _319 => _319.mappings, 'optionalAccess', _320 => _320.length]) > 0) {
|
|
189778
189829
|
mappingId = importData.sync.mappings[0]._id;
|
|
189779
189830
|
} else if (mappingIds.length > 0) {
|
|
189780
189831
|
mappingId = mappingIds[0];
|
|
@@ -191419,7 +191470,7 @@ async function readApplicationGlossary({
|
|
|
191419
191470
|
state: state2
|
|
191420
191471
|
});
|
|
191421
191472
|
} catch (error49) {
|
|
191422
|
-
if (_optionalChain([error49, 'access',
|
|
191473
|
+
if (_optionalChain([error49, 'access', _321 => _321.response, 'optionalAccess', _322 => _322.status]) !== 404) {
|
|
191423
191474
|
throw error49;
|
|
191424
191475
|
}
|
|
191425
191476
|
}
|
|
@@ -191580,7 +191631,7 @@ async function readFeatures({
|
|
|
191580
191631
|
const { result } = await getFeatures({ state: state2 });
|
|
191581
191632
|
state2.setFeatures(JSON.parse(JSON.stringify(result)));
|
|
191582
191633
|
} catch (error49) {
|
|
191583
|
-
debugMessage({ message: _optionalChain([error49, 'access',
|
|
191634
|
+
debugMessage({ message: _optionalChain([error49, 'access', _323 => _323.response, 'optionalAccess', _324 => _324.data]), state: state2 });
|
|
191584
191635
|
state2.setFeatures([]);
|
|
191585
191636
|
}
|
|
191586
191637
|
return state2.getFeatures();
|
|
@@ -193419,7 +193470,7 @@ async function determineDeploymentType(state2) {
|
|
|
193419
193470
|
state: state2
|
|
193420
193471
|
});
|
|
193421
193472
|
} catch (e) {
|
|
193422
|
-
if (_optionalChain([e, 'access',
|
|
193473
|
+
if (_optionalChain([e, 'access', _325 => _325.response, 'optionalAccess', _326 => _326.status]) === 302 && _optionalChain([e, 'access', _327 => _327.response, 'access', _328 => _328.headers, 'optionalAccess', _329 => _329.location, 'optionalAccess', _330 => _330.indexOf, 'call', _331 => _331("code=")]) > -1) {
|
|
193423
193474
|
verboseMessage({
|
|
193424
193475
|
message: C.cyan(`ForgeRock Identity Cloud`) + ` detected.`,
|
|
193425
193476
|
state: state2
|
|
@@ -193435,7 +193486,7 @@ async function determineDeploymentType(state2) {
|
|
|
193435
193486
|
state: state2
|
|
193436
193487
|
});
|
|
193437
193488
|
} catch (ex) {
|
|
193438
|
-
if (_optionalChain([ex, 'access',
|
|
193489
|
+
if (_optionalChain([ex, 'access', _332 => _332.response, 'optionalAccess', _333 => _333.status]) === 302 && _optionalChain([ex, 'access', _334 => _334.response, 'access', _335 => _335.headers, 'optionalAccess', _336 => _336.location, 'optionalAccess', _337 => _337.indexOf, 'call', _338 => _338("code=")]) > -1) {
|
|
193439
193490
|
adminClientId = state2.getAdminClientId() || forgeopsClientId;
|
|
193440
193491
|
verboseMessage({
|
|
193441
193492
|
message: C.cyan(`ForgeOps deployment`) + ` detected.`,
|
|
@@ -193459,14 +193510,20 @@ async function determineDeploymentType(state2) {
|
|
|
193459
193510
|
}
|
|
193460
193511
|
}
|
|
193461
193512
|
}
|
|
193513
|
+
var UNKNOWN_AM_VERSION = "0.0.0";
|
|
193462
193514
|
function getSemanticVersion(versionInfo) {
|
|
193463
|
-
|
|
193464
|
-
|
|
193465
|
-
|
|
193466
|
-
|
|
193467
|
-
|
|
193515
|
+
const versionFields = [_optionalChain([versionInfo, 'optionalAccess', _339 => _339.version]), _optionalChain([versionInfo, 'optionalAccess', _340 => _340.fullVersion])];
|
|
193516
|
+
const semanticVersionRegex = /(\d+\.\d+\.\d+(?:\.\d+)*)/;
|
|
193517
|
+
for (const versionField of versionFields) {
|
|
193518
|
+
if (typeof versionField !== "string") {
|
|
193519
|
+
continue;
|
|
193520
|
+
}
|
|
193521
|
+
const version32 = versionField.match(semanticVersionRegex);
|
|
193522
|
+
if (version32) {
|
|
193523
|
+
return version32[0];
|
|
193524
|
+
}
|
|
193468
193525
|
}
|
|
193469
|
-
|
|
193526
|
+
return UNKNOWN_AM_VERSION;
|
|
193470
193527
|
}
|
|
193471
193528
|
async function getFreshUserSessionToken({
|
|
193472
193529
|
stepHandler,
|
|
@@ -193673,7 +193730,7 @@ async function getAuthCode(scope, redirectUri, codeChallenge, codeChallengeMetho
|
|
|
193673
193730
|
throw error49;
|
|
193674
193731
|
}
|
|
193675
193732
|
}
|
|
193676
|
-
const redirectLocationURL = _optionalChain([response, 'access',
|
|
193733
|
+
const redirectLocationURL = _optionalChain([response, 'access', _341 => _341.headers, 'optionalAccess', _342 => _342.location]);
|
|
193677
193734
|
const parsedUrl = new (0, _url2.URL)(redirectLocationURL, state2.getHost());
|
|
193678
193735
|
const code = parsedUrl.searchParams.get("code");
|
|
193679
193736
|
if (code) {
|
|
@@ -193891,7 +193948,7 @@ async function getPfUserBearerToken(state2) {
|
|
|
193891
193948
|
}
|
|
193892
193949
|
function createPayload(serviceAccountId, host) {
|
|
193893
193950
|
const u = parseUrl3(host);
|
|
193894
|
-
const aud = `${u.origin}
|
|
193951
|
+
const aud = `${u.origin}${u.port ? "" : `:${u.protocol === "https" ? "443" : "80"}`}${u.pathname.replace(/\/$/, "")}/oauth2/access_token`;
|
|
193895
193952
|
const exp = Math.floor((/* @__PURE__ */ new Date()).getTime() / 1e3 + 180);
|
|
193896
193953
|
const jti = v4_default();
|
|
193897
193954
|
const iss = serviceAccountId;
|
|
@@ -193924,7 +193981,7 @@ async function getFreshSaBearerToken({
|
|
|
193924
193981
|
});
|
|
193925
193982
|
} catch (error49) {
|
|
193926
193983
|
const err = error49;
|
|
193927
|
-
if (err.isHttpError && err.httpErrorText === "invalid_scope" && _optionalChain([err, 'access',
|
|
193984
|
+
if (err.isHttpError && err.httpErrorText === "invalid_scope" && _optionalChain([err, 'access', _343 => _343.httpDescription, 'optionalAccess', _344 => _344.startsWith, 'call', _345 => _345("Unsupported scope for service account: ")])) {
|
|
193928
193985
|
const invalidScopes = err.httpDescription.substring(39).split(",");
|
|
193929
193986
|
const finalScopes = scope.split(" ").filter((el) => {
|
|
193930
193987
|
return !invalidScopes.includes(el);
|
|
@@ -193980,7 +194037,7 @@ async function getFreshPfSaBearerToken({
|
|
|
193980
194037
|
});
|
|
193981
194038
|
} catch (error49) {
|
|
193982
194039
|
const err = error49;
|
|
193983
|
-
if (err.isHttpError && err.httpErrorText === "invalid_scope" && _optionalChain([err, 'access',
|
|
194040
|
+
if (err.isHttpError && err.httpErrorText === "invalid_scope" && _optionalChain([err, 'access', _346 => _346.httpDescription, 'optionalAccess', _347 => _347.startsWith, 'call', _348 => _348("Unsupported scope for service account: ")])) {
|
|
193984
194041
|
const invalidScopes = err.httpDescription.substring(39).split(",");
|
|
193985
194042
|
const finalScopes = scope.split(" ").filter((el) => {
|
|
193986
194043
|
return !invalidScopes.includes(el);
|
|
@@ -194163,9 +194220,9 @@ function scheduleAutoRefresh(forceLoginAsUser, autoRefresh, state2) {
|
|
|
194163
194220
|
clearTimeout(timer);
|
|
194164
194221
|
}
|
|
194165
194222
|
if (autoRefresh) {
|
|
194166
|
-
const expires = state2.getDeploymentType() === Constants_default.CLASSIC_DEPLOYMENT_TYPE_KEY ? _optionalChain([state2, 'access',
|
|
194167
|
-
_optionalChain([state2, 'access',
|
|
194168
|
-
_optionalChain([state2, 'access',
|
|
194223
|
+
const expires = state2.getDeploymentType() === Constants_default.CLASSIC_DEPLOYMENT_TYPE_KEY ? _optionalChain([state2, 'access', _349 => _349.getUserSessionTokenMeta, 'call', _350 => _350(), 'optionalAccess', _351 => _351.expires]) : state2.getUseBearerTokenForAmApis() ? _optionalChain([state2, 'access', _352 => _352.getBearerTokenMeta, 'call', _353 => _353(), 'optionalAccess', _354 => _354.expires]) : Math.min(
|
|
194224
|
+
_optionalChain([state2, 'access', _355 => _355.getBearerTokenMeta, 'call', _356 => _356(), 'optionalAccess', _357 => _357.expires]),
|
|
194225
|
+
_optionalChain([state2, 'access', _358 => _358.getUserSessionTokenMeta, 'call', _359 => _359(), 'optionalAccess', _360 => _360.expires])
|
|
194169
194226
|
);
|
|
194170
194227
|
let timeout4 = expires - Date.now() - 1e3 * 25;
|
|
194171
194228
|
if (timeout4 < 1e3 * 30) {
|
|
@@ -194357,10 +194414,10 @@ async function getTokens({
|
|
|
194357
194414
|
throw new FrodoError(`Incomplete or no credentials`);
|
|
194358
194415
|
}
|
|
194359
194416
|
if (state2.getCookieValue() || state2.getUseBearerTokenForAmApis() && state2.getBearerToken()) {
|
|
194360
|
-
if (_optionalChain([state2, 'access',
|
|
194417
|
+
if (_optionalChain([state2, 'access', _361 => _361.getBearerTokenMeta, 'call', _362 => _362(), 'optionalAccess', _363 => _363.from_cache])) {
|
|
194361
194418
|
verboseMessage({ message: `Using cached bearer token.`, state: state2 });
|
|
194362
194419
|
}
|
|
194363
|
-
if (!state2.getUseBearerTokenForAmApis() && _optionalChain([state2, 'access',
|
|
194420
|
+
if (!state2.getUseBearerTokenForAmApis() && _optionalChain([state2, 'access', _364 => _364.getUserSessionTokenMeta, 'call', _365 => _365(), 'optionalAccess', _366 => _366.from_cache])) {
|
|
194364
194421
|
verboseMessage({ message: `Using cached session token.`, state: state2 });
|
|
194365
194422
|
}
|
|
194366
194423
|
scheduleAutoRefresh(forceLoginAsUser, autoRefresh, state2);
|
|
@@ -194487,7 +194544,7 @@ async function readAuthenticationSettings({
|
|
|
194487
194544
|
const settings = await getAuthenticationSettings({ state: state2, globalConfig: globalConfig2 });
|
|
194488
194545
|
return settings;
|
|
194489
194546
|
} catch (error49) {
|
|
194490
|
-
if (_optionalChain([error49, 'access',
|
|
194547
|
+
if (_optionalChain([error49, 'access', _367 => _367.response, 'optionalAccess', _368 => _368.status]) === 403 && _optionalChain([error49, 'access', _369 => _369.response, 'optionalAccess', _370 => _370.data, 'optionalAccess', _371 => _371.message]) === "This operation is not available in PingOne Advanced Identity Cloud.") {
|
|
194491
194548
|
return null;
|
|
194492
194549
|
} else {
|
|
194493
194550
|
throw new FrodoError(
|
|
@@ -195009,7 +195066,7 @@ async function importServers({
|
|
|
195009
195066
|
state: state2
|
|
195010
195067
|
});
|
|
195011
195068
|
} catch (e) {
|
|
195012
|
-
if (_optionalChain([e, 'access',
|
|
195069
|
+
if (_optionalChain([e, 'access', _372 => _372.response, 'optionalAccess', _373 => _373.status]) !== 400 || _optionalChain([e, 'access', _374 => _374.response, 'optionalAccess', _375 => _375.data, 'optionalAccess', _376 => _376.message]) !== "Update not supported") {
|
|
195013
195070
|
throw new FrodoError(
|
|
195014
195071
|
`Error creating server with id '${server._id}' and URL '${server.url}'`,
|
|
195015
195072
|
e
|
|
@@ -195476,7 +195533,7 @@ async function updateAdminFederationProvider({
|
|
|
195476
195533
|
});
|
|
195477
195534
|
return response;
|
|
195478
195535
|
} catch (importError) {
|
|
195479
|
-
if (_optionalChain([importError, 'access',
|
|
195536
|
+
if (_optionalChain([importError, 'access', _377 => _377.response, 'optionalAccess', _378 => _378.status]) === 400 && _optionalChain([importError, 'access', _379 => _379.response, 'optionalAccess', _380 => _380.data, 'optionalAccess', _381 => _381.message]) === "Invalid attribute specified.") {
|
|
195480
195537
|
const { validAttributes } = importError.response.data.detail;
|
|
195481
195538
|
validAttributes.push("_id", "_type");
|
|
195482
195539
|
for (const attribute of Object.keys(providerData)) {
|
|
@@ -197977,7 +198034,7 @@ async function importCertificationTemplates({
|
|
|
197977
198034
|
state: state2
|
|
197978
198035
|
});
|
|
197979
198036
|
} catch (error49) {
|
|
197980
|
-
if (_optionalChain([error49, 'access',
|
|
198037
|
+
if (_optionalChain([error49, 'access', _382 => _382.response, 'optionalAccess', _383 => _383.status]) === 404 && _optionalChain([error49, 'access', _384 => _384.response, 'optionalAccess', _385 => _385.data, 'optionalAccess', _386 => _386.message]) && error49.response.data.message.startsWith("Cannot find template with id")) {
|
|
197981
198038
|
result = await createCertificationTemplate2({
|
|
197982
198039
|
templateData,
|
|
197983
198040
|
state: state2
|
|
@@ -199052,6 +199109,16 @@ function createSecretsExportTemplate({
|
|
|
199052
199109
|
secret: {}
|
|
199053
199110
|
};
|
|
199054
199111
|
}
|
|
199112
|
+
function warnSkippedActiveValueExport({
|
|
199113
|
+
secretId,
|
|
199114
|
+
state: state2
|
|
199115
|
+
}) {
|
|
199116
|
+
printMessage({
|
|
199117
|
+
message: `Warning: Secret '${secretId}' has 'Use in Placeholders' disabled, skipping active value export.`,
|
|
199118
|
+
type: "warn",
|
|
199119
|
+
state: state2
|
|
199120
|
+
});
|
|
199121
|
+
}
|
|
199055
199122
|
async function exportSecret({
|
|
199056
199123
|
secretId,
|
|
199057
199124
|
options = { includeActiveValues: false, target: null },
|
|
@@ -199063,11 +199130,15 @@ async function exportSecret({
|
|
|
199063
199130
|
const exportData = createSecretsExportTemplate({ state: state2 });
|
|
199064
199131
|
const secret = await readSecret({ secretId, state: state2 });
|
|
199065
199132
|
if (includeActiveValues) {
|
|
199066
|
-
secret.
|
|
199067
|
-
|
|
199068
|
-
|
|
199069
|
-
|
|
199070
|
-
|
|
199133
|
+
if (secret.useInPlaceholders) {
|
|
199134
|
+
secret.activeValue = await readSecretValue({
|
|
199135
|
+
secretId: secret._id,
|
|
199136
|
+
target,
|
|
199137
|
+
state: state2
|
|
199138
|
+
});
|
|
199139
|
+
} else {
|
|
199140
|
+
warnSkippedActiveValueExport({ secretId: secret._id, state: state2 });
|
|
199141
|
+
}
|
|
199071
199142
|
}
|
|
199072
199143
|
exportData.secret[secret._id] = secret;
|
|
199073
199144
|
debugMessage({ message: `SecretsOps.exportSecret: end`, state: state2 });
|
|
@@ -199103,7 +199174,11 @@ async function exportSecrets({
|
|
|
199103
199174
|
message: `Exporting secret ${secret._id}`,
|
|
199104
199175
|
state: state2
|
|
199105
199176
|
});
|
|
199106
|
-
secret.
|
|
199177
|
+
if (secret.useInPlaceholders) {
|
|
199178
|
+
secret.activeValue = mapOfSecrets[secret._id];
|
|
199179
|
+
} else {
|
|
199180
|
+
warnSkippedActiveValueExport({ secretId: secret._id, state: state2 });
|
|
199181
|
+
}
|
|
199107
199182
|
exportData.secret[secret._id] = secret;
|
|
199108
199183
|
}
|
|
199109
199184
|
} else {
|
|
@@ -199733,9 +199808,21 @@ var StartupOps_default = (state2) => {
|
|
|
199733
199808
|
timeout: timeout4,
|
|
199734
199809
|
state: state2
|
|
199735
199810
|
});
|
|
199811
|
+
},
|
|
199812
|
+
/**
|
|
199813
|
+
* Get the current restart status of the environment
|
|
199814
|
+
* @returns {Promise<RestartStatus>} the current restart status
|
|
199815
|
+
*/
|
|
199816
|
+
async readStatus() {
|
|
199817
|
+
return readStatus({ state: state2 });
|
|
199736
199818
|
}
|
|
199737
199819
|
};
|
|
199738
199820
|
};
|
|
199821
|
+
async function readStatus({
|
|
199822
|
+
state: state2
|
|
199823
|
+
}) {
|
|
199824
|
+
return getStatus({ state: state2 });
|
|
199825
|
+
}
|
|
199739
199826
|
async function checkForUpdates({
|
|
199740
199827
|
state: state2
|
|
199741
199828
|
}) {
|
|
@@ -199761,7 +199848,7 @@ async function checkForUpdates({
|
|
|
199761
199848
|
state: state2
|
|
199762
199849
|
});
|
|
199763
199850
|
}
|
|
199764
|
-
const updateCount = _optionalChain([updates, 'access',
|
|
199851
|
+
const updateCount = _optionalChain([updates, 'access', _387 => _387.secrets, 'optionalAccess', _388 => _388.length]) + _optionalChain([updates, 'access', _389 => _389.variables, 'optionalAccess', _390 => _390.length]) || 0;
|
|
199765
199852
|
if (updateCount > 0) {
|
|
199766
199853
|
stopProgressIndicator({
|
|
199767
199854
|
id: indicatorId,
|
|
@@ -199854,7 +199941,7 @@ async function applyUpdates({
|
|
|
199854
199941
|
} catch (error49) {
|
|
199855
199942
|
stopProgressIndicator({
|
|
199856
199943
|
id: indicatorId,
|
|
199857
|
-
message: `Error: ${_optionalChain([error49, 'access',
|
|
199944
|
+
message: `Error: ${_optionalChain([error49, 'access', _391 => _391.response, 'optionalAccess', _392 => _392.data, 'optionalAccess', _393 => _393.code]) || error49} - ${_optionalChain([error49, 'access', _394 => _394.response, 'optionalAccess', _395 => _395.data, 'optionalAccess', _396 => _396.message])}`,
|
|
199858
199945
|
status: "fail",
|
|
199859
199946
|
state: state2
|
|
199860
199947
|
});
|
|
@@ -200982,8 +201069,8 @@ async function readSocialIdentityProviders({
|
|
|
200982
201069
|
} catch (error49) {
|
|
200983
201070
|
if (
|
|
200984
201071
|
// service accounts don't have access to social idps in root realm in AIC
|
|
200985
|
-
state2.getDeploymentType() === Constants_default.CLOUD_DEPLOYMENT_TYPE_KEY && _optionalChain([error49, 'access',
|
|
200986
|
-
_optionalChain([error49, 'access',
|
|
201072
|
+
state2.getDeploymentType() === Constants_default.CLOUD_DEPLOYMENT_TYPE_KEY && _optionalChain([error49, 'access', _397 => _397.response, 'optionalAccess', _398 => _398.status]) === 403 && state2.getUseBearerTokenForAmApis() && getCurrentRealmName(state2) === "/" || // hm... not sure if this clause ever tiggers
|
|
201073
|
+
_optionalChain([error49, 'access', _399 => _399.response, 'optionalAccess', _400 => _400.status]) === 403 && _optionalChain([error49, 'access', _401 => _401.response, 'optionalAccess', _402 => _402.data, 'optionalAccess', _403 => _403.message]) === "This operation is not available in PingOne Advanced Identity Cloud."
|
|
200987
201074
|
) {
|
|
200988
201075
|
return [];
|
|
200989
201076
|
} else {
|
|
@@ -201082,7 +201169,7 @@ async function updateSocialIdentityProvider({
|
|
|
201082
201169
|
});
|
|
201083
201170
|
return response;
|
|
201084
201171
|
} catch (error49) {
|
|
201085
|
-
if (_optionalChain([error49, 'access',
|
|
201172
|
+
if (_optionalChain([error49, 'access', _404 => _404.response, 'optionalAccess', _405 => _405.status]) === 500 && _optionalChain([error49, 'access', _406 => _406.response, 'optionalAccess', _407 => _407.data, 'optionalAccess', _408 => _408.message]) === "Unable to update SMS config: Data validation failed for the attribute, Redirect after form post URL") {
|
|
201086
201173
|
providerData["redirectAfterFormPostURI"] = "";
|
|
201087
201174
|
try {
|
|
201088
201175
|
await putProviderByTypeAndId2({
|
|
@@ -201094,7 +201181,7 @@ async function updateSocialIdentityProvider({
|
|
|
201094
201181
|
} catch (importError2) {
|
|
201095
201182
|
throw new FrodoError(`Error updating provider ${providerId}`, error49);
|
|
201096
201183
|
}
|
|
201097
|
-
} else if (_optionalChain([error49, 'access',
|
|
201184
|
+
} else if (_optionalChain([error49, 'access', _409 => _409.response, 'optionalAccess', _410 => _410.status]) === 400 && _optionalChain([error49, 'access', _411 => _411.response, 'optionalAccess', _412 => _412.data, 'optionalAccess', _413 => _413.message]) === "Invalid attribute specified.") {
|
|
201098
201185
|
const { validAttributes } = error49.response.data.detail;
|
|
201099
201186
|
for (const attribute of Object.keys(providerData)) {
|
|
201100
201187
|
if (!validAttributes.includes(attribute)) {
|
|
@@ -202106,13 +202193,13 @@ async function getTreesCount({
|
|
|
202106
202193
|
}).get(urlString, {
|
|
202107
202194
|
withCredentials: true
|
|
202108
202195
|
});
|
|
202109
|
-
if (typeof _optionalChain([data2, 'optionalAccess',
|
|
202196
|
+
if (typeof _optionalChain([data2, 'optionalAccess', _414 => _414.totalPagedResults]) === "number" && data2.totalPagedResults >= 0) {
|
|
202110
202197
|
return data2.totalPagedResults;
|
|
202111
202198
|
}
|
|
202112
|
-
if (typeof _optionalChain([data2, 'optionalAccess',
|
|
202199
|
+
if (typeof _optionalChain([data2, 'optionalAccess', _415 => _415.resultCount]) === "number" && data2.resultCount >= 0) {
|
|
202113
202200
|
return data2.resultCount;
|
|
202114
202201
|
}
|
|
202115
|
-
return Array.isArray(_optionalChain([data2, 'optionalAccess',
|
|
202202
|
+
return Array.isArray(_optionalChain([data2, 'optionalAccess', _416 => _416.result])) ? data2.result.length : 0;
|
|
202116
202203
|
}
|
|
202117
202204
|
async function getTree({ id: id7, state: state2 }) {
|
|
202118
202205
|
const urlString = _util2.default.format(
|
|
@@ -203028,7 +203115,7 @@ async function updateCustomNode({
|
|
|
203028
203115
|
}
|
|
203029
203116
|
result = await putCustomNode({ nodeId, nodeData, state: state2 });
|
|
203030
203117
|
} catch (error49) {
|
|
203031
|
-
if (_optionalChain([error49, 'access',
|
|
203118
|
+
if (_optionalChain([error49, 'access', _417 => _417.response, 'optionalAccess', _418 => _418.status]) === 409 && _optionalChain([error49, 'access', _419 => _419.response, 'optionalAccess', _420 => _420.data, 'access', _421 => _421.message, 'access', _422 => _422.startsWith, 'call', _423 => _423("Node Type with display name")]) && _optionalChain([error49, 'access', _424 => _424.response, 'optionalAccess', _425 => _425.data, 'access', _426 => _426.message, 'access', _427 => _427.endsWith, 'call', _428 => _428("already exists")])) {
|
|
203032
203119
|
verboseMessage({
|
|
203033
203120
|
message: `updateCustomNode WARNING: custom node with display name ${nodeData.displayName} already exists, using renaming policy... <name> => <name - imported (n)>`,
|
|
203034
203121
|
state: state2
|
|
@@ -203089,7 +203176,7 @@ async function importCustomNodes({
|
|
|
203089
203176
|
message: `NodeOps.importCustomNodes: Custom node ${nodeData.displayName} (${existingId}) already exists, attempting to update...`,
|
|
203090
203177
|
state: state2
|
|
203091
203178
|
});
|
|
203092
|
-
if (_optionalChain([error49, 'access',
|
|
203179
|
+
if (_optionalChain([error49, 'access', _429 => _429.response, 'optionalAccess', _430 => _430.status]) === 409) {
|
|
203093
203180
|
result = await updateCustomNode({
|
|
203094
203181
|
nodeId: newId,
|
|
203095
203182
|
nodeData,
|
|
@@ -204423,6 +204510,38 @@ function hasScriptDependency(nodeConfig) {
|
|
|
204423
204510
|
}
|
|
204424
204511
|
var emailTemplateNodes = ["EmailSuspendNode", "EmailTemplateNode"];
|
|
204425
204512
|
var emptyScriptPlaceholder = "[Empty]";
|
|
204513
|
+
var treeDependencyNodeTypes = /* @__PURE__ */ new Set([
|
|
204514
|
+
"InnerTreeEvaluatorNode",
|
|
204515
|
+
"BackChannelInitNode"
|
|
204516
|
+
]);
|
|
204517
|
+
function getTreeDependencyId({
|
|
204518
|
+
nodeType,
|
|
204519
|
+
nodeConfig
|
|
204520
|
+
}) {
|
|
204521
|
+
const dependencyNodeType = _nullishCoalesce(nodeType, () => ( _optionalChain([nodeConfig, 'optionalAccess', _431 => _431._type, 'optionalAccess', _432 => _432._id])));
|
|
204522
|
+
if (!dependencyNodeType || !treeDependencyNodeTypes.has(dependencyNodeType) || typeof _optionalChain([nodeConfig, 'optionalAccess', _433 => _433.tree]) !== "string") {
|
|
204523
|
+
return void 0;
|
|
204524
|
+
}
|
|
204525
|
+
return nodeConfig.tree;
|
|
204526
|
+
}
|
|
204527
|
+
function collectTreeDependencyIds(treeDependencyMap, treeIds = []) {
|
|
204528
|
+
for (const [treeId, dependencies] of Object.entries(treeDependencyMap)) {
|
|
204529
|
+
for (const dependencyMap of dependencies) {
|
|
204530
|
+
collectTreeDependencyIds(dependencyMap, treeIds);
|
|
204531
|
+
}
|
|
204532
|
+
if (!treeIds.includes(treeId)) {
|
|
204533
|
+
treeIds.push(treeId);
|
|
204534
|
+
}
|
|
204535
|
+
}
|
|
204536
|
+
return treeIds;
|
|
204537
|
+
}
|
|
204538
|
+
function stripExportMetadata(exportData) {
|
|
204539
|
+
const treeExport = {
|
|
204540
|
+
...exportData
|
|
204541
|
+
};
|
|
204542
|
+
delete treeExport.meta;
|
|
204543
|
+
return treeExport;
|
|
204544
|
+
}
|
|
204426
204545
|
function createSingleTreeExportTemplate({
|
|
204427
204546
|
state: state2
|
|
204428
204547
|
}) {
|
|
@@ -204513,7 +204632,7 @@ async function getSaml2NodeDependencies(nodeObject, allProviders, allCirclesOfTr
|
|
|
204513
204632
|
}
|
|
204514
204633
|
saml2EntityPromises.push(providerResponse);
|
|
204515
204634
|
} catch (error49) {
|
|
204516
|
-
error49.message = `Error reading ${getCurrentRealmName(state2) + " realm"} saml2 dependencies: ${_optionalChain([error49, 'access',
|
|
204635
|
+
error49.message = `Error reading ${getCurrentRealmName(state2) + " realm"} saml2 dependencies: ${_optionalChain([error49, 'access', _434 => _434.response, 'optionalAccess', _435 => _435.data, 'optionalAccess', _436 => _436.message]) || error49.message}`;
|
|
204517
204636
|
errors.push(error49);
|
|
204518
204637
|
}
|
|
204519
204638
|
}
|
|
@@ -204542,7 +204661,7 @@ async function getSaml2NodeDependencies(nodeObject, allProviders, allCirclesOfTr
|
|
|
204542
204661
|
circlesOfTrust
|
|
204543
204662
|
};
|
|
204544
204663
|
} catch (error49) {
|
|
204545
|
-
error49.message = `Error reading ${getCurrentRealmName(state2) + " realm"} saml2 dependencies: ${_optionalChain([error49, 'access',
|
|
204664
|
+
error49.message = `Error reading ${getCurrentRealmName(state2) + " realm"} saml2 dependencies: ${_optionalChain([error49, 'access', _437 => _437.response, 'optionalAccess', _438 => _438.data, 'optionalAccess', _439 => _439.message]) || error49.message}`;
|
|
204546
204665
|
errors.push(error49);
|
|
204547
204666
|
}
|
|
204548
204667
|
if (errors.length) {
|
|
@@ -204554,7 +204673,7 @@ ${errorMessages}`
|
|
|
204554
204673
|
}
|
|
204555
204674
|
return saml2NodeDependencies;
|
|
204556
204675
|
}
|
|
204557
|
-
async function
|
|
204676
|
+
async function exportSingleJourney({
|
|
204558
204677
|
journeyId,
|
|
204559
204678
|
options = {
|
|
204560
204679
|
useStringArrays: true,
|
|
@@ -204653,7 +204772,7 @@ async function exportJourney({
|
|
|
204653
204772
|
if (deps && hasScriptDependency(nodeObject) && nodeObject.script !== emptyScriptPlaceholder) {
|
|
204654
204773
|
scriptPromises.push(readScript({ scriptId: nodeObject.script, state: state2 }));
|
|
204655
204774
|
}
|
|
204656
|
-
if (deps && _optionalChain([nodeObject, 'access',
|
|
204775
|
+
if (deps && _optionalChain([nodeObject, 'access', _440 => _440._type, 'optionalAccess', _441 => _441._id]) && nodeObject._type._id.startsWith("designer-")) {
|
|
204657
204776
|
customNodePromises.push(
|
|
204658
204777
|
readCustomNode({
|
|
204659
204778
|
nodeId: nodeObject._type._id.substring(9) + "-1",
|
|
@@ -204674,7 +204793,7 @@ async function exportJourney({
|
|
|
204674
204793
|
});
|
|
204675
204794
|
emailTemplatePromises.push(emailTemplate);
|
|
204676
204795
|
} catch (error49) {
|
|
204677
|
-
error49.message = `Error reading email template ${nodeObject.emailTemplateName}: ${_optionalChain([error49, 'access',
|
|
204796
|
+
error49.message = `Error reading email template ${nodeObject.emailTemplateName}: ${_optionalChain([error49, 'access', _442 => _442.response, 'optionalAccess', _443 => _443.data, 'optionalAccess', _444 => _444.message]) || error49.message}`;
|
|
204678
204797
|
errors.push(error49);
|
|
204679
204798
|
}
|
|
204680
204799
|
}
|
|
@@ -204776,7 +204895,7 @@ async function exportJourney({
|
|
|
204776
204895
|
readScript({ scriptId: innerNodeObject.script, state: state2 })
|
|
204777
204896
|
);
|
|
204778
204897
|
}
|
|
204779
|
-
if (deps && _optionalChain([innerNodeObject, 'access',
|
|
204898
|
+
if (deps && _optionalChain([innerNodeObject, 'access', _445 => _445._type, 'optionalAccess', _446 => _446._id]) && innerNodeObject._type._id.startsWith("designer-")) {
|
|
204780
204899
|
customNodePromises.push(
|
|
204781
204900
|
readCustomNode({
|
|
204782
204901
|
nodeId: innerNodeObject._type._id.substring(9) + "-1",
|
|
@@ -205052,7 +205171,7 @@ async function exportJourney({
|
|
|
205052
205171
|
for (const themeObject of themePromiseResults) {
|
|
205053
205172
|
if (themeObject && // has the theme been specified by id or name in a page node?
|
|
205054
205173
|
(themes.includes(themeObject._id) || themes.includes(themeObject.name) || // has this journey been linked to a theme?
|
|
205055
|
-
_optionalChain([themeObject, 'access',
|
|
205174
|
+
_optionalChain([themeObject, 'access', _447 => _447.linkedTrees, 'optionalAccess', _448 => _448.includes, 'call', _449 => _449(treeObject._id)]))) {
|
|
205056
205175
|
if (verbose)
|
|
205057
205176
|
printMessage({
|
|
205058
205177
|
message: `
|
|
@@ -205091,6 +205210,43 @@ async function exportJourney({
|
|
|
205091
205210
|
});
|
|
205092
205211
|
return exportData;
|
|
205093
205212
|
}
|
|
205213
|
+
async function exportJourney({
|
|
205214
|
+
journeyId,
|
|
205215
|
+
options = {
|
|
205216
|
+
useStringArrays: true,
|
|
205217
|
+
deps: true,
|
|
205218
|
+
coords: true
|
|
205219
|
+
},
|
|
205220
|
+
resolveTreeExport = onlineTreeExportResolver,
|
|
205221
|
+
state: state2
|
|
205222
|
+
}) {
|
|
205223
|
+
const exportData = await exportSingleJourney({ journeyId, options, state: state2 });
|
|
205224
|
+
if (!options.deps) {
|
|
205225
|
+
const multiTreeExport2 = createMultiTreeExportTemplate({ state: state2 });
|
|
205226
|
+
multiTreeExport2.trees[journeyId] = stripExportMetadata(exportData);
|
|
205227
|
+
return multiTreeExport2;
|
|
205228
|
+
}
|
|
205229
|
+
const treeDependencyMap = await getTreeDescendents({
|
|
205230
|
+
treeExport: exportData,
|
|
205231
|
+
resolveTreeExport,
|
|
205232
|
+
resolvedTreeIds: [],
|
|
205233
|
+
state: state2
|
|
205234
|
+
});
|
|
205235
|
+
const dependencyTreeIds = collectTreeDependencyIds(treeDependencyMap).filter(
|
|
205236
|
+
(treeId) => treeId !== journeyId
|
|
205237
|
+
);
|
|
205238
|
+
const multiTreeExport = createMultiTreeExportTemplate({ state: state2 });
|
|
205239
|
+
for (const dependencyTreeId of dependencyTreeIds) {
|
|
205240
|
+
const dependencyExport = resolveTreeExport === onlineTreeExportResolver ? await exportSingleJourney({
|
|
205241
|
+
journeyId: dependencyTreeId,
|
|
205242
|
+
options,
|
|
205243
|
+
state: state2
|
|
205244
|
+
}) : await resolveTreeExport(dependencyTreeId, state2);
|
|
205245
|
+
multiTreeExport.trees[dependencyTreeId] = stripExportMetadata(dependencyExport);
|
|
205246
|
+
}
|
|
205247
|
+
multiTreeExport.trees[journeyId] = stripExportMetadata(exportData);
|
|
205248
|
+
return multiTreeExport;
|
|
205249
|
+
}
|
|
205094
205250
|
async function exportJourneys({
|
|
205095
205251
|
options = {
|
|
205096
205252
|
useStringArrays: true,
|
|
@@ -205111,7 +205267,7 @@ async function exportJourneys({
|
|
|
205111
205267
|
const exportData = await getResult(
|
|
205112
205268
|
resultCallback,
|
|
205113
205269
|
`Error exporting the ${getCurrentRealmName(state2) + " realm"} journey ${tree._id}`,
|
|
205114
|
-
|
|
205270
|
+
exportSingleJourney,
|
|
205115
205271
|
{
|
|
205116
205272
|
journeyId: tree._id,
|
|
205117
205273
|
options,
|
|
@@ -205514,7 +205670,7 @@ async function importJourney({
|
|
|
205514
205670
|
try {
|
|
205515
205671
|
await createCircleOfTrust({ cotData, state: state2 });
|
|
205516
205672
|
} catch (error49) {
|
|
205517
|
-
if (_optionalChain([error49, 'access',
|
|
205673
|
+
if (_optionalChain([error49, 'access', _450 => _450.response, 'optionalAccess', _451 => _451.status]) === 409 || _optionalChain([error49, 'access', _452 => _452.response, 'optionalAccess', _453 => _453.status]) === 500) {
|
|
205518
205674
|
try {
|
|
205519
205675
|
await updateCircleOfTrust({ cotId, cotData, state: state2 });
|
|
205520
205676
|
} catch (updateCotErr) {
|
|
@@ -205600,17 +205756,17 @@ async function importJourney({
|
|
|
205600
205756
|
await updateNode({
|
|
205601
205757
|
nodeId: newUuid,
|
|
205602
205758
|
nodeType,
|
|
205603
|
-
nodeTypeVersion: _optionalChain([innerNodeData, 'access',
|
|
205759
|
+
nodeTypeVersion: _optionalChain([innerNodeData, 'access', _454 => _454["_type"], 'optionalAccess', _455 => _455["version"]]) || "1.0",
|
|
205604
205760
|
nodeData: innerNodeData,
|
|
205605
205761
|
state: state2
|
|
205606
205762
|
});
|
|
205607
205763
|
} catch (nodeImportError) {
|
|
205608
|
-
if (_optionalChain([nodeImportError, 'access',
|
|
205764
|
+
if (_optionalChain([nodeImportError, 'access', _456 => _456.response, 'optionalAccess', _457 => _457.status]) === 400 && _optionalChain([nodeImportError, 'access', _458 => _458.response, 'optionalAccess', _459 => _459.data, 'optionalAccess', _460 => _460.message]) === "Data validation failed for the attribute, Script") {
|
|
205609
205765
|
throw new FrodoError(
|
|
205610
205766
|
`Missing ${getCurrentRealmName(state2) + " realm"} script ${innerNodeData["script"]} referenced by inner node ${innerNodeId}${innerNodeId === newUuid ? "" : ` [${newUuid}]`} (${innerNodeData["_type"]["_id"]}) in journey ${treeId}`,
|
|
205611
205767
|
nodeImportError
|
|
205612
205768
|
);
|
|
205613
|
-
} else if (_optionalChain([nodeImportError, 'access',
|
|
205769
|
+
} else if (_optionalChain([nodeImportError, 'access', _461 => _461.response, 'optionalAccess', _462 => _462.status]) === 400 && _optionalChain([nodeImportError, 'access', _463 => _463.response, 'optionalAccess', _464 => _464.data, 'optionalAccess', _465 => _465.message]) === "Invalid attribute specified.") {
|
|
205614
205770
|
const { validAttributes } = nodeImportError.response.data.detail;
|
|
205615
205771
|
validAttributes.push("_id");
|
|
205616
205772
|
for (const attribute of Object.keys(innerNodeData)) {
|
|
@@ -205630,7 +205786,7 @@ async function importJourney({
|
|
|
205630
205786
|
await updateNode({
|
|
205631
205787
|
nodeId: newUuid,
|
|
205632
205788
|
nodeType,
|
|
205633
|
-
nodeTypeVersion: _optionalChain([innerNodeData, 'access',
|
|
205789
|
+
nodeTypeVersion: _optionalChain([innerNodeData, 'access', _466 => _466["_type"], 'optionalAccess', _467 => _467["version"]]) || "1.0",
|
|
205634
205790
|
nodeData: innerNodeData,
|
|
205635
205791
|
state: state2
|
|
205636
205792
|
});
|
|
@@ -205640,7 +205796,7 @@ async function importJourney({
|
|
|
205640
205796
|
nodeImportError2
|
|
205641
205797
|
);
|
|
205642
205798
|
}
|
|
205643
|
-
} else if (_optionalChain([nodeImportError, 'access',
|
|
205799
|
+
} else if (_optionalChain([nodeImportError, 'access', _468 => _468.response, 'optionalAccess', _469 => _469.status]) === 404) {
|
|
205644
205800
|
throw new FrodoError(
|
|
205645
205801
|
`Unable to import ${getCurrentRealmName(state2) + " realm"} node ${innerNodeId}${innerNodeId === newUuid ? "" : ` [${newUuid}]`} in journey ${treeId} because its type ${innerNodeData._type._id} doesn't exist in deployment`,
|
|
205646
205802
|
nodeImportError
|
|
@@ -205661,7 +205817,7 @@ async function importJourney({
|
|
|
205661
205817
|
for (let [nodeId, nodeData] of Object.entries(importData.nodes)) {
|
|
205662
205818
|
delete nodeData["_rev"];
|
|
205663
205819
|
const nodeType = nodeData["_type"]["_id"];
|
|
205664
|
-
const nodeTypeVersion = _optionalChain([nodeData, 'access',
|
|
205820
|
+
const nodeTypeVersion = _optionalChain([nodeData, 'access', _470 => _470["_type"], 'optionalAccess', _471 => _471["version"]]) || "1.0";
|
|
205665
205821
|
if (!reUuid) {
|
|
205666
205822
|
newUuid = nodeId;
|
|
205667
205823
|
} else {
|
|
@@ -205722,12 +205878,12 @@ async function importJourney({
|
|
|
205722
205878
|
state: state2
|
|
205723
205879
|
});
|
|
205724
205880
|
} catch (nodeImportError) {
|
|
205725
|
-
if (_optionalChain([nodeImportError, 'access',
|
|
205881
|
+
if (_optionalChain([nodeImportError, 'access', _472 => _472.response, 'optionalAccess', _473 => _473.status]) === 400 && _optionalChain([nodeImportError, 'access', _474 => _474.response, 'optionalAccess', _475 => _475.data, 'optionalAccess', _476 => _476.message]) === "Data validation failed for the attribute, Script") {
|
|
205726
205882
|
throw new FrodoError(
|
|
205727
205883
|
`Missing ${getCurrentRealmName(state2) + " realm"} script ${nodeData["script"]} referenced by node ${nodeId}${nodeId === newUuid ? "" : ` [${newUuid}]`} (${nodeData["_type"]["_id"]}) in journey ${treeId}`,
|
|
205728
205884
|
nodeImportError
|
|
205729
205885
|
);
|
|
205730
|
-
} else if (_optionalChain([nodeImportError, 'access',
|
|
205886
|
+
} else if (_optionalChain([nodeImportError, 'access', _477 => _477.response, 'optionalAccess', _478 => _478.status]) === 400 && _optionalChain([nodeImportError, 'access', _479 => _479.response, 'optionalAccess', _480 => _480.data, 'optionalAccess', _481 => _481.message]) === "Invalid attribute specified.") {
|
|
205731
205887
|
const { validAttributes } = nodeImportError.response.data.detail;
|
|
205732
205888
|
validAttributes.push("_id");
|
|
205733
205889
|
for (const attribute of Object.keys(nodeData)) {
|
|
@@ -205757,7 +205913,7 @@ async function importJourney({
|
|
|
205757
205913
|
nodeImportError2
|
|
205758
205914
|
);
|
|
205759
205915
|
}
|
|
205760
|
-
} else if (_optionalChain([nodeImportError, 'access',
|
|
205916
|
+
} else if (_optionalChain([nodeImportError, 'access', _482 => _482.response, 'optionalAccess', _483 => _483.status]) === 404) {
|
|
205761
205917
|
throw new FrodoError(
|
|
205762
205918
|
`Unable to import ${getCurrentRealmName(state2) + " realm"} node ${nodeId}${nodeId === newUuid ? "" : ` [${newUuid}]`} in journey ${treeId} because its type ${nodeData._type._id} doesn't exist in deployment`,
|
|
205763
205919
|
nodeImportError
|
|
@@ -205821,7 +205977,7 @@ async function importJourney({
|
|
|
205821
205977
|
state: state2
|
|
205822
205978
|
});
|
|
205823
205979
|
} catch (importError) {
|
|
205824
|
-
if (_optionalChain([importError, 'access',
|
|
205980
|
+
if (_optionalChain([importError, 'access', _484 => _484.response, 'optionalAccess', _485 => _485.status]) === 400 && _optionalChain([importError, 'access', _486 => _486.response, 'optionalAccess', _487 => _487.data, 'optionalAccess', _488 => _488.message]) === "Invalid attribute specified.") {
|
|
205825
205981
|
const { validAttributes } = importError.response.data.detail;
|
|
205826
205982
|
validAttributes.push("_id");
|
|
205827
205983
|
for (const attribute of Object.keys(importData.tree)) {
|
|
@@ -205889,8 +206045,11 @@ async function resolveDependencies(installedJorneys, journeyMap, unresolvedJourn
|
|
|
205889
206045
|
if ({}.hasOwnProperty.call(journeyMap, tree)) {
|
|
205890
206046
|
const dependencies = [];
|
|
205891
206047
|
for (const node2 in journeyMap[tree].nodes) {
|
|
205892
|
-
|
|
205893
|
-
|
|
206048
|
+
const dependency = getTreeDependencyId({
|
|
206049
|
+
nodeConfig: journeyMap[tree].nodes[node2]
|
|
206050
|
+
});
|
|
206051
|
+
if (dependency) {
|
|
206052
|
+
dependencies.push(dependency);
|
|
205894
206053
|
}
|
|
205895
206054
|
}
|
|
205896
206055
|
let allResolved = true;
|
|
@@ -206009,7 +206168,7 @@ function getNodeRef(nodeObj, singleTreeExport) {
|
|
|
206009
206168
|
}
|
|
206010
206169
|
var onlineTreeExportResolver = async function(treeId, state2) {
|
|
206011
206170
|
debugMessage({ message: `onlineTreeExportResolver(${treeId})`, state: state2 });
|
|
206012
|
-
return await
|
|
206171
|
+
return await exportSingleJourney({
|
|
206013
206172
|
journeyId: treeId,
|
|
206014
206173
|
options: {
|
|
206015
206174
|
deps: false,
|
|
@@ -206030,7 +206189,7 @@ var fileByIdTreeExportResolver = async function(treeId, state2) {
|
|
|
206030
206189
|
message: `fileByIdTreeExportResolver: resolved '${treeId}' to ${file2}`,
|
|
206031
206190
|
state: state2
|
|
206032
206191
|
});
|
|
206033
|
-
if (_optionalChain([jsonData, 'access',
|
|
206192
|
+
if (_optionalChain([jsonData, 'access', _489 => _489.tree, 'optionalAccess', _490 => _490._id]) === treeId) {
|
|
206034
206193
|
treeExport = jsonData;
|
|
206035
206194
|
} else if (jsonData.trees && jsonData.trees[treeId]) {
|
|
206036
206195
|
treeExport = jsonData.trees[treeId];
|
|
@@ -206049,7 +206208,7 @@ function createFileParamTreeExportResolver(file2, state2) {
|
|
|
206049
206208
|
let treeExport = createSingleTreeExportTemplate({ state: state2 });
|
|
206050
206209
|
try {
|
|
206051
206210
|
const jsonData = JSON.parse(fs52.default.readFileSync(file2, "utf8"));
|
|
206052
|
-
if (_optionalChain([jsonData, 'access',
|
|
206211
|
+
if (_optionalChain([jsonData, 'access', _491 => _491.tree, 'optionalAccess', _492 => _492._id]) === treeId) {
|
|
206053
206212
|
treeExport = jsonData;
|
|
206054
206213
|
} else if (jsonData.trees && jsonData.trees[treeId]) {
|
|
206055
206214
|
treeExport = jsonData.trees[treeId];
|
|
@@ -206085,23 +206244,24 @@ async function getTreeDescendents({
|
|
|
206085
206244
|
for (const [nodeId, node2] of Object.entries(treeExport.tree.nodes)) {
|
|
206086
206245
|
let innerTreeId;
|
|
206087
206246
|
try {
|
|
206088
|
-
|
|
206089
|
-
|
|
206090
|
-
|
|
206091
|
-
|
|
206092
|
-
|
|
206093
|
-
|
|
206247
|
+
innerTreeId = getTreeDependencyId({
|
|
206248
|
+
nodeType: node2.nodeType,
|
|
206249
|
+
nodeConfig: treeExport.nodes[nodeId]
|
|
206250
|
+
});
|
|
206251
|
+
if (innerTreeId && !resolvedTreeIds.includes(innerTreeId)) {
|
|
206252
|
+
const innerTreeExport = await resolveTreeExport(innerTreeId, state2);
|
|
206253
|
+
debugMessage({
|
|
206254
|
+
message: `resolved inner tree: ${innerTreeExport.tree._id}`,
|
|
206255
|
+
state: state2
|
|
206256
|
+
});
|
|
206257
|
+
dependencies.push(
|
|
206258
|
+
await getTreeDescendents({
|
|
206259
|
+
treeExport: innerTreeExport,
|
|
206260
|
+
resolveTreeExport,
|
|
206261
|
+
resolvedTreeIds,
|
|
206094
206262
|
state: state2
|
|
206095
|
-
})
|
|
206096
|
-
|
|
206097
|
-
await getTreeDescendents({
|
|
206098
|
-
treeExport: innerTreeExport,
|
|
206099
|
-
resolveTreeExport,
|
|
206100
|
-
resolvedTreeIds,
|
|
206101
|
-
state: state2
|
|
206102
|
-
})
|
|
206103
|
-
);
|
|
206104
|
-
}
|
|
206263
|
+
})
|
|
206264
|
+
);
|
|
206105
206265
|
}
|
|
206106
206266
|
} catch (error49) {
|
|
206107
206267
|
if (innerTreeId) {
|
|
@@ -206119,7 +206279,7 @@ function isConnectedNodeDeleteError(error49) {
|
|
|
206119
206279
|
if (error49 instanceof FrodoError && error49.getOriginalErrors().length > 0) {
|
|
206120
206280
|
return isConnectedNodeDeleteError(error49.getOriginalErrors()[0]);
|
|
206121
206281
|
}
|
|
206122
|
-
return axios_default.isAxiosError(error49) && _optionalChain([error49, 'access',
|
|
206282
|
+
return axios_default.isAxiosError(error49) && _optionalChain([error49, 'access', _493 => _493.response, 'optionalAccess', _494 => _494.status]) === 400 && _optionalChain([error49, 'access', _495 => _495.response, 'optionalAccess', _496 => _496.data, 'optionalAccess', _497 => _497.message]) === "Cannot delete a node that is connected in a tree.";
|
|
206123
206283
|
}
|
|
206124
206284
|
async function deleteJourney({
|
|
206125
206285
|
journeyId,
|
|
@@ -206153,7 +206313,7 @@ async function deleteJourney({
|
|
|
206153
206313
|
`Delete endpoint returned success but ${getCurrentRealmName(state2) + " realm"} journey ${journeyId} still exists`
|
|
206154
206314
|
);
|
|
206155
206315
|
} catch (error49) {
|
|
206156
|
-
if (!(axios_default.isAxiosError(error49) && _optionalChain([error49, 'access',
|
|
206316
|
+
if (!(axios_default.isAxiosError(error49) && _optionalChain([error49, 'access', _498 => _498.response, 'optionalAccess', _499 => _499.status]) === 404) && !(error49 instanceof FrodoError)) {
|
|
206157
206317
|
throw error49;
|
|
206158
206318
|
}
|
|
206159
206319
|
if (error49 instanceof FrodoError) {
|
|
@@ -206246,7 +206406,7 @@ async function deleteJourney({
|
|
|
206246
206406
|
state: state2
|
|
206247
206407
|
});
|
|
206248
206408
|
} catch (error49) {
|
|
206249
|
-
if (axios_default.isAxiosError(error49) && _optionalChain([error49, 'access',
|
|
206409
|
+
if (axios_default.isAxiosError(error49) && _optionalChain([error49, 'access', _500 => _500.response, 'optionalAccess', _501 => _501.data, 'optionalAccess', _502 => _502.code]) === 500 && error49.response.data.message === "Unable to read SMS config: Node did not exist") {
|
|
206250
206410
|
status.nodes[containerNode._id] = { status: "success" };
|
|
206251
206411
|
if (verbose)
|
|
206252
206412
|
printMessage({
|
|
@@ -207057,7 +207217,7 @@ async function exportResourceType({
|
|
|
207057
207217
|
debugMessage({ message: `ResourceTypeOps.exportResourceType: end`, state: state2 });
|
|
207058
207218
|
return exportData;
|
|
207059
207219
|
} catch (error49) {
|
|
207060
|
-
if (_optionalChain([error49, 'access',
|
|
207220
|
+
if (_optionalChain([error49, 'access', _503 => _503.response, 'optionalAccess', _504 => _504.status]) === 404) {
|
|
207061
207221
|
throw new FrodoError(
|
|
207062
207222
|
`${getCurrentRealmName(state2) + " realm"} resource type ${resourceTypeUuid} does not exist`,
|
|
207063
207223
|
error49
|
|
@@ -207154,7 +207314,7 @@ async function importResourceType({
|
|
|
207154
207314
|
try {
|
|
207155
207315
|
response = await createResourceType({ resourceTypeData, state: state2 });
|
|
207156
207316
|
} catch (createError) {
|
|
207157
|
-
if (_optionalChain([createError, 'access',
|
|
207317
|
+
if (_optionalChain([createError, 'access', _505 => _505.response, 'optionalAccess', _506 => _506.status]) === 409)
|
|
207158
207318
|
response = await putResourceType({
|
|
207159
207319
|
resourceTypeUuid: id7,
|
|
207160
207320
|
resourceTypeData,
|
|
@@ -207197,7 +207357,7 @@ async function importResourceTypeByName({
|
|
|
207197
207357
|
try {
|
|
207198
207358
|
response = await createResourceType({ resourceTypeData, state: state2 });
|
|
207199
207359
|
} catch (createError) {
|
|
207200
|
-
if (_optionalChain([createError, 'access',
|
|
207360
|
+
if (_optionalChain([createError, 'access', _507 => _507.response, 'optionalAccess', _508 => _508.status]) === 409)
|
|
207201
207361
|
response = await putResourceType({
|
|
207202
207362
|
resourceTypeUuid: id7,
|
|
207203
207363
|
resourceTypeData,
|
|
@@ -207239,7 +207399,7 @@ async function importFirstResourceType({
|
|
|
207239
207399
|
try {
|
|
207240
207400
|
response = await createResourceType({ resourceTypeData, state: state2 });
|
|
207241
207401
|
} catch (createError) {
|
|
207242
|
-
if (_optionalChain([createError, 'access',
|
|
207402
|
+
if (_optionalChain([createError, 'access', _509 => _509.response, 'optionalAccess', _510 => _510.status]) === 409)
|
|
207243
207403
|
response = await putResourceType({
|
|
207244
207404
|
resourceTypeUuid: id7,
|
|
207245
207405
|
resourceTypeData,
|
|
@@ -207277,7 +207437,7 @@ async function importResourceTypes({
|
|
|
207277
207437
|
try {
|
|
207278
207438
|
response.push(await createResourceType({ resourceTypeData, state: state2 }));
|
|
207279
207439
|
} catch (createError) {
|
|
207280
|
-
if (_optionalChain([createError, 'access',
|
|
207440
|
+
if (_optionalChain([createError, 'access', _511 => _511.response, 'optionalAccess', _512 => _512.status]) === 409)
|
|
207281
207441
|
response.push(
|
|
207282
207442
|
await putResourceType({
|
|
207283
207443
|
resourceTypeUuid: id7,
|
|
@@ -207832,7 +207992,7 @@ async function importPolicySet({
|
|
|
207832
207992
|
response = await createPolicySet({ policySetData, state: state2 });
|
|
207833
207993
|
imported.push(id7);
|
|
207834
207994
|
} catch (error49) {
|
|
207835
|
-
if (_optionalChain([error49, 'access',
|
|
207995
|
+
if (_optionalChain([error49, 'access', _513 => _513.response, 'optionalAccess', _514 => _514.status]) === 409) {
|
|
207836
207996
|
response = await updatePolicySet({ policySetData, state: state2 });
|
|
207837
207997
|
imported.push(id7);
|
|
207838
207998
|
} else throw error49;
|
|
@@ -207894,7 +208054,7 @@ async function importFirstPolicySet({
|
|
|
207894
208054
|
response = await createPolicySet({ policySetData, state: state2 });
|
|
207895
208055
|
imported.push(id7);
|
|
207896
208056
|
} catch (error49) {
|
|
207897
|
-
if (_optionalChain([error49, 'access',
|
|
208057
|
+
if (_optionalChain([error49, 'access', _515 => _515.response, 'optionalAccess', _516 => _516.status]) === 409) {
|
|
207898
208058
|
response = await updatePolicySet({ policySetData, state: state2 });
|
|
207899
208059
|
imported.push(id7);
|
|
207900
208060
|
} else throw error49;
|
|
@@ -207951,7 +208111,7 @@ async function importPolicySets({
|
|
|
207951
208111
|
try {
|
|
207952
208112
|
response.push(await createPolicySet({ policySetData, state: state2 }));
|
|
207953
208113
|
} catch (error49) {
|
|
207954
|
-
if (_optionalChain([error49, 'access',
|
|
208114
|
+
if (_optionalChain([error49, 'access', _517 => _517.response, 'optionalAccess', _518 => _518.status]) === 409) {
|
|
207955
208115
|
response.push(await updatePolicySet({ policySetData, state: state2 }));
|
|
207956
208116
|
} else throw error49;
|
|
207957
208117
|
}
|
|
@@ -209080,7 +209240,7 @@ async function exportScriptTypes({
|
|
|
209080
209240
|
state: state2
|
|
209081
209241
|
});
|
|
209082
209242
|
} catch (e) {
|
|
209083
|
-
if (e.httpStatus === 404 || _optionalChain([e, 'access',
|
|
209243
|
+
if (e.httpStatus === 404 || _optionalChain([e, 'access', _519 => _519.response, 'optionalAccess', _520 => _520.status]) === 404) {
|
|
209084
209244
|
} else {
|
|
209085
209245
|
printMessage({
|
|
209086
209246
|
message: `Unable to get engine configuration for script type '${scriptType._id}': ${e.message}`,
|
|
@@ -209655,7 +209815,7 @@ async function readSecretStores({
|
|
|
209655
209815
|
})
|
|
209656
209816
|
);
|
|
209657
209817
|
} catch (e) {
|
|
209658
|
-
if (_optionalChain([e, 'access',
|
|
209818
|
+
if (_optionalChain([e, 'access', _521 => _521.response, 'optionalAccess', _522 => _522.status]) === 403 && _optionalChain([e, 'access', _523 => _523.response, 'optionalAccess', _524 => _524.data, 'optionalAccess', _525 => _525.message]) === "This operation is not available in PingOne Advanced Identity Cloud.") {
|
|
209659
209819
|
return result;
|
|
209660
209820
|
}
|
|
209661
209821
|
throw e;
|
|
@@ -209881,7 +210041,7 @@ async function importSecretStores({
|
|
|
209881
210041
|
continue;
|
|
209882
210042
|
}
|
|
209883
210043
|
if (secretStoreId && !secretStoreTypeId)
|
|
209884
|
-
secretStoreTypeId = _optionalChain([secretStore, 'access',
|
|
210044
|
+
secretStoreTypeId = _optionalChain([secretStore, 'access', _526 => _526._type, 'optionalAccess', _527 => _527._id]) || (await findSecretStore({ secretStoreId, globalConfig: globalConfig2, state: state2 }))._type._id;
|
|
209885
210045
|
const isCloudDeployment = state2.getDeploymentType() === Constants_default.CLOUD_DEPLOYMENT_TYPE_KEY;
|
|
209886
210046
|
let result = secretStore;
|
|
209887
210047
|
const secretStoreMappings = secretStore.mappings;
|
|
@@ -210366,7 +210526,7 @@ async function getListOfServices2({
|
|
|
210366
210526
|
debugMessage({ message: `ServiceOps.getListOfServices: end`, state: state2 });
|
|
210367
210527
|
return services;
|
|
210368
210528
|
} catch (error49) {
|
|
210369
|
-
if (_optionalChain([error49, 'access',
|
|
210529
|
+
if (_optionalChain([error49, 'access', _528 => _528.response, 'optionalAccess', _529 => _529.status]) === 403 && _optionalChain([error49, 'access', _530 => _530.response, 'optionalAccess', _531 => _531.data, 'optionalAccess', _532 => _532.message]) === "This operation is not available in PingOne Advanced Identity Cloud.") {
|
|
210370
210530
|
return [];
|
|
210371
210531
|
} else {
|
|
210372
210532
|
throw new FrodoError(
|
|
@@ -210402,8 +210562,8 @@ async function getFullServices({
|
|
|
210402
210562
|
nextDescendents
|
|
210403
210563
|
};
|
|
210404
210564
|
} catch (error49) {
|
|
210405
|
-
if (!(_optionalChain([error49, 'access',
|
|
210406
|
-
const message = _optionalChain([error49, 'access',
|
|
210565
|
+
if (!(_optionalChain([error49, 'access', _533 => _533.response, 'optionalAccess', _534 => _534.status]) === 403 && _optionalChain([error49, 'access', _535 => _535.response, 'optionalAccess', _536 => _536.data, 'optionalAccess', _537 => _537.message]) === "This operation is not available in PingOne Advanced Identity Cloud.")) {
|
|
210566
|
+
const message = _optionalChain([error49, 'access', _538 => _538.response, 'optionalAccess', _539 => _539.data, 'optionalAccess', _540 => _540.message]);
|
|
210407
210567
|
printMessage({
|
|
210408
210568
|
message: `Unable to retrieve data for ${listItem._id} with error: ${message}`,
|
|
210409
210569
|
type: "error",
|
|
@@ -210435,16 +210595,17 @@ async function putFullService({
|
|
|
210435
210595
|
state: state2
|
|
210436
210596
|
});
|
|
210437
210597
|
const fullServiceDataCopy = cloneDeep(fullServiceData);
|
|
210438
|
-
const nextDescendents =
|
|
210439
|
-
|
|
210440
|
-
delete
|
|
210441
|
-
delete
|
|
210598
|
+
const nextDescendents = fullServiceDataCopy.nextDescendents;
|
|
210599
|
+
const transportType = fullServiceDataCopy.transportType;
|
|
210600
|
+
delete fullServiceDataCopy.nextDescendents;
|
|
210601
|
+
delete fullServiceDataCopy._rev;
|
|
210602
|
+
delete fullServiceDataCopy.enabled;
|
|
210442
210603
|
if (clean) {
|
|
210443
210604
|
try {
|
|
210444
210605
|
debugMessage({ message: `ServiceOps.putFullService: clean`, state: state2 });
|
|
210445
210606
|
await deleteFullService({ serviceId, globalConfig: globalConfig2, state: state2 });
|
|
210446
210607
|
} catch (error49) {
|
|
210447
|
-
if (!(_optionalChain([error49, 'access',
|
|
210608
|
+
if (!(_optionalChain([error49, 'access', _541 => _541.response, 'optionalAccess', _542 => _542.status]) === 404 && _optionalChain([error49, 'access', _543 => _543.response, 'optionalAccess', _544 => _544.data, 'optionalAccess', _545 => _545.message]) === "Not Found")) {
|
|
210448
210609
|
throw new FrodoError(
|
|
210449
210610
|
`Error deleting service '${serviceId}' before import`,
|
|
210450
210611
|
error49
|
|
@@ -210452,13 +210613,13 @@ async function putFullService({
|
|
|
210452
210613
|
}
|
|
210453
210614
|
}
|
|
210454
210615
|
}
|
|
210455
|
-
delete
|
|
210456
|
-
if (serviceId === "email" &&
|
|
210457
|
-
delete
|
|
210616
|
+
delete fullServiceDataCopy.location;
|
|
210617
|
+
if (serviceId === "email" && transportType) {
|
|
210618
|
+
delete fullServiceDataCopy.transportType;
|
|
210458
210619
|
}
|
|
210459
210620
|
let result = await putService({
|
|
210460
210621
|
serviceId,
|
|
210461
|
-
serviceData:
|
|
210622
|
+
serviceData: fullServiceDataCopy,
|
|
210462
210623
|
globalConfig: globalConfig2,
|
|
210463
210624
|
state: state2
|
|
210464
210625
|
});
|
|
@@ -210499,11 +210660,11 @@ async function putFullService({
|
|
|
210499
210660
|
return result2;
|
|
210500
210661
|
})
|
|
210501
210662
|
);
|
|
210502
|
-
if (serviceId === "email" &&
|
|
210503
|
-
|
|
210663
|
+
if (serviceId === "email" && transportType) {
|
|
210664
|
+
fullServiceDataCopy.transportType = transportType;
|
|
210504
210665
|
result = await putService({
|
|
210505
210666
|
serviceId,
|
|
210506
|
-
serviceData:
|
|
210667
|
+
serviceData: fullServiceDataCopy,
|
|
210507
210668
|
globalConfig: globalConfig2,
|
|
210508
210669
|
state: state2
|
|
210509
210670
|
});
|
|
@@ -210624,8 +210785,8 @@ async function deleteFullServices({
|
|
|
210624
210785
|
state: state2
|
|
210625
210786
|
});
|
|
210626
210787
|
} catch (error49) {
|
|
210627
|
-
if (!(_optionalChain([error49, 'access',
|
|
210628
|
-
const message = _optionalChain([error49, 'access',
|
|
210788
|
+
if (!(_optionalChain([error49, 'access', _546 => _546.response, 'optionalAccess', _547 => _547.status]) === 403 && _optionalChain([error49, 'access', _548 => _548.response, 'optionalAccess', _549 => _549.data, 'optionalAccess', _550 => _550.message]) === "This operation is not available in PingOne Advanced Identity Cloud.")) {
|
|
210789
|
+
const message = _optionalChain([error49, 'access', _551 => _551.response, 'optionalAccess', _552 => _552.data, 'optionalAccess', _553 => _553.message]);
|
|
210629
210790
|
printMessage({
|
|
210630
210791
|
message: `Delete service '${serviceListItem._id}': ${message}`,
|
|
210631
210792
|
state: state2,
|
|
@@ -210907,14 +211068,14 @@ async function exportFullConfiguration({
|
|
|
210907
211068
|
"Global Agents",
|
|
210908
211069
|
resultCallback,
|
|
210909
211070
|
isFullAmDeployment
|
|
210910
|
-
)), 'optionalAccess', async
|
|
211071
|
+
)), 'optionalAccess', async _554 => _554.agent]),
|
|
210911
211072
|
authentication: await _asyncOptionalChain([(await exportWithErrorHandling(
|
|
210912
211073
|
exportAuthenticationSettings,
|
|
210913
211074
|
globalStateObj,
|
|
210914
211075
|
"Global Authentication Settings",
|
|
210915
211076
|
resultCallback,
|
|
210916
211077
|
isFullAmDeployment
|
|
210917
|
-
)), 'optionalAccess', async
|
|
211078
|
+
)), 'optionalAccess', async _555 => _555.authentication]),
|
|
210918
211079
|
certificationTemplate: await _asyncOptionalChain([(await exportWithErrorHandling(
|
|
210919
211080
|
exportCertificationTemplates,
|
|
210920
211081
|
{
|
|
@@ -210926,14 +211087,14 @@ async function exportFullConfiguration({
|
|
|
210926
211087
|
"Certification Templates",
|
|
210927
211088
|
resultCallback,
|
|
210928
211089
|
!!state2.getIsIGA()
|
|
210929
|
-
)), 'optionalAccess', async
|
|
211090
|
+
)), 'optionalAccess', async _556 => _556.certificationTemplate]),
|
|
210930
211091
|
emailTemplate: await _asyncOptionalChain([(await exportWithErrorHandling(
|
|
210931
211092
|
exportEmailTemplates,
|
|
210932
211093
|
{ includeDefault: includeReadOnly, state: state2 },
|
|
210933
211094
|
"Email Templates",
|
|
210934
211095
|
resultCallback,
|
|
210935
211096
|
isIdmDeployment
|
|
210936
|
-
)), 'optionalAccess', async
|
|
211097
|
+
)), 'optionalAccess', async _557 => _557.emailTemplate]),
|
|
210937
211098
|
event: await _asyncOptionalChain([(await exportWithErrorHandling(
|
|
210938
211099
|
exportEvents,
|
|
210939
211100
|
{
|
|
@@ -210945,7 +211106,7 @@ async function exportFullConfiguration({
|
|
|
210945
211106
|
"Events",
|
|
210946
211107
|
resultCallback,
|
|
210947
211108
|
!!state2.getIsIGA()
|
|
210948
|
-
)), 'optionalAccess', async
|
|
211109
|
+
)), 'optionalAccess', async _558 => _558.event]),
|
|
210949
211110
|
glossarySchema: await _asyncOptionalChain([(await exportWithErrorHandling(
|
|
210950
211111
|
exportGlossarySchemas,
|
|
210951
211112
|
{
|
|
@@ -210957,7 +211118,7 @@ async function exportFullConfiguration({
|
|
|
210957
211118
|
"Glossary Schemas",
|
|
210958
211119
|
resultCallback,
|
|
210959
211120
|
!!state2.getIsIGA()
|
|
210960
|
-
)), 'optionalAccess', async
|
|
211121
|
+
)), 'optionalAccess', async _559 => _559.glossarySchema]),
|
|
210961
211122
|
idm: await _asyncOptionalChain([(await exportWithErrorHandling(
|
|
210962
211123
|
exportConfigEntities,
|
|
210963
211124
|
{
|
|
@@ -210971,15 +211132,15 @@ async function exportFullConfiguration({
|
|
|
210971
211132
|
"IDM Config Entities",
|
|
210972
211133
|
resultCallback,
|
|
210973
211134
|
isIdmDeployment
|
|
210974
|
-
)), 'optionalAccess', async
|
|
211135
|
+
)), 'optionalAccess', async _560 => _560.idm]),
|
|
210975
211136
|
internalRole: await _asyncOptionalChain([(await exportWithErrorHandling(
|
|
210976
211137
|
exportInternalRoles,
|
|
210977
211138
|
stateObj,
|
|
210978
211139
|
"Internal Roles",
|
|
210979
211140
|
resultCallback,
|
|
210980
211141
|
isIdmDeployment
|
|
210981
|
-
)), 'optionalAccess', async
|
|
210982
|
-
mapping: _optionalChain([mappings, 'optionalAccess',
|
|
211142
|
+
)), 'optionalAccess', async _561 => _561.internalRole]),
|
|
211143
|
+
mapping: _optionalChain([mappings, 'optionalAccess', _562 => _562.mapping]),
|
|
210983
211144
|
nodeTypes: await _asyncOptionalChain([(await exportWithErrorHandling(
|
|
210984
211145
|
exportCustomNodes,
|
|
210985
211146
|
{
|
|
@@ -210990,14 +211151,14 @@ async function exportFullConfiguration({
|
|
|
210990
211151
|
},
|
|
210991
211152
|
"Custom Nodes",
|
|
210992
211153
|
resultCallback
|
|
210993
|
-
)), 'optionalAccess', async
|
|
211154
|
+
)), 'optionalAccess', async _563 => _563.nodeTypes]),
|
|
210994
211155
|
realm: await _asyncOptionalChain([(await exportWithErrorHandling(
|
|
210995
211156
|
exportRealms,
|
|
210996
211157
|
stateObj,
|
|
210997
211158
|
"Realms",
|
|
210998
211159
|
resultCallback,
|
|
210999
211160
|
includeReadOnly || isFullAmDeployment
|
|
211000
|
-
)), 'optionalAccess', async
|
|
211161
|
+
)), 'optionalAccess', async _564 => _564.realm]),
|
|
211001
211162
|
requestForm: await _asyncOptionalChain([(await exportWithErrorHandling(
|
|
211002
211163
|
exportRequestForms,
|
|
211003
211164
|
{
|
|
@@ -211011,7 +211172,7 @@ async function exportFullConfiguration({
|
|
|
211011
211172
|
"Request Forms",
|
|
211012
211173
|
resultCallback,
|
|
211013
211174
|
!!state2.getIsIGA()
|
|
211014
|
-
)), 'optionalAccess', async
|
|
211175
|
+
)), 'optionalAccess', async _565 => _565.requestForm]),
|
|
211015
211176
|
requestType: await _asyncOptionalChain([(await exportWithErrorHandling(
|
|
211016
211177
|
exportRequestTypes,
|
|
211017
211178
|
{
|
|
@@ -211024,43 +211185,43 @@ async function exportFullConfiguration({
|
|
|
211024
211185
|
"Request Types",
|
|
211025
211186
|
resultCallback,
|
|
211026
211187
|
!!state2.getIsIGA()
|
|
211027
|
-
)), 'optionalAccess', async
|
|
211188
|
+
)), 'optionalAccess', async _566 => _566.requestType]),
|
|
211028
211189
|
scripttype: await _asyncOptionalChain([(await exportWithErrorHandling(
|
|
211029
211190
|
exportScriptTypes,
|
|
211030
211191
|
stateObj,
|
|
211031
211192
|
"Script Types",
|
|
211032
211193
|
resultCallback,
|
|
211033
211194
|
includeReadOnly || isFullAmDeployment
|
|
211034
|
-
)), 'optionalAccess', async
|
|
211195
|
+
)), 'optionalAccess', async _567 => _567.scripttype]),
|
|
211035
211196
|
secret: await _asyncOptionalChain([(await exportWithErrorHandling(
|
|
211036
211197
|
exportSecrets,
|
|
211037
211198
|
{ options: { includeActiveValues, target }, state: state2 },
|
|
211038
211199
|
"ESV Secrets",
|
|
211039
211200
|
resultCallback,
|
|
211040
211201
|
isCloudDeployment
|
|
211041
|
-
)), 'optionalAccess', async
|
|
211202
|
+
)), 'optionalAccess', async _568 => _568.secret]),
|
|
211042
211203
|
secretstore: await _asyncOptionalChain([(await exportWithErrorHandling(
|
|
211043
211204
|
exportSecretStores,
|
|
211044
211205
|
globalStateObj,
|
|
211045
211206
|
"Global Secret Stores",
|
|
211046
211207
|
resultCallback,
|
|
211047
211208
|
isFullAmDeployment
|
|
211048
|
-
)), 'optionalAccess', async
|
|
211209
|
+
)), 'optionalAccess', async _569 => _569.secretstore]),
|
|
211049
211210
|
server: serverExport,
|
|
211050
211211
|
service: await _asyncOptionalChain([(await exportWithErrorHandling(
|
|
211051
211212
|
exportServices,
|
|
211052
211213
|
globalStateObj,
|
|
211053
211214
|
"Services",
|
|
211054
211215
|
resultCallback
|
|
211055
|
-
)), 'optionalAccess', async
|
|
211216
|
+
)), 'optionalAccess', async _570 => _570.service]),
|
|
211056
211217
|
site: await _asyncOptionalChain([(await exportWithErrorHandling(
|
|
211057
211218
|
exportSites,
|
|
211058
211219
|
stateObj,
|
|
211059
211220
|
"Sites",
|
|
211060
211221
|
resultCallback,
|
|
211061
211222
|
isFullAmDeployment
|
|
211062
|
-
)), 'optionalAccess', async
|
|
211063
|
-
sync: _optionalChain([mappings, 'optionalAccess',
|
|
211223
|
+
)), 'optionalAccess', async _571 => _571.site]),
|
|
211224
|
+
sync: _optionalChain([mappings, 'optionalAccess', _572 => _572.sync]),
|
|
211064
211225
|
variable: await _asyncOptionalChain([(await exportWithErrorHandling(
|
|
211065
211226
|
exportVariables,
|
|
211066
211227
|
{
|
|
@@ -211070,7 +211231,7 @@ async function exportFullConfiguration({
|
|
|
211070
211231
|
"ESV Variables",
|
|
211071
211232
|
resultCallback,
|
|
211072
211233
|
isCloudDeployment
|
|
211073
|
-
)), 'optionalAccess', async
|
|
211234
|
+
)), 'optionalAccess', async _573 => _573.variable]),
|
|
211074
211235
|
workflow: await _asyncOptionalChain([(await exportWithErrorHandling(
|
|
211075
211236
|
exportWorkflows,
|
|
211076
211237
|
{
|
|
@@ -211086,7 +211247,7 @@ async function exportFullConfiguration({
|
|
|
211086
211247
|
"Workflows",
|
|
211087
211248
|
resultCallback,
|
|
211088
211249
|
!!state2.getIsIGA()
|
|
211089
|
-
)), 'optionalAccess', async
|
|
211250
|
+
)), 'optionalAccess', async _574 => _574.workflow]),
|
|
211090
211251
|
...config5.global
|
|
211091
211252
|
};
|
|
211092
211253
|
if (globalConfig2.idm) {
|
|
@@ -211096,7 +211257,7 @@ async function exportFullConfiguration({
|
|
|
211096
211257
|
}
|
|
211097
211258
|
if (globalConfig2.event && globalConfig2.certificationTemplate) {
|
|
211098
211259
|
const eventTemplateIds = new Set(
|
|
211099
|
-
Object.values(globalConfig2.event).map((e) => _optionalChain([e, 'access',
|
|
211260
|
+
Object.values(globalConfig2.event).map((e) => _optionalChain([e, 'access', _575 => _575.action, 'optionalAccess', _576 => _576.template, 'optionalAccess', _577 => _577.id])).filter((i2) => i2)
|
|
211100
211261
|
);
|
|
211101
211262
|
const templateIds = Object.keys(globalConfig2.certificationTemplate);
|
|
211102
211263
|
for (const templateId of templateIds) {
|
|
@@ -211120,7 +211281,7 @@ async function exportFullConfiguration({
|
|
|
211120
211281
|
stateObj,
|
|
211121
211282
|
"SAML2 Providers",
|
|
211122
211283
|
resultCallback
|
|
211123
|
-
)), 'optionalAccess', async
|
|
211284
|
+
)), 'optionalAccess', async _578 => _578.saml]);
|
|
211124
211285
|
const cotExport = await exportWithErrorHandling(
|
|
211125
211286
|
exportCirclesOfTrust,
|
|
211126
211287
|
stateObj,
|
|
@@ -211128,9 +211289,9 @@ async function exportFullConfiguration({
|
|
|
211128
211289
|
resultCallback
|
|
211129
211290
|
);
|
|
211130
211291
|
if (saml) {
|
|
211131
|
-
saml.cot = _optionalChain([cotExport, 'optionalAccess',
|
|
211292
|
+
saml.cot = _optionalChain([cotExport, 'optionalAccess', _579 => _579.saml, 'access', _580 => _580.cot]);
|
|
211132
211293
|
} else {
|
|
211133
|
-
saml = _optionalChain([cotExport, 'optionalAccess',
|
|
211294
|
+
saml = _optionalChain([cotExport, 'optionalAccess', _581 => _581.saml]);
|
|
211134
211295
|
}
|
|
211135
211296
|
realmConfig[realm2] = {
|
|
211136
211297
|
agentGroup: await _asyncOptionalChain([(await exportWithErrorHandling(
|
|
@@ -211138,13 +211299,13 @@ async function exportFullConfiguration({
|
|
|
211138
211299
|
stateObj,
|
|
211139
211300
|
"Agent Groups",
|
|
211140
211301
|
resultCallback
|
|
211141
|
-
)), 'optionalAccess', async
|
|
211302
|
+
)), 'optionalAccess', async _582 => _582.agentGroup]),
|
|
211142
211303
|
agent: await _asyncOptionalChain([(await exportWithErrorHandling(
|
|
211143
211304
|
exportAgents,
|
|
211144
211305
|
realmStateObj,
|
|
211145
211306
|
"Agents",
|
|
211146
211307
|
resultCallback
|
|
211147
|
-
)), 'optionalAccess', async
|
|
211308
|
+
)), 'optionalAccess', async _583 => _583.agent]),
|
|
211148
211309
|
application: await _asyncOptionalChain([(await exportWithErrorHandling(
|
|
211149
211310
|
exportOAuth2Clients,
|
|
211150
211311
|
{
|
|
@@ -211153,19 +211314,19 @@ async function exportFullConfiguration({
|
|
|
211153
211314
|
},
|
|
211154
211315
|
"OAuth2 Client Applications",
|
|
211155
211316
|
resultCallback
|
|
211156
|
-
)), 'optionalAccess', async
|
|
211317
|
+
)), 'optionalAccess', async _584 => _584.application]),
|
|
211157
211318
|
authentication: await _asyncOptionalChain([(await exportWithErrorHandling(
|
|
211158
211319
|
exportAuthenticationSettings,
|
|
211159
211320
|
realmStateObj,
|
|
211160
211321
|
"Authentication Settings",
|
|
211161
211322
|
resultCallback
|
|
211162
|
-
)), 'optionalAccess', async
|
|
211323
|
+
)), 'optionalAccess', async _585 => _585.authentication]),
|
|
211163
211324
|
idp: await _asyncOptionalChain([(await exportWithErrorHandling(
|
|
211164
211325
|
exportSocialIdentityProviders,
|
|
211165
211326
|
stateObj,
|
|
211166
211327
|
"Social Identity Providers",
|
|
211167
211328
|
resultCallback
|
|
211168
|
-
)), 'optionalAccess', async
|
|
211329
|
+
)), 'optionalAccess', async _586 => _586.idp]),
|
|
211169
211330
|
trees: await _asyncOptionalChain([(await exportWithErrorHandling(
|
|
211170
211331
|
exportJourneys,
|
|
211171
211332
|
{
|
|
@@ -211179,7 +211340,7 @@ async function exportFullConfiguration({
|
|
|
211179
211340
|
},
|
|
211180
211341
|
"Journeys",
|
|
211181
211342
|
resultCallback
|
|
211182
|
-
)), 'optionalAccess', async
|
|
211343
|
+
)), 'optionalAccess', async _587 => _587.trees]),
|
|
211183
211344
|
managedApplication: await _asyncOptionalChain([(await exportWithErrorHandling(
|
|
211184
211345
|
exportApplications,
|
|
211185
211346
|
{
|
|
@@ -211189,7 +211350,7 @@ async function exportFullConfiguration({
|
|
|
211189
211350
|
"Applications",
|
|
211190
211351
|
resultCallback,
|
|
211191
211352
|
isIdmDeployment
|
|
211192
|
-
)), 'optionalAccess', async
|
|
211353
|
+
)), 'optionalAccess', async _588 => _588.managedApplication]),
|
|
211193
211354
|
policy: await _asyncOptionalChain([(await exportWithErrorHandling(
|
|
211194
211355
|
exportPolicies,
|
|
211195
211356
|
{
|
|
@@ -211198,7 +211359,7 @@ async function exportFullConfiguration({
|
|
|
211198
211359
|
},
|
|
211199
211360
|
"Policies",
|
|
211200
211361
|
resultCallback
|
|
211201
|
-
)), 'optionalAccess', async
|
|
211362
|
+
)), 'optionalAccess', async _589 => _589.policy]),
|
|
211202
211363
|
policyset: await _asyncOptionalChain([(await exportWithErrorHandling(
|
|
211203
211364
|
exportPolicySets,
|
|
211204
211365
|
{
|
|
@@ -211207,13 +211368,13 @@ async function exportFullConfiguration({
|
|
|
211207
211368
|
},
|
|
211208
211369
|
"Policy Sets",
|
|
211209
211370
|
resultCallback
|
|
211210
|
-
)), 'optionalAccess', async
|
|
211371
|
+
)), 'optionalAccess', async _590 => _590.policyset]),
|
|
211211
211372
|
resourcetype: await _asyncOptionalChain([(await exportWithErrorHandling(
|
|
211212
211373
|
exportResourceTypes,
|
|
211213
211374
|
stateObj,
|
|
211214
211375
|
"Resource Types",
|
|
211215
211376
|
resultCallback
|
|
211216
|
-
)), 'optionalAccess', async
|
|
211377
|
+
)), 'optionalAccess', async _591 => _591.resourcetype]),
|
|
211217
211378
|
saml,
|
|
211218
211379
|
script: await _asyncOptionalChain([(await exportWithErrorHandling(
|
|
211219
211380
|
exportScripts,
|
|
@@ -211228,19 +211389,19 @@ async function exportFullConfiguration({
|
|
|
211228
211389
|
},
|
|
211229
211390
|
"Scripts",
|
|
211230
211391
|
resultCallback
|
|
211231
|
-
)), 'optionalAccess', async
|
|
211392
|
+
)), 'optionalAccess', async _592 => _592.script]),
|
|
211232
211393
|
secretstore: await _asyncOptionalChain([(await exportWithErrorHandling(
|
|
211233
211394
|
exportSecretStores,
|
|
211234
211395
|
realmStateObj,
|
|
211235
211396
|
"Secret Stores",
|
|
211236
211397
|
resultCallback
|
|
211237
|
-
)), 'optionalAccess', async
|
|
211398
|
+
)), 'optionalAccess', async _593 => _593.secretstore]),
|
|
211238
211399
|
service: await _asyncOptionalChain([(await exportWithErrorHandling(
|
|
211239
211400
|
exportServices,
|
|
211240
211401
|
realmStateObj,
|
|
211241
211402
|
"Services",
|
|
211242
211403
|
resultCallback
|
|
211243
|
-
)), 'optionalAccess', async
|
|
211404
|
+
)), 'optionalAccess', async _594 => _594.service]),
|
|
211244
211405
|
theme: await _asyncOptionalChain([(await exportWithErrorHandling(
|
|
211245
211406
|
exportThemes,
|
|
211246
211407
|
{
|
|
@@ -211249,7 +211410,7 @@ async function exportFullConfiguration({
|
|
|
211249
211410
|
"Themes",
|
|
211250
211411
|
resultCallback,
|
|
211251
211412
|
isIdmDeployment
|
|
211252
|
-
)), 'optionalAccess', async
|
|
211413
|
+
)), 'optionalAccess', async _595 => _595.theme]),
|
|
211253
211414
|
trustedJwtIssuer: await _asyncOptionalChain([(await exportWithErrorHandling(
|
|
211254
211415
|
exportOAuth2TrustedJwtIssuers,
|
|
211255
211416
|
{
|
|
@@ -211258,7 +211419,7 @@ async function exportFullConfiguration({
|
|
|
211258
211419
|
},
|
|
211259
211420
|
"Trusted JWT Issuers",
|
|
211260
211421
|
resultCallback
|
|
211261
|
-
)), 'optionalAccess', async
|
|
211422
|
+
)), 'optionalAccess', async _596 => _596.trustedJwtIssuer]),
|
|
211262
211423
|
...config5.realm[realm2]
|
|
211263
211424
|
};
|
|
211264
211425
|
if (realmConfig[realm2].service && realmConfig[realm2].service["SocialIdentityProviders"]) {
|
|
@@ -212994,13 +213155,13 @@ async function getUserCount({
|
|
|
212994
213155
|
}).get(urlString, {
|
|
212995
213156
|
withCredentials: true
|
|
212996
213157
|
});
|
|
212997
|
-
if (typeof _optionalChain([data2, 'optionalAccess',
|
|
213158
|
+
if (typeof _optionalChain([data2, 'optionalAccess', _597 => _597.totalPagedResults]) === "number" && data2.totalPagedResults >= 0) {
|
|
212998
213159
|
return data2.totalPagedResults;
|
|
212999
213160
|
}
|
|
213000
|
-
if (typeof _optionalChain([data2, 'optionalAccess',
|
|
213161
|
+
if (typeof _optionalChain([data2, 'optionalAccess', _598 => _598.resultCount]) === "number" && data2.resultCount >= 0) {
|
|
213001
213162
|
return data2.resultCount;
|
|
213002
213163
|
}
|
|
213003
|
-
return Array.isArray(_optionalChain([data2, 'optionalAccess',
|
|
213164
|
+
return Array.isArray(_optionalChain([data2, 'optionalAccess', _599 => _599.result])) ? data2.result.length : 0;
|
|
213004
213165
|
}
|
|
213005
213166
|
async function getUserConfig({
|
|
213006
213167
|
userId,
|
|
@@ -213060,7 +213221,7 @@ async function getUserConfig({
|
|
|
213060
213221
|
current = current[part];
|
|
213061
213222
|
}
|
|
213062
213223
|
} catch (e) {
|
|
213063
|
-
if (e.httpStatus === 404 || _optionalChain([e, 'access',
|
|
213224
|
+
if (e.httpStatus === 404 || _optionalChain([e, 'access', _600 => _600.response, 'optionalAccess', _601 => _601.status]) === 404) {
|
|
213064
213225
|
} else {
|
|
213065
213226
|
printMessage({
|
|
213066
213227
|
message: `Error exporting config for user with id '${userId}' from url '${urlString}': ${e.message}`,
|
|
@@ -215650,13 +215811,13 @@ var helpMetadata = [
|
|
|
215650
215811
|
{
|
|
215651
215812
|
typeName: "Journey",
|
|
215652
215813
|
methodName: "exportJourney",
|
|
215653
|
-
signature: "exportJourney( treeId: string, options?: TreeExportOptions ): Promise<
|
|
215814
|
+
signature: "exportJourney( treeId: string, options?: TreeExportOptions ): Promise<MultiTreeExportInterface>",
|
|
215654
215815
|
description: "Create export data for a tree/journey with all its nodes and dependencies. The export data can be written to a file as is.",
|
|
215655
215816
|
params: [
|
|
215656
215817
|
{ name: "treeId", type: "string", description: "tree id/name" },
|
|
215657
215818
|
{ name: "options", type: "TreeExportOptions", description: "export options" }
|
|
215658
215819
|
],
|
|
215659
|
-
returns: "{Promise<
|
|
215820
|
+
returns: "{Promise<MultiTreeExportInterface>} a promise that resolves to an object containing the tree and any exported dependencies"
|
|
215660
215821
|
},
|
|
215661
215822
|
{
|
|
215662
215823
|
typeName: "Journey",
|
|
@@ -217605,9 +217766,11 @@ var helpMetadata = [
|
|
|
217605
217766
|
{
|
|
217606
217767
|
typeName: "Script",
|
|
217607
217768
|
methodName: "readScripts",
|
|
217608
|
-
signature: "readScripts(): Promise<ScriptSkeleton[]>",
|
|
217769
|
+
signature: "readScripts(filter?: ScriptFilter): Promise<ScriptSkeleton[]>",
|
|
217609
217770
|
description: "Read all scripts",
|
|
217610
|
-
params: [
|
|
217771
|
+
params: [
|
|
217772
|
+
{ name: "filter", type: "ScriptFilter", description: "Optional script filter" }
|
|
217773
|
+
],
|
|
217611
217774
|
returns: "{Promise<ScriptSkeleton[]>} a promise that resolves to an array of script objects"
|
|
217612
217775
|
},
|
|
217613
217776
|
{
|
|
@@ -217686,10 +217849,11 @@ var helpMetadata = [
|
|
|
217686
217849
|
{
|
|
217687
217850
|
typeName: "Script",
|
|
217688
217851
|
methodName: "deleteScripts",
|
|
217689
|
-
signature: "deleteScripts( resultCallback?: ResultCallback<ScriptSkeleton
|
|
217852
|
+
signature: "deleteScripts( resultCallback?: ResultCallback<ScriptSkeleton>, filter?: ScriptFilter ): Promise<ScriptSkeleton[]>",
|
|
217690
217853
|
description: "Delete all non-default scripts",
|
|
217691
217854
|
params: [
|
|
217692
|
-
{ name: "resultCallback", type: "ResultCallback", description: "Optional callback to process individual results" }
|
|
217855
|
+
{ name: "resultCallback", type: "ResultCallback", description: "Optional callback to process individual results" },
|
|
217856
|
+
{ name: "filter", type: "ScriptFilter", description: "Optional script filter" }
|
|
217693
217857
|
],
|
|
217694
217858
|
returns: "{Promise<ScriptSkeleton[]>} a promise that resolves to an array of script objects"
|
|
217695
217859
|
},
|
|
@@ -219668,6 +219832,14 @@ var helpMetadata = [
|
|
|
219668
219832
|
],
|
|
219669
219833
|
returns: "{Promise<boolean>} true if successful, false otherwise"
|
|
219670
219834
|
},
|
|
219835
|
+
{
|
|
219836
|
+
typeName: "Startup",
|
|
219837
|
+
methodName: "readStatus",
|
|
219838
|
+
signature: "readStatus(): Promise<RestartStatus>",
|
|
219839
|
+
description: "Get the current restart status of the environment",
|
|
219840
|
+
params: [],
|
|
219841
|
+
returns: "{Promise<RestartStatus>} the current restart status"
|
|
219842
|
+
},
|
|
219671
219843
|
{
|
|
219672
219844
|
typeName: "Variable",
|
|
219673
219845
|
methodName: "readVariable",
|
|
@@ -222508,6 +222680,31 @@ var CAPABILITY_META = {
|
|
|
222508
222680
|
supportsRealm: true,
|
|
222509
222681
|
notes: "Update (or upsert) a script by id. Prefer namedArgs { scriptId, scriptData }."
|
|
222510
222682
|
},
|
|
222683
|
+
"script.deleteScripts": {
|
|
222684
|
+
argumentMode: "named",
|
|
222685
|
+
parameters: [
|
|
222686
|
+
{
|
|
222687
|
+
name: "resultCallback",
|
|
222688
|
+
type: "ResultCallback<ScriptSkeleton>",
|
|
222689
|
+
required: false,
|
|
222690
|
+
position: 0,
|
|
222691
|
+
description: "Optional callback to process each deleted script as it is removed."
|
|
222692
|
+
},
|
|
222693
|
+
{
|
|
222694
|
+
name: "filter",
|
|
222695
|
+
type: "ScriptFilter",
|
|
222696
|
+
required: false,
|
|
222697
|
+
position: 1,
|
|
222698
|
+
description: "Optional script filter selecting which non-default scripts to delete.",
|
|
222699
|
+
schema: {
|
|
222700
|
+
type: "object",
|
|
222701
|
+
additionalProperties: true
|
|
222702
|
+
}
|
|
222703
|
+
}
|
|
222704
|
+
],
|
|
222705
|
+
supportsRealm: true,
|
|
222706
|
+
notes: "Prefer namedArgs { filter } for MCP callers. resultCallback is primarily intended for in-process library usage."
|
|
222707
|
+
},
|
|
222511
222708
|
"oauth2oidc.client.createOAuth2Client": {
|
|
222512
222709
|
argumentMode: "named",
|
|
222513
222710
|
parameters: [
|
|
@@ -222834,11 +223031,11 @@ function buildDescriptor(path72) {
|
|
|
222834
223031
|
const annotations = inferAnnotations(operationType, mutating, destructive);
|
|
222835
223032
|
const sourcePath = [...modulePath, methodName].join(".");
|
|
222836
223033
|
const meta3 = resolveCapabilityMeta(sourcePath);
|
|
222837
|
-
const argumentMode = _nullishCoalesce(_optionalChain([meta3, 'optionalAccess',
|
|
222838
|
-
const parameters = _nullishCoalesce(_optionalChain([meta3, 'optionalAccess',
|
|
222839
|
-
const supportsPaging = _nullishCoalesce(_optionalChain([meta3, 'optionalAccess',
|
|
222840
|
-
const supportsIncludeTotal = _nullishCoalesce(_optionalChain([meta3, 'optionalAccess',
|
|
222841
|
-
const supportsRealm = _nullishCoalesce(_optionalChain([meta3, 'optionalAccess',
|
|
223034
|
+
const argumentMode = _nullishCoalesce(_optionalChain([meta3, 'optionalAccess', _602 => _602.argumentMode]), () => ( inferArgumentMode(operationType)));
|
|
223035
|
+
const parameters = _nullishCoalesce(_optionalChain([meta3, 'optionalAccess', _603 => _603.parameters]), () => ( inferParameters(methodName, objectType2, operationType)));
|
|
223036
|
+
const supportsPaging = _nullishCoalesce(_optionalChain([meta3, 'optionalAccess', _604 => _604.supportsPaging]), () => ( (operationType === "list" || operationType === "search")));
|
|
223037
|
+
const supportsIncludeTotal = _nullishCoalesce(_optionalChain([meta3, 'optionalAccess', _605 => _605.supportsIncludeTotal]), () => ( (operationType === "list" || operationType === "search")));
|
|
223038
|
+
const supportsRealm = _nullishCoalesce(_optionalChain([meta3, 'optionalAccess', _606 => _606.supportsRealm]), () => ( kind === "generic"));
|
|
222842
223039
|
return {
|
|
222843
223040
|
id: sourcePath,
|
|
222844
223041
|
toolName: `frodo.${sourcePath}`,
|
|
@@ -222849,7 +223046,7 @@ function buildDescriptor(path72) {
|
|
|
222849
223046
|
operationType,
|
|
222850
223047
|
argumentMode,
|
|
222851
223048
|
...parameters !== void 0 && { parameters },
|
|
222852
|
-
..._optionalChain([meta3, 'optionalAccess',
|
|
223049
|
+
..._optionalChain([meta3, 'optionalAccess', _607 => _607.scope]) !== void 0 && { scope: meta3.scope },
|
|
222853
223050
|
supportsRealm,
|
|
222854
223051
|
supportsPaging,
|
|
222855
223052
|
supportsIncludeTotal,
|
|
@@ -222857,17 +223054,17 @@ function buildDescriptor(path72) {
|
|
|
222857
223054
|
riskClass,
|
|
222858
223055
|
mutating,
|
|
222859
223056
|
destructive,
|
|
222860
|
-
deploymentTypes: _nullishCoalesce(_optionalChain([meta3, 'optionalAccess',
|
|
222861
|
-
..._optionalChain([meta3, 'optionalAccess',
|
|
223057
|
+
deploymentTypes: _nullishCoalesce(_optionalChain([meta3, 'optionalAccess', _608 => _608.deploymentTypes]), () => ( ["any"])),
|
|
223058
|
+
..._optionalChain([meta3, 'optionalAccess', _609 => _609.preferredDeploymentTypes]) !== void 0 && {
|
|
222862
223059
|
preferredDeploymentTypes: meta3.preferredDeploymentTypes
|
|
222863
223060
|
},
|
|
222864
|
-
..._optionalChain([meta3, 'optionalAccess',
|
|
223061
|
+
..._optionalChain([meta3, 'optionalAccess', _610 => _610.identitySurface]) !== void 0 && {
|
|
222865
223062
|
identitySurface: meta3.identitySurface
|
|
222866
223063
|
},
|
|
222867
|
-
..._optionalChain([meta3, 'optionalAccess',
|
|
223064
|
+
..._optionalChain([meta3, 'optionalAccess', _611 => _611.objectTypePatterns]) !== void 0 && {
|
|
222868
223065
|
objectTypePatterns: meta3.objectTypePatterns
|
|
222869
223066
|
},
|
|
222870
|
-
..._optionalChain([meta3, 'optionalAccess',
|
|
223067
|
+
..._optionalChain([meta3, 'optionalAccess', _612 => _612.notes]) !== void 0 && {
|
|
222871
223068
|
notes: meta3.notes
|
|
222872
223069
|
},
|
|
222873
223070
|
requiredScopes: [],
|
|
@@ -223188,7 +223385,7 @@ function createToolRuntime(manifest, capabilities, options = {}) {
|
|
|
223188
223385
|
const paginationWarningThreshold = _nullishCoalesce(options.paginationWarningThreshold, () => ( 1e3));
|
|
223189
223386
|
const resultWarningThresholdBytes = _nullishCoalesce(options.resultWarningThresholdBytes, () => ( 65536));
|
|
223190
223387
|
const executeTool = async (request) => {
|
|
223191
|
-
if (!_optionalChain([request, 'optionalAccess',
|
|
223388
|
+
if (!_optionalChain([request, 'optionalAccess', _613 => _613.toolName])) {
|
|
223192
223389
|
throw new FrodoError("MCP runtime error: missing toolName in request.");
|
|
223193
223390
|
}
|
|
223194
223391
|
if (request.toolName === manifest.discoveryTool.toolName) {
|
|
@@ -223305,10 +223502,10 @@ function assertDeploymentCompatibility(descriptor, context) {
|
|
|
223305
223502
|
);
|
|
223306
223503
|
}
|
|
223307
223504
|
function resolveContextDeploymentType(context) {
|
|
223308
|
-
if (!_optionalChain([context, 'optionalAccess',
|
|
223505
|
+
if (!_optionalChain([context, 'optionalAccess', _614 => _614.auth])) {
|
|
223309
223506
|
return void 0;
|
|
223310
223507
|
}
|
|
223311
|
-
const rawType = context.auth.mode === "state-config" ? _optionalChain([context, 'access',
|
|
223508
|
+
const rawType = context.auth.mode === "state-config" ? _optionalChain([context, 'access', _615 => _615.auth, 'access', _616 => _616.config, 'optionalAccess', _617 => _617.deploymentType]) : context.auth.deploymentType;
|
|
223312
223509
|
if (typeof rawType !== "string") {
|
|
223313
223510
|
return void 0;
|
|
223314
223511
|
}
|
|
@@ -223319,7 +223516,7 @@ function resolveContextDeploymentType(context) {
|
|
|
223319
223516
|
return void 0;
|
|
223320
223517
|
}
|
|
223321
223518
|
function resolveRequestScopedFrodo(context, frodoRoot = frodo) {
|
|
223322
|
-
if (!_optionalChain([context, 'optionalAccess',
|
|
223519
|
+
if (!_optionalChain([context, 'optionalAccess', _618 => _618.auth])) {
|
|
223323
223520
|
throw new FrodoError("MCP runtime error: missing auth context.");
|
|
223324
223521
|
}
|
|
223325
223522
|
switch (context.auth.mode) {
|
|
@@ -223571,7 +223768,7 @@ function toInvocationArgs(raw, descriptor) {
|
|
|
223571
223768
|
return maybeArgs.positionalArgs;
|
|
223572
223769
|
}
|
|
223573
223770
|
if (maybeArgs.namedArgs && typeof maybeArgs.namedArgs === "object") {
|
|
223574
|
-
if (_optionalChain([descriptor, 'optionalAccess',
|
|
223771
|
+
if (_optionalChain([descriptor, 'optionalAccess', _619 => _619.parameters]) && descriptor.parameters.length > 0) {
|
|
223575
223772
|
return descriptor.parameters.slice().sort(
|
|
223576
223773
|
(left, right) => (_nullishCoalesce(left.position, () => ( Number.MAX_SAFE_INTEGER))) - (_nullishCoalesce(right.position, () => ( Number.MAX_SAFE_INTEGER)))
|
|
223577
223774
|
).map((parameter) => {
|
|
@@ -223633,14 +223830,14 @@ function validateInvocationArguments(descriptor, args) {
|
|
|
223633
223830
|
`MCP runtime error: descriptor '${descriptor.id}' does not accept named argument(s) ${unknownNames.join(", ")}. Allowed parameters: ${formatDescriptorParameters(descriptor)}.`
|
|
223634
223831
|
);
|
|
223635
223832
|
}
|
|
223636
|
-
const missingRequired = descriptor.parameters.filter((parameter) => parameter.required).filter((parameter) => _optionalChain([args, 'access',
|
|
223833
|
+
const missingRequired = descriptor.parameters.filter((parameter) => parameter.required).filter((parameter) => _optionalChain([args, 'access', _620 => _620.namedArgs, 'optionalAccess', _621 => _621[parameter.name]]) === void 0).map((parameter) => parameter.name);
|
|
223637
223834
|
if (missingRequired.length > 0) {
|
|
223638
223835
|
throw new FrodoError(
|
|
223639
223836
|
`MCP runtime error: descriptor '${descriptor.id}' is missing required named argument(s): ${missingRequired.join(", ")}. Allowed parameters: ${formatDescriptorParameters(descriptor)}.`
|
|
223640
223837
|
);
|
|
223641
223838
|
}
|
|
223642
223839
|
for (const parameter of descriptor.parameters) {
|
|
223643
|
-
const value = _optionalChain([args, 'access',
|
|
223840
|
+
const value = _optionalChain([args, 'access', _622 => _622.namedArgs, 'optionalAccess', _623 => _623[parameter.name]]);
|
|
223644
223841
|
if (value === void 0) {
|
|
223645
223842
|
continue;
|
|
223646
223843
|
}
|
|
@@ -223648,7 +223845,7 @@ function validateInvocationArguments(descriptor, args) {
|
|
|
223648
223845
|
}
|
|
223649
223846
|
}
|
|
223650
223847
|
function resolveNamedOrGenericParameterValue(parameter, args) {
|
|
223651
|
-
const providedValue = _optionalChain([args, 'access',
|
|
223848
|
+
const providedValue = _optionalChain([args, 'access', _624 => _624.namedArgs, 'optionalAccess', _625 => _625[parameter.name]]);
|
|
223652
223849
|
if (providedValue !== void 0) {
|
|
223653
223850
|
return providedValue;
|
|
223654
223851
|
}
|
|
@@ -224059,7 +224256,7 @@ function buildPaginationMetadata(data2, args, operationType, paginationWarningTh
|
|
|
224059
224256
|
}
|
|
224060
224257
|
function buildUnsupportedGenericCombinationMessage(toolName, domain2, objectType2, discovery) {
|
|
224061
224258
|
const objectTypeKey = `${domain2}.${objectType2}`;
|
|
224062
|
-
const supportEntry = _optionalChain([discovery, 'access',
|
|
224259
|
+
const supportEntry = _optionalChain([discovery, 'access', _626 => _626.objectTypeOperationSupport, 'optionalAccess', _627 => _627.find, 'call', _628 => _628(
|
|
224063
224260
|
(entry) => entry.domain === domain2 && entry.objectType === objectType2
|
|
224064
224261
|
)]);
|
|
224065
224262
|
if (supportEntry) {
|
|
@@ -224067,7 +224264,7 @@ function buildUnsupportedGenericCombinationMessage(toolName, domain2, objectType
|
|
|
224067
224264
|
return `MCP runtime error: tool '${toolName}' does not support domain '${domain2}' and objectType '${objectType2}'. Supported operations for '${objectTypeKey}': ${supportedList}. Use 'frodo_discover' to inspect supported combinations.`;
|
|
224068
224265
|
}
|
|
224069
224266
|
const knownObjectTypes = discovery.objectTypesByDomain[domain2];
|
|
224070
|
-
if (_optionalChain([knownObjectTypes, 'optionalAccess',
|
|
224267
|
+
if (_optionalChain([knownObjectTypes, 'optionalAccess', _629 => _629.length])) {
|
|
224071
224268
|
return `MCP runtime error: tool '${toolName}' does not support domain '${domain2}' and objectType '${objectType2}'. Known object types for domain '${domain2}': ${knownObjectTypes.join(", ")}. Use 'frodo_discover' to inspect supported combinations.`;
|
|
224072
224269
|
}
|
|
224073
224270
|
return `MCP runtime error: tool '${toolName}' does not support domain '${domain2}' and objectType '${objectType2}'. Use 'frodo_discover' to inspect supported combinations.`;
|
|
@@ -224116,7 +224313,7 @@ function composeCapabilityPolicy(presetName, override) {
|
|
|
224116
224313
|
return {
|
|
224117
224314
|
...preset,
|
|
224118
224315
|
...override,
|
|
224119
|
-
name: _optionalChain([override, 'optionalAccess',
|
|
224316
|
+
name: _optionalChain([override, 'optionalAccess', _630 => _630.name]) || preset.name
|
|
224120
224317
|
};
|
|
224121
224318
|
}
|
|
224122
224319
|
function createMcpService(options = {}) {
|
|
@@ -224327,7 +224524,7 @@ function v43(options, buf, offset) {
|
|
|
224327
224524
|
return native_default3.randomUUID();
|
|
224328
224525
|
}
|
|
224329
224526
|
options = options || {};
|
|
224330
|
-
const rnds = _nullishCoalesce(_nullishCoalesce(options.random, () => ( _optionalChain([options, 'access',
|
|
224527
|
+
const rnds = _nullishCoalesce(_nullishCoalesce(options.random, () => ( _optionalChain([options, 'access', _631 => _631.rng, 'optionalCall', _632 => _632()]))), () => ( rng3()));
|
|
224331
224528
|
if (rnds.length < 16) {
|
|
224332
224529
|
throw new Error("Random bytes length must be >= 16");
|
|
224333
224530
|
}
|
|
@@ -224832,7 +225029,7 @@ function getEffectiveCommandStabilityMetadata(command) {
|
|
|
224832
225029
|
if (stabilityLevelPriority[metadata.level] > stabilityLevelPriority[level]) {
|
|
224833
225030
|
level = metadata.level;
|
|
224834
225031
|
}
|
|
224835
|
-
if (!gate && _optionalChain([metadata, 'access',
|
|
225032
|
+
if (!gate && _optionalChain([metadata, 'access', _633 => _633.gate, 'optionalAccess', _634 => _634.requiredOptIn])) {
|
|
224836
225033
|
gate = metadata.gate;
|
|
224837
225034
|
}
|
|
224838
225035
|
}
|
|
@@ -224885,7 +225082,7 @@ function decorateDescriptionWithStability(description, target) {
|
|
|
224885
225082
|
metadata.level
|
|
224886
225083
|
)
|
|
224887
225084
|
];
|
|
224888
|
-
if (_optionalChain([metadata, 'access',
|
|
225085
|
+
if (_optionalChain([metadata, 'access', _635 => _635.gate, 'optionalAccess', _636 => _636.requiredOptIn])) {
|
|
224889
225086
|
badges.push(
|
|
224890
225087
|
colorizeStabilityBadge("[Opt-in required]", metadata.level, true)
|
|
224891
225088
|
);
|
|
@@ -225415,7 +225612,7 @@ function isSingleDeploymentType(types) {
|
|
|
225415
225612
|
}
|
|
225416
225613
|
function collectEnvironmentVariableGroups(command, includeAll = false, supportedTypes) {
|
|
225417
225614
|
const groupedEntries = /* @__PURE__ */ new Map();
|
|
225418
|
-
const effectiveTypes = _optionalChain([command, 'optionalAccess',
|
|
225615
|
+
const effectiveTypes = _optionalChain([command, 'optionalAccess', _637 => _637.types]) || supportedTypes;
|
|
225419
225616
|
function getOrCreate(group) {
|
|
225420
225617
|
let data2 = groupedEntries.get(group);
|
|
225421
225618
|
if (!data2) {
|
|
@@ -225470,7 +225667,7 @@ function collectEnvironmentVariableGroups(command, includeAll = false, supported
|
|
|
225470
225667
|
return groupedEntries;
|
|
225471
225668
|
}
|
|
225472
225669
|
function renderEnvironmentVariableGroups(groupedEntries, command, supportedTypes) {
|
|
225473
|
-
const effectiveTypes = _optionalChain([command, 'optionalAccess',
|
|
225670
|
+
const effectiveTypes = _optionalChain([command, 'optionalAccess', _638 => _638.types]) || supportedTypes;
|
|
225474
225671
|
const isSingleType = isSingleDeploymentType(effectiveTypes);
|
|
225475
225672
|
const sections = environmentVariableGroupOrder.flatMap((group) => {
|
|
225476
225673
|
const groupData = groupedEntries.get(group);
|
|
@@ -225700,7 +225897,7 @@ function isStabilityGateSatisfied(command, gate) {
|
|
|
225700
225897
|
const envVarName = gate.envVarName || "FRODO_ENABLE_PREVIEW";
|
|
225701
225898
|
const options = command.optsWithGlobals();
|
|
225702
225899
|
const optionKey = toOptionAttributeName(optionName);
|
|
225703
|
-
const optionEnabled = isTruthyOptInValue(_optionalChain([options, 'optionalAccess',
|
|
225900
|
+
const optionEnabled = isTruthyOptInValue(_optionalChain([options, 'optionalAccess', _639 => _639[optionKey]]));
|
|
225704
225901
|
const envEnabled = isTruthyOptInValue(process.env[envVarName]);
|
|
225705
225902
|
switch (mode2) {
|
|
225706
225903
|
case "option-only":
|
|
@@ -225726,7 +225923,7 @@ function enforceOptionStabilityAndWarn(actionCommand) {
|
|
|
225726
225923
|
const commandPath = getCommandPath(actionCommand);
|
|
225727
225924
|
const optionLabel = getOptionLabel(option);
|
|
225728
225925
|
const warningKey = `${commandPath}::${optionLabel}`;
|
|
225729
|
-
if (_optionalChain([metadata, 'access',
|
|
225926
|
+
if (_optionalChain([metadata, 'access', _640 => _640.gate, 'optionalAccess', _641 => _641.requiredOptIn])) {
|
|
225730
225927
|
const gate = metadata.gate;
|
|
225731
225928
|
if (!isStabilityGateSatisfied(actionCommand, gate)) {
|
|
225732
225929
|
const optionName = gate.optionName || "enable-preview";
|
|
@@ -225739,7 +225936,7 @@ function enforceOptionStabilityAndWarn(actionCommand) {
|
|
|
225739
225936
|
}
|
|
225740
225937
|
}
|
|
225741
225938
|
if (!warnedStabilityOptions.has(warningKey)) {
|
|
225742
|
-
const suffix = _optionalChain([metadata, 'access',
|
|
225939
|
+
const suffix = _optionalChain([metadata, 'access', _642 => _642.gate, 'optionalAccess', _643 => _643.requiredOptIn]) ? metadata.level === "deprecated" ? " This option is opt-in, deprecated, and may be removed in a future release." : " This option is opt-in and may change without notice." : metadata.level === "deprecated" ? " This option is deprecated and may be removed in a future release." : " This option may change without notice.";
|
|
225743
225940
|
printMessage2(
|
|
225744
225941
|
`${formatStabilityLevel(metadata.level)} option in use: '${optionLabel}' on command '${commandPath}'.${suffix}`,
|
|
225745
225942
|
"warn"
|
|
@@ -225754,7 +225951,7 @@ function enforceStabilityAndWarn(actionCommand) {
|
|
|
225754
225951
|
return;
|
|
225755
225952
|
}
|
|
225756
225953
|
const commandPath = getCommandPath(actionCommand);
|
|
225757
|
-
if (_optionalChain([metadata, 'access',
|
|
225954
|
+
if (_optionalChain([metadata, 'access', _644 => _644.gate, 'optionalAccess', _645 => _645.requiredOptIn])) {
|
|
225758
225955
|
const gate = metadata.gate;
|
|
225759
225956
|
if (!isStabilityGateSatisfied(actionCommand, gate)) {
|
|
225760
225957
|
const optionName = gate.optionName || "enable-preview";
|
|
@@ -225767,7 +225964,7 @@ function enforceStabilityAndWarn(actionCommand) {
|
|
|
225767
225964
|
}
|
|
225768
225965
|
}
|
|
225769
225966
|
if (!warnedStabilityCommands.has(commandPath)) {
|
|
225770
|
-
const gateSuffix = _optionalChain([metadata, 'access',
|
|
225967
|
+
const gateSuffix = _optionalChain([metadata, 'access', _646 => _646.gate, 'optionalAccess', _647 => _647.requiredOptIn]) ? metadata.level === "deprecated" ? " This command is opt-in, deprecated, and may be removed in a future release." : " This feature is opt-in and may change without notice." : metadata.level === "deprecated" ? " This command is deprecated and may be removed in a future release." : " This feature may change without notice.";
|
|
225771
225968
|
printMessage2(
|
|
225772
225969
|
`${formatStabilityLevel(metadata.level)} feature in use: '${commandPath}'.${gateSuffix}`,
|
|
225773
225970
|
"warn"
|
|
@@ -225816,7 +226013,7 @@ var FrodoStubCommand = class extends (_a = Command, STABILITY_METADATA_KEY, _a)
|
|
|
225816
226013
|
sortSubcommands: true,
|
|
225817
226014
|
sortOptions: true
|
|
225818
226015
|
});
|
|
225819
|
-
_optionalChain([this, 'access',
|
|
226016
|
+
_optionalChain([this, 'access', _648 => _648.options, 'access', _649 => _649.find, 'call', _650 => _650((option) => option.name() === "help"), 'optionalAccess', _651 => _651.helpGroup, 'call', _652 => _652(HELP_OPTIONS_HEADING)]);
|
|
225820
226017
|
this.addHelpText("after", () => {
|
|
225821
226018
|
if (!isFullHelpRequested()) {
|
|
225822
226019
|
return "";
|
|
@@ -225854,7 +226051,7 @@ var FrodoStubCommand = class extends (_a = Command, STABILITY_METADATA_KEY, _a)
|
|
|
225854
226051
|
* @returns This command for chaining.
|
|
225855
226052
|
*/
|
|
225856
226053
|
withStability(level, gate) {
|
|
225857
|
-
const normalizedGate = _optionalChain([gate, 'optionalAccess',
|
|
226054
|
+
const normalizedGate = _optionalChain([gate, 'optionalAccess', _653 => _653.requiredOptIn]) ? {
|
|
225858
226055
|
requiredOptIn: true,
|
|
225859
226056
|
optionName: gate.optionName || "enable-preview",
|
|
225860
226057
|
envVarName: gate.envVarName || "FRODO_ENABLE_PREVIEW",
|
|
@@ -225862,7 +226059,7 @@ var FrodoStubCommand = class extends (_a = Command, STABILITY_METADATA_KEY, _a)
|
|
|
225862
226059
|
mode: gate.mode || "option-or-env"
|
|
225863
226060
|
} : gate;
|
|
225864
226061
|
setStabilityMetadata(this, { level, gate: normalizedGate });
|
|
225865
|
-
if (_optionalChain([normalizedGate, 'optionalAccess',
|
|
226062
|
+
if (_optionalChain([normalizedGate, 'optionalAccess', _654 => _654.requiredOptIn])) {
|
|
225866
226063
|
const optionName = normalizedGate.optionName || "enable-preview";
|
|
225867
226064
|
const optionExists = this.options.some(
|
|
225868
226065
|
(option) => option.name() === optionName || option.attributeName() === optionName
|
|
@@ -226203,7 +226400,7 @@ var FrodoCommand = class extends FrodoStubCommand {
|
|
|
226203
226400
|
for (const opt of defaultOpts) {
|
|
226204
226401
|
if (!commandOmits.has(opt.name())) this.addOption(opt);
|
|
226205
226402
|
}
|
|
226206
|
-
_optionalChain([this, 'access',
|
|
226403
|
+
_optionalChain([this, 'access', _655 => _655.options, 'access', _656 => _656.find, 'call', _657 => _657((option) => option.name() === "help"), 'optionalAccess', _658 => _658.helpGroup, 'call', _659 => _659(HELP_OPTIONS_HEADING)]);
|
|
226207
226404
|
this.addHelpText(
|
|
226208
226405
|
"after",
|
|
226209
226406
|
() => isFullHelpRequested() ? formatEnvironmentVariables(this) : ""
|
|
@@ -228044,7 +228241,7 @@ In AM, create a trusted issuer in the ${state.getRealm()} realm with the followi
|
|
|
228044
228241
|
]);
|
|
228045
228242
|
issuer.push([
|
|
228046
228243
|
"Allowed Subjects "["brightCyan"],
|
|
228047
|
-
_optionalChain([artefacts, 'access',
|
|
228244
|
+
_optionalChain([artefacts, 'access', _660 => _660.issuer, 'access', _661 => _661.allowedSubjects, 'optionalAccess', _662 => _662.value, 'access', _663 => _663.length]) ? _optionalChain([artefacts, 'access', _664 => _664.issuer, 'access', _665 => _665.allowedSubjects, 'optionalAccess', _666 => _666.value, 'access', _667 => _667.join, 'call', _668 => _668(", ")]) : `Any ${state.getRealm()} realm user`
|
|
228048
228245
|
]);
|
|
228049
228246
|
issuer.push([
|
|
228050
228247
|
"JWKS (Public Key)"["brightCyan"],
|
|
@@ -228172,7 +228369,7 @@ async function executeRfc7523AuthZGrantFlow2(clientId, iss, jwk, sub, scope, jso
|
|
|
228172
228369
|
stopProgressIndicator2(
|
|
228173
228370
|
spinnerId,
|
|
228174
228371
|
`Error executing rfc7523 authz grant flow: ${stringify3(
|
|
228175
|
-
_optionalChain([error49, 'access',
|
|
228372
|
+
_optionalChain([error49, 'access', _669 => _669.response, 'optionalAccess', _670 => _670.data]) || error49.message
|
|
228176
228373
|
)}`,
|
|
228177
228374
|
"fail"
|
|
228178
228375
|
);
|
|
@@ -229626,11 +229823,11 @@ function normalizeAgentImportData(importData) {
|
|
|
229626
229823
|
function resolveAgentStatus(agent) {
|
|
229627
229824
|
switch (agent._type._id) {
|
|
229628
229825
|
case "AIAgent":
|
|
229629
|
-
return _nullishCoalesce(_nullishCoalesce(_optionalChain([agent, 'access',
|
|
229826
|
+
return _nullishCoalesce(_nullishCoalesce(_optionalChain([agent, 'access', _671 => _671["coreOAuth2ClientConfig"], 'optionalAccess', _672 => _672["status"], 'optionalAccess', _673 => _673["value"]]), () => ( _optionalChain([agent, 'access', _674 => _674["coreOAuth2ClientConfig"], 'optionalAccess', _675 => _675["status"]]))), () => ( "Unknown"));
|
|
229630
229827
|
case "J2EEAgent":
|
|
229631
|
-
return _nullishCoalesce(_optionalChain([agent, 'access',
|
|
229828
|
+
return _nullishCoalesce(_optionalChain([agent, 'access', _676 => _676["globalJ2EEAgentConfig"], 'optionalAccess', _677 => _677["status"]]), () => ( "Unknown"));
|
|
229632
229829
|
case "WebAgent":
|
|
229633
|
-
return _nullishCoalesce(_optionalChain([agent, 'access',
|
|
229830
|
+
return _nullishCoalesce(_optionalChain([agent, 'access', _678 => _678["globalWebAgentConfig"], 'optionalAccess', _679 => _679["status"]]), () => ( "Unknown"));
|
|
229634
229831
|
case "IdentityGatewayAgent":
|
|
229635
229832
|
return _nullishCoalesce(agent["status"], () => ( "Unknown"));
|
|
229636
229833
|
default:
|
|
@@ -236512,9 +236709,9 @@ function getLegacyMappingsFromFiles(files) {
|
|
|
236512
236709
|
if (syncFiles.length === 1) {
|
|
236513
236710
|
const file2 = syncFiles[0];
|
|
236514
236711
|
const jsonData = JSON.parse(file2.content);
|
|
236515
|
-
const syncData = _nullishCoalesce(jsonData.sync, () => ( _optionalChain([jsonData, 'access',
|
|
236712
|
+
const syncData = _nullishCoalesce(jsonData.sync, () => ( _optionalChain([jsonData, 'access', _680 => _680.idm, 'optionalAccess', _681 => _681.sync])));
|
|
236516
236713
|
const syncJsonDir = sysPath2.default.dirname(file2.path);
|
|
236517
|
-
if (_optionalChain([syncData, 'optionalAccess',
|
|
236714
|
+
if (_optionalChain([syncData, 'optionalAccess', _682 => _682.mappings])) {
|
|
236518
236715
|
for (const mapping of syncData.mappings) {
|
|
236519
236716
|
let resolvedMapping;
|
|
236520
236717
|
if (typeof mapping === "string") {
|
|
@@ -236815,7 +237012,7 @@ async function importConfigEntityByIdFromFile(entityId, file2, envFile, validate
|
|
|
236815
237012
|
importData = { idm: { managed: managedData } };
|
|
236816
237013
|
} else {
|
|
236817
237014
|
importData = JSON.parse(fileData);
|
|
236818
|
-
const entity = _optionalChain([importData, 'access',
|
|
237015
|
+
const entity = _optionalChain([importData, 'access', _683 => _683.idm, 'optionalAccess', _684 => _684[entityId]]);
|
|
236819
237016
|
if (entity) {
|
|
236820
237017
|
const baseDir = sysPath2.default.dirname(filePath);
|
|
236821
237018
|
resolveAllExtractedScriptsForImport(entity, baseDir);
|
|
@@ -237192,12 +237389,12 @@ function getManagedObjectsFromFiles(files) {
|
|
|
237192
237389
|
};
|
|
237193
237390
|
if (managedFiles.length === 1) {
|
|
237194
237391
|
const jsonData = JSON.parse(managedFiles[0].content);
|
|
237195
|
-
const managedData = _nullishCoalesce(jsonData.managed, () => ( _optionalChain([jsonData, 'access',
|
|
237392
|
+
const managedData = _nullishCoalesce(jsonData.managed, () => ( _optionalChain([jsonData, 'access', _685 => _685.idm, 'optionalAccess', _686 => _686.managed])));
|
|
237196
237393
|
const managedJsonDir = managedFiles[0].path.substring(
|
|
237197
237394
|
0,
|
|
237198
237395
|
managedFiles[0].path.indexOf("/managed.idm.json")
|
|
237199
237396
|
);
|
|
237200
|
-
if (_optionalChain([managedData, 'optionalAccess',
|
|
237397
|
+
if (_optionalChain([managedData, 'optionalAccess', _687 => _687.objects])) {
|
|
237201
237398
|
for (const object3 of managedData.objects) {
|
|
237202
237399
|
let resolvedObject;
|
|
237203
237400
|
if (typeof object3 === "string") {
|
|
@@ -237225,7 +237422,7 @@ function getLastString(path16) {
|
|
|
237225
237422
|
function getObjectByPath(obj, path16) {
|
|
237226
237423
|
return path16.split(".").reduce((acc, key) => {
|
|
237227
237424
|
const realKey = /^\d+$/.test(key) ? Number(key) : key;
|
|
237228
|
-
return _optionalChain([acc, 'optionalAccess',
|
|
237425
|
+
return _optionalChain([acc, 'optionalAccess', _688 => _688[realKey]]);
|
|
237229
237426
|
}, obj);
|
|
237230
237427
|
}
|
|
237231
237428
|
function getObjectByPathExcludeLast(obj, path16) {
|
|
@@ -239360,7 +239557,7 @@ async function importScriptsFromFiles(watch2, options, validateScripts) {
|
|
|
239360
239557
|
// !path?.endsWith('.script.groovy')
|
|
239361
239558
|
// : // in regular mode, ignore everything but frodo script exports
|
|
239362
239559
|
// stats?.isFile() && !path?.endsWith('.script.json'),
|
|
239363
|
-
ignored: (path16, stats) => _optionalChain([stats, 'optionalAccess',
|
|
239560
|
+
ignored: (path16, stats) => _optionalChain([stats, 'optionalAccess', _689 => _689.isFile, 'call', _690 => _690()]) && !_optionalChain([path16, 'optionalAccess', _691 => _691.endsWith, 'call', _692 => _692(".script.json")]) && !_optionalChain([path16, 'optionalAccess', _693 => _693.endsWith, 'call', _694 => _694(".script.js")]) && !_optionalChain([path16, 'optionalAccess', _695 => _695.endsWith, 'call', _696 => _696(".script.groovy")]),
|
|
239364
239561
|
persistent: watch2,
|
|
239365
239562
|
ignoreInitial: false
|
|
239366
239563
|
});
|
|
@@ -239487,14 +239684,14 @@ async function deleteAllScripts() {
|
|
|
239487
239684
|
}
|
|
239488
239685
|
function separateScriptsFromFullExport(fullExport) {
|
|
239489
239686
|
const scripts = { realm: {} };
|
|
239490
|
-
if (!_optionalChain([fullExport, 'optionalAccess',
|
|
239687
|
+
if (!_optionalChain([fullExport, 'optionalAccess', _697 => _697.realm]) || typeof fullExport.realm !== "object") {
|
|
239491
239688
|
return scripts;
|
|
239492
239689
|
}
|
|
239493
239690
|
for (const [realm2, realmExport] of Object.entries(fullExport.realm)) {
|
|
239494
239691
|
if (!scripts.realm[realm2]) {
|
|
239495
239692
|
scripts.realm[realm2] = {};
|
|
239496
239693
|
}
|
|
239497
|
-
scripts.realm[realm2].script = _nullishCoalesce(_optionalChain([realmExport, 'optionalAccess',
|
|
239694
|
+
scripts.realm[realm2].script = _nullishCoalesce(_optionalChain([realmExport, 'optionalAccess', _698 => _698.script]), () => ( {}));
|
|
239498
239695
|
if (realmExport && typeof realmExport === "object") {
|
|
239499
239696
|
delete realmExport.script;
|
|
239500
239697
|
}
|
|
@@ -239505,9 +239702,9 @@ function getScriptLocations(configuration, scriptName) {
|
|
|
239505
239702
|
const locations = [];
|
|
239506
239703
|
const regex2 = new RegExp(`require\\(['|"]${scriptName}['|"]\\)`);
|
|
239507
239704
|
for (const [realm2, realmExport] of Object.entries(
|
|
239508
|
-
_nullishCoalesce(_optionalChain([configuration, 'optionalAccess',
|
|
239705
|
+
_nullishCoalesce(_optionalChain([configuration, 'optionalAccess', _699 => _699.realm]), () => ( {}))
|
|
239509
239706
|
)) {
|
|
239510
|
-
for (const scriptData of Object.values(_nullishCoalesce(_optionalChain([realmExport, 'optionalAccess',
|
|
239707
|
+
for (const scriptData of Object.values(_nullishCoalesce(_optionalChain([realmExport, 'optionalAccess', _700 => _700.script]), () => ( {})))) {
|
|
239511
239708
|
let scriptString = scriptData.script;
|
|
239512
239709
|
if (Array.isArray(scriptData.script)) {
|
|
239513
239710
|
scriptString = scriptData.script.join("\n");
|
|
@@ -239544,7 +239741,7 @@ var {
|
|
|
239544
239741
|
} = frodo.utils;
|
|
239545
239742
|
var { stringify: stringify5 } = frodo.utils.json;
|
|
239546
239743
|
function getOneLineDescription2(nodeObj, nodeRef) {
|
|
239547
|
-
const description = `[${nodeObj._id["brightCyan"]}] ${nodeObj._type._id}${nodeRef ? " - " + _optionalChain([nodeRef, 'optionalAccess',
|
|
239744
|
+
const description = `[${nodeObj._id["brightCyan"]}] ${nodeObj._type._id}${nodeRef ? " - " + _optionalChain([nodeRef, 'optionalAccess', _701 => _701.displayName]) : ""}`;
|
|
239548
239745
|
return description;
|
|
239549
239746
|
}
|
|
239550
239747
|
function getTableHeaderMd2() {
|
|
@@ -241432,7 +241629,7 @@ function getExtractedFiles(obj, connectorMappingDirectory) {
|
|
|
241432
241629
|
if (!obj || typeof obj !== "object") return;
|
|
241433
241630
|
for (const key of Object.keys(obj)) {
|
|
241434
241631
|
const value = obj[key];
|
|
241435
|
-
if (_optionalChain([value, 'optionalAccess',
|
|
241632
|
+
if (_optionalChain([value, 'optionalAccess', _702 => _702.type]) === "text/javascript" && value.file) {
|
|
241436
241633
|
const scriptPath = sysPath2.default.join(connectorMappingDirectory, value.file);
|
|
241437
241634
|
if (fs52.default.existsSync(scriptPath)) {
|
|
241438
241635
|
value.source = fs52.default.readFileSync(scriptPath, { encoding: "utf-8" });
|
|
@@ -242128,7 +242325,7 @@ function getExtractedFiles2(obj, managedObjectDirectory) {
|
|
|
242128
242325
|
if (!obj || typeof obj !== "object") return;
|
|
242129
242326
|
for (const key of Object.keys(obj)) {
|
|
242130
242327
|
const value = obj[key];
|
|
242131
|
-
if (_optionalChain([value, 'optionalAccess',
|
|
242328
|
+
if (_optionalChain([value, 'optionalAccess', _703 => _703.type]) === "text/javascript" && value.file) {
|
|
242132
242329
|
const scriptPath = sysPath2.default.join(managedObjectDirectory, value.file);
|
|
242133
242330
|
if (fs52.default.existsSync(scriptPath)) {
|
|
242134
242331
|
value.source = fs52.default.readFileSync(scriptPath, { encoding: "utf-8" });
|
|
@@ -242462,7 +242659,7 @@ async function configManagerImportPasswordPolicy(realm2) {
|
|
|
242462
242659
|
if (parsedData && typeof parsedData === "object" && parsedData.idm && typeof parsedData.idm === "object" && Object.keys(parsedData.idm).length > 0) {
|
|
242463
242660
|
importData = { idm: parsedData.idm };
|
|
242464
242661
|
} else {
|
|
242465
|
-
const id7 = _optionalChain([parsedData, 'optionalAccess',
|
|
242662
|
+
const id7 = _optionalChain([parsedData, 'optionalAccess', _704 => _704._id]);
|
|
242466
242663
|
if (!id7) {
|
|
242467
242664
|
throw new Error(
|
|
242468
242665
|
`Invalid password policy payload in '${filePath}': expected either an 'idm' map or top-level '_id'.`
|
|
@@ -242654,7 +242851,7 @@ async function configManagerImportSchedules(schedulesName) {
|
|
|
242654
242851
|
if (schedulesName && id7 !== `schedule/${schedulesName}`) {
|
|
242655
242852
|
continue;
|
|
242656
242853
|
}
|
|
242657
|
-
if (_optionalChain([importData, 'access',
|
|
242854
|
+
if (_optionalChain([importData, 'access', _705 => _705.invokeContext, 'optionalAccess', _706 => _706.task, 'optionalAccess', _707 => _707.script, 'optionalAccess', _708 => _708.file])) {
|
|
242658
242855
|
const scriptPath = getFilePath39(
|
|
242659
242856
|
`schedules/${schedulesFile}/${importData.invokeContext.task.script.file}`
|
|
242660
242857
|
);
|
|
@@ -246778,7 +246975,7 @@ async function tailLogs(source, levels, txid, cookie, nf) {
|
|
|
246778
246975
|
filteredLogs = logsObject.result.filter(
|
|
246779
246976
|
(el) => !noiseFilter.includes(
|
|
246780
246977
|
el.payload.logger
|
|
246781
|
-
) && !noiseFilter.includes(el.type) && (levels[0] === "ALL" || levels.includes(resolvePayloadLevel2(el))) && (typeof txid === "undefined" || txid === null || _optionalChain([el, 'access',
|
|
246978
|
+
) && !noiseFilter.includes(el.type) && (levels[0] === "ALL" || levels.includes(resolvePayloadLevel2(el))) && (typeof txid === "undefined" || txid === null || _optionalChain([el, 'access', _709 => _709.payload, 'access', _710 => _710.transactionId, 'optionalAccess', _711 => _711.includes, 'call', _712 => _712(
|
|
246782
246979
|
txid
|
|
246783
246980
|
)]))
|
|
246784
246981
|
);
|
|
@@ -246995,9 +247192,9 @@ function setup148() {
|
|
|
246995
247192
|
`Created log API key ${creds.api_key_id} and secret.`
|
|
246996
247193
|
);
|
|
246997
247194
|
} catch (error49) {
|
|
246998
|
-
printMessage2(_optionalChain([error49, 'access',
|
|
247195
|
+
printMessage2(_optionalChain([error49, 'access', _713 => _713.response, 'optionalAccess', _714 => _714.data]), "error");
|
|
246999
247196
|
printMessage2(
|
|
247000
|
-
`Error creating log API key and secret: ${_optionalChain([error49, 'access',
|
|
247197
|
+
`Error creating log API key and secret: ${_optionalChain([error49, 'access', _715 => _715.response, 'optionalAccess', _716 => _716.data, 'optionalAccess', _717 => _717.message])}`,
|
|
247001
247198
|
"error"
|
|
247002
247199
|
);
|
|
247003
247200
|
process.exitCode = 1;
|
|
@@ -248128,7 +248325,7 @@ function setup162() {
|
|
|
248128
248325
|
printMessage2(updatesTable.toString(), "data");
|
|
248129
248326
|
}
|
|
248130
248327
|
if (!options.checkOnly) {
|
|
248131
|
-
if (_optionalChain([updates, 'access',
|
|
248328
|
+
if (_optionalChain([updates, 'access', _718 => _718.secrets, 'optionalAccess', _719 => _719.length]) || _optionalChain([updates, 'access', _720 => _720.variables, 'optionalAccess', _721 => _721.length]) || options.force) {
|
|
248132
248329
|
const ok = options.yes || await (0, import_yesno.default)({
|
|
248133
248330
|
question: `
|
|
248134
248331
|
Changes may take up to 10 minutes to propagate, during which time you will not be able to make further updates.
|
|
@@ -252612,18 +252809,18 @@ async function listJourneys(long = false) {
|
|
|
252612
252809
|
0,
|
|
252613
252810
|
`Retrieving details of all journeys...`
|
|
252614
252811
|
);
|
|
252615
|
-
const exportPromises = [];
|
|
252616
252812
|
try {
|
|
252617
|
-
|
|
252618
|
-
|
|
252619
|
-
|
|
252620
|
-
|
|
252621
|
-
|
|
252622
|
-
|
|
252623
|
-
|
|
252624
|
-
|
|
252625
|
-
|
|
252626
|
-
|
|
252813
|
+
const journeyExportPromises = journeys.map((journeyStub) => ({
|
|
252814
|
+
journeyId: journeyStub["_id"],
|
|
252815
|
+
promise: exportJourney2(journeyStub["_id"], {
|
|
252816
|
+
useStringArrays: false,
|
|
252817
|
+
deps: false,
|
|
252818
|
+
coords: true
|
|
252819
|
+
})
|
|
252820
|
+
}));
|
|
252821
|
+
const journeyExports = await Promise.all(
|
|
252822
|
+
journeyExportPromises.map((p) => p.promise)
|
|
252823
|
+
);
|
|
252627
252824
|
stopProgressIndicator2(
|
|
252628
252825
|
spinnerId,
|
|
252629
252826
|
"Retrieved details of all journeys.",
|
|
@@ -252639,17 +252836,25 @@ async function listJourneys(long = false) {
|
|
|
252639
252836
|
"Resource",
|
|
252640
252837
|
"Tags"
|
|
252641
252838
|
]);
|
|
252642
|
-
for (
|
|
252839
|
+
for (let i2 = 0; i2 < journeyExports.length; i2++) {
|
|
252840
|
+
const { journeyId } = journeyExportPromises[i2];
|
|
252841
|
+
const treeExport = journeyExports[i2].trees[journeyId];
|
|
252842
|
+
if (!treeExport) {
|
|
252843
|
+
debugMessage2(
|
|
252844
|
+
`listJourneys: journey '${journeyId}' not found in export response, skipping`
|
|
252845
|
+
);
|
|
252846
|
+
continue;
|
|
252847
|
+
}
|
|
252643
252848
|
table.push([
|
|
252644
|
-
`${
|
|
252645
|
-
|
|
252646
|
-
|
|
252647
|
-
|
|
252648
|
-
|
|
252649
|
-
|
|
252650
|
-
|
|
252651
|
-
_optionalChain([
|
|
252652
|
-
JSON.parse(
|
|
252849
|
+
`${treeExport.tree._id}`,
|
|
252850
|
+
treeExport.tree.enabled === false ? "disabled"["brightRed"] : "enabled"["brightGreen"],
|
|
252851
|
+
treeExport.tree.innerTreeOnly ? "yes"["brightYellow"] : "no"["brightGreen"],
|
|
252852
|
+
treeExport.tree.mustRun ? "yes"["brightYellow"] : "no"["brightGreen"],
|
|
252853
|
+
treeExport.tree.noSession ? "yes"["brightYellow"] : "no"["brightGreen"],
|
|
252854
|
+
treeExport.tree.transactionalOnly ? "yes"["brightYellow"] : "no"["brightGreen"],
|
|
252855
|
+
treeExport.tree.identityResource ? treeExport.tree.identityResource : "",
|
|
252856
|
+
_optionalChain([treeExport, 'access', _722 => _722.tree, 'access', _723 => _723.uiConfig, 'optionalAccess', _724 => _724.categories]) ? wordwrap(
|
|
252857
|
+
JSON.parse(treeExport.tree.uiConfig.categories).join(", "),
|
|
252653
252858
|
60
|
|
252654
252859
|
) : ""
|
|
252655
252860
|
]);
|
|
@@ -252692,11 +252897,7 @@ async function exportJourneyToFile(journeyId, file2, includeMeta = true, options
|
|
|
252692
252897
|
delete fileData.meta;
|
|
252693
252898
|
if (verbose)
|
|
252694
252899
|
spinnerId = createProgressIndicator2("indeterminate", 0, `${journeyId}`);
|
|
252695
|
-
saveJsonToFile57(
|
|
252696
|
-
{ trees: { [fileData.tree._id]: fileData } },
|
|
252697
|
-
filePath,
|
|
252698
|
-
includeMeta
|
|
252699
|
-
);
|
|
252900
|
+
saveJsonToFile57(fileData, filePath, includeMeta);
|
|
252700
252901
|
stopProgressIndicator2(
|
|
252701
252902
|
spinnerId,
|
|
252702
252903
|
`Exported ${journeyId["brightCyan"]} to ${filePath["brightCyan"]}.`,
|
|
@@ -252964,11 +253165,11 @@ async function importJourneysFromFiles(options) {
|
|
|
252964
253165
|
const allJourneysData = { trees: {} };
|
|
252965
253166
|
for (const file2 of jsonFiles) {
|
|
252966
253167
|
const fileObj = JSON.parse(fs52.default.readFileSync(file2, "utf8"));
|
|
252967
|
-
if (_optionalChain([fileObj, 'optionalAccess',
|
|
253168
|
+
if (_optionalChain([fileObj, 'optionalAccess', _725 => _725.trees]) && typeof fileObj.trees === "object") {
|
|
252968
253169
|
for (const [id7, obj] of Object.entries(fileObj.trees)) {
|
|
252969
253170
|
allJourneysData.trees[id7] = obj;
|
|
252970
253171
|
}
|
|
252971
|
-
} else if (_optionalChain([fileObj, 'optionalAccess',
|
|
253172
|
+
} else if (_optionalChain([fileObj, 'optionalAccess', _726 => _726.tree, 'optionalAccess', _727 => _727._id])) {
|
|
252972
253173
|
allJourneysData.trees[fileObj.tree._id] = fileObj;
|
|
252973
253174
|
} else {
|
|
252974
253175
|
printMessage2(
|
|
@@ -253047,7 +253248,7 @@ async function describeJourney(journeyData, resolveTreeExport = onlineTreeExport
|
|
|
253047
253248
|
nodeTypeMap[nodeData._type._id] = 1;
|
|
253048
253249
|
}
|
|
253049
253250
|
}
|
|
253050
|
-
if (!state.getAmVersion() && _optionalChain([journeyData, 'access',
|
|
253251
|
+
if (!state.getAmVersion() && _optionalChain([journeyData, 'access', _728 => _728.meta, 'optionalAccess', _729 => _729.originAmVersion])) {
|
|
253051
253252
|
state.setAmVersion(journeyData.meta.originAmVersion);
|
|
253052
253253
|
}
|
|
253053
253254
|
printMessage2(`${getOneLineDescription8(journeyData.tree)}`, "data");
|
|
@@ -253071,7 +253272,7 @@ Flags
|
|
|
253071
253272
|
- No Session: ${journeyData.tree.noSession ? "true"["brightGreen"] : "false"["brightRed"]}
|
|
253072
253273
|
- Transactional Only: ${journeyData.tree.transactionalOnly ? "true"["brightGreen"] : "false"["brightRed"]}`
|
|
253073
253274
|
);
|
|
253074
|
-
if (_optionalChain([journeyData, 'access',
|
|
253275
|
+
if (_optionalChain([journeyData, 'access', _730 => _730.tree, 'access', _731 => _731.uiConfig, 'optionalAccess', _732 => _732.categories]) && journeyData.tree.uiConfig.categories != "[]") {
|
|
253075
253276
|
printMessage2("\nCategories/Tags", "data");
|
|
253076
253277
|
printMessage2(
|
|
253077
253278
|
`${JSON.parse(journeyData.tree.uiConfig.categories).join(", ")}`,
|
|
@@ -253110,7 +253311,7 @@ Nodes (${Object.entries(allNodes).length}):`, "data");
|
|
|
253110
253311
|
);
|
|
253111
253312
|
}
|
|
253112
253313
|
}
|
|
253113
|
-
if (_optionalChain([journeyData, 'access',
|
|
253314
|
+
if (_optionalChain([journeyData, 'access', _733 => _733.themes, 'optionalAccess', _734 => _734.length])) {
|
|
253114
253315
|
printMessage2(`
|
|
253115
253316
|
Themes (${journeyData.themes.length}):`, "data");
|
|
253116
253317
|
for (const themeData of journeyData.themes) {
|
|
@@ -253204,14 +253405,14 @@ async function describeJourneyMd(journeyData, resolveTreeExport = onlineTreeExpo
|
|
|
253204
253405
|
nodeTypeMap[nodeData._type._id] = 1;
|
|
253205
253406
|
}
|
|
253206
253407
|
}
|
|
253207
|
-
if (!state.getAmVersion() && _optionalChain([journeyData, 'access',
|
|
253408
|
+
if (!state.getAmVersion() && _optionalChain([journeyData, 'access', _735 => _735.meta, 'optionalAccess', _736 => _736.originAmVersion])) {
|
|
253208
253409
|
state.setAmVersion(journeyData.meta.originAmVersion);
|
|
253209
253410
|
}
|
|
253210
253411
|
printMessage2(
|
|
253211
253412
|
`# ${getOneLineDescriptionMd(journeyData.tree)} - ${journeyData.tree.enabled === false ? ":o: `disabled`" : ":white_check_mark: `enabled`"}, ${journeyData.tree.innerTreeOnly ? ":o: `innerTreeOnly`" : ":white_check_mark: `not innerTreeOnly`"}, ${journeyData.tree.mustRun ? ":o: `mustRun`" : ":white_check_mark: `not mustRun`"}, ${journeyData.tree.noSession ? ":o: `noSession`" : ":white_check_mark: `sessionAllowed`"}, ${journeyData.tree.transactionalOnly ? ":o: `transactionalOnly`" : ":white_check_mark: `not transactionalOnly`"}${journeyData.tree.identityResource ? `, identity resource: \`${journeyData.tree.identityResource}\`` : ""}`,
|
|
253212
253413
|
"data"
|
|
253213
253414
|
);
|
|
253214
|
-
if (_optionalChain([journeyData, 'access',
|
|
253415
|
+
if (_optionalChain([journeyData, 'access', _737 => _737.tree, 'access', _738 => _738.uiConfig, 'optionalAccess', _739 => _739.categories]) && journeyData.tree.uiConfig.categories != "[]") {
|
|
253215
253416
|
printMessage2(
|
|
253216
253417
|
`\`${JSON.parse(journeyData.tree.uiConfig.categories).join("`, `")}\``,
|
|
253217
253418
|
"data"
|
|
@@ -253250,7 +253451,7 @@ ${journeyData.tree.description}`, "data");
|
|
|
253250
253451
|
);
|
|
253251
253452
|
}
|
|
253252
253453
|
}
|
|
253253
|
-
if (_optionalChain([journeyData, 'access',
|
|
253454
|
+
if (_optionalChain([journeyData, 'access', _740 => _740.themes, 'optionalAccess', _741 => _741.length])) {
|
|
253254
253455
|
printMessage2(`## Themes (${journeyData.themes.length})`, "data");
|
|
253255
253456
|
printMessage2(getTableHeaderMd7(), "data");
|
|
253256
253457
|
for (const themeData of journeyData.themes) {
|
|
@@ -253535,9 +253736,9 @@ function setup203() {
|
|
|
253535
253736
|
journeyData = fileData.trees[options.journeyId];
|
|
253536
253737
|
} else if (typeof options.journeyId === "undefined" && fileData.trees) {
|
|
253537
253738
|
[journeyData] = Object.values(fileData.trees);
|
|
253538
|
-
} else if (typeof options.journeyId !== "undefined" && options.journeyId === _optionalChain([fileData, 'access',
|
|
253739
|
+
} else if (typeof options.journeyId !== "undefined" && options.journeyId === _optionalChain([fileData, 'access', _742 => _742.tree, 'optionalAccess', _743 => _743._id])) {
|
|
253539
253740
|
journeyData = fileData;
|
|
253540
|
-
} else if (typeof options.journeyId === "undefined" && _optionalChain([fileData, 'access',
|
|
253741
|
+
} else if (typeof options.journeyId === "undefined" && _optionalChain([fileData, 'access', _744 => _744.tree, 'optionalAccess', _745 => _745._id])) {
|
|
253541
253742
|
journeyData = fileData;
|
|
253542
253743
|
} else {
|
|
253543
253744
|
throw new Error(
|
|
@@ -253571,7 +253772,13 @@ function setup203() {
|
|
|
253571
253772
|
journeys = await readJourneys3();
|
|
253572
253773
|
for (const journey of journeys) {
|
|
253573
253774
|
try {
|
|
253574
|
-
const
|
|
253775
|
+
const multiTreeData = await exportJourney3(journey["_id"]);
|
|
253776
|
+
const treeData = multiTreeData.trees[journey["_id"]];
|
|
253777
|
+
if (!treeData) {
|
|
253778
|
+
throw new Error(
|
|
253779
|
+
`Journey '${journey["_id"]}' not found in export response`
|
|
253780
|
+
);
|
|
253781
|
+
}
|
|
253575
253782
|
const originalAmVersion = state.getAmVersion();
|
|
253576
253783
|
const runtimeResolver = async (treeId) => {
|
|
253577
253784
|
const resolverVersion = state.getAmVersion();
|
|
@@ -253611,7 +253818,13 @@ function setup203() {
|
|
|
253611
253818
|
}
|
|
253612
253819
|
} else {
|
|
253613
253820
|
try {
|
|
253614
|
-
const
|
|
253821
|
+
const multiTreeData = await exportJourney3(options.journeyId);
|
|
253822
|
+
const treeData = multiTreeData.trees[options.journeyId];
|
|
253823
|
+
if (!treeData) {
|
|
253824
|
+
throw new Error(
|
|
253825
|
+
`Journey '${options.journeyId}' not found in export response`
|
|
253826
|
+
);
|
|
253827
|
+
}
|
|
253615
253828
|
const originalAmVersion = state.getAmVersion();
|
|
253616
253829
|
const runtimeResolver = async (treeId) => {
|
|
253617
253830
|
const resolverVersion = state.getAmVersion();
|
|
@@ -255369,7 +255582,7 @@ _chunkDLBJL7R2cjs.init_cjs_shims.call(void 0, );
|
|
|
255369
255582
|
var errorUtil;
|
|
255370
255583
|
(function(errorUtil2) {
|
|
255371
255584
|
errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {};
|
|
255372
|
-
errorUtil2.toString = (message) => typeof message === "string" ? message : _optionalChain([message, 'optionalAccess',
|
|
255585
|
+
errorUtil2.toString = (message) => typeof message === "string" ? message : _optionalChain([message, 'optionalAccess', _746 => _746.message]);
|
|
255373
255586
|
})(errorUtil || (errorUtil = {}));
|
|
255374
255587
|
|
|
255375
255588
|
// node_modules/zod/v3/types.js
|
|
@@ -255485,10 +255698,10 @@ var ZodType = class {
|
|
|
255485
255698
|
const ctx = {
|
|
255486
255699
|
common: {
|
|
255487
255700
|
issues: [],
|
|
255488
|
-
async: _nullishCoalesce(_optionalChain([params, 'optionalAccess',
|
|
255489
|
-
contextualErrorMap: _optionalChain([params, 'optionalAccess',
|
|
255701
|
+
async: _nullishCoalesce(_optionalChain([params, 'optionalAccess', _747 => _747.async]), () => ( false)),
|
|
255702
|
+
contextualErrorMap: _optionalChain([params, 'optionalAccess', _748 => _748.errorMap])
|
|
255490
255703
|
},
|
|
255491
|
-
path: _optionalChain([params, 'optionalAccess',
|
|
255704
|
+
path: _optionalChain([params, 'optionalAccess', _749 => _749.path]) || [],
|
|
255492
255705
|
schemaErrorMap: this._def.errorMap,
|
|
255493
255706
|
parent: null,
|
|
255494
255707
|
data: data2,
|
|
@@ -255518,7 +255731,7 @@ var ZodType = class {
|
|
|
255518
255731
|
issues: ctx.common.issues
|
|
255519
255732
|
};
|
|
255520
255733
|
} catch (err) {
|
|
255521
|
-
if (_optionalChain([err, 'optionalAccess',
|
|
255734
|
+
if (_optionalChain([err, 'optionalAccess', _750 => _750.message, 'optionalAccess', _751 => _751.toLowerCase, 'call', _752 => _752(), 'optionalAccess', _753 => _753.includes, 'call', _754 => _754("encountered")])) {
|
|
255522
255735
|
this["~standard"].async = true;
|
|
255523
255736
|
}
|
|
255524
255737
|
ctx.common = {
|
|
@@ -255543,10 +255756,10 @@ var ZodType = class {
|
|
|
255543
255756
|
const ctx = {
|
|
255544
255757
|
common: {
|
|
255545
255758
|
issues: [],
|
|
255546
|
-
contextualErrorMap: _optionalChain([params, 'optionalAccess',
|
|
255759
|
+
contextualErrorMap: _optionalChain([params, 'optionalAccess', _755 => _755.errorMap]),
|
|
255547
255760
|
async: true
|
|
255548
255761
|
},
|
|
255549
|
-
path: _optionalChain([params, 'optionalAccess',
|
|
255762
|
+
path: _optionalChain([params, 'optionalAccess', _756 => _756.path]) || [],
|
|
255550
255763
|
schemaErrorMap: this._def.errorMap,
|
|
255551
255764
|
parent: null,
|
|
255552
255765
|
data: data2,
|
|
@@ -255777,7 +255990,7 @@ function isValidJWT(jwt2, alg) {
|
|
|
255777
255990
|
const decoded = JSON.parse(atob(base643));
|
|
255778
255991
|
if (typeof decoded !== "object" || decoded === null)
|
|
255779
255992
|
return false;
|
|
255780
|
-
if ("typ" in decoded && _optionalChain([decoded, 'optionalAccess',
|
|
255993
|
+
if ("typ" in decoded && _optionalChain([decoded, 'optionalAccess', _757 => _757.typ]) !== "JWT")
|
|
255781
255994
|
return false;
|
|
255782
255995
|
if (!decoded.alg)
|
|
255783
255996
|
return false;
|
|
@@ -256166,10 +256379,10 @@ var ZodString = class _ZodString2 extends ZodType {
|
|
|
256166
256379
|
}
|
|
256167
256380
|
return this._addCheck({
|
|
256168
256381
|
kind: "datetime",
|
|
256169
|
-
precision: typeof _optionalChain([options, 'optionalAccess',
|
|
256170
|
-
offset: _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
256171
|
-
local: _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
256172
|
-
...errorUtil.errToObj(_optionalChain([options, 'optionalAccess',
|
|
256382
|
+
precision: typeof _optionalChain([options, 'optionalAccess', _758 => _758.precision]) === "undefined" ? null : _optionalChain([options, 'optionalAccess', _759 => _759.precision]),
|
|
256383
|
+
offset: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _760 => _760.offset]), () => ( false)),
|
|
256384
|
+
local: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _761 => _761.local]), () => ( false)),
|
|
256385
|
+
...errorUtil.errToObj(_optionalChain([options, 'optionalAccess', _762 => _762.message]))
|
|
256173
256386
|
});
|
|
256174
256387
|
}
|
|
256175
256388
|
date(message) {
|
|
@@ -256185,8 +256398,8 @@ var ZodString = class _ZodString2 extends ZodType {
|
|
|
256185
256398
|
}
|
|
256186
256399
|
return this._addCheck({
|
|
256187
256400
|
kind: "time",
|
|
256188
|
-
precision: typeof _optionalChain([options, 'optionalAccess',
|
|
256189
|
-
...errorUtil.errToObj(_optionalChain([options, 'optionalAccess',
|
|
256401
|
+
precision: typeof _optionalChain([options, 'optionalAccess', _763 => _763.precision]) === "undefined" ? null : _optionalChain([options, 'optionalAccess', _764 => _764.precision]),
|
|
256402
|
+
...errorUtil.errToObj(_optionalChain([options, 'optionalAccess', _765 => _765.message]))
|
|
256190
256403
|
});
|
|
256191
256404
|
}
|
|
256192
256405
|
duration(message) {
|
|
@@ -256203,8 +256416,8 @@ var ZodString = class _ZodString2 extends ZodType {
|
|
|
256203
256416
|
return this._addCheck({
|
|
256204
256417
|
kind: "includes",
|
|
256205
256418
|
value,
|
|
256206
|
-
position: _optionalChain([options, 'optionalAccess',
|
|
256207
|
-
...errorUtil.errToObj(_optionalChain([options, 'optionalAccess',
|
|
256419
|
+
position: _optionalChain([options, 'optionalAccess', _766 => _766.position]),
|
|
256420
|
+
...errorUtil.errToObj(_optionalChain([options, 'optionalAccess', _767 => _767.message]))
|
|
256208
256421
|
});
|
|
256209
256422
|
}
|
|
256210
256423
|
startsWith(value, message) {
|
|
@@ -256339,7 +256552,7 @@ ZodString.create = (params) => {
|
|
|
256339
256552
|
return new ZodString({
|
|
256340
256553
|
checks: [],
|
|
256341
256554
|
typeName: ZodFirstPartyTypeKind.ZodString,
|
|
256342
|
-
coerce: _nullishCoalesce(_optionalChain([params, 'optionalAccess',
|
|
256555
|
+
coerce: _nullishCoalesce(_optionalChain([params, 'optionalAccess', _768 => _768.coerce]), () => ( false)),
|
|
256343
256556
|
...processCreateParams(params)
|
|
256344
256557
|
});
|
|
256345
256558
|
};
|
|
@@ -256579,7 +256792,7 @@ ZodNumber.create = (params) => {
|
|
|
256579
256792
|
return new ZodNumber({
|
|
256580
256793
|
checks: [],
|
|
256581
256794
|
typeName: ZodFirstPartyTypeKind.ZodNumber,
|
|
256582
|
-
coerce: _optionalChain([params, 'optionalAccess',
|
|
256795
|
+
coerce: _optionalChain([params, 'optionalAccess', _769 => _769.coerce]) || false,
|
|
256583
256796
|
...processCreateParams(params)
|
|
256584
256797
|
});
|
|
256585
256798
|
};
|
|
@@ -256751,7 +256964,7 @@ ZodBigInt.create = (params) => {
|
|
|
256751
256964
|
return new ZodBigInt({
|
|
256752
256965
|
checks: [],
|
|
256753
256966
|
typeName: ZodFirstPartyTypeKind.ZodBigInt,
|
|
256754
|
-
coerce: _nullishCoalesce(_optionalChain([params, 'optionalAccess',
|
|
256967
|
+
coerce: _nullishCoalesce(_optionalChain([params, 'optionalAccess', _770 => _770.coerce]), () => ( false)),
|
|
256755
256968
|
...processCreateParams(params)
|
|
256756
256969
|
});
|
|
256757
256970
|
};
|
|
@@ -256776,7 +256989,7 @@ var ZodBoolean = class extends ZodType {
|
|
|
256776
256989
|
ZodBoolean.create = (params) => {
|
|
256777
256990
|
return new ZodBoolean({
|
|
256778
256991
|
typeName: ZodFirstPartyTypeKind.ZodBoolean,
|
|
256779
|
-
coerce: _optionalChain([params, 'optionalAccess',
|
|
256992
|
+
coerce: _optionalChain([params, 'optionalAccess', _771 => _771.coerce]) || false,
|
|
256780
256993
|
...processCreateParams(params)
|
|
256781
256994
|
});
|
|
256782
256995
|
};
|
|
@@ -256884,7 +257097,7 @@ var ZodDate = class _ZodDate extends ZodType {
|
|
|
256884
257097
|
ZodDate.create = (params) => {
|
|
256885
257098
|
return new ZodDate({
|
|
256886
257099
|
checks: [],
|
|
256887
|
-
coerce: _optionalChain([params, 'optionalAccess',
|
|
257100
|
+
coerce: _optionalChain([params, 'optionalAccess', _772 => _772.coerce]) || false,
|
|
256888
257101
|
typeName: ZodFirstPartyTypeKind.ZodDate,
|
|
256889
257102
|
...processCreateParams(params)
|
|
256890
257103
|
});
|
|
@@ -257258,7 +257471,7 @@ var ZodObject = class _ZodObject extends ZodType {
|
|
|
257258
257471
|
unknownKeys: "strict",
|
|
257259
257472
|
...message !== void 0 ? {
|
|
257260
257473
|
errorMap: (issue2, ctx) => {
|
|
257261
|
-
const defaultError = _nullishCoalesce(_optionalChain([this, 'access',
|
|
257474
|
+
const defaultError = _nullishCoalesce(_optionalChain([this, 'access', _773 => _773._def, 'access', _774 => _774.errorMap, 'optionalCall', _775 => _775(issue2, ctx), 'access', _776 => _776.message]), () => ( ctx.defaultError));
|
|
257262
257475
|
if (issue2.code === "unrecognized_keys")
|
|
257263
257476
|
return {
|
|
257264
257477
|
message: _nullishCoalesce(errorUtil.errToObj(message).message, () => ( defaultError))
|
|
@@ -259092,13 +259305,13 @@ function $constructor(name, initializer3, params) {
|
|
|
259092
259305
|
}
|
|
259093
259306
|
}
|
|
259094
259307
|
}
|
|
259095
|
-
const Parent = _nullishCoalesce(_optionalChain([params, 'optionalAccess',
|
|
259308
|
+
const Parent = _nullishCoalesce(_optionalChain([params, 'optionalAccess', _777 => _777.Parent]), () => ( Object));
|
|
259096
259309
|
class Definition extends Parent {
|
|
259097
259310
|
}
|
|
259098
259311
|
Object.defineProperty(Definition, "name", { value: name });
|
|
259099
259312
|
function _(def7) {
|
|
259100
259313
|
var _a4;
|
|
259101
|
-
const inst = _optionalChain([params, 'optionalAccess',
|
|
259314
|
+
const inst = _optionalChain([params, 'optionalAccess', _778 => _778.Parent]) ? new Definition() : this;
|
|
259102
259315
|
init(inst, def7);
|
|
259103
259316
|
_nullishCoalesce((_a4 = inst._zod).deferred, () => ( (_a4.deferred = [])));
|
|
259104
259317
|
for (const fn of inst._zod.deferred) {
|
|
@@ -259109,9 +259322,9 @@ function $constructor(name, initializer3, params) {
|
|
|
259109
259322
|
Object.defineProperty(_, "init", { value: init });
|
|
259110
259323
|
Object.defineProperty(_, Symbol.hasInstance, {
|
|
259111
259324
|
value: (inst) => {
|
|
259112
|
-
if (_optionalChain([params, 'optionalAccess',
|
|
259325
|
+
if (_optionalChain([params, 'optionalAccess', _779 => _779.Parent]) && inst instanceof params.Parent)
|
|
259113
259326
|
return true;
|
|
259114
|
-
return _optionalChain([inst, 'optionalAccess',
|
|
259327
|
+
return _optionalChain([inst, 'optionalAccess', _780 => _780._zod, 'optionalAccess', _781 => _781.traits, 'optionalAccess', _782 => _782.has, 'call', _783 => _783(name)]);
|
|
259115
259328
|
}
|
|
259116
259329
|
});
|
|
259117
259330
|
Object.defineProperty(_, "name", { value: name });
|
|
@@ -259262,7 +259475,7 @@ function floatSafeRemainder2(val, step2) {
|
|
|
259262
259475
|
let stepDecCount = (stepString.split(".")[1] || "").length;
|
|
259263
259476
|
if (stepDecCount === 0 && /\d?e-\d?/.test(stepString)) {
|
|
259264
259477
|
const match2 = stepString.match(/\d?e-(\d?)/);
|
|
259265
|
-
if (_optionalChain([match2, 'optionalAccess',
|
|
259478
|
+
if (_optionalChain([match2, 'optionalAccess', _784 => _784[1]])) {
|
|
259266
259479
|
stepDecCount = Number.parseInt(match2[1]);
|
|
259267
259480
|
}
|
|
259268
259481
|
}
|
|
@@ -259319,7 +259532,7 @@ function cloneDef(schema) {
|
|
|
259319
259532
|
function getElementAtPath(obj, path16) {
|
|
259320
259533
|
if (!path16)
|
|
259321
259534
|
return obj;
|
|
259322
|
-
return path16.reduce((acc, key) => _optionalChain([acc, 'optionalAccess',
|
|
259535
|
+
return path16.reduce((acc, key) => _optionalChain([acc, 'optionalAccess', _785 => _785[key]]), obj);
|
|
259323
259536
|
}
|
|
259324
259537
|
function promiseAllObject(promisesObj) {
|
|
259325
259538
|
const keys13 = Object.keys(promisesObj);
|
|
@@ -259352,7 +259565,7 @@ function isObject5(data2) {
|
|
|
259352
259565
|
return typeof data2 === "object" && data2 !== null && !Array.isArray(data2);
|
|
259353
259566
|
}
|
|
259354
259567
|
var allowsEval = cached(() => {
|
|
259355
|
-
if (typeof navigator !== "undefined" && _optionalChain([navigator, 'optionalAccess',
|
|
259568
|
+
if (typeof navigator !== "undefined" && _optionalChain([navigator, 'optionalAccess', _786 => _786.userAgent, 'optionalAccess', _787 => _787.includes, 'call', _788 => _788("Cloudflare")])) {
|
|
259356
259569
|
return false;
|
|
259357
259570
|
}
|
|
259358
259571
|
try {
|
|
@@ -259446,7 +259659,7 @@ function escapeRegex2(str) {
|
|
|
259446
259659
|
}
|
|
259447
259660
|
function clone(inst, def7, params) {
|
|
259448
259661
|
const cl = new inst._zod.constr(_nullishCoalesce(def7, () => ( inst._zod.def)));
|
|
259449
|
-
if (!def7 || _optionalChain([params, 'optionalAccess',
|
|
259662
|
+
if (!def7 || _optionalChain([params, 'optionalAccess', _789 => _789.parent]))
|
|
259450
259663
|
cl._zod.parent = inst;
|
|
259451
259664
|
return cl;
|
|
259452
259665
|
}
|
|
@@ -259456,8 +259669,8 @@ function normalizeParams(_params) {
|
|
|
259456
259669
|
return {};
|
|
259457
259670
|
if (typeof params === "string")
|
|
259458
259671
|
return { error: () => params };
|
|
259459
|
-
if (_optionalChain([params, 'optionalAccess',
|
|
259460
|
-
if (_optionalChain([params, 'optionalAccess',
|
|
259672
|
+
if (_optionalChain([params, 'optionalAccess', _790 => _790.message]) !== void 0) {
|
|
259673
|
+
if (_optionalChain([params, 'optionalAccess', _791 => _791.error]) !== void 0)
|
|
259461
259674
|
throw new Error("Cannot specify both `message` and `error` params");
|
|
259462
259675
|
params.error = params.message;
|
|
259463
259676
|
}
|
|
@@ -259696,7 +259909,7 @@ function aborted(x, startIndex = 0) {
|
|
|
259696
259909
|
if (x.aborted === true)
|
|
259697
259910
|
return true;
|
|
259698
259911
|
for (let i2 = startIndex; i2 < x.issues.length; i2++) {
|
|
259699
|
-
if (_optionalChain([x, 'access',
|
|
259912
|
+
if (_optionalChain([x, 'access', _792 => _792.issues, 'access', _793 => _793[i2], 'optionalAccess', _794 => _794.continue]) !== true) {
|
|
259700
259913
|
return true;
|
|
259701
259914
|
}
|
|
259702
259915
|
}
|
|
@@ -259711,17 +259924,17 @@ function prefixIssues(path16, issues) {
|
|
|
259711
259924
|
});
|
|
259712
259925
|
}
|
|
259713
259926
|
function unwrapMessage(message) {
|
|
259714
|
-
return typeof message === "string" ? message : _optionalChain([message, 'optionalAccess',
|
|
259927
|
+
return typeof message === "string" ? message : _optionalChain([message, 'optionalAccess', _795 => _795.message]);
|
|
259715
259928
|
}
|
|
259716
259929
|
function finalizeIssue(iss, ctx, config5) {
|
|
259717
259930
|
const full = { ...iss, path: _nullishCoalesce(iss.path, () => ( [])) };
|
|
259718
259931
|
if (!iss.message) {
|
|
259719
|
-
const message = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(unwrapMessage(_optionalChain([iss, 'access',
|
|
259932
|
+
const message = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(unwrapMessage(_optionalChain([iss, 'access', _796 => _796.inst, 'optionalAccess', _797 => _797._zod, 'access', _798 => _798.def, 'optionalAccess', _799 => _799.error, 'optionalCall', _800 => _800(iss)])), () => ( unwrapMessage(_optionalChain([ctx, 'optionalAccess', _801 => _801.error, 'optionalCall', _802 => _802(iss)])))), () => ( unwrapMessage(_optionalChain([config5, 'access', _803 => _803.customError, 'optionalCall', _804 => _804(iss)])))), () => ( unwrapMessage(_optionalChain([config5, 'access', _805 => _805.localeError, 'optionalCall', _806 => _806(iss)])))), () => ( "Invalid input"));
|
|
259720
259933
|
full.message = message;
|
|
259721
259934
|
}
|
|
259722
259935
|
delete full.inst;
|
|
259723
259936
|
delete full.continue;
|
|
259724
|
-
if (!_optionalChain([ctx, 'optionalAccess',
|
|
259937
|
+
if (!_optionalChain([ctx, 'optionalAccess', _807 => _807.reportInput])) {
|
|
259725
259938
|
delete full.input;
|
|
259726
259939
|
}
|
|
259727
259940
|
return full;
|
|
@@ -259952,7 +260165,7 @@ function prettifyError(error49) {
|
|
|
259952
260165
|
const issues = [...error49.issues].sort((a, b) => (_nullishCoalesce(a.path, () => ( []))).length - (_nullishCoalesce(b.path, () => ( []))).length);
|
|
259953
260166
|
for (const issue2 of issues) {
|
|
259954
260167
|
lines.push(`\u2716 ${issue2.message}`);
|
|
259955
|
-
if (_optionalChain([issue2, 'access',
|
|
260168
|
+
if (_optionalChain([issue2, 'access', _808 => _808.path, 'optionalAccess', _809 => _809.length]))
|
|
259956
260169
|
lines.push(` \u2192 at ${toDotPath(issue2.path)}`);
|
|
259957
260170
|
}
|
|
259958
260171
|
return lines.join("\n");
|
|
@@ -259966,8 +260179,8 @@ var _parse = (_Err) => (schema, value, _ctx7, _params) => {
|
|
|
259966
260179
|
throw new $ZodAsyncError();
|
|
259967
260180
|
}
|
|
259968
260181
|
if (result.issues.length) {
|
|
259969
|
-
const e = new (_nullishCoalesce(_optionalChain([_params, 'optionalAccess',
|
|
259970
|
-
captureStackTrace(e, _optionalChain([_params, 'optionalAccess',
|
|
260182
|
+
const e = new (_nullishCoalesce(_optionalChain([_params, 'optionalAccess', _810 => _810.Err]), () => ( _Err)))(result.issues.map((iss) => finalizeIssue(iss, ctx, config4())));
|
|
260183
|
+
captureStackTrace(e, _optionalChain([_params, 'optionalAccess', _811 => _811.callee]));
|
|
259971
260184
|
throw e;
|
|
259972
260185
|
}
|
|
259973
260186
|
return result.value;
|
|
@@ -259979,8 +260192,8 @@ var _parseAsync = (_Err) => async (schema, value, _ctx7, params) => {
|
|
|
259979
260192
|
if (result instanceof Promise)
|
|
259980
260193
|
result = await result;
|
|
259981
260194
|
if (result.issues.length) {
|
|
259982
|
-
const e = new (_nullishCoalesce(_optionalChain([params, 'optionalAccess',
|
|
259983
|
-
captureStackTrace(e, _optionalChain([params, 'optionalAccess',
|
|
260195
|
+
const e = new (_nullishCoalesce(_optionalChain([params, 'optionalAccess', _812 => _812.Err]), () => ( _Err)))(result.issues.map((iss) => finalizeIssue(iss, ctx, config4())));
|
|
260196
|
+
captureStackTrace(e, _optionalChain([params, 'optionalAccess', _813 => _813.callee]));
|
|
259984
260197
|
throw e;
|
|
259985
260198
|
}
|
|
259986
260199
|
return result.value;
|
|
@@ -260176,7 +260389,7 @@ function datetime(args) {
|
|
|
260176
260389
|
return new RegExp(`^${dateSource}T(?:${timeRegex2})$`);
|
|
260177
260390
|
}
|
|
260178
260391
|
var string = (params) => {
|
|
260179
|
-
const regex2 = params ? `[\\s\\S]{${_nullishCoalesce(_optionalChain([params, 'optionalAccess',
|
|
260392
|
+
const regex2 = params ? `[\\s\\S]{${_nullishCoalesce(_optionalChain([params, 'optionalAccess', _814 => _814.minimum]), () => ( 0))},${_nullishCoalesce(_optionalChain([params, 'optionalAccess', _815 => _815.maximum]), () => ( ""))}}` : `[\\s\\S]*`;
|
|
260180
260393
|
return new RegExp(`^${regex2}$`);
|
|
260181
260394
|
};
|
|
260182
260395
|
var bigint = /^-?\d+n?$/;
|
|
@@ -260303,7 +260516,7 @@ var $ZodCheckMultipleOf = /* @__PURE__ */ $constructor("$ZodCheckMultipleOf", (i
|
|
|
260303
260516
|
var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat", (inst, def7) => {
|
|
260304
260517
|
$ZodCheck.init(inst, def7);
|
|
260305
260518
|
def7.format = def7.format || "float64";
|
|
260306
|
-
const isInt = _optionalChain([def7, 'access',
|
|
260519
|
+
const isInt = _optionalChain([def7, 'access', _816 => _816.format, 'optionalAccess', _817 => _817.includes, 'call', _818 => _818("int")]);
|
|
260307
260520
|
const origin2 = isInt ? "int" : "number";
|
|
260308
260521
|
const [minimum, maximum] = NUMBER_FORMAT_RANGES[def7.format];
|
|
260309
260522
|
inst._zod.onattach.push((inst2) => {
|
|
@@ -260788,8 +261001,8 @@ var Doc = class {
|
|
|
260788
261001
|
}
|
|
260789
261002
|
compile() {
|
|
260790
261003
|
const F = Function;
|
|
260791
|
-
const args = _optionalChain([this, 'optionalAccess',
|
|
260792
|
-
const content = _nullishCoalesce(_optionalChain([this, 'optionalAccess',
|
|
261004
|
+
const args = _optionalChain([this, 'optionalAccess', _819 => _819.args]);
|
|
261005
|
+
const content = _nullishCoalesce(_optionalChain([this, 'optionalAccess', _820 => _820.content]), () => ( [``]));
|
|
260793
261006
|
const lines = [...content.map((x) => ` ${x}`)];
|
|
260794
261007
|
return new F(...args, lines.join("\n"));
|
|
260795
261008
|
}
|
|
@@ -260821,7 +261034,7 @@ var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def7) => {
|
|
|
260821
261034
|
}
|
|
260822
261035
|
if (checks.length === 0) {
|
|
260823
261036
|
_nullishCoalesce((_a4 = inst._zod).deferred, () => ( (_a4.deferred = [])));
|
|
260824
|
-
_optionalChain([inst, 'access',
|
|
261037
|
+
_optionalChain([inst, 'access', _821 => _821._zod, 'access', _822 => _822.deferred, 'optionalAccess', _823 => _823.push, 'call', _824 => _824(() => {
|
|
260825
261038
|
inst._zod.run = inst._zod.parse;
|
|
260826
261039
|
})]);
|
|
260827
261040
|
} else {
|
|
@@ -260838,7 +261051,7 @@ var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def7) => {
|
|
|
260838
261051
|
}
|
|
260839
261052
|
const currLen = payload.issues.length;
|
|
260840
261053
|
const _ = ch._zod.check(payload);
|
|
260841
|
-
if (_ instanceof Promise && _optionalChain([ctx, 'optionalAccess',
|
|
261054
|
+
if (_ instanceof Promise && _optionalChain([ctx, 'optionalAccess', _825 => _825.async]) === false) {
|
|
260842
261055
|
throw new $ZodAsyncError();
|
|
260843
261056
|
}
|
|
260844
261057
|
if (asyncResult || _ instanceof Promise) {
|
|
@@ -260904,9 +261117,9 @@ var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def7) => {
|
|
|
260904
261117
|
validate: (value) => {
|
|
260905
261118
|
try {
|
|
260906
261119
|
const r = safeParse(inst, value);
|
|
260907
|
-
return r.success ? { value: r.data } : { issues: _optionalChain([r, 'access',
|
|
261120
|
+
return r.success ? { value: r.data } : { issues: _optionalChain([r, 'access', _826 => _826.error, 'optionalAccess', _827 => _827.issues]) };
|
|
260908
261121
|
} catch (_) {
|
|
260909
|
-
return safeParseAsync(inst, value).then((r) => r.success ? { value: r.data } : { issues: _optionalChain([r, 'access',
|
|
261122
|
+
return safeParseAsync(inst, value).then((r) => r.success ? { value: r.data } : { issues: _optionalChain([r, 'access', _828 => _828.error, 'optionalAccess', _829 => _829.issues]) });
|
|
260910
261123
|
}
|
|
260911
261124
|
},
|
|
260912
261125
|
vendor: "zod",
|
|
@@ -260915,7 +261128,7 @@ var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def7) => {
|
|
|
260915
261128
|
});
|
|
260916
261129
|
var $ZodString = /* @__PURE__ */ $constructor("$ZodString", (inst, def7) => {
|
|
260917
261130
|
$ZodType.init(inst, def7);
|
|
260918
|
-
inst._zod.pattern = _nullishCoalesce([..._nullishCoalesce(_optionalChain([inst, 'optionalAccess',
|
|
261131
|
+
inst._zod.pattern = _nullishCoalesce([..._nullishCoalesce(_optionalChain([inst, 'optionalAccess', _830 => _830._zod, 'access', _831 => _831.bag, 'optionalAccess', _832 => _832.patterns]), () => ( []))].pop(), () => ( string(inst._zod.bag)));
|
|
260919
261132
|
inst._zod.parse = (payload, _) => {
|
|
260920
261133
|
if (def7.coerce)
|
|
260921
261134
|
try {
|
|
@@ -261184,7 +261397,7 @@ function isValidJWT2(token2, algorithm = null) {
|
|
|
261184
261397
|
if (!header)
|
|
261185
261398
|
return false;
|
|
261186
261399
|
const parsedHeader = JSON.parse(atob(header));
|
|
261187
|
-
if ("typ" in parsedHeader && _optionalChain([parsedHeader, 'optionalAccess',
|
|
261400
|
+
if ("typ" in parsedHeader && _optionalChain([parsedHeader, 'optionalAccess', _833 => _833.typ]) !== "JWT")
|
|
261188
261401
|
return false;
|
|
261189
261402
|
if (!parsedHeader.alg)
|
|
261190
261403
|
return false;
|
|
@@ -261463,7 +261676,7 @@ function handlePropertyResult(result, final, key, input, isOptionalOut) {
|
|
|
261463
261676
|
function normalizeDef(def7) {
|
|
261464
261677
|
const keys13 = Object.keys(def7.shape);
|
|
261465
261678
|
for (const k2 of keys13) {
|
|
261466
|
-
if (!_optionalChain([def7, 'access',
|
|
261679
|
+
if (!_optionalChain([def7, 'access', _834 => _834.shape, 'optionalAccess', _835 => _835[k2], 'optionalAccess', _836 => _836._zod, 'optionalAccess', _837 => _837.traits, 'optionalAccess', _838 => _838.has, 'call', _839 => _839("$ZodType")])) {
|
|
261467
261680
|
throw new Error(`Invalid element at key "${k2}": expected a Zod schema`);
|
|
261468
261681
|
}
|
|
261469
261682
|
}
|
|
@@ -261513,7 +261726,7 @@ function handleCatchall(proms, input, payload, ctx, def7, inst) {
|
|
|
261513
261726
|
var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def7) => {
|
|
261514
261727
|
$ZodType.init(inst, def7);
|
|
261515
261728
|
const desc = Object.getOwnPropertyDescriptor(def7, "shape");
|
|
261516
|
-
if (!_optionalChain([desc, 'optionalAccess',
|
|
261729
|
+
if (!_optionalChain([desc, 'optionalAccess', _840 => _840.get])) {
|
|
261517
261730
|
const sh = def7.shape;
|
|
261518
261731
|
Object.defineProperty(def7, "shape", {
|
|
261519
261732
|
get: () => {
|
|
@@ -261595,7 +261808,7 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def7) =
|
|
|
261595
261808
|
const id7 = ids[key];
|
|
261596
261809
|
const k2 = esc(key);
|
|
261597
261810
|
const schema = shape[key];
|
|
261598
|
-
const isOptionalOut = _optionalChain([schema, 'optionalAccess',
|
|
261811
|
+
const isOptionalOut = _optionalChain([schema, 'optionalAccess', _841 => _841._zod, 'optionalAccess', _842 => _842.optout]) === "optional";
|
|
261599
261812
|
doc.write(`const ${id7} = ${parseStr(key)};`);
|
|
261600
261813
|
if (isOptionalOut) {
|
|
261601
261814
|
doc.write(`
|
|
@@ -261661,7 +261874,7 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def7) =
|
|
|
261661
261874
|
});
|
|
261662
261875
|
return payload;
|
|
261663
261876
|
}
|
|
261664
|
-
if (jit && fastEnabled && _optionalChain([ctx, 'optionalAccess',
|
|
261877
|
+
if (jit && fastEnabled && _optionalChain([ctx, 'optionalAccess', _843 => _843.async]) === false && ctx.jitless !== true) {
|
|
261665
261878
|
if (!fastpass)
|
|
261666
261879
|
fastpass = generateFastpass(def7.shape);
|
|
261667
261880
|
payload = fastpass(payload, ctx);
|
|
@@ -261816,7 +262029,7 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
|
|
|
261816
262029
|
const opts = def7.options;
|
|
261817
262030
|
const map5 = /* @__PURE__ */ new Map();
|
|
261818
262031
|
for (const o of opts) {
|
|
261819
|
-
const values3 = _optionalChain([o, 'access',
|
|
262032
|
+
const values3 = _optionalChain([o, 'access', _844 => _844._zod, 'access', _845 => _845.propValues, 'optionalAccess', _846 => _846[def7.discriminator]]);
|
|
261820
262033
|
if (!values3 || values3.size === 0)
|
|
261821
262034
|
throw new Error(`Invalid discriminated union option at index "${def7.options.indexOf(o)}"`);
|
|
261822
262035
|
for (const v of values3) {
|
|
@@ -261839,7 +262052,7 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
|
|
|
261839
262052
|
});
|
|
261840
262053
|
return payload;
|
|
261841
262054
|
}
|
|
261842
|
-
const opt = disc.value.get(_optionalChain([input, 'optionalAccess',
|
|
262055
|
+
const opt = disc.value.get(_optionalChain([input, 'optionalAccess', _847 => _847[def7.discriminator]]));
|
|
261843
262056
|
if (opt) {
|
|
261844
262057
|
return opt._zod.run(payload, ctx);
|
|
261845
262058
|
}
|
|
@@ -262583,8 +262796,8 @@ var $ZodReadonly = /* @__PURE__ */ $constructor("$ZodReadonly", (inst, def7) =>
|
|
|
262583
262796
|
$ZodType.init(inst, def7);
|
|
262584
262797
|
defineLazy(inst._zod, "propValues", () => def7.innerType._zod.propValues);
|
|
262585
262798
|
defineLazy(inst._zod, "values", () => def7.innerType._zod.values);
|
|
262586
|
-
defineLazy(inst._zod, "optin", () => _optionalChain([def7, 'access',
|
|
262587
|
-
defineLazy(inst._zod, "optout", () => _optionalChain([def7, 'access',
|
|
262799
|
+
defineLazy(inst._zod, "optin", () => _optionalChain([def7, 'access', _848 => _848.innerType, 'optionalAccess', _849 => _849._zod, 'optionalAccess', _850 => _850.optin]));
|
|
262800
|
+
defineLazy(inst._zod, "optout", () => _optionalChain([def7, 'access', _851 => _851.innerType, 'optionalAccess', _852 => _852._zod, 'optionalAccess', _853 => _853.optout]));
|
|
262588
262801
|
inst._zod.parse = (payload, ctx) => {
|
|
262589
262802
|
if (ctx.direction === "backward") {
|
|
262590
262803
|
return def7.innerType._zod.run(payload, ctx);
|
|
@@ -262731,10 +262944,10 @@ var $ZodPromise = /* @__PURE__ */ $constructor("$ZodPromise", (inst, def7) => {
|
|
|
262731
262944
|
var $ZodLazy = /* @__PURE__ */ $constructor("$ZodLazy", (inst, def7) => {
|
|
262732
262945
|
$ZodType.init(inst, def7);
|
|
262733
262946
|
defineLazy(inst._zod, "innerType", () => def7.getter());
|
|
262734
|
-
defineLazy(inst._zod, "pattern", () => _optionalChain([inst, 'access',
|
|
262735
|
-
defineLazy(inst._zod, "propValues", () => _optionalChain([inst, 'access',
|
|
262736
|
-
defineLazy(inst._zod, "optin", () => _nullishCoalesce(_optionalChain([inst, 'access',
|
|
262737
|
-
defineLazy(inst._zod, "optout", () => _nullishCoalesce(_optionalChain([inst, 'access',
|
|
262947
|
+
defineLazy(inst._zod, "pattern", () => _optionalChain([inst, 'access', _854 => _854._zod, 'access', _855 => _855.innerType, 'optionalAccess', _856 => _856._zod, 'optionalAccess', _857 => _857.pattern]));
|
|
262948
|
+
defineLazy(inst._zod, "propValues", () => _optionalChain([inst, 'access', _858 => _858._zod, 'access', _859 => _859.innerType, 'optionalAccess', _860 => _860._zod, 'optionalAccess', _861 => _861.propValues]));
|
|
262949
|
+
defineLazy(inst._zod, "optin", () => _nullishCoalesce(_optionalChain([inst, 'access', _862 => _862._zod, 'access', _863 => _863.innerType, 'optionalAccess', _864 => _864._zod, 'optionalAccess', _865 => _865.optin]), () => ( void 0)));
|
|
262950
|
+
defineLazy(inst._zod, "optout", () => _nullishCoalesce(_optionalChain([inst, 'access', _866 => _866._zod, 'access', _867 => _867.innerType, 'optionalAccess', _868 => _868._zod, 'optionalAccess', _869 => _869.optout]), () => ( void 0)));
|
|
262738
262951
|
inst._zod.parse = (payload, ctx) => {
|
|
262739
262952
|
const inner = inst._zod.innerType;
|
|
262740
262953
|
return inner._zod.run(payload, ctx);
|
|
@@ -264619,7 +264832,7 @@ var error17 = () => {
|
|
|
264619
264832
|
const withDefinite = (t) => `\u05D4${typeLabel(t)}`;
|
|
264620
264833
|
const verbFor = (t) => {
|
|
264621
264834
|
const e = typeEntry(t);
|
|
264622
|
-
const gender = _nullishCoalesce(_optionalChain([e, 'optionalAccess',
|
|
264835
|
+
const gender = _nullishCoalesce(_optionalChain([e, 'optionalAccess', _870 => _870.gender]), () => ( "m"));
|
|
264623
264836
|
return gender === "f" ? "\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA" : "\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA";
|
|
264624
264837
|
};
|
|
264625
264838
|
const getSizing = (origin2) => {
|
|
@@ -264668,7 +264881,7 @@ var error17 = () => {
|
|
|
264668
264881
|
const expectedKey = issue2.expected;
|
|
264669
264882
|
const expected = _nullishCoalesce(TypeDictionary[_nullishCoalesce(expectedKey, () => ( ""))], () => ( typeLabel(expectedKey)));
|
|
264670
264883
|
const receivedType = parsedType(issue2.input);
|
|
264671
|
-
const received = _nullishCoalesce(_nullishCoalesce(TypeDictionary[receivedType], () => ( _optionalChain([TypeNames, 'access',
|
|
264884
|
+
const received = _nullishCoalesce(_nullishCoalesce(TypeDictionary[receivedType], () => ( _optionalChain([TypeNames, 'access', _871 => _871[receivedType], 'optionalAccess', _872 => _872.label]))), () => ( receivedType));
|
|
264672
264885
|
if (/^[A-Z]/.test(issue2.expected)) {
|
|
264673
264886
|
return `\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA instanceof ${issue2.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${received}`;
|
|
264674
264887
|
}
|
|
@@ -264690,7 +264903,7 @@ var error17 = () => {
|
|
|
264690
264903
|
const sizing = getSizing(issue2.origin);
|
|
264691
264904
|
const subject = withDefinite(_nullishCoalesce(issue2.origin, () => ( "value")));
|
|
264692
264905
|
if (issue2.origin === "string") {
|
|
264693
|
-
return `${_nullishCoalesce(_optionalChain([sizing, 'optionalAccess',
|
|
264906
|
+
return `${_nullishCoalesce(_optionalChain([sizing, 'optionalAccess', _873 => _873.longLabel]), () => ( "\u05D0\u05E8\u05D5\u05DA"))} \u05DE\u05D3\u05D9: ${subject} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${issue2.maximum.toString()} ${_nullishCoalesce(_optionalChain([sizing, 'optionalAccess', _874 => _874.unit]), () => ( ""))} ${issue2.inclusive ? "\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA" : "\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();
|
|
264694
264907
|
}
|
|
264695
264908
|
if (issue2.origin === "number") {
|
|
264696
264909
|
const comparison = issue2.inclusive ? `\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${issue2.maximum}` : `\u05E7\u05D8\u05DF \u05DE-${issue2.maximum}`;
|
|
@@ -264698,21 +264911,21 @@ var error17 = () => {
|
|
|
264698
264911
|
}
|
|
264699
264912
|
if (issue2.origin === "array" || issue2.origin === "set") {
|
|
264700
264913
|
const verb = issue2.origin === "set" ? "\u05E6\u05E8\u05D9\u05DB\u05D4" : "\u05E6\u05E8\u05D9\u05DA";
|
|
264701
|
-
const comparison = issue2.inclusive ? `${issue2.maximum} ${_nullishCoalesce(_optionalChain([sizing, 'optionalAccess',
|
|
264914
|
+
const comparison = issue2.inclusive ? `${issue2.maximum} ${_nullishCoalesce(_optionalChain([sizing, 'optionalAccess', _875 => _875.unit]), () => ( ""))} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA` : `\u05E4\u05D7\u05D5\u05EA \u05DE-${issue2.maximum} ${_nullishCoalesce(_optionalChain([sizing, 'optionalAccess', _876 => _876.unit]), () => ( ""))}`;
|
|
264702
264915
|
return `\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${subject} ${verb} \u05DC\u05D4\u05DB\u05D9\u05DC ${comparison}`.trim();
|
|
264703
264916
|
}
|
|
264704
264917
|
const adj = issue2.inclusive ? "<=" : "<";
|
|
264705
264918
|
const be = verbFor(_nullishCoalesce(issue2.origin, () => ( "value")));
|
|
264706
|
-
if (_optionalChain([sizing, 'optionalAccess',
|
|
264919
|
+
if (_optionalChain([sizing, 'optionalAccess', _877 => _877.unit])) {
|
|
264707
264920
|
return `${sizing.longLabel} \u05DE\u05D3\u05D9: ${subject} ${be} ${adj}${issue2.maximum.toString()} ${sizing.unit}`;
|
|
264708
264921
|
}
|
|
264709
|
-
return `${_nullishCoalesce(_optionalChain([sizing, 'optionalAccess',
|
|
264922
|
+
return `${_nullishCoalesce(_optionalChain([sizing, 'optionalAccess', _878 => _878.longLabel]), () => ( "\u05D2\u05D3\u05D5\u05DC"))} \u05DE\u05D3\u05D9: ${subject} ${be} ${adj}${issue2.maximum.toString()}`;
|
|
264710
264923
|
}
|
|
264711
264924
|
case "too_small": {
|
|
264712
264925
|
const sizing = getSizing(issue2.origin);
|
|
264713
264926
|
const subject = withDefinite(_nullishCoalesce(issue2.origin, () => ( "value")));
|
|
264714
264927
|
if (issue2.origin === "string") {
|
|
264715
|
-
return `${_nullishCoalesce(_optionalChain([sizing, 'optionalAccess',
|
|
264928
|
+
return `${_nullishCoalesce(_optionalChain([sizing, 'optionalAccess', _879 => _879.shortLabel]), () => ( "\u05E7\u05E6\u05E8"))} \u05DE\u05D3\u05D9: ${subject} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${issue2.minimum.toString()} ${_nullishCoalesce(_optionalChain([sizing, 'optionalAccess', _880 => _880.unit]), () => ( ""))} ${issue2.inclusive ? "\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8" : "\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();
|
|
264716
264929
|
}
|
|
264717
264930
|
if (issue2.origin === "number") {
|
|
264718
264931
|
const comparison = issue2.inclusive ? `\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${issue2.minimum}` : `\u05D2\u05D3\u05D5\u05DC \u05DE-${issue2.minimum}`;
|
|
@@ -264724,15 +264937,15 @@ var error17 = () => {
|
|
|
264724
264937
|
const singularPhrase = issue2.origin === "set" ? "\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3" : "\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3";
|
|
264725
264938
|
return `\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${subject} ${verb} \u05DC\u05D4\u05DB\u05D9\u05DC ${singularPhrase}`;
|
|
264726
264939
|
}
|
|
264727
|
-
const comparison = issue2.inclusive ? `${issue2.minimum} ${_nullishCoalesce(_optionalChain([sizing, 'optionalAccess',
|
|
264940
|
+
const comparison = issue2.inclusive ? `${issue2.minimum} ${_nullishCoalesce(_optionalChain([sizing, 'optionalAccess', _881 => _881.unit]), () => ( ""))} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8` : `\u05D9\u05D5\u05EA\u05E8 \u05DE-${issue2.minimum} ${_nullishCoalesce(_optionalChain([sizing, 'optionalAccess', _882 => _882.unit]), () => ( ""))}`;
|
|
264728
264941
|
return `\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${subject} ${verb} \u05DC\u05D4\u05DB\u05D9\u05DC ${comparison}`.trim();
|
|
264729
264942
|
}
|
|
264730
264943
|
const adj = issue2.inclusive ? ">=" : ">";
|
|
264731
264944
|
const be = verbFor(_nullishCoalesce(issue2.origin, () => ( "value")));
|
|
264732
|
-
if (_optionalChain([sizing, 'optionalAccess',
|
|
264945
|
+
if (_optionalChain([sizing, 'optionalAccess', _883 => _883.unit])) {
|
|
264733
264946
|
return `${sizing.shortLabel} \u05DE\u05D3\u05D9: ${subject} ${be} ${adj}${issue2.minimum.toString()} ${sizing.unit}`;
|
|
264734
264947
|
}
|
|
264735
|
-
return `${_nullishCoalesce(_optionalChain([sizing, 'optionalAccess',
|
|
264948
|
+
return `${_nullishCoalesce(_optionalChain([sizing, 'optionalAccess', _884 => _884.shortLabel]), () => ( "\u05E7\u05D8\u05DF"))} \u05DE\u05D3\u05D9: ${subject} ${be} ${adj}${issue2.minimum.toString()}`;
|
|
264736
264949
|
}
|
|
264737
264950
|
case "invalid_format": {
|
|
264738
264951
|
const _issue = issue2;
|
|
@@ -264745,8 +264958,8 @@ var error17 = () => {
|
|
|
264745
264958
|
if (_issue.format === "regex")
|
|
264746
264959
|
return `\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${_issue.pattern}`;
|
|
264747
264960
|
const nounEntry = FormatDictionary[_issue.format];
|
|
264748
|
-
const noun = _nullishCoalesce(_optionalChain([nounEntry, 'optionalAccess',
|
|
264749
|
-
const gender = _nullishCoalesce(_optionalChain([nounEntry, 'optionalAccess',
|
|
264961
|
+
const noun = _nullishCoalesce(_optionalChain([nounEntry, 'optionalAccess', _885 => _885.label]), () => ( _issue.format));
|
|
264962
|
+
const gender = _nullishCoalesce(_optionalChain([nounEntry, 'optionalAccess', _886 => _886.gender]), () => ( "m"));
|
|
264750
264963
|
const adjective = gender === "f" ? "\u05EA\u05E7\u05D9\u05E0\u05D4" : "\u05EA\u05E7\u05D9\u05DF";
|
|
264751
264964
|
return `${noun} \u05DC\u05D0 ${adjective}`;
|
|
264752
264965
|
}
|
|
@@ -265769,7 +265982,7 @@ var error26 = () => {
|
|
|
265769
265982
|
const adj = issue2.inclusive ? "\uC774\uD558" : "\uBBF8\uB9CC";
|
|
265770
265983
|
const suffix = adj === "\uBBF8\uB9CC" ? "\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4" : "\uC5EC\uC57C \uD569\uB2C8\uB2E4";
|
|
265771
265984
|
const sizing = getSizing(issue2.origin);
|
|
265772
|
-
const unit = _nullishCoalesce(_optionalChain([sizing, 'optionalAccess',
|
|
265985
|
+
const unit = _nullishCoalesce(_optionalChain([sizing, 'optionalAccess', _887 => _887.unit]), () => ( "\uC694\uC18C"));
|
|
265773
265986
|
if (sizing)
|
|
265774
265987
|
return `${_nullishCoalesce(issue2.origin, () => ( "\uAC12"))}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${issue2.maximum.toString()}${unit} ${adj}${suffix}`;
|
|
265775
265988
|
return `${_nullishCoalesce(issue2.origin, () => ( "\uAC12"))}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${issue2.maximum.toString()} ${adj}${suffix}`;
|
|
@@ -265778,7 +265991,7 @@ var error26 = () => {
|
|
|
265778
265991
|
const adj = issue2.inclusive ? "\uC774\uC0C1" : "\uCD08\uACFC";
|
|
265779
265992
|
const suffix = adj === "\uC774\uC0C1" ? "\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4" : "\uC5EC\uC57C \uD569\uB2C8\uB2E4";
|
|
265780
265993
|
const sizing = getSizing(issue2.origin);
|
|
265781
|
-
const unit = _nullishCoalesce(_optionalChain([sizing, 'optionalAccess',
|
|
265994
|
+
const unit = _nullishCoalesce(_optionalChain([sizing, 'optionalAccess', _888 => _888.unit]), () => ( "\uC694\uC18C"));
|
|
265782
265995
|
if (sizing) {
|
|
265783
265996
|
return `${_nullishCoalesce(issue2.origin, () => ( "\uAC12"))}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${issue2.minimum.toString()}${unit} ${adj}${suffix}`;
|
|
265784
265997
|
}
|
|
@@ -265974,18 +266187,18 @@ var error27 = () => {
|
|
|
265974
266187
|
case "too_big": {
|
|
265975
266188
|
const origin2 = _nullishCoalesce(TypeDictionary[issue2.origin], () => ( issue2.origin));
|
|
265976
266189
|
const sizing = getSizing(issue2.origin, getUnitTypeFromNumber(Number(issue2.maximum)), _nullishCoalesce(issue2.inclusive, () => ( false)), "smaller");
|
|
265977
|
-
if (_optionalChain([sizing, 'optionalAccess',
|
|
266190
|
+
if (_optionalChain([sizing, 'optionalAccess', _889 => _889.verb]))
|
|
265978
266191
|
return `${capitalizeFirstCharacter(_nullishCoalesce(_nullishCoalesce(origin2, () => ( issue2.origin)), () => ( "reik\u0161m\u0117")))} ${sizing.verb} ${issue2.maximum.toString()} ${_nullishCoalesce(sizing.unit, () => ( "element\u0173"))}`;
|
|
265979
266192
|
const adj = issue2.inclusive ? "ne didesnis kaip" : "ma\u017Eesnis kaip";
|
|
265980
|
-
return `${capitalizeFirstCharacter(_nullishCoalesce(_nullishCoalesce(origin2, () => ( issue2.origin)), () => ( "reik\u0161m\u0117")))} turi b\u016Bti ${adj} ${issue2.maximum.toString()} ${_optionalChain([sizing, 'optionalAccess',
|
|
266193
|
+
return `${capitalizeFirstCharacter(_nullishCoalesce(_nullishCoalesce(origin2, () => ( issue2.origin)), () => ( "reik\u0161m\u0117")))} turi b\u016Bti ${adj} ${issue2.maximum.toString()} ${_optionalChain([sizing, 'optionalAccess', _890 => _890.unit])}`;
|
|
265981
266194
|
}
|
|
265982
266195
|
case "too_small": {
|
|
265983
266196
|
const origin2 = _nullishCoalesce(TypeDictionary[issue2.origin], () => ( issue2.origin));
|
|
265984
266197
|
const sizing = getSizing(issue2.origin, getUnitTypeFromNumber(Number(issue2.minimum)), _nullishCoalesce(issue2.inclusive, () => ( false)), "bigger");
|
|
265985
|
-
if (_optionalChain([sizing, 'optionalAccess',
|
|
266198
|
+
if (_optionalChain([sizing, 'optionalAccess', _891 => _891.verb]))
|
|
265986
266199
|
return `${capitalizeFirstCharacter(_nullishCoalesce(_nullishCoalesce(origin2, () => ( issue2.origin)), () => ( "reik\u0161m\u0117")))} ${sizing.verb} ${issue2.minimum.toString()} ${_nullishCoalesce(sizing.unit, () => ( "element\u0173"))}`;
|
|
265987
266200
|
const adj = issue2.inclusive ? "ne ma\u017Eesnis kaip" : "didesnis kaip";
|
|
265988
|
-
return `${capitalizeFirstCharacter(_nullishCoalesce(_nullishCoalesce(origin2, () => ( issue2.origin)), () => ( "reik\u0161m\u0117")))} turi b\u016Bti ${adj} ${issue2.minimum.toString()} ${_optionalChain([sizing, 'optionalAccess',
|
|
266201
|
+
return `${capitalizeFirstCharacter(_nullishCoalesce(_nullishCoalesce(origin2, () => ( issue2.origin)), () => ( "reik\u0161m\u0117")))} turi b\u016Bti ${adj} ${issue2.minimum.toString()} ${_optionalChain([sizing, 'optionalAccess', _892 => _892.unit])}`;
|
|
265989
266202
|
}
|
|
265990
266203
|
case "invalid_format": {
|
|
265991
266204
|
const _issue = issue2;
|
|
@@ -269499,24 +269712,24 @@ function _stringFormat(Class2, format2, fnOrRegex, _params = {}) {
|
|
|
269499
269712
|
// node_modules/zod/v4/core/to-json-schema.js
|
|
269500
269713
|
_chunkDLBJL7R2cjs.init_cjs_shims.call(void 0, );
|
|
269501
269714
|
function initializeContext(params) {
|
|
269502
|
-
let target = _nullishCoalesce(_optionalChain([params, 'optionalAccess',
|
|
269715
|
+
let target = _nullishCoalesce(_optionalChain([params, 'optionalAccess', _893 => _893.target]), () => ( "draft-2020-12"));
|
|
269503
269716
|
if (target === "draft-4")
|
|
269504
269717
|
target = "draft-04";
|
|
269505
269718
|
if (target === "draft-7")
|
|
269506
269719
|
target = "draft-07";
|
|
269507
269720
|
return {
|
|
269508
269721
|
processors: _nullishCoalesce(params.processors, () => ( {})),
|
|
269509
|
-
metadataRegistry: _nullishCoalesce(_optionalChain([params, 'optionalAccess',
|
|
269722
|
+
metadataRegistry: _nullishCoalesce(_optionalChain([params, 'optionalAccess', _894 => _894.metadata]), () => ( globalRegistry)),
|
|
269510
269723
|
target,
|
|
269511
|
-
unrepresentable: _nullishCoalesce(_optionalChain([params, 'optionalAccess',
|
|
269512
|
-
override: _nullishCoalesce(_optionalChain([params, 'optionalAccess',
|
|
269724
|
+
unrepresentable: _nullishCoalesce(_optionalChain([params, 'optionalAccess', _895 => _895.unrepresentable]), () => ( "throw")),
|
|
269725
|
+
override: _nullishCoalesce(_optionalChain([params, 'optionalAccess', _896 => _896.override]), () => ( (() => {
|
|
269513
269726
|
}))),
|
|
269514
|
-
io: _nullishCoalesce(_optionalChain([params, 'optionalAccess',
|
|
269727
|
+
io: _nullishCoalesce(_optionalChain([params, 'optionalAccess', _897 => _897.io]), () => ( "output")),
|
|
269515
269728
|
counter: 0,
|
|
269516
269729
|
seen: /* @__PURE__ */ new Map(),
|
|
269517
|
-
cycles: _nullishCoalesce(_optionalChain([params, 'optionalAccess',
|
|
269518
|
-
reused: _nullishCoalesce(_optionalChain([params, 'optionalAccess',
|
|
269519
|
-
external: _nullishCoalesce(_optionalChain([params, 'optionalAccess',
|
|
269730
|
+
cycles: _nullishCoalesce(_optionalChain([params, 'optionalAccess', _898 => _898.cycles]), () => ( "ref")),
|
|
269731
|
+
reused: _nullishCoalesce(_optionalChain([params, 'optionalAccess', _899 => _899.reused]), () => ( "inline")),
|
|
269732
|
+
external: _nullishCoalesce(_optionalChain([params, 'optionalAccess', _900 => _900.external]), () => ( void 0))
|
|
269520
269733
|
};
|
|
269521
269734
|
}
|
|
269522
269735
|
function process5(schema, ctx, _params = { path: [], schemaPath: [] }) {
|
|
@@ -269533,7 +269746,7 @@ function process5(schema, ctx, _params = { path: [], schemaPath: [] }) {
|
|
|
269533
269746
|
}
|
|
269534
269747
|
const result = { schema: {}, count: 1, cycle: void 0, path: _params.path };
|
|
269535
269748
|
ctx.seen.set(schema, result);
|
|
269536
|
-
const overrideSchema = _optionalChain([schema, 'access',
|
|
269749
|
+
const overrideSchema = _optionalChain([schema, 'access', _901 => _901._zod, 'access', _902 => _902.toJSONSchema, 'optionalCall', _903 => _903()]);
|
|
269537
269750
|
if (overrideSchema) {
|
|
269538
269751
|
result.schema = overrideSchema;
|
|
269539
269752
|
} else {
|
|
@@ -269579,7 +269792,7 @@ function extractDefs(ctx, schema) {
|
|
|
269579
269792
|
throw new Error("Unprocessed schema. This is a bug in Zod.");
|
|
269580
269793
|
const idToSchema = /* @__PURE__ */ new Map();
|
|
269581
269794
|
for (const entry of ctx.seen.entries()) {
|
|
269582
|
-
const id7 = _optionalChain([ctx, 'access',
|
|
269795
|
+
const id7 = _optionalChain([ctx, 'access', _904 => _904.metadataRegistry, 'access', _905 => _905.get, 'call', _906 => _906(entry[0]), 'optionalAccess', _907 => _907.id]);
|
|
269583
269796
|
if (id7) {
|
|
269584
269797
|
const existing = idToSchema.get(id7);
|
|
269585
269798
|
if (existing && existing !== entry[0]) {
|
|
@@ -269591,7 +269804,7 @@ function extractDefs(ctx, schema) {
|
|
|
269591
269804
|
const makeURI = (entry) => {
|
|
269592
269805
|
const defsSegment = ctx.target === "draft-2020-12" ? "$defs" : "definitions";
|
|
269593
269806
|
if (ctx.external) {
|
|
269594
|
-
const externalId = _optionalChain([ctx, 'access',
|
|
269807
|
+
const externalId = _optionalChain([ctx, 'access', _908 => _908.external, 'access', _909 => _909.registry, 'access', _910 => _910.get, 'call', _911 => _911(entry[0]), 'optionalAccess', _912 => _912.id]);
|
|
269595
269808
|
const uriGenerator = _nullishCoalesce(ctx.external.uri, () => ( ((id8) => id8)));
|
|
269596
269809
|
if (externalId) {
|
|
269597
269810
|
return { ref: uriGenerator(externalId) };
|
|
@@ -269627,7 +269840,7 @@ function extractDefs(ctx, schema) {
|
|
|
269627
269840
|
for (const entry of ctx.seen.entries()) {
|
|
269628
269841
|
const seen = entry[1];
|
|
269629
269842
|
if (seen.cycle) {
|
|
269630
|
-
throw new Error(`Cycle detected: #/${_optionalChain([seen, 'access',
|
|
269843
|
+
throw new Error(`Cycle detected: #/${_optionalChain([seen, 'access', _913 => _913.cycle, 'optionalAccess', _914 => _914.join, 'call', _915 => _915("/")])}/<root>
|
|
269631
269844
|
|
|
269632
269845
|
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`);
|
|
269633
269846
|
}
|
|
@@ -269640,13 +269853,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
269640
269853
|
continue;
|
|
269641
269854
|
}
|
|
269642
269855
|
if (ctx.external) {
|
|
269643
|
-
const ext = _optionalChain([ctx, 'access',
|
|
269856
|
+
const ext = _optionalChain([ctx, 'access', _916 => _916.external, 'access', _917 => _917.registry, 'access', _918 => _918.get, 'call', _919 => _919(entry[0]), 'optionalAccess', _920 => _920.id]);
|
|
269644
269857
|
if (schema !== entry[0] && ext) {
|
|
269645
269858
|
extractToDef(entry);
|
|
269646
269859
|
continue;
|
|
269647
269860
|
}
|
|
269648
269861
|
}
|
|
269649
|
-
const id7 = _optionalChain([ctx, 'access',
|
|
269862
|
+
const id7 = _optionalChain([ctx, 'access', _921 => _921.metadataRegistry, 'access', _922 => _922.get, 'call', _923 => _923(entry[0]), 'optionalAccess', _924 => _924.id]);
|
|
269650
269863
|
if (id7) {
|
|
269651
269864
|
extractToDef(entry);
|
|
269652
269865
|
continue;
|
|
@@ -269710,7 +269923,7 @@ function finalize(ctx, schema) {
|
|
|
269710
269923
|
if (parent && parent !== ref) {
|
|
269711
269924
|
flattenRef(parent);
|
|
269712
269925
|
const parentSeen = ctx.seen.get(parent);
|
|
269713
|
-
if (_optionalChain([parentSeen, 'optionalAccess',
|
|
269926
|
+
if (_optionalChain([parentSeen, 'optionalAccess', _925 => _925.schema, 'access', _926 => _926.$ref])) {
|
|
269714
269927
|
schema2.$ref = parentSeen.schema.$ref;
|
|
269715
269928
|
if (parentSeen.def) {
|
|
269716
269929
|
for (const key in schema2) {
|
|
@@ -269742,14 +269955,14 @@ function finalize(ctx, schema) {
|
|
|
269742
269955
|
} else if (ctx.target === "openapi-3.0") {
|
|
269743
269956
|
} else {
|
|
269744
269957
|
}
|
|
269745
|
-
if (_optionalChain([ctx, 'access',
|
|
269746
|
-
const id7 = _optionalChain([ctx, 'access',
|
|
269958
|
+
if (_optionalChain([ctx, 'access', _927 => _927.external, 'optionalAccess', _928 => _928.uri])) {
|
|
269959
|
+
const id7 = _optionalChain([ctx, 'access', _929 => _929.external, 'access', _930 => _930.registry, 'access', _931 => _931.get, 'call', _932 => _932(schema), 'optionalAccess', _933 => _933.id]);
|
|
269747
269960
|
if (!id7)
|
|
269748
269961
|
throw new Error("Schema is missing an `id` property");
|
|
269749
269962
|
result.$id = ctx.external.uri(id7);
|
|
269750
269963
|
}
|
|
269751
269964
|
Object.assign(result, _nullishCoalesce(root4.def, () => ( root4.schema)));
|
|
269752
|
-
const defs = _nullishCoalesce(_optionalChain([ctx, 'access',
|
|
269965
|
+
const defs = _nullishCoalesce(_optionalChain([ctx, 'access', _934 => _934.external, 'optionalAccess', _935 => _935.defs]), () => ( {}));
|
|
269753
269966
|
for (const entry of ctx.seen.entries()) {
|
|
269754
269967
|
const seen = entry[1];
|
|
269755
269968
|
if (seen.def && seen.defId) {
|
|
@@ -270128,7 +270341,7 @@ var objectProcessor = (schema, ctx, _json, params) => {
|
|
|
270128
270341
|
if (requiredKeys.size > 0) {
|
|
270129
270342
|
json2.required = Array.from(requiredKeys);
|
|
270130
270343
|
}
|
|
270131
|
-
if (_optionalChain([def7, 'access',
|
|
270344
|
+
if (_optionalChain([def7, 'access', _936 => _936.catchall, 'optionalAccess', _937 => _937._zod, 'access', _938 => _938.def, 'access', _939 => _939.type]) === "never") {
|
|
270132
270345
|
json2.additionalProperties = false;
|
|
270133
270346
|
} else if (!def7.catchall) {
|
|
270134
270347
|
if (ctx.io === "output")
|
|
@@ -270218,7 +270431,7 @@ var recordProcessor = (schema, ctx, _json, params) => {
|
|
|
270218
270431
|
json2.type = "object";
|
|
270219
270432
|
const keyType = def7.keyType;
|
|
270220
270433
|
const keyBag = keyType._zod.bag;
|
|
270221
|
-
const patterns = _optionalChain([keyBag, 'optionalAccess',
|
|
270434
|
+
const patterns = _optionalChain([keyBag, 'optionalAccess', _940 => _940.patterns]);
|
|
270222
270435
|
if (def7.mode === "loose" && patterns && patterns.size > 0) {
|
|
270223
270436
|
const valueSchema = process5(def7.valueType, ctx, {
|
|
270224
270437
|
...params,
|
|
@@ -270378,7 +270591,7 @@ function toJSONSchema(input, params) {
|
|
|
270378
270591
|
const schemas = {};
|
|
270379
270592
|
const external = {
|
|
270380
270593
|
registry: registry2,
|
|
270381
|
-
uri: _optionalChain([params, 'optionalAccess',
|
|
270594
|
+
uri: _optionalChain([params, 'optionalAccess', _941 => _941.uri]),
|
|
270382
270595
|
defs
|
|
270383
270596
|
};
|
|
270384
270597
|
ctx2.external = external;
|
|
@@ -270436,7 +270649,7 @@ var JSONSchemaGenerator = class {
|
|
|
270436
270649
|
return this.ctx.seen;
|
|
270437
270650
|
}
|
|
270438
270651
|
constructor(params) {
|
|
270439
|
-
let normalizedTarget = _nullishCoalesce(_optionalChain([params, 'optionalAccess',
|
|
270652
|
+
let normalizedTarget = _nullishCoalesce(_optionalChain([params, 'optionalAccess', _942 => _942.target]), () => ( "draft-2020-12"));
|
|
270440
270653
|
if (normalizedTarget === "draft-4")
|
|
270441
270654
|
normalizedTarget = "draft-04";
|
|
270442
270655
|
if (normalizedTarget === "draft-7")
|
|
@@ -270444,10 +270657,10 @@ var JSONSchemaGenerator = class {
|
|
|
270444
270657
|
this.ctx = initializeContext({
|
|
270445
270658
|
processors: allProcessors,
|
|
270446
270659
|
target: normalizedTarget,
|
|
270447
|
-
..._optionalChain([params, 'optionalAccess',
|
|
270448
|
-
..._optionalChain([params, 'optionalAccess',
|
|
270449
|
-
..._optionalChain([params, 'optionalAccess',
|
|
270450
|
-
..._optionalChain([params, 'optionalAccess',
|
|
270660
|
+
..._optionalChain([params, 'optionalAccess', _943 => _943.metadata]) && { metadata: params.metadata },
|
|
270661
|
+
..._optionalChain([params, 'optionalAccess', _944 => _944.unrepresentable]) && { unrepresentable: params.unrepresentable },
|
|
270662
|
+
..._optionalChain([params, 'optionalAccess', _945 => _945.override]) && { override: params.override },
|
|
270663
|
+
..._optionalChain([params, 'optionalAccess', _946 => _946.io]) && { io: params.io }
|
|
270451
270664
|
});
|
|
270452
270665
|
}
|
|
270453
270666
|
/**
|
|
@@ -270579,7 +270792,7 @@ function getObjectShape(schema) {
|
|
|
270579
270792
|
let rawShape;
|
|
270580
270793
|
if (isZ4Schema(schema)) {
|
|
270581
270794
|
const v4Schema = schema;
|
|
270582
|
-
rawShape = _optionalChain([v4Schema, 'access',
|
|
270795
|
+
rawShape = _optionalChain([v4Schema, 'access', _947 => _947._zod, 'optionalAccess', _948 => _948.def, 'optionalAccess', _949 => _949.shape]);
|
|
270583
270796
|
} else {
|
|
270584
270797
|
const v3Schema = schema;
|
|
270585
270798
|
rawShape = v3Schema.shape;
|
|
@@ -270610,7 +270823,7 @@ function normalizeObjectSchema(schema) {
|
|
|
270610
270823
|
}
|
|
270611
270824
|
if (isZ4Schema(schema)) {
|
|
270612
270825
|
const v4Schema = schema;
|
|
270613
|
-
const def7 = _optionalChain([v4Schema, 'access',
|
|
270826
|
+
const def7 = _optionalChain([v4Schema, 'access', _950 => _950._zod, 'optionalAccess', _951 => _951.def]);
|
|
270614
270827
|
if (def7 && (def7.type === "object" || def7.shape !== void 0)) {
|
|
270615
270828
|
return schema;
|
|
270616
270829
|
}
|
|
@@ -270647,18 +270860,18 @@ function getSchemaDescription(schema) {
|
|
|
270647
270860
|
function isSchemaOptional(schema) {
|
|
270648
270861
|
if (isZ4Schema(schema)) {
|
|
270649
270862
|
const v4Schema = schema;
|
|
270650
|
-
return _optionalChain([v4Schema, 'access',
|
|
270863
|
+
return _optionalChain([v4Schema, 'access', _952 => _952._zod, 'optionalAccess', _953 => _953.def, 'optionalAccess', _954 => _954.type]) === "optional";
|
|
270651
270864
|
}
|
|
270652
270865
|
const v3Schema = schema;
|
|
270653
270866
|
if (typeof schema.isOptional === "function") {
|
|
270654
270867
|
return schema.isOptional();
|
|
270655
270868
|
}
|
|
270656
|
-
return _optionalChain([v3Schema, 'access',
|
|
270869
|
+
return _optionalChain([v3Schema, 'access', _955 => _955._def, 'optionalAccess', _956 => _956.typeName]) === "ZodOptional";
|
|
270657
270870
|
}
|
|
270658
270871
|
function getLiteralValue(schema) {
|
|
270659
270872
|
if (isZ4Schema(schema)) {
|
|
270660
270873
|
const v4Schema = schema;
|
|
270661
|
-
const def8 = _optionalChain([v4Schema, 'access',
|
|
270874
|
+
const def8 = _optionalChain([v4Schema, 'access', _957 => _957._zod, 'optionalAccess', _958 => _958.def]);
|
|
270662
270875
|
if (def8) {
|
|
270663
270876
|
if (def8.value !== void 0)
|
|
270664
270877
|
return def8.value;
|
|
@@ -271305,7 +271518,7 @@ var ZodType2 = /* @__PURE__ */ $constructor("ZodType", (inst, def7) => {
|
|
|
271305
271518
|
};
|
|
271306
271519
|
Object.defineProperty(inst, "description", {
|
|
271307
271520
|
get() {
|
|
271308
|
-
return _optionalChain([globalRegistry, 'access',
|
|
271521
|
+
return _optionalChain([globalRegistry, 'access', _959 => _959.get, 'call', _960 => _960(inst), 'optionalAccess', _961 => _961.description]);
|
|
271309
271522
|
},
|
|
271310
271523
|
configurable: true
|
|
271311
271524
|
});
|
|
@@ -271554,7 +271767,7 @@ function hex5(_params) {
|
|
|
271554
271767
|
return _stringFormat(ZodCustomStringFormat, "hex", regexes_exports.hex, _params);
|
|
271555
271768
|
}
|
|
271556
271769
|
function hash(alg, params) {
|
|
271557
|
-
const enc2 = _nullishCoalesce(_optionalChain([params, 'optionalAccess',
|
|
271770
|
+
const enc2 = _nullishCoalesce(_optionalChain([params, 'optionalAccess', _962 => _962.enc]), () => ( "hex"));
|
|
271558
271771
|
const format2 = `${alg}_${enc2}`;
|
|
271559
271772
|
const regex2 = regexes_exports[format2];
|
|
271560
271773
|
if (!regex2)
|
|
@@ -272252,8 +272465,8 @@ var ZodFunction2 = /* @__PURE__ */ $constructor("ZodFunction", (inst, def7) => {
|
|
|
272252
272465
|
function _function(params) {
|
|
272253
272466
|
return new ZodFunction2({
|
|
272254
272467
|
type: "function",
|
|
272255
|
-
input: Array.isArray(_optionalChain([params, 'optionalAccess',
|
|
272256
|
-
output: _nullishCoalesce(_optionalChain([params, 'optionalAccess',
|
|
272468
|
+
input: Array.isArray(_optionalChain([params, 'optionalAccess', _963 => _963.input])) ? tuple(_optionalChain([params, 'optionalAccess', _964 => _964.input])) : _nullishCoalesce(_optionalChain([params, 'optionalAccess', _965 => _965.input]), () => ( array(unknown()))),
|
|
272469
|
+
output: _nullishCoalesce(_optionalChain([params, 'optionalAccess', _966 => _966.output]), () => ( unknown()))
|
|
272257
272470
|
});
|
|
272258
272471
|
}
|
|
272259
272472
|
var ZodCustom = /* @__PURE__ */ $constructor("ZodCustom", (inst, def7) => {
|
|
@@ -272806,7 +273019,7 @@ function fromJSONSchema(schema, params) {
|
|
|
272806
273019
|
if (typeof schema === "boolean") {
|
|
272807
273020
|
return schema ? z.any() : z.never();
|
|
272808
273021
|
}
|
|
272809
|
-
const version4 = detectVersion(schema, _optionalChain([params, 'optionalAccess',
|
|
273022
|
+
const version4 = detectVersion(schema, _optionalChain([params, 'optionalAccess', _967 => _967.defaultTarget]));
|
|
272810
273023
|
const defs = schema.$defs || schema.definitions || {};
|
|
272811
273024
|
const ctx = {
|
|
272812
273025
|
version: version4,
|
|
@@ -272814,7 +273027,7 @@ function fromJSONSchema(schema, params) {
|
|
|
272814
273027
|
refs: /* @__PURE__ */ new Map(),
|
|
272815
273028
|
processing: /* @__PURE__ */ new Set(),
|
|
272816
273029
|
rootSchema: schema,
|
|
272817
|
-
registry: _nullishCoalesce(_optionalChain([params, 'optionalAccess',
|
|
273030
|
+
registry: _nullishCoalesce(_optionalChain([params, 'optionalAccess', _968 => _968.registry]), () => ( globalRegistry))
|
|
272818
273031
|
};
|
|
272819
273032
|
return convertSchema(schema, ctx);
|
|
272820
273033
|
}
|
|
@@ -274377,7 +274590,7 @@ var UrlElicitationRequiredError = class extends McpError {
|
|
|
274377
274590
|
});
|
|
274378
274591
|
}
|
|
274379
274592
|
get elicitations() {
|
|
274380
|
-
return _nullishCoalesce(_optionalChain([this, 'access',
|
|
274593
|
+
return _nullishCoalesce(_optionalChain([this, 'access', _969 => _969.data, 'optionalAccess', _970 => _970.elicitations]), () => ( []));
|
|
274381
274594
|
}
|
|
274382
274595
|
};
|
|
274383
274596
|
|
|
@@ -274453,7 +274666,7 @@ var getRefs = (options) => {
|
|
|
274453
274666
|
// node_modules/zod-to-json-schema/dist/esm/errorMessages.js
|
|
274454
274667
|
_chunkDLBJL7R2cjs.init_cjs_shims.call(void 0, );
|
|
274455
274668
|
function addErrorMessage(res, key, errorMessage, refs) {
|
|
274456
|
-
if (!_optionalChain([refs, 'optionalAccess',
|
|
274669
|
+
if (!_optionalChain([refs, 'optionalAccess', _971 => _971.errorMessages]))
|
|
274457
274670
|
return;
|
|
274458
274671
|
if (errorMessage) {
|
|
274459
274672
|
res.errorMessage = {
|
|
@@ -274507,7 +274720,7 @@ function parseArrayDef(def7, refs) {
|
|
|
274507
274720
|
const res = {
|
|
274508
274721
|
type: "array"
|
|
274509
274722
|
};
|
|
274510
|
-
if (_optionalChain([def7, 'access',
|
|
274723
|
+
if (_optionalChain([def7, 'access', _972 => _972.type, 'optionalAccess', _973 => _973._def]) && _optionalChain([def7, 'access', _974 => _974.type, 'optionalAccess', _975 => _975._def, 'optionalAccess', _976 => _976.typeName]) !== ZodFirstPartyTypeKind.ZodAny) {
|
|
274511
274724
|
res.items = parseDef(def7.type._def, {
|
|
274512
274725
|
...refs,
|
|
274513
274726
|
currentPath: [...refs.currentPath, "items"]
|
|
@@ -274942,7 +275155,7 @@ function escapeNonAlphaNumeric(source) {
|
|
|
274942
275155
|
return result;
|
|
274943
275156
|
}
|
|
274944
275157
|
function addFormat(schema, value, message, refs) {
|
|
274945
|
-
if (schema.format || _optionalChain([schema, 'access',
|
|
275158
|
+
if (schema.format || _optionalChain([schema, 'access', _977 => _977.anyOf, 'optionalAccess', _978 => _978.some, 'call', _979 => _979((x) => x.format)])) {
|
|
274946
275159
|
if (!schema.anyOf) {
|
|
274947
275160
|
schema.anyOf = [];
|
|
274948
275161
|
}
|
|
@@ -274970,7 +275183,7 @@ function addFormat(schema, value, message, refs) {
|
|
|
274970
275183
|
}
|
|
274971
275184
|
}
|
|
274972
275185
|
function addPattern(schema, regex2, message, refs) {
|
|
274973
|
-
if (schema.pattern || _optionalChain([schema, 'access',
|
|
275186
|
+
if (schema.pattern || _optionalChain([schema, 'access', _980 => _980.allOf, 'optionalAccess', _981 => _981.some, 'call', _982 => _982((x) => x.pattern)])) {
|
|
274974
275187
|
if (!schema.allOf) {
|
|
274975
275188
|
schema.allOf = [];
|
|
274976
275189
|
}
|
|
@@ -275025,7 +275238,7 @@ function stringifyRegExpWithFlags(regex2, refs) {
|
|
|
275025
275238
|
pattern += source[i2];
|
|
275026
275239
|
pattern += `${source[i2 - 2]}-${source[i2]}`.toUpperCase();
|
|
275027
275240
|
inCharRange = false;
|
|
275028
|
-
} else if (source[i2 + 1] === "-" && _optionalChain([source, 'access',
|
|
275241
|
+
} else if (source[i2 + 1] === "-" && _optionalChain([source, 'access', _983 => _983[i2 + 2], 'optionalAccess', _984 => _984.match, 'call', _985 => _985(/[a-z]/)])) {
|
|
275029
275242
|
pattern += source[i2];
|
|
275030
275243
|
inCharRange = true;
|
|
275031
275244
|
} else {
|
|
@@ -275078,7 +275291,7 @@ function parseRecordDef(def7, refs) {
|
|
|
275078
275291
|
if (refs.target === "openAi") {
|
|
275079
275292
|
console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead.");
|
|
275080
275293
|
}
|
|
275081
|
-
if (refs.target === "openApi3" && _optionalChain([def7, 'access',
|
|
275294
|
+
if (refs.target === "openApi3" && _optionalChain([def7, 'access', _986 => _986.keyType, 'optionalAccess', _987 => _987._def, 'access', _988 => _988.typeName]) === ZodFirstPartyTypeKind.ZodEnum) {
|
|
275082
275295
|
return {
|
|
275083
275296
|
type: "object",
|
|
275084
275297
|
required: def7.keyType._def.values,
|
|
@@ -275102,20 +275315,20 @@ function parseRecordDef(def7, refs) {
|
|
|
275102
275315
|
if (refs.target === "openApi3") {
|
|
275103
275316
|
return schema;
|
|
275104
275317
|
}
|
|
275105
|
-
if (_optionalChain([def7, 'access',
|
|
275318
|
+
if (_optionalChain([def7, 'access', _989 => _989.keyType, 'optionalAccess', _990 => _990._def, 'access', _991 => _991.typeName]) === ZodFirstPartyTypeKind.ZodString && _optionalChain([def7, 'access', _992 => _992.keyType, 'access', _993 => _993._def, 'access', _994 => _994.checks, 'optionalAccess', _995 => _995.length])) {
|
|
275106
275319
|
const { type, ...keyType } = parseStringDef(def7.keyType._def, refs);
|
|
275107
275320
|
return {
|
|
275108
275321
|
...schema,
|
|
275109
275322
|
propertyNames: keyType
|
|
275110
275323
|
};
|
|
275111
|
-
} else if (_optionalChain([def7, 'access',
|
|
275324
|
+
} else if (_optionalChain([def7, 'access', _996 => _996.keyType, 'optionalAccess', _997 => _997._def, 'access', _998 => _998.typeName]) === ZodFirstPartyTypeKind.ZodEnum) {
|
|
275112
275325
|
return {
|
|
275113
275326
|
...schema,
|
|
275114
275327
|
propertyNames: {
|
|
275115
275328
|
enum: def7.keyType._def.values
|
|
275116
275329
|
}
|
|
275117
275330
|
};
|
|
275118
|
-
} else if (_optionalChain([def7, 'access',
|
|
275331
|
+
} else if (_optionalChain([def7, 'access', _999 => _999.keyType, 'optionalAccess', _1000 => _1000._def, 'access', _1001 => _1001.typeName]) === ZodFirstPartyTypeKind.ZodBranded && def7.keyType._def.type._def.typeName === ZodFirstPartyTypeKind.ZodString && _optionalChain([def7, 'access', _1002 => _1002.keyType, 'access', _1003 => _1003._def, 'access', _1004 => _1004.type, 'access', _1005 => _1005._def, 'access', _1006 => _1006.checks, 'optionalAccess', _1007 => _1007.length])) {
|
|
275119
275332
|
const { type, ...keyType } = parseBrandedDef(def7.keyType._def, refs);
|
|
275120
275333
|
return {
|
|
275121
275334
|
...schema,
|
|
@@ -275415,7 +275628,7 @@ function safeIsOptional(schema) {
|
|
|
275415
275628
|
// node_modules/zod-to-json-schema/dist/esm/parsers/optional.js
|
|
275416
275629
|
_chunkDLBJL7R2cjs.init_cjs_shims.call(void 0, );
|
|
275417
275630
|
var parseOptionalDef = (def7, refs) => {
|
|
275418
|
-
if (refs.currentPath.toString() === _optionalChain([refs, 'access',
|
|
275631
|
+
if (refs.currentPath.toString() === _optionalChain([refs, 'access', _1008 => _1008.propertyPath, 'optionalAccess', _1009 => _1009.toString, 'call', _1010 => _1010()])) {
|
|
275419
275632
|
return parseDef(def7.innerType._def, refs);
|
|
275420
275633
|
}
|
|
275421
275634
|
const innerSchema = parseDef(def7.innerType._def, {
|
|
@@ -275609,7 +275822,7 @@ var selectParser = (def7, typeName, refs) => {
|
|
|
275609
275822
|
function parseDef(def7, refs, forceResolution = false) {
|
|
275610
275823
|
const seenItem = refs.seen.get(def7);
|
|
275611
275824
|
if (refs.override) {
|
|
275612
|
-
const overrideResult = _optionalChain([refs, 'access',
|
|
275825
|
+
const overrideResult = _optionalChain([refs, 'access', _1011 => _1011.override, 'optionalCall', _1012 => _1012(def7, refs, seenItem, forceResolution)]);
|
|
275613
275826
|
if (overrideResult !== ignoreOverride) {
|
|
275614
275827
|
return overrideResult;
|
|
275615
275828
|
}
|
|
@@ -275675,7 +275888,7 @@ var zodToJsonSchema = (schema, options) => {
|
|
|
275675
275888
|
currentPath: [...refs.basePath, refs.definitionPath, name2]
|
|
275676
275889
|
}, true), () => ( parseAnyDef(refs)))
|
|
275677
275890
|
}), {}) : void 0;
|
|
275678
|
-
const name = typeof options === "string" ? options : _optionalChain([options, 'optionalAccess',
|
|
275891
|
+
const name = typeof options === "string" ? options : _optionalChain([options, 'optionalAccess', _1013 => _1013.nameStrategy]) === "title" ? void 0 : _optionalChain([options, 'optionalAccess', _1014 => _1014.name]);
|
|
275679
275892
|
const main = _nullishCoalesce(parseDef(schema._def, name === void 0 ? refs : {
|
|
275680
275893
|
...refs,
|
|
275681
275894
|
currentPath: [...refs.basePath, refs.definitionPath, name]
|
|
@@ -275740,18 +275953,18 @@ function mapMiniTarget(t) {
|
|
|
275740
275953
|
function toJsonSchemaCompat(schema, opts) {
|
|
275741
275954
|
if (isZ4Schema(schema)) {
|
|
275742
275955
|
return toJSONSchema(schema, {
|
|
275743
|
-
target: mapMiniTarget(_optionalChain([opts, 'optionalAccess',
|
|
275744
|
-
io: _nullishCoalesce(_optionalChain([opts, 'optionalAccess',
|
|
275956
|
+
target: mapMiniTarget(_optionalChain([opts, 'optionalAccess', _1015 => _1015.target])),
|
|
275957
|
+
io: _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _1016 => _1016.pipeStrategy]), () => ( "input"))
|
|
275745
275958
|
});
|
|
275746
275959
|
}
|
|
275747
275960
|
return zodToJsonSchema(schema, {
|
|
275748
|
-
strictUnions: _nullishCoalesce(_optionalChain([opts, 'optionalAccess',
|
|
275749
|
-
pipeStrategy: _nullishCoalesce(_optionalChain([opts, 'optionalAccess',
|
|
275961
|
+
strictUnions: _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _1017 => _1017.strictUnions]), () => ( true)),
|
|
275962
|
+
pipeStrategy: _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _1018 => _1018.pipeStrategy]), () => ( "input"))
|
|
275750
275963
|
});
|
|
275751
275964
|
}
|
|
275752
275965
|
function getMethodLiteral(schema) {
|
|
275753
275966
|
const shape = getObjectShape(schema);
|
|
275754
|
-
const methodSchema = _optionalChain([shape, 'optionalAccess',
|
|
275967
|
+
const methodSchema = _optionalChain([shape, 'optionalAccess', _1019 => _1019.method]);
|
|
275755
275968
|
if (!methodSchema) {
|
|
275756
275969
|
throw new Error("Schema is missing a method literal");
|
|
275757
275970
|
}
|
|
@@ -275795,8 +276008,8 @@ var Protocol = class {
|
|
|
275795
276008
|
// Automatic pong by default.
|
|
275796
276009
|
(_request) => ({})
|
|
275797
276010
|
);
|
|
275798
|
-
this._taskStore = _optionalChain([_options, 'optionalAccess',
|
|
275799
|
-
this._taskMessageQueue = _optionalChain([_options, 'optionalAccess',
|
|
276011
|
+
this._taskStore = _optionalChain([_options, 'optionalAccess', _1020 => _1020.taskStore]);
|
|
276012
|
+
this._taskMessageQueue = _optionalChain([_options, 'optionalAccess', _1021 => _1021.taskMessageQueue]);
|
|
275800
276013
|
if (this._taskStore) {
|
|
275801
276014
|
this.setRequestHandler(GetTaskRequestSchema, async (request, extra) => {
|
|
275802
276015
|
const task5 = await this._taskStore.getTask(request.params.taskId, extra.sessionId);
|
|
@@ -275832,7 +276045,7 @@ var Protocol = class {
|
|
|
275832
276045
|
}
|
|
275833
276046
|
continue;
|
|
275834
276047
|
}
|
|
275835
|
-
await _optionalChain([this, 'access',
|
|
276048
|
+
await _optionalChain([this, 'access', _1022 => _1022._transport, 'optionalAccess', _1023 => _1023.send, 'call', _1024 => _1024(queuedMessage.message, { relatedRequestId: extra.requestId })]);
|
|
275836
276049
|
}
|
|
275837
276050
|
}
|
|
275838
276051
|
const task5 = await this._taskStore.getTask(taskId, extra.sessionId);
|
|
@@ -275862,7 +276075,7 @@ var Protocol = class {
|
|
|
275862
276075
|
});
|
|
275863
276076
|
this.setRequestHandler(ListTasksRequestSchema, async (request, extra) => {
|
|
275864
276077
|
try {
|
|
275865
|
-
const { tasks, nextCursor } = await this._taskStore.listTasks(_optionalChain([request, 'access',
|
|
276078
|
+
const { tasks, nextCursor } = await this._taskStore.listTasks(_optionalChain([request, 'access', _1025 => _1025.params, 'optionalAccess', _1026 => _1026.cursor]), extra.sessionId);
|
|
275866
276079
|
return {
|
|
275867
276080
|
tasks,
|
|
275868
276081
|
nextCursor,
|
|
@@ -275905,7 +276118,7 @@ var Protocol = class {
|
|
|
275905
276118
|
return;
|
|
275906
276119
|
}
|
|
275907
276120
|
const controller = this._requestHandlerAbortControllers.get(notification.params.requestId);
|
|
275908
|
-
_optionalChain([controller, 'optionalAccess',
|
|
276121
|
+
_optionalChain([controller, 'optionalAccess', _1027 => _1027.abort, 'call', _1028 => _1028(notification.params.reason)]);
|
|
275909
276122
|
}
|
|
275910
276123
|
_setupTimeout(messageId, timeout4, maxTotalTimeout, onTimeout, resetTimeoutOnProgress = false) {
|
|
275911
276124
|
this._timeoutInfo.set(messageId, {
|
|
@@ -275950,19 +276163,19 @@ var Protocol = class {
|
|
|
275950
276163
|
throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");
|
|
275951
276164
|
}
|
|
275952
276165
|
this._transport = transport;
|
|
275953
|
-
const _onclose = _optionalChain([this, 'access',
|
|
276166
|
+
const _onclose = _optionalChain([this, 'access', _1029 => _1029.transport, 'optionalAccess', _1030 => _1030.onclose]);
|
|
275954
276167
|
this._transport.onclose = () => {
|
|
275955
|
-
_optionalChain([_onclose, 'optionalCall',
|
|
276168
|
+
_optionalChain([_onclose, 'optionalCall', _1031 => _1031()]);
|
|
275956
276169
|
this._onclose();
|
|
275957
276170
|
};
|
|
275958
|
-
const _onerror = _optionalChain([this, 'access',
|
|
276171
|
+
const _onerror = _optionalChain([this, 'access', _1032 => _1032.transport, 'optionalAccess', _1033 => _1033.onerror]);
|
|
275959
276172
|
this._transport.onerror = (error49) => {
|
|
275960
|
-
_optionalChain([_onerror, 'optionalCall',
|
|
276173
|
+
_optionalChain([_onerror, 'optionalCall', _1034 => _1034(error49)]);
|
|
275961
276174
|
this._onerror(error49);
|
|
275962
276175
|
};
|
|
275963
|
-
const _onmessage = _optionalChain([this, 'access',
|
|
276176
|
+
const _onmessage = _optionalChain([this, 'access', _1035 => _1035._transport, 'optionalAccess', _1036 => _1036.onmessage]);
|
|
275964
276177
|
this._transport.onmessage = (message, extra) => {
|
|
275965
|
-
_optionalChain([_onmessage, 'optionalCall',
|
|
276178
|
+
_optionalChain([_onmessage, 'optionalCall', _1037 => _1037(message, extra)]);
|
|
275966
276179
|
if (isJSONRPCResultResponse(message) || isJSONRPCErrorResponse(message)) {
|
|
275967
276180
|
this._onresponse(message);
|
|
275968
276181
|
} else if (isJSONRPCRequest(message)) {
|
|
@@ -275991,13 +276204,13 @@ var Protocol = class {
|
|
|
275991
276204
|
this._requestHandlerAbortControllers.clear();
|
|
275992
276205
|
const error49 = McpError.fromError(ErrorCode.ConnectionClosed, "Connection closed");
|
|
275993
276206
|
this._transport = void 0;
|
|
275994
|
-
_optionalChain([this, 'access',
|
|
276207
|
+
_optionalChain([this, 'access', _1038 => _1038.onclose, 'optionalCall', _1039 => _1039()]);
|
|
275995
276208
|
for (const handler of responseHandlers.values()) {
|
|
275996
276209
|
handler(error49);
|
|
275997
276210
|
}
|
|
275998
276211
|
}
|
|
275999
276212
|
_onerror(error49) {
|
|
276000
|
-
_optionalChain([this, 'access',
|
|
276213
|
+
_optionalChain([this, 'access', _1040 => _1040.onerror, 'optionalCall', _1041 => _1041(error49)]);
|
|
276001
276214
|
}
|
|
276002
276215
|
_onnotification(notification) {
|
|
276003
276216
|
const handler = _nullishCoalesce(this._notificationHandlers.get(notification.method), () => ( this.fallbackNotificationHandler));
|
|
@@ -276009,7 +276222,7 @@ var Protocol = class {
|
|
|
276009
276222
|
_onrequest(request, extra) {
|
|
276010
276223
|
const handler = _nullishCoalesce(this._requestHandlers.get(request.method), () => ( this.fallbackRequestHandler));
|
|
276011
276224
|
const capturedTransport = this._transport;
|
|
276012
|
-
const relatedTaskId = _optionalChain([request, 'access',
|
|
276225
|
+
const relatedTaskId = _optionalChain([request, 'access', _1042 => _1042.params, 'optionalAccess', _1043 => _1043._meta, 'optionalAccess', _1044 => _1044[RELATED_TASK_META_KEY], 'optionalAccess', _1045 => _1045.taskId]);
|
|
276013
276226
|
if (handler === void 0) {
|
|
276014
276227
|
const errorResponse = {
|
|
276015
276228
|
jsonrpc: "2.0",
|
|
@@ -276024,20 +276237,20 @@ var Protocol = class {
|
|
|
276024
276237
|
type: "error",
|
|
276025
276238
|
message: errorResponse,
|
|
276026
276239
|
timestamp: Date.now()
|
|
276027
|
-
}, _optionalChain([capturedTransport, 'optionalAccess',
|
|
276240
|
+
}, _optionalChain([capturedTransport, 'optionalAccess', _1046 => _1046.sessionId])).catch((error49) => this._onerror(new Error(`Failed to enqueue error response: ${error49}`)));
|
|
276028
276241
|
} else {
|
|
276029
|
-
_optionalChain([capturedTransport, 'optionalAccess',
|
|
276242
|
+
_optionalChain([capturedTransport, 'optionalAccess', _1047 => _1047.send, 'call', _1048 => _1048(errorResponse), 'access', _1049 => _1049.catch, 'call', _1050 => _1050((error49) => this._onerror(new Error(`Failed to send an error response: ${error49}`)))]);
|
|
276030
276243
|
}
|
|
276031
276244
|
return;
|
|
276032
276245
|
}
|
|
276033
276246
|
const abortController = new AbortController();
|
|
276034
276247
|
this._requestHandlerAbortControllers.set(request.id, abortController);
|
|
276035
276248
|
const taskCreationParams = isTaskAugmentedRequestParams(request.params) ? request.params.task : void 0;
|
|
276036
|
-
const taskStore = this._taskStore ? this.requestTaskStore(request, _optionalChain([capturedTransport, 'optionalAccess',
|
|
276249
|
+
const taskStore = this._taskStore ? this.requestTaskStore(request, _optionalChain([capturedTransport, 'optionalAccess', _1051 => _1051.sessionId])) : void 0;
|
|
276037
276250
|
const fullExtra = {
|
|
276038
276251
|
signal: abortController.signal,
|
|
276039
|
-
sessionId: _optionalChain([capturedTransport, 'optionalAccess',
|
|
276040
|
-
_meta: _optionalChain([request, 'access',
|
|
276252
|
+
sessionId: _optionalChain([capturedTransport, 'optionalAccess', _1052 => _1052.sessionId]),
|
|
276253
|
+
_meta: _optionalChain([request, 'access', _1053 => _1053.params, 'optionalAccess', _1054 => _1054._meta]),
|
|
276041
276254
|
sendNotification: async (notification) => {
|
|
276042
276255
|
if (abortController.signal.aborted)
|
|
276043
276256
|
return;
|
|
@@ -276055,20 +276268,20 @@ var Protocol = class {
|
|
|
276055
276268
|
if (relatedTaskId && !requestOptions.relatedTask) {
|
|
276056
276269
|
requestOptions.relatedTask = { taskId: relatedTaskId };
|
|
276057
276270
|
}
|
|
276058
|
-
const effectiveTaskId = _nullishCoalesce(_optionalChain([requestOptions, 'access',
|
|
276271
|
+
const effectiveTaskId = _nullishCoalesce(_optionalChain([requestOptions, 'access', _1055 => _1055.relatedTask, 'optionalAccess', _1056 => _1056.taskId]), () => ( relatedTaskId));
|
|
276059
276272
|
if (effectiveTaskId && taskStore) {
|
|
276060
276273
|
await taskStore.updateTaskStatus(effectiveTaskId, "input_required");
|
|
276061
276274
|
}
|
|
276062
276275
|
return await this.request(r, resultSchema, requestOptions);
|
|
276063
276276
|
},
|
|
276064
|
-
authInfo: _optionalChain([extra, 'optionalAccess',
|
|
276277
|
+
authInfo: _optionalChain([extra, 'optionalAccess', _1057 => _1057.authInfo]),
|
|
276065
276278
|
requestId: request.id,
|
|
276066
|
-
requestInfo: _optionalChain([extra, 'optionalAccess',
|
|
276279
|
+
requestInfo: _optionalChain([extra, 'optionalAccess', _1058 => _1058.requestInfo]),
|
|
276067
276280
|
taskId: relatedTaskId,
|
|
276068
276281
|
taskStore,
|
|
276069
|
-
taskRequestedTtl: _optionalChain([taskCreationParams, 'optionalAccess',
|
|
276070
|
-
closeSSEStream: _optionalChain([extra, 'optionalAccess',
|
|
276071
|
-
closeStandaloneSSEStream: _optionalChain([extra, 'optionalAccess',
|
|
276282
|
+
taskRequestedTtl: _optionalChain([taskCreationParams, 'optionalAccess', _1059 => _1059.ttl]),
|
|
276283
|
+
closeSSEStream: _optionalChain([extra, 'optionalAccess', _1060 => _1060.closeSSEStream]),
|
|
276284
|
+
closeStandaloneSSEStream: _optionalChain([extra, 'optionalAccess', _1061 => _1061.closeStandaloneSSEStream])
|
|
276072
276285
|
};
|
|
276073
276286
|
Promise.resolve().then(() => {
|
|
276074
276287
|
if (taskCreationParams) {
|
|
@@ -276088,9 +276301,9 @@ var Protocol = class {
|
|
|
276088
276301
|
type: "response",
|
|
276089
276302
|
message: response,
|
|
276090
276303
|
timestamp: Date.now()
|
|
276091
|
-
}, _optionalChain([capturedTransport, 'optionalAccess',
|
|
276304
|
+
}, _optionalChain([capturedTransport, 'optionalAccess', _1062 => _1062.sessionId]));
|
|
276092
276305
|
} else {
|
|
276093
|
-
await _optionalChain([capturedTransport, 'optionalAccess',
|
|
276306
|
+
await _optionalChain([capturedTransport, 'optionalAccess', _1063 => _1063.send, 'call', _1064 => _1064(response)]);
|
|
276094
276307
|
}
|
|
276095
276308
|
}, async (error49) => {
|
|
276096
276309
|
if (abortController.signal.aborted) {
|
|
@@ -276110,9 +276323,9 @@ var Protocol = class {
|
|
|
276110
276323
|
type: "error",
|
|
276111
276324
|
message: errorResponse,
|
|
276112
276325
|
timestamp: Date.now()
|
|
276113
|
-
}, _optionalChain([capturedTransport, 'optionalAccess',
|
|
276326
|
+
}, _optionalChain([capturedTransport, 'optionalAccess', _1065 => _1065.sessionId]));
|
|
276114
276327
|
} else {
|
|
276115
|
-
await _optionalChain([capturedTransport, 'optionalAccess',
|
|
276328
|
+
await _optionalChain([capturedTransport, 'optionalAccess', _1066 => _1066.send, 'call', _1067 => _1067(errorResponse)]);
|
|
276116
276329
|
}
|
|
276117
276330
|
}).catch((error49) => this._onerror(new Error(`Failed to send response: ${error49}`))).finally(() => {
|
|
276118
276331
|
if (this._requestHandlerAbortControllers.get(request.id) === abortController) {
|
|
@@ -276191,7 +276404,7 @@ var Protocol = class {
|
|
|
276191
276404
|
* Closes the connection.
|
|
276192
276405
|
*/
|
|
276193
276406
|
async close() {
|
|
276194
|
-
await _optionalChain([this, 'access',
|
|
276407
|
+
await _optionalChain([this, 'access', _1068 => _1068._transport, 'optionalAccess', _1069 => _1069.close, 'call', _1070 => _1070()]);
|
|
276195
276408
|
}
|
|
276196
276409
|
/**
|
|
276197
276410
|
* Sends a request and returns an AsyncGenerator that yields response messages.
|
|
@@ -276268,9 +276481,9 @@ var Protocol = class {
|
|
|
276268
276481
|
yield { type: "result", result };
|
|
276269
276482
|
return;
|
|
276270
276483
|
}
|
|
276271
|
-
const pollInterval = _nullishCoalesce(_nullishCoalesce(task6.pollInterval, () => ( _optionalChain([this, 'access',
|
|
276484
|
+
const pollInterval = _nullishCoalesce(_nullishCoalesce(task6.pollInterval, () => ( _optionalChain([this, 'access', _1071 => _1071._options, 'optionalAccess', _1072 => _1072.defaultTaskPollInterval]))), () => ( 1e3));
|
|
276272
276485
|
await new Promise((resolve7) => setTimeout(resolve7, pollInterval));
|
|
276273
|
-
_optionalChain([options, 'optionalAccess',
|
|
276486
|
+
_optionalChain([options, 'optionalAccess', _1073 => _1073.signal, 'optionalAccess', _1074 => _1074.throwIfAborted, 'call', _1075 => _1075()]);
|
|
276274
276487
|
}
|
|
276275
276488
|
} catch (error49) {
|
|
276276
276489
|
yield {
|
|
@@ -276294,7 +276507,7 @@ var Protocol = class {
|
|
|
276294
276507
|
earlyReject(new Error("Not connected"));
|
|
276295
276508
|
return;
|
|
276296
276509
|
}
|
|
276297
|
-
if (_optionalChain([this, 'access',
|
|
276510
|
+
if (_optionalChain([this, 'access', _1076 => _1076._options, 'optionalAccess', _1077 => _1077.enforceStrictCapabilities]) === true) {
|
|
276298
276511
|
try {
|
|
276299
276512
|
this.assertCapabilityForMethod(request.method);
|
|
276300
276513
|
if (task5) {
|
|
@@ -276305,19 +276518,19 @@ var Protocol = class {
|
|
|
276305
276518
|
return;
|
|
276306
276519
|
}
|
|
276307
276520
|
}
|
|
276308
|
-
_optionalChain([options, 'optionalAccess',
|
|
276521
|
+
_optionalChain([options, 'optionalAccess', _1078 => _1078.signal, 'optionalAccess', _1079 => _1079.throwIfAborted, 'call', _1080 => _1080()]);
|
|
276309
276522
|
const messageId = this._requestMessageId++;
|
|
276310
276523
|
const jsonrpcRequest = {
|
|
276311
276524
|
...request,
|
|
276312
276525
|
jsonrpc: "2.0",
|
|
276313
276526
|
id: messageId
|
|
276314
276527
|
};
|
|
276315
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
276528
|
+
if (_optionalChain([options, 'optionalAccess', _1081 => _1081.onprogress])) {
|
|
276316
276529
|
this._progressHandlers.set(messageId, options.onprogress);
|
|
276317
276530
|
jsonrpcRequest.params = {
|
|
276318
276531
|
...request.params,
|
|
276319
276532
|
_meta: {
|
|
276320
|
-
..._optionalChain([request, 'access',
|
|
276533
|
+
..._optionalChain([request, 'access', _1082 => _1082.params, 'optionalAccess', _1083 => _1083._meta]) || {},
|
|
276321
276534
|
progressToken: messageId
|
|
276322
276535
|
}
|
|
276323
276536
|
};
|
|
@@ -276332,7 +276545,7 @@ var Protocol = class {
|
|
|
276332
276545
|
jsonrpcRequest.params = {
|
|
276333
276546
|
...jsonrpcRequest.params,
|
|
276334
276547
|
_meta: {
|
|
276335
|
-
..._optionalChain([jsonrpcRequest, 'access',
|
|
276548
|
+
..._optionalChain([jsonrpcRequest, 'access', _1084 => _1084.params, 'optionalAccess', _1085 => _1085._meta]) || {},
|
|
276336
276549
|
[RELATED_TASK_META_KEY]: relatedTask
|
|
276337
276550
|
}
|
|
276338
276551
|
};
|
|
@@ -276341,19 +276554,19 @@ var Protocol = class {
|
|
|
276341
276554
|
this._responseHandlers.delete(messageId);
|
|
276342
276555
|
this._progressHandlers.delete(messageId);
|
|
276343
276556
|
this._cleanupTimeout(messageId);
|
|
276344
|
-
_optionalChain([this, 'access',
|
|
276557
|
+
_optionalChain([this, 'access', _1086 => _1086._transport, 'optionalAccess', _1087 => _1087.send, 'call', _1088 => _1088({
|
|
276345
276558
|
jsonrpc: "2.0",
|
|
276346
276559
|
method: "notifications/cancelled",
|
|
276347
276560
|
params: {
|
|
276348
276561
|
requestId: messageId,
|
|
276349
276562
|
reason: String(reason)
|
|
276350
276563
|
}
|
|
276351
|
-
}, { relatedRequestId, resumptionToken, onresumptiontoken }), 'access',
|
|
276564
|
+
}, { relatedRequestId, resumptionToken, onresumptiontoken }), 'access', _1089 => _1089.catch, 'call', _1090 => _1090((error50) => this._onerror(new Error(`Failed to send cancellation: ${error50}`)))]);
|
|
276352
276565
|
const error49 = reason instanceof McpError ? reason : new McpError(ErrorCode.RequestTimeout, String(reason));
|
|
276353
276566
|
reject5(error49);
|
|
276354
276567
|
};
|
|
276355
276568
|
this._responseHandlers.set(messageId, (response) => {
|
|
276356
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
276569
|
+
if (_optionalChain([options, 'optionalAccess', _1091 => _1091.signal, 'optionalAccess', _1092 => _1092.aborted])) {
|
|
276357
276570
|
return;
|
|
276358
276571
|
}
|
|
276359
276572
|
if (response instanceof Error) {
|
|
@@ -276370,13 +276583,13 @@ var Protocol = class {
|
|
|
276370
276583
|
reject5(error49);
|
|
276371
276584
|
}
|
|
276372
276585
|
});
|
|
276373
|
-
_optionalChain([options, 'optionalAccess',
|
|
276374
|
-
cancel(_optionalChain([options, 'optionalAccess',
|
|
276586
|
+
_optionalChain([options, 'optionalAccess', _1093 => _1093.signal, 'optionalAccess', _1094 => _1094.addEventListener, 'call', _1095 => _1095("abort", () => {
|
|
276587
|
+
cancel(_optionalChain([options, 'optionalAccess', _1096 => _1096.signal, 'optionalAccess', _1097 => _1097.reason]));
|
|
276375
276588
|
})]);
|
|
276376
|
-
const timeout4 = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
276589
|
+
const timeout4 = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _1098 => _1098.timeout]), () => ( DEFAULT_REQUEST_TIMEOUT_MSEC));
|
|
276377
276590
|
const timeoutHandler = () => cancel(McpError.fromError(ErrorCode.RequestTimeout, "Request timed out", { timeout: timeout4 }));
|
|
276378
|
-
this._setupTimeout(messageId, timeout4, _optionalChain([options, 'optionalAccess',
|
|
276379
|
-
const relatedTaskId = _optionalChain([relatedTask, 'optionalAccess',
|
|
276591
|
+
this._setupTimeout(messageId, timeout4, _optionalChain([options, 'optionalAccess', _1099 => _1099.maxTotalTimeout]), timeoutHandler, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _1100 => _1100.resetTimeoutOnProgress]), () => ( false)));
|
|
276592
|
+
const relatedTaskId = _optionalChain([relatedTask, 'optionalAccess', _1101 => _1101.taskId]);
|
|
276380
276593
|
if (relatedTaskId) {
|
|
276381
276594
|
const responseResolver = (response) => {
|
|
276382
276595
|
const handler = this._responseHandlers.get(messageId);
|
|
@@ -276443,7 +276656,7 @@ var Protocol = class {
|
|
|
276443
276656
|
throw new Error("Not connected");
|
|
276444
276657
|
}
|
|
276445
276658
|
this.assertNotificationCapability(notification.method);
|
|
276446
|
-
const relatedTaskId = _optionalChain([options, 'optionalAccess',
|
|
276659
|
+
const relatedTaskId = _optionalChain([options, 'optionalAccess', _1102 => _1102.relatedTask, 'optionalAccess', _1103 => _1103.taskId]);
|
|
276447
276660
|
if (relatedTaskId) {
|
|
276448
276661
|
const jsonrpcNotification2 = {
|
|
276449
276662
|
...notification,
|
|
@@ -276451,7 +276664,7 @@ var Protocol = class {
|
|
|
276451
276664
|
params: {
|
|
276452
276665
|
...notification.params,
|
|
276453
276666
|
_meta: {
|
|
276454
|
-
..._optionalChain([notification, 'access',
|
|
276667
|
+
..._optionalChain([notification, 'access', _1104 => _1104.params, 'optionalAccess', _1105 => _1105._meta]) || {},
|
|
276455
276668
|
[RELATED_TASK_META_KEY]: options.relatedTask
|
|
276456
276669
|
}
|
|
276457
276670
|
}
|
|
@@ -276463,8 +276676,8 @@ var Protocol = class {
|
|
|
276463
276676
|
});
|
|
276464
276677
|
return;
|
|
276465
276678
|
}
|
|
276466
|
-
const debouncedMethods = _nullishCoalesce(_optionalChain([this, 'access',
|
|
276467
|
-
const canDebounce = debouncedMethods.includes(notification.method) && !notification.params && !_optionalChain([options, 'optionalAccess',
|
|
276679
|
+
const debouncedMethods = _nullishCoalesce(_optionalChain([this, 'access', _1106 => _1106._options, 'optionalAccess', _1107 => _1107.debouncedNotificationMethods]), () => ( []));
|
|
276680
|
+
const canDebounce = debouncedMethods.includes(notification.method) && !notification.params && !_optionalChain([options, 'optionalAccess', _1108 => _1108.relatedRequestId]) && !_optionalChain([options, 'optionalAccess', _1109 => _1109.relatedTask]);
|
|
276468
276681
|
if (canDebounce) {
|
|
276469
276682
|
if (this._pendingDebouncedNotifications.has(notification.method)) {
|
|
276470
276683
|
return;
|
|
@@ -276479,19 +276692,19 @@ var Protocol = class {
|
|
|
276479
276692
|
...notification,
|
|
276480
276693
|
jsonrpc: "2.0"
|
|
276481
276694
|
};
|
|
276482
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
276695
|
+
if (_optionalChain([options, 'optionalAccess', _1110 => _1110.relatedTask])) {
|
|
276483
276696
|
jsonrpcNotification2 = {
|
|
276484
276697
|
...jsonrpcNotification2,
|
|
276485
276698
|
params: {
|
|
276486
276699
|
...jsonrpcNotification2.params,
|
|
276487
276700
|
_meta: {
|
|
276488
|
-
..._optionalChain([jsonrpcNotification2, 'access',
|
|
276701
|
+
..._optionalChain([jsonrpcNotification2, 'access', _1111 => _1111.params, 'optionalAccess', _1112 => _1112._meta]) || {},
|
|
276489
276702
|
[RELATED_TASK_META_KEY]: options.relatedTask
|
|
276490
276703
|
}
|
|
276491
276704
|
}
|
|
276492
276705
|
};
|
|
276493
276706
|
}
|
|
276494
|
-
_optionalChain([this, 'access',
|
|
276707
|
+
_optionalChain([this, 'access', _1113 => _1113._transport, 'optionalAccess', _1114 => _1114.send, 'call', _1115 => _1115(jsonrpcNotification2, options), 'access', _1116 => _1116.catch, 'call', _1117 => _1117((error49) => this._onerror(error49))]);
|
|
276495
276708
|
});
|
|
276496
276709
|
return;
|
|
276497
276710
|
}
|
|
@@ -276499,13 +276712,13 @@ var Protocol = class {
|
|
|
276499
276712
|
...notification,
|
|
276500
276713
|
jsonrpc: "2.0"
|
|
276501
276714
|
};
|
|
276502
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
276715
|
+
if (_optionalChain([options, 'optionalAccess', _1118 => _1118.relatedTask])) {
|
|
276503
276716
|
jsonrpcNotification = {
|
|
276504
276717
|
...jsonrpcNotification,
|
|
276505
276718
|
params: {
|
|
276506
276719
|
...jsonrpcNotification.params,
|
|
276507
276720
|
_meta: {
|
|
276508
|
-
..._optionalChain([jsonrpcNotification, 'access',
|
|
276721
|
+
..._optionalChain([jsonrpcNotification, 'access', _1119 => _1119.params, 'optionalAccess', _1120 => _1120._meta]) || {},
|
|
276509
276722
|
[RELATED_TASK_META_KEY]: options.relatedTask
|
|
276510
276723
|
}
|
|
276511
276724
|
}
|
|
@@ -276584,7 +276797,7 @@ var Protocol = class {
|
|
|
276584
276797
|
if (!this._taskStore || !this._taskMessageQueue) {
|
|
276585
276798
|
throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");
|
|
276586
276799
|
}
|
|
276587
|
-
const maxQueueSize = _optionalChain([this, 'access',
|
|
276800
|
+
const maxQueueSize = _optionalChain([this, 'access', _1121 => _1121._options, 'optionalAccess', _1122 => _1122.maxTaskQueueSize]);
|
|
276588
276801
|
await this._taskMessageQueue.enqueue(taskId, message, sessionId, maxQueueSize);
|
|
276589
276802
|
}
|
|
276590
276803
|
/**
|
|
@@ -276617,10 +276830,10 @@ var Protocol = class {
|
|
|
276617
276830
|
* @returns Promise that resolves when an update occurs or rejects if aborted
|
|
276618
276831
|
*/
|
|
276619
276832
|
async _waitForTaskUpdate(taskId, signal) {
|
|
276620
|
-
let interval = _nullishCoalesce(_optionalChain([this, 'access',
|
|
276833
|
+
let interval = _nullishCoalesce(_optionalChain([this, 'access', _1123 => _1123._options, 'optionalAccess', _1124 => _1124.defaultTaskPollInterval]), () => ( 1e3));
|
|
276621
276834
|
try {
|
|
276622
|
-
const task5 = await _optionalChain([this, 'access',
|
|
276623
|
-
if (_optionalChain([task5, 'optionalAccess',
|
|
276835
|
+
const task5 = await _optionalChain([this, 'access', _1125 => _1125._taskStore, 'optionalAccess', _1126 => _1126.getTask, 'call', _1127 => _1127(taskId)]);
|
|
276836
|
+
if (_optionalChain([task5, 'optionalAccess', _1128 => _1128.pollInterval])) {
|
|
276624
276837
|
interval = task5.pollInterval;
|
|
276625
276838
|
}
|
|
276626
276839
|
} catch (e48) {
|
|
@@ -276860,7 +277073,7 @@ var ExperimentalServerTasks = class {
|
|
|
276860
277073
|
*/
|
|
276861
277074
|
createMessageStream(params, options) {
|
|
276862
277075
|
const clientCapabilities = this._server.getClientCapabilities();
|
|
276863
|
-
if ((params.tools || params.toolChoice) && !_optionalChain([clientCapabilities, 'optionalAccess',
|
|
277076
|
+
if ((params.tools || params.toolChoice) && !_optionalChain([clientCapabilities, 'optionalAccess', _1129 => _1129.sampling, 'optionalAccess', _1130 => _1130.tools])) {
|
|
276864
277077
|
throw new Error("Client does not support sampling tools capability.");
|
|
276865
277078
|
}
|
|
276866
277079
|
if (params.messages.length > 0) {
|
|
@@ -276938,13 +277151,13 @@ var ExperimentalServerTasks = class {
|
|
|
276938
277151
|
const mode2 = _nullishCoalesce(params.mode, () => ( "form"));
|
|
276939
277152
|
switch (mode2) {
|
|
276940
277153
|
case "url": {
|
|
276941
|
-
if (!_optionalChain([clientCapabilities, 'optionalAccess',
|
|
277154
|
+
if (!_optionalChain([clientCapabilities, 'optionalAccess', _1131 => _1131.elicitation, 'optionalAccess', _1132 => _1132.url])) {
|
|
276942
277155
|
throw new Error("Client does not support url elicitation.");
|
|
276943
277156
|
}
|
|
276944
277157
|
break;
|
|
276945
277158
|
}
|
|
276946
277159
|
case "form": {
|
|
276947
|
-
if (!_optionalChain([clientCapabilities, 'optionalAccess',
|
|
277160
|
+
if (!_optionalChain([clientCapabilities, 'optionalAccess', _1133 => _1133.elicitation, 'optionalAccess', _1134 => _1134.form])) {
|
|
276948
277161
|
throw new Error("Client does not support form elicitation.");
|
|
276949
277162
|
}
|
|
276950
277163
|
break;
|
|
@@ -277014,7 +277227,7 @@ function assertToolsCallTaskCapability(requests, method2, entityName) {
|
|
|
277014
277227
|
}
|
|
277015
277228
|
switch (method2) {
|
|
277016
277229
|
case "tools/call":
|
|
277017
|
-
if (!_optionalChain([requests, 'access',
|
|
277230
|
+
if (!_optionalChain([requests, 'access', _1135 => _1135.tools, 'optionalAccess', _1136 => _1136.call])) {
|
|
277018
277231
|
throw new Error(`${entityName} does not support task creation for tools/call (required for ${method2})`);
|
|
277019
277232
|
}
|
|
277020
277233
|
break;
|
|
@@ -277028,12 +277241,12 @@ function assertClientRequestTaskCapability(requests, method2, entityName) {
|
|
|
277028
277241
|
}
|
|
277029
277242
|
switch (method2) {
|
|
277030
277243
|
case "sampling/createMessage":
|
|
277031
|
-
if (!_optionalChain([requests, 'access',
|
|
277244
|
+
if (!_optionalChain([requests, 'access', _1137 => _1137.sampling, 'optionalAccess', _1138 => _1138.createMessage])) {
|
|
277032
277245
|
throw new Error(`${entityName} does not support task creation for sampling/createMessage (required for ${method2})`);
|
|
277033
277246
|
}
|
|
277034
277247
|
break;
|
|
277035
277248
|
case "elicitation/create":
|
|
277036
|
-
if (!_optionalChain([requests, 'access',
|
|
277249
|
+
if (!_optionalChain([requests, 'access', _1139 => _1139.elicitation, 'optionalAccess', _1140 => _1140.create])) {
|
|
277037
277250
|
throw new Error(`${entityName} does not support task creation for elicitation/create (required for ${method2})`);
|
|
277038
277251
|
}
|
|
277039
277252
|
break;
|
|
@@ -277056,14 +277269,14 @@ var Server2 = class extends Protocol {
|
|
|
277056
277269
|
const currentLevel = this._loggingLevels.get(sessionId);
|
|
277057
277270
|
return currentLevel ? this.LOG_LEVEL_SEVERITY.get(level) < this.LOG_LEVEL_SEVERITY.get(currentLevel) : false;
|
|
277058
277271
|
};
|
|
277059
|
-
this._capabilities = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
277060
|
-
this._instructions = _optionalChain([options, 'optionalAccess',
|
|
277061
|
-
this._jsonSchemaValidator = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
277272
|
+
this._capabilities = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _1141 => _1141.capabilities]), () => ( {}));
|
|
277273
|
+
this._instructions = _optionalChain([options, 'optionalAccess', _1142 => _1142.instructions]);
|
|
277274
|
+
this._jsonSchemaValidator = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _1143 => _1143.jsonSchemaValidator]), () => ( new AjvJsonSchemaValidator()));
|
|
277062
277275
|
this.setRequestHandler(InitializeRequestSchema, (request) => this._oninitialize(request));
|
|
277063
|
-
this.setNotificationHandler(InitializedNotificationSchema, () => _optionalChain([this, 'access',
|
|
277276
|
+
this.setNotificationHandler(InitializedNotificationSchema, () => _optionalChain([this, 'access', _1144 => _1144.oninitialized, 'optionalCall', _1145 => _1145()]));
|
|
277064
277277
|
if (this._capabilities.logging) {
|
|
277065
277278
|
this.setRequestHandler(SetLevelRequestSchema, async (request, extra) => {
|
|
277066
|
-
const transportSessionId = extra.sessionId || _optionalChain([extra, 'access',
|
|
277279
|
+
const transportSessionId = extra.sessionId || _optionalChain([extra, 'access', _1146 => _1146.requestInfo, 'optionalAccess', _1147 => _1147.headers, 'access', _1148 => _1148["mcp-session-id"]]) || void 0;
|
|
277067
277280
|
const { level } = request.params;
|
|
277068
277281
|
const parseResult = LoggingLevelSchema.safeParse(level);
|
|
277069
277282
|
if (parseResult.success) {
|
|
@@ -277104,19 +277317,19 @@ var Server2 = class extends Protocol {
|
|
|
277104
277317
|
*/
|
|
277105
277318
|
setRequestHandler(requestSchema, handler) {
|
|
277106
277319
|
const shape = getObjectShape(requestSchema);
|
|
277107
|
-
const methodSchema = _optionalChain([shape, 'optionalAccess',
|
|
277320
|
+
const methodSchema = _optionalChain([shape, 'optionalAccess', _1149 => _1149.method]);
|
|
277108
277321
|
if (!methodSchema) {
|
|
277109
277322
|
throw new Error("Schema is missing a method literal");
|
|
277110
277323
|
}
|
|
277111
277324
|
let methodValue;
|
|
277112
277325
|
if (isZ4Schema(methodSchema)) {
|
|
277113
277326
|
const v4Schema = methodSchema;
|
|
277114
|
-
const v4Def = _optionalChain([v4Schema, 'access',
|
|
277115
|
-
methodValue = _nullishCoalesce(_optionalChain([v4Def, 'optionalAccess',
|
|
277327
|
+
const v4Def = _optionalChain([v4Schema, 'access', _1150 => _1150._zod, 'optionalAccess', _1151 => _1151.def]);
|
|
277328
|
+
methodValue = _nullishCoalesce(_optionalChain([v4Def, 'optionalAccess', _1152 => _1152.value]), () => ( v4Schema.value));
|
|
277116
277329
|
} else {
|
|
277117
277330
|
const v3Schema = methodSchema;
|
|
277118
277331
|
const legacyDef = v3Schema._def;
|
|
277119
|
-
methodValue = _nullishCoalesce(_optionalChain([legacyDef, 'optionalAccess',
|
|
277332
|
+
methodValue = _nullishCoalesce(_optionalChain([legacyDef, 'optionalAccess', _1153 => _1153.value]), () => ( v3Schema.value));
|
|
277120
277333
|
}
|
|
277121
277334
|
if (typeof methodValue !== "string") {
|
|
277122
277335
|
throw new Error("Schema method literal must be a string");
|
|
@@ -277153,17 +277366,17 @@ var Server2 = class extends Protocol {
|
|
|
277153
277366
|
assertCapabilityForMethod(method2) {
|
|
277154
277367
|
switch (method2) {
|
|
277155
277368
|
case "sampling/createMessage":
|
|
277156
|
-
if (!_optionalChain([this, 'access',
|
|
277369
|
+
if (!_optionalChain([this, 'access', _1154 => _1154._clientCapabilities, 'optionalAccess', _1155 => _1155.sampling])) {
|
|
277157
277370
|
throw new Error(`Client does not support sampling (required for ${method2})`);
|
|
277158
277371
|
}
|
|
277159
277372
|
break;
|
|
277160
277373
|
case "elicitation/create":
|
|
277161
|
-
if (!_optionalChain([this, 'access',
|
|
277374
|
+
if (!_optionalChain([this, 'access', _1156 => _1156._clientCapabilities, 'optionalAccess', _1157 => _1157.elicitation])) {
|
|
277162
277375
|
throw new Error(`Client does not support elicitation (required for ${method2})`);
|
|
277163
277376
|
}
|
|
277164
277377
|
break;
|
|
277165
277378
|
case "roots/list":
|
|
277166
|
-
if (!_optionalChain([this, 'access',
|
|
277379
|
+
if (!_optionalChain([this, 'access', _1158 => _1158._clientCapabilities, 'optionalAccess', _1159 => _1159.roots])) {
|
|
277167
277380
|
throw new Error(`Client does not support listing roots (required for ${method2})`);
|
|
277168
277381
|
}
|
|
277169
277382
|
break;
|
|
@@ -277195,7 +277408,7 @@ var Server2 = class extends Protocol {
|
|
|
277195
277408
|
}
|
|
277196
277409
|
break;
|
|
277197
277410
|
case "notifications/elicitation/complete":
|
|
277198
|
-
if (!_optionalChain([this, 'access',
|
|
277411
|
+
if (!_optionalChain([this, 'access', _1160 => _1160._clientCapabilities, 'optionalAccess', _1161 => _1161.elicitation, 'optionalAccess', _1162 => _1162.url])) {
|
|
277199
277412
|
throw new Error(`Client does not support URL elicitation (required for ${method2})`);
|
|
277200
277413
|
}
|
|
277201
277414
|
break;
|
|
@@ -277253,13 +277466,13 @@ var Server2 = class extends Protocol {
|
|
|
277253
277466
|
}
|
|
277254
277467
|
}
|
|
277255
277468
|
assertTaskCapability(method2) {
|
|
277256
|
-
assertClientRequestTaskCapability(_optionalChain([this, 'access',
|
|
277469
|
+
assertClientRequestTaskCapability(_optionalChain([this, 'access', _1163 => _1163._clientCapabilities, 'optionalAccess', _1164 => _1164.tasks, 'optionalAccess', _1165 => _1165.requests]), method2, "Client");
|
|
277257
277470
|
}
|
|
277258
277471
|
assertTaskHandlerCapability(method2) {
|
|
277259
277472
|
if (!this._capabilities) {
|
|
277260
277473
|
return;
|
|
277261
277474
|
}
|
|
277262
|
-
assertToolsCallTaskCapability(_optionalChain([this, 'access',
|
|
277475
|
+
assertToolsCallTaskCapability(_optionalChain([this, 'access', _1166 => _1166._capabilities, 'access', _1167 => _1167.tasks, 'optionalAccess', _1168 => _1168.requests]), method2, "Server");
|
|
277263
277476
|
}
|
|
277264
277477
|
async _oninitialize(request) {
|
|
277265
277478
|
const requestedVersion = request.params.protocolVersion;
|
|
@@ -277294,7 +277507,7 @@ var Server2 = class extends Protocol {
|
|
|
277294
277507
|
// Implementation
|
|
277295
277508
|
async createMessage(params, options) {
|
|
277296
277509
|
if (params.tools || params.toolChoice) {
|
|
277297
|
-
if (!_optionalChain([this, 'access',
|
|
277510
|
+
if (!_optionalChain([this, 'access', _1169 => _1169._clientCapabilities, 'optionalAccess', _1170 => _1170.sampling, 'optionalAccess', _1171 => _1171.tools])) {
|
|
277298
277511
|
throw new Error("Client does not support sampling tools capability.");
|
|
277299
277512
|
}
|
|
277300
277513
|
}
|
|
@@ -277337,14 +277550,14 @@ var Server2 = class extends Protocol {
|
|
|
277337
277550
|
const mode2 = _nullishCoalesce(params.mode, () => ( "form"));
|
|
277338
277551
|
switch (mode2) {
|
|
277339
277552
|
case "url": {
|
|
277340
|
-
if (!_optionalChain([this, 'access',
|
|
277553
|
+
if (!_optionalChain([this, 'access', _1172 => _1172._clientCapabilities, 'optionalAccess', _1173 => _1173.elicitation, 'optionalAccess', _1174 => _1174.url])) {
|
|
277341
277554
|
throw new Error("Client does not support url elicitation.");
|
|
277342
277555
|
}
|
|
277343
277556
|
const urlParams = params;
|
|
277344
277557
|
return this.request({ method: "elicitation/create", params: urlParams }, ElicitResultSchema, options);
|
|
277345
277558
|
}
|
|
277346
277559
|
case "form": {
|
|
277347
|
-
if (!_optionalChain([this, 'access',
|
|
277560
|
+
if (!_optionalChain([this, 'access', _1175 => _1175._clientCapabilities, 'optionalAccess', _1176 => _1176.elicitation, 'optionalAccess', _1177 => _1177.form])) {
|
|
277348
277561
|
throw new Error("Client does not support form elicitation.");
|
|
277349
277562
|
}
|
|
277350
277563
|
const formParams = params.mode === "form" ? params : { ...params, mode: "form" };
|
|
@@ -277376,7 +277589,7 @@ var Server2 = class extends Protocol {
|
|
|
277376
277589
|
* @returns A function that emits the completion notification when awaited.
|
|
277377
277590
|
*/
|
|
277378
277591
|
createElicitationCompletionNotifier(elicitationId, options) {
|
|
277379
|
-
if (!_optionalChain([this, 'access',
|
|
277592
|
+
if (!_optionalChain([this, 'access', _1178 => _1178._clientCapabilities, 'optionalAccess', _1179 => _1179.elicitation, 'optionalAccess', _1180 => _1180.url])) {
|
|
277380
277593
|
throw new Error("Client does not support URL elicitation (required for notifications/elicitation/complete)");
|
|
277381
277594
|
}
|
|
277382
277595
|
return () => this.notification({
|
|
@@ -277430,7 +277643,7 @@ function isCompletable(schema) {
|
|
|
277430
277643
|
}
|
|
277431
277644
|
function getCompleter(schema) {
|
|
277432
277645
|
const meta3 = schema[COMPLETABLE_SYMBOL];
|
|
277433
|
-
return _optionalChain([meta3, 'optionalAccess',
|
|
277646
|
+
return _optionalChain([meta3, 'optionalAccess', _1181 => _1181.complete]);
|
|
277434
277647
|
}
|
|
277435
277648
|
var McpZodTypeKind;
|
|
277436
277649
|
(function(McpZodTypeKind2) {
|
|
@@ -277610,7 +277823,7 @@ var McpServer = class {
|
|
|
277610
277823
|
throw new McpError(ErrorCode.InvalidParams, `Tool ${request.params.name} disabled`);
|
|
277611
277824
|
}
|
|
277612
277825
|
const isTaskRequest = !!request.params.task;
|
|
277613
|
-
const taskSupport = _optionalChain([tool, 'access',
|
|
277826
|
+
const taskSupport = _optionalChain([tool, 'access', _1182 => _1182.execution, 'optionalAccess', _1183 => _1183.taskSupport]);
|
|
277614
277827
|
const isTaskHandler = "createTask" in tool.handler;
|
|
277615
277828
|
if ((taskSupport === "required" || taskSupport === "optional") && !isTaskHandler) {
|
|
277616
277829
|
throw new McpError(ErrorCode.InternalError, `Tool ${request.params.name} has taskSupport '${taskSupport}' but was not registered with registerToolTask`);
|
|
@@ -277785,7 +277998,7 @@ var McpServer = class {
|
|
|
277785
277998
|
return EMPTY_COMPLETION_RESULT;
|
|
277786
277999
|
}
|
|
277787
278000
|
const promptShape = getObjectShape(prompt.argsSchema);
|
|
277788
|
-
const field = _optionalChain([promptShape, 'optionalAccess',
|
|
278001
|
+
const field = _optionalChain([promptShape, 'optionalAccess', _1184 => _1184[request.params.argument.name]]);
|
|
277789
278002
|
if (!isCompletable(field)) {
|
|
277790
278003
|
return EMPTY_COMPLETION_RESULT;
|
|
277791
278004
|
}
|
|
@@ -278063,7 +278276,7 @@ var McpServer = class {
|
|
|
278063
278276
|
this._registeredPrompts[name] = registeredPrompt;
|
|
278064
278277
|
if (argsSchema) {
|
|
278065
278278
|
const hasCompletable = Object.values(argsSchema).some((field) => {
|
|
278066
|
-
const inner = field instanceof ZodOptional2 ? _optionalChain([field, 'access',
|
|
278279
|
+
const inner = field instanceof ZodOptional2 ? _optionalChain([field, 'access', _1185 => _1185._def, 'optionalAccess', _1186 => _1186.innerType]) : field;
|
|
278067
278280
|
return isCompletable(inner);
|
|
278068
278281
|
});
|
|
278069
278282
|
if (hasCompletable) {
|
|
@@ -278284,7 +278497,7 @@ function promptArgumentsFromSchema(schema) {
|
|
|
278284
278497
|
}
|
|
278285
278498
|
function getMethodValue(schema) {
|
|
278286
278499
|
const shape = getObjectShape(schema);
|
|
278287
|
-
const methodSchema = _optionalChain([shape, 'optionalAccess',
|
|
278500
|
+
const methodSchema = _optionalChain([shape, 'optionalAccess', _1187 => _1187.method]);
|
|
278288
278501
|
if (!methodSchema) {
|
|
278289
278502
|
throw new Error("Schema is missing a method literal");
|
|
278290
278503
|
}
|
|
@@ -278355,7 +278568,7 @@ var StdioServerTransport = class {
|
|
|
278355
278568
|
this.processReadBuffer();
|
|
278356
278569
|
};
|
|
278357
278570
|
this._onerror = (error49) => {
|
|
278358
|
-
_optionalChain([this, 'access',
|
|
278571
|
+
_optionalChain([this, 'access', _1188 => _1188.onerror, 'optionalCall', _1189 => _1189(error49)]);
|
|
278359
278572
|
};
|
|
278360
278573
|
}
|
|
278361
278574
|
/**
|
|
@@ -278376,9 +278589,9 @@ var StdioServerTransport = class {
|
|
|
278376
278589
|
if (message === null) {
|
|
278377
278590
|
break;
|
|
278378
278591
|
}
|
|
278379
|
-
_optionalChain([this, 'access',
|
|
278592
|
+
_optionalChain([this, 'access', _1190 => _1190.onmessage, 'optionalCall', _1191 => _1191(message)]);
|
|
278380
278593
|
} catch (error49) {
|
|
278381
|
-
_optionalChain([this, 'access',
|
|
278594
|
+
_optionalChain([this, 'access', _1192 => _1192.onerror, 'optionalCall', _1193 => _1193(error49)]);
|
|
278382
278595
|
}
|
|
278383
278596
|
}
|
|
278384
278597
|
}
|
|
@@ -278390,7 +278603,7 @@ var StdioServerTransport = class {
|
|
|
278390
278603
|
this._stdin.pause();
|
|
278391
278604
|
}
|
|
278392
278605
|
this._readBuffer.clear();
|
|
278393
|
-
_optionalChain([this, 'access',
|
|
278606
|
+
_optionalChain([this, 'access', _1194 => _1194.onclose, 'optionalCall', _1195 => _1195()]);
|
|
278394
278607
|
}
|
|
278395
278608
|
send(message) {
|
|
278396
278609
|
return new Promise((resolve7) => {
|
|
@@ -278431,7 +278644,7 @@ var Request2 = class extends GlobalRequest {
|
|
|
278431
278644
|
if (typeof input === "object" && getRequestCache in input) {
|
|
278432
278645
|
input = input[getRequestCache]();
|
|
278433
278646
|
}
|
|
278434
|
-
if (typeof _optionalChain([options, 'optionalAccess',
|
|
278647
|
+
if (typeof _optionalChain([options, 'optionalAccess', _1196 => _1196.body, 'optionalAccess', _1197 => _1197.getReader]) !== "undefined") {
|
|
278435
278648
|
;
|
|
278436
278649
|
_nullishCoalesce(options.duplex, () => ( (options.duplex = "half")));
|
|
278437
278650
|
}
|
|
@@ -278630,9 +278843,9 @@ var Response22 = (_a3 = class {
|
|
|
278630
278843
|
} else {
|
|
278631
278844
|
_chunkDLBJL7R2cjs.__privateSet.call(void 0, this, _init, init);
|
|
278632
278845
|
}
|
|
278633
|
-
if (typeof body2 === "string" || typeof _optionalChain([body2, 'optionalAccess',
|
|
278846
|
+
if (typeof body2 === "string" || typeof _optionalChain([body2, 'optionalAccess', _1198 => _1198.getReader]) !== "undefined" || body2 instanceof Blob || body2 instanceof Uint8Array) {
|
|
278634
278847
|
;
|
|
278635
|
-
this[cacheKey] = [_optionalChain([init, 'optionalAccess',
|
|
278848
|
+
this[cacheKey] = [_optionalChain([init, 'optionalAccess', _1199 => _1199.status]) || 200, body2, headers2 || _optionalChain([init, 'optionalAccess', _1200 => _1200.headers])];
|
|
278636
278849
|
}
|
|
278637
278850
|
}
|
|
278638
278851
|
[getResponseCache]() {
|
|
@@ -278652,7 +278865,7 @@ var Response22 = (_a3 = class {
|
|
|
278652
278865
|
return this[getResponseCache]().headers;
|
|
278653
278866
|
}
|
|
278654
278867
|
get status() {
|
|
278655
|
-
return _nullishCoalesce(_optionalChain([this, 'access',
|
|
278868
|
+
return _nullishCoalesce(_optionalChain([this, 'access', _1201 => _1201[cacheKey], 'optionalAccess', _1202 => _1202[0]]), () => ( this[getResponseCache]().status));
|
|
278656
278869
|
}
|
|
278657
278870
|
get ok() {
|
|
278658
278871
|
const status = this.status;
|
|
@@ -278767,7 +278980,7 @@ var drainIncoming = (incoming) => {
|
|
|
278767
278980
|
if (incoming instanceof _http22.Http2ServerRequest) {
|
|
278768
278981
|
try {
|
|
278769
278982
|
;
|
|
278770
|
-
_optionalChain([incoming, 'access',
|
|
278983
|
+
_optionalChain([incoming, 'access', _1203 => _1203.stream, 'optionalAccess', _1204 => _1204.close, 'optionalCall', _1205 => _1205(_http22.constants.NGHTTP2_NO_ERROR)]);
|
|
278771
278984
|
} catch (e49) {
|
|
278772
278985
|
}
|
|
278773
278986
|
return;
|
|
@@ -278787,7 +279000,7 @@ var drainIncoming = (incoming) => {
|
|
|
278787
279000
|
}
|
|
278788
279001
|
};
|
|
278789
279002
|
const timer = setTimeout(forceClose, DRAIN_TIMEOUT_MS);
|
|
278790
|
-
_optionalChain([timer, 'access',
|
|
279003
|
+
_optionalChain([timer, 'access', _1206 => _1206.unref, 'optionalCall', _1207 => _1207()]);
|
|
278791
279004
|
const onData = (chunk) => {
|
|
278792
279005
|
bytesRead += chunk.length;
|
|
278793
279006
|
if (bytesRead > MAX_DRAIN_BYTES) {
|
|
@@ -278859,12 +279072,12 @@ var responseViaCache = async (res, outgoing) => {
|
|
|
278859
279072
|
outgoing.end(new Uint8Array(await body2.arrayBuffer()));
|
|
278860
279073
|
} else {
|
|
278861
279074
|
flushHeaders(outgoing);
|
|
278862
|
-
await _optionalChain([writeFromReadableStream, 'call',
|
|
279075
|
+
await _optionalChain([writeFromReadableStream, 'call', _1208 => _1208(body2, outgoing), 'optionalAccess', _1209 => _1209.catch, 'call', _1210 => _1210(
|
|
278863
279076
|
(e) => handleResponseError(e, outgoing)
|
|
278864
279077
|
)]);
|
|
278865
279078
|
}
|
|
278866
279079
|
;
|
|
278867
|
-
_optionalChain([outgoing, 'access',
|
|
279080
|
+
_optionalChain([outgoing, 'access', _1211 => _1211[outgoingEnded], 'optionalCall', _1212 => _1212()]);
|
|
278868
279081
|
};
|
|
278869
279082
|
var isPromise = (res) => typeof res.then === "function";
|
|
278870
279083
|
var responseViaResponseObject = async (res, outgoing, options = {}) => {
|
|
@@ -278940,7 +279153,7 @@ var responseViaResponseObject = async (res, outgoing, options = {}) => {
|
|
|
278940
279153
|
outgoing.end();
|
|
278941
279154
|
}
|
|
278942
279155
|
;
|
|
278943
|
-
_optionalChain([outgoing, 'access',
|
|
279156
|
+
_optionalChain([outgoing, 'access', _1213 => _1213[outgoingEnded], 'optionalCall', _1214 => _1214()]);
|
|
278944
279157
|
};
|
|
278945
279158
|
var getRequestListener = (fetchCallback, options = {}) => {
|
|
278946
279159
|
const autoCleanupIncoming = _nullishCoalesce(options.autoCleanupIncoming, () => ( true));
|
|
@@ -279067,7 +279280,7 @@ var WebStandardStreamableHTTPServerTransport = class {
|
|
|
279067
279280
|
*/
|
|
279068
279281
|
createJsonErrorResponse(status, code, message, options) {
|
|
279069
279282
|
const error49 = { code, message };
|
|
279070
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
279283
|
+
if (_optionalChain([options, 'optionalAccess', _1215 => _1215.data]) !== void 0) {
|
|
279071
279284
|
error49.data = options.data;
|
|
279072
279285
|
}
|
|
279073
279286
|
return new Response(JSON.stringify({
|
|
@@ -279078,7 +279291,7 @@ var WebStandardStreamableHTTPServerTransport = class {
|
|
|
279078
279291
|
status,
|
|
279079
279292
|
headers: {
|
|
279080
279293
|
"Content-Type": "application/json",
|
|
279081
|
-
..._optionalChain([options, 'optionalAccess',
|
|
279294
|
+
..._optionalChain([options, 'optionalAccess', _1216 => _1216.headers])
|
|
279082
279295
|
}
|
|
279083
279296
|
});
|
|
279084
279297
|
}
|
|
@@ -279094,7 +279307,7 @@ var WebStandardStreamableHTTPServerTransport = class {
|
|
|
279094
279307
|
const hostHeader = req.headers.get("host");
|
|
279095
279308
|
if (!hostHeader || !this._allowedHosts.includes(hostHeader)) {
|
|
279096
279309
|
const error49 = `Invalid Host header: ${hostHeader}`;
|
|
279097
|
-
_optionalChain([this, 'access',
|
|
279310
|
+
_optionalChain([this, 'access', _1217 => _1217.onerror, 'optionalCall', _1218 => _1218(new Error(error49))]);
|
|
279098
279311
|
return this.createJsonErrorResponse(403, -32e3, error49);
|
|
279099
279312
|
}
|
|
279100
279313
|
}
|
|
@@ -279102,7 +279315,7 @@ var WebStandardStreamableHTTPServerTransport = class {
|
|
|
279102
279315
|
const originHeader = req.headers.get("origin");
|
|
279103
279316
|
if (originHeader && !this._allowedOrigins.includes(originHeader)) {
|
|
279104
279317
|
const error49 = `Invalid Origin header: ${originHeader}`;
|
|
279105
|
-
_optionalChain([this, 'access',
|
|
279318
|
+
_optionalChain([this, 'access', _1219 => _1219.onerror, 'optionalCall', _1220 => _1220(new Error(error49))]);
|
|
279106
279319
|
return this.createJsonErrorResponse(403, -32e3, error49);
|
|
279107
279320
|
}
|
|
279108
279321
|
}
|
|
@@ -279163,8 +279376,8 @@ data:
|
|
|
279163
279376
|
*/
|
|
279164
279377
|
async handleGetRequest(req) {
|
|
279165
279378
|
const acceptHeader = req.headers.get("accept");
|
|
279166
|
-
if (!_optionalChain([acceptHeader, 'optionalAccess',
|
|
279167
|
-
_optionalChain([this, 'access',
|
|
279379
|
+
if (!_optionalChain([acceptHeader, 'optionalAccess', _1221 => _1221.includes, 'call', _1222 => _1222("text/event-stream")])) {
|
|
279380
|
+
_optionalChain([this, 'access', _1223 => _1223.onerror, 'optionalCall', _1224 => _1224(new Error("Not Acceptable: Client must accept text/event-stream"))]);
|
|
279168
279381
|
return this.createJsonErrorResponse(406, -32e3, "Not Acceptable: Client must accept text/event-stream");
|
|
279169
279382
|
}
|
|
279170
279383
|
const sessionError = this.validateSession(req);
|
|
@@ -279182,7 +279395,7 @@ data:
|
|
|
279182
279395
|
}
|
|
279183
279396
|
}
|
|
279184
279397
|
if (this._streamMapping.get(this._standaloneSseStreamId) !== void 0) {
|
|
279185
|
-
_optionalChain([this, 'access',
|
|
279398
|
+
_optionalChain([this, 'access', _1225 => _1225.onerror, 'optionalCall', _1226 => _1226(new Error("Conflict: Only one SSE stream is allowed per session"))]);
|
|
279186
279399
|
return this.createJsonErrorResponse(409, -32e3, "Conflict: Only one SSE stream is allowed per session");
|
|
279187
279400
|
}
|
|
279188
279401
|
const encoder = new TextEncoder();
|
|
@@ -279222,7 +279435,7 @@ data:
|
|
|
279222
279435
|
*/
|
|
279223
279436
|
async replayEvents(lastEventId) {
|
|
279224
279437
|
if (!this._eventStore) {
|
|
279225
|
-
_optionalChain([this, 'access',
|
|
279438
|
+
_optionalChain([this, 'access', _1227 => _1227.onerror, 'optionalCall', _1228 => _1228(new Error("Event store not configured"))]);
|
|
279226
279439
|
return this.createJsonErrorResponse(400, -32e3, "Event store not configured");
|
|
279227
279440
|
}
|
|
279228
279441
|
try {
|
|
@@ -279230,11 +279443,11 @@ data:
|
|
|
279230
279443
|
if (this._eventStore.getStreamIdForEventId) {
|
|
279231
279444
|
streamId = await this._eventStore.getStreamIdForEventId(lastEventId);
|
|
279232
279445
|
if (!streamId) {
|
|
279233
|
-
_optionalChain([this, 'access',
|
|
279446
|
+
_optionalChain([this, 'access', _1229 => _1229.onerror, 'optionalCall', _1230 => _1230(new Error("Invalid event ID format"))]);
|
|
279234
279447
|
return this.createJsonErrorResponse(400, -32e3, "Invalid event ID format");
|
|
279235
279448
|
}
|
|
279236
279449
|
if (this._streamMapping.get(streamId) !== void 0) {
|
|
279237
|
-
_optionalChain([this, 'access',
|
|
279450
|
+
_optionalChain([this, 'access', _1231 => _1231.onerror, 'optionalCall', _1232 => _1232(new Error("Conflict: Stream already has an active connection"))]);
|
|
279238
279451
|
return this.createJsonErrorResponse(409, -32e3, "Conflict: Stream already has an active connection");
|
|
279239
279452
|
}
|
|
279240
279453
|
}
|
|
@@ -279259,7 +279472,7 @@ data:
|
|
|
279259
279472
|
send: async (eventId, message) => {
|
|
279260
279473
|
const success2 = this.writeSSEEvent(streamController, encoder, message, eventId);
|
|
279261
279474
|
if (!success2) {
|
|
279262
|
-
_optionalChain([this, 'access',
|
|
279475
|
+
_optionalChain([this, 'access', _1233 => _1233.onerror, 'optionalCall', _1234 => _1234(new Error("Failed replay events"))]);
|
|
279263
279476
|
try {
|
|
279264
279477
|
streamController.close();
|
|
279265
279478
|
} catch (e51) {
|
|
@@ -279280,7 +279493,7 @@ data:
|
|
|
279280
279493
|
});
|
|
279281
279494
|
return new Response(readable, { headers: headers2 });
|
|
279282
279495
|
} catch (error49) {
|
|
279283
|
-
_optionalChain([this, 'access',
|
|
279496
|
+
_optionalChain([this, 'access', _1235 => _1235.onerror, 'optionalCall', _1236 => _1236(error49)]);
|
|
279284
279497
|
return this.createJsonErrorResponse(500, -32e3, "Error replaying events");
|
|
279285
279498
|
}
|
|
279286
279499
|
}
|
|
@@ -279301,7 +279514,7 @@ data:
|
|
|
279301
279514
|
controller.enqueue(encoder.encode(eventData));
|
|
279302
279515
|
return true;
|
|
279303
279516
|
} catch (error49) {
|
|
279304
|
-
_optionalChain([this, 'access',
|
|
279517
|
+
_optionalChain([this, 'access', _1237 => _1237.onerror, 'optionalCall', _1238 => _1238(error49)]);
|
|
279305
279518
|
return false;
|
|
279306
279519
|
}
|
|
279307
279520
|
}
|
|
@@ -279309,7 +279522,7 @@ data:
|
|
|
279309
279522
|
* Handles unsupported requests (PUT, PATCH, etc.)
|
|
279310
279523
|
*/
|
|
279311
279524
|
handleUnsupportedRequest() {
|
|
279312
|
-
_optionalChain([this, 'access',
|
|
279525
|
+
_optionalChain([this, 'access', _1239 => _1239.onerror, 'optionalCall', _1240 => _1240(new Error("Method not allowed."))]);
|
|
279313
279526
|
return new Response(JSON.stringify({
|
|
279314
279527
|
jsonrpc: "2.0",
|
|
279315
279528
|
error: {
|
|
@@ -279331,13 +279544,13 @@ data:
|
|
|
279331
279544
|
async handlePostRequest(req, options) {
|
|
279332
279545
|
try {
|
|
279333
279546
|
const acceptHeader = req.headers.get("accept");
|
|
279334
|
-
if (!_optionalChain([acceptHeader, 'optionalAccess',
|
|
279335
|
-
_optionalChain([this, 'access',
|
|
279547
|
+
if (!_optionalChain([acceptHeader, 'optionalAccess', _1241 => _1241.includes, 'call', _1242 => _1242("application/json")]) || !acceptHeader.includes("text/event-stream")) {
|
|
279548
|
+
_optionalChain([this, 'access', _1243 => _1243.onerror, 'optionalCall', _1244 => _1244(new Error("Not Acceptable: Client must accept both application/json and text/event-stream"))]);
|
|
279336
279549
|
return this.createJsonErrorResponse(406, -32e3, "Not Acceptable: Client must accept both application/json and text/event-stream");
|
|
279337
279550
|
}
|
|
279338
279551
|
const ct = req.headers.get("content-type");
|
|
279339
279552
|
if (!ct || !ct.includes("application/json")) {
|
|
279340
|
-
_optionalChain([this, 'access',
|
|
279553
|
+
_optionalChain([this, 'access', _1245 => _1245.onerror, 'optionalCall', _1246 => _1246(new Error("Unsupported Media Type: Content-Type must be application/json"))]);
|
|
279341
279554
|
return this.createJsonErrorResponse(415, -32e3, "Unsupported Media Type: Content-Type must be application/json");
|
|
279342
279555
|
}
|
|
279343
279556
|
const requestInfo = {
|
|
@@ -279345,13 +279558,13 @@ data:
|
|
|
279345
279558
|
url: new URL(req.url)
|
|
279346
279559
|
};
|
|
279347
279560
|
let rawMessage;
|
|
279348
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
279561
|
+
if (_optionalChain([options, 'optionalAccess', _1247 => _1247.parsedBody]) !== void 0) {
|
|
279349
279562
|
rawMessage = options.parsedBody;
|
|
279350
279563
|
} else {
|
|
279351
279564
|
try {
|
|
279352
279565
|
rawMessage = await req.json();
|
|
279353
279566
|
} catch (e53) {
|
|
279354
|
-
_optionalChain([this, 'access',
|
|
279567
|
+
_optionalChain([this, 'access', _1248 => _1248.onerror, 'optionalCall', _1249 => _1249(new Error("Parse error: Invalid JSON"))]);
|
|
279355
279568
|
return this.createJsonErrorResponse(400, -32700, "Parse error: Invalid JSON");
|
|
279356
279569
|
}
|
|
279357
279570
|
}
|
|
@@ -279363,20 +279576,20 @@ data:
|
|
|
279363
279576
|
messages = [JSONRPCMessageSchema.parse(rawMessage)];
|
|
279364
279577
|
}
|
|
279365
279578
|
} catch (e54) {
|
|
279366
|
-
_optionalChain([this, 'access',
|
|
279579
|
+
_optionalChain([this, 'access', _1250 => _1250.onerror, 'optionalCall', _1251 => _1251(new Error("Parse error: Invalid JSON-RPC message"))]);
|
|
279367
279580
|
return this.createJsonErrorResponse(400, -32700, "Parse error: Invalid JSON-RPC message");
|
|
279368
279581
|
}
|
|
279369
279582
|
const isInitializationRequest = messages.some(isInitializeRequest);
|
|
279370
279583
|
if (isInitializationRequest) {
|
|
279371
279584
|
if (this._initialized && this.sessionId !== void 0) {
|
|
279372
|
-
_optionalChain([this, 'access',
|
|
279585
|
+
_optionalChain([this, 'access', _1252 => _1252.onerror, 'optionalCall', _1253 => _1253(new Error("Invalid Request: Server already initialized"))]);
|
|
279373
279586
|
return this.createJsonErrorResponse(400, -32600, "Invalid Request: Server already initialized");
|
|
279374
279587
|
}
|
|
279375
279588
|
if (messages.length > 1) {
|
|
279376
|
-
_optionalChain([this, 'access',
|
|
279589
|
+
_optionalChain([this, 'access', _1254 => _1254.onerror, 'optionalCall', _1255 => _1255(new Error("Invalid Request: Only one initialization request is allowed"))]);
|
|
279377
279590
|
return this.createJsonErrorResponse(400, -32600, "Invalid Request: Only one initialization request is allowed");
|
|
279378
279591
|
}
|
|
279379
|
-
this.sessionId = _optionalChain([this, 'access',
|
|
279592
|
+
this.sessionId = _optionalChain([this, 'access', _1256 => _1256.sessionIdGenerator, 'optionalCall', _1257 => _1257()]);
|
|
279380
279593
|
this._initialized = true;
|
|
279381
279594
|
if (this.sessionId && this._onsessioninitialized) {
|
|
279382
279595
|
await Promise.resolve(this._onsessioninitialized(this.sessionId));
|
|
@@ -279395,7 +279608,7 @@ data:
|
|
|
279395
279608
|
const hasRequests = messages.some(isJSONRPCRequest);
|
|
279396
279609
|
if (!hasRequests) {
|
|
279397
279610
|
for (const message of messages) {
|
|
279398
|
-
_optionalChain([this, 'access',
|
|
279611
|
+
_optionalChain([this, 'access', _1258 => _1258.onmessage, 'optionalCall', _1259 => _1259(message, { authInfo: _optionalChain([options, 'optionalAccess', _1260 => _1260.authInfo]), requestInfo })]);
|
|
279399
279612
|
}
|
|
279400
279613
|
return new Response(null, { status: 202 });
|
|
279401
279614
|
}
|
|
@@ -279416,7 +279629,7 @@ data:
|
|
|
279416
279629
|
}
|
|
279417
279630
|
}
|
|
279418
279631
|
for (const message of messages) {
|
|
279419
|
-
_optionalChain([this, 'access',
|
|
279632
|
+
_optionalChain([this, 'access', _1261 => _1261.onmessage, 'optionalCall', _1262 => _1262(message, { authInfo: _optionalChain([options, 'optionalAccess', _1263 => _1263.authInfo]), requestInfo })]);
|
|
279420
279633
|
}
|
|
279421
279634
|
});
|
|
279422
279635
|
}
|
|
@@ -279466,11 +279679,11 @@ data:
|
|
|
279466
279679
|
this.closeStandaloneSSEStream();
|
|
279467
279680
|
};
|
|
279468
279681
|
}
|
|
279469
|
-
_optionalChain([this, 'access',
|
|
279682
|
+
_optionalChain([this, 'access', _1264 => _1264.onmessage, 'optionalCall', _1265 => _1265(message, { authInfo: _optionalChain([options, 'optionalAccess', _1266 => _1266.authInfo]), requestInfo, closeSSEStream, closeStandaloneSSEStream })]);
|
|
279470
279683
|
}
|
|
279471
279684
|
return new Response(readable, { status: 200, headers: headers2 });
|
|
279472
279685
|
} catch (error49) {
|
|
279473
|
-
_optionalChain([this, 'access',
|
|
279686
|
+
_optionalChain([this, 'access', _1267 => _1267.onerror, 'optionalCall', _1268 => _1268(error49)]);
|
|
279474
279687
|
return this.createJsonErrorResponse(400, -32700, "Parse error", { data: String(error49) });
|
|
279475
279688
|
}
|
|
279476
279689
|
}
|
|
@@ -279486,7 +279699,7 @@ data:
|
|
|
279486
279699
|
if (protocolError) {
|
|
279487
279700
|
return protocolError;
|
|
279488
279701
|
}
|
|
279489
|
-
await Promise.resolve(_optionalChain([this, 'access',
|
|
279702
|
+
await Promise.resolve(_optionalChain([this, 'access', _1269 => _1269._onsessionclosed, 'optionalCall', _1270 => _1270(this.sessionId)]));
|
|
279490
279703
|
await this.close();
|
|
279491
279704
|
return new Response(null, { status: 200 });
|
|
279492
279705
|
}
|
|
@@ -279499,16 +279712,16 @@ data:
|
|
|
279499
279712
|
return void 0;
|
|
279500
279713
|
}
|
|
279501
279714
|
if (!this._initialized) {
|
|
279502
|
-
_optionalChain([this, 'access',
|
|
279715
|
+
_optionalChain([this, 'access', _1271 => _1271.onerror, 'optionalCall', _1272 => _1272(new Error("Bad Request: Server not initialized"))]);
|
|
279503
279716
|
return this.createJsonErrorResponse(400, -32e3, "Bad Request: Server not initialized");
|
|
279504
279717
|
}
|
|
279505
279718
|
const sessionId = req.headers.get("mcp-session-id");
|
|
279506
279719
|
if (!sessionId) {
|
|
279507
|
-
_optionalChain([this, 'access',
|
|
279720
|
+
_optionalChain([this, 'access', _1273 => _1273.onerror, 'optionalCall', _1274 => _1274(new Error("Bad Request: Mcp-Session-Id header is required"))]);
|
|
279508
279721
|
return this.createJsonErrorResponse(400, -32e3, "Bad Request: Mcp-Session-Id header is required");
|
|
279509
279722
|
}
|
|
279510
279723
|
if (sessionId !== this.sessionId) {
|
|
279511
|
-
_optionalChain([this, 'access',
|
|
279724
|
+
_optionalChain([this, 'access', _1275 => _1275.onerror, 'optionalCall', _1276 => _1276(new Error("Session not found"))]);
|
|
279512
279725
|
return this.createJsonErrorResponse(404, -32001, "Session not found");
|
|
279513
279726
|
}
|
|
279514
279727
|
return void 0;
|
|
@@ -279529,7 +279742,7 @@ data:
|
|
|
279529
279742
|
validateProtocolVersion(req) {
|
|
279530
279743
|
const protocolVersion = req.headers.get("mcp-protocol-version");
|
|
279531
279744
|
if (protocolVersion !== null && !SUPPORTED_PROTOCOL_VERSIONS.includes(protocolVersion)) {
|
|
279532
|
-
_optionalChain([this, 'access',
|
|
279745
|
+
_optionalChain([this, 'access', _1277 => _1277.onerror, 'optionalCall', _1278 => _1278(new Error(`Bad Request: Unsupported protocol version: ${protocolVersion} (supported versions: ${SUPPORTED_PROTOCOL_VERSIONS.join(", ")})`))]);
|
|
279533
279746
|
return this.createJsonErrorResponse(400, -32e3, `Bad Request: Unsupported protocol version: ${protocolVersion} (supported versions: ${SUPPORTED_PROTOCOL_VERSIONS.join(", ")})`);
|
|
279534
279747
|
}
|
|
279535
279748
|
return void 0;
|
|
@@ -279540,7 +279753,7 @@ data:
|
|
|
279540
279753
|
});
|
|
279541
279754
|
this._streamMapping.clear();
|
|
279542
279755
|
this._requestResponseMap.clear();
|
|
279543
|
-
_optionalChain([this, 'access',
|
|
279756
|
+
_optionalChain([this, 'access', _1279 => _1279.onclose, 'optionalCall', _1280 => _1280()]);
|
|
279544
279757
|
}
|
|
279545
279758
|
/**
|
|
279546
279759
|
* Close an SSE stream for a specific request, triggering client reconnection.
|
|
@@ -279567,7 +279780,7 @@ data:
|
|
|
279567
279780
|
}
|
|
279568
279781
|
}
|
|
279569
279782
|
async send(message, options) {
|
|
279570
|
-
let requestId = _optionalChain([options, 'optionalAccess',
|
|
279783
|
+
let requestId = _optionalChain([options, 'optionalAccess', _1281 => _1281.relatedRequestId]);
|
|
279571
279784
|
if (isJSONRPCResultResponse(message) || isJSONRPCErrorResponse(message)) {
|
|
279572
279785
|
requestId = message.id;
|
|
279573
279786
|
}
|
|
@@ -279593,7 +279806,7 @@ data:
|
|
|
279593
279806
|
throw new Error(`No connection established for request ID: ${String(requestId)}`);
|
|
279594
279807
|
}
|
|
279595
279808
|
const stream4 = this._streamMapping.get(streamId);
|
|
279596
|
-
if (!this._enableJsonResponse && _optionalChain([stream4, 'optionalAccess',
|
|
279809
|
+
if (!this._enableJsonResponse && _optionalChain([stream4, 'optionalAccess', _1282 => _1282.controller]) && _optionalChain([stream4, 'optionalAccess', _1283 => _1283.encoder])) {
|
|
279597
279810
|
let eventId;
|
|
279598
279811
|
if (this._eventStore) {
|
|
279599
279812
|
eventId = await this._eventStore.storeEvent(streamId, message);
|
|
@@ -279641,8 +279854,8 @@ var StreamableHTTPServerTransport = class {
|
|
|
279641
279854
|
this._requestListener = getRequestListener(async (webRequest) => {
|
|
279642
279855
|
const context = this._requestContext.get(webRequest);
|
|
279643
279856
|
return this._webStandardTransport.handleRequest(webRequest, {
|
|
279644
|
-
authInfo: _optionalChain([context, 'optionalAccess',
|
|
279645
|
-
parsedBody: _optionalChain([context, 'optionalAccess',
|
|
279857
|
+
authInfo: _optionalChain([context, 'optionalAccess', _1284 => _1284.authInfo]),
|
|
279858
|
+
parsedBody: _optionalChain([context, 'optionalAccess', _1285 => _1285.parsedBody])
|
|
279646
279859
|
});
|
|
279647
279860
|
}, { overrideGlobalObjects: false });
|
|
279648
279861
|
}
|
|
@@ -281321,7 +281534,7 @@ async function importServiceFromFile(serviceId, file2, options = {
|
|
|
281321
281534
|
);
|
|
281322
281535
|
const data2 = fs52.default.readFileSync(filePath, "utf8");
|
|
281323
281536
|
const importData = JSON.parse(data2);
|
|
281324
|
-
if (_optionalChain([importData, 'optionalAccess',
|
|
281537
|
+
if (_optionalChain([importData, 'optionalAccess', _1286 => _1286.service, 'access', _1287 => _1287[serviceId]])) {
|
|
281325
281538
|
await importService2(serviceId, importData, options);
|
|
281326
281539
|
stopProgressIndicator2(
|
|
281327
281540
|
indicatorId,
|
|
@@ -282603,7 +282816,7 @@ async function listRealms(long = false) {
|
|
|
282603
282816
|
} catch (error49) {
|
|
282604
282817
|
printMessage2(error49, "error");
|
|
282605
282818
|
printMessage2(`Error listing realms: ${error49.message}`, "error");
|
|
282606
|
-
printMessage2(_optionalChain([error49, 'access',
|
|
282819
|
+
printMessage2(_optionalChain([error49, 'access', _1288 => _1288.response, 'optionalAccess', _1289 => _1289.data]), "error");
|
|
282607
282820
|
}
|
|
282608
282821
|
}
|
|
282609
282822
|
async function exportRealmById(realmId, file2, includeMeta = true) {
|
|
@@ -286824,7 +287037,7 @@ function createFrodoCompleter(rootBindings, docsByMethod, onMethodHint) {
|
|
|
286824
287037
|
const tokenMatch = line.match(
|
|
286825
287038
|
/([A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)*\.?)$/
|
|
286826
287039
|
);
|
|
286827
|
-
const token2 = _nullishCoalesce(_optionalChain([tokenMatch, 'optionalAccess',
|
|
287040
|
+
const token2 = _nullishCoalesce(_optionalChain([tokenMatch, 'optionalAccess', _1290 => _1290[1]]), () => ( ""));
|
|
286828
287041
|
if (!token2) return [[], line];
|
|
286829
287042
|
const rootCandidates = Object.keys(rootBindings).filter(
|
|
286830
287043
|
(rootName2) => rootName2.startsWith(token2)
|
|
@@ -286880,7 +287093,7 @@ function buildDocsByMethod(frodoInstance) {
|
|
|
286880
287093
|
function registerOpenParenHint(replServer, rootBindings, docsByMethod, onHint) {
|
|
286881
287094
|
process.stdin.on("keypress", (_char, key) => {
|
|
286882
287095
|
const char = typeof _char === "string" ? _char : "";
|
|
286883
|
-
const sequence = _nullishCoalesce(_optionalChain([key, 'optionalAccess',
|
|
287096
|
+
const sequence = _nullishCoalesce(_optionalChain([key, 'optionalAccess', _1291 => _1291.sequence]), () => ( ""));
|
|
286884
287097
|
if (sequence !== "(" && char !== "(") return;
|
|
286885
287098
|
const currentLine = _nullishCoalesce(replServer["line"], () => ( ""));
|
|
286886
287099
|
const match2 = currentLine.match(
|
|
@@ -287033,7 +287246,7 @@ function createHelpContext(frodoInstance) {
|
|
|
287033
287246
|
console.log(`${BOLD}Factory helpers:${RESET2}`);
|
|
287034
287247
|
for (const fn of sortedFns) {
|
|
287035
287248
|
const docs = idx.get(fn);
|
|
287036
|
-
const sigHint = _optionalChain([docs, 'optionalAccess',
|
|
287249
|
+
const sigHint = _optionalChain([docs, 'optionalAccess', _1292 => _1292.length]) ? ` ${DIM2}${docs[0].signature}${RESET2}` : "";
|
|
287037
287250
|
console.log(` frodo.${GREEN}${fn}${RESET2}${sigHint}`);
|
|
287038
287251
|
}
|
|
287039
287252
|
}
|
|
@@ -287088,7 +287301,7 @@ function createHelpContext(frodoInstance) {
|
|
|
287088
287301
|
const sortedSubMods = [...subMods].sort(alphaSort);
|
|
287089
287302
|
const methodCount = sortedMethods.length;
|
|
287090
287303
|
const subModuleCount = sortedSubMods.length;
|
|
287091
|
-
const moduleType = _optionalChain([findModulePath, 'call',
|
|
287304
|
+
const moduleType = _optionalChain([findModulePath, 'call', _1293 => _1293(frodoInstance, target), 'optionalAccess', _1294 => _1294.replace, 'call', _1295 => _1295(
|
|
287092
287305
|
/^frodo\./,
|
|
287093
287306
|
""
|
|
287094
287307
|
)]) || "Module";
|
|
@@ -287154,7 +287367,7 @@ function createHelpContext(frodoInstance) {
|
|
|
287154
287367
|
console.log("");
|
|
287155
287368
|
for (const methodName of sortedMethods) {
|
|
287156
287369
|
const docs = idx.get(methodName);
|
|
287157
|
-
const doc = _nullishCoalesce(_optionalChain([docs, 'optionalAccess',
|
|
287370
|
+
const doc = _nullishCoalesce(_optionalChain([docs, 'optionalAccess', _1296 => _1296.find, 'call', _1297 => _1297((d4) => d4.typeName === bestType)]), () => ( _optionalChain([docs, 'optionalAccess', _1298 => _1298[0]])));
|
|
287158
287371
|
if (doc) {
|
|
287159
287372
|
const sig = doc.signature.length > 100 ? doc.signature.slice(0, 97) + "..." : doc.signature;
|
|
287160
287373
|
console.log(` ${YELLOW}${sig}${RESET2}`);
|
|
@@ -287406,7 +287619,7 @@ async function startRepl(allowAwait = false, host) {
|
|
|
287406
287619
|
console.log(`${BOLD2}Shell dot-commands:${RESET3}`);
|
|
287407
287620
|
const commands = replServer.commands;
|
|
287408
287621
|
for (const name of Object.keys(commands).sort()) {
|
|
287409
|
-
const helpText = _nullishCoalesce(_optionalChain([commands, 'access',
|
|
287622
|
+
const helpText = _nullishCoalesce(_optionalChain([commands, 'access', _1299 => _1299[name], 'optionalAccess', _1300 => _1300.help]), () => ( ""));
|
|
287410
287623
|
console.log(` ${GREEN2}.${name}${RESET3} ${DIM3}${helpText}${RESET3}`);
|
|
287411
287624
|
}
|
|
287412
287625
|
this.displayPrompt();
|
|
@@ -287416,7 +287629,7 @@ async function startRepl(allowAwait = false, host) {
|
|
|
287416
287629
|
process.stdin.on("keypress", (_char, key) => {
|
|
287417
287630
|
const rl = replServer;
|
|
287418
287631
|
const currentHistIdx = _nullishCoalesce(rl["_historyIndex"], () => ( -1));
|
|
287419
|
-
if (_optionalChain([key, 'optionalAccess',
|
|
287632
|
+
if (_optionalChain([key, 'optionalAccess', _1301 => _1301.name]) === "down" && !historyNavigationActive && currentHistIdx === -1) {
|
|
287420
287633
|
const currentLine = _nullishCoalesce(replServer.line, () => ( ""));
|
|
287421
287634
|
if (currentLine.trim().length > 0) {
|
|
287422
287635
|
const replHistory = _nullishCoalesce(rl["history"], () => ( []));
|
|
@@ -287428,15 +287641,15 @@ async function startRepl(allowAwait = false, host) {
|
|
|
287428
287641
|
replServer.write(null, { ctrl: true, name: "u" });
|
|
287429
287642
|
}
|
|
287430
287643
|
}
|
|
287431
|
-
if (_optionalChain([key, 'optionalAccess',
|
|
287644
|
+
if (_optionalChain([key, 'optionalAccess', _1302 => _1302.name]) === "up" || _optionalChain([key, 'optionalAccess', _1303 => _1303.name]) === "down") {
|
|
287432
287645
|
historyNavigationActive = true;
|
|
287433
287646
|
return;
|
|
287434
287647
|
}
|
|
287435
|
-
if (_optionalChain([key, 'optionalAccess',
|
|
287648
|
+
if (_optionalChain([key, 'optionalAccess', _1304 => _1304.name]) === "return" || _optionalChain([key, 'optionalAccess', _1305 => _1305.name]) === "enter") {
|
|
287436
287649
|
historyNavigationActive = false;
|
|
287437
287650
|
return;
|
|
287438
287651
|
}
|
|
287439
|
-
if (_optionalChain([key, 'optionalAccess',
|
|
287652
|
+
if (_optionalChain([key, 'optionalAccess', _1306 => _1306.ctrl]) || _optionalChain([key, 'optionalAccess', _1307 => _1307.meta]) || typeof _optionalChain([key, 'optionalAccess', _1308 => _1308.name]) === "string") {
|
|
287440
287653
|
historyNavigationActive = false;
|
|
287441
287654
|
}
|
|
287442
287655
|
});
|
|
@@ -287858,7 +288071,7 @@ var compareVersions = (v12, v2) => {
|
|
|
287858
288071
|
// package.json
|
|
287859
288072
|
var package_default2 = {
|
|
287860
288073
|
name: "@rockcarver/frodo-cli",
|
|
287861
|
-
version: "4.0.0",
|
|
288074
|
+
version: "4.0.1-0",
|
|
287862
288075
|
type: "module",
|
|
287863
288076
|
description: "A command line interface to manage ForgeRock Identity Cloud tenants, ForgeOps deployments, and classic deployments.",
|
|
287864
288077
|
keywords: [
|
|
@@ -287962,7 +288175,7 @@ var package_default2 = {
|
|
|
287962
288175
|
},
|
|
287963
288176
|
devDependencies: {
|
|
287964
288177
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
287965
|
-
"@rockcarver/frodo-lib": "4.0.
|
|
288178
|
+
"@rockcarver/frodo-lib": "4.0.1-6",
|
|
287966
288179
|
"@types/colors": "^1.2.1",
|
|
287967
288180
|
"@types/fs-extra": "^11.0.1",
|
|
287968
288181
|
"@types/jest": "^29.2.3",
|
|
@@ -288007,6 +288220,10 @@ var package_default2 = {
|
|
|
288007
288220
|
uuid: "^11.1.0",
|
|
288008
288221
|
yesno: "^0.4.0",
|
|
288009
288222
|
zod: "^4.3.6"
|
|
288223
|
+
},
|
|
288224
|
+
allowScripts: {
|
|
288225
|
+
"esbuild@0.27.2": true,
|
|
288226
|
+
"fsevents@2.3.3": true
|
|
288010
288227
|
}
|
|
288011
288228
|
};
|
|
288012
288229
|
|