@snowcone-app/sdk 0.24.4 → 0.25.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/CHANGELOG.md +6 -0
- package/dist/{chunk-FQC2FPV7.js → chunk-P3ZDE6LZ.js} +23 -0
- package/dist/index.cjs +23 -0
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/react.cjs +32 -1
- package/dist/react.d.cts +3 -1
- package/dist/react.d.ts +3 -1
- package/dist/react.js +10 -2
- package/dist/{websocket-BYnhkMSH.d.cts → websocket-Cy0Y29CW.d.cts} +23 -0
- package/dist/{websocket-BYnhkMSH.d.ts → websocket-Cy0Y29CW.d.ts} +23 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.25.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#4344](https://github.com/snowcone-app/snowcone-monorepo/pull/4344) [`379a042`](https://github.com/snowcone-app/snowcone-monorepo/commit/379a042eb69a26f98fe0050f694c4ccf342e55b8) Thanks [@kevinsproles](https://github.com/kevinsproles)! - Per-placement render versions and an explicit re-render. SDK: `MockupResult.versions` (every placement folded into a frame, from boxes that stamp it), `getLatestSentVersions()`, and `rerender(mockupIds)` (answered by `rerender_queued`; refusals are typed `E_RERENDER_*` errors). UI: a picture's `data-render-state` is `current` only when every placement is at its latest sent version, and a picture whose cropped frame failed is re-rendered with `rerender` once the box stamps versions (falling back to forcing it with configs on an `E_RERENDER_*` refusal or an older box).
|
|
8
|
+
|
|
3
9
|
## 0.24.4
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -262,6 +262,9 @@ var RealtimeMockupService = class {
|
|
|
262
262
|
case "have_all_blobs":
|
|
263
263
|
this.addLog("\u{1F389} All blobs received! Starting render...");
|
|
264
264
|
break;
|
|
265
|
+
case "rerender_queued":
|
|
266
|
+
this.addLog(`\u{1F501} Re-render queued for [${(data.mockupIds ?? []).join(", ")}]`, "received");
|
|
267
|
+
break;
|
|
265
268
|
case "rendering_started":
|
|
266
269
|
this.addLog("\u{1F3A8} Mockup rendering has started...");
|
|
267
270
|
break;
|
|
@@ -290,6 +293,7 @@ var RealtimeMockupService = class {
|
|
|
290
293
|
requestId: data.requestId,
|
|
291
294
|
requestVersion: responseVersion,
|
|
292
295
|
placement: responsePlacement,
|
|
296
|
+
...data.versions && typeof data.versions === "object" ? { versions: data.versions } : {},
|
|
293
297
|
renderMs: data.renderMs,
|
|
294
298
|
blobToRenderMs: data.blobToRenderMs,
|
|
295
299
|
costUsd: data.costUsd,
|
|
@@ -761,6 +765,25 @@ ${versionToSend}
|
|
|
761
765
|
* send a frame belongs to — the pipeline-depth send policy counts a send
|
|
762
766
|
* as landed when every mockup of its version has arrived.
|
|
763
767
|
*/
|
|
768
|
+
/** The latest canvas version sent per placement (copy). */
|
|
769
|
+
getLatestSentVersions() {
|
|
770
|
+
return { ...this.latestSentVersionByPlacement };
|
|
771
|
+
}
|
|
772
|
+
/**
|
|
773
|
+
* Re-render these mockups now from the session's current state (servers with
|
|
774
|
+
* the `rerender` message). Answered by `rerender_queued` and then one
|
|
775
|
+
* mockup_rendered per mockup; refusals arrive as typed errors
|
|
776
|
+
* (E_RERENDER_NOT_CONFIGURED | E_RERENDER_BAD_REQUEST | E_RERENDER_UNKNOWN_MOCKUP |
|
|
777
|
+
* E_RERENDER_INCOMPLETE | E_RERENDER_RATE_LIMITED). Never changes the
|
|
778
|
+
* session's mockupIds.
|
|
779
|
+
*/
|
|
780
|
+
rerender(mockupIds) {
|
|
781
|
+
if (!this.ws || this.ws.readyState !== WebSocket.OPEN || !this.config || mockupIds.length === 0) return false;
|
|
782
|
+
const { requestId, traceparent } = newRenderCorrelation();
|
|
783
|
+
this.ws.send(JSON.stringify({ type: "rerender", mockupIds, requestId, traceparent }));
|
|
784
|
+
this.addLog(`\u{1F501} Re-render requested for [${mockupIds.join(", ")}] (req ${requestId})`, "sent");
|
|
785
|
+
return true;
|
|
786
|
+
}
|
|
764
787
|
getLastSentVersion() {
|
|
765
788
|
return this.lastSentVersion;
|
|
766
789
|
}
|
package/dist/index.cjs
CHANGED
|
@@ -5292,6 +5292,9 @@ var RealtimeMockupService = class {
|
|
|
5292
5292
|
case "have_all_blobs":
|
|
5293
5293
|
this.addLog("\u{1F389} All blobs received! Starting render...");
|
|
5294
5294
|
break;
|
|
5295
|
+
case "rerender_queued":
|
|
5296
|
+
this.addLog(`\u{1F501} Re-render queued for [${(data.mockupIds ?? []).join(", ")}]`, "received");
|
|
5297
|
+
break;
|
|
5295
5298
|
case "rendering_started":
|
|
5296
5299
|
this.addLog("\u{1F3A8} Mockup rendering has started...");
|
|
5297
5300
|
break;
|
|
@@ -5320,6 +5323,7 @@ var RealtimeMockupService = class {
|
|
|
5320
5323
|
requestId: data.requestId,
|
|
5321
5324
|
requestVersion: responseVersion,
|
|
5322
5325
|
placement: responsePlacement,
|
|
5326
|
+
...data.versions && typeof data.versions === "object" ? { versions: data.versions } : {},
|
|
5323
5327
|
renderMs: data.renderMs,
|
|
5324
5328
|
blobToRenderMs: data.blobToRenderMs,
|
|
5325
5329
|
costUsd: data.costUsd,
|
|
@@ -5791,6 +5795,25 @@ ${versionToSend}
|
|
|
5791
5795
|
* send a frame belongs to — the pipeline-depth send policy counts a send
|
|
5792
5796
|
* as landed when every mockup of its version has arrived.
|
|
5793
5797
|
*/
|
|
5798
|
+
/** The latest canvas version sent per placement (copy). */
|
|
5799
|
+
getLatestSentVersions() {
|
|
5800
|
+
return { ...this.latestSentVersionByPlacement };
|
|
5801
|
+
}
|
|
5802
|
+
/**
|
|
5803
|
+
* Re-render these mockups now from the session's current state (servers with
|
|
5804
|
+
* the `rerender` message). Answered by `rerender_queued` and then one
|
|
5805
|
+
* mockup_rendered per mockup; refusals arrive as typed errors
|
|
5806
|
+
* (E_RERENDER_NOT_CONFIGURED | E_RERENDER_BAD_REQUEST | E_RERENDER_UNKNOWN_MOCKUP |
|
|
5807
|
+
* E_RERENDER_INCOMPLETE | E_RERENDER_RATE_LIMITED). Never changes the
|
|
5808
|
+
* session's mockupIds.
|
|
5809
|
+
*/
|
|
5810
|
+
rerender(mockupIds) {
|
|
5811
|
+
if (!this.ws || this.ws.readyState !== WebSocket.OPEN || !this.config || mockupIds.length === 0) return false;
|
|
5812
|
+
const { requestId, traceparent } = newRenderCorrelation();
|
|
5813
|
+
this.ws.send(JSON.stringify({ type: "rerender", mockupIds, requestId, traceparent }));
|
|
5814
|
+
this.addLog(`\u{1F501} Re-render requested for [${mockupIds.join(", ")}] (req ${requestId})`, "sent");
|
|
5815
|
+
return true;
|
|
5816
|
+
}
|
|
5794
5817
|
getLastSentVersion() {
|
|
5795
5818
|
return this.lastSentVersion;
|
|
5796
5819
|
}
|
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { createDevFetcher } from './dev-fetcher.cjs';
|
|
2
2
|
import { PublicDesign, PublicFill, PublicOptions } from '@snowcone-app/mockup-url';
|
|
3
|
-
import { O as OptionAttribute, a as OptionSelection, C as Combination, F as FrameworkAdapter, b as ComponentProps, c as ComponentDescriptor, d as ComponentState, e as ComponentContext, f as ComponentLifecycleHooks, E as EventHandler, g as FrameworkUtilities, P as PlacementSettings, M as MockupResult, R as RealtimeRenderError, h as RealtimeMockupService } from './websocket-
|
|
4
|
-
export { A as AdapterRegistry, i as ProductComponentContext, j as RealtimeMockupCallbacks, k as RealtimeMockupState, l as RenderResult, W as WebSocketConfig, m as WebSocketMessage, n as adapterRegistry, o as computeDisabledChoices, p as createComponent, q as defineComponent, r as deriveDefaultSelection, s as findBestCombination, t as getPricePreview, u as isOptionAvailable, v as resolveBestCombination } from './websocket-
|
|
3
|
+
import { O as OptionAttribute, a as OptionSelection, C as Combination, F as FrameworkAdapter, b as ComponentProps, c as ComponentDescriptor, d as ComponentState, e as ComponentContext, f as ComponentLifecycleHooks, E as EventHandler, g as FrameworkUtilities, P as PlacementSettings, M as MockupResult, R as RealtimeRenderError, h as RealtimeMockupService } from './websocket-Cy0Y29CW.cjs';
|
|
4
|
+
export { A as AdapterRegistry, i as ProductComponentContext, j as RealtimeMockupCallbacks, k as RealtimeMockupState, l as RenderResult, W as WebSocketConfig, m as WebSocketMessage, n as adapterRegistry, o as computeDisabledChoices, p as createComponent, q as defineComponent, r as deriveDefaultSelection, s as findBestCombination, t as getPricePreview, u as isOptionAvailable, v as resolveBestCombination } from './websocket-Cy0Y29CW.cjs';
|
|
5
5
|
|
|
6
6
|
interface CatalogProduct {
|
|
7
7
|
id: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { createDevFetcher } from './dev-fetcher.js';
|
|
2
2
|
import { PublicDesign, PublicFill, PublicOptions } from '@snowcone-app/mockup-url';
|
|
3
|
-
import { O as OptionAttribute, a as OptionSelection, C as Combination, F as FrameworkAdapter, b as ComponentProps, c as ComponentDescriptor, d as ComponentState, e as ComponentContext, f as ComponentLifecycleHooks, E as EventHandler, g as FrameworkUtilities, P as PlacementSettings, M as MockupResult, R as RealtimeRenderError, h as RealtimeMockupService } from './websocket-
|
|
4
|
-
export { A as AdapterRegistry, i as ProductComponentContext, j as RealtimeMockupCallbacks, k as RealtimeMockupState, l as RenderResult, W as WebSocketConfig, m as WebSocketMessage, n as adapterRegistry, o as computeDisabledChoices, p as createComponent, q as defineComponent, r as deriveDefaultSelection, s as findBestCombination, t as getPricePreview, u as isOptionAvailable, v as resolveBestCombination } from './websocket-
|
|
3
|
+
import { O as OptionAttribute, a as OptionSelection, C as Combination, F as FrameworkAdapter, b as ComponentProps, c as ComponentDescriptor, d as ComponentState, e as ComponentContext, f as ComponentLifecycleHooks, E as EventHandler, g as FrameworkUtilities, P as PlacementSettings, M as MockupResult, R as RealtimeRenderError, h as RealtimeMockupService } from './websocket-Cy0Y29CW.js';
|
|
4
|
+
export { A as AdapterRegistry, i as ProductComponentContext, j as RealtimeMockupCallbacks, k as RealtimeMockupState, l as RenderResult, W as WebSocketConfig, m as WebSocketMessage, n as adapterRegistry, o as computeDisabledChoices, p as createComponent, q as defineComponent, r as deriveDefaultSelection, s as findBestCombination, t as getPricePreview, u as isOptionAvailable, v as resolveBestCombination } from './websocket-Cy0Y29CW.js';
|
|
5
5
|
|
|
6
6
|
interface CatalogProduct {
|
|
7
7
|
id: string;
|
package/dist/index.js
CHANGED
package/dist/react.cjs
CHANGED
|
@@ -296,6 +296,9 @@ var RealtimeMockupService = class {
|
|
|
296
296
|
case "have_all_blobs":
|
|
297
297
|
this.addLog("\u{1F389} All blobs received! Starting render...");
|
|
298
298
|
break;
|
|
299
|
+
case "rerender_queued":
|
|
300
|
+
this.addLog(`\u{1F501} Re-render queued for [${(data.mockupIds ?? []).join(", ")}]`, "received");
|
|
301
|
+
break;
|
|
299
302
|
case "rendering_started":
|
|
300
303
|
this.addLog("\u{1F3A8} Mockup rendering has started...");
|
|
301
304
|
break;
|
|
@@ -324,6 +327,7 @@ var RealtimeMockupService = class {
|
|
|
324
327
|
requestId: data.requestId,
|
|
325
328
|
requestVersion: responseVersion,
|
|
326
329
|
placement: responsePlacement,
|
|
330
|
+
...data.versions && typeof data.versions === "object" ? { versions: data.versions } : {},
|
|
327
331
|
renderMs: data.renderMs,
|
|
328
332
|
blobToRenderMs: data.blobToRenderMs,
|
|
329
333
|
costUsd: data.costUsd,
|
|
@@ -795,6 +799,25 @@ ${versionToSend}
|
|
|
795
799
|
* send a frame belongs to — the pipeline-depth send policy counts a send
|
|
796
800
|
* as landed when every mockup of its version has arrived.
|
|
797
801
|
*/
|
|
802
|
+
/** The latest canvas version sent per placement (copy). */
|
|
803
|
+
getLatestSentVersions() {
|
|
804
|
+
return { ...this.latestSentVersionByPlacement };
|
|
805
|
+
}
|
|
806
|
+
/**
|
|
807
|
+
* Re-render these mockups now from the session's current state (servers with
|
|
808
|
+
* the `rerender` message). Answered by `rerender_queued` and then one
|
|
809
|
+
* mockup_rendered per mockup; refusals arrive as typed errors
|
|
810
|
+
* (E_RERENDER_NOT_CONFIGURED | E_RERENDER_BAD_REQUEST | E_RERENDER_UNKNOWN_MOCKUP |
|
|
811
|
+
* E_RERENDER_INCOMPLETE | E_RERENDER_RATE_LIMITED). Never changes the
|
|
812
|
+
* session's mockupIds.
|
|
813
|
+
*/
|
|
814
|
+
rerender(mockupIds) {
|
|
815
|
+
if (!this.ws || this.ws.readyState !== WebSocket.OPEN || !this.config || mockupIds.length === 0) return false;
|
|
816
|
+
const { requestId, traceparent } = newRenderCorrelation();
|
|
817
|
+
this.ws.send(JSON.stringify({ type: "rerender", mockupIds, requestId, traceparent }));
|
|
818
|
+
this.addLog(`\u{1F501} Re-render requested for [${mockupIds.join(", ")}] (req ${requestId})`, "sent");
|
|
819
|
+
return true;
|
|
820
|
+
}
|
|
798
821
|
getLastSentVersion() {
|
|
799
822
|
return this.lastSentVersion;
|
|
800
823
|
}
|
|
@@ -1007,6 +1030,12 @@ function useRealtimeMockup(options = {}) {
|
|
|
1007
1030
|
const hasPendingBlobs = (0, import_react.useCallback)(() => {
|
|
1008
1031
|
return serviceRef.current?.hasPendingBlobs() || false;
|
|
1009
1032
|
}, []);
|
|
1033
|
+
const getLatestSentVersions = (0, import_react.useCallback)(() => {
|
|
1034
|
+
return serviceRef.current?.getLatestSentVersions() ?? {};
|
|
1035
|
+
}, []);
|
|
1036
|
+
const rerender = (0, import_react.useCallback)((mockupIds) => {
|
|
1037
|
+
return serviceRef.current?.rerender(mockupIds) ?? false;
|
|
1038
|
+
}, []);
|
|
1010
1039
|
const getLastSentVersion = (0, import_react.useCallback)(() => {
|
|
1011
1040
|
return serviceRef.current?.getLastSentVersion() ?? 0;
|
|
1012
1041
|
}, []);
|
|
@@ -1028,7 +1057,9 @@ function useRealtimeMockup(options = {}) {
|
|
|
1028
1057
|
clearMockups,
|
|
1029
1058
|
flushPendingBlobs,
|
|
1030
1059
|
hasPendingBlobs,
|
|
1031
|
-
getLastSentVersion
|
|
1060
|
+
getLastSentVersion,
|
|
1061
|
+
getLatestSentVersions,
|
|
1062
|
+
rerender
|
|
1032
1063
|
};
|
|
1033
1064
|
}
|
|
1034
1065
|
|
package/dist/react.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { M as MockupResult, R as RealtimeRenderError, W as WebSocketConfig, P as PlacementSettings, F as FrameworkAdapter, b as ComponentProps, d as ComponentState, e as ComponentContext, f as ComponentLifecycleHooks, E as EventHandler, c as ComponentDescriptor, g as FrameworkUtilities } from './websocket-
|
|
1
|
+
import { M as MockupResult, R as RealtimeRenderError, W as WebSocketConfig, P as PlacementSettings, F as FrameworkAdapter, b as ComponentProps, d as ComponentState, e as ComponentContext, f as ComponentLifecycleHooks, E as EventHandler, c as ComponentDescriptor, g as FrameworkUtilities } from './websocket-Cy0Y29CW.cjs';
|
|
2
2
|
import { CSSProperties, ReactNode } from 'react';
|
|
3
3
|
|
|
4
4
|
interface UseRealtimeMockupOptions {
|
|
@@ -54,6 +54,8 @@ declare function useRealtimeMockup(options?: UseRealtimeMockupOptions): {
|
|
|
54
54
|
flushPendingBlobs: () => void;
|
|
55
55
|
hasPendingBlobs: () => boolean;
|
|
56
56
|
getLastSentVersion: () => number;
|
|
57
|
+
getLatestSentVersions: () => Record<string, number>;
|
|
58
|
+
rerender: (mockupIds: string[]) => boolean;
|
|
57
59
|
isConnected: boolean;
|
|
58
60
|
sessionId: string | null;
|
|
59
61
|
box: string | null;
|
package/dist/react.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { M as MockupResult, R as RealtimeRenderError, W as WebSocketConfig, P as PlacementSettings, F as FrameworkAdapter, b as ComponentProps, d as ComponentState, e as ComponentContext, f as ComponentLifecycleHooks, E as EventHandler, c as ComponentDescriptor, g as FrameworkUtilities } from './websocket-
|
|
1
|
+
import { M as MockupResult, R as RealtimeRenderError, W as WebSocketConfig, P as PlacementSettings, F as FrameworkAdapter, b as ComponentProps, d as ComponentState, e as ComponentContext, f as ComponentLifecycleHooks, E as EventHandler, c as ComponentDescriptor, g as FrameworkUtilities } from './websocket-Cy0Y29CW.js';
|
|
2
2
|
import { CSSProperties, ReactNode } from 'react';
|
|
3
3
|
|
|
4
4
|
interface UseRealtimeMockupOptions {
|
|
@@ -54,6 +54,8 @@ declare function useRealtimeMockup(options?: UseRealtimeMockupOptions): {
|
|
|
54
54
|
flushPendingBlobs: () => void;
|
|
55
55
|
hasPendingBlobs: () => boolean;
|
|
56
56
|
getLastSentVersion: () => number;
|
|
57
|
+
getLatestSentVersions: () => Record<string, number>;
|
|
58
|
+
rerender: (mockupIds: string[]) => boolean;
|
|
57
59
|
isConnected: boolean;
|
|
58
60
|
sessionId: string | null;
|
|
59
61
|
box: string | null;
|
package/dist/react.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
RealtimeMockupService
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-P3ZDE6LZ.js";
|
|
4
4
|
|
|
5
5
|
// src/realtime/react.ts
|
|
6
6
|
import { useCallback, useEffect, useRef, useState } from "react";
|
|
@@ -117,6 +117,12 @@ function useRealtimeMockup(options = {}) {
|
|
|
117
117
|
const hasPendingBlobs = useCallback(() => {
|
|
118
118
|
return serviceRef.current?.hasPendingBlobs() || false;
|
|
119
119
|
}, []);
|
|
120
|
+
const getLatestSentVersions = useCallback(() => {
|
|
121
|
+
return serviceRef.current?.getLatestSentVersions() ?? {};
|
|
122
|
+
}, []);
|
|
123
|
+
const rerender = useCallback((mockupIds) => {
|
|
124
|
+
return serviceRef.current?.rerender(mockupIds) ?? false;
|
|
125
|
+
}, []);
|
|
120
126
|
const getLastSentVersion = useCallback(() => {
|
|
121
127
|
return serviceRef.current?.getLastSentVersion() ?? 0;
|
|
122
128
|
}, []);
|
|
@@ -138,7 +144,9 @@ function useRealtimeMockup(options = {}) {
|
|
|
138
144
|
clearMockups,
|
|
139
145
|
flushPendingBlobs,
|
|
140
146
|
hasPendingBlobs,
|
|
141
|
-
getLastSentVersion
|
|
147
|
+
getLastSentVersion,
|
|
148
|
+
getLatestSentVersions,
|
|
149
|
+
rerender
|
|
142
150
|
};
|
|
143
151
|
}
|
|
144
152
|
|
|
@@ -303,6 +303,14 @@ interface MockupResult {
|
|
|
303
303
|
requestVersion?: number;
|
|
304
304
|
/** The placement this mockup corresponds to */
|
|
305
305
|
placement?: string;
|
|
306
|
+
/**
|
|
307
|
+
* Every canvas_state placement folded into this frame, with the version the
|
|
308
|
+
* box used for it (servers with per-placement stamps; then `requestVersion`
|
|
309
|
+
* is their max). A frame is current when, for every placement this session
|
|
310
|
+
* sent, `versions[placement]` is at least the latest version sent for it
|
|
311
|
+
* (see {@link RealtimeMockupService.getLatestSentVersions}).
|
|
312
|
+
*/
|
|
313
|
+
versions?: Record<string, number>;
|
|
306
314
|
/** Server-side render time in ms */
|
|
307
315
|
renderMs?: number;
|
|
308
316
|
/** Time from blob received to render start in ms */
|
|
@@ -349,6 +357,10 @@ interface WebSocketMessage {
|
|
|
349
357
|
imageUrl?: string;
|
|
350
358
|
renderUrl?: string;
|
|
351
359
|
mockupId?: string;
|
|
360
|
+
/** `rerender_queued`: the mockups the box queued. */
|
|
361
|
+
mockupIds?: string[];
|
|
362
|
+
/** Per-placement versions folded into a frame (see MockupResult.versions). */
|
|
363
|
+
versions?: Record<string, number>;
|
|
352
364
|
imageSize?: number;
|
|
353
365
|
message?: string;
|
|
354
366
|
/** Machine-readable error code on `type: 'error'` frames (e.g. 'asset_not_allowed') */
|
|
@@ -568,6 +580,17 @@ declare class RealtimeMockupService {
|
|
|
568
580
|
* send a frame belongs to — the pipeline-depth send policy counts a send
|
|
569
581
|
* as landed when every mockup of its version has arrived.
|
|
570
582
|
*/
|
|
583
|
+
/** The latest canvas version sent per placement (copy). */
|
|
584
|
+
getLatestSentVersions(): Record<string, number>;
|
|
585
|
+
/**
|
|
586
|
+
* Re-render these mockups now from the session's current state (servers with
|
|
587
|
+
* the `rerender` message). Answered by `rerender_queued` and then one
|
|
588
|
+
* mockup_rendered per mockup; refusals arrive as typed errors
|
|
589
|
+
* (E_RERENDER_NOT_CONFIGURED | E_RERENDER_BAD_REQUEST | E_RERENDER_UNKNOWN_MOCKUP |
|
|
590
|
+
* E_RERENDER_INCOMPLETE | E_RERENDER_RATE_LIMITED). Never changes the
|
|
591
|
+
* session's mockupIds.
|
|
592
|
+
*/
|
|
593
|
+
rerender(mockupIds: string[]): boolean;
|
|
571
594
|
getLastSentVersion(): number;
|
|
572
595
|
sendColorBlob(placement: string, hexColor: string): boolean;
|
|
573
596
|
createEmptyCanvasBlob(width?: number, height?: number): Promise<Blob>;
|
|
@@ -303,6 +303,14 @@ interface MockupResult {
|
|
|
303
303
|
requestVersion?: number;
|
|
304
304
|
/** The placement this mockup corresponds to */
|
|
305
305
|
placement?: string;
|
|
306
|
+
/**
|
|
307
|
+
* Every canvas_state placement folded into this frame, with the version the
|
|
308
|
+
* box used for it (servers with per-placement stamps; then `requestVersion`
|
|
309
|
+
* is their max). A frame is current when, for every placement this session
|
|
310
|
+
* sent, `versions[placement]` is at least the latest version sent for it
|
|
311
|
+
* (see {@link RealtimeMockupService.getLatestSentVersions}).
|
|
312
|
+
*/
|
|
313
|
+
versions?: Record<string, number>;
|
|
306
314
|
/** Server-side render time in ms */
|
|
307
315
|
renderMs?: number;
|
|
308
316
|
/** Time from blob received to render start in ms */
|
|
@@ -349,6 +357,10 @@ interface WebSocketMessage {
|
|
|
349
357
|
imageUrl?: string;
|
|
350
358
|
renderUrl?: string;
|
|
351
359
|
mockupId?: string;
|
|
360
|
+
/** `rerender_queued`: the mockups the box queued. */
|
|
361
|
+
mockupIds?: string[];
|
|
362
|
+
/** Per-placement versions folded into a frame (see MockupResult.versions). */
|
|
363
|
+
versions?: Record<string, number>;
|
|
352
364
|
imageSize?: number;
|
|
353
365
|
message?: string;
|
|
354
366
|
/** Machine-readable error code on `type: 'error'` frames (e.g. 'asset_not_allowed') */
|
|
@@ -568,6 +580,17 @@ declare class RealtimeMockupService {
|
|
|
568
580
|
* send a frame belongs to — the pipeline-depth send policy counts a send
|
|
569
581
|
* as landed when every mockup of its version has arrived.
|
|
570
582
|
*/
|
|
583
|
+
/** The latest canvas version sent per placement (copy). */
|
|
584
|
+
getLatestSentVersions(): Record<string, number>;
|
|
585
|
+
/**
|
|
586
|
+
* Re-render these mockups now from the session's current state (servers with
|
|
587
|
+
* the `rerender` message). Answered by `rerender_queued` and then one
|
|
588
|
+
* mockup_rendered per mockup; refusals arrive as typed errors
|
|
589
|
+
* (E_RERENDER_NOT_CONFIGURED | E_RERENDER_BAD_REQUEST | E_RERENDER_UNKNOWN_MOCKUP |
|
|
590
|
+
* E_RERENDER_INCOMPLETE | E_RERENDER_RATE_LIMITED). Never changes the
|
|
591
|
+
* session's mockupIds.
|
|
592
|
+
*/
|
|
593
|
+
rerender(mockupIds: string[]): boolean;
|
|
571
594
|
getLastSentVersion(): number;
|
|
572
595
|
sendColorBlob(placement: string, hexColor: string): boolean;
|
|
573
596
|
createEmptyCanvasBlob(width?: number, height?: number): Promise<Blob>;
|