@wvdsh/api 0.1.102 → 0.1.104

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.
@@ -183,7 +183,6 @@ export declare const IFRAME_MESSAGE_TYPE: {
183
183
  readonly LOBBY_LEFT: "LobbyLeft";
184
184
  readonly GET_LOBBY_INVITE_LINK: "GetLobbyInviteLink";
185
185
  readonly GET_DEVICE_FINGERPRINT: "GetDeviceFingerprint";
186
- readonly GET_GAMEPLAY_ATTRIBUTION: "GetGameplayAttribution";
187
186
  readonly SET_FULLSCREEN: "SetFullscreen";
188
187
  readonly TOGGLE_FULLSCREEN: "ToggleFullscreen";
189
188
  readonly FULLSCREEN_CHANGED: "FullscreenChanged";
@@ -198,6 +197,10 @@ export declare const IFRAME_MESSAGE_TYPE: {
198
197
  readonly LINK_COPIED: "LinkCopied";
199
198
  readonly RECORDING_CHANGED: "RecordingChanged";
200
199
  readonly RECORDING_COMPLETE: "RecordingComplete";
200
+ readonly RECORDING_STARTED: "RecordingStarted";
201
+ readonly RECORDING_DATA: "RecordingData";
202
+ readonly RECORDING_FINISHED: "RecordingFinished";
203
+ readonly RECORDING_FAILED: "RecordingFailed";
201
204
  readonly RECORDING_HOTKEY_CHANGED: "RecordingHotkeyChanged";
202
205
  readonly RECORDING_HOTKEY_PRESSED: "RecordingHotkeyPressed";
203
206
  };
@@ -234,7 +237,7 @@ export interface SDKConfig {
234
237
  pageViewId?: string;
235
238
  recordingHotkey?: string;
236
239
  }
237
- export type IframeResponseMessageTypes = typeof IFRAME_MESSAGE_TYPE.GET_LOBBY_INVITE_LINK | typeof IFRAME_MESSAGE_TYPE.GET_DEVICE_FINGERPRINT | typeof IFRAME_MESSAGE_TYPE.GET_GAMEPLAY_ATTRIBUTION | typeof IFRAME_MESSAGE_TYPE.SET_FULLSCREEN | typeof IFRAME_MESSAGE_TYPE.TOGGLE_FULLSCREEN | typeof IFRAME_MESSAGE_TYPE.SET_MUTE | typeof IFRAME_MESSAGE_TYPE.TOGGLE_MUTE | typeof IFRAME_MESSAGE_TYPE.TRIGGER_PAYWALL;
240
+ export type IframeResponseMessageTypes = typeof IFRAME_MESSAGE_TYPE.GET_LOBBY_INVITE_LINK | typeof IFRAME_MESSAGE_TYPE.GET_DEVICE_FINGERPRINT | typeof IFRAME_MESSAGE_TYPE.SET_FULLSCREEN | typeof IFRAME_MESSAGE_TYPE.TOGGLE_FULLSCREEN | typeof IFRAME_MESSAGE_TYPE.SET_MUTE | typeof IFRAME_MESSAGE_TYPE.TOGGLE_MUTE | typeof IFRAME_MESSAGE_TYPE.TRIGGER_PAYWALL;
238
241
  export type RecordingCompletePayload = {
239
242
  success: true;
240
243
  recordingId?: number;
@@ -249,7 +252,37 @@ export type RecordingCompletePayload = {
249
252
  error: string;
250
253
  reason?: RecordingFailureReason;
251
254
  };
252
- export type RecordingFailureReason = 'no-canvas';
255
+ export type RecordingFile = `${number}.mp4` | `${number}.webm` | 'audio.mp4' | 'audio.webm' | 'dom.json.gz' | 'manifest.json';
256
+ export declare const CSS_ANIMATION_KIND: {
257
+ readonly ANIMATION: "animation";
258
+ readonly TRANSITION: "transition";
259
+ };
260
+ export type CssAnimationKind = (typeof CSS_ANIMATION_KIND)[keyof typeof CSS_ANIMATION_KIND];
261
+ export type ClipManifest = {
262
+ durationMs: number;
263
+ viewport: {
264
+ width: number;
265
+ height: number;
266
+ dpr: number;
267
+ };
268
+ tracks: {
269
+ file: `${number}.mp4` | `${number}.webm`;
270
+ rrwebNodeId: number | null;
271
+ startOffsetMs: number;
272
+ }[];
273
+ audio: {
274
+ file: `${number}.mp4` | `${number}.webm` | 'audio.mp4' | 'audio.webm';
275
+ startOffsetMs: number;
276
+ } | null;
277
+ animationStarts?: {
278
+ rrwebNodeId: number;
279
+ pseudoElement: string | null;
280
+ kind: CssAnimationKind;
281
+ name: string;
282
+ startOffsetMs: number;
283
+ }[];
284
+ };
285
+ export type RecordingFailureReason = 'no-canvas' | 'no-frames';
253
286
  export type IFrameEventPayloadMap = {
254
287
  [IFRAME_MESSAGE_TYPE.FULLSCREEN_CHANGED]: {
255
288
  isFullscreen: boolean;
@@ -263,9 +296,6 @@ export type IFrameEventPayloadMap = {
263
296
  [IFRAME_MESSAGE_TYPE.TAKE_FOCUS]: void;
264
297
  [IFRAME_MESSAGE_TYPE.GET_LOBBY_INVITE_LINK]: string;
265
298
  [IFRAME_MESSAGE_TYPE.GET_DEVICE_FINGERPRINT]: DeviceFingerprint;
266
- [IFRAME_MESSAGE_TYPE.GET_GAMEPLAY_ATTRIBUTION]: {
267
- pageViewId: string;
268
- };
269
299
  [IFRAME_MESSAGE_TYPE.SET_FULLSCREEN]: {
270
300
  success: boolean;
271
301
  };
@@ -296,9 +326,32 @@ export type IFrameEventPayloadMap = {
296
326
  [IFRAME_MESSAGE_TYPE.FRAME_BOOTED]: void;
297
327
  [IFRAME_MESSAGE_TYPE.RECORDING_CHANGED]: {
298
328
  isRecording: boolean;
299
- recordingId?: number;
329
+ recordingId: number;
300
330
  };
301
331
  [IFRAME_MESSAGE_TYPE.RECORDING_COMPLETE]: RecordingCompletePayload;
332
+ [IFRAME_MESSAGE_TYPE.RECORDING_STARTED]: {
333
+ recordingId: number;
334
+ trackCount: number;
335
+ hasDom: boolean;
336
+ };
337
+ [IFRAME_MESSAGE_TYPE.RECORDING_DATA]: {
338
+ recordingId: number;
339
+ file: RecordingFile;
340
+ data: ArrayBuffer;
341
+ final: boolean;
342
+ };
343
+ [IFRAME_MESSAGE_TYPE.RECORDING_FINISHED]: {
344
+ recordingId: number;
345
+ durationMs: number;
346
+ width: number;
347
+ height: number;
348
+ thumbnailImage: Blob | null;
349
+ };
350
+ [IFRAME_MESSAGE_TYPE.RECORDING_FAILED]: {
351
+ recordingId: number;
352
+ error: string;
353
+ reason?: RecordingFailureReason;
354
+ };
302
355
  [IFRAME_MESSAGE_TYPE.RECORDING_HOTKEY_CHANGED]: {
303
356
  hotkey: string | null;
304
357
  };
@@ -157,7 +157,6 @@ export const IFRAME_MESSAGE_TYPE = {
157
157
  LOBBY_LEFT: 'LobbyLeft',
158
158
  GET_LOBBY_INVITE_LINK: 'GetLobbyInviteLink',
159
159
  GET_DEVICE_FINGERPRINT: 'GetDeviceFingerprint',
160
- GET_GAMEPLAY_ATTRIBUTION: 'GetGameplayAttribution',
161
160
  SET_FULLSCREEN: 'SetFullscreen',
162
161
  TOGGLE_FULLSCREEN: 'ToggleFullscreen',
163
162
  FULLSCREEN_CHANGED: 'FullscreenChanged',
@@ -172,6 +171,10 @@ export const IFRAME_MESSAGE_TYPE = {
172
171
  LINK_COPIED: 'LinkCopied',
173
172
  RECORDING_CHANGED: 'RecordingChanged',
174
173
  RECORDING_COMPLETE: 'RecordingComplete',
174
+ RECORDING_STARTED: 'RecordingStarted',
175
+ RECORDING_DATA: 'RecordingData',
176
+ RECORDING_FINISHED: 'RecordingFinished',
177
+ RECORDING_FAILED: 'RecordingFailed',
175
178
  RECORDING_HOTKEY_CHANGED: 'RecordingHotkeyChanged',
176
179
  RECORDING_HOTKEY_PRESSED: 'RecordingHotkeyPressed'
177
180
  };
@@ -186,6 +189,10 @@ export const SERVICE_WORKER_MESSAGE_TYPE = {
186
189
  EMBED_CREDS_REQUEST: 'embed.creds-request',
187
190
  EMBED_CREDS_RESPONSE: 'embed.creds-response'
188
191
  };
192
+ export const CSS_ANIMATION_KIND = {
193
+ ANIMATION: 'animation',
194
+ TRANSITION: 'transition'
195
+ };
189
196
  // Launch params passed from URL query params to the game SDK
190
197
  export const LAUNCH_PARAM_PREFIX = 'wvdsh_';
191
198
  // URL params referenced by external consumers
@@ -119,16 +119,6 @@ export type PublicApiType = {
119
119
  playerCount: number;
120
120
  visibility: 0 | 1 | 2;
121
121
  }>>;
122
- lobbyMessages: FunctionReference<"query", "public", {
123
- lobbyId: Id<"lobbies">;
124
- }, Array<{
125
- lobbyId: Id<"lobbies">;
126
- message: string;
127
- messageId: Id<"lobbyMessages">;
128
- timestamp: number;
129
- userId: Id<"users">;
130
- username: string;
131
- }>>;
132
122
  lobbyUsers: FunctionReference<"query", "public", {
133
123
  lobbyId: Id<"lobbies">;
134
124
  }, Array<{
@@ -280,7 +270,7 @@ export type PublicApiType = {
280
270
  };
281
271
  p2pSignaling: {
282
272
  getSignalingMessages: FunctionReference<"query", "public", {
283
- after?: bigint;
273
+ after: bigint;
284
274
  lobbyId: Id<"lobbies">;
285
275
  }, Array<{
286
276
  _creationTime: number;
@@ -303,19 +293,6 @@ export type PublicApiType = {
303
293
  };
304
294
  presence: {
305
295
  heartbeat: FunctionReference<"mutation", "public", {
306
- attribution?: {
307
- embedAncestors?: Array<string>;
308
- navigation?: {
309
- campaign?: "continue_playing" | "recommended" | "trending" | "feed" | "category" | "search_results" | "more_from_developer" | "more_like_this" | "profile_games" | "profile_collection" | "team_games" | "friend_playing" | "notifications" | "invitations" | "embed";
310
- fromPageViewId: string;
311
- position?: number;
312
- source: string;
313
- term?: string;
314
- };
315
- pageViewId: string;
316
- referrer?: string;
317
- trackingParams?: Record<string, string>;
318
- };
319
296
  data?: Record<string, string | number | boolean | null>;
320
297
  deviceFingerprint?: {
321
298
  browser?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wvdsh/api",
3
- "version": "0.1.102",
3
+ "version": "0.1.104",
4
4
  "description": "Public API types and shared constants for the Wavedash platform",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",