@privateaim/messenger-http-kit
v0.14.0
Published
<p align="center"> <a href="https://github.com/PrivateAIM/hub" target="_blank" rel="noopener noreferrer"> <img src="https://raw.githubusercontent.com/PrivateAIM/hub/master/.github/assets/logo.svg" alt="FLAME Hub" height="90"> </a> </p>
Readme
Part of the FLAME Hub monorepo — central services for the PrivateAIM platform.
Built on Hapic, this client wraps the broker REST API (send / pull / ack) using the contract types from @privateaim/messenger-kit. The FLAME node broker consumes this client to talk to the Hub.
Installation
npm install @privateaim/messenger-http-kitTesting
The Client class implements IMessengerClient, so consumers can depend on the
contract rather than the class. @privateaim/messenger-http-kit/testing ships a
FakeClient — a real Client on an in-memory transport, so the request pipeline
(header merge, decode, hooks, retry) runs unchanged and no network is touched:
import { createFakeClient } from '@privateaim/messenger-http-kit/testing';
const client = createFakeClient({
handlers: {
'GET /messages': () => ({ messages: [{ id: 'm1' }] }),
},
});
const { messages } = await client.message.pull();
// Every dispatched request is recorded, normalized.
console.log(client.requests);License
Made with 💚
Published under Apache 2.0.
