async-playfab-web-sdk 1.192.250526-1 → 1.192.250526-3

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.
Files changed (87) hide show
  1. package/dist/Addon.d.ts +31 -31
  2. package/dist/Addon.js +4 -448
  3. package/dist/Addon.js.map +1 -1
  4. package/dist/Admin.d.ts +118 -118
  5. package/dist/Admin.js +4 -1108
  6. package/dist/Admin.js.map +1 -1
  7. package/dist/Authentication.d.ts +5 -5
  8. package/dist/Authentication.js +4 -286
  9. package/dist/Authentication.js.map +1 -1
  10. package/dist/Client.d.ts +174 -174
  11. package/dist/Client.js +4 -1889
  12. package/dist/Client.js.map +1 -1
  13. package/dist/CloudScript.d.ts +16 -16
  14. package/dist/CloudScript.js +4 -345
  15. package/dist/CloudScript.js.map +1 -1
  16. package/dist/Data.d.ts +8 -8
  17. package/dist/Data.js +4 -287
  18. package/dist/Data.js.map +1 -1
  19. package/dist/Economy.d.ts +47 -47
  20. package/dist/Economy.js +4 -610
  21. package/dist/Economy.js.map +1 -1
  22. package/dist/Events.d.ts +13 -13
  23. package/dist/Events.js +4 -323
  24. package/dist/Events.js.map +1 -1
  25. package/dist/Experimentation.d.ts +14 -14
  26. package/dist/Experimentation.js +4 -329
  27. package/dist/Experimentation.js.map +1 -1
  28. package/dist/Groups.d.ts +26 -26
  29. package/dist/Groups.js +4 -413
  30. package/dist/Groups.js.map +1 -1
  31. package/dist/Insights.d.ts +7 -7
  32. package/dist/Insights.js +4 -282
  33. package/dist/Insights.js.map +1 -1
  34. package/dist/Localization.d.ts +2 -2
  35. package/dist/Localization.js +4 -245
  36. package/dist/Localization.js.map +1 -1
  37. package/dist/Multiplayer.d.ts +88 -88
  38. package/dist/Multiplayer.js +4 -858
  39. package/dist/Multiplayer.js.map +1 -1
  40. package/dist/{PlayFabCommon-BUv4zqXf.d.ts → PlayFabCommon-BX3jSqGx.d.ts} +4 -6
  41. package/dist/Profiles.d.ts +10 -10
  42. package/dist/Profiles.js +4 -302
  43. package/dist/Profiles.js.map +1 -1
  44. package/dist/Progression.d.ts +24 -24
  45. package/dist/Progression.js +4 -400
  46. package/dist/Progression.js.map +1 -1
  47. package/dist/Server.d.ts +150 -150
  48. package/dist/Server.js +4 -1373
  49. package/dist/Server.js.map +1 -1
  50. package/dist/chunk-3FCAP7OZ.js +187 -0
  51. package/dist/chunk-3FCAP7OZ.js.map +1 -0
  52. package/dist/chunk-62SULWOK.js +195 -0
  53. package/dist/chunk-62SULWOK.js.map +1 -0
  54. package/dist/chunk-A7VD6ALV.js +222 -0
  55. package/dist/chunk-A7VD6ALV.js.map +1 -0
  56. package/dist/chunk-BX65UND2.js +632 -0
  57. package/dist/chunk-BX65UND2.js.map +1 -0
  58. package/dist/chunk-J4QS5VX5.js +19 -0
  59. package/dist/chunk-J4QS5VX5.js.map +1 -0
  60. package/dist/chunk-JGDO2ZE3.js +1663 -0
  61. package/dist/chunk-JGDO2ZE3.js.map +1 -0
  62. package/dist/chunk-POMI7LEF.js +76 -0
  63. package/dist/chunk-POMI7LEF.js.map +1 -0
  64. package/dist/chunk-Q3OF3AOJ.js +97 -0
  65. package/dist/chunk-Q3OF3AOJ.js.map +1 -0
  66. package/dist/chunk-QUZHVSVZ.js +174 -0
  67. package/dist/chunk-QUZHVSVZ.js.map +1 -0
  68. package/dist/chunk-QVLIVSO4.js +1147 -0
  69. package/dist/chunk-QVLIVSO4.js.map +1 -0
  70. package/dist/chunk-R7V7DFCF.js +103 -0
  71. package/dist/chunk-R7V7DFCF.js.map +1 -0
  72. package/dist/chunk-SGSEOIKS.js +56 -0
  73. package/dist/chunk-SGSEOIKS.js.map +1 -0
  74. package/dist/chunk-UOHHNVCJ.js +119 -0
  75. package/dist/chunk-UOHHNVCJ.js.map +1 -0
  76. package/dist/chunk-USKFWNQK.js +384 -0
  77. package/dist/chunk-USKFWNQK.js.map +1 -0
  78. package/dist/chunk-UX7LFJCX.js +61 -0
  79. package/dist/chunk-UX7LFJCX.js.map +1 -0
  80. package/dist/chunk-X34XZJB6.js +60 -0
  81. package/dist/chunk-X34XZJB6.js.map +1 -0
  82. package/dist/chunk-YNZF3WXS.js +882 -0
  83. package/dist/chunk-YNZF3WXS.js.map +1 -0
  84. package/dist/index.d.ts +1 -1
  85. package/dist/index.js +49 -5988
  86. package/dist/index.js.map +1 -1
  87. package/package.json +1 -1
