doover-js 0.6.2 → 0.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -11,6 +11,12 @@ export interface ListMessagesParams {
|
|
|
11
11
|
* index 0.
|
|
12
12
|
*/
|
|
13
13
|
order?: "asc" | "desc";
|
|
14
|
+
/**
|
|
15
|
+
* Opt into paginated timeseries responses (`getTimeseries` only). When true
|
|
16
|
+
* the server returns a `next` cursor alongside `{ results, count }`; pass it
|
|
17
|
+
* back as `before` to page through results.
|
|
18
|
+
*/
|
|
19
|
+
paginate?: boolean;
|
|
14
20
|
}
|
|
15
21
|
export interface MessageMutationParams {
|
|
16
22
|
suppress_response?: boolean;
|
|
@@ -31,8 +31,10 @@ class RpcDispatcher {
|
|
|
31
31
|
const startedAt = this.stats?.recordRpcStart() ?? null;
|
|
32
32
|
this.messages
|
|
33
33
|
.postMessage(channel.agentId, channel.channelName, {
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
data: {
|
|
35
|
+
type: "rpc",
|
|
36
|
+
...request,
|
|
37
|
+
},
|
|
36
38
|
})
|
|
37
39
|
.then((message) => {
|
|
38
40
|
const pending = {
|
|
@@ -77,8 +77,9 @@ describe("MessagesApi overloads + defaults", () => {
|
|
|
77
77
|
const restB = makeRestStub();
|
|
78
78
|
const apiA = new messages_api_1.MessagesApi(restA);
|
|
79
79
|
const apiB = new messages_api_1.MessagesApi(restB);
|
|
80
|
-
|
|
81
|
-
await
|
|
80
|
+
const before = "185536526405337088";
|
|
81
|
+
await apiA.listMessages("a1", "c1", { limit: 5, order: "desc", before });
|
|
82
|
+
await apiB.listMessages({ agentId: "a1", channelName: "c1" }, { limit: 5, order: "desc", before });
|
|
82
83
|
(0, chai_1.expect)(restA.calls).to.deep.equal(restB.calls);
|
|
83
84
|
});
|
|
84
85
|
it("listMessages defaults limit to 10 when omitted", async () => {
|
|
@@ -120,6 +121,14 @@ describe("MessagesApi overloads + defaults", () => {
|
|
|
120
121
|
(0, chai_1.expect)(wireParams.order).to.equal(undefined);
|
|
121
122
|
(0, chai_1.expect)(wireParams.limit).to.equal(5);
|
|
122
123
|
});
|
|
124
|
+
it("getTimeseries forwards paginate to the server", async () => {
|
|
125
|
+
const rest = makeRestStub();
|
|
126
|
+
const api = new messages_api_1.MessagesApi(rest);
|
|
127
|
+
await api.getTimeseries("a1", "c1", { limit: 1500, paginate: true });
|
|
128
|
+
const wireParams = rest.calls[0].args[1];
|
|
129
|
+
(0, chai_1.expect)(wireParams.paginate).to.equal(true);
|
|
130
|
+
(0, chai_1.expect)(wireParams.limit).to.equal(1500);
|
|
131
|
+
});
|
|
123
132
|
});
|
|
124
133
|
const aggregates_api_1 = require("../apis/aggregates-api");
|
|
125
134
|
describe("AggregatesApi overloads", () => {
|
package/dist/types/common.d.ts
CHANGED