@stackedapp/types 1.9.3 → 1.9.11

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,26 @@ 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
+ /** Currencies for this entity that is populated with name and image information */
731
732
  type StackedEntityCurrencies = Record<string, IPlayerDataCurrency>;
732
- /** represents a stacked snapshot's data within a specific app/game. This is scoped to the app/game! */
733
+ /** represents a stacked entity's snapshot's data within a specific app/game. This is scoped to the app/game!
734
+ * Has information about stacked currencies of this entity earned through this specific app/game
735
+ */
733
736
  type StackedEntityData = Pick<IPlayerData, 'gameId' | 'playerId'> & {
734
737
  currencies?: StackedEntityCurrencies;
735
738
  };
736
739
 
740
+ type StackedBaseConditions = IBaseCondition;
737
741
  type StackedCompletionConditions = ICompletionCondition;
742
+ type StackedDynamicCondition = IDynamicCondition;
743
+ type StackedCompletionDynamicTracker = ICompletionDynamicTracker;
744
+ type StackedCompletionTrackers = ICompletionTrackers;
745
+ type StackedOfferTrackers = IPlayerOfferTrackers;
746
+ type StackedSocialTrackerAccumulate = ISocialTrackerAccumulate;
747
+ type StackedSocialTrackerAttach = ISocialTrackerAttach;
748
+ type StackedDynamicGroup = IDynamicGroup;
749
+ type StackedClaimableConditions = IOffer['claimableConditions'];
750
+ type StackedClaimableTrackers = IPlayerOffer['claimableTrackers'];
738
751
  /** Stripped sibling offer data for client rendering */
739
752
  interface StackedSnapshotProgress {
740
753
  status: UserOfferStatus;
@@ -766,6 +779,11 @@ type StackedOffer = StackedBaseOffer & StackedUserOffer & {
766
779
  instanceId: string;
767
780
  };
768
781
 
782
+ type StackedRewardKind = RewardKind;
783
+ interface StackedReward extends IReward {
784
+ image?: string;
785
+ }
786
+
769
787
  /** represents a stacked consumer from the web/mobile app */
770
788
  type StackedBaseUser = Pick<IUser, '_id' | 'appConnections' | 'providers'>;
771
789
  /** extra data populated into a stacked web/mobile app user */
@@ -774,54 +792,95 @@ interface StackedBaseUserExtra {
774
792
  balances?: Record<string, number>;
775
793
  }>;
776
794
  }
795
+ /** Base stacked user that includes their id, app connections connected to their stacked account, crypto wallets
796
+ * information
797
+ */
777
798
  type StackedUser = StackedBaseUser & StackedBaseUserExtra;
778
799
  /** 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
800
  type StackedAppConnection = {
801
+ /** this is the Stacked platforms' copy of a user/entity's snapshot for the current app/game */
780
802
  snapshot: StackedSnapshot;
803
+ /** represents a stacked entity's snapshot's data within a specific app/game. This is scoped to the app/game!
804
+ * Has information about stacked currencies of this entity earned through this specific app/game
805
+ */
781
806
  stackedData: StackedEntityData;
782
807
  };
783
808
  /** Returned alongside offers when fetching a specific user/player's offers */
784
809
  type StackedUserResponse = {
785
- /** @deprecated use stackedData instead */
810
+ /** @deprecated use stackedData instead for stacked-scoped data (like currencies) */
786
811
  data?: IClientPlayerData | null;
787
812
  user?: StackedUser;
788
813
  } & StackedAppConnection;
789
814
  /** @deprecated - old way of getting a specific game player's currencies in stacked */
790
815
  type IClientPlayerData = StackedEntityData;
791
- /** Stacked mobile web app's initialize user response */
792
- interface StackedUserWithAppConnections {
816
+ /** Stacked mobile/web app's initialize user response */
817
+ interface StackedUserComplete {
793
818
  user: StackedUser;
794
819
  apps: {
795
820
  [appId: string]: StackedAppConnection;
796
821
  };
822
+ authMethods: {
823
+ wallets: Array<{
824
+ address: string;
825
+ type: number;
826
+ }>;
827
+ emails: Array<{
828
+ email: string;
829
+ }>;
830
+ phones: Array<{
831
+ phone: string;
832
+ }>;
833
+ providers: Array<{
834
+ type: string;
835
+ profilePic?: string;
836
+ username?: string;
837
+ displayName?: string;
838
+ providerUserId?: string;
839
+ }>;
840
+ };
841
+ }
842
+
843
+ /** Relevant assets like currencies with name image information so that the client
844
+ * can render name/image
845
+ */
846
+ interface StackedAssets {
847
+ currencies: Record<string, {
848
+ name: string;
849
+ image: string;
850
+ }>;
797
851
  }
798
852
 
799
853
  /** Base campaigns response - shared fields between client and server */
800
854
  interface StackedCampaignsBaseResponse extends StackedUserResponse {
801
855
  /** List of offers/campaigns for the player */
802
856
  offers: StackedOffer[];
803
- /** Player's currency balances */
857
+ /**
858
+ * @deprecated
859
+ * look at assets for currencies asset information name/image. The actually currencies on
860
+ * the player is in stackedUser.currencies */
804
861
  currencies?: StackedEntityCurrencies;
862
+ /** Relevant assets like currencies with name image information so that the client
863
+ * can render name/image
864
+ */
865
+ assets: StackedAssets;
805
866
  }
806
- /** Client-side campaigns response (from JWT-authenticated endpoints) */
867
+ /** Client-side campaigns response (from JWT-authenticated endpoints). Returns a list of offers plus
868
+ * user snapshot and stacked user-specific data.
869
+ */
807
870
  type StackedCampaignsResponse = StackedCampaignsBaseResponse;
808
- /** Server-side campaigns response (from API key authenticated endpoints) */
871
+ /** Server-side campaigns response (from API key authenticated endpoints). Returns a list of offers plus
872
+ * user snapshot and stacked user-specific data. */
809
873
  interface StackedCampaignsServerResponse extends StackedCampaignsBaseResponse {
810
874
  /** @deprecated iframe session token for subsequent client calls */
811
- token: string;
875
+ token?: string;
812
876
  /** Game/app ID */
813
877
  gameId: string;
814
878
  /** @deprecated use player.snapshot instead */
815
- playerSnapshot: StackedSnapshot;
879
+ playerSnapshot?: StackedSnapshot;
816
880
  /** @deprecated use player.stackedData instead */
817
- playerData: StackedEntityData;
818
- }
819
-
820
- type StackedRewardKind = RewardKind;
821
- interface StackedReward extends IReward {
822
- image?: string;
881
+ playerData?: StackedEntityData;
823
882
  }
824
883
 
825
884
  type StackedEnv = IEnv;
826
885
 
827
- export type { IClientPlayerData, StackedAppConnection, StackedBaseOffer, StackedBaseUser, StackedBaseUserExtra, StackedCampaignsResponse, StackedCampaignsServerResponse, StackedCompletionConditions, StackedEntityCurrencies, StackedEntityData, StackedEnv, StackedOffer, StackedReward, StackedRewardKind, StackedSnapshot, StackedSnapshotProgress, StackedUser, StackedUserOffer, StackedUserResponse, StackedUserWithAppConnections, UserOfferStatus };
886
+ 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.3",
3
+ "version": "1.9.11",
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": {