Skip to content
Permalink
master
Switch branches/tags
Go to file
 
 
Cannot retrieve contributors at this time
/** Static object you add your CloudScript endpoints to */
declare var handlers: IPlayFabHandlers;
interface IPlayFabHandlers {
[handlerId:string]: (args?:any, context?:IPlayFabContext) => any;
}
/** The playfab id for the user who called into CloudScript */
declare var currentPlayerId: string;
/**
* Static object containing cloudscript logging functions
* debug(message: string, exc?: any): void,
* error(message: string, exc?: any): void,
* info(message: string, exc?: any): void,
*/
declare var log: Logger;
interface Logger {
debug(message: string, exc?: any): void,
error(message: string, exc?: any): void,
info(message: string, exc?: any): void,
}
/**
* Static object containing cloudscript external request functions
* request(url: string, method?: string, content?: string, contentType?: string): string
*/
declare var http: IPlayFabHttp;
interface IPlayFabHttp {
request(url: string, method?: string, content?: string, contentType?: string, headers?: { [key: string]: string }): string
}
interface ITriggeredByTask {
Name: string;
Id: string;
}
interface IPlayFabContext {
playStreamEvent: PlayStreamModels.IBasePlayStreamEvent;
playerProfile: IPlayFabPlayerProfile;
triggeredByTask: ITriggeredByTask;
}
interface IPlayFabPlayerProfile {
PlayerId: string;
DisplayName: string;
}
declare var script: IPlayFabEnvironment;
interface IPlayFabEnvironment {
revision: number;
titleId: string;
}
interface IPlayFabError {
cloudScriptErrorCode : string;
stack : string;
apiErrorInfo?: IApiErrorInfo;
}
interface IApiErrorInfo {
api : string;
request : any;
result : any;
apiError?: IApiError;
}
interface IApiError {
code : number;
status : string;
error : string;
errorCode : number;
errorMessage : string;
errorDetails?: { [index:string] : { message: string[] } };
}
/** Static object which allows access to PlayFab Classic Server API calls */
declare var server: IPlayFabServerAPI;
/** Static object which allows access to PlayFab Entity API calls */
declare var entity: IPlayFabEntityAPI;
/** ServerAPI.Models as interfaces */
declare namespace PlayFabServerModels {
interface AdCampaignAttribution {
/** UTC time stamp of attribution */
AttributedAt: string,
/** Attribution campaign identifier */
CampaignId?: string,
/** Attribution network name */
Platform?: string,
}
interface AdCampaignAttributionModel {
/** UTC time stamp of attribution */
AttributedAt: string,
/** Attribution campaign identifier */
CampaignId?: string,
/** Attribution network name */
Platform?: string,
}
interface AddCharacterVirtualCurrencyRequest {
/**
* Amount to be added to the character balance of the specified virtual currency. Maximum VC balance is Int32
* (2,147,483,647). Any increase over this value will be discarded.
*/
Amount: number,
/** Unique PlayFab assigned ID for a specific character owned by a user */
CharacterId: string,
/** The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). */
CustomTags?: { [key: string]: string | null },
/** PlayFab unique identifier of the user whose virtual currency balance is to be incremented. */
PlayFabId: string,
/** Name of the virtual currency which is to be incremented. */
VirtualCurrency: string,
}
interface AddFriendRequest {
/** Email address of the user being added. */
FriendEmail?: string,
/** The PlayFab identifier of the user being added. */
FriendPlayFabId?: string,
/** Title-specific display name of the user to being added. */
FriendTitleDisplayName?: string,
/** The PlayFab username of the user being added */
FriendUsername?: string,
/** PlayFab identifier of the player to add a new friend. */
PlayFabId: string,
}
interface AddGenericIDRequest {
/** Generic service identifier to add to the player account. */
GenericId: GenericServiceId,
/** PlayFabId of the user to link. */
PlayFabId: string,
}
/**
* This API will trigger a player_tag_added event and add a tag with the given TagName and PlayFabID to the corresponding
* player profile. TagName can be used for segmentation and it is limited to 256 characters. Also there is a limit on the
* number of tags a title can have.
*/
interface AddPlayerTagRequest {
/** The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). */
CustomTags?: { [key: string]: string | null },
/** Unique PlayFab assigned ID of the user on whom the operation will be performed. */
PlayFabId: string,
/** Unique tag for player profile. */
TagName: string,
}
interface AddPlayerTagResult {
}
interface AddSharedGroupMembersRequest {
/** An array of unique PlayFab assigned ID of the user on whom the operation will be performed. */
PlayFabIds: string[],
/** Unique identifier for the shared group. */
SharedGroupId: string,
}
interface AddSharedGroupMembersResult {
}
interface AddUserVirtualCurrencyRequest {
/**
* Amount to be added to the user balance of the specified virtual currency. Maximum VC balance is Int32 (2,147,483,647).
* Any increase over this value will be discarded.
*/
Amount: number,
/** The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). */
CustomTags?: { [key: string]: string | null },
/** PlayFab unique identifier of the user whose virtual currency balance is to be increased. */
PlayFabId: string,
/** Name of the virtual currency which is to be incremented. */
VirtualCurrency: string,
}
interface AdvancedPushPlatformMsg {
/**
* Stops GoogleCloudMessaging notifications from including both notification and data properties and instead only sends the
* data property.
*/
GCMDataOnly?: boolean,
/** The Json the platform should receive. */
Json: string,
/** The platform that should receive the Json. */
Platform: PushNotificationPlatform,
}
/**
* Note that data returned may be Personally Identifying Information (PII), such as email address, and so care should be
* taken in how this data is stored and managed. Since this call will always return the relevant information for users who
* have accessed the title, the recommendation is to not store this data locally.
*/
interface AuthenticateSessionTicketRequest {
/** Session ticket as issued by a PlayFab client login API. */
SessionTicket: string,
}
interface AuthenticateSessionTicketResult {
/** Indicates if token was expired at request time. */
IsSessionTicketExpired?: boolean,
/** Account info for the user whose session ticket was supplied. */
UserInfo?: UserAccountInfo,
}
interface AwardSteamAchievementItem {
/** Unique Steam achievement name. */
AchievementName: string,
/** Unique PlayFab assigned ID of the user on whom the operation will be performed. */
PlayFabId: string,
/** Result of the award attempt (only valid on response, not on request). */
Result: boolean,
}
interface AwardSteamAchievementRequest {
/** Array of achievements to grant and the users to whom they are to be granted. */
Achievements: AwardSteamAchievementItem[],
}
interface AwardSteamAchievementResult {
/** Array of achievements granted. */
AchievementResults?: AwardSteamAchievementItem[],
}
interface AzureResourceSystemData {
/** The timestamp of resource creation (UTC) */
CreatedAt?: string,
/** The identity that created the resource */
CreatedBy?: string,
/** The type of identity that created the resource */
CreatedByType?: string,
/** The type of identity that last modified the resource */
LastModifiedAt?: string,
/** The identity that last modified the resource */
LastModifiedBy?: string,
/** The type of identity that last modified the resource */
LastModifiedByType?: string,
}
/** Contains information for a ban. */
interface BanInfo {
/** The active state of this ban. Expired bans may still have this value set to true but they will have no effect. */
Active: boolean,
/** The unique Ban Id associated with this ban. */
BanId?: string,
/** The time when this ban was applied. */
Created?: string,
/** The time when this ban expires. Permanent bans do not have expiration date. */
Expires?: string,
/** The IP address on which the ban was applied. May affect multiple players. */
IPAddress?: string,
/** Unique PlayFab assigned ID of the user on whom the operation will be performed. */
PlayFabId?: string,
/** The reason why this ban was applied. */
Reason?: string,
}
/** Represents a single ban request. */
interface BanRequest {
/** The duration in hours for the ban. Leave this blank for a permanent ban. */
DurationInHours?: number,
/** IP address to be banned. May affect multiple players. */
IPAddress?: string,
/** MAC address to be banned. May affect multiple players. */