All files / core/blong-realm/gateway/blong blongDigestGet.ts

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

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 21 22 23 24 251x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 4x 4x 4x 4x 4x 4x 4x 4x 4x 1x  
import {validation} from '@feasibleone/blong';
 
/**
 * `blong.digest.get` — what changed since a point in time.
 *
 * Declared in the `gateway` layer because that is what puts the method on the
 * RPC route (see `blongFlowFind.ts`).
 *
 * NOTE: the digest page asks the portal for the permission `blong.digest.find`,
 * while the call this route declares is `blong.digest.get`. The two names must
 * agree for RBAC to gate what the page actually calls.
 */
export default validation(
    async ({lib: {type}}) =>
        function blongDigestGet() {
            return {
                params: type.Object({
                    since: type.Optional(type.String()),
                    limit: type.Optional(type.Number()),
                }),
                result: type.Unknown(),
            };
        },
);