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.
- package/dist/Addon.d.ts +31 -31
- package/dist/Addon.js +4 -448
- package/dist/Addon.js.map +1 -1
- package/dist/Admin.d.ts +118 -118
- package/dist/Admin.js +4 -1108
- package/dist/Admin.js.map +1 -1
- package/dist/Authentication.d.ts +5 -5
- package/dist/Authentication.js +4 -286
- package/dist/Authentication.js.map +1 -1
- package/dist/Client.d.ts +174 -174
- package/dist/Client.js +4 -1889
- package/dist/Client.js.map +1 -1
- package/dist/CloudScript.d.ts +16 -16
- package/dist/CloudScript.js +4 -345
- package/dist/CloudScript.js.map +1 -1
- package/dist/Data.d.ts +8 -8
- package/dist/Data.js +4 -287
- package/dist/Data.js.map +1 -1
- package/dist/Economy.d.ts +47 -47
- package/dist/Economy.js +4 -610
- package/dist/Economy.js.map +1 -1
- package/dist/Events.d.ts +13 -13
- package/dist/Events.js +4 -323
- package/dist/Events.js.map +1 -1
- package/dist/Experimentation.d.ts +14 -14
- package/dist/Experimentation.js +4 -329
- package/dist/Experimentation.js.map +1 -1
- package/dist/Groups.d.ts +26 -26
- package/dist/Groups.js +4 -413
- package/dist/Groups.js.map +1 -1
- package/dist/Insights.d.ts +7 -7
- package/dist/Insights.js +4 -282
- package/dist/Insights.js.map +1 -1
- package/dist/Localization.d.ts +2 -2
- package/dist/Localization.js +4 -245
- package/dist/Localization.js.map +1 -1
- package/dist/Multiplayer.d.ts +88 -88
- package/dist/Multiplayer.js +4 -858
- package/dist/Multiplayer.js.map +1 -1
- package/dist/{PlayFabCommon-BUv4zqXf.d.ts → PlayFabCommon-BX3jSqGx.d.ts} +4 -6
- package/dist/Profiles.d.ts +10 -10
- package/dist/Profiles.js +4 -302
- package/dist/Profiles.js.map +1 -1
- package/dist/Progression.d.ts +24 -24
- package/dist/Progression.js +4 -400
- package/dist/Progression.js.map +1 -1
- package/dist/Server.d.ts +150 -150
- package/dist/Server.js +4 -1373
- package/dist/Server.js.map +1 -1
- package/dist/chunk-3FCAP7OZ.js +187 -0
- package/dist/chunk-3FCAP7OZ.js.map +1 -0
- package/dist/chunk-62SULWOK.js +195 -0
- package/dist/chunk-62SULWOK.js.map +1 -0
- package/dist/chunk-A7VD6ALV.js +222 -0
- package/dist/chunk-A7VD6ALV.js.map +1 -0
- package/dist/chunk-BX65UND2.js +632 -0
- package/dist/chunk-BX65UND2.js.map +1 -0
- package/dist/chunk-J4QS5VX5.js +19 -0
- package/dist/chunk-J4QS5VX5.js.map +1 -0
- package/dist/chunk-JGDO2ZE3.js +1663 -0
- package/dist/chunk-JGDO2ZE3.js.map +1 -0
- package/dist/chunk-POMI7LEF.js +76 -0
- package/dist/chunk-POMI7LEF.js.map +1 -0
- package/dist/chunk-Q3OF3AOJ.js +97 -0
- package/dist/chunk-Q3OF3AOJ.js.map +1 -0
- package/dist/chunk-QUZHVSVZ.js +174 -0
- package/dist/chunk-QUZHVSVZ.js.map +1 -0
- package/dist/chunk-QVLIVSO4.js +1147 -0
- package/dist/chunk-QVLIVSO4.js.map +1 -0
- package/dist/chunk-R7V7DFCF.js +103 -0
- package/dist/chunk-R7V7DFCF.js.map +1 -0
- package/dist/chunk-SGSEOIKS.js +56 -0
- package/dist/chunk-SGSEOIKS.js.map +1 -0
- package/dist/chunk-UOHHNVCJ.js +119 -0
- package/dist/chunk-UOHHNVCJ.js.map +1 -0
- package/dist/chunk-USKFWNQK.js +384 -0
- package/dist/chunk-USKFWNQK.js.map +1 -0
- package/dist/chunk-UX7LFJCX.js +61 -0
- package/dist/chunk-UX7LFJCX.js.map +1 -0
- package/dist/chunk-X34XZJB6.js +60 -0
- package/dist/chunk-X34XZJB6.js.map +1 -0
- package/dist/chunk-YNZF3WXS.js +882 -0
- package/dist/chunk-YNZF3WXS.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +49 -5988
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/Profiles.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/constants.ts","../src/PlayFabContext.ts","../src/PlayFabCommon.ts","../src/apis/PlayFabProfilesApi.ts"],"sourcesContent":["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","import type {\n\n GetGlobalPolicyRequest,\n GetEntityProfileRequest,\n GetEntityProfilesRequest,\n GetTitlePlayersFromMasterPlayerAccountIdsRequest,\n GetTitlePlayersFromXboxLiveIDsRequest,\n SetDisplayNameRequest,\n SetGlobalPolicyRequest,\n SetProfileLanguageRequest,\n SetEntityProfilePolicyRequest,\n GetGlobalPolicyResponse,\n GetEntityProfileResponse,\n GetEntityProfilesResponse,\n GetTitlePlayersFromMasterPlayerAccountIdsResponse,\n GetTitlePlayersFromProviderIDsResponse,\n SetDisplayNameResponse,\n SetGlobalPolicyResponse,\n SetProfileLanguageResponse,\n SetEntityProfilePolicyResponse,\n} from \"../types/PlayFabProfilesApi\";\nimport { PlayFabCommon } from \"../PlayFabCommon\";\n\nexport default class PlayFabProfilesApi extends PlayFabCommon {\n\n /**\n * Gets the global title access policy\n * https://docs.microsoft.com/rest/api/playfab/profiles/account-management/getglobalpolicy\n */\n GetGlobalPolicy (request: GetGlobalPolicyRequest, customData?: any, extraHeaders?: Record<string, string>) {\n return this.ExecuteRequestWrapper<GetGlobalPolicyResponse>(\"/Profile/GetGlobalPolicy\", request, \"X-EntityToken\", customData, extraHeaders);\n }\n\n /**\n * Retrieves the entity's profile.\n * https://docs.microsoft.com/rest/api/playfab/profiles/account-management/getprofile\n */\n GetProfile (request: GetEntityProfileRequest, customData?: any, extraHeaders?: Record<string, string>) {\n return this.ExecuteRequestWrapper<GetEntityProfileResponse>(\"/Profile/GetProfile\", request, \"X-EntityToken\", customData, extraHeaders);\n }\n\n /**\n * Retrieves the entity's profile.\n * https://docs.microsoft.com/rest/api/playfab/profiles/account-management/getprofiles\n */\n GetProfiles (request: GetEntityProfilesRequest, customData?: any, extraHeaders?: Record<string, string>) {\n return this.ExecuteRequestWrapper<GetEntityProfilesResponse>(\"/Profile/GetProfiles\", request, \"X-EntityToken\", customData, extraHeaders);\n }\n\n /**\n * Retrieves the title player accounts associated with the given master player account.\n * https://docs.microsoft.com/rest/api/playfab/profiles/account-management/gettitleplayersfrommasterplayeraccountids\n */\n GetTitlePlayersFromMasterPlayerAccountIds (request: GetTitlePlayersFromMasterPlayerAccountIdsRequest, customData?: any, extraHeaders?: Record<string, string>) {\n return this.ExecuteRequestWrapper<GetTitlePlayersFromMasterPlayerAccountIdsResponse>(\"/Profile/GetTitlePlayersFromMasterPlayerAccountIds\", request, \"X-EntityToken\", customData, extraHeaders);\n }\n\n /**\n * Retrieves the title player accounts associated with the given XUIDs.\n * https://docs.microsoft.com/rest/api/playfab/profiles/account-management/gettitleplayersfromxboxliveids\n */\n GetTitlePlayersFromXboxLiveIDs (request: GetTitlePlayersFromXboxLiveIDsRequest, customData?: any, extraHeaders?: Record<string, string>) {\n return this.ExecuteRequestWrapper<GetTitlePlayersFromProviderIDsResponse>(\"/Profile/GetTitlePlayersFromXboxLiveIDs\", request, \"X-EntityToken\", customData, extraHeaders);\n }\n\n /**\n * Update the display name of the entity\n * https://docs.microsoft.com/rest/api/playfab/profiles/account-management/setdisplayname\n */\n SetDisplayName (request: SetDisplayNameRequest, customData?: any, extraHeaders?: Record<string, string>) {\n return this.ExecuteRequestWrapper<SetDisplayNameResponse>(\"/Profile/SetDisplayName\", request, \"X-EntityToken\", customData, extraHeaders);\n }\n\n /**\n * Sets the global title access policy\n * https://docs.microsoft.com/rest/api/playfab/profiles/account-management/setglobalpolicy\n */\n SetGlobalPolicy (request: SetGlobalPolicyRequest, customData?: any, extraHeaders?: Record<string, string>) {\n return this.ExecuteRequestWrapper<SetGlobalPolicyResponse>(\"/Profile/SetGlobalPolicy\", request, \"X-EntityToken\", customData, extraHeaders);\n }\n\n /**\n * Updates the entity's language. The precedence hierarchy for communication to the player is Title Player Account\n * language, Master Player Account language, and then title default language if the first two aren't set or supported.\n * https://docs.microsoft.com/rest/api/playfab/profiles/account-management/setprofilelanguage\n */\n SetProfileLanguage (request: SetProfileLanguageRequest, customData?: any, extraHeaders?: Record<string, string>) {\n return this.ExecuteRequestWrapper<SetProfileLanguageResponse>(\"/Profile/SetProfileLanguage\", request, \"X-EntityToken\", customData, extraHeaders);\n }\n\n /**\n * Sets the profiles access policy\n * https://docs.microsoft.com/rest/api/playfab/profiles/account-management/setprofilepolicy\n */\n SetProfilePolicy (request: SetEntityProfilePolicyRequest, customData?: any, extraHeaders?: Record<string, string>) {\n return this.ExecuteRequestWrapper<SetEntityProfilePolicyResponse>(\"/Profile/SetProfilePolicy\", request, \"X-EntityToken\", customData, extraHeaders);\n }\n\n};\n"],"mappings":";AAWO,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+B;AAE/B,uBAA6B;AAAA,EAEN;AAAA,EAEvB,WAAkB,WAA2B;AAC3C,QAAI,CAAC,gBAAe,WAAW;AAC7B,sBAAe,YAAY,IAAI,gBAAe;AAAA,IAChD;AAEA,WAAO,gBAAe;AAAA,EACxB;AACF;;;AChCO,IAAM,gBAAN,MAAoB;AAAA,EAazB,YAAY,WAA2C,QAAW;AAZlE,2BAA0B,kBAAU;AACpC,4BAAmB;AAAA,MACjB,KAAK,kBAAU;AA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AAAA,EAMA,eAAgB,SAAgC,YAAkB,cAAuC;AACrG,WAAO,KAAK,sBAA8C,2BAA2B,SAAS,iBAAiB,YAAY,YAAY;AAAA,EAC3I;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,gBAAiB,SAAiC,YAAkB,cAAuC;AACvG,WAAO,KAAK,sBAA+C,4BAA4B,SAAS,iBAAiB,YAAY,YAAY;AAAA,EAC7I;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,mBAAoB,SAAoC,YAAkB,cAAuC;AAC7G,WAAO,KAAK,sBAAkD,+BAA+B,SAAS,iBAAiB,YAAY,YAAY;AAAA,EACnJ;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,iBAAkB,SAAwC,YAAkB,cAAuC;AAC/G,WAAO,KAAK,sBAAsD,6BAA6B,SAAS,iBAAiB,YAAY,YAAY;AAAA,EACrJ;AAEJ;","names":[]}
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/Progression.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { I as IPlayFabRequestCommon, a as IPlayFabResultCommon, P as PlayFabCommon, E as EmptyResponse } from './PlayFabCommon-
|
1
|
+
import { I as IPlayFabRequestCommon, a as IPlayFabResultCommon, P as PlayFabCommon, E as EmptyResponse } from './PlayFabCommon-BX3jSqGx.js';
|
2
2
|
|
3
3
|
interface CreateLeaderboardDefinitionRequest extends IPlayFabRequestCommon {
|
4
4
|
/**
|
@@ -481,118 +481,118 @@ declare class PlayFabProgressionApi extends PlayFabCommon {
|
|
481
481
|
* Creates a new leaderboard definition.
|
482
482
|
* https://docs.microsoft.com/rest/api/playfab/progression/leaderboards/createleaderboarddefinition
|
483
483
|
*/
|
484
|
-
CreateLeaderboardDefinition(request: CreateLeaderboardDefinitionRequest,
|
484
|
+
CreateLeaderboardDefinition(request: CreateLeaderboardDefinitionRequest, extraHeaders?: Record<string, string>): Promise<EmptyResponse>;
|
485
485
|
/**
|
486
486
|
* Create a new entity statistic definition.
|
487
487
|
* https://docs.microsoft.com/rest/api/playfab/progression/statistics/createstatisticdefinition
|
488
488
|
*/
|
489
|
-
CreateStatisticDefinition(request: CreateStatisticDefinitionRequest,
|
489
|
+
CreateStatisticDefinition(request: CreateStatisticDefinitionRequest, extraHeaders?: Record<string, string>): Promise<EmptyResponse>;
|
490
490
|
/**
|
491
491
|
* Deletes a leaderboard definition.
|
492
492
|
* https://docs.microsoft.com/rest/api/playfab/progression/leaderboards/deleteleaderboarddefinition
|
493
493
|
*/
|
494
|
-
DeleteLeaderboardDefinition(request: DeleteLeaderboardDefinitionRequest,
|
494
|
+
DeleteLeaderboardDefinition(request: DeleteLeaderboardDefinitionRequest, extraHeaders?: Record<string, string>): Promise<EmptyResponse>;
|
495
495
|
/**
|
496
496
|
* Deletes the specified entries from the given leaderboard.
|
497
497
|
* https://docs.microsoft.com/rest/api/playfab/progression/leaderboards/deleteleaderboardentries
|
498
498
|
*/
|
499
|
-
DeleteLeaderboardEntries(request: DeleteLeaderboardEntriesRequest,
|
499
|
+
DeleteLeaderboardEntries(request: DeleteLeaderboardEntriesRequest, extraHeaders?: Record<string, string>): Promise<EmptyResponse>;
|
500
500
|
/**
|
501
501
|
* Delete an entity statistic definition. Will delete all statistics on entity profiles and leaderboards.
|
502
502
|
* https://docs.microsoft.com/rest/api/playfab/progression/statistics/deletestatisticdefinition
|
503
503
|
*/
|
504
|
-
DeleteStatisticDefinition(request: DeleteStatisticDefinitionRequest,
|
504
|
+
DeleteStatisticDefinition(request: DeleteStatisticDefinitionRequest, extraHeaders?: Record<string, string>): Promise<EmptyResponse>;
|
505
505
|
/**
|
506
506
|
* Delete statistics on an entity profile. This will remove all rankings from associated leaderboards.
|
507
507
|
* https://docs.microsoft.com/rest/api/playfab/progression/statistics/deletestatistics
|
508
508
|
*/
|
509
|
-
DeleteStatistics(request: DeleteStatisticsRequest,
|
509
|
+
DeleteStatistics(request: DeleteStatisticsRequest, extraHeaders?: Record<string, string>): Promise<DeleteStatisticsResponse>;
|
510
510
|
/**
|
511
511
|
* Get the friend leaderboard for the specified entity. A maximum of 25 friend entries are listed in the leaderboard.
|
512
512
|
* https://docs.microsoft.com/rest/api/playfab/progression/leaderboards/getfriendleaderboardforentity
|
513
513
|
*/
|
514
|
-
GetFriendLeaderboardForEntity(request: GetFriendLeaderboardForEntityRequest,
|
514
|
+
GetFriendLeaderboardForEntity(request: GetFriendLeaderboardForEntityRequest, extraHeaders?: Record<string, string>): Promise<GetEntityLeaderboardResponse>;
|
515
515
|
/**
|
516
516
|
* Get the leaderboard for a specific entity type and statistic.
|
517
517
|
* https://docs.microsoft.com/rest/api/playfab/progression/leaderboards/getleaderboard
|
518
518
|
*/
|
519
|
-
GetLeaderboard(request: GetEntityLeaderboardRequest,
|
519
|
+
GetLeaderboard(request: GetEntityLeaderboardRequest, extraHeaders?: Record<string, string>): Promise<GetEntityLeaderboardResponse>;
|
520
520
|
/**
|
521
521
|
* Get the leaderboard around a specific entity.
|
522
522
|
* https://docs.microsoft.com/rest/api/playfab/progression/leaderboards/getleaderboardaroundentity
|
523
523
|
*/
|
524
|
-
GetLeaderboardAroundEntity(request: GetLeaderboardAroundEntityRequest,
|
524
|
+
GetLeaderboardAroundEntity(request: GetLeaderboardAroundEntityRequest, extraHeaders?: Record<string, string>): Promise<GetEntityLeaderboardResponse>;
|
525
525
|
/**
|
526
526
|
* Gets the specified leaderboard definition.
|
527
527
|
* https://docs.microsoft.com/rest/api/playfab/progression/leaderboards/getleaderboarddefinition
|
528
528
|
*/
|
529
|
-
GetLeaderboardDefinition(request: GetLeaderboardDefinitionRequest,
|
529
|
+
GetLeaderboardDefinition(request: GetLeaderboardDefinitionRequest, extraHeaders?: Record<string, string>): Promise<GetLeaderboardDefinitionResponse>;
|
530
530
|
/**
|
531
531
|
* Get the leaderboard limited to a set of entities.
|
532
532
|
* https://docs.microsoft.com/rest/api/playfab/progression/leaderboards/getleaderboardforentities
|
533
533
|
*/
|
534
|
-
GetLeaderboardForEntities(request: GetLeaderboardForEntitiesRequest,
|
534
|
+
GetLeaderboardForEntities(request: GetLeaderboardForEntitiesRequest, extraHeaders?: Record<string, string>): Promise<GetEntityLeaderboardResponse>;
|
535
535
|
/**
|
536
536
|
* Get current statistic definition information
|
537
537
|
* https://docs.microsoft.com/rest/api/playfab/progression/statistics/getstatisticdefinition
|
538
538
|
*/
|
539
|
-
GetStatisticDefinition(request: GetStatisticDefinitionRequest,
|
539
|
+
GetStatisticDefinition(request: GetStatisticDefinitionRequest, extraHeaders?: Record<string, string>): Promise<GetStatisticDefinitionResponse>;
|
540
540
|
/**
|
541
541
|
* Gets statistics for the specified entity.
|
542
542
|
* https://docs.microsoft.com/rest/api/playfab/progression/statistics/getstatistics
|
543
543
|
*/
|
544
|
-
GetStatistics(request: GetStatisticsRequest,
|
544
|
+
GetStatistics(request: GetStatisticsRequest, extraHeaders?: Record<string, string>): Promise<GetStatisticsResponse>;
|
545
545
|
/**
|
546
546
|
* Gets statistics for the specified collection of entities.
|
547
547
|
* https://docs.microsoft.com/rest/api/playfab/progression/statistics/getstatisticsforentities
|
548
548
|
*/
|
549
|
-
GetStatisticsForEntities(request: GetStatisticsForEntitiesRequest,
|
549
|
+
GetStatisticsForEntities(request: GetStatisticsForEntitiesRequest, extraHeaders?: Record<string, string>): Promise<GetStatisticsForEntitiesResponse>;
|
550
550
|
/**
|
551
551
|
* Increment a leaderboard version.
|
552
552
|
* https://docs.microsoft.com/rest/api/playfab/progression/leaderboards/incrementleaderboardversion
|
553
553
|
*/
|
554
|
-
IncrementLeaderboardVersion(request: IncrementLeaderboardVersionRequest,
|
554
|
+
IncrementLeaderboardVersion(request: IncrementLeaderboardVersionRequest, extraHeaders?: Record<string, string>): Promise<IncrementLeaderboardVersionResponse>;
|
555
555
|
/**
|
556
556
|
* Increment an entity statistic definition version.
|
557
557
|
* https://docs.microsoft.com/rest/api/playfab/progression/statistics/incrementstatisticversion
|
558
558
|
*/
|
559
|
-
IncrementStatisticVersion(request: IncrementStatisticVersionRequest,
|
559
|
+
IncrementStatisticVersion(request: IncrementStatisticVersionRequest, extraHeaders?: Record<string, string>): Promise<IncrementStatisticVersionResponse>;
|
560
560
|
/**
|
561
561
|
* Lists the leaderboard definitions defined for the Title.
|
562
562
|
* https://docs.microsoft.com/rest/api/playfab/progression/leaderboards/listleaderboarddefinitions
|
563
563
|
*/
|
564
|
-
ListLeaderboardDefinitions(request: ListLeaderboardDefinitionsRequest,
|
564
|
+
ListLeaderboardDefinitions(request: ListLeaderboardDefinitionsRequest, extraHeaders?: Record<string, string>): Promise<ListLeaderboardDefinitionsResponse>;
|
565
565
|
/**
|
566
566
|
* Get all current statistic definitions information
|
567
567
|
* https://docs.microsoft.com/rest/api/playfab/progression/statistics/liststatisticdefinitions
|
568
568
|
*/
|
569
|
-
ListStatisticDefinitions(request: ListStatisticDefinitionsRequest,
|
569
|
+
ListStatisticDefinitions(request: ListStatisticDefinitionsRequest, extraHeaders?: Record<string, string>): Promise<ListStatisticDefinitionsResponse>;
|
570
570
|
/**
|
571
571
|
* Unlinks a leaderboard definition from it's linked statistic definition.
|
572
572
|
* https://docs.microsoft.com/rest/api/playfab/progression/leaderboards/unlinkleaderboardfromstatistic
|
573
573
|
*/
|
574
|
-
UnlinkLeaderboardFromStatistic(request: UnlinkLeaderboardFromStatisticRequest,
|
574
|
+
UnlinkLeaderboardFromStatistic(request: UnlinkLeaderboardFromStatisticRequest, extraHeaders?: Record<string, string>): Promise<EmptyResponse>;
|
575
575
|
/**
|
576
576
|
* Updates a leaderboard definition.
|
577
577
|
* https://docs.microsoft.com/rest/api/playfab/progression/leaderboards/updateleaderboarddefinition
|
578
578
|
*/
|
579
|
-
UpdateLeaderboardDefinition(request: UpdateLeaderboardDefinitionRequest,
|
579
|
+
UpdateLeaderboardDefinition(request: UpdateLeaderboardDefinitionRequest, extraHeaders?: Record<string, string>): Promise<EmptyResponse>;
|
580
580
|
/**
|
581
581
|
* Adds or updates entries on the specified leaderboard.
|
582
582
|
* https://docs.microsoft.com/rest/api/playfab/progression/leaderboards/updateleaderboardentries
|
583
583
|
*/
|
584
|
-
UpdateLeaderboardEntries(request: UpdateLeaderboardEntriesRequest,
|
584
|
+
UpdateLeaderboardEntries(request: UpdateLeaderboardEntriesRequest, extraHeaders?: Record<string, string>): Promise<EmptyResponse>;
|
585
585
|
/**
|
586
586
|
* Update an existing entity statistic definition.
|
587
587
|
* https://docs.microsoft.com/rest/api/playfab/progression/statistics/updatestatisticdefinition
|
588
588
|
*/
|
589
|
-
UpdateStatisticDefinition(request: UpdateStatisticDefinitionRequest,
|
589
|
+
UpdateStatisticDefinition(request: UpdateStatisticDefinitionRequest, extraHeaders?: Record<string, string>): Promise<EmptyResponse>;
|
590
590
|
/**
|
591
591
|
* Update statistics on an entity profile. Depending on the statistic definition, this may result in entity being ranked on
|
592
592
|
* various leaderboards.
|
593
593
|
* https://docs.microsoft.com/rest/api/playfab/progression/statistics/updatestatistics
|
594
594
|
*/
|
595
|
-
UpdateStatistics(request: UpdateStatisticsRequest,
|
595
|
+
UpdateStatistics(request: UpdateStatisticsRequest, extraHeaders?: Record<string, string>): Promise<UpdateStatisticsResponse>;
|
596
596
|
}
|
597
597
|
|
598
598
|
export { PlayFabProgressionApi as default };
|
package/dist/Progression.js
CHANGED
@@ -1,403 +1,7 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
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/PlayFabProgressionApi.ts
|
237
|
-
var PlayFabProgressionApi = class extends PlayFabCommon {
|
238
|
-
/**
|
239
|
-
* Creates a new leaderboard definition.
|
240
|
-
* https://docs.microsoft.com/rest/api/playfab/progression/leaderboards/createleaderboarddefinition
|
241
|
-
*/
|
242
|
-
CreateLeaderboardDefinition(request, customData, extraHeaders) {
|
243
|
-
return this.ExecuteRequestWrapper("/Leaderboard/CreateLeaderboardDefinition", request, "X-EntityToken", customData, extraHeaders);
|
244
|
-
}
|
245
|
-
/**
|
246
|
-
* Create a new entity statistic definition.
|
247
|
-
* https://docs.microsoft.com/rest/api/playfab/progression/statistics/createstatisticdefinition
|
248
|
-
*/
|
249
|
-
CreateStatisticDefinition(request, customData, extraHeaders) {
|
250
|
-
return this.ExecuteRequestWrapper("/Statistic/CreateStatisticDefinition", request, "X-EntityToken", customData, extraHeaders);
|
251
|
-
}
|
252
|
-
/**
|
253
|
-
* Deletes a leaderboard definition.
|
254
|
-
* https://docs.microsoft.com/rest/api/playfab/progression/leaderboards/deleteleaderboarddefinition
|
255
|
-
*/
|
256
|
-
DeleteLeaderboardDefinition(request, customData, extraHeaders) {
|
257
|
-
return this.ExecuteRequestWrapper("/Leaderboard/DeleteLeaderboardDefinition", request, "X-EntityToken", customData, extraHeaders);
|
258
|
-
}
|
259
|
-
/**
|
260
|
-
* Deletes the specified entries from the given leaderboard.
|
261
|
-
* https://docs.microsoft.com/rest/api/playfab/progression/leaderboards/deleteleaderboardentries
|
262
|
-
*/
|
263
|
-
DeleteLeaderboardEntries(request, customData, extraHeaders) {
|
264
|
-
return this.ExecuteRequestWrapper("/Leaderboard/DeleteLeaderboardEntries", request, "X-EntityToken", customData, extraHeaders);
|
265
|
-
}
|
266
|
-
/**
|
267
|
-
* Delete an entity statistic definition. Will delete all statistics on entity profiles and leaderboards.
|
268
|
-
* https://docs.microsoft.com/rest/api/playfab/progression/statistics/deletestatisticdefinition
|
269
|
-
*/
|
270
|
-
DeleteStatisticDefinition(request, customData, extraHeaders) {
|
271
|
-
return this.ExecuteRequestWrapper("/Statistic/DeleteStatisticDefinition", request, "X-EntityToken", customData, extraHeaders);
|
272
|
-
}
|
273
|
-
/**
|
274
|
-
* Delete statistics on an entity profile. This will remove all rankings from associated leaderboards.
|
275
|
-
* https://docs.microsoft.com/rest/api/playfab/progression/statistics/deletestatistics
|
276
|
-
*/
|
277
|
-
DeleteStatistics(request, customData, extraHeaders) {
|
278
|
-
return this.ExecuteRequestWrapper("/Statistic/DeleteStatistics", request, "X-EntityToken", customData, extraHeaders);
|
279
|
-
}
|
280
|
-
/**
|
281
|
-
* Get the friend leaderboard for the specified entity. A maximum of 25 friend entries are listed in the leaderboard.
|
282
|
-
* https://docs.microsoft.com/rest/api/playfab/progression/leaderboards/getfriendleaderboardforentity
|
283
|
-
*/
|
284
|
-
GetFriendLeaderboardForEntity(request, customData, extraHeaders) {
|
285
|
-
return this.ExecuteRequestWrapper("/Leaderboard/GetFriendLeaderboardForEntity", request, "X-EntityToken", customData, extraHeaders);
|
286
|
-
}
|
287
|
-
/**
|
288
|
-
* Get the leaderboard for a specific entity type and statistic.
|
289
|
-
* https://docs.microsoft.com/rest/api/playfab/progression/leaderboards/getleaderboard
|
290
|
-
*/
|
291
|
-
GetLeaderboard(request, customData, extraHeaders) {
|
292
|
-
return this.ExecuteRequestWrapper("/Leaderboard/GetLeaderboard", request, "X-EntityToken", customData, extraHeaders);
|
293
|
-
}
|
294
|
-
/**
|
295
|
-
* Get the leaderboard around a specific entity.
|
296
|
-
* https://docs.microsoft.com/rest/api/playfab/progression/leaderboards/getleaderboardaroundentity
|
297
|
-
*/
|
298
|
-
GetLeaderboardAroundEntity(request, customData, extraHeaders) {
|
299
|
-
return this.ExecuteRequestWrapper("/Leaderboard/GetLeaderboardAroundEntity", request, "X-EntityToken", customData, extraHeaders);
|
300
|
-
}
|
301
|
-
/**
|
302
|
-
* Gets the specified leaderboard definition.
|
303
|
-
* https://docs.microsoft.com/rest/api/playfab/progression/leaderboards/getleaderboarddefinition
|
304
|
-
*/
|
305
|
-
GetLeaderboardDefinition(request, customData, extraHeaders) {
|
306
|
-
return this.ExecuteRequestWrapper("/Leaderboard/GetLeaderboardDefinition", request, "X-EntityToken", customData, extraHeaders);
|
307
|
-
}
|
308
|
-
/**
|
309
|
-
* Get the leaderboard limited to a set of entities.
|
310
|
-
* https://docs.microsoft.com/rest/api/playfab/progression/leaderboards/getleaderboardforentities
|
311
|
-
*/
|
312
|
-
GetLeaderboardForEntities(request, customData, extraHeaders) {
|
313
|
-
return this.ExecuteRequestWrapper("/Leaderboard/GetLeaderboardForEntities", request, "X-EntityToken", customData, extraHeaders);
|
314
|
-
}
|
315
|
-
/**
|
316
|
-
* Get current statistic definition information
|
317
|
-
* https://docs.microsoft.com/rest/api/playfab/progression/statistics/getstatisticdefinition
|
318
|
-
*/
|
319
|
-
GetStatisticDefinition(request, customData, extraHeaders) {
|
320
|
-
return this.ExecuteRequestWrapper("/Statistic/GetStatisticDefinition", request, "X-EntityToken", customData, extraHeaders);
|
321
|
-
}
|
322
|
-
/**
|
323
|
-
* Gets statistics for the specified entity.
|
324
|
-
* https://docs.microsoft.com/rest/api/playfab/progression/statistics/getstatistics
|
325
|
-
*/
|
326
|
-
GetStatistics(request, customData, extraHeaders) {
|
327
|
-
return this.ExecuteRequestWrapper("/Statistic/GetStatistics", request, "X-EntityToken", customData, extraHeaders);
|
328
|
-
}
|
329
|
-
/**
|
330
|
-
* Gets statistics for the specified collection of entities.
|
331
|
-
* https://docs.microsoft.com/rest/api/playfab/progression/statistics/getstatisticsforentities
|
332
|
-
*/
|
333
|
-
GetStatisticsForEntities(request, customData, extraHeaders) {
|
334
|
-
return this.ExecuteRequestWrapper("/Statistic/GetStatisticsForEntities", request, "X-EntityToken", customData, extraHeaders);
|
335
|
-
}
|
336
|
-
/**
|
337
|
-
* Increment a leaderboard version.
|
338
|
-
* https://docs.microsoft.com/rest/api/playfab/progression/leaderboards/incrementleaderboardversion
|
339
|
-
*/
|
340
|
-
IncrementLeaderboardVersion(request, customData, extraHeaders) {
|
341
|
-
return this.ExecuteRequestWrapper("/Leaderboard/IncrementLeaderboardVersion", request, "X-EntityToken", customData, extraHeaders);
|
342
|
-
}
|
343
|
-
/**
|
344
|
-
* Increment an entity statistic definition version.
|
345
|
-
* https://docs.microsoft.com/rest/api/playfab/progression/statistics/incrementstatisticversion
|
346
|
-
*/
|
347
|
-
IncrementStatisticVersion(request, customData, extraHeaders) {
|
348
|
-
return this.ExecuteRequestWrapper("/Statistic/IncrementStatisticVersion", request, "X-EntityToken", customData, extraHeaders);
|
349
|
-
}
|
350
|
-
/**
|
351
|
-
* Lists the leaderboard definitions defined for the Title.
|
352
|
-
* https://docs.microsoft.com/rest/api/playfab/progression/leaderboards/listleaderboarddefinitions
|
353
|
-
*/
|
354
|
-
ListLeaderboardDefinitions(request, customData, extraHeaders) {
|
355
|
-
return this.ExecuteRequestWrapper("/Leaderboard/ListLeaderboardDefinitions", request, "X-EntityToken", customData, extraHeaders);
|
356
|
-
}
|
357
|
-
/**
|
358
|
-
* Get all current statistic definitions information
|
359
|
-
* https://docs.microsoft.com/rest/api/playfab/progression/statistics/liststatisticdefinitions
|
360
|
-
*/
|
361
|
-
ListStatisticDefinitions(request, customData, extraHeaders) {
|
362
|
-
return this.ExecuteRequestWrapper("/Statistic/ListStatisticDefinitions", request, "X-EntityToken", customData, extraHeaders);
|
363
|
-
}
|
364
|
-
/**
|
365
|
-
* Unlinks a leaderboard definition from it's linked statistic definition.
|
366
|
-
* https://docs.microsoft.com/rest/api/playfab/progression/leaderboards/unlinkleaderboardfromstatistic
|
367
|
-
*/
|
368
|
-
UnlinkLeaderboardFromStatistic(request, customData, extraHeaders) {
|
369
|
-
return this.ExecuteRequestWrapper("/Leaderboard/UnlinkLeaderboardFromStatistic", request, "X-EntityToken", customData, extraHeaders);
|
370
|
-
}
|
371
|
-
/**
|
372
|
-
* Updates a leaderboard definition.
|
373
|
-
* https://docs.microsoft.com/rest/api/playfab/progression/leaderboards/updateleaderboarddefinition
|
374
|
-
*/
|
375
|
-
UpdateLeaderboardDefinition(request, customData, extraHeaders) {
|
376
|
-
return this.ExecuteRequestWrapper("/Leaderboard/UpdateLeaderboardDefinition", request, "X-EntityToken", customData, extraHeaders);
|
377
|
-
}
|
378
|
-
/**
|
379
|
-
* Adds or updates entries on the specified leaderboard.
|
380
|
-
* https://docs.microsoft.com/rest/api/playfab/progression/leaderboards/updateleaderboardentries
|
381
|
-
*/
|
382
|
-
UpdateLeaderboardEntries(request, customData, extraHeaders) {
|
383
|
-
return this.ExecuteRequestWrapper("/Leaderboard/UpdateLeaderboardEntries", request, "X-EntityToken", customData, extraHeaders);
|
384
|
-
}
|
385
|
-
/**
|
386
|
-
* Update an existing entity statistic definition.
|
387
|
-
* https://docs.microsoft.com/rest/api/playfab/progression/statistics/updatestatisticdefinition
|
388
|
-
*/
|
389
|
-
UpdateStatisticDefinition(request, customData, extraHeaders) {
|
390
|
-
return this.ExecuteRequestWrapper("/Statistic/UpdateStatisticDefinition", request, "X-EntityToken", customData, extraHeaders);
|
391
|
-
}
|
392
|
-
/**
|
393
|
-
* Update statistics on an entity profile. Depending on the statistic definition, this may result in entity being ranked on
|
394
|
-
* various leaderboards.
|
395
|
-
* https://docs.microsoft.com/rest/api/playfab/progression/statistics/updatestatistics
|
396
|
-
*/
|
397
|
-
UpdateStatistics(request, customData, extraHeaders) {
|
398
|
-
return this.ExecuteRequestWrapper("/Statistic/UpdateStatistics", request, "X-EntityToken", customData, extraHeaders);
|
399
|
-
}
|
400
|
-
};
|
1
|
+
import {
|
2
|
+
PlayFabProgressionApi
|
3
|
+
} from "./chunk-QUZHVSVZ.js";
|
4
|
+
import "./chunk-62SULWOK.js";
|
401
5
|
export {
|
402
6
|
PlayFabProgressionApi as default
|
403
7
|
};
|