MCPcopy Create free account
hub / github.com/zenstackhq/zenstack / proceed

Function proceed

packages/orm/src/client/client-impl.ts:622–648  ·  view source on GitHub ↗
(_args: unknown)

Source from the content-addressed store, hash-verified

620 ) => {
621 return createZenStackPromise(async (txClient?: ClientContract<any>) => {
622 let proceed = async (_args: unknown) => {
623 // prepare args for ext result: strip ext result field names from select/omit,
624 // inject needs fields into select (recursively handles nested relations)
625 const shouldApplyExtResult = hasAnyExtResult && EXT_RESULT_OPERATIONS.has(operation);
626 const processedArgs = shouldApplyExtResult
627 ? prepareArgsForExtResult(_args, model, schema, plugins)
628 : _args;
629
630 const _handler = txClient ? handler.withClient(txClient) : handler;
631 const r = await _handler.handle(operation, processedArgs);
632 if (!r && throwIfNoResult) {
633 throw createNotFoundError(model);
634 }
635 let result: unknown;
636 if (r && postProcess) {
637 result = resultProcessor.processResult(r, model, processedArgs);
638 } else {
639 result = r ?? null;
640 }
641
642 // compute ext result fields (recursively handles nested relations)
643 if (result && shouldApplyExtResult) {
644 result = applyExtResult(result, model, _args, schema, plugins);
645 }
646
647 return result;
648 };
649
650 // apply plugins
651 const plugins = [...(client.$options.plugins ?? [])];

Callers 15

handleMethod · 0.85
preUpdateCheckMethod · 0.85
postUpdateCheckMethod · 0.85
processReadBackMethod · 0.85
handleMethod · 0.85
invokeWithClientMethod · 0.85
createPromiseFunction · 0.85
mainFunction · 0.85

Calls 5

createNotFoundErrorFunction · 0.90
prepareArgsForExtResultFunction · 0.85
applyExtResultFunction · 0.85
processResultMethod · 0.80
handleMethod · 0.45

Tested by 1

onKyselyQueryFunction · 0.68