@stackedapp/types 1.15.9 → 1.15.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
@@ -14,7 +14,6 @@ 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;
18
17
  // Re-export all public types
19
18
  __exportStar(require("./stacked_offer"), exports);
20
19
  __exportStar(require("./stacked_reward"), exports);
@@ -24,7 +23,4 @@ __exportStar(require("./stacked_response"), exports);
24
23
  __exportStar(require("./stacked_content"), exports);
25
24
  __exportStar(require("./stacked_app"), exports);
26
25
  __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; } });
30
26
  //# sourceMappingURL=index.js.map
@@ -1,34 +1,3 @@
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
-
32
1
  interface Stringable {
33
2
  toString(): string;
34
3
  }
@@ -772,6 +741,28 @@ type StackedEntityCurrencies = Record<string, IPlayerDataCurrency>;
772
741
  type StackedEntityData = Pick<IPlayerData, 'gameId' | 'playerId'> & {
773
742
  currencies?: StackedEntityCurrencies;
774
743
  };
744
+ interface StackedPlayerDelta {
745
+ /** What type of data is being updated */
746
+ target: 'offers' | 'snapshot';
747
+ /** For offer updates: the affected playerOffer IDs */
748
+ offers?: string[];
749
+ /** Replace value: local[path] = value */
750
+ set?: Record<string, unknown>;
751
+ /** Increment value: local[path] = (local[path] ?? 0) + delta */
752
+ inc?: Record<string, number>;
753
+ /** Keep minimum: local[path] = Math.min(local[path], value) */
754
+ min?: Record<string, number>;
755
+ /** Keep maximum: local[path] = Math.max(local[path], value) */
756
+ max?: Record<string, number>;
757
+ /** Remove fields: delete local[path] */
758
+ unset?: string[];
759
+ /** Add to array if not exists (match by key like address, identifier, playerId) */
760
+ addToSet?: Record<string, unknown[]>;
761
+ /** Append to array (allows duplicates) */
762
+ push?: Record<string, unknown[]>;
763
+ /** Remove from array where matches criteria */
764
+ pull?: Record<string, unknown[]>;
765
+ }
775
766
 
776
767
  type StackedBaseConditions = IBaseCondition;
777
768
  type StackedCompletionConditions = ICompletionCondition;
@@ -1604,5 +1595,4 @@ type StackedCurrencyPrice = ILibraryCurrencyPrice;
1604
1595
 
1605
1596
  type StackedEnv = IEnv;
1606
1597
 
1607
- export { isEmptyDelta };
1608
- 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 };
1598
+ export type { CompleteCryptoAuthResponse, CompleteOAuthResponse, CompleteOneTimeAuthResponse, ConditionDetail, ConditionResult, CurrencyUnit, DeleteAccountResponse, ExchangeOneTimeTokenForSessionTokenResponse, ExchangeStackedLinkTokenResponse, GenerateStackedLinkTokenResponse, GetOneTimeAuthTokenResponse, IClientPlayerData, InitializeUnifiedUserResponse, LinkExternalGameToUnifiedAccountResponse, 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, StackedPlayerDelta, StackedReward, StackedRewardKind, StackedSnapshot, StackedSnapshotProgress, StackedSocialTrackerAccumulate, StackedSocialTrackerAttach, StackedSupportedNetwork, StackedThirdPartyApp, StackedUser, StackedUserComplete, StackedUserOffer, StackedUserResponse, StackedUserWithApps, StartCryptoAuthResponse, StartOAuthAttachResponse, StartOAuthResponse, StartOneTimeAuthResponse, TeamProgress, UnlinkExternalGameFromUnifiedAccountResponse, UserOfferStatus };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stackedapp/types",
3
- "version": "1.15.9",
3
+ "version": "1.15.11",
4
4
  "description": "Public types for Stacked platform SDK",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/stacked-types.d.ts",