CloudXInterface

CloudXInterface

new CloudXInterface(BUS, product, version)

Source:
Parameters:
Name Type Description
BUS EventEmitter Internal Communication Use, Event Bus Plug.
product string Library/System Name - Metadata.
version string Library/System Version - Metadata.

Members

(static, readonly) CLOUD_ENDPOINT

Source:
. Current Cloud Endpoint

(static, readonly) CloudEndpoint :Enumerable.<string>

Source:
Properties:
Name Type Description
Production "Production"
Staging "Staging"
Local "Local"
. Cloud Endpoint Types
Type:

(static, readonly) CLOUDX_NEOS_CDN

Source:

(static, readonly) CLOUDX_NEOS_DURABLE_BLOB

Source:

(static, readonly) CLOUDX_NEOS_OPERATIONAL_BLOB

Source:

(static, readonly) CLOUDX_NEOS_VIDEO_CDN

Source:

(static, readonly) CLOUDX_PRODUCTION_NEOS_API

Source:

(static, readonly) CLOUDX_STAGING_NEOS_API

Source:

(static, readonly) DEFAULT_RETRIES

Source:
. Number of Retries for tasks

(static, readonly) DefaultTimeout

Source:
. Request Timeout

(static, readonly) JSON_MEDIA_TYPE

Source:
. JSON Header

(static, readonly) LOCAL_NEOS_API

Source:

(static, readonly) LOCAL_NEOS_BLOB

Source:

(static, readonly) MemoryStreamAllocator

Source:
. Not Implimented

(static, readonly) NEOS_API

Source:
. Get the Neos Endpoint

(static, readonly) NEOS_ASSETS

Source:
. Return the Assets URI

(static, readonly) NEOS_ASSETS_BLOB

Source:
. Get the Neos Blob Server

(static, readonly) NEOS_ASSETS_CDN

Source:
. Get the Neos CDN server

(static, readonly) NEOS_ASSETS_VIDEO_CDN

Source:
. Video CDN Server

(static, readonly) NEOS_BLOB

Source:
. Return the Blob Endpoint

(static, readonly) NEOS_CLOUD_BLOB

Source:
. Get the Blob

(static, readonly) NEOS_INSTALL

Source:
. Neos Server Info Endpoint

(static, readonly) NEOS_THUMBNAILS

Source:
. Get the Neos Thumbnail Endpoint

(static, readonly) NEOS_THUMBNAILS_OLD

Source:
Deprecated:
. Get the Neos Thumbnail Endpoint

(static, readonly) ProfilerBeginSampleCallback

Source:
. Not Implimented

(static, readonly) ProfilerEndSampleCallback

Source:
. Not Implimented

(static, readonly) SESSION_EXTEND_INTERVAL

Source:
. How frequent to extend the user session

(static, readonly) storageUpdateDelays

Source:
. Delays in subsequent requests to the storage system

(static, readonly) UPLOAD_DEGREE_OF_PARALLELISM

Source:
. Honestly Not Sure

(protected, static, readonly) USE_CDN

Source:
If you need to ask your account can't use this.

cachedRecords :Dictionary.<Type, Dictionary.<Uri, CloudResult>>

Source:
Type:

CurrentSession

Source:
. The Current Session Object

CurrentUser

Source:
. The Current User Object

(readonly) CurrentUserGroupInfos

Source:

(readonly) CurrentUserMemberInfos

Source:

CurrentUserMemberships

Source:
. The Curent Memberships, Will return Null if this.Update has not been run

Friends :FriendManager

Source:
Type:

Friends :FriendManager

Source:
Type:

GitHub :GitHubClient

Source:
Type:

GroupMemberUpdated :GroupMemberUpdatedFunction

Source:
Type:
  • GroupMemberUpdatedFunction

GroupUpdated :GroupUpdatedFunction

Source:
Type:
  • GroupUpdatedFunction

HttpClient :HttpClient

Source:
Test.
Type:
  • HttpClient

HttpClient :HTTP_CLIENT

Source:
Type:

LastLocalServerResponse :Date

Source:
Type:
  • Date

LastServerStateFetch :Date

Source:
Type:
  • Date

lastServerStatsUpdate :Date

Source:
Type:
  • Date

LastServerUpdate :Date

Source:
Type:
  • Date

MembershipsUpdated :MembershipsUpdatedFunction

