@wvdsh/api 0.1.17 → 0.1.18

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.
@@ -106,6 +106,18 @@ export declare const IFRAME_MESSAGE_TYPE: {
106
106
  readonly GAMEPLAY_JWT_READY: "GameplayJwtReady";
107
107
  readonly END_SESSION: "EndSession";
108
108
  };
109
+ export declare const SERVICE_WORKER_MESSAGE_TYPE: {
110
+ readonly EMBED_CONFIGURE: "embed.configure";
111
+ readonly EMBED_CONFIGURE_ACK: "embed.configure:ack";
112
+ readonly EMBED_JWT_UPDATE: "embed.jwt-update";
113
+ readonly EMBED_CREDS_REQUEST: "embed.creds-request";
114
+ readonly EMBED_CREDS_RESPONSE: "embed.creds-response";
115
+ };
116
+ export declare const SW_PRELOAD_MESSAGE_TYPE: {
117
+ readonly PROGRESS: "sw-progress";
118
+ readonly READY: "sw-ready";
119
+ readonly FAILED: "sw-failed";
120
+ };
109
121
  export interface IFrameResponse<T> {
110
122
  requestId: string;
111
123
  requestType: (typeof IFRAME_MESSAGE_TYPE)[keyof typeof IFRAME_MESSAGE_TYPE];
@@ -83,6 +83,21 @@ export const IFRAME_MESSAGE_TYPE = {
83
83
  GAMEPLAY_JWT_READY: 'GameplayJwtReady',
84
84
  END_SESSION: 'EndSession'
85
85
  };
86
+ // Wire types for messages on the page ↔ service-worker MessageChannel.
87
+ // Mirror of play's ServiceWorkerMessageType enum — kept here so the SDK and
88
+ // mainsite can replace inline string literals once @wvdsh/api is republished.
89
+ export const SERVICE_WORKER_MESSAGE_TYPE = {
90
+ EMBED_CONFIGURE: 'embed.configure',
91
+ EMBED_CONFIGURE_ACK: 'embed.configure:ack',
92
+ EMBED_JWT_UPDATE: 'embed.jwt-update',
93
+ EMBED_CREDS_REQUEST: 'embed.creds-request',
94
+ EMBED_CREDS_RESPONSE: 'embed.creds-response'
95
+ };
96
+ export const SW_PRELOAD_MESSAGE_TYPE = {
97
+ PROGRESS: 'sw-progress',
98
+ READY: 'sw-ready',
99
+ FAILED: 'sw-failed'
100
+ };
86
101
  // URL params referenced by external consumers
87
102
  export const UrlParams = {
88
103
  GameCloudId: 'gcid',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wvdsh/api",
3
- "version": "0.1.17",
3
+ "version": "0.1.18",
4
4
  "description": "Public API types and shared constants for the Wavedash platform",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",