@stackedapp/types 1.9.0 → 1.9.1
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 +1 -0
- package/dist/stacked-types.d.ts +33 -7
- package/package.json +1 -1
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);
|
package/dist/stacked-types.d.ts
CHANGED
|
@@ -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'
|
|
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 */
|
|
@@ -798,6 +796,34 @@ interface StackedUserWithAppConnections {
|
|
|
798
796
|
};
|
|
799
797
|
}
|
|
800
798
|
|
|
799
|
+
/** Base campaigns response - shared fields between client and server */
|
|
800
|
+
interface StackedCampaignsBase {
|
|
801
|
+
/** Player snapshot and data */
|
|
802
|
+
player: StackedUserResponse;
|
|
803
|
+
/** List of offers/campaigns for the player */
|
|
804
|
+
offers: StackedOffer[];
|
|
805
|
+
/** Player's currency balances */
|
|
806
|
+
currencies?: StackedEntityCurrencies;
|
|
807
|
+
}
|
|
808
|
+
/** Client-side campaigns response (from JWT-authenticated endpoints) */
|
|
809
|
+
type StackedCampaigns = StackedCampaignsBase;
|
|
810
|
+
/** Server-side campaigns response (from API key authenticated endpoints) */
|
|
811
|
+
interface StackedCampaignsServer extends StackedCampaignsBase {
|
|
812
|
+
/** @deprecated iframe session token for subsequent client calls */
|
|
813
|
+
token: string;
|
|
814
|
+
/** Game/app ID */
|
|
815
|
+
gameId: string;
|
|
816
|
+
/** @deprecated use player.snapshot instead */
|
|
817
|
+
playerSnapshot: StackedSnapshot;
|
|
818
|
+
/** @deprecated use player.stackedData instead */
|
|
819
|
+
playerData: StackedEntityData;
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
type StackedRewardKind = RewardKind;
|
|
823
|
+
interface StackedReward extends IReward {
|
|
824
|
+
image?: string;
|
|
825
|
+
}
|
|
826
|
+
|
|
801
827
|
type StackedEnv = IEnv;
|
|
802
828
|
|
|
803
|
-
export type { IClientPlayerData, StackedAppConnection, StackedBaseOffer, StackedBaseUser, StackedBaseUserExtra, StackedCompletionConditions, StackedEntityData, StackedEnv, StackedOffer, StackedReward, StackedRewardKind, StackedSnapshot, StackedSnapshotProgress, StackedUser, StackedUserOffer, StackedUserResponse, StackedUserWithAppConnections, UserOfferStatus };
|
|
829
|
+
export type { IClientPlayerData, StackedAppConnection, StackedBaseOffer, StackedBaseUser, StackedBaseUserExtra, StackedCampaigns, StackedCampaignsServer, StackedCompletionConditions, StackedEntityCurrencies, StackedEntityData, StackedEnv, StackedOffer, StackedReward, StackedRewardKind, StackedSnapshot, StackedSnapshotProgress, StackedUser, StackedUserOffer, StackedUserResponse, StackedUserWithAppConnections, UserOfferStatus };
|