Source:
Type:
  • MembershipsUpdatedFunction

Messages :MessageManager

Source:
Type:

Messages :MessageManager

Source:
Type:

PublicKey :RSAParameters

Source:
Type:
  • RSAParameters

ServerResponseTime :Number

Source:
Type:
  • Number

(readonly) ServerStatus

Source:
. Recalculate Server Ping and Response Time

SessionChanged :SessionChangedFunction

Source:
Type:
  • SessionChangedFunction

Transactions :TransactionManager

Source:
Type:

Transactions :TransactionManager

Source:
Type:

UserAgent :ProductInfoHeaderValue

Source:
Type:
  • ProductInfoHeaderValue

UserAgentProduct :String

Source:
Type:
  • String

UserAgentVersion :String

Source:
Type:
  • String

UserUpdated :UserUpdatedFunction

Source:
Type:
  • UserUpdatedFunction

Methods

(static) FilterNeosURL(assetURL) → {Uri|void}

Source:
. Filter Url's - Internal
Parameters:
Name Type Description
assetURL Uri
Returns:
Type
Uri | void

(static) IsLegacyNeosDB(uri) → {Boolean}

Source:
. Check if a Uri is Legacy
Parameters:
Name Type Description
uri Uri
Returns:
Type
Boolean

(static) IsValidNeosDBUri(uri) → {boolean}

Source:
Parameters:
Name Type Description
uri Uri
Returns:
Type
boolean

(static) NeosDBFilename(neosdb) → {string}

Source:
Parameters:
Name Type Description
neosdb Uri
Returns:
Type
string

(static) NeosDBQuery(neosdb) → {string}

Source:
Parameters:
Name Type Description
neosdb Uri
Returns:
Type
string

(static) NeosDBSignature(neosdb) → {string}

Source:
Parameters:
Name Type Description
neosdb Uri
Returns:
Type
string

(static) NeosDBToHttp(neosdb, endpoint) → {Uri}

Source:
. Convert a neosdb:// to a http cdn url
Parameters:
Name Type Description
neosdb Uri
endpoint NeosDB_Endpoint
Returns:
Type
Uri

(static) NeosThumbnailIdToHttp(id) → {string}

Source:
. Thumbnail ID to HTTP
Parameters:
Name Type Description
id string
Returns:
Type
string

(static) TryFromString(url) → {Uri|null}

Source:
. Check if a string is a proper Uri, Returns Uri on true, null on false
Parameters:
Name Type Description
url string
Returns:
Type
Uri | null

AddBody(message, entity)

Source:
. Add a body to a request. Internal
Parameters:
Name Type Description
message HttpRequestMessage
entity * Content

AddMembership(membership)

Source:
. Add a user membership - Local
Parameters:
Name Type Description
membership Membership

ClearMemberships()

Source:
. Reset the membership cache

CloudXInterface(UserAgentProductopt, UserAgentVersionopt)

Source:
. Initializing Function, Setup local managers
Parameters:
Name Type Attributes Default Description
UserAgentProduct String <optional>
"CloudX" Agent ie. NeosJS
UserAgentVersion String <optional>
"0.0.0.0" Version ie v1.5.6

(async) CreateNeosSession(session) → {Promise.<CloudResult.<NeosSession>>}

Source:
Parameters:
Name Type Description
session NeosSession
Returns:
Type
Promise.<CloudResult.<NeosSession>>

CreateRequest(resource, method) → {HttpRequestMessage}

Source:
. Build a Http Request. Fire request with RunRequest
Parameters:
Name Type Description
resource string Endpoint
method HttpMethod
Returns:
Type
HttpRequestMessage

DELETE(resource, timeoutopt, throwOnErroropt) → {Promise.<CloudResult.<any>>}

Source:
. Make a Delete Request
Parameters:
Name Type Attributes Default Description
resource string Endpoint
timeout TimeSpan <optional>
null
throwOnError boolean <optional>
true
Returns:
Type
Promise.<CloudResult.<any>>

(async) DeleteFriend(friend) → {Promise.<CloudResult>}

Source:
. Remove a Friend
Parameters:
Name Type Description
friend Friend | string
Returns:
Type
Promise.<CloudResult>

(async) DeleteGroupMember(member) → {Promise.<CloudResult.<Member>>}

Source:
.
Parameters:
Name Type Description
member *
Returns:
Type
Promise.<CloudResult.<Member>>

