@wvdsh/api 0.1.115 → 0.1.117

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.
@@ -168,6 +168,11 @@ export declare const P2P_SIGNALING_MESSAGE_TYPE: {
168
168
  readonly ANSWER: "answer";
169
169
  readonly ICE_CANDIDATE: "ice-candidate";
170
170
  };
171
+ export declare const SDK_FEATURE: {
172
+ readonly LOBBY: "lobby";
173
+ readonly P2P: "p2p";
174
+ readonly UGC: "ugc";
175
+ };
171
176
  export declare const GAME_AUTHORITY: {
172
177
  readonly CLIENT: 0;
173
178
  readonly SERVER: 1;
@@ -410,6 +415,7 @@ export declare const GameplaySubdomain: {
410
415
  gameCloudId: string;
411
416
  userId: string;
412
417
  gameBuildId: string;
418
+ isAnonymous: boolean;
413
419
  }) => string;
414
420
  };
415
421
  export declare const PAID_CONTENT_PICOMATCH_OPTIONS: {
@@ -142,6 +142,11 @@ export const P2P_SIGNALING_MESSAGE_TYPE = {
142
142
  ANSWER: 'answer',
143
143
  ICE_CANDIDATE: 'ice-candidate'
144
144
  };
145
+ export const SDK_FEATURE = {
146
+ LOBBY: 'lobby',
147
+ P2P: 'p2p',
148
+ UGC: 'ugc'
149
+ };
145
150
  export const GAME_AUTHORITY = {
146
151
  CLIENT: 0,
147
152
  SERVER: 1
@@ -280,9 +285,10 @@ export const GameplaySubdomain = {
280
285
  }
281
286
  return (h >>> 0).toString(16).padStart(8, '0');
282
287
  },
283
- // `{gameCloudId}-{hashPart(userId)}-{hashPart(gameBuildId)}`
288
+ // `{gameCloudId}-{hashPart(userId)}-{hashPart(gameBuildId)}`, with `guest` in place of the user hash for anonymous users
284
289
  build(args) {
285
- const subdomain = `${args.gameCloudId}-${GameplaySubdomain.hashPart(args.userId)}-${GameplaySubdomain.hashPart(args.gameBuildId)}`;
290
+ const userPart = args.isAnonymous ? 'guest' : GameplaySubdomain.hashPart(args.userId);
291
+ const subdomain = `${args.gameCloudId}-${userPart}-${GameplaySubdomain.hashPart(args.gameBuildId)}`;
286
292
  if (subdomain.length > GameplaySubdomain.MAX_LENGTH) {
287
293
  throw new Error(`Gameplay subdomain exceeds ${GameplaySubdomain.MAX_LENGTH} characters`);
288
294
  }
@@ -443,6 +443,11 @@ export type PublicApiType = {
443
443
  type: "DURABLE" | "CONSUMABLE";
444
444
  }>;
445
445
  };
446
+ featureUsage: {
447
+ recordFeatureUsage: FunctionReference<"mutation", "public", {
448
+ feature: "lobby" | "p2p" | "ugc";
449
+ }, null>;
450
+ };
446
451
  };
447
452
  };
448
453
  export type InternalApiType = {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wvdsh/api",
3
- "version": "0.1.115",
3
+ "version": "0.1.117",
4
4
  "description": "Public API types and shared constants for the Wavedash platform",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",