@stackedapp/types 1.9.2 → 1.9.10

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,8 +16,8 @@ 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);
20
19
  __exportStar(require("./stacked_reward"), exports);
21
20
  __exportStar(require("./stacked_snapshot"), exports);
22
21
  __exportStar(require("./stacked_user"), exports);
22
+ __exportStar(require("./stacked_response"), exports);
23
23
  //# sourceMappingURL=index.js.map
@@ -728,13 +728,29 @@ 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
  };
736
742
 
743
+ type StackedBaseConditions = IBaseCondition;
737
744
  type StackedCompletionConditions = ICompletionCondition;
745
+ type StackedDynamicCondition = IDynamicCondition;
746
+ type StackedCompletionDynamicTracker = ICompletionDynamicTracker;
747
+ type StackedCompletionTrackers = ICompletionTrackers;
748
+ type StackedOfferTrackers = IPlayerOfferTrackers;
749
+ type StackedSocialTrackerAccumulate = ISocialTrackerAccumulate;
750
+ type StackedSocialTrackerAttach = ISocialTrackerAttach;
751
+ type StackedDynamicGroup = IDynamicGroup;
752
+ type StackedClaimableConditions = IOffer['claimableConditions'];
753
+ type StackedClaimableTrackers = IPlayerOffer['claimableTrackers'];
738
754
  /** Stripped sibling offer data for client rendering */
739
755
  interface StackedSnapshotProgress {
740
756
  status: UserOfferStatus;
@@ -766,6 +782,11 @@ type StackedOffer = StackedBaseOffer & StackedUserOffer & {
766
782
  instanceId: string;
767
783
  };
768
784
 
785
+ type StackedRewardKind = RewardKind;
786
+ interface StackedReward extends IReward {
787
+ image?: string;
788
+ }
789
+
769
790
  /** represents a stacked consumer from the web/mobile app */
770
791
  type StackedBaseUser = Pick<IUser, '_id' | 'appConnections' | 'providers'>;
771
792
  /** extra data populated into a stacked web/mobile app user */
@@ -774,54 +795,81 @@ interface StackedBaseUserExtra {
774
795
  balances?: Record<string, number>;
775
796
  }>;
776
797
  }
798
+ /** Base stacked user that includes their id, app connections connected to their stacked account, crypto wallets
799
+ * information
800
+ */
777
801
  type StackedUser = StackedBaseUser & StackedBaseUserExtra;
778
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) */
779
803
  type StackedAppConnection = {
804
+ /** this is the Stacked platforms' copy of a user/entity's snapshot for the current app/game */
780
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
+ */
781
809
  stackedData: StackedEntityData;
782
810
  };
783
811
  /** Returned alongside offers when fetching a specific user/player's offers */
784
812
  type StackedUserResponse = {
785
- /** @deprecated use stackedData instead */
813
+ /** @deprecated use stackedData instead for stacked-scoped data (like currencies) */
786
814
  data?: IClientPlayerData | null;
787
- stackedUser?: StackedUser;
815
+ user?: StackedUser;
788
816
  } & StackedAppConnection;
789
817
  /** @deprecated - old way of getting a specific game player's currencies in stacked */
790
818
  type IClientPlayerData = StackedEntityData;
791
- /** Stacked mobile web app's initialize user response */
792
- interface StackedUserWithAppConnections {
793
- stackedUser: StackedUser;
819
+ /** Stacked mobile/web app's initialize user response */
820
+ interface StackedUserComplete {
821
+ user: StackedUser;
794
822
  apps: {
795
823
  [appId: string]: StackedAppConnection;
796
824
  };
825
+ authMethods: {
826
+ wallets: Array<{
827
+ address: string;
828
+ type: number;
829
+ }>;
830
+ emails: Array<{
831
+ email: string;
832
+ }>;
833
+ phones: Array<{
834
+ phone: string;
835
+ }>;
836
+ providers: Array<{
837
+ type: string;
838
+ profilePic?: string;
839
+ username?: string;
840
+ displayName?: string;
841
+ providerUserId?: string;
842
+ }>;
843
+ };
797
844
  }
798
845
 
799
846
  /** Base campaigns response - shared fields between client and server */
800
847
  interface StackedCampaignsBaseResponse extends StackedUserResponse {
801
848
  /** List of offers/campaigns for the player */
802
849
  offers: StackedOffer[];
803
- /** Player's currency balances */
850
+ /**
851
+ * @deprecated
852
+ * look at stackedData.currencies instead.
853
+ * Currencies with name and image and balance information */
804
854
  currencies?: StackedEntityCurrencies;
805
855
  }
806
- /** 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
+ */
807
859
  type StackedCampaignsResponse = StackedCampaignsBaseResponse;
808
- /** 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. */
809
862
  interface StackedCampaignsServerResponse extends StackedCampaignsBaseResponse {
810
863
  /** @deprecated iframe session token for subsequent client calls */
811
- token: string;
864
+ token?: string;
812
865
  /** Game/app ID */
813
866
  gameId: string;
814
867
  /** @deprecated use player.snapshot instead */
815
- playerSnapshot: StackedSnapshot;
868
+ playerSnapshot?: StackedSnapshot;
816
869
  /** @deprecated use player.stackedData instead */
817
- playerData: StackedEntityData;
818
- }
819
-
820
- type StackedRewardKind = RewardKind;
821
- interface StackedReward extends IReward {
822
- image?: string;
870
+ playerData?: StackedEntityData;
823
871
  }
824
872
 
825
873
  type StackedEnv = IEnv;
826
874
 
827
- export type { IClientPlayerData, StackedAppConnection, StackedBaseOffer, StackedBaseUser, StackedBaseUserExtra, StackedCampaignsResponse, StackedCampaignsServerResponse, StackedCompletionConditions, StackedEntityCurrencies, StackedEntityData, StackedEnv, StackedOffer, StackedReward, StackedRewardKind, StackedSnapshot, StackedSnapshotProgress, StackedUser, StackedUserOffer, StackedUserResponse, StackedUserWithAppConnections, UserOfferStatus };
875
+ export type { IClientPlayerData, StackedAppConnection, StackedBaseConditions, StackedBaseOffer, StackedBaseUser, StackedBaseUserExtra, StackedCampaignsResponse, StackedCampaignsServerResponse, StackedClaimableConditions, StackedClaimableTrackers, StackedCompletionConditions, StackedCompletionDynamicTracker, StackedCompletionTrackers, StackedDynamicCondition, StackedDynamicGroup, StackedEntityCurrencies, StackedEntityData, StackedEnv, StackedOffer, StackedOfferTrackers, StackedReward, StackedRewardKind, StackedSnapshot, StackedSnapshotProgress, StackedSocialTrackerAccumulate, StackedSocialTrackerAttach, StackedUser, StackedUserComplete, StackedUserOffer, StackedUserResponse, UserOfferStatus };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stackedapp/types",
3
- "version": "1.9.2",
3
+ "version": "1.9.10",
4
4
  "description": "Public types for Stacked platform SDK",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/stacked-types.d.ts",
@@ -20,7 +20,7 @@
20
20
  "@semantic-release/gitlab": "^13.2.9",
21
21
  "@semantic-release/npm": "^13.1.3",
22
22
  "@semantic-release/release-notes-generator": "^14.1.0",
23
- "@stackedplatform/types-internal": "*",
23
+ "@stackedplatform/types": "*",
24
24
  "conventional-changelog-conventionalcommits": "^9.1.0"
25
25
  },
26
26
  "publishConfig": {