(async) DeleteRecord(ownerId, recordId) → {Promise.<CloudResult.<any>>}

Source:
.
Parameters:
Name Type Description
ownerId *
recordId *
Returns:
Type
Promise.<CloudResult.<any>>

(async) ExtendSession() → {Promise.<CloudResult.<any>>}

Source:
. Extend the current session
Returns:
Type
Promise.<CloudResult.<any>>

(async) FetchRecordCached(recordUri, type)

Source:
Parameters:
Name Type Description
recordUri Uri
type R

FindRecords(search) → {Promise.<CloudResult.<any>>}

Source:
.
Parameters:
Name Type Description
search SearchParameters
Returns:
Type
Promise.<CloudResult.<any>>

GET(resource, timeoutopt, throwOnErroropt) → {Promise.<CloudResult.<any>>}

Source:
. Make a Get Request
Parameters:
Name Type Attributes Default Description
resource string Endpoint
timeout TimeSpan <optional>
null
throwOnError boolean <optional>
true
Returns:
Type
Promise.<CloudResult.<any>>

(async) GetCurrencyRates(baseCurrencyopt) → {CurrencyRates}

Source:
. Get a list of Transaction Rates
Parameters:
Name Type Attributes Default Description
baseCurrency string <optional>
"USD"
Returns:
Type
CurrencyRates

(async) GetFriends(userId, lastStatusUpdateopt, count) → {Promise.<CloudResult.<List.<Friend>>>}

Source:
.
Parameters:
Name Type Attributes Default Description
userId string | Date
lastStatusUpdate Date <optional>
null
count 0
Returns:
Type
Promise.<CloudResult.<List.<Friend>>>

(async) GetGroup(groupId) → {Promise.<CloudResult.<Group>>}

Source:
.
Parameters:
Name Type Description
groupId *
Returns:
Type
Promise.<CloudResult.<Group>>

(async) GetGroupMember(groupId, userId) → {Promise.<CloudResult.<Member>>}

Source:
.
Parameters:
Name Type Description
groupId *
userId *
Returns:
Type
Promise.<CloudResult.<Member>>

(async) GetGroupMembers(groupId)

Source:
.
Parameters:
Name Type Description
groupId *

(async) GetHubPatreons() → {Promise.<HubPatreons>}

Source:
Returns:
Type
Promise.<HubPatreons>

(async) GetMessageHistory(user, maxItemsopt) → {Promise.<CloudResult.<List.<Message>>>}

Source:
. Get message history with `user`
Parameters:
Name Type Attributes Default Description
user string
maxItems number <optional>
100
Returns:
Type
Promise.<CloudResult.<List.<Message>>>

(async) GetMessages(fromTimeopt, maxItems, user, unreadOnly) → {Promise.<CloudResult.<List.<Message>>>}

Source:
. Get messages
Parameters:
Name Type Attributes Description
fromTime Date <optional>
maxItems Number
user String
unreadOnly Boolean
Returns:
Type
Promise.<CloudResult.<List.<Message>>>

(async) GetOnlineUserCount() → {Promise.<number>}

Source:
Returns:
Type
Promise.<number>

(async) GetOnlineUserStats() → {OnlineUserStats}

Source:
. Get Online User Statistics
Returns:
Type
OnlineUserStats

(async) GetRandomExitMessage() → {ExitMessage}

Source:
. Get a random Exit Message
Returns:
Type
ExitMessage

GetRecords(a, b, c)

Source:
Parameters:
Name Type Description
a Array.<string> | List.<string> | string Record ID's|Owner Id.
b string Tag.
c string Path.

(async) GetServerStatistics() → {Promise.<CloudResult.<ServerStatistics>>}

Source:
. Fetch Neos Server Statistics
Returns:
Type
Promise.<CloudResult.<ServerStatistics>>

(async) GetSession(sessionId) → {Promise.<CloudResult.<SessionInfo>>}

Source:
.
Parameters:
Name Type Description
sessionId string Session Id
Returns:
Type
Promise.<CloudResult.<SessionInfo>>

(async) GetSessions(updateSince, includeEnded, compatibilityHash, name, universeId, hostName, hostId, minActiveUsers, includeEmptyHeadless) → {Promise.<CloudResult.<List.<Sessioninfo>>>}

