@playcademy/sdk 0.0.1-beta.13 → 0.0.1-beta.14

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.
@@ -1,6 +1,6 @@
1
1
  import { type Method } from './request';
2
2
  import type { Game, GameWithManifest, UpsertGameMetadataInput, InsertItem, UpdateItem, InsertCurrency, UpdateCurrency, InsertShopListing, UpdateShopListing } from '@playcademy/types';
3
- import type { GameState, InventoryItemWithItem, ClientConfig, ClientEvents, LoginResponse, GameTokenResponse, StartSessionResponse, InventoryMutationResponse, DeveloperStatusValue } from '../types';
3
+ import type { GameState, InventoryItemWithItem, ClientConfig, ClientEvents, LoginResponse, GameTokenResponse, StartSessionResponse, InventoryMutationResponse, DeveloperStatusValue, ShopViewResponse } from '../types';
4
4
  export declare class PlaycademyClient {
5
5
  private baseUrl;
6
6
  private token?;
@@ -242,6 +242,9 @@ export declare class PlaycademyClient {
242
242
  deleteListing: (listingId: string) => Promise<void>;
243
243
  };
244
244
  };
245
+ shop: {
246
+ view: () => Promise<ShopViewResponse>;
247
+ };
245
248
  telemetry: {
246
249
  pushMetrics: (metrics: Record<string, number>) => Promise<void>;
247
250
  };
package/dist/runtime.js CHANGED
@@ -330,6 +330,11 @@ class PlaycademyClient {
330
330
  deleteListing: (listingId) => this.request(`/shop-listings/${listingId}`, "DELETE")
331
331
  }
332
332
  };
333
+ shop = {
334
+ view: async () => {
335
+ return this.request("/shop/view", "GET");
336
+ }
337
+ };
333
338
  telemetry = {
334
339
  pushMetrics: (metrics) => this.request(`/telemetry/metrics`, "POST", metrics)
335
340
  };
package/dist/types.d.ts CHANGED
@@ -40,4 +40,24 @@ export type StartSessionResponse = {
40
40
  export type InventoryMutationResponse = {
41
41
  newTotal: number;
42
42
  };
43
+ export interface ShopDisplayItem extends Item {
44
+ listingId: string;
45
+ shopPrice: string;
46
+ currencyId: string;
47
+ currencySymbol?: string | null;
48
+ currencyImageUrl?: string | null;
49
+ stock?: number | null;
50
+ sellBackPercentage?: number | null;
51
+ }
52
+ export interface UserCurrencyInfo {
53
+ id: string;
54
+ balance: number;
55
+ symbol?: string | null;
56
+ imageUrl?: string | null;
57
+ isPrimary: boolean;
58
+ }
59
+ export interface ShopViewResponse {
60
+ shopItems: ShopDisplayItem[];
61
+ userCurrencies: UserCurrencyInfo[];
62
+ }
43
63
  export type { User, InventoryItemWithItem, Game, ManifestV1, DeveloperKey, DeveloperStatusResponse, MapElement, Item, InsertItem, UpdateItem, Currency, InsertCurrency, UpdateCurrency, ShopListing, InsertShopListing, UpdateShopListing, };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@playcademy/sdk",
3
3
  "type": "module",
4
- "version": "0.0.1-beta.13",
4
+ "version": "0.0.1-beta.14",
5
5
  "exports": {
6
6
  ".": {
7
7
  "import": "./dist/runtime.js",