@stackedapp/types 1.15.4 → 1.15.6
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 +4 -0
- package/dist/stacked-types.d.ts +33 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -14,6 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.isEmptyDelta = void 0;
|
|
17
18
|
// Re-export all public types
|
|
18
19
|
__exportStar(require("./stacked_offer"), exports);
|
|
19
20
|
__exportStar(require("./stacked_reward"), exports);
|
|
@@ -23,4 +24,7 @@ __exportStar(require("./stacked_response"), exports);
|
|
|
23
24
|
__exportStar(require("./stacked_content"), exports);
|
|
24
25
|
__exportStar(require("./stacked_app"), exports);
|
|
25
26
|
__exportStar(require("./stacked_currency"), exports);
|
|
27
|
+
// Re-export delta types for real-time updates
|
|
28
|
+
var player_delta_1 = require("@stackedplatform/types/pubsub/player_delta");
|
|
29
|
+
Object.defineProperty(exports, "isEmptyDelta", { enumerable: true, get: function () { return player_delta_1.isEmptyDelta; } });
|
|
26
30
|
//# sourceMappingURL=index.js.map
|
package/dist/stacked-types.d.ts
CHANGED
|
@@ -1,3 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unified delta format for real-time player updates via SSE.
|
|
3
|
+
* Used for both offer tracker updates and snapshot updates.
|
|
4
|
+
*/
|
|
5
|
+
interface PlayerDelta {
|
|
6
|
+
/** What type of data is being updated */
|
|
7
|
+
target: 'offers' | 'snapshot';
|
|
8
|
+
/** For offer updates: the affected playerOffer IDs */
|
|
9
|
+
offers?: string[];
|
|
10
|
+
/** Replace value: local[path] = value */
|
|
11
|
+
set?: Record<string, unknown>;
|
|
12
|
+
/** Increment value: local[path] = (local[path] ?? 0) + delta */
|
|
13
|
+
inc?: Record<string, number>;
|
|
14
|
+
/** Keep minimum: local[path] = Math.min(local[path], value) */
|
|
15
|
+
min?: Record<string, number>;
|
|
16
|
+
/** Keep maximum: local[path] = Math.max(local[path], value) */
|
|
17
|
+
max?: Record<string, number>;
|
|
18
|
+
/** Remove fields: delete local[path] */
|
|
19
|
+
unset?: string[];
|
|
20
|
+
/** Add to array if not exists (match by key like address, identifier, playerId) */
|
|
21
|
+
addToSet?: Record<string, unknown[]>;
|
|
22
|
+
/** Append to array (allows duplicates) */
|
|
23
|
+
push?: Record<string, unknown[]>;
|
|
24
|
+
/** Remove from array where matches criteria */
|
|
25
|
+
pull?: Record<string, unknown[]>;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Helper to check if a delta has any operations
|
|
29
|
+
*/
|
|
30
|
+
declare function isEmptyDelta(delta: PlayerDelta): boolean;
|
|
31
|
+
|
|
1
32
|
interface Stringable {
|
|
2
33
|
toString(): string;
|
|
3
34
|
}
|
|
@@ -1570,4 +1601,5 @@ type StackedCurrencyPrice = ILibraryCurrencyPrice;
|
|
|
1570
1601
|
|
|
1571
1602
|
type StackedEnv = IEnv;
|
|
1572
1603
|
|
|
1573
|
-
export
|
|
1604
|
+
export { isEmptyDelta };
|
|
1605
|
+
export type { CompleteCryptoAuthResponse, CompleteOAuthResponse, CompleteOneTimeAuthResponse, ConditionDetail, ConditionResult, CurrencyUnit, DeleteAccountResponse, ExchangeOneTimeTokenForSessionTokenResponse, ExchangeStackedLinkTokenResponse, GenerateStackedLinkTokenResponse, GetOneTimeAuthTokenResponse, IClientPlayerData, InitializeUnifiedUserResponse, LinkExternalGameToUnifiedAccountResponse, PlayerDelta, RemoveAuthMethodResponse, RemoveOAuthProviderResponse, SignOutUnifiedUserResponse, StackedAppConnection, StackedAppState, StackedBaseConditions, StackedBaseOffer, StackedBaseUser, StackedBaseUserExtra, StackedCampaignsResponse, StackedCampaignsServerResponse, StackedClaimableConditions, StackedClaimableTrackers, StackedCompletionConditions, StackedCompletionDynamicTracker, StackedCompletionTrackers, StackedContentItem, StackedContentResponse, StackedContentStats, StackedCurrency, StackedCurrencyPrice, StackedDynamicCondition, StackedDynamicGroup, StackedEntityCurrencies, StackedEntityData, StackedEnv, StackedOffer, StackedOfferHelpers, StackedOfferTrackers, StackedReward, StackedRewardKind, StackedSnapshot, StackedSnapshotProgress, StackedSocialTrackerAccumulate, StackedSocialTrackerAttach, StackedSupportedNetwork, StackedThirdPartyApp, StackedUser, StackedUserComplete, StackedUserOffer, StackedUserResponse, StackedUserWithApps, StartCryptoAuthResponse, StartOAuthAttachResponse, StartOAuthResponse, StartOneTimeAuthResponse, TeamProgress, UnlinkExternalGameFromUnifiedAccountResponse, UserOfferStatus };
|