@byok-sdk/cloud 0.4.0 → 0.4.1
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.
- package/README.md +1 -1
- package/dist/index.js +11 -2
- package/dist/index.js.map +1 -1
- package/package.json +9 -9
package/README.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -675,6 +675,7 @@ function tokenHandler(deps) {
|
|
|
675
675
|
return c.json(response, 200);
|
|
676
676
|
};
|
|
677
677
|
}
|
|
678
|
+
var CLOUD_PROTOCOL_CAPABILITIES = ["result-document"];
|
|
678
679
|
function sleep(ms) {
|
|
679
680
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
680
681
|
}
|
|
@@ -703,12 +704,20 @@ function eventsHandler(deps) {
|
|
|
703
704
|
});
|
|
704
705
|
if (page.messages.length > 0) {
|
|
705
706
|
const events = page.messages.map((message) => decodeEnvelope(message.body));
|
|
706
|
-
const response2 = {
|
|
707
|
+
const response2 = {
|
|
708
|
+
events,
|
|
709
|
+
cursor: page.nextSeq,
|
|
710
|
+
capabilities: CLOUD_PROTOCOL_CAPABILITIES
|
|
711
|
+
};
|
|
707
712
|
return c.json(response2, 200);
|
|
708
713
|
}
|
|
709
714
|
if (attempt < attempts - 1) await sleep(deps.longPollIntervalMs);
|
|
710
715
|
}
|
|
711
|
-
const response = {
|
|
716
|
+
const response = {
|
|
717
|
+
events: [],
|
|
718
|
+
cursor,
|
|
719
|
+
capabilities: CLOUD_PROTOCOL_CAPABILITIES
|
|
720
|
+
};
|
|
712
721
|
return c.json(response, 200);
|
|
713
722
|
};
|
|
714
723
|
}
|