@wvdsh/api 0.1.70 → 0.1.72
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.
|
@@ -84,6 +84,17 @@ export declare const LEADERBOARD_METADATA_LIMITS: {
|
|
|
84
84
|
readonly MAX_STRING_VALUE_LENGTH: 256;
|
|
85
85
|
readonly MAX_TOTAL_BYTES: 2048;
|
|
86
86
|
};
|
|
87
|
+
export declare const PAID_CONTENT_TYPE: {
|
|
88
|
+
readonly DURABLE: "DURABLE";
|
|
89
|
+
readonly CONSUMABLE: "CONSUMABLE";
|
|
90
|
+
};
|
|
91
|
+
export type PaidContentType = (typeof PAID_CONTENT_TYPE)[keyof typeof PAID_CONTENT_TYPE];
|
|
92
|
+
export declare const FULFILL_PURCHASE_STATUS: {
|
|
93
|
+
readonly FULFILLED: "FULFILLED";
|
|
94
|
+
readonly ALREADY_FULFILLED: "ALREADY_FULFILLED";
|
|
95
|
+
readonly NOT_FOUND: "NOT_FOUND";
|
|
96
|
+
};
|
|
97
|
+
export type FulfillPurchaseStatus = (typeof FULFILL_PURCHASE_STATUS)[keyof typeof FULFILL_PURCHASE_STATUS];
|
|
87
98
|
export declare const UGC_TYPE: {
|
|
88
99
|
readonly SCREENSHOT: 0;
|
|
89
100
|
readonly VIDEO: 1;
|
|
@@ -133,12 +144,10 @@ export declare const IFRAME_MESSAGE_TYPE: {
|
|
|
133
144
|
readonly SDK_FUNCTION_CALLED: "SdkFunctionCalled";
|
|
134
145
|
readonly SET_MUTE: "SetMute";
|
|
135
146
|
readonly TOGGLE_MUTE: "ToggleMute";
|
|
136
|
-
readonly MUTE_CHANGED: "MuteChanged";
|
|
137
147
|
readonly OVERLAY_CHANGED: "OverlayChanged";
|
|
138
148
|
readonly GAMEPLAY_JWT_READY: "GameplayJwtReady";
|
|
139
149
|
readonly END_SESSION: "EndSession";
|
|
140
150
|
readonly TRIGGER_PAYWALL: "TriggerPaywall";
|
|
141
|
-
readonly ENTITLEMENTS_GRANTED: "EntitlementsGranted";
|
|
142
151
|
readonly LINK_COPIED: "LinkCopied";
|
|
143
152
|
};
|
|
144
153
|
export declare const GAME_ISOLATION_ERROR_PATTERN: RegExp;
|
|
@@ -176,9 +185,6 @@ export type IFrameEventPayloadMap = {
|
|
|
176
185
|
[IFRAME_MESSAGE_TYPE.VOLUME_CHANGED]: {
|
|
177
186
|
volume: number;
|
|
178
187
|
};
|
|
179
|
-
[IFRAME_MESSAGE_TYPE.MUTE_CHANGED]: {
|
|
180
|
-
isMuted: boolean;
|
|
181
|
-
};
|
|
182
188
|
[IFRAME_MESSAGE_TYPE.OVERLAY_CHANGED]: {
|
|
183
189
|
isOpen: boolean;
|
|
184
190
|
};
|
|
@@ -205,9 +211,7 @@ export type IFrameEventPayloadMap = {
|
|
|
205
211
|
};
|
|
206
212
|
[IFRAME_MESSAGE_TYPE.TRIGGER_PAYWALL]: {
|
|
207
213
|
purchased: boolean;
|
|
208
|
-
|
|
209
|
-
[IFRAME_MESSAGE_TYPE.ENTITLEMENTS_GRANTED]: {
|
|
210
|
-
contentIdentifiers: string[];
|
|
214
|
+
type?: PaidContentType;
|
|
211
215
|
};
|
|
212
216
|
[IFRAME_MESSAGE_TYPE.LOADING_FAILED]: {
|
|
213
217
|
message: string;
|
|
@@ -62,6 +62,17 @@ export const LEADERBOARD_METADATA_LIMITS = {
|
|
|
62
62
|
MAX_STRING_VALUE_LENGTH: 256,
|
|
63
63
|
MAX_TOTAL_BYTES: 2048
|
|
64
64
|
};
|
|
65
|
+
// ========== PAID CONTENT ==========
|
|
66
|
+
// DURABLE: purchased once, never expires, gates build files. CONSUMABLE: repeatable, fulfilled by the game.
|
|
67
|
+
export const PAID_CONTENT_TYPE = {
|
|
68
|
+
DURABLE: 'DURABLE',
|
|
69
|
+
CONSUMABLE: 'CONSUMABLE'
|
|
70
|
+
};
|
|
71
|
+
export const FULFILL_PURCHASE_STATUS = {
|
|
72
|
+
FULFILLED: 'FULFILLED',
|
|
73
|
+
ALREADY_FULFILLED: 'ALREADY_FULFILLED',
|
|
74
|
+
NOT_FOUND: 'NOT_FOUND'
|
|
75
|
+
};
|
|
65
76
|
// ========== USER GENERATED CONTENT ==========
|
|
66
77
|
export const UGC_TYPE = {
|
|
67
78
|
SCREENSHOT: 0,
|
|
@@ -113,12 +124,10 @@ export const IFRAME_MESSAGE_TYPE = {
|
|
|
113
124
|
SDK_FUNCTION_CALLED: 'SdkFunctionCalled',
|
|
114
125
|
SET_MUTE: 'SetMute',
|
|
115
126
|
TOGGLE_MUTE: 'ToggleMute',
|
|
116
|
-
MUTE_CHANGED: 'MuteChanged',
|
|
117
127
|
OVERLAY_CHANGED: 'OverlayChanged',
|
|
118
128
|
GAMEPLAY_JWT_READY: 'GameplayJwtReady',
|
|
119
129
|
END_SESSION: 'EndSession',
|
|
120
130
|
TRIGGER_PAYWALL: 'TriggerPaywall',
|
|
121
|
-
ENTITLEMENTS_GRANTED: 'EntitlementsGranted',
|
|
122
131
|
LINK_COPIED: 'LinkCopied'
|
|
123
132
|
};
|
|
124
133
|
// Errors that mean a threaded build ran without cross-origin isolation, only meaningful when crossOriginIsolated is false.
|
|
@@ -355,10 +355,30 @@ export type PublicApiType = {
|
|
|
355
355
|
}>>;
|
|
356
356
|
};
|
|
357
357
|
paidContent: {
|
|
358
|
+
fulfillPurchase: FunctionReference<"mutation", "public", {
|
|
359
|
+
purchaseId: Id<"userPaidContent">;
|
|
360
|
+
}, {
|
|
361
|
+
status: "FULFILLED" | "ALREADY_FULFILLED" | "NOT_FOUND";
|
|
362
|
+
}>;
|
|
363
|
+
listNewAndUnfulfilled: FunctionReference<"query", "public", {
|
|
364
|
+
since: number;
|
|
365
|
+
}, Array<{
|
|
366
|
+
contentIdentifier: string;
|
|
367
|
+
fulfilled: boolean;
|
|
368
|
+
purchaseId: Id<"userPaidContent">;
|
|
369
|
+
purchasedAt: number;
|
|
370
|
+
receiptJwt: string;
|
|
371
|
+
type: "DURABLE" | "CONSUMABLE";
|
|
372
|
+
}>>;
|
|
358
373
|
mockPurchase: FunctionReference<"mutation", "public", {
|
|
359
374
|
contentIdentifier: string;
|
|
360
375
|
}, {
|
|
361
|
-
|
|
376
|
+
contentIdentifier: string;
|
|
377
|
+
fulfilled: boolean;
|
|
378
|
+
purchaseId: Id<"userPaidContent">;
|
|
379
|
+
purchasedAt: number;
|
|
380
|
+
receiptJwt: string;
|
|
381
|
+
type: "DURABLE" | "CONSUMABLE";
|
|
362
382
|
}>;
|
|
363
383
|
};
|
|
364
384
|
};
|