A builder to allow defining rules that will mock IPFS pin ls requests.

Hierarchy

  • PinLsRuleBuilder

Constructors

  • This builder should not be constructed directly. Call mockNode.forPinLs() instead.

    Parameters

    • addRuleCallback: ((data: RequestRuleData) => Promise<void>)
        • (data: RequestRuleData): Promise<void>
        • Parameters

          • data: RequestRuleData

          Returns Promise<void>

    Returns PinLsRuleBuilder

Methods

  • Close the connection immediately after receiving the matching request, without sending any response.

    This method completes the rule definition, and returns a promise that resolves once the rule is active.

    Returns Promise<void>

  • Return a successful result, returning the given fixed list of pinned content. The parameter should be an array of { type, cid } objects, where type is the pin type (direct, recursive, indirect, or all), and cid is the CID of the pinned content.

    When this matches a request that specifies a filter (e.g. ?type=direct) only the values with the matching type will be returned.

    This method completes the rule definition, and returns a promise that resolves once the rule is active.

    Parameters

    • values: {
          cid: string;
          type: string;
      }[]

    Returns Promise<void>

  • Timeout, accepting the request but never returning a response.

    This method completes the rule definition, and returns a promise that resolves once the rule is active.

    Returns Promise<void>

Generated using TypeDoc