package/dist/Addon.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { I as IPlayFabRequestCommon, a as IPlayFabResultCommon, P as PlayFabCommon } from './PlayFabCommon-BUv4zqXf.js';
1
+ import { I as IPlayFabRequestCommon, a as IPlayFabResultCommon, P as PlayFabCommon } from './PlayFabCommon-BX3jSqGx.js';
2
2
 
3
3
  interface CreateOrUpdateAppleRequest extends IPlayFabRequestCommon {
4
4
  /** iOS App Bundle ID obtained after setting up your app in the App Store. */
@@ -440,152 +440,152 @@ declare class PlayFabAddonApi extends PlayFabCommon {
440
440
  * Creates the Apple addon on a title, or updates it if it already exists.
441
441
  * https://docs.microsoft.com/rest/api/playfab/addon/addon/createorupdateapple
442
442
  */
443
- CreateOrUpdateApple(request: CreateOrUpdateAppleRequest, customData?: any, extraHeaders?: Record<string, string>): Promise<CreateOrUpdateAppleResponse>;
443
+ CreateOrUpdateApple(request: CreateOrUpdateAppleRequest, extraHeaders?: Record<string, string>): Promise<CreateOrUpdateAppleResponse>;
444
444
  /**
445
445
  * Creates the Facebook addon on a title, or updates it if it already exists.
446
446
  * https://docs.microsoft.com/rest/api/playfab/addon/addon/createorupdatefacebook
447
447
  */
448
- CreateOrUpdateFacebook(request: CreateOrUpdateFacebookRequest, customData?: any, extraHeaders?: Record<string, string>): Promise<CreateOrUpdateFacebookResponse>;
448
+ CreateOrUpdateFacebook(request: CreateOrUpdateFacebookRequest, extraHeaders?: Record<string, string>): Promise<CreateOrUpdateFacebookResponse>;
449
449
  /**
450
450
  * Creates the Facebook Instant Games addon on a title, or updates it if it already exists.
451
451
  * https://docs.microsoft.com/rest/api/playfab/addon/addon/createorupdatefacebookinstantgames
452
452
  */
453
- CreateOrUpdateFacebookInstantGames(request: CreateOrUpdateFacebookInstantGamesRequest, customData?: any, extraHeaders?: Record<string, string>): Promise<CreateOrUpdateFacebookInstantGamesResponse>;
453
+ CreateOrUpdateFacebookInstantGames(request: CreateOrUpdateFacebookInstantGamesRequest, extraHeaders?: Record<string, string>): Promise<CreateOrUpdateFacebookInstantGamesResponse>;
454
454
  /**
455
455
  * Creates the Google addon on a title, or updates it if it already exists.
456
456
  * https://docs.microsoft.com/rest/api/playfab/addon/addon/createorupdategoogle
457
457
  */
458
- CreateOrUpdateGoogle(request: CreateOrUpdateGoogleRequest, customData?: any, extraHeaders?: Record<string, string>): Promise<CreateOrUpdateGoogleResponse>;
458
+ CreateOrUpdateGoogle(request: CreateOrUpdateGoogleRequest, extraHeaders?: Record<string, string>): Promise<CreateOrUpdateGoogleResponse>;
459
459
  /**
460
460
  * Creates the Kongregate addon on a title, or updates it if it already exists.
461
461
  * https://docs.microsoft.com/rest/api/playfab/addon/addon/createorupdatekongregate
462
462
  */
463
- CreateOrUpdateKongregate(request: CreateOrUpdateKongregateRequest, customData?: any, extraHeaders?: Record<string, string>): Promise<CreateOrUpdateKongregateResponse>;
463
+ CreateOrUpdateKongregate(request: CreateOrUpdateKongregateRequest, extraHeaders?: Record<string, string>): Promise<CreateOrUpdateKongregateResponse>;
464
464
  /**
465
465
  * Creates the Nintendo addon on a title, or updates it if it already exists.
466
466
  * https://docs.microsoft.com/rest/api/playfab/addon/addon/createorupdatenintendo
467
467
  */
468
- CreateOrUpdateNintendo(request: CreateOrUpdateNintendoRequest, customData?: any, extraHeaders?: Record<string, string>): Promise<CreateOrUpdateNintendoResponse>;
468
+ CreateOrUpdateNintendo(request: CreateOrUpdateNintendoRequest, extraHeaders?: Record<string, string>): Promise<CreateOrUpdateNintendoResponse>;
469
469
  /**
470
470
  * Creates the PSN addon on a title, or updates it if it already exists.
471
471
  * https://docs.microsoft.com/rest/api/playfab/addon/addon/createorupdatepsn
472
472
  */
473
- CreateOrUpdatePSN(request: CreateOrUpdatePSNRequest, customData?: any, extraHeaders?: Record<string, string>): Promise<CreateOrUpdatePSNResponse>;
473
+ CreateOrUpdatePSN(request: CreateOrUpdatePSNRequest, extraHeaders?: Record<string, string>): Promise<CreateOrUpdatePSNResponse>;
474
474
  /**
475
475
  * Creates the Steam addon on a title, or updates it if it already exists.
476
476
  * https://docs.microsoft.com/rest/api/playfab/addon/addon/createorupdatesteam
477
477
  */
478
- CreateOrUpdateSteam(request: CreateOrUpdateSteamRequest, customData?: any, extraHeaders?: Record<string, string>): Promise<CreateOrUpdateSteamResponse>;
478
+ CreateOrUpdateSteam(request: CreateOrUpdateSteamRequest, extraHeaders?: Record<string, string>): Promise<CreateOrUpdateSteamResponse>;
479
479
  /**
480
480
  * Creates the ToxMod addon on a title, or updates it if it already exists.
481
481
  * https://docs.microsoft.com/rest/api/playfab/addon/addon/createorupdatetoxmod
482
482
  */
483
- CreateOrUpdateToxMod(request: CreateOrUpdateToxModRequest, customData?: any, extraHeaders?: Record<string, string>): Promise<CreateOrUpdateToxModResponse>;
483
+ CreateOrUpdateToxMod(request: CreateOrUpdateToxModRequest, extraHeaders?: Record<string, string>): Promise<CreateOrUpdateToxModResponse>;
484
484
  /**
485
485
  * Creates the Twitch addon on a title, or updates it if it already exists.
486
486
  * https://docs.microsoft.com/rest/api/playfab/addon/addon/createorupdatetwitch
487
487
  */
488
- CreateOrUpdateTwitch(request: CreateOrUpdateTwitchRequest, customData?: any, extraHeaders?: Record<string, string>): Promise<CreateOrUpdateTwitchResponse>;
488
+ CreateOrUpdateTwitch(request: CreateOrUpdateTwitchRequest, extraHeaders?: Record<string, string>): Promise<CreateOrUpdateTwitchResponse>;
489
489
  /**
490
490
  * Deletes the Apple addon on a title.
491
491
  * https://docs.microsoft.com/rest/api/playfab/addon/addon/deleteapple
492
492
  */
493
- DeleteApple(request: DeleteAppleRequest, customData?: any, extraHeaders?: Record<string, string>): Promise<DeleteAppleResponse>;
493
+ DeleteApple(request: DeleteAppleRequest, extraHeaders?: Record<string, string>): Promise<DeleteAppleResponse>;
494
494
  /**
495
495
  * Deletes the Facebook addon on a title.
496
496
  * https://docs.microsoft.com/rest/api/playfab/addon/addon/deletefacebook
497
497
  */
498
- DeleteFacebook(request: DeleteFacebookRequest, customData?: any, extraHeaders?: Record<string, string>): Promise<DeleteFacebookResponse>;
498
+ DeleteFacebook(request: DeleteFacebookRequest, extraHeaders?: Record<string, string>): Promise<DeleteFacebookResponse>;
499
499
  /**
500
500
  * Deletes the Facebook addon on a title.
501
501
  * https://docs.microsoft.com/rest/api/playfab/addon/addon/deletefacebookinstantgames
502
502
  */
503
- DeleteFacebookInstantGames(request: DeleteFacebookInstantGamesRequest, customData?: any, extraHeaders?: Record<string, string>): Promise<DeleteFacebookInstantGamesResponse>;
503
+ DeleteFacebookInstantGames(request: DeleteFacebookInstantGamesRequest, extraHeaders?: Record<string, string>): Promise<DeleteFacebookInstantGamesResponse>;
504
504
  /**
505
505
  * Deletes the Google addon on a title.
506
506
  * https://docs.microsoft.com/rest/api/playfab/addon/addon/deletegoogle
507
507
  */
508
- DeleteGoogle(request: DeleteGoogleRequest, customData?: any, extraHeaders?: Record<string, string>): Promise<DeleteGoogleResponse>;
508
+ DeleteGoogle(request: DeleteGoogleRequest, extraHeaders?: Record<string, string>): Promise<DeleteGoogleResponse>;
509
509
  /**
510
510
  * Deletes the Kongregate addon on a title.
511
511
  * https://docs.microsoft.com/rest/api/playfab/addon/addon/deletekongregate
512
512
  */
513
- DeleteKongregate(request: DeleteKongregateRequest, customData?: any, extraHeaders?: Record<string, string>): Promise<DeleteKongregateResponse>;
513
+ DeleteKongregate(request: DeleteKongregateRequest, extraHeaders?: Record<string, string>): Promise<DeleteKongregateResponse>;
514
514
  /**
515
515
  * Deletes the Nintendo addon on a title.
516
516
  * https://docs.microsoft.com/rest/api/playfab/addon/addon/deletenintendo
517
517
  */
518
- DeleteNintendo(request: DeleteNintendoRequest, customData?: any, extraHeaders?: Record<string, string>): Promise<DeleteNintendoResponse>;
518
+ DeleteNintendo(request: DeleteNintendoRequest, extraHeaders?: Record<string, string>): Promise<DeleteNintendoResponse>;
519
519
  /**
520
520
  * Deletes the PSN addon on a title.
521
521
  * https://docs.microsoft.com/rest/api/playfab/addon/addon/deletepsn
522
522
  */
523
- DeletePSN(request: DeletePSNRequest, customData?: any, extraHeaders?: Record<string, string>): Promise<DeletePSNResponse>;
523
+ DeletePSN(request: DeletePSNRequest, extraHeaders?: Record<string, string>): Promise<DeletePSNResponse>;
524
524
  /**
525
525
  * Deletes the Steam addon on a title.
526
526
  * https://docs.microsoft.com/rest/api/playfab/addon/addon/deletesteam
527
527
  */
528
- DeleteSteam(request: DeleteSteamRequest, customData?: any, extraHeaders?: Record<string, string>): Promise<DeleteSteamResponse>;
528
+ DeleteSteam(request: DeleteSteamRequest, extraHeaders?: Record<string, string>): Promise<DeleteSteamResponse>;
529
529
  /**
530
530
  * Deletes the ToxMod addon on a title.
531
531
  * https://docs.microsoft.com/rest/api/playfab/addon/addon/deletetoxmod
532
532
  */
533
- DeleteToxMod(request: DeleteToxModRequest, customData?: any, extraHeaders?: Record<string, string>): Promise<DeleteToxModResponse>;
533
+ DeleteToxMod(request: DeleteToxModRequest, extraHeaders?: Record<string, string>): Promise<DeleteToxModResponse>;
534
534
  /**
535
535
  * Deletes the Twitch addon on a title.
536
536
  * https://docs.microsoft.com/rest/api/playfab/addon/addon/deletetwitch
537
537
  */
538
- DeleteTwitch(request: DeleteTwitchRequest, customData?: any, extraHeaders?: Record<string, string>): Promise<DeleteTwitchResponse>;
538
+ DeleteTwitch(request: DeleteTwitchRequest, extraHeaders?: Record<string, string>): Promise<DeleteTwitchResponse>;
539
539
  /**
540
540
  * Gets information of the Apple addon on a title, omits secrets.
541
541
  * https://docs.microsoft.com/rest/api/playfab/addon/addon/getapple
542
542
  */
543
- GetApple(request: GetAppleRequest, customData?: any, extraHeaders?: Record<string, string>): Promise<GetAppleResponse>;
543
+ GetApple(request: GetAppleRequest, extraHeaders?: Record<string, string>): Promise<GetAppleResponse>;
544
544
  /**
545
545
  * Gets information of the Facebook addon on a title, omits secrets.
546
546
  * https://docs.microsoft.com/rest/api/playfab/addon/addon/getfacebook
547
547
  */
548
- GetFacebook(request: GetFacebookRequest, customData?: any, extraHeaders?: Record<string, string>): Promise<GetFacebookResponse>;
548
+ GetFacebook(request: GetFacebookRequest, extraHeaders?: Record<string, string>): Promise<GetFacebookResponse>;
549
549
  /**
550
550
  * Gets information of the Facebook Instant Games addon on a title, omits secrets.
551
551
  * https://docs.microsoft.com/rest/api/playfab/addon/addon/getfacebookinstantgames
552
552
  */
553
- GetFacebookInstantGames(request: GetFacebookInstantGamesRequest, customData?: any, extraHeaders?: Record<string, string>): Promise<GetFacebookInstantGamesResponse>;
553
+ GetFacebookInstantGames(request: GetFacebookInstantGamesRequest, extraHeaders?: Record<string, string>): Promise<GetFacebookInstantGamesResponse>;
554
554
  /**
555
555
  * Gets information of the Google addon on a title, omits secrets.
556
556
  * https://docs.microsoft.com/rest/api/playfab/addon/addon/getgoogle
557
557
  */
558
- GetGoogle(request: GetGoogleRequest, customData?: any, extraHeaders?: Record<string, string>): Promise<GetGoogleResponse>;
558
+ GetGoogle(request: GetGoogleRequest, extraHeaders?: Record<string, string>): Promise<GetGoogleResponse>;
559
559
  /**
560
560
  * Gets information of the Kongregate addon on a title, omits secrets.
561
561
  * https://docs.microsoft.com/rest/api/playfab/addon/addon/getkongregate
562
562
  */
563
- GetKongregate(request: GetKongregateRequest, customData?: any, extraHeaders?: Record<string, string>): Promise<GetKongregateResponse>;
563
+ GetKongregate(request: GetKongregateRequest, extraHeaders?: Record<string, string>): Promise<GetKongregateResponse>;
564
564
  /**
565
565
  * Gets information of the Nintendo addon on a title, omits secrets.
566
566
  * https://docs.microsoft.com/rest/api/playfab/addon/addon/getnintendo
567
567
  */
568
- GetNintendo(request: GetNintendoRequest, customData?: any, extraHeaders?: Record<string, string>): Promise<GetNintendoResponse>;
568
+ GetNintendo(request: GetNintendoRequest, extraHeaders?: Record<string, string>): Promise<GetNintendoResponse>;
569
569
  /**
570
570
  * Gets information of the PSN addon on a title, omits secrets.
571
571
  * https://docs.microsoft.com/rest/api/playfab/addon/addon/getpsn
572
572
  */
573
- GetPSN(request: GetPSNRequest, customData?: any, extraHeaders?: Record<string, string>): Promise<GetPSNResponse>;
573
+ GetPSN(request: GetPSNRequest, extraHeaders?: Record<string, string>): Promise<GetPSNResponse>;
574
574
  /**
575
575
  * Gets information of the Steam addon on a title, omits secrets.
576
576
  * https://docs.microsoft.com/rest/api/playfab/addon/addon/getsteam
577
577
  */
578
- GetSteam(request: GetSteamRequest, customData?: any, extraHeaders?: Record<string, string>): Promise<GetSteamResponse>;
578
+ GetSteam(request: GetSteamRequest, extraHeaders?: Record<string, string>): Promise<GetSteamResponse>;
579
579
  /**
580
580
  * Gets information of the ToxMod addon on a title, omits secrets.
581
581
  * https://docs.microsoft.com/rest/api/playfab/addon/addon/gettoxmod
582
582
  */
583
- GetToxMod(request: GetToxModRequest, customData?: any, extraHeaders?: Record<string, string>): Promise<GetToxModResponse>;
583
+ GetToxMod(request: GetToxModRequest, extraHeaders?: Record<string, string>): Promise<GetToxModResponse>;
584
584
  /**
585
585
  * Gets information of the Twitch addon on a title, omits secrets.
586
586
  * https://docs.microsoft.com/rest/api/playfab/addon/addon/gettwitch
587
587
  */
588
- GetTwitch(request: GetTwitchRequest, customData?: any, extraHeaders?: Record<string, string>): Promise<GetTwitchResponse>;
588
+ GetTwitch(request: GetTwitchRequest, extraHeaders?: Record<string, string>): Promise<GetTwitchResponse>;
589
589
  }
590
590
 
591
591
  export { PlayFabAddonApi as default };
package/dist/Addon.js CHANGED
@@ -1,451 +1,7 @@
1
- // src/constants.ts
2
- var AuthInfoMap = {
3
- "X-EntityToken": {
4
- authAttr: "entityToken",
5
- authError: "errorEntityToken"
6
- },
7
- "X-Authorization": {
8
- authAttr: "sessionTicket",
9
- authError: "errorLoggedIn"
10
- },
11
- "X-SecretKey": {
12
- authAttr: "developerSecretKey",
13
- authError: "errorSecretKey"
14
- }
15
- };
16
- var constants_default = {
17
- sdkVersion: "1.192.250526",
18
- sdkFingerprint: "JavaScriptSDK-1.192.250526",
19
- buildIdentifier: "custom_async-javascriptsdk",
20
- defaultSettings: {
21
- titleId: "",
22
- developerSecretKey: "",
23
- GlobalHeaderInjection: {},
24
- productionServerUrl: ".playfabapi.com",
25
- verticalName: null
26
- }
27
- };
28
-
29
- // src/PlayFabContext.ts
30
- var PlayFabContext = class _PlayFabContext {
31
- constructor() {
32
- this.settings = constants_default.defaultSettings;
33
- this.authenticationContext = {
34
- PlayFabId: null,
35
- EntityId: null,
36
- EntityType: null,
37
- SessionTicket: null,
38
- EntityToken: null
39
- };
40
- this.sessionTicket = null;
41
- this.entityToken = null;
42
- }
43
- static get instance() {
44
- if (!_PlayFabContext._instance) {
45
- _PlayFabContext._instance = new _PlayFabContext();
46
- }
47
- return _PlayFabContext._instance;
48
- }
49
- };
50
-
51
- // src/PlayFabCommon.ts
52
- var PlayFabCommon = class {
53
- constructor(settings = void 0) {
54
- this.buildIdentifier = constants_default.buildIdentifier;
55
- this.requestGetParams = {
56
- sdk: constants_default.sdkFingerprint
57
- };
58
- this.errorTitleId = "Must be have settings.titleId set to call this method";
59
- this.errorLoggedIn = "Must be logged in to call this method";
60
- this.errorEntityToken = "You must successfully call GetEntityToken before calling this";
61
- this.errorSecretKey = "Must have settings.developerSecretKey set to call this method";
62
- this._context = PlayFabContext.instance;
63
- if (settings) {
64
- Object.assign(this._context.settings, settings);
65
- }
66
- }
67
- get settings() {
68
- return this._context.settings;
69
- }
70
- get authenticationContext() {
71
- return this._context.authenticationContext;
72
- }
73
- get sessionTicket() {
74
- return this._context.sessionTicket;
75
- }
76
- set sessionTicket(value) {
77
- this._context.sessionTicket = value;
78
- }
79
- get entityToken() {
80
- return this._context.entityToken;
81
- }
82
- set entityToken(value) {
83
- this._context.entityToken = value;
84
- }
85
- GetServerUrl() {
86
- if (!(this.settings.productionServerUrl.substring(0, 4) === "http")) {
87
- return `https://${this.settings.verticalName || this.settings.titleId}${this.settings.productionServerUrl}`;
88
- } else {
89
- return this.settings.productionServerUrl;
90
- }
91
- }
92
- InjectHeaders(xhr, headersObj) {
93
- if (!headersObj) return;
94
- for (const headerKey in headersObj) {
95
- try {
96
- xhr.setRequestHeader(headerKey, headersObj[headerKey]);
97
- } catch (e) {
98
- console.log(
99
- `Failed to append header: ${headerKey} = ${headersObj[headerKey]} Error: ${e}`
100
- );
101
- }
102
- }
103
- }
104
- ExecuteRequest(url, body, authkey, authValue, customData, extraHeaders) {
105
- return new Promise((resolve, reject) => {
106
- if (body == null) body = {};
107
- var startTime = (/* @__PURE__ */ new Date()).getTime();
108
- var requestBody = JSON.stringify(body);
109
- var urlArr = [url];
110
- var getParams = this.requestGetParams;
111
- if (getParams != null) {
112
- var firstParam = true;
113
- for (var key in getParams) {
114
- if (firstParam) {
115
- urlArr.push("?");
116
- firstParam = false;
117
- } else {
118
- urlArr.push("&");
119
- }
120
- urlArr.push(key);
121
- urlArr.push("=");
122
- urlArr.push(getParams[key]);
123
- }
124
- }
125
- var completeUrl = urlArr.join("");
126
- var xhr = new XMLHttpRequest();
127
- xhr.open("POST", completeUrl, true);
128
- xhr.setRequestHeader("Content-Type", "application/json");
129
- xhr.setRequestHeader(
130
- "X-PlayFabSDK",
131
- "JavaScriptSDK-" + constants_default.sdkVersion
132
- );
133
- if (authkey != null) {
134
- xhr.setRequestHeader(authkey, authValue);
135
- }
136
- this.InjectHeaders(xhr, this.settings.GlobalHeaderInjection);
137
- this.InjectHeaders(xhr, extraHeaders);
138
- xhr.onloadend = () => {
139
- var result = this.GetPlayFabResponse(body, xhr, startTime, customData);
140
- if (result.code === 200) {
141
- resolve(result.data || result);
142
- } else {
143
- reject(result);
144
- }
145
- };
146
- xhr.onerror = () => {
147
- var result = this.GetPlayFabResponse(body, xhr, startTime, customData);
148
- reject(result);
149
- };
150
- xhr.send(requestBody);
151
- });
152
- }
153
- GetPlayFabResponse(request, xhr, startTime, customData) {
154
- var result = null;
155
- try {
156
- result = JSON.parse(xhr.responseText);
157
- } catch (e) {
158
- result = {
159
- code: 503,
160
- // Service Unavailable
161
- status: "Service Unavailable",
162
- error: "Connection error",
163
- errorCode: 2,
164
- // PlayFabErrorCode.ConnectionError
165
- errorMessage: xhr.responseText
166
- };
167
- }
168
- result.CallBackTimeMS = (/* @__PURE__ */ new Date()).getTime() - startTime;
169
- result.Request = request;
170
- result.CustomData = customData;
171
- return result;
172
- }
173
- UpdateAuthenticationContext(currentAuthContext, result) {
174
- var authenticationContextUpdates = {};
175
- if (result == null ? void 0 : result.PlayFabId) {
176
- authenticationContextUpdates.PlayFabId = result.PlayFabId;
177
- }
178
- if (result == null ? void 0 : result.SessionTicket) {
179
- authenticationContextUpdates.SessionTicket = result.SessionTicket;
180
- }
181
- if (result == null ? void 0 : result.EntityToken) {
182
- authenticationContextUpdates.EntityId = result.EntityToken.Entity.Id;
183
- authenticationContextUpdates.EntityType = result.EntityToken.Entity.Type;
184
- authenticationContextUpdates.EntityToken = result.EntityToken.EntityToken;
185
- }
186
- currentAuthContext = Object.assign(
187
- currentAuthContext,
188
- authenticationContextUpdates
189
- );
190
- this._context.authenticationContext = currentAuthContext;
191
- return currentAuthContext;
192
- }
193
- GetAuthInfo(request, authKey) {
194
- var authError = AuthInfoMap[authKey].authError;
195
- var authAttr = AuthInfoMap[authKey].authAttr;
196
- var defaultAuthValue = null;
197
- if (authAttr === "entityToken") defaultAuthValue = this.entityToken;
198
- else if (authAttr === "sessionTicket")
199
- defaultAuthValue = this.sessionTicket;
200
- else if (authAttr === "developerSecretKey")
201
- defaultAuthValue = this.settings.developerSecretKey;
202
- var authValue = request.AuthenticationContext ? request.AuthenticationContext[authAttr] : defaultAuthValue;
203
- return { authKey, authValue, authError };
204
- }
205
- ExecuteRequestWrapper(apiURL, request, authKey, customData, extraHeaders) {
206
- var authValue = null;
207
- if (authKey !== null) {
208
- const { authError, ...authInfo } = this.GetAuthInfo(request, authKey);
209
- authKey = authInfo.authKey;
210
- authValue = authInfo.authValue;
211
- if (!authValue) throw authError;
212
- }
213
- return this.ExecuteRequest(
214
- this.GetServerUrl() + apiURL,
215
- request,
216
- authKey,
217
- authValue,
218
- customData,
219
- extraHeaders
220
- );
221
- }
222
- GenerateErrorReport(error) {
223
- if (error == null) return "";
224
- var fullErrors = error.errorMessage;
225
- for (var paramName in error.errorDetails)
226
- for (var msgIdx in error.errorDetails[paramName])
227
- fullErrors += "\n" + paramName + ": " + error.errorDetails[paramName][msgIdx];
228
- return fullErrors;
229
- }
230
- ForgetAllCredentials() {
231
- this._context.sessionTicket = null;
232
- this._context.entityToken = null;
233
- }
234
- };
235
-
236
- // src/apis/PlayFabAddonApi.ts
237
- var PlayFabAddonApi = class extends PlayFabCommon {
238
- /**
239
- * Creates the Apple addon on a title, or updates it if it already exists.
240
- * https://docs.microsoft.com/rest/api/playfab/addon/addon/createorupdateapple
241
- */
242
- CreateOrUpdateApple(request, customData, extraHeaders) {
243
- return this.ExecuteRequestWrapper("/Addon/CreateOrUpdateApple", request, "X-EntityToken", customData, extraHeaders);
244
- }
245
- /**
246
- * Creates the Facebook addon on a title, or updates it if it already exists.
247
- * https://docs.microsoft.com/rest/api/playfab/addon/addon/createorupdatefacebook
248
- */
249
- CreateOrUpdateFacebook(request, customData, extraHeaders) {
250
- return this.ExecuteRequestWrapper("/Addon/CreateOrUpdateFacebook", request, "X-EntityToken", customData, extraHeaders);
251
- }
252
- /**
253
- * Creates the Facebook Instant Games addon on a title, or updates it if it already exists.
254
- * https://docs.microsoft.com/rest/api/playfab/addon/addon/createorupdatefacebookinstantgames
255
- */
256
- CreateOrUpdateFacebookInstantGames(request, customData, extraHeaders) {
257
- return this.ExecuteRequestWrapper("/Addon/CreateOrUpdateFacebookInstantGames", request, "X-EntityToken", customData, extraHeaders);
258
- }
259
- /**
260
- * Creates the Google addon on a title, or updates it if it already exists.
261
- * https://docs.microsoft.com/rest/api/playfab/addon/addon/createorupdategoogle
262
- */
263
- CreateOrUpdateGoogle(request, customData, extraHeaders) {
264
- return this.ExecuteRequestWrapper("/Addon/CreateOrUpdateGoogle", request, "X-EntityToken", customData, extraHeaders);
265
- }
266
- /**
267
- * Creates the Kongregate addon on a title, or updates it if it already exists.
268
- * https://docs.microsoft.com/rest/api/playfab/addon/addon/createorupdatekongregate
269
- */
270
- CreateOrUpdateKongregate(request, customData, extraHeaders) {
271
- return this.ExecuteRequestWrapper("/Addon/CreateOrUpdateKongregate", request, "X-EntityToken", customData, extraHeaders);
272
- }
273
- /**
274
- * Creates the Nintendo addon on a title, or updates it if it already exists.
275
- * https://docs.microsoft.com/rest/api/playfab/addon/addon/createorupdatenintendo
276
- */
277
- CreateOrUpdateNintendo(request, customData, extraHeaders) {
278
- return this.ExecuteRequestWrapper("/Addon/CreateOrUpdateNintendo", request, "X-EntityToken", customData, extraHeaders);
279
- }
280
- /**
281
- * Creates the PSN addon on a title, or updates it if it already exists.
282
- * https://docs.microsoft.com/rest/api/playfab/addon/addon/createorupdatepsn
283
- */
284
- CreateOrUpdatePSN(request, customData, extraHeaders) {
285
- return this.ExecuteRequestWrapper("/Addon/CreateOrUpdatePSN", request, "X-EntityToken", customData, extraHeaders);
286
- }
287
- /**
288
- * Creates the Steam addon on a title, or updates it if it already exists.
289
- * https://docs.microsoft.com/rest/api/playfab/addon/addon/createorupdatesteam
290
- */
291
- CreateOrUpdateSteam(request, customData, extraHeaders) {
292
- return this.ExecuteRequestWrapper("/Addon/CreateOrUpdateSteam", request, "X-EntityToken", customData, extraHeaders);
293
- }
294
- /**
295
- * Creates the ToxMod addon on a title, or updates it if it already exists.
296
- * https://docs.microsoft.com/rest/api/playfab/addon/addon/createorupdatetoxmod
297
- */
298
- CreateOrUpdateToxMod(request, customData, extraHeaders) {
299
- return this.ExecuteRequestWrapper("/Addon/CreateOrUpdateToxMod", request, "X-EntityToken", customData, extraHeaders);
300
- }
301
- /**
302
- * Creates the Twitch addon on a title, or updates it if it already exists.
303
- * https://docs.microsoft.com/rest/api/playfab/addon/addon/createorupdatetwitch
304
- */
305
- CreateOrUpdateTwitch(request, customData, extraHeaders) {
306
- return this.ExecuteRequestWrapper("/Addon/CreateOrUpdateTwitch", request, "X-EntityToken", customData, extraHeaders);
307
- }
308
- /**
309
- * Deletes the Apple addon on a title.
310
- * https://docs.microsoft.com/rest/api/playfab/addon/addon/deleteapple
311
- */
312
- DeleteApple(request, customData, extraHeaders) {
313
- return this.ExecuteRequestWrapper("/Addon/DeleteApple", request, "X-EntityToken", customData, extraHeaders);
314
- }
315
- /**
316
- * Deletes the Facebook addon on a title.
317
- * https://docs.microsoft.com/rest/api/playfab/addon/addon/deletefacebook
318
- */
319
- DeleteFacebook(request, customData, extraHeaders) {
320
- return this.ExecuteRequestWrapper("/Addon/DeleteFacebook", request, "X-EntityToken", customData, extraHeaders);
321
- }
322
- /**
323
- * Deletes the Facebook addon on a title.
324
- * https://docs.microsoft.com/rest/api/playfab/addon/addon/deletefacebookinstantgames
325
- */
326
- DeleteFacebookInstantGames(request, customData, extraHeaders) {
327
- return this.ExecuteRequestWrapper("/Addon/DeleteFacebookInstantGames", request, "X-EntityToken", customData, extraHeaders);
328
- }
329
- /**
330
- * Deletes the Google addon on a title.
331
- * https://docs.microsoft.com/rest/api/playfab/addon/addon/deletegoogle
332
- */
333
- DeleteGoogle(request, customData, extraHeaders) {
334
- return this.ExecuteRequestWrapper("/Addon/DeleteGoogle", request, "X-EntityToken", customData, extraHeaders);
335
- }
336
- /**
337
- * Deletes the Kongregate addon on a title.
338
- * https://docs.microsoft.com/rest/api/playfab/addon/addon/deletekongregate
339
- */
340
- DeleteKongregate(request, customData, extraHeaders) {
341
- return this.ExecuteRequestWrapper("/Addon/DeleteKongregate", request, "X-EntityToken", customData, extraHeaders);
342
- }
343
- /**
344
- * Deletes the Nintendo addon on a title.
345
- * https://docs.microsoft.com/rest/api/playfab/addon/addon/deletenintendo
346
- */
347
- DeleteNintendo(request, customData, extraHeaders) {
348
- return this.ExecuteRequestWrapper("/Addon/DeleteNintendo", request, "X-EntityToken", customData, extraHeaders);
349
- }
350
- /**
351
- * Deletes the PSN addon on a title.
352
- * https://docs.microsoft.com/rest/api/playfab/addon/addon/deletepsn
353
- */
354
- DeletePSN(request, customData, extraHeaders) {
355
- return this.ExecuteRequestWrapper("/Addon/DeletePSN", request, "X-EntityToken", customData, extraHeaders);
356
- }
357
- /**
358
- * Deletes the Steam addon on a title.
359
- * https://docs.microsoft.com/rest/api/playfab/addon/addon/deletesteam
360
- */
361
- DeleteSteam(request, customData, extraHeaders) {
362
- return this.ExecuteRequestWrapper("/Addon/DeleteSteam", request, "X-EntityToken", customData, extraHeaders);
363
- }
364
- /**
365
- * Deletes the ToxMod addon on a title.
366
- * https://docs.microsoft.com/rest/api/playfab/addon/addon/deletetoxmod
367
- */
368
- DeleteToxMod(request, customData, extraHeaders) {
369
- return this.ExecuteRequestWrapper("/Addon/DeleteToxMod", request, "X-EntityToken", customData, extraHeaders);
370
- }
371
- /**
372
- * Deletes the Twitch addon on a title.
373
- * https://docs.microsoft.com/rest/api/playfab/addon/addon/deletetwitch
374
- */
375
- DeleteTwitch(request, customData, extraHeaders) {
376
- return this.ExecuteRequestWrapper("/Addon/DeleteTwitch", request, "X-EntityToken", customData, extraHeaders);
377
- }
378
- /**
379
- * Gets information of the Apple addon on a title, omits secrets.
380
- * https://docs.microsoft.com/rest/api/playfab/addon/addon/getapple
381
- */
382
- GetApple(request, customData, extraHeaders) {
383
- return this.ExecuteRequestWrapper("/Addon/GetApple", request, "X-EntityToken", customData, extraHeaders);
384
- }
385
- /**
386
- * Gets information of the Facebook addon on a title, omits secrets.
387
- * https://docs.microsoft.com/rest/api/playfab/addon/addon/getfacebook
388
- */
389
- GetFacebook(request, customData, extraHeaders) {
390
- return this.ExecuteRequestWrapper("/Addon/GetFacebook", request, "X-EntityToken", customData, extraHeaders);
391
- }
392
- /**
393
- * Gets information of the Facebook Instant Games addon on a title, omits secrets.
394
- * https://docs.microsoft.com/rest/api/playfab/addon/addon/getfacebookinstantgames
395
- */
396
- GetFacebookInstantGames(request, customData, extraHeaders) {
397
- return this.ExecuteRequestWrapper("/Addon/GetFacebookInstantGames", request, "X-EntityToken", customData, extraHeaders);
398
- }
399
- /**
400
- * Gets information of the Google addon on a title, omits secrets.
401
- * https://docs.microsoft.com/rest/api/playfab/addon/addon/getgoogle
402
- */
403
- GetGoogle(request, customData, extraHeaders) {
404
- return this.ExecuteRequestWrapper("/Addon/GetGoogle", request, "X-EntityToken", customData, extraHeaders);
405
- }
406
- /**
407
- * Gets information of the Kongregate addon on a title, omits secrets.
408
- * https://docs.microsoft.com/rest/api/playfab/addon/addon/getkongregate
409
- */
410
- GetKongregate(request, customData, extraHeaders) {
411
- return this.ExecuteRequestWrapper("/Addon/GetKongregate", request, "X-EntityToken", customData, extraHeaders);
412
- }
413
- /**
414
- * Gets information of the Nintendo addon on a title, omits secrets.
415
- * https://docs.microsoft.com/rest/api/playfab/addon/addon/getnintendo
416
- */
417
- GetNintendo(request, customData, extraHeaders) {
418
- return this.ExecuteRequestWrapper("/Addon/GetNintendo", request, "X-EntityToken", customData, extraHeaders);
419
- }
420
- /**
421
- * Gets information of the PSN addon on a title, omits secrets.
422
- * https://docs.microsoft.com/rest/api/playfab/addon/addon/getpsn
423
- */
424
- GetPSN(request, customData, extraHeaders) {
425
- return this.ExecuteRequestWrapper("/Addon/GetPSN", request, "X-EntityToken", customData, extraHeaders);
426
- }
427
- /**
428
- * Gets information of the Steam addon on a title, omits secrets.
429
- * https://docs.microsoft.com/rest/api/playfab/addon/addon/getsteam
430
- */
431
- GetSteam(request, customData, extraHeaders) {
432
- return this.ExecuteRequestWrapper("/Addon/GetSteam", request, "X-EntityToken", customData, extraHeaders);
433
- }
434
- /**
435
- * Gets information of the ToxMod addon on a title, omits secrets.
436
- * https://docs.microsoft.com/rest/api/playfab/addon/addon/gettoxmod
437
- */
438
- GetToxMod(request, customData, extraHeaders) {
439
- return this.ExecuteRequestWrapper("/Addon/GetToxMod", request, "X-EntityToken", customData, extraHeaders);
440
- }
441
- /**
442
- * Gets information of the Twitch addon on a title, omits secrets.
443
- * https://docs.microsoft.com/rest/api/playfab/addon/addon/gettwitch
444
- */
445
- GetTwitch(request, customData, extraHeaders) {
446
- return this.ExecuteRequestWrapper("/Addon/GetTwitch", request, "X-EntityToken", customData, extraHeaders);
447
- }
448
- };
1
+ import {
2
+ PlayFabAddonApi
3
+ } from "./chunk-A7VD6ALV.js";
4
+ import "./chunk-62SULWOK.js";
449
5
  export {
450
6
  PlayFabAddonApi as default
451
7
  };