MCPcopy Create free account
hub / github.com/callstack/agent-device / resolvePushInput

Function resolvePushInput

src/commands/management/runtime/apps.ts:285–313  ·  view source on GitHub ↗
(
  runtime: AgentDeviceRuntime,
  input: AppPushInput | undefined,
)

Source from the content-addressed store, hash-verified

283}
284
285async function resolvePushInput(
286 runtime: AgentDeviceRuntime,
287 input: AppPushInput | undefined,
288): Promise<{
289 backendInput: BackendPushInput;
290 inputKind: 'json' | 'file';
291 cleanup?: () => Promise<void>;
292}> {
293 if (!input || typeof input !== 'object') {
294 throw new AppError('INVALID_ARGS', 'apps.push requires an input');
295 }
296 if (input.kind === 'json') {
297 validateJsonObjectPayload(input.payload, 'apps.push JSON payload', MAX_APP_PUSH_PAYLOAD_BYTES);
298 return {
299 backendInput: { kind: 'json', payload: input.payload },
300 inputKind: 'json',
301 };
302 }
303
304 const resolved = await resolveCommandInput(runtime, input, {
305 usage: 'apps.push',
306 field: 'input',
307 });
308 return {
309 backendInput: { kind: 'file', path: resolved.path },
310 inputKind: 'file',
311 ...(resolved.cleanup ? { cleanup: resolved.cleanup } : {}),
312 };
313}
314
315function requireAppEventName(name: string): string {
316 const normalized = requireText(name, 'name');

Callers 1

pushAppCommandFunction · 0.85

Calls 2

resolveCommandInputFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…