@my-life-buddies/cli 0.19.0 → 0.21.0
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 +32 -16
- package/dist/bin/buddy.js +11 -9
- package/dist/bin/buddy.js.map +2 -2
- package/dist/bin/core.js +412 -234
- package/dist/bin/core.js.map +4 -4
- package/dist/bin/preview.js +5 -5
- package/dist/bin/preview.js.map +2 -2
- package/package.json +3 -3
package/dist/bin/preview.js
CHANGED
|
@@ -1989,7 +1989,7 @@ async function connectPreviewBridge(options) {
|
|
|
1989
1989
|
let interrupted = false;
|
|
1990
1990
|
let disconnecting = false;
|
|
1991
1991
|
async function call(path, token, payload, requestSignal = signal) {
|
|
1992
|
-
const response = await fetch(new URL(path, options.
|
|
1992
|
+
const response = await fetch(new URL(path, options.platformOrigin), {
|
|
1993
1993
|
method: "POST",
|
|
1994
1994
|
redirect: "error",
|
|
1995
1995
|
signal: AbortSignal.any([requestSignal, AbortSignal.timeout(4e3)]),
|
|
@@ -2001,7 +2001,7 @@ async function connectPreviewBridge(options) {
|
|
|
2001
2001
|
return value;
|
|
2002
2002
|
}
|
|
2003
2003
|
const attach = async () => {
|
|
2004
|
-
const result = await call("
|
|
2004
|
+
const result = await call("/cli/preview/connect", await options.token(), {
|
|
2005
2005
|
connectionId,
|
|
2006
2006
|
forceDisconnect: true,
|
|
2007
2007
|
buddyId: options.buddyId,
|
|
@@ -2028,7 +2028,7 @@ async function connectPreviewBridge(options) {
|
|
|
2028
2028
|
while (!signal.aborted && pendingEvents.size) {
|
|
2029
2029
|
const events = [...pendingEvents.values()].sort((a, b) => a.sequence - b.sequence);
|
|
2030
2030
|
try {
|
|
2031
|
-
await call("
|
|
2031
|
+
await call("/cli/preview/events", connectionId, { events });
|
|
2032
2032
|
for (const event of events) if (pendingEvents.get(event.type) === event) pendingEvents.delete(event.type);
|
|
2033
2033
|
} catch {
|
|
2034
2034
|
if (!signal.aborted) retryEvents = setTimeout(() => {
|
|
@@ -2108,7 +2108,7 @@ async function connectPreviewBridge(options) {
|
|
|
2108
2108
|
await stopping;
|
|
2109
2109
|
stopping = void 0;
|
|
2110
2110
|
}
|
|
2111
|
-
const result = await call("
|
|
2111
|
+
const result = await call("/cli/preview/poll", connectionId, { replies: [...replies.values()].slice(0, 1) });
|
|
2112
2112
|
lastContact = Date.now();
|
|
2113
2113
|
const recovered = interrupted;
|
|
2114
2114
|
if (stopping) {
|
|
@@ -2160,7 +2160,7 @@ async function connectPreviewBridge(options) {
|
|
|
2160
2160
|
await Promise.allSettled(running.values());
|
|
2161
2161
|
await stopping;
|
|
2162
2162
|
await options.controller.stop();
|
|
2163
|
-
await call("
|
|
2163
|
+
await call("/cli/preview/disconnect", connectionId, {}, AbortSignal.timeout(2e3)).catch(() => void 0);
|
|
2164
2164
|
}
|
|
2165
2165
|
};
|
|
2166
2166
|
}
|