@stackedapp/types 1.0.0 → 1.0.2

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.
@@ -728,8 +728,14 @@ type Nullable<T> = {
728
728
  };
729
729
  /** this is the Stacked platforms' copy of a user/entity's snapshot for the current app/game */
730
730
  type StackedSnapshot = Nullable<Pick<IPlayerSnapshot, '_id' | 'gameId' | 'playerId' | 'unifiedUserLinkedAt' | 'unifiedUserUnlinkedAt' | 'referredById' | 'username' | 'snapshotLastUpdated' | 'offersLastChecked' | 'daysInGame' | 'loginStreak' | 'daysInGameLastUpdated' | 'dateSignedUp' | 'dynamic' | 'stakedTokens' | 'currencies' | 'levels' | 'quests' | 'trustScore' | 'trustLastUpdated' | 'achievements' | 'memberships' | 'cryptoWallets' | 'identifiers' | 'entityKind' | 'entityLinks'>>;
731
- type StackedEntityCurrencies = Record<string, IPlayerDataCurrency>;
732
- /** represents a stacked snapshot's data within a specific app/game. This is scoped to the app/game! */
731
+ /** Currencies for this entity that is populated with name and image information */
732
+ type StackedEntityCurrencies = Record<string, IPlayerDataCurrency & {
733
+ name: string;
734
+ image?: string;
735
+ }>;
736
+ /** represents a stacked entity's snapshot's data within a specific app/game. This is scoped to the app/game!
737
+ * Has information about stacked currencies of this entity earned through this specific app/game
738
+ */
733
739
  type StackedEntityData = Pick<IPlayerData, 'gameId' | 'playerId'> & {
734
740
  currencies?: StackedEntityCurrencies;
735
741
  };
@@ -789,10 +795,17 @@ interface StackedBaseUserExtra {
789
795
  balances?: Record<string, number>;
790
796
  }>;
791
797
  }
798
+ /** Base stacked user that includes their id, app connections connected to their stacked account, crypto wallets
799
+ * information
800
+ */
792
801
  type StackedUser = StackedBaseUser & StackedBaseUserExtra;
793
802
  /** This user's app connection data which is a snapshot of their profile in your app, plus the stacked platform's data (like stacked points, etc) */
794
803
  type StackedAppConnection = {
804
+ /** this is the Stacked platforms' copy of a user/entity's snapshot for the current app/game */
795
805
  snapshot: StackedSnapshot;
806
+ /** represents a stacked entity's snapshot's data within a specific app/game. This is scoped to the app/game!
807
+ * Has information about stacked currencies of this entity earned through this specific app/game
808
+ */
796
809
  stackedData: StackedEntityData;
797
810
  };
798
811
  /** Returned alongside offers when fetching a specific user/player's offers */
@@ -803,7 +816,7 @@ type StackedUserResponse = {
803
816
  } & StackedAppConnection;
804
817
  /** @deprecated - old way of getting a specific game player's currencies in stacked */
805
818
  type IClientPlayerData = StackedEntityData;
806
- /** Stacked mobile web app's initialize user response */
819
+ /** Stacked mobile/web app's initialize user response */
807
820
  interface StackedUserComplete {
808
821
  user: StackedUser;
809
822
  apps: {
@@ -834,21 +847,27 @@ interface StackedUserComplete {
834
847
  interface StackedCampaignsBaseResponse extends StackedUserResponse {
835
848
  /** List of offers/campaigns for the player */
836
849
  offers: StackedOffer[];
837
- /** Player's currency balances */
850
+ /**
851
+ * @deprecated
852
+ * look at stackedData.currencies instead.
853
+ * Currencies with name and image and balance information */
838
854
  currencies?: StackedEntityCurrencies;
839
855
  }
840
- /** Client-side campaigns response (from JWT-authenticated endpoints) */
856
+ /** Client-side campaigns response (from JWT-authenticated endpoints). Returns a list of offers plus
857
+ * user snapshot and stacked user-specific data.
858
+ */
841
859
  type StackedCampaignsResponse = StackedCampaignsBaseResponse;
842
- /** Server-side campaigns response (from API key authenticated endpoints) */
860
+ /** Server-side campaigns response (from API key authenticated endpoints). Returns a list of offers plus
861
+ * user snapshot and stacked user-specific data. */
843
862
  interface StackedCampaignsServerResponse extends StackedCampaignsBaseResponse {
844
863
  /** @deprecated iframe session token for subsequent client calls */
845
- token: string;
864
+ token?: string;
846
865
  /** Game/app ID */
847
866
  gameId: string;
848
867
  /** @deprecated use player.snapshot instead */
849
- playerSnapshot: StackedSnapshot;
868
+ playerSnapshot?: StackedSnapshot;
850
869
  /** @deprecated use player.stackedData instead */
851
- playerData: StackedEntityData;
870
+ playerData?: StackedEntityData;
852
871
  }
853
872
 
854
873
  type StackedEnv = IEnv;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stackedapp/types",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Public types for Stacked platform SDK",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/stacked-types.d.ts",