async-playfab-web-sdk 1.192.250526 → 1.193.250606-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/{Addon.d.mts → Addon.d.ts} +213 -73
- package/dist/Addon.js +8 -0
- package/dist/Addon.js.map +1 -1
- package/dist/{Admin.d.mts → Admin.d.ts} +2547 -356
- package/dist/Admin.js +8 -0
- package/dist/Admin.js.map +1 -1
- package/dist/{Authentication.d.mts → Authentication.d.ts} +36 -9
- package/dist/Authentication.js +8 -0
- package/dist/Authentication.js.map +1 -1
- package/dist/{Client.d.mts → Client.d.ts} +2473 -557
- package/dist/Client.js +8 -0
- package/dist/Client.js.map +1 -1
- package/dist/{CloudScript.d.mts → CloudScript.d.ts} +214 -46
- package/dist/CloudScript.js +8 -0
- package/dist/CloudScript.js.map +1 -1
- package/dist/{Data.d.mts → Data.d.ts} +144 -25
- package/dist/Data.js +8 -0
- package/dist/Data.js.map +1 -1
- package/dist/{Economy.d.mts → Economy.d.ts} +1218 -173
- package/dist/Economy.js +8 -0
- package/dist/Economy.js.map +1 -1
- package/dist/{Events.d.mts → Events.d.ts} +212 -25
- package/dist/Events.js +8 -0
- package/dist/Events.js.map +1 -1
- package/dist/{Experimentation.d.mts → Experimentation.d.ts} +177 -30
- package/dist/Experimentation.js +8 -0
- package/dist/Experimentation.js.map +1 -1
- package/dist/{Groups.d.mts → Groups.d.ts} +306 -67
- package/dist/Groups.js +8 -0
- package/dist/Groups.js.map +1 -1
- package/dist/{Insights.d.mts → Insights.d.ts} +39 -13
- package/dist/Insights.js +8 -0
- package/dist/Insights.js.map +1 -1
- package/dist/{Localization.d.mts → Localization.d.ts} +6 -3
- package/dist/Localization.js +8 -0
- package/dist/Localization.js.map +1 -1
- package/dist/Matchmaker.d.ts +271 -0
- package/dist/Matchmaker.js +8 -0
- package/dist/Matchmaker.js.map +1 -0
- package/dist/{Multiplayer.d.mts → Multiplayer.d.ts} +2829 -301
- package/dist/Multiplayer.js +8 -0
- package/dist/Multiplayer.js.map +1 -1
- package/dist/{PlayFabCommon-BUv4zqXf.d.mts → PlayFabCommon-Dnp_xHg5.d.ts} +6 -10
- package/dist/{Profiles.d.mts → Profiles.d.ts} +172 -28
- package/dist/Profiles.js +8 -0
- package/dist/Profiles.js.map +1 -1
- package/dist/{Progression.d.mts → Progression.d.ts} +337 -73
- package/dist/Progression.js +8 -0
- package/dist/Progression.js.map +1 -1
- package/dist/{Server.d.mts → Server.d.ts} +2120 -458
- package/dist/Server.js +8 -0
- package/dist/Server.js.map +1 -1
- package/dist/chunk-4E2KRRDD.js +357 -0
- package/dist/chunk-4E2KRRDD.js.map +1 -0
- package/dist/chunk-7CBRLK5L.js +22 -0
- package/dist/chunk-7CBRLK5L.js.map +1 -0
- package/dist/{Localization.mjs → chunk-B6REENP7.js} +43 -94
- package/dist/chunk-B6REENP7.js.map +1 -0
- package/dist/chunk-DXAOLJHK.js +82 -0
- package/dist/chunk-DXAOLJHK.js.map +1 -0
- package/dist/chunk-EBJBJXQD.js +421 -0
- package/dist/chunk-EBJBJXQD.js.map +1 -0
- package/dist/chunk-GJBETVD4.js +237 -0
- package/dist/chunk-GJBETVD4.js.map +1 -0
- package/dist/chunk-JBOTM62B.js +2387 -0
- package/dist/chunk-JBOTM62B.js.map +1 -0
- package/dist/chunk-JOLCAGAW.js +2970 -0
- package/dist/chunk-JOLCAGAW.js.map +1 -0
- package/dist/chunk-KGYLMZG2.js +175 -0
- package/dist/chunk-KGYLMZG2.js.map +1 -0
- package/dist/chunk-PDLKO3WE.js +2477 -0
- package/dist/chunk-PDLKO3WE.js.map +1 -0
- package/dist/chunk-PSQSJQ3D.js +2673 -0
- package/dist/chunk-PSQSJQ3D.js.map +1 -0
- package/dist/chunk-RGHAECKS.js +197 -0
- package/dist/chunk-RGHAECKS.js.map +1 -0
- package/dist/chunk-SFUUCWPC.js +76 -0
- package/dist/chunk-SFUUCWPC.js.map +1 -0
- package/dist/chunk-SYWVDBNU.js +270 -0
- package/dist/chunk-SYWVDBNU.js.map +1 -0
- package/dist/chunk-T5SJ77OD.js +225 -0
- package/dist/chunk-T5SJ77OD.js.map +1 -0
- package/dist/chunk-VSRO2RWK.js +1048 -0
- package/dist/chunk-VSRO2RWK.js.map +1 -0
- package/dist/chunk-XPNV2H5D.js +421 -0
- package/dist/chunk-XPNV2H5D.js.map +1 -0
- package/dist/chunk-Z7SMY2UK.js +82 -0
- package/dist/chunk-Z7SMY2UK.js.map +1 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.js +72 -0
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
- package/dist/Addon.mjs +0 -452
- package/dist/Addon.mjs.map +0 -1
- package/dist/Admin.mjs +0 -1112
- package/dist/Admin.mjs.map +0 -1
- package/dist/Authentication.mjs +0 -290
- package/dist/Authentication.mjs.map +0 -1
- package/dist/Client.mjs +0 -1893
- package/dist/Client.mjs.map +0 -1
- package/dist/CloudScript.mjs +0 -349
- package/dist/CloudScript.mjs.map +0 -1
- package/dist/Data.mjs +0 -291
- package/dist/Data.mjs.map +0 -1
- package/dist/Economy.mjs +0 -614
- package/dist/Economy.mjs.map +0 -1
- package/dist/Events.mjs +0 -327
- package/dist/Events.mjs.map +0 -1
- package/dist/Experimentation.mjs +0 -333
- package/dist/Experimentation.mjs.map +0 -1
- package/dist/Groups.mjs +0 -417
- package/dist/Groups.mjs.map +0 -1
- package/dist/Insights.mjs +0 -286
- package/dist/Insights.mjs.map +0 -1
- package/dist/Localization.mjs.map +0 -1
- package/dist/Multiplayer.mjs +0 -862
- package/dist/Multiplayer.mjs.map +0 -1
- package/dist/Profiles.mjs +0 -306
- package/dist/Profiles.mjs.map +0 -1
- package/dist/Progression.mjs +0 -404
- package/dist/Progression.mjs.map +0 -1
- package/dist/Server.mjs +0 -1377
- package/dist/Server.mjs.map +0 -1
- package/dist/index.d.mts +0 -17
- package/dist/index.mjs +0 -6007
- package/dist/index.mjs.map +0 -1
@@ -1,4 +1,4 @@
|
|
1
|
-
import { I as IPlayFabRequestCommon, a as IPlayFabResultCommon, P as PlayFabCommon } from './PlayFabCommon-
|
1
|
+
import { I as IPlayFabRequestCommon, a as IPlayFabResultCommon, P as PlayFabCommon } from './PlayFabCommon-Dnp_xHg5.js';
|
2
2
|
|
3
3
|
interface AbortFileUploadsRequest extends IPlayFabRequestCommon {
|
4
4
|
/** The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). */
|
@@ -8,7 +8,7 @@ interface AbortFileUploadsRequest extends IPlayFabRequestCommon {
|
|
8
8
|
/** Names of the files to have their pending uploads aborted. */
|
9
9
|
FileNames: string[];
|
10
10
|
/**
|
11
|
-
* The expected version of the profile, if set and doesn
|
11
|
+
* The expected version of the profile, if set and doesn't match the current version of the profile the operation will not
|
12
12
|
* be performed.
|
13
13
|
*/
|
14
14
|
ProfileVersion?: number;
|
@@ -27,7 +27,7 @@ interface DeleteFilesRequest extends IPlayFabRequestCommon {
|
|
27
27
|
/** Names of the files to be deleted. */
|
28
28
|
FileNames: string[];
|
29
29
|
/**
|
30
|
-
* The expected version of the profile, if set and doesn
|
30
|
+
* The expected version of the profile, if set and doesn't match the current version of the profile the operation will not
|
31
31
|
* be performed.
|
32
32
|
*/
|
33
33
|
ProfileVersion?: number;
|
@@ -43,13 +43,18 @@ interface EntityKey {
|
|
43
43
|
Id: string;
|
44
44
|
/** Entity type. See https://docs.microsoft.com/gaming/playfab/features/data/entities/available-built-in-entity-types */
|
45
45
|
Type?: string;
|
46
|
+
/**
|
47
|
+
* Alternate name for Type.
|
48
|
+
* @deprecated Please use Type instead.
|
49
|
+
*/
|
50
|
+
TypeString?: string;
|
46
51
|
}
|
47
52
|
interface FinalizeFileUploadsRequest extends IPlayFabRequestCommon {
|
48
53
|
/** The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). */
|
49
54
|
CustomTags?: Record<string, string | null>;
|
50
55
|
/** The entity to perform this action on. */
|
51
56
|
Entity: EntityKey;
|
52
|
-
/** Names of the files to be finalized. Restricted to a-Z, 0-9,
|
57
|
+
/** Names of the files to be finalized. Restricted to a-Z, 0-9, '(', ')', '_', '-' and '.' */
|
53
58
|
FileNames: string[];
|
54
59
|
/** The current version of the profile, can be used for concurrency control during updates. */
|
55
60
|
ProfileVersion: number;
|
@@ -57,7 +62,7 @@ interface FinalizeFileUploadsRequest extends IPlayFabRequestCommon {
|
|
57
62
|
interface FinalizeFileUploadsResponse extends IPlayFabResultCommon {
|
58
63
|
/** The entity id and type. */
|
59
64
|
Entity?: EntityKey;
|
60
|
-
/** Collection of metadata for the entity
|
65
|
+
/** Collection of metadata for the entity's files */
|
61
66
|
Metadata?: Record<string, GetFileMetadata>;
|
62
67
|
/** The current version of the profile, can be used for concurrency control during updates. */
|
63
68
|
ProfileVersion: number;
|
@@ -71,7 +76,7 @@ interface GetFileMetadata {
|
|
71
76
|
FileName?: string;
|
72
77
|
/** Last UTC time the file was modified */
|
73
78
|
LastModified: string;
|
74
|
-
/** Storage service
|
79
|
+
/** Storage service's reported byte count */
|
75
80
|
Size: number;
|
76
81
|
}
|
77
82
|
interface GetFilesRequest extends IPlayFabRequestCommon {
|
@@ -83,7 +88,7 @@ interface GetFilesRequest extends IPlayFabRequestCommon {
|
|
83
88
|
interface GetFilesResponse extends IPlayFabResultCommon {
|
84
89
|
/** The entity id and type. */
|
85
90
|
Entity?: EntityKey;
|
86
|
-
/** Collection of metadata for the entity
|
91
|
+
/** Collection of metadata for the entity's files */
|
87
92
|
Metadata?: Record<string, GetFileMetadata>;
|
88
93
|
/** The current version of the profile, can be used for concurrency control during updates. */
|
89
94
|
ProfileVersion: number;
|
@@ -118,10 +123,10 @@ interface InitiateFileUploadsRequest extends IPlayFabRequestCommon {
|
|
118
123
|
CustomTags?: Record<string, string | null>;
|
119
124
|
/** The entity to perform this action on. */
|
120
125
|
Entity: EntityKey;
|
121
|
-
/** Names of the files to be set. Restricted to a-Z, 0-9,
|
126
|
+
/** Names of the files to be set. Restricted to a-Z, 0-9, '(', ')', '_', '-' and '.' */
|
122
127
|
FileNames: string[];
|
123
128
|
/**
|
124
|
-
* The expected version of the profile, if set and doesn
|
129
|
+
* The expected version of the profile, if set and doesn't match the current version of the profile the operation will not
|
125
130
|
* be performed.
|
126
131
|
*/
|
127
132
|
ProfileVersion?: number;
|
@@ -139,7 +144,7 @@ interface ObjectResult {
|
|
139
144
|
DataObject?: any;
|
140
145
|
/** Escaped string JSON body of the object, if EscapeObject is true. */
|
141
146
|
EscapedDataObject?: string;
|
142
|
-
/** Name of the object. Restricted to a-Z, 0-9,
|
147
|
+
/** Name of the object. Restricted to a-Z, 0-9, '(', ')', '_', '-' and '.' */
|
143
148
|
ObjectName?: string;
|
144
149
|
}
|
145
150
|
interface SetObject {
|
@@ -155,7 +160,7 @@ interface SetObject {
|
|
155
160
|
* exists, or no operation will occur if it does not exist. Only one of DataObject or EscapedDataObject fields may be used.
|
156
161
|
*/
|
157
162
|
EscapedDataObject?: string;
|
158
|
-
/** Name of object. Restricted to a-Z, 0-9,
|
163
|
+
/** Name of object. Restricted to a-Z, 0-9, '(', ')', '_', '-' and '.'. */
|
159
164
|
ObjectName: string;
|
160
165
|
}
|
161
166
|
interface SetObjectInfo {
|
@@ -190,39 +195,153 @@ interface SetObjectsResponse extends IPlayFabResultCommon {
|
|
190
195
|
declare class PlayFabDataApi extends PlayFabCommon {
|
191
196
|
/**
|
192
197
|
* Abort pending file uploads to an entity's profile.
|
193
|
-
*
|
198
|
+
*
|
199
|
+
* {@link https://docs.microsoft.com/rest/api/playfab/file/file/abortfileuploads Microsoft Documentation}
|
200
|
+
* @example
|
201
|
+
* await fileClient.AbortFileUploads({
|
202
|
+
* "FileNames": [
|
203
|
+
* "avatar",
|
204
|
+
* "game_state"
|
205
|
+
* ],
|
206
|
+
* "Entity": {
|
207
|
+
* "Id": "ID",
|
208
|
+
* "Type": "title_player_account",
|
209
|
+
* "TypeString": "title_player_account"
|
210
|
+
* }
|
211
|
+
* });
|
194
212
|
*/
|
195
|
-
AbortFileUploads(request: AbortFileUploadsRequest,
|
213
|
+
AbortFileUploads(request: AbortFileUploadsRequest, extraHeaders?: Record<string, string>): Promise<AbortFileUploadsResponse>;
|
196
214
|
/**
|
197
215
|
* Delete files on an entity's profile.
|
198
|
-
*
|
216
|
+
*
|
217
|
+
* {@link https://docs.microsoft.com/rest/api/playfab/file/file/deletefiles Microsoft Documentation}
|
218
|
+
* @example
|
219
|
+
* await fileClient.DeleteFiles({
|
220
|
+
* "FileNames": [
|
221
|
+
* "game_state",
|
222
|
+
* "avatar"
|
223
|
+
* ],
|
224
|
+
* "Entity": {
|
225
|
+
* "Id": "ID",
|
226
|
+
* "Type": "title_player_account",
|
227
|
+
* "TypeString": "title_player_account"
|
228
|
+
* }
|
229
|
+
* });
|
199
230
|
*/
|
200
|
-
DeleteFiles(request: DeleteFilesRequest,
|
231
|
+
DeleteFiles(request: DeleteFilesRequest, extraHeaders?: Record<string, string>): Promise<DeleteFilesResponse>;
|
201
232
|
/**
|
202
233
|
* Finalize file uploads to an entity's profile.
|
203
|
-
*
|
234
|
+
*
|
235
|
+
* {@link https://docs.microsoft.com/rest/api/playfab/file/file/finalizefileuploads Microsoft Documentation}
|
236
|
+
* @example
|
237
|
+
* await fileClient.FinalizeFileUploads({
|
238
|
+
* "ProfileVersion": 0,
|
239
|
+
* "FileNames": [
|
240
|
+
* "avatar",
|
241
|
+
* "game_state"
|
242
|
+
* ],
|
243
|
+
* "Entity": {
|
244
|
+
* "Id": "ID",
|
245
|
+
* "Type": "title_player_account",
|
246
|
+
* "TypeString": "title_player_account"
|
247
|
+
* }
|
248
|
+
* });
|
204
249
|
*/
|
205
|
-
FinalizeFileUploads(request: FinalizeFileUploadsRequest,
|
250
|
+
FinalizeFileUploads(request: FinalizeFileUploadsRequest, extraHeaders?: Record<string, string>): Promise<FinalizeFileUploadsResponse>;
|
206
251
|
/**
|
207
252
|
* Retrieves file metadata from an entity's profile.
|
208
|
-
*
|
253
|
+
*
|
254
|
+
* {@link https://docs.microsoft.com/rest/api/playfab/file/file/getfiles Microsoft Documentation}
|
255
|
+
* @example
|
256
|
+
* await fileClient.GetFiles({
|
257
|
+
* "Entity": {
|
258
|
+
* "Id": "ID",
|
259
|
+
* "Type": "title_player_account",
|
260
|
+
* "TypeString": "title_player_account"
|
261
|
+
* }
|
262
|
+
* });
|
209
263
|
*/
|
210
|
-
GetFiles(request: GetFilesRequest,
|
264
|
+
GetFiles(request: GetFilesRequest, extraHeaders?: Record<string, string>): Promise<GetFilesResponse>;
|
211
265
|
/**
|
212
266
|
* Retrieves objects from an entity's profile.
|
213
|
-
*
|
267
|
+
*
|
268
|
+
* {@link https://docs.microsoft.com/rest/api/playfab/object/object/getobjects Microsoft Documentation}
|
269
|
+
* @example
|
270
|
+
* await objectClient.GetObjects({
|
271
|
+
* "Entity": {
|
272
|
+
* "Id": "ABC90712ABC",
|
273
|
+
* "Type": "title_player_account",
|
274
|
+
* "TypeString": "title_player_account"
|
275
|
+
* }
|
276
|
+
* });
|
214
277
|
*/
|
215
|
-
GetObjects(request: GetObjectsRequest,
|
278
|
+
GetObjects(request: GetObjectsRequest, extraHeaders?: Record<string, string>): Promise<GetObjectsResponse>;
|
216
279
|
/**
|
217
280
|
* Initiates file uploads to an entity's profile.
|
218
|
-
*
|
281
|
+
*
|
282
|
+
* {@link https://docs.microsoft.com/rest/api/playfab/file/file/initiatefileuploads Microsoft Documentation}
|
283
|
+
* @example
|
284
|
+
* await fileClient.InitiateFileUploads({
|
285
|
+
* "FileNames": [
|
286
|
+
* "avatar",
|
287
|
+
* "game_state"
|
288
|
+
* ],
|
289
|
+
* "Entity": {
|
290
|
+
* "Id": "ID",
|
291
|
+
* "Type": "title_player_account",
|
292
|
+
* "TypeString": "title_player_account"
|
293
|
+
* }
|
294
|
+
* });
|
219
295
|
*/
|
220
|
-
InitiateFileUploads(request: InitiateFileUploadsRequest,
|
296
|
+
InitiateFileUploads(request: InitiateFileUploadsRequest, extraHeaders?: Record<string, string>): Promise<InitiateFileUploadsResponse>;
|
221
297
|
/**
|
222
298
|
* Sets objects on an entity's profile.
|
223
|
-
*
|
299
|
+
*
|
300
|
+
* {@link https://docs.microsoft.com/rest/api/playfab/object/object/setobjects Microsoft Documentation}
|
301
|
+
* @example
|
302
|
+
* await objectClient.SetObjects({
|
303
|
+
* "ExpectedProfileVersion": 5,
|
304
|
+
* "Objects": [
|
305
|
+
* {
|
306
|
+
* "ObjectName": "SaveSate",
|
307
|
+
* "DataObject": {
|
308
|
+
* "PlayerDetails": {
|
309
|
+
* "LastMissionSuccess": "2017-06-15T11:05:19Z",
|
310
|
+
* "LastMissionFailure": "2017-06-12T11:05:19Z",
|
311
|
+
* "MapPosition": [
|
312
|
+
* 22.0,
|
313
|
+
* 37.78
|
314
|
+
* ],
|
315
|
+
* "IsPaidUpgrade": true
|
316
|
+
* },
|
317
|
+
* "GameSettings": {
|
318
|
+
* "Screen": "FriendsList",
|
319
|
+
* "Favorites": [
|
320
|
+
* "Place 1",
|
321
|
+
* "Place 2"
|
322
|
+
* ]
|
323
|
+
* }
|
324
|
+
* },
|
325
|
+
* "SimpleStatements": {
|
326
|
+
* "Read": [
|
327
|
+
* {
|
328
|
+
* "Friend": true
|
329
|
+
* }
|
330
|
+
* ],
|
331
|
+
* "Write": [
|
332
|
+
* "Self"
|
333
|
+
* ]
|
334
|
+
* }
|
335
|
+
* }
|
336
|
+
* ],
|
337
|
+
* "Entity": {
|
338
|
+
* "Id": "A8140AB9109712B",
|
339
|
+
* "Type": "title_player_account",
|
340
|
+
* "TypeString": "title_player_account"
|
341
|
+
* }
|
342
|
+
* });
|
224
343
|
*/
|
225
|
-
SetObjects(request: SetObjectsRequest,
|
344
|
+
SetObjects(request: SetObjectsRequest, extraHeaders?: Record<string, string>): Promise<SetObjectsResponse>;
|
226
345
|
}
|
227
346
|
|
228
347
|
export { PlayFabDataApi as default };
|
package/dist/Data.js
ADDED
package/dist/Data.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/apis/PlayFabDataApi.ts","../src/constants.ts","../src/PlayFabContext.ts","../src/PlayFabCommon.ts"],"sourcesContent":["import type {\n\n AbortFileUploadsRequest,\n DeleteFilesRequest,\n FinalizeFileUploadsRequest,\n GetFilesRequest,\n GetObjectsRequest,\n InitiateFileUploadsRequest,\n SetObjectsRequest,\n AbortFileUploadsResponse,\n DeleteFilesResponse,\n FinalizeFileUploadsResponse,\n GetFilesResponse,\n GetObjectsResponse,\n InitiateFileUploadsResponse,\n SetObjectsResponse,\n} from \"../types/PlayFabDataApi\";\nimport { PlayFabCommon } from \"../PlayFabCommon\";\n\nexport default class PlayFabDataApi extends PlayFabCommon {\n\n /**\n * Abort pending file uploads to an entity's profile.\n * https://docs.microsoft.com/rest/api/playfab/data/file/abortfileuploads\n */\n AbortFileUploads (request: AbortFileUploadsRequest, customData?: any, extraHeaders?: Record<string, string>) {\n return this.ExecuteRequestWrapper<AbortFileUploadsResponse>(\"/File/AbortFileUploads\", request, \"X-EntityToken\", customData, extraHeaders);\n }\n\n /**\n * Delete files on an entity's profile.\n * https://docs.microsoft.com/rest/api/playfab/data/file/deletefiles\n */\n DeleteFiles (request: DeleteFilesRequest, customData?: any, extraHeaders?: Record<string, string>) {\n return this.ExecuteRequestWrapper<DeleteFilesResponse>(\"/File/DeleteFiles\", request, \"X-EntityToken\", customData, extraHeaders);\n }\n\n /**\n * Finalize file uploads to an entity's profile.\n * https://docs.microsoft.com/rest/api/playfab/data/file/finalizefileuploads\n */\n FinalizeFileUploads (request: FinalizeFileUploadsRequest, customData?: any, extraHeaders?: Record<string, string>) {\n return this.ExecuteRequestWrapper<FinalizeFileUploadsResponse>(\"/File/FinalizeFileUploads\", request, \"X-EntityToken\", customData, extraHeaders);\n }\n\n /**\n * Retrieves file metadata from an entity's profile.\n * https://docs.microsoft.com/rest/api/playfab/data/file/getfiles\n */\n GetFiles (request: GetFilesRequest, customData?: any, extraHeaders?: Record<string, string>) {\n return this.ExecuteRequestWrapper<GetFilesResponse>(\"/File/GetFiles\", request, \"X-EntityToken\", customData, extraHeaders);\n }\n\n /**\n * Retrieves objects from an entity's profile.\n * https://docs.microsoft.com/rest/api/playfab/data/object/getobjects\n */\n GetObjects (request: GetObjectsRequest, customData?: any, extraHeaders?: Record<string, string>) {\n return this.ExecuteRequestWrapper<GetObjectsResponse>(\"/Object/GetObjects\", request, \"X-EntityToken\", customData, extraHeaders);\n }\n\n /**\n * Initiates file uploads to an entity's profile.\n * https://docs.microsoft.com/rest/api/playfab/data/file/initiatefileuploads\n */\n InitiateFileUploads (request: InitiateFileUploadsRequest, customData?: any, extraHeaders?: Record<string, string>) {\n return this.ExecuteRequestWrapper<InitiateFileUploadsResponse>(\"/File/InitiateFileUploads\", request, \"X-EntityToken\", customData, extraHeaders);\n }\n\n /**\n * Sets objects on an entity's profile.\n * https://docs.microsoft.com/rest/api/playfab/data/object/setobjects\n */\n SetObjects (request: SetObjectsRequest, customData?: any, extraHeaders?: Record<string, string>) {\n return this.ExecuteRequestWrapper<SetObjectsResponse>(\"/Object/SetObjects\", request, \"X-EntityToken\", customData, extraHeaders);\n }\n\n};\n","export interface ISettings {\n /** You must set this value for PlayFabSdk to work properly (Found in the Game Manager for your title, at the PlayFab Website) */\n titleId: string;\n /** For security reasons you must never expose this value to the client or players - You must set this value for Server-APIs to work properly (Found in the Game Manager for your title, at the PlayFab Website) */\n developerSecretKey: string;\n productionServerUrl: string;\n GlobalHeaderInjection?: { [key: string]: string };\n /** The name of a customer vertical. This is only for customers running a private cluster. Generally you shouldn't touch this */\n verticalName?: string | null;\n}\n\nexport const AuthInfoMap = {\n \"X-EntityToken\": {\n authAttr: \"entityToken\",\n authError: \"errorEntityToken\",\n },\n \"X-Authorization\": {\n authAttr: \"sessionTicket\",\n authError: \"errorLoggedIn\",\n },\n \"X-SecretKey\": {\n authAttr: \"developerSecretKey\",\n authError: \"errorSecretKey\",\n },\n};\n\nexport default {\n sdkVersion: \"1.192.250526\",\n sdkFingerprint: \"JavaScriptSDK-1.192.250526\",\n buildIdentifier: \"custom_async-javascriptsdk\",\n defaultSettings: {\n titleId: \"\",\n developerSecretKey: \"\",\n GlobalHeaderInjection: {},\n productionServerUrl: \".playfabapi.com\",\n verticalName: null\n } as ISettings\n};\n","import constants, { type ISettings } from \"./constants\";\n\nexport type AuthContext = {\n PlayFabId: string | null;\n EntityId: string | null;\n EntityType: string | null;\n SessionTicket: string | null;\n EntityToken: string | null;\n};\n\nexport class PlayFabContext {\n private static _instance: PlayFabContext;\n\n settings: ISettings = constants.defaultSettings;\n\n authenticationContext: AuthContext = {\n PlayFabId: null,\n EntityId: null,\n EntityType: null,\n SessionTicket: null,\n EntityToken: null,\n };\n\n sessionTicket: string | null = null;\n\n entityToken: string | null = null;\n\n private constructor() {}\n\n public static get instance(): PlayFabContext {\n if (!PlayFabContext._instance) {\n PlayFabContext._instance = new PlayFabContext();\n }\n\n return PlayFabContext._instance;\n }\n}\n","import constants, { ISettings, AuthInfoMap } from \"./constants\";\nimport { AuthContext, PlayFabContext } from \"./PlayFabContext\";\nimport { IPlayFabError, IPlayFabResultCommon } from \"./types/PlayFab\";\n\nexport class PlayFabCommon {\n buildIdentifier: string = constants.buildIdentifier;\n requestGetParams = {\n sdk: constants.sdkFingerprint,\n } as const;\n errorTitleId = \"Must be have settings.titleId set to call this method\";\n errorLoggedIn = \"Must be logged in to call this method\";\n errorEntityToken =\n \"You must successfully call GetEntityToken before calling this\";\n errorSecretKey =\n \"Must have settings.developerSecretKey set to call this method\";\n private _context = PlayFabContext.instance;\n\n constructor(settings: Partial<ISettings> | undefined = undefined) {\n if (settings) {\n Object.assign(this._context.settings, settings);\n }\n }\n\n get settings() {\n return this._context.settings;\n }\n\n get authenticationContext() {\n return this._context.authenticationContext;\n }\n\n get sessionTicket() {\n return this._context.sessionTicket;\n }\n\n set sessionTicket(value: string | null) {\n this._context.sessionTicket = value;\n }\n\n get entityToken() {\n return this._context.entityToken;\n }\n\n set entityToken(value: string | null) {\n this._context.entityToken = value;\n }\n\n GetServerUrl() {\n if (!(this.settings.productionServerUrl.substring(0, 4) === \"http\")) {\n return `https://${this.settings.verticalName || this.settings.titleId}${\n this.settings.productionServerUrl\n }`;\n } else {\n return this.settings.productionServerUrl;\n }\n }\n\n InjectHeaders(\n xhr: XMLHttpRequest,\n headersObj: Record<string, string> | undefined\n ) {\n if (!headersObj) return;\n\n for (const headerKey in headersObj) {\n try {\n xhr.setRequestHeader(headerKey, headersObj[headerKey]);\n } catch (e) {\n console.log(\n `Failed to append header: ${headerKey} = ${headersObj[headerKey]} Error: ${e}`\n );\n }\n }\n }\n\n ExecuteRequest<T extends IPlayFabResultCommon>(\n url: string,\n body: any,\n authkey: string | null,\n authValue: string | null,\n customData: any,\n extraHeaders?: Record<string, string>\n ): Promise<T> {\n return new Promise((resolve, reject) => {\n if (body == null) body = {};\n\n var startTime = new Date().getTime();\n var requestBody = JSON.stringify(body);\n\n var urlArr = [url];\n var getParams = this.requestGetParams;\n if (getParams != null) {\n var firstParam = true;\n for (var key in getParams) {\n if (firstParam) {\n urlArr.push(\"?\");\n firstParam = false;\n } else {\n urlArr.push(\"&\");\n }\n urlArr.push(key);\n urlArr.push(\"=\");\n urlArr.push(getParams[key as keyof typeof getParams]);\n }\n }\n\n var completeUrl = urlArr.join(\"\");\n\n var xhr = new XMLHttpRequest();\n xhr.open(\"POST\", completeUrl, true);\n\n xhr.setRequestHeader(\"Content-Type\", \"application/json\");\n xhr.setRequestHeader(\n \"X-PlayFabSDK\",\n \"JavaScriptSDK-\" + constants.sdkVersion\n );\n if (authkey != null) {\n xhr.setRequestHeader(authkey, authValue!);\n }\n this.InjectHeaders(xhr, this.settings.GlobalHeaderInjection);\n this.InjectHeaders(xhr, extraHeaders);\n\n xhr.onloadend = () => {\n var result = this.GetPlayFabResponse(body, xhr, startTime, customData);\n if (result.code === 200) {\n resolve(result.data || result);\n } else {\n reject(result);\n }\n };\n\n xhr.onerror = () => {\n var result = this.GetPlayFabResponse(body, xhr, startTime, customData);\n reject(result);\n };\n\n xhr.send(requestBody);\n });\n }\n\n GetPlayFabResponse(\n request: any,\n xhr: XMLHttpRequest,\n startTime: number,\n customData: any\n ) {\n var result = null as any;\n try {\n // window.console.log(\"parsing json result: \" + xhr.responseText);\n result = JSON.parse(xhr.responseText);\n } catch (e) {\n result = {\n code: 503, // Service Unavailable\n status: \"Service Unavailable\",\n error: \"Connection error\",\n errorCode: 2, // PlayFabErrorCode.ConnectionError\n errorMessage: xhr.responseText,\n };\n }\n\n result.CallBackTimeMS = new Date().getTime() - startTime;\n result.Request = request;\n result.CustomData = customData;\n return result;\n }\n\n UpdateAuthenticationContext(currentAuthContext: AuthContext, result: any) {\n var authenticationContextUpdates = {} as AuthContext;\n if (result?.PlayFabId) {\n authenticationContextUpdates.PlayFabId = result.PlayFabId;\n }\n if (result?.SessionTicket) {\n authenticationContextUpdates.SessionTicket = result.SessionTicket;\n }\n if (result?.EntityToken) {\n authenticationContextUpdates.EntityId = result.EntityToken.Entity.Id;\n authenticationContextUpdates.EntityType = result.EntityToken.Entity.Type;\n authenticationContextUpdates.EntityToken = result.EntityToken.EntityToken;\n }\n // Update the authenticationContext with values from the result\n currentAuthContext = Object.assign(\n currentAuthContext,\n authenticationContextUpdates\n );\n\n this._context.authenticationContext = currentAuthContext;\n\n return currentAuthContext;\n }\n\n GetAuthInfo(request: any, authKey: string) {\n // Use the most-recently saved authKey, unless one was provided in the request via the AuthenticationContext\n var authError = AuthInfoMap[authKey as keyof typeof AuthInfoMap].authError;\n var authAttr = AuthInfoMap[authKey as keyof typeof AuthInfoMap].authAttr;\n var defaultAuthValue: string | null = null;\n if (authAttr === \"entityToken\") defaultAuthValue = this.entityToken;\n else if (authAttr === \"sessionTicket\")\n defaultAuthValue = this.sessionTicket;\n else if (authAttr === \"developerSecretKey\")\n defaultAuthValue = this.settings.developerSecretKey;\n var authValue = request.AuthenticationContext\n ? request.AuthenticationContext[authAttr]\n : defaultAuthValue;\n return { authKey, authValue, authError };\n }\n\n ExecuteRequestWrapper<T extends IPlayFabResultCommon>(\n apiURL: string,\n request: any,\n authKey: string | null,\n customData: any,\n extraHeaders?: Record<string, string>\n ) {\n var authValue = null;\n if (authKey !== null) {\n const { authError, ...authInfo } = this.GetAuthInfo(request, authKey);\n authKey = authInfo.authKey;\n authValue = authInfo.authValue;\n if (!authValue) throw authError;\n }\n return this.ExecuteRequest<T>(\n this.GetServerUrl() + apiURL,\n request,\n authKey,\n authValue,\n customData,\n extraHeaders\n );\n }\n\n GenerateErrorReport(error: IPlayFabError | null): string {\n if (error == null) return \"\";\n var fullErrors = error.errorMessage;\n for (var paramName in error.errorDetails)\n for (var msgIdx in error.errorDetails[paramName])\n fullErrors +=\n \"\\n\" + paramName + \": \" + error.errorDetails[paramName][msgIdx];\n return fullErrors;\n }\n\n ForgetAllCredentials() {\n this._context.sessionTicket = null;\n this._context.entityToken = null;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACWO,IAAM,cAAc;AAAA,EACzB,iBAAiB;AAAA,IACf,UAAU;AAAA,IACV,WAAW;AAAA,EACb;AAAA,EACA,mBAAmB;AAAA,IACjB,UAAU;AAAA,IACV,WAAW;AAAA,EACb;AAAA,EACA,eAAe;AAAA,IACb,UAAU;AAAA,IACV,WAAW;AAAA,EACb;AACF;AAEA,IAAO,oBAAQ;AAAA,EACb,YAAY;AAAA,EACZ,gBAAgB;AAAA,EAChB,iBAAiB;AAAA,EACjB,iBAAiB;AAAA,IACf,SAAS;AAAA,IACT,oBAAoB;AAAA,IACpB,uBAAuB,CAAC;AAAA,IACxB,qBAAqB;AAAA,IACrB,cAAc;AAAA,EAChB;AACF;;;AC3BO,IAAM,iBAAN,MAAM,gBAAe;AAAA,EAiBlB,cAAc;AAdtB,oBAAsB,kBAAU;AAEhC,iCAAqC;AAAA,MACnC,WAAW;AAAA,MACX,UAAU;AAAA,MACV,YAAY;AAAA,MACZ,eAAe;AAAA,MACf,aAAa;AAAA,IACf;AAEA,yBAA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