Source:
. Get a list of sessions
Parameters:
Name Type Default Description
updateSince Date null
includeEnded Boolean false
compatibilityHash String null
name String null
universeId String null
hostName String null
hostId String null
minActiveUsers Number null
includeEmptyHeadless Boolean true
Returns:
Type
Promise.<CloudResult.<List.<Sessioninfo>>>

(async) GetStatus(userId) → {Promise.<CloudResult.<UserStatus>>}

Source:
. Get User Status
Parameters:
Name Type Description
userId string
Returns:
Type
Promise.<CloudResult.<UserStatus>>

(async) GetUnreadMessages(fromTimeopt) → {Promise.<CloudResult.<List.<Message>>>}

Source:
. Return all unread messages
Parameters:
Name Type Attributes Default Description
fromTime Date <optional>
null
Returns:
Type
Promise.<CloudResult.<List.<Message>>>

HasPotentialAccess(ownerId) → {boolean}

Source:
. Does the current user potentially have API access
Parameters:
Name Type Description
ownerId String
Returns:
Type
boolean

IsCurrentUserMemberOfGroup(groupId)

Source:
. Get User is member of groupId
Parameters:
Name Type Description
groupId string

(async) Login(credential, passwordopt, sessionTokenopt, secretMachineIdopt, rememberMeopt, recoverCodeopt, seviceIdopt, deviceId) → {Promise.<CloudResult.<UserSession>>}

Source:
. Login to a Neos Account or Set a new Password via recoverCode (Sent to Email associated with account when reset requested)
Parameters:
Name Type Attributes Description
credential string UserId, Email, or Username
password string <optional>
Password
sessionToken string <optional>
Can be used instead of password using a valid SessionToken
secretMachineId string <optional>
ALWAYS SET THIS TO A UNIQUE KEY! If this is not set, All instances of the account will be logged out
rememberMe Boolean <optional>
If set, Session will be valid for 7 days instead of 1.
recoverCode string <optional>
If set, password field will become the new account password
seviceId string <optional>
deviceId
Returns:
Type
Promise.<CloudResult.<UserSession>>

(async) LogVisit(visit) → {Promise.<CloudResult>}

Source:
Parameters:
Name Type Description
visit Visit
Returns:
Type
Promise.<CloudResult>

(async) MarkMessagesRead(messageIds) → {Promise.<CloudResult>}

Source:
. Mark Messages as Read
Parameters:
Name Type Description
messageIds List.<String>
Returns:
Type
Promise.<CloudResult>

(abstract) OnDebug(…vars)

Source:
. Overrideable Function to handle Debug messages
Parameters:
Name Type Attributes Description
vars * <repeatable>
Unpredictable number of arguments

(abstract) OnError(…error)

Source:
. Overrideable function to handle Errors
Parameters:
Name Type Attributes Description
error * <repeatable>

OnLogin()

Source:
. Redefineable Function for Hooks

OnLogout()

Source:
. Redefineable Function for Hooks

OnSessionUpdated()

Source:
. Redefineable Function for Hooks

PATCH(resource, entity, timeoutopt, throwOnErroropt) → {Promise.<CloudResult.<any>>}

Source:
. Make a Patch Request
Parameters:
Name Type Attributes Default Description
resource string Endpoint
entity * Content
timeout TimeSpan <optional>
null
throwOnError boolean <optional>
true
Returns:
Type
Promise.<CloudResult.<any>>

(async) PatchNeosSession(session) → {Promise.<CloudResult.<NeosSession>>}

Source:
Parameters:
Name Type Description
session NeosSession
Returns:
Type
Promise.<CloudResult.<NeosSession>>

(async) Ping() → {Promise.<CloudResult>}

Source:
.
Returns:
Type
Promise.<CloudResult>

POST(resource, entity, timeoutopt, throwOnErroropt) → {Promise.<CloudResult.<any>>}

Source:
. Make a Post Request
Parameters:
Name Type Attributes Default Description
resource string Endpoint
entity * Content
timeout TimeSpan <optional>
null
throwOnError boolean <optional>
true
Returns:
Type
Promise.<CloudResult.<any>>

ProfilerBeginSample()

Source:
. Not Implimented

ProfilerEndSample()

Source:
. Not Implimented

PUT(resource, entity, timeoutopt, throwOnErroropt) → {Promise.<CloudResult.<any>>}

