@stackedapp/types 1.9.0 → 1.9.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.
package/dist/index.js CHANGED
@@ -16,6 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  // Re-export all public types
18
18
  __exportStar(require("./stacked_offer"), exports);
19
+ __exportStar(require("./stacked_response"), exports);
19
20
  __exportStar(require("./stacked_reward"), exports);
20
21
  __exportStar(require("./stacked_snapshot"), exports);
21
22
  __exportStar(require("./stacked_user"), exports);
@@ -728,8 +728,11 @@ 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>;
731
732
  /** represents a stacked snapshot's data within a specific app/game. This is scoped to the app/game! */
732
- type StackedEntityData = Pick<IPlayerData, 'gameId' | 'playerId' | 'currencies'>;
733
+ type StackedEntityData = Pick<IPlayerData, 'gameId' | 'playerId'> & {
734
+ currencies?: StackedEntityCurrencies;
735
+ };
733
736
 
734
737
  type StackedCompletionConditions = ICompletionCondition;
735
738
  /** Stripped sibling offer data for client rendering */
@@ -763,11 +766,6 @@ type StackedOffer = StackedBaseOffer & StackedUserOffer & {
763
766
  instanceId: string;
764
767
  };
765
768
 
766
- type StackedRewardKind = RewardKind;
767
- interface StackedReward extends IReward {
768
- image?: string;
769
- }
770
-
771
769
  /** represents a stacked consumer from the web/mobile app */
772
770
  type StackedBaseUser = Pick<IUser, '_id' | 'appConnections' | 'providers'>;
773
771
  /** extra data populated into a stacked web/mobile app user */
@@ -786,18 +784,44 @@ type StackedAppConnection = {
786
784
  type StackedUserResponse = {
787
785
  /** @deprecated use stackedData instead */
788
786
  data?: IClientPlayerData | null;
789
- user?: StackedUser;
787
+ stackedUser?: StackedUser;
790
788
  } & StackedAppConnection;
791
789
  /** @deprecated - old way of getting a specific game player's currencies in stacked */
792
790
  type IClientPlayerData = StackedEntityData;
793
791
  /** Stacked mobile web app's initialize user response */
794
792
  interface StackedUserWithAppConnections {
795
- user: StackedUser;
793
+ stackedUser: StackedUser;
796
794
  apps: {
797
795
  [appId: string]: StackedAppConnection;
798
796
  };
799
797
  }
800
798
 
799
+ /** Base campaigns response - shared fields between client and server */
800
+ interface StackedCampaignsBaseResponse extends StackedUserResponse {
801
+ /** List of offers/campaigns for the player */
802
+ offers: StackedOffer[];
803
+ /** Player's currency balances */
804
+ currencies?: StackedEntityCurrencies;
805
+ }
806
+ /** Client-side campaigns response (from JWT-authenticated endpoints) */
807
+ type StackedCampaignsResponse = StackedCampaignsBaseResponse;
808
+ /** Server-side campaigns response (from API key authenticated endpoints) */
809
+ interface StackedCampaignsServerResponse extends StackedCampaignsBaseResponse {
810
+ /** @deprecated iframe session token for subsequent client calls */
811
+ token: string;
812
+ /** Game/app ID */
813
+ gameId: string;
814
+ /** @deprecated use player.snapshot instead */
815
+ playerSnapshot: StackedSnapshot;
816
+ /** @deprecated use player.stackedData instead */
817
+ playerData: StackedEntityData;
818
+ }
819
+
820
+ type StackedRewardKind = RewardKind;
821
+ interface StackedReward extends IReward {
822
+ image?: string;
823
+ }
824
+
801
825
  type StackedEnv = IEnv;
802
826
 
803
- export type { IClientPlayerData, StackedAppConnection, StackedBaseOffer, StackedBaseUser, StackedBaseUserExtra, StackedCompletionConditions, StackedEntityData, StackedEnv, StackedOffer, StackedReward, StackedRewardKind, StackedSnapshot, StackedSnapshotProgress, StackedUser, StackedUserOffer, StackedUserResponse, StackedUserWithAppConnections, UserOfferStatus };
827
+ export type { IClientPlayerData, StackedAppConnection, StackedBaseOffer, StackedBaseUser, StackedBaseUserExtra, StackedCampaignsResponse, StackedCampaignsServerResponse, StackedCompletionConditions, StackedEntityCurrencies, StackedEntityData, StackedEnv, StackedOffer, StackedReward, StackedRewardKind, StackedSnapshot, StackedSnapshotProgress, StackedUser, StackedUserOffer, StackedUserResponse, StackedUserWithAppConnections, UserOfferStatus };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stackedapp/types",
3
- "version": "1.9.0",
3
+ "version": "1.9.2",
4
4
  "description": "Public types for Stacked platform SDK",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/stacked-types.d.ts",