@mpgd/adapter-devvit 0.3.2 → 0.4.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.
Files changed (2) hide show
  1. package/dist/index.js +46 -1
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -49,6 +49,24 @@ export function createDevvitPlatformGateway(input) {
49
49
  rememberStorageFallbackNamespace(player);
50
50
  return player;
51
51
  },
52
+ getSession: async () => {
53
+ const session = await request('identity.getSession', {});
54
+ rememberStorageFallbackNamespace(session.playerId === undefined ? null : { playerId: session.playerId });
55
+ return session;
56
+ },
57
+ requestUpgrade: (payload) => request('identity.requestUpgrade', payload),
58
+ },
59
+ presentation: {
60
+ getLaunchIntent: () => request('presentation.getLaunchIntent', {}),
61
+ requestGameSurface: (payload) => request('presentation.requestGameSurface', payload),
62
+ },
63
+ sharing: {
64
+ share: (payload) => request('share.share', payload),
65
+ readInboundShare: () => request('share.readInboundShare', {}),
66
+ },
67
+ notifications: {
68
+ getStatus: (topic) => request('notifications.getStatus', { topic }),
69
+ requestSubscription: (topic) => request('notifications.requestSubscription', { topic }),
52
70
  },
53
71
  commerce: {
54
72
  getProducts: () => request('commerce.getProducts', {}),
@@ -255,7 +273,7 @@ export function createDevvitSandboxBridge() {
255
273
  nativeLeaderboard: true,
256
274
  achievements: false,
257
275
  cloudSave: true,
258
- socialShare: true,
276
+ socialShare: false,
259
277
  haptics: false,
260
278
  localizedContent: true,
261
279
  });
@@ -264,6 +282,33 @@ export function createDevvitSandboxBridge() {
264
282
  playerId: 'reddit-sandbox-player',
265
283
  displayName: 'Reddit Sandbox Player',
266
284
  });
285
+ case 'identity.getSession':
286
+ return ok(input, {
287
+ identityLevel: 'authenticated',
288
+ playerId: 'reddit-sandbox-player',
289
+ trustLevel: 'server-verified',
290
+ });
291
+ case 'identity.requestUpgrade':
292
+ return ok(input, {
293
+ status: 'completed',
294
+ reloadExpected: false,
295
+ });
296
+ case 'presentation.getLaunchIntent':
297
+ return ok(input, {
298
+ entry: 'home',
299
+ });
300
+ case 'presentation.requestGameSurface':
301
+ return ok(input, 'unavailable');
302
+ case 'share.share':
303
+ return ok(input, {
304
+ status: 'unavailable',
305
+ });
306
+ case 'share.readInboundShare':
307
+ return ok(input, null);
308
+ case 'notifications.getStatus':
309
+ return ok(input, 'approval-required');
310
+ case 'notifications.requestSubscription':
311
+ return ok(input, 'unavailable');
267
312
  case 'commerce.getProducts':
268
313
  case 'commerce.getEntitlements':
269
314
  return ok(input, []);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mpgd/adapter-devvit",
3
- "version": "0.3.2",
3
+ "version": "0.4.0",
4
4
  "description": "Reddit Devvit Web platform adapter for mpgd games.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -34,8 +34,8 @@
34
34
  "dist"
35
35
  ],
36
36
  "dependencies": {
37
- "@mpgd/bridge": "0.3.2",
38
- "@mpgd/platform": "0.3.2"
37
+ "@mpgd/bridge": "0.5.0",
38
+ "@mpgd/platform": "0.4.0"
39
39
  },
40
40
  "devDependencies": {
41
41
  "ttsc": "0.16.9",