All files / core/blong-realm/adapter/semlog blongFlowGetRequestSend.ts

100% Statements 20/20
100% Branches 2/2
100% Functions 1/1
100% Lines 20/20

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 211x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 4x 1x 1x 1x 1x 1x 1x 1x  
import {handler} from '@feasibleone/blong';
 
/**
 * The request the port makes for `blong.flow.get`: one execution's diagram, or one
 * kind's.
 *
 * The reference is a path segment, so it is encoded rather than concatenated: an
 * identifier the caller composed is caller-supplied text like any other. See
 * `blongFlowFindRequestSend.ts` for why this is a conversion and not a handler.
 */
export default handler(
    () =>
        function blongFlowGetRequestSend(params: {reference: string}) {
            return {
                method: 'GET',
                path: `/flows/${encodeURIComponent(params.reference)}/diagram`,
                responseType: 'json',
            };
        },
);