Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
eliangcs committed Feb 11, 2025
1 parent 66d7adc commit f62f128
Show file tree
Hide file tree
Showing 2 changed files with 148 additions and 27 deletions.
45 changes: 45 additions & 0 deletions packages/cli/src/oclif/commands/invoke.js
Original file line number Diff line number Diff line change
Expand Up @@ -663,10 +663,13 @@ class InvokeCommand extends BaseCommand {
field,
appDefinition,
inputData,
authId,
authData,
timezone,
zcacheTestObj,
cursorTestObj,
appId,
deployKey,
) {
const message = formatFieldDisplay(field) + ':';
if (field.dynamic) {
Expand All @@ -686,11 +689,14 @@ class InvokeCommand extends BaseCommand {
'triggers',
trigger,
inputData,
authId,
authData,
meta,
timezone,
zcacheTestObj,
cursorTestObj,
appId,
deployKey,
);
return this.promptWithList(
message,
Expand All @@ -716,11 +722,14 @@ class InvokeCommand extends BaseCommand {
inputData,
inputFields,
appDefinition,
authId,
authData,
meta,
timezone,
zcacheTestObj,
cursorTestObj,
appId,
deployKey,
) {
const missingFields = getMissingRequiredInputFields(inputData, inputFields);
if (missingFields.length) {
Expand All @@ -735,10 +744,13 @@ class InvokeCommand extends BaseCommand {
f,
appDefinition,
inputData,
authId,
authData,
timezone,
zcacheTestObj,
cursorTestObj,
appId,
deployKey,
);
}
}
Expand All @@ -748,10 +760,13 @@ class InvokeCommand extends BaseCommand {
inputData,
inputFields,
appDefinition,
authId,
authData,
timezone,
zcacheTestObj,
cursorTestObj,
appId,
deployKey,
) {
inputFields = inputFields.filter((f) => f.key);
if (!inputFields.length) {
Expand Down Expand Up @@ -799,10 +814,13 @@ class InvokeCommand extends BaseCommand {
field,
appDefinition,
inputData,
authId,
authData,
timezone,
zcacheTestObj,
cursorTestObj,
appId,
deployKey,
);
}
}
Expand All @@ -811,31 +829,40 @@ class InvokeCommand extends BaseCommand {
inputData,
inputFields,
appDefinition,
authId,
authData,
meta,
timezone,
zcacheTestObj,
cursorTestObj,
appId,
deployKey,
) {
await this.promptOrErrorForRequiredInputFields(
inputData,
inputFields,
appDefinition,
authId,
authData,
meta,
timezone,
zcacheTestObj,
cursorTestObj,
appId,
deployKey,
);
if (!this.nonInteractive && !meta.isFillingDynamicDropdown) {
await this.promptForInputFieldEdit(
inputData,
inputFields,
appDefinition,
authId,
authData,
timezone,
zcacheTestObj,
cursorTestObj,
appId,
deployKey,
);
}
}
Expand All @@ -845,11 +872,14 @@ class InvokeCommand extends BaseCommand {
actionTypePlural,
action,
inputData,
authId,
authData,
meta,
timezone,
zcacheTestObj,
cursorTestObj,
appId,
deployKey,
) {
// Do these in order:
// 1. Prompt for static input fields that alter dynamic fields
Expand All @@ -866,11 +896,14 @@ class InvokeCommand extends BaseCommand {
inputData,
staticInputFields,
appDefinition,
authId,
authData,
meta,
timezone,
zcacheTestObj,
cursorTestObj,
appId,
deployKey,
);

let methodName = `${actionTypePlural}.${action.key}.operation.inputFields`;
Expand All @@ -888,6 +921,9 @@ class InvokeCommand extends BaseCommand {
cursorTestObj,
customLogger,
calledFromCliInvoke: true,
appId,
deployKey,
relayAuthenticationId: authId,
});
endSpinner();

Expand All @@ -898,11 +934,14 @@ class InvokeCommand extends BaseCommand {
inputData,
inputFields,
appDefinition,
authId,
authData,
meta,
timezone,
zcacheTestObj,
cursorTestObj,
appId,
deployKey,
);
}

Expand All @@ -922,6 +961,9 @@ class InvokeCommand extends BaseCommand {
cursorTestObj,
customLogger,
calledFromCliInvoke: true,
appId,
deployKey,
relayAuthenticationId: authId,
});
endSpinner();

Expand Down Expand Up @@ -1180,11 +1222,14 @@ class InvokeCommand extends BaseCommand {
actionTypePlural,
action,
inputData,
authId,
authData,
meta,
timezone,
zcacheTestObj,
cursorTestObj,
appId,
deployKey,
);
console.log(JSON.stringify(output, null, 2));
}
Expand Down
Loading

0 comments on commit f62f128

Please sign in to comment.