Source:
. Make a Put Request
Parameters:
Name Type Attributes Default Description
resource string Endpoint
entity * Content
timeout TimeSpan <optional>
null
throwOnError boolean <optional>
true
Returns:
Type
Promise.<CloudResult.<any>>

(async) Register(username, email, password, deviceId) → {Promise.<CloudResult.<User>>}

Source:
. Register a new Neos Account
Parameters:
Name Type Description
username string
email string
password string
deviceId string
Returns:
Type
Promise.<CloudResult.<User>>

(async) RequestRecoveryCode(email) → {Promise.<CloudResult>}

Source:
.
Parameters:
Name Type Description
email *
Returns:
Type
Promise.<CloudResult>

(async) RunMembershipsUpdated() → {Promise.<void>}

Source:
. Update Membership Events
Returns:
Type
Promise.<void>

(async) RunRequest(requestSource, timeout, throwOnErroropt) → {Promise.<CloudResult.<any>>}

Source:
See:
. Run a HttpRequest
Parameters:
Name Type Attributes Default Description
requestSource HttpRequestMessage
timeout TimeSpan
throwOnError boolean <optional>
false
Returns:
Type
Promise.<CloudResult.<any>>

(async) SendMessage(message) → {Promise.<CloudResult.<Message>>}

Source:
Send a Message Object - Requires Sender be friends with Recipient.
Parameters:
Name Type Description
message Message
Returns:
Type
Promise.<CloudResult.<Message>>

(async) SendTransaction(transaction) → {Promise.<CloudResult.<*>>}

Source:
.
Parameters:
Name Type Description
transaction Transaction
Returns:
Type
Promise.<CloudResult.<*>>

SetMemberships(memberships)

Source:
. Set the user memberhsips - Local
Parameters:
Name Type Description
memberships List.<Membership>

TryGetCurrentUserGroupInfo(groupId) → {Group}

Source:
. Get Group from Id
Parameters:
Name Type Description
groupId string
Returns:
Type
Group

TryGetCurrentUserGroupMemberInfo(groupId) → {Member}

Source:
. Get Current User Group Membershop
Parameters:
Name Type Description
groupId string
Returns:
Type
Member

TryGetCurrentUserGroupMembership(groupId) → {Member}

Source:
Parameters:
Name Type Description
groupId string
Returns:
Type
Member

Update()

Source:
. Main Update Call

(async) UpdateGroupInfo(groupId) → {Task}

Source:
Parameters:
Name Type Description
groupId string
Returns:
Type
Task

(async) UpdateProfile(userId, profileopt) → {Promise.<CloudResult>}

Source:
. Update the User Profile
Example
await UpdateProfile(userId, UserProfile)
await UpdateProfile(UserProfile)
Parameters:
Name Type Attributes Description
userId string | UserProfile
profile UserProfile <optional>
Returns:
Type
Promise.<CloudResult>

(async) UpdateSessions(update) → {Promise.<CloudResult>}

Source:
.
Parameters:
Name Type Description
update SessionUpdate
Returns:
Type
Promise.<CloudResult>

(async) UpdateStatus(userId, statusopt) → {Promise.<CloudResult>}

Source:
. Update the User Status -If not userId is supplied, uses Current User, Refer to Examples
Example
await UpdateStatus(userId, UserStatus)
await UpdateStatus(UserStatus)
Parameters:
Name Type Attributes Description
userId string | UserStatus
status UserStatus <optional>
Returns:
Type
Promise.<CloudResult>

(async) UpsertFriend(friend) → {Promise.<CloudResult>}

Source:
. Add a Friend Record
Parameters:
Name Type Description
friend Friend
Returns:
Type
Promise.<CloudResult>

UpsertRecord(record) → {Promise.<CloudResult.<any>>}

Source:
.
Parameters:
Name Type Description
record *
Returns:
Type
Promise.<CloudResult.<any>>

(async) UpsertVariableDefinition(definition) → {Promise.<CloudResult.<CloudVariableDefinition>>}

Source:
.
Parameters:
Name Type Description
definition CloudVariableDefinition
Returns:
Type
Promise.<CloudResult.<CloudVariableDefinition>>

(async) WriteVariable(ownerId, path, valueopt)

Source:
Write a Variable - If ownerId is Omitted and arguments are shifter, CurrentUser will be used.
Parameters:
Name Type Attributes Description
ownerId string | string OwnerID | Path.
path string | T Path or T.
value T <optional>