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 AdCampaignAttributionModel {
|
4
4
|
/** UTC time stamp of attribution */
|
@@ -23,6 +23,11 @@ interface EntityKey {
|
|
23
23
|
Id: string;
|
24
24
|
/** Entity type. See https://docs.microsoft.com/gaming/playfab/features/data/entities/available-built-in-entity-types */
|
25
25
|
Type?: string;
|
26
|
+
/**
|
27
|
+
* Alternate name for Type.
|
28
|
+
* @deprecated Please use Type instead.
|
29
|
+
*/
|
30
|
+
TypeString?: string;
|
26
31
|
}
|
27
32
|
interface EventHubFunctionModel {
|
28
33
|
/** The connection string for the event hub. */
|
@@ -78,17 +83,17 @@ interface ExecuteEntityCloudScriptRequest extends IPlayFabRequestCommon {
|
|
78
83
|
/** Object that is passed in to the function as the first argument */
|
79
84
|
FunctionParameter?: any;
|
80
85
|
/**
|
81
|
-
* Generate a
|
86
|
+
* Generate a 'entity_executed_cloudscript' PlayStream event containing the results of the function execution and other
|
82
87
|
* contextual information. This event will show up in the PlayStream debugger console for the player in Game Manager.
|
83
88
|
*/
|
84
89
|
GeneratePlayStreamEvent?: boolean;
|
85
90
|
/**
|
86
|
-
* Option for which revision of the CloudScript to execute.
|
87
|
-
* executes the current live, published revision, and
|
88
|
-
*
|
91
|
+
* Option for which revision of the CloudScript to execute. 'Latest' executes the most recently created revision, 'Live'
|
92
|
+
* executes the current live, published revision, and 'Specific' executes the specified revision. The default value is
|
93
|
+
* 'Specific', if the SpecificRevision parameter is specified, otherwise it is 'Live'.
|
89
94
|
*/
|
90
95
|
RevisionSelection?: string;
|
91
|
-
/** The specific revision to execute, when RevisionSelection is set to
|
96
|
+
/** The specific revision to execute, when RevisionSelection is set to 'Specific' */
|
92
97
|
SpecificRevision?: number;
|
93
98
|
}
|
94
99
|
interface ExecuteFunctionRequest extends IPlayFabRequestCommon {
|
@@ -101,7 +106,7 @@ interface ExecuteFunctionRequest extends IPlayFabRequestCommon {
|
|
101
106
|
/** Object that is passed in to the function as the FunctionArgument field of the FunctionExecutionContext data structure */
|
102
107
|
FunctionParameter?: any;
|
103
108
|
/**
|
104
|
-
* Generate a
|
109
|
+
* Generate a 'entity_executed_cloudscript_function' PlayStream event containing the results of the function execution and
|
105
110
|
* other contextual information. This event will show up in the PlayStream debugger console for the player in Game Manager.
|
106
111
|
*/
|
107
112
|
GeneratePlayStreamEvent?: boolean;
|
@@ -204,7 +209,7 @@ interface LocationModel {
|
|
204
209
|
interface LogStatement {
|
205
210
|
/** Optional object accompanying the message as contextual information */
|
206
211
|
Data?: any;
|
207
|
-
/**
|
212
|
+
/** 'Debug', 'Info', or 'Error' */
|
208
213
|
Level?: string;
|
209
214
|
Message?: string;
|
210
215
|
}
|
@@ -220,6 +225,8 @@ interface MembershipModel {
|
|
220
225
|
* overridden, this will be the new expiration time.
|
221
226
|
*/
|
222
227
|
OverrideExpiration?: string;
|
228
|
+
/** Whether the override expiration is set. */
|
229
|
+
OverrideIsSet?: boolean;
|
223
230
|
/** The list of subscriptions that this player has for this membership */
|
224
231
|
Subscriptions?: SubscriptionModel[];
|
225
232
|
}
|
@@ -232,7 +239,7 @@ interface NameIdentifier {
|
|
232
239
|
interface PlayerProfileModel {
|
233
240
|
/** List of advertising campaigns the player has been attributed to */
|
234
241
|
AdCampaignAttributions?: AdCampaignAttributionModel[];
|
235
|
-
/** URL of the player
|
242
|
+
/** URL of the player's avatar image */
|
236
243
|
AvatarUrl?: string;
|
237
244
|
/** If the player is currently banned, the UTC Date when the ban expires */
|
238
245
|
BannedUntil?: string;
|
@@ -266,16 +273,16 @@ interface PlayerProfileModel {
|
|
266
273
|
PushNotificationRegistrations?: PushNotificationRegistrationModel[];
|
267
274
|
/** List of leaderboard statistic values for the player */
|
268
275
|
Statistics?: StatisticModel[];
|
269
|
-
/** List of player
|
276
|
+
/** List of player's tags for segmentation */
|
270
277
|
Tags?: TagModel[];
|
271
278
|
/** Title ID this player profile applies to */
|
272
279
|
TitleId?: string;
|
273
280
|
/**
|
274
|
-
* Sum of the player
|
281
|
+
* Sum of the player's purchases made with real-money currencies, converted to US dollars equivalent and represented as a
|
275
282
|
* whole number of cents (1/100 USD). For example, 999 indicates nine dollars and ninety-nine cents.
|
276
283
|
*/
|
277
284
|
TotalValueToDateInUSD?: number;
|
278
|
-
/** List of the player
|
285
|
+
/** List of the player's lifetime purchase totals, summed by real-money currency */
|
279
286
|
ValuesToDate?: ValueToDateModel[];
|
280
287
|
}
|
281
288
|
interface PlayStreamEventEnvelopeModel {
|
@@ -311,6 +318,11 @@ interface PostFunctionResultForFunctionExecutionRequest extends IPlayFabRequestC
|
|
311
318
|
interface PostFunctionResultForPlayerTriggeredActionRequest extends IPlayFabRequestCommon {
|
312
319
|
/** The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). */
|
313
320
|
CustomTags?: Record<string, string | null>;
|
321
|
+
/**
|
322
|
+
* The optional entity to perform this action on. Defaults to the currently logged in entity.
|
323
|
+
* @deprecated Do not use
|
324
|
+
*/
|
325
|
+
Entity?: EntityKey;
|
314
326
|
/** The result of the function execution. */
|
315
327
|
FunctionResult: ExecuteFunctionResult;
|
316
328
|
/** The player profile the function was invoked with. */
|
@@ -321,6 +333,11 @@ interface PostFunctionResultForPlayerTriggeredActionRequest extends IPlayFabRequ
|
|
321
333
|
interface PostFunctionResultForScheduledTaskRequest extends IPlayFabRequestCommon {
|
322
334
|
/** The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). */
|
323
335
|
CustomTags?: Record<string, string | null>;
|
336
|
+
/**
|
337
|
+
* The entity to perform this action on.
|
338
|
+
* @deprecated Do not use
|
339
|
+
*/
|
340
|
+
Entity?: EntityKey;
|
324
341
|
/** The result of the function execution */
|
325
342
|
FunctionResult: ExecuteFunctionResult;
|
326
343
|
/** The id of the scheduled task that invoked the function. */
|
@@ -392,7 +409,7 @@ interface SubscriptionModel {
|
|
392
409
|
Expiration: string;
|
393
410
|
/** The time the subscription was orignially purchased */
|
394
411
|
InitialSubscriptionTime: string;
|
395
|
-
/** Whether this subscription is currently active. That is, if Expiration
|
412
|
+
/** Whether this subscription is currently active. That is, if Expiration > now. */
|
396
413
|
IsActive: boolean;
|
397
414
|
/** The status of this subscription, according to the subscription provider. */
|
398
415
|
Status?: string;
|
@@ -418,12 +435,12 @@ interface ValueToDateModel {
|
|
418
435
|
Currency?: string;
|
419
436
|
/**
|
420
437
|
* Total value of the purchases in a whole number of 1/100 monetary units. For example, 999 indicates nine dollars and
|
421
|
-
* ninety-nine cents when Currency is
|
438
|
+
* ninety-nine cents when Currency is 'USD')
|
422
439
|
*/
|
423
440
|
TotalValue: number;
|
424
441
|
/**
|
425
|
-
* Total value of the purchases in a string representation of decimal monetary units. For example,
|
426
|
-
* dollars and ninety-nine cents when Currency is
|
442
|
+
* Total value of the purchases in a string representation of decimal monetary units. For example, '9.99' indicates nine
|
443
|
+
* dollars and ninety-nine cents when Currency is 'USD'.
|
427
444
|
*/
|
428
445
|
TotalValueAsDecimal?: string;
|
429
446
|
}
|
@@ -432,80 +449,231 @@ declare class PlayFabCloudScriptApi extends PlayFabCommon {
|
|
432
449
|
/**
|
433
450
|
* Cloud Script is one of PlayFab's most versatile features. It allows client code to request execution of any kind of
|
434
451
|
* custom server-side functionality you can implement, and it can be used in conjunction with virtually anything.
|
435
|
-
*
|
452
|
+
*
|
453
|
+
* {@link https://docs.microsoft.com/rest/api/playfab/cloudscript/server-side-cloud-script/executeentitycloudscript Microsoft Documentation}
|
454
|
+
* @example
|
455
|
+
* await cloudscriptClient.ExecuteEntityCloudScript({
|
456
|
+
* "FunctionName": "levelCompleted",
|
457
|
+
* "FunctionParameter": {
|
458
|
+
* "level": 3,
|
459
|
+
* "points": 400
|
460
|
+
* },
|
461
|
+
* "RevisionSelection": "Live",
|
462
|
+
* "GeneratePlayStreamEvent": true,
|
463
|
+
* "Entity": {
|
464
|
+
* "Id": "aaa",
|
465
|
+
* "Type": "title_player_account",
|
466
|
+
* "TypeString": "title_player_account"
|
467
|
+
* }
|
468
|
+
* });
|
436
469
|
*/
|
437
|
-
ExecuteEntityCloudScript(request: ExecuteEntityCloudScriptRequest,
|
470
|
+
ExecuteEntityCloudScript(request: ExecuteEntityCloudScriptRequest, extraHeaders?: Record<string, string>): Promise<ExecuteCloudScriptResult>;
|
438
471
|
/**
|
439
472
|
* Cloud Script is one of PlayFab's most versatile features. It allows client code to request execution of any kind of
|
440
473
|
* custom server-side functionality you can implement, and it can be used in conjunction with virtually anything.
|
441
|
-
*
|
474
|
+
*
|
475
|
+
* {@link https://docs.microsoft.com/rest/api/playfab/cloudscript/server-side-cloud-script/executefunction Microsoft Documentation}
|
476
|
+
* @example
|
477
|
+
* await cloudscriptClient.ExecuteFunction({
|
478
|
+
* "FunctionName": "LevelCompleted",
|
479
|
+
* "FunctionParameter": {
|
480
|
+
* "level": 3,
|
481
|
+
* "points": 400
|
482
|
+
* },
|
483
|
+
* "GeneratePlayStreamEvent": true,
|
484
|
+
* "Entity": {
|
485
|
+
* "Id": "aaa",
|
486
|
+
* "Type": "title_player_account",
|
487
|
+
* "TypeString": "title_player_account"
|
488
|
+
* }
|
489
|
+
* });
|
442
490
|
*/
|
443
|
-
ExecuteFunction(request: ExecuteFunctionRequest,
|
491
|
+
ExecuteFunction(request: ExecuteFunctionRequest, extraHeaders?: Record<string, string>): Promise<ExecuteFunctionResult>;
|
444
492
|
/**
|
445
493
|
* Gets registered Azure Functions for a given title id and function name.
|
446
|
-
*
|
494
|
+
*
|
495
|
+
* {@link https://docs.microsoft.com/rest/api/playfab/cloudscript/server-side-cloud-script/getfunction Microsoft Documentation}
|
496
|
+
* @example
|
497
|
+
* await cloudscriptClient.GetFunction({
|
498
|
+
* "FunctionName": "LevelCompleted"
|
499
|
+
* });
|
447
500
|
*/
|
448
|
-
GetFunction(request: GetFunctionRequest,
|
501
|
+
GetFunction(request: GetFunctionRequest, extraHeaders?: Record<string, string>): Promise<GetFunctionResult>;
|
449
502
|
/**
|
450
503
|
* Lists all currently registered Event Hub triggered Azure Functions for a given title.
|
451
|
-
*
|
504
|
+
*
|
505
|
+
* {@link https://docs.microsoft.com/rest/api/playfab/cloudscript/server-side-cloud-script/listeventhubfunctions Microsoft Documentation}
|
506
|
+
* @example
|
507
|
+
* await cloudscriptClient.ListEventHubFunctions({});
|
452
508
|
*/
|
453
|
-
ListEventHubFunctions(request: ListFunctionsRequest,
|
509
|
+
ListEventHubFunctions(request: ListFunctionsRequest, extraHeaders?: Record<string, string>): Promise<ListEventHubFunctionsResult>;
|
454
510
|
/**
|
455
511
|
* Lists all currently registered Azure Functions for a given title.
|
456
|
-
*
|
512
|
+
*
|
513
|
+
* {@link https://docs.microsoft.com/rest/api/playfab/cloudscript/server-side-cloud-script/listfunctions Microsoft Documentation}
|
514
|
+
* @example
|
515
|
+
* await cloudscriptClient.ListFunctions({});
|
457
516
|
*/
|
458
|
-
ListFunctions(request: ListFunctionsRequest,
|
517
|
+
ListFunctions(request: ListFunctionsRequest, extraHeaders?: Record<string, string>): Promise<ListFunctionsResult>;
|
459
518
|
/**
|
460
519
|
* Lists all currently registered HTTP triggered Azure Functions for a given title.
|
461
|
-
*
|
520
|
+
*
|
521
|
+
* {@link https://docs.microsoft.com/rest/api/playfab/cloudscript/server-side-cloud-script/listhttpfunctions Microsoft Documentation}
|
522
|
+
* @example
|
523
|
+
* await cloudscriptClient.ListHttpFunctions({});
|
462
524
|
*/
|
463
|
-
ListHttpFunctions(request: ListFunctionsRequest,
|
525
|
+
ListHttpFunctions(request: ListFunctionsRequest, extraHeaders?: Record<string, string>): Promise<ListHttpFunctionsResult>;
|
464
526
|
/**
|
465
527
|
* Lists all currently registered Queue triggered Azure Functions for a given title.
|
466
|
-
*
|
528
|
+
*
|
529
|
+
* {@link https://docs.microsoft.com/rest/api/playfab/cloudscript/server-side-cloud-script/listqueuedfunctions Microsoft Documentation}
|
530
|
+
* @example
|
531
|
+
* await cloudscriptClient.ListQueuedFunctions({});
|
467
532
|
*/
|
468
|
-
ListQueuedFunctions(request: ListFunctionsRequest,
|
533
|
+
ListQueuedFunctions(request: ListFunctionsRequest, extraHeaders?: Record<string, string>): Promise<ListQueuedFunctionsResult>;
|
469
534
|
/**
|
470
535
|
* Generate an entity PlayStream event for the provided function result.
|
471
|
-
*
|
536
|
+
*
|
537
|
+
* {@link https://docs.microsoft.com/rest/api/playfab/cloudscript/server-side-cloud-script/postfunctionresultforentitytriggeredaction Microsoft Documentation}
|
538
|
+
* @example
|
539
|
+
* await cloudscriptClient.PostFunctionResultForEntityTriggeredAction({
|
540
|
+
* "FunctionResult": {
|
541
|
+
* "ExecutionTimeMilliseconds": 367,
|
542
|
+
* "FunctionName": "LevelCompleted",
|
543
|
+
* "FunctionResult": {
|
544
|
+
* "newScore": 25,
|
545
|
+
* "isWinner": false
|
546
|
+
* }
|
547
|
+
* },
|
548
|
+
* "Entity": {
|
549
|
+
* "Id": "ID",
|
550
|
+
* "Type": "title_player_account",
|
551
|
+
* "TypeString": "title_player_account"
|
552
|
+
* }
|
553
|
+
* });
|
472
554
|
*/
|
473
|
-
PostFunctionResultForEntityTriggeredAction(request: PostFunctionResultForEntityTriggeredActionRequest,
|
555
|
+
PostFunctionResultForEntityTriggeredAction(request: PostFunctionResultForEntityTriggeredActionRequest, extraHeaders?: Record<string, string>): Promise<EmptyResult>;
|
474
556
|
/**
|
475
557
|
* Generate an entity PlayStream event for the provided function result.
|
476
|
-
*
|
558
|
+
*
|
559
|
+
* {@link https://docs.microsoft.com/rest/api/playfab/cloudscript/server-side-cloud-script/postfunctionresultforfunctionexecution Microsoft Documentation}
|
560
|
+
* @example
|
561
|
+
* await cloudscriptClient.PostFunctionResultForFunctionExecution({
|
562
|
+
* "FunctionResult": {
|
563
|
+
* "ExecutionTimeMilliseconds": 367,
|
564
|
+
* "FunctionName": "LevelCompleted",
|
565
|
+
* "FunctionResult": {
|
566
|
+
* "newScore": 25,
|
567
|
+
* "isWinner": false
|
568
|
+
* }
|
569
|
+
* },
|
570
|
+
* "Entity": {
|
571
|
+
* "Id": "ID",
|
572
|
+
* "Type": "title_player_account",
|
573
|
+
* "TypeString": "title_player_account"
|
574
|
+
* }
|
575
|
+
* });
|
477
576
|
*/
|
478
|
-
PostFunctionResultForFunctionExecution(request: PostFunctionResultForFunctionExecutionRequest,
|
577
|
+
PostFunctionResultForFunctionExecution(request: PostFunctionResultForFunctionExecutionRequest, extraHeaders?: Record<string, string>): Promise<EmptyResult>;
|
479
578
|
/**
|
480
579
|
* Generate a player PlayStream event for the provided function result.
|
481
|
-
*
|
580
|
+
*
|
581
|
+
* {@link https://docs.microsoft.com/rest/api/playfab/cloudscript/server-side-cloud-script/postfunctionresultforplayertriggeredaction Microsoft Documentation}
|
582
|
+
* @example
|
583
|
+
* await cloudscriptClient.PostFunctionResultForPlayerTriggeredAction({
|
584
|
+
* "PlayStreamEventEnvelope": {
|
585
|
+
* "EntityId": "1234ABCD",
|
586
|
+
* "EntityType": "title_player_account",
|
587
|
+
* "EventName": "player_logged_in",
|
588
|
+
* "EventNamespace": "com.playfab",
|
589
|
+
* "EventData": "someeventdata",
|
590
|
+
* "EventSettings": "someeventsettings",
|
591
|
+
* "EventToBeDropped": false
|
592
|
+
* },
|
593
|
+
* "PlayerProfile": {
|
594
|
+
* "TitleId": "FFFF",
|
595
|
+
* "PlayerId": "1234ABCD",
|
596
|
+
* "Created": "2019-02-11T20:23:05Z",
|
597
|
+
* "LastLogin": "2020-02-11T20:23:05Z",
|
598
|
+
* "DisplayName": "Gudge"
|
599
|
+
* },
|
600
|
+
* "FunctionResult": {
|
601
|
+
* "ExecutionTimeMilliseconds": 367,
|
602
|
+
* "FunctionName": "LevelCompleted",
|
603
|
+
* "FunctionResult": {
|
604
|
+
* "newScore": 25,
|
605
|
+
* "isWinner": false
|
606
|
+
* }
|
607
|
+
* }
|
608
|
+
* });
|
482
609
|
*/
|
483
|
-
PostFunctionResultForPlayerTriggeredAction(request: PostFunctionResultForPlayerTriggeredActionRequest,
|
610
|
+
PostFunctionResultForPlayerTriggeredAction(request: PostFunctionResultForPlayerTriggeredActionRequest, extraHeaders?: Record<string, string>): Promise<EmptyResult>;
|
484
611
|
/**
|
485
612
|
* Generate a PlayStream event for the provided function result.
|
486
|
-
*
|
613
|
+
*
|
614
|
+
* {@link https://docs.microsoft.com/rest/api/playfab/cloudscript/server-side-cloud-script/postfunctionresultforscheduledtask Microsoft Documentation}
|
615
|
+
* @example
|
616
|
+
* await cloudscriptClient.PostFunctionResultForScheduledTask({
|
617
|
+
* "ScheduledTaskId": {
|
618
|
+
* "Name": "MyTask",
|
619
|
+
* "Id": "d739e188-22f6-4d13-a4d5-df2e93d4d2f7"
|
620
|
+
* },
|
621
|
+
* "FunctionResult": {
|
622
|
+
* "ExecutionTimeMilliseconds": 367,
|
623
|
+
* "FunctionName": "LevelCompleted",
|
624
|
+
* "FunctionResult": {
|
625
|
+
* "newScore": 25,
|
626
|
+
* "isWinner": false
|
627
|
+
* }
|
628
|
+
* }
|
629
|
+
* });
|
487
630
|
*/
|
488
|
-
PostFunctionResultForScheduledTask(request: PostFunctionResultForScheduledTaskRequest,
|
631
|
+
PostFunctionResultForScheduledTask(request: PostFunctionResultForScheduledTaskRequest, extraHeaders?: Record<string, string>): Promise<EmptyResult>;
|
489
632
|
/**
|
490
633
|
* Registers an event hub triggered Azure Function with a title.
|
491
|
-
*
|
634
|
+
*
|
635
|
+
* {@link https://docs.microsoft.com/rest/api/playfab/cloudscript/server-side-cloud-script/registereventhubfunction Microsoft Documentation}
|
636
|
+
* @example
|
637
|
+
* await cloudscriptClient.RegisterEventHubFunction({
|
638
|
+
* "EventHubName": "fn-eventhub",
|
639
|
+
* "ConnectionString": "SampleConnectionString",
|
640
|
+
* "FunctionName": "functionName"
|
641
|
+
* });
|
492
642
|
*/
|
493
|
-
RegisterEventHubFunction(request: RegisterEventHubFunctionRequest,
|
643
|
+
RegisterEventHubFunction(request: RegisterEventHubFunctionRequest, extraHeaders?: Record<string, string>): Promise<EmptyResult>;
|
494
644
|
/**
|
495
645
|
* Registers an HTTP triggered Azure function with a title.
|
496
|
-
*
|
646
|
+
*
|
647
|
+
* {@link https://docs.microsoft.com/rest/api/playfab/cloudscript/server-side-cloud-script/registerhttpfunction Microsoft Documentation}
|
648
|
+
* @example
|
649
|
+
* await cloudscriptClient.RegisterHttpFunction({
|
650
|
+
* "FunctionUrl": "http://function.url",
|
651
|
+
* "FunctionName": "functionName"
|
652
|
+
* });
|
497
653
|
*/
|
498
|
-
RegisterHttpFunction(request: RegisterHttpFunctionRequest,
|
654
|
+
RegisterHttpFunction(request: RegisterHttpFunctionRequest, extraHeaders?: Record<string, string>): Promise<EmptyResult>;
|
499
655
|
/**
|
500
656
|
* Registers a queue triggered Azure Function with a title.
|
501
|
-
*
|
657
|
+
*
|
658
|
+
* {@link https://docs.microsoft.com/rest/api/playfab/cloudscript/server-side-cloud-script/registerqueuedfunction Microsoft Documentation}
|
659
|
+
* @example
|
660
|
+
* await cloudscriptClient.RegisterQueuedFunction({
|
661
|
+
* "QueueName": "fn-queue",
|
662
|
+
* "ConnectionString": "SampleConnectionString",
|
663
|
+
* "FunctionName": "functionName"
|
664
|
+
* });
|
502
665
|
*/
|
503
|
-
RegisterQueuedFunction(request: RegisterQueuedFunctionRequest,
|
666
|
+
RegisterQueuedFunction(request: RegisterQueuedFunctionRequest, extraHeaders?: Record<string, string>): Promise<EmptyResult>;
|
504
667
|
/**
|
505
668
|
* Unregisters an Azure Function with a title.
|
506
|
-
*
|
669
|
+
*
|
670
|
+
* {@link https://docs.microsoft.com/rest/api/playfab/cloudscript/server-side-cloud-script/unregisterfunction Microsoft Documentation}
|
671
|
+
* @example
|
672
|
+
* await cloudscriptClient.UnregisterFunction({
|
673
|
+
* "FunctionName": "functionName"
|
674
|
+
* });
|
507
675
|
*/
|
508
|
-
UnregisterFunction(request: UnregisterFunctionRequest,
|
676
|
+
UnregisterFunction(request: UnregisterFunctionRequest, extraHeaders?: Record<string, string>): Promise<EmptyResult>;
|
509
677
|
}
|
510
678
|
|
511
679
|
export { PlayFabCloudScriptApi as default };
|
package/dist/CloudScript.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/apis/PlayFabCloudScriptApi.ts","../src/constants.ts","../src/PlayFabContext.ts","../src/PlayFabCommon.ts"],"sourcesContent":["import type {\n\n ExecuteEntityCloudScriptRequest,\n ExecuteFunctionRequest,\n GetFunctionRequest,\n ListFunctionsRequest,\n PostFunctionResultForEntityTriggeredActionRequest,\n PostFunctionResultForFunctionExecutionRequest,\n PostFunctionResultForPlayerTriggeredActionRequest,\n PostFunctionResultForScheduledTaskRequest,\n RegisterEventHubFunctionRequest,\n RegisterHttpFunctionRequest,\n RegisterQueuedFunctionRequest,\n UnregisterFunctionRequest,\n ExecuteCloudScriptResult,\n ExecuteFunctionResult,\n GetFunctionResult,\n ListEventHubFunctionsResult,\n ListFunctionsResult,\n ListHttpFunctionsResult,\n ListQueuedFunctionsResult,\n EmptyResult,\n} from \"../types/PlayFabCloudScriptApi\";\nimport { PlayFabCommon } from \"../PlayFabCommon\";\n\nexport default class PlayFabCloudScriptApi extends PlayFabCommon {\n\n /**\n * Cloud Script is one of PlayFab's most versatile features. It allows client code to request execution of any kind of\n * custom server-side functionality you can implement, and it can be used in conjunction with virtually anything.\n * https://docs.microsoft.com/rest/api/playfab/cloudscript/server-side-cloud-script/executeentitycloudscript\n */\n ExecuteEntityCloudScript (request: ExecuteEntityCloudScriptRequest, customData?: any, extraHeaders?: Record<string, string>) {\n return this.ExecuteRequestWrapper<ExecuteCloudScriptResult>(\"/CloudScript/ExecuteEntityCloudScript\", request, \"X-EntityToken\", customData, extraHeaders);\n }\n\n /**\n * Cloud Script is one of PlayFab's most versatile features. It allows client code to request execution of any kind of\n * custom server-side functionality you can implement, and it can be used in conjunction with virtually anything.\n * https://docs.microsoft.com/rest/api/playfab/cloudscript/server-side-cloud-script/executefunction\n */\n ExecuteFunction (request: ExecuteFunctionRequest, customData?: any, extraHeaders?: Record<string, string>) {\n return this.ExecuteRequestWrapper<ExecuteFunctionResult>(\"/CloudScript/ExecuteFunction\", request, \"X-EntityToken\", customData, extraHeaders);\n }\n\n /**\n * Gets registered Azure Functions for a given title id and function name.\n * https://docs.microsoft.com/rest/api/playfab/cloudscript/server-side-cloud-script/getfunction\n */\n GetFunction (request: GetFunctionRequest, customData?: any, extraHeaders?: Record<string, string>) {\n return this.ExecuteRequestWrapper<GetFunctionResult>(\"/CloudScript/GetFunction\", request, \"X-EntityToken\", customData, extraHeaders);\n }\n\n /**\n * Lists all currently registered Event Hub triggered Azure Functions for a given title.\n * https://docs.microsoft.com/rest/api/playfab/cloudscript/server-side-cloud-script/listeventhubfunctions\n */\n ListEventHubFunctions (request: ListFunctionsRequest, customData?: any, extraHeaders?: Record<string, string>) {\n return this.ExecuteRequestWrapper<ListEventHubFunctionsResult>(\"/CloudScript/ListEventHubFunctions\", request, \"X-EntityToken\", customData, extraHeaders);\n }\n\n /**\n * Lists all currently registered Azure Functions for a given title.\n * https://docs.microsoft.com/rest/api/playfab/cloudscript/server-side-cloud-script/listfunctions\n */\n ListFunctions (request: ListFunctionsRequest, customData?: any, extraHeaders?: Record<string, string>) {\n return this.ExecuteRequestWrapper<ListFunctionsResult>(\"/CloudScript/ListFunctions\", request, \"X-EntityToken\", customData, extraHeaders);\n }\n\n /**\n * Lists all currently registered HTTP triggered Azure Functions for a given title.\n * https://docs.microsoft.com/rest/api/playfab/cloudscript/server-side-cloud-script/listhttpfunctions\n */\n ListHttpFunctions (request: ListFunctionsRequest, customData?: any, extraHeaders?: Record<string, string>) {\n return this.ExecuteRequestWrapper<ListHttpFunctionsResult>(\"/CloudScript/ListHttpFunctions\", request, \"X-EntityToken\", customData, extraHeaders);\n }\n\n /**\n * Lists all currently registered Queue triggered Azure Functions for a given title.\n * https://docs.microsoft.com/rest/api/playfab/cloudscript/server-side-cloud-script/listqueuedfunctions\n */\n ListQueuedFunctions (request: ListFunctionsRequest, customData?: any, extraHeaders?: Record<string, string>) {\n return this.ExecuteRequestWrapper<ListQueuedFunctionsResult>(\"/CloudScript/ListQueuedFunctions\", request, \"X-EntityToken\", customData, extraHeaders);\n }\n\n /**\n * Generate an entity PlayStream event for the provided function result.\n * https://docs.microsoft.com/rest/api/playfab/cloudscript/server-side-cloud-script/postfunctionresultforentitytriggeredaction\n */\n PostFunctionResultForEntityTriggeredAction (request: PostFunctionResultForEntityTriggeredActionRequest, customData?: any, extraHeaders?: Record<string, string>) {\n return this.ExecuteRequestWrapper<EmptyResult>(\"/CloudScript/PostFunctionResultForEntityTriggeredAction\", request, \"X-EntityToken\", customData, extraHeaders);\n }\n\n /**\n * Generate an entity PlayStream event for the provided function result.\n * https://docs.microsoft.com/rest/api/playfab/cloudscript/server-side-cloud-script/postfunctionresultforfunctionexecution\n */\n PostFunctionResultForFunctionExecution (request: PostFunctionResultForFunctionExecutionRequest, customData?: any, extraHeaders?: Record<string, string>) {\n return this.ExecuteRequestWrapper<EmptyResult>(\"/CloudScript/PostFunctionResultForFunctionExecution\", request, \"X-EntityToken\", customData, extraHeaders);\n }\n\n /**\n * Generate a player PlayStream event for the provided function result.\n * https://docs.microsoft.com/rest/api/playfab/cloudscript/server-side-cloud-script/postfunctionresultforplayertriggeredaction\n */\n PostFunctionResultForPlayerTriggeredAction (request: PostFunctionResultForPlayerTriggeredActionRequest, customData?: any, extraHeaders?: Record<string, string>) {\n return this.ExecuteRequestWrapper<EmptyResult>(\"/CloudScript/PostFunctionResultForPlayerTriggeredAction\", request, \"X-EntityToken\", customData, extraHeaders);\n }\n\n /**\n * Generate a PlayStream event for the provided function result.\n * https://docs.microsoft.com/rest/api/playfab/cloudscript/server-side-cloud-script/postfunctionresultforscheduledtask\n */\n PostFunctionResultForScheduledTask (request: PostFunctionResultForScheduledTaskRequest, customData?: any, extraHeaders?: Record<string, string>) {\n return this.ExecuteRequestWrapper<EmptyResult>(\"/CloudScript/PostFunctionResultForScheduledTask\", request, \"X-EntityToken\", customData, extraHeaders);\n }\n\n /**\n * Registers an event hub triggered Azure Function with a title.\n * https://docs.microsoft.com/rest/api/playfab/cloudscript/server-side-cloud-script/registereventhubfunction\n */\n RegisterEventHubFunction (request: RegisterEventHubFunctionRequest, customData?: any, extraHeaders?: Record<string, string>) {\n return this.ExecuteRequestWrapper<EmptyResult>(\"/CloudScript/RegisterEventHubFunction\", request, \"X-EntityToken\", customData, extraHeaders);\n }\n\n /**\n * Registers an HTTP triggered Azure function with a title.\n * https://docs.microsoft.com/rest/api/playfab/cloudscript/server-side-cloud-script/registerhttpfunction\n */\n RegisterHttpFunction (request: RegisterHttpFunctionRequest, customData?: any, extraHeaders?: Record<string, string>) {\n return this.ExecuteRequestWrapper<EmptyResult>(\"/CloudScript/RegisterHttpFunction\", request, \"X-EntityToken\", customData, extraHeaders);\n }\n\n /**\n * Registers a queue triggered Azure Function with a title.\n * https://docs.microsoft.com/rest/api/playfab/cloudscript/server-side-cloud-script/registerqueuedfunction\n */\n RegisterQueuedFunction (request: RegisterQueuedFunctionRequest, customData?: any, extraHeaders?: Record<string, string>) {\n return this.ExecuteRequestWrapper<EmptyResult>(\"/CloudScript/RegisterQueuedFunction\", request, \"X-EntityToken\", customData, extraHeaders);\n }\n\n /**\n * Unregisters an Azure Function with a title.\n * https://docs.microsoft.com/rest/api/playfab/cloudscript/server-side-cloud-script/unregisterfunction\n */\n UnregisterFunction (request: UnregisterFunctionRequest, customData?: any, extraHeaders?: Record<string, string>) {\n return this.ExecuteRequestWrapper<EmptyResult>(\"/CloudScript/UnregisterFunction\", 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;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