
// javascript proxy for webservices
// by Matthias Hertel
/* Use this service to request and manage credential tokens for other IFactorWebServices */

proxies.IFCommonService = {
url: "http://www.streetlightoutages.com/webservices/IFCommonService.asmx",
ns: "http://www.ifactorconsulting.com/webservices"
} // proxies.IFCommonService

/** Returns the organization record associated with the user record referred to by userToken. */

proxies.IFCommonService.GetOrganizationInfoForUserToken = function () { return(proxies.callSoap(arguments)); }
proxies.IFCommonService.GetOrganizationInfoForUserToken.fname = "GetOrganizationInfoForUserToken";
proxies.IFCommonService.GetOrganizationInfoForUserToken.service = proxies.IFCommonService;
proxies.IFCommonService.GetOrganizationInfoForUserToken.action = "http://www.ifactorconsulting.com/webservices/GetOrganizationInfoForUserToken";
proxies.IFCommonService.GetOrganizationInfoForUserToken.params = ["userToken:string"];
proxies.IFCommonService.GetOrganizationInfoForUserToken.rtype = ["GetOrganizationInfoForUserTokenResult:other"];

/** Returns the organization record associated with the usertoken. */

proxies.IFCommonService.GetOrganizationValidatedUserToken = function () { return(proxies.callSoap(arguments)); }
proxies.IFCommonService.GetOrganizationValidatedUserToken.fname = "GetOrganizationValidatedUserToken";
proxies.IFCommonService.GetOrganizationValidatedUserToken.service = proxies.IFCommonService;
proxies.IFCommonService.GetOrganizationValidatedUserToken.action = "http://www.ifactorconsulting.com/webservices/GetOrganizationValidatedUserToken";
proxies.IFCommonService.GetOrganizationValidatedUserToken.params = ["userToken:string"];
proxies.IFCommonService.GetOrganizationValidatedUserToken.rtype = ["GetOrganizationValidatedUserTokenResult:other"];

/** Provide a username, password and expiryMinutes and receive a token string in return.  This token string will be valid in other IFactorWebServices */

proxies.IFCommonService.GetUserToken = function () { return(proxies.callSoap(arguments)); }
proxies.IFCommonService.GetUserToken.fname = "GetUserToken";
proxies.IFCommonService.GetUserToken.service = proxies.IFCommonService;
proxies.IFCommonService.GetUserToken.action = "http://www.ifactorconsulting.com/webservices/GetUserToken";
proxies.IFCommonService.GetUserToken.params = ["username:string","password:string","expiryMinutes:int"];
proxies.IFCommonService.GetUserToken.rtype = ["GetUserTokenResult:string"];

/** Returns an array of strings representing all organizations trusted by the current user's organization.  Always includes self in the list. */

proxies.IFCommonService.GetTrustedOrganizationNames = function () { return(proxies.callSoap(arguments)); }
proxies.IFCommonService.GetTrustedOrganizationNames.fname = "GetTrustedOrganizationNames";
proxies.IFCommonService.GetTrustedOrganizationNames.service = proxies.IFCommonService;
proxies.IFCommonService.GetTrustedOrganizationNames.action = "http://www.ifactorconsulting.com/webservices/GetTrustedOrganizationNames";
proxies.IFCommonService.GetTrustedOrganizationNames.params = ["userToken:string"];
proxies.IFCommonService.GetTrustedOrganizationNames.rtype = ["GetTrustedOrganizationNamesResult:ArrayOfString"];

/** Returns an array of strings representing all organizations trusting the current user's organization.  Always includes self in the list. */

proxies.IFCommonService.GetTrustingOrganizationNames = function () { return(proxies.callSoap(arguments)); }
proxies.IFCommonService.GetTrustingOrganizationNames.fname = "GetTrustingOrganizationNames";
proxies.IFCommonService.GetTrustingOrganizationNames.service = proxies.IFCommonService;
proxies.IFCommonService.GetTrustingOrganizationNames.action = "http://www.ifactorconsulting.com/webservices/GetTrustingOrganizationNames";
proxies.IFCommonService.GetTrustingOrganizationNames.params = ["userToken:string"];
proxies.IFCommonService.GetTrustingOrganizationNames.rtype = ["GetTrustingOrganizationNamesResult:ArrayOfString"];

/** Returns a trust token that can be sent to other organizations to give them the key to view the current user's organization's data.  The trusted organizations need to register this trust token to complete the trust relationship. */

proxies.IFCommonService.GetOrganizationTrustToken = function () { return(proxies.callSoap(arguments)); }
proxies.IFCommonService.GetOrganizationTrustToken.fname = "GetOrganizationTrustToken";
proxies.IFCommonService.GetOrganizationTrustToken.service = proxies.IFCommonService;
proxies.IFCommonService.GetOrganizationTrustToken.action = "http://www.ifactorconsulting.com/webservices/GetOrganizationTrustToken";
proxies.IFCommonService.GetOrganizationTrustToken.params = ["userToken:string","trustedOrganizationName:string"];
proxies.IFCommonService.GetOrganizationTrustToken.rtype = ["GetOrganizationTrustTokenResult:string"];

/** Register a trust token from another organization.  This allows the current user to see asset data of the trusting organization. */

proxies.IFCommonService.RegisterTrustToken = function () { return(proxies.callSoap(arguments)); }
proxies.IFCommonService.RegisterTrustToken.fname = "RegisterTrustToken";
proxies.IFCommonService.RegisterTrustToken.service = proxies.IFCommonService;
proxies.IFCommonService.RegisterTrustToken.action = "http://www.ifactorconsulting.com/webservices/RegisterTrustToken";
proxies.IFCommonService.RegisterTrustToken.params = ["userToken:string","trustingOrganizationTrustToken:string"];
proxies.IFCommonService.RegisterTrustToken.rtype = ["RegisterTrustTokenResult:bool"];

/** Removes all organizational trust relationships between the organization referenced by userToken and organizationName. */

proxies.IFCommonService.BreakTrustRelationship = function () { return(proxies.callSoap(arguments)); }
proxies.IFCommonService.BreakTrustRelationship.fname = "BreakTrustRelationship";
proxies.IFCommonService.BreakTrustRelationship.service = proxies.IFCommonService;
proxies.IFCommonService.BreakTrustRelationship.action = "http://www.ifactorconsulting.com/webservices/BreakTrustRelationship";
proxies.IFCommonService.BreakTrustRelationship.params = ["userToken:string","organizationName:string"];
proxies.IFCommonService.BreakTrustRelationship.rtype = ["BreakTrustRelationshipResult:bool"];

/** Return the User information for the username assigned to this token. */

proxies.IFCommonService.GetUserDetails = function () { return(proxies.callSoap(arguments)); }
proxies.IFCommonService.GetUserDetails.fname = "GetUserDetails";
proxies.IFCommonService.GetUserDetails.service = proxies.IFCommonService;
proxies.IFCommonService.GetUserDetails.action = "http://www.ifactorconsulting.com/webservices/GetUserDetails";
proxies.IFCommonService.GetUserDetails.params = ["userToken:string"];
proxies.IFCommonService.GetUserDetails.rtype = ["GetUserDetailsResult:other"];

/** Return the User information for the username assigned to this token as a JSON string. */

proxies.IFCommonService.GetUserDetailsAsJSON = function () { return(proxies.callSoap(arguments)); }
proxies.IFCommonService.GetUserDetailsAsJSON.fname = "GetUserDetailsAsJSON";
proxies.IFCommonService.GetUserDetailsAsJSON.service = proxies.IFCommonService;
proxies.IFCommonService.GetUserDetailsAsJSON.action = "http://www.ifactorconsulting.com/webservices/GetUserDetailsAsJSON";
proxies.IFCommonService.GetUserDetailsAsJSON.params = ["userToken:string"];
proxies.IFCommonService.GetUserDetailsAsJSON.rtype = ["GetUserDetailsAsJSONResult:string"];

/** Gathers information about a new organization and then sends a verification e-mail to complete the registration. */

proxies.IFCommonService.RegisterOrganization = function () { return(proxies.callSoap(arguments)); }
proxies.IFCommonService.RegisterOrganization.fname = "RegisterOrganization";
proxies.IFCommonService.RegisterOrganization.service = proxies.IFCommonService;
proxies.IFCommonService.RegisterOrganization.action = "http://www.ifactorconsulting.com/webservices/RegisterOrganization";
proxies.IFCommonService.RegisterOrganization.params = ["organizationName:string","fullOrganizationName:string","adminFirstName:string","adminLastName:string","adminUsername:string","adminPassword:string","adminPhone:string"];
proxies.IFCommonService.RegisterOrganization.rtype = ["RegisterOrganizationResult:string"];

/** Creates the new organization based on the infoToken. */

proxies.IFCommonService.VerifyOrganization = function () { return(proxies.callSoap(arguments)); }
proxies.IFCommonService.VerifyOrganization.fname = "VerifyOrganization";
proxies.IFCommonService.VerifyOrganization.service = proxies.IFCommonService;
proxies.IFCommonService.VerifyOrganization.action = "http://www.ifactorconsulting.com/webservices/VerifyOrganization";
proxies.IFCommonService.VerifyOrganization.params = ["infoToken:string"];
proxies.IFCommonService.VerifyOrganization.rtype = ["VerifyOrganizationResult:string"];

/** Gets a list of usernames for the current organization */

proxies.IFCommonService.GetUsers = function () { return(proxies.callSoap(arguments)); }
proxies.IFCommonService.GetUsers.fname = "GetUsers";
proxies.IFCommonService.GetUsers.service = proxies.IFCommonService;
proxies.IFCommonService.GetUsers.action = "http://www.ifactorconsulting.com/webservices/GetUsers";
proxies.IFCommonService.GetUsers.params = ["userToken:string"];
proxies.IFCommonService.GetUsers.rtype = ["GetUsersResult:other"];

/** Adds newAdminUserName to userToken's organization.  This only works if userToken has 'Admin' rights itself and if newAdminUserName is a valid name for userToken's organization. */

proxies.IFCommonService.AddAdminUser = function () { return(proxies.callSoap(arguments)); }
proxies.IFCommonService.AddAdminUser.fname = "AddAdminUser";
proxies.IFCommonService.AddAdminUser.service = proxies.IFCommonService;
proxies.IFCommonService.AddAdminUser.action = "http://www.ifactorconsulting.com/webservices/AddAdminUser";
proxies.IFCommonService.AddAdminUser.params = ["userToken:string","newAdminUserName:string"];
proxies.IFCommonService.AddAdminUser.rtype = ["AddAdminUserResult:bool"];

/** Removes adminUserName from userToken's organization.  This only works if userToken has 'Admin' rights itself and if adminUserName is a valid name for userToken's organization. */

proxies.IFCommonService.RemoveAdminUser = function () { return(proxies.callSoap(arguments)); }
proxies.IFCommonService.RemoveAdminUser.fname = "RemoveAdminUser";
proxies.IFCommonService.RemoveAdminUser.service = proxies.IFCommonService;
proxies.IFCommonService.RemoveAdminUser.action = "http://www.ifactorconsulting.com/webservices/RemoveAdminUser";
proxies.IFCommonService.RemoveAdminUser.params = ["userToken:string","adminUserName:string"];
proxies.IFCommonService.RemoveAdminUser.rtype = ["RemoveAdminUserResult:bool"];

/** Creates a new user account.  Need to provide an existing userToken so that we know which organization the new user account is being created for. */

proxies.IFCommonService.CreateUser = function () { return(proxies.callSoap(arguments)); }
proxies.IFCommonService.CreateUser.fname = "CreateUser";
proxies.IFCommonService.CreateUser.service = proxies.IFCommonService;
proxies.IFCommonService.CreateUser.action = "http://www.ifactorconsulting.com/webservices/CreateUser";
proxies.IFCommonService.CreateUser.params = ["userToken:string","username:string","password:string","firstname:string","lastname:string","email:string","phone:string"];
proxies.IFCommonService.CreateUser.rtype = ["CreateUserResult:string"];

/** Deletes a user account.  */

proxies.IFCommonService.DeleteUser = function () { return(proxies.callSoap(arguments)); }
proxies.IFCommonService.DeleteUser.fname = "DeleteUser";
proxies.IFCommonService.DeleteUser.service = proxies.IFCommonService;
proxies.IFCommonService.DeleteUser.action = "http://www.ifactorconsulting.com/webservices/DeleteUser";
proxies.IFCommonService.DeleteUser.params = ["userToken:string","usernameToDelete:string"];
proxies.IFCommonService.DeleteUser.rtype = ["DeleteUserResult:string"];

/** Removes a user assigned to userToken's organization and assigns it to the defaultOrganization. */

proxies.IFCommonService.RemoveUser = function () { return(proxies.callSoap(arguments)); }
proxies.IFCommonService.RemoveUser.fname = "RemoveUser";
proxies.IFCommonService.RemoveUser.service = proxies.IFCommonService;
proxies.IFCommonService.RemoveUser.action = "http://www.ifactorconsulting.com/webservices/RemoveUser";
proxies.IFCommonService.RemoveUser.params = ["userToken:string","usernameToRemove:string"];
proxies.IFCommonService.RemoveUser.rtype = ["RemoveUserResult:string"];

/** Resets the password for 'username'.  A note will be sent to the e-mail address on file with a new password. */

proxies.IFCommonService.ResetUserPassword = function () { return(proxies.callSoap(arguments)); }
proxies.IFCommonService.ResetUserPassword.fname = "ResetUserPassword";
proxies.IFCommonService.ResetUserPassword.service = proxies.IFCommonService;
proxies.IFCommonService.ResetUserPassword.action = "http://www.ifactorconsulting.com/webservices/ResetUserPassword";
proxies.IFCommonService.ResetUserPassword.params = ["username:string"];
proxies.IFCommonService.ResetUserPassword.rtype = ["ResetUserPasswordResult:string"];

/** updates the organization's configurationAsJSON column */

proxies.IFCommonService.SetConfigurations = function () { return(proxies.callSoap(arguments)); }
proxies.IFCommonService.SetConfigurations.fname = "SetConfigurations";
proxies.IFCommonService.SetConfigurations.service = proxies.IFCommonService;
proxies.IFCommonService.SetConfigurations.action = "http://www.ifactorconsulting.com/webservices/SetConfigurations";
proxies.IFCommonService.SetConfigurations.params = ["userToken:string","configurationAsJSON:string"];
proxies.IFCommonService.SetConfigurations.rtype = ["SetConfigurationsResult:bool"];

/** updates the email/URL incident notification properties for userToken's organization. */

proxies.IFCommonService.SetIncidentNotificationInformation = function () { return(proxies.callSoap(arguments)); }
proxies.IFCommonService.SetIncidentNotificationInformation.fname = "SetIncidentNotificationInformation";
proxies.IFCommonService.SetIncidentNotificationInformation.service = proxies.IFCommonService;
proxies.IFCommonService.SetIncidentNotificationInformation.action = "http://www.ifactorconsulting.com/webservices/SetIncidentNotificationInformation";
proxies.IFCommonService.SetIncidentNotificationInformation.params = ["userToken:string","incidentNotificationEmailList:string","incidentNotificationURL:string"];
proxies.IFCommonService.SetIncidentNotificationInformation.rtype = ["SetIncidentNotificationInformationResult:bool"];

/** gets the email/URL incident notification properties for userToken's organization.  Returns a JSON String. */

proxies.IFCommonService.GetIncidentNotificationInformation = function () { return(proxies.callSoap(arguments)); }
proxies.IFCommonService.GetIncidentNotificationInformation.fname = "GetIncidentNotificationInformation";
proxies.IFCommonService.GetIncidentNotificationInformation.service = proxies.IFCommonService;
proxies.IFCommonService.GetIncidentNotificationInformation.action = "http://www.ifactorconsulting.com/webservices/GetIncidentNotificationInformation";
proxies.IFCommonService.GetIncidentNotificationInformation.params = ["userToken:string"];
proxies.IFCommonService.GetIncidentNotificationInformation.rtype = ["GetIncidentNotificationInformationResult:string"];

/** Retrieves the current user's organization configuration as a string. */

proxies.IFCommonService.GetConfigurations = function () { return(proxies.callSoap(arguments)); }
proxies.IFCommonService.GetConfigurations.fname = "GetConfigurations";
proxies.IFCommonService.GetConfigurations.service = proxies.IFCommonService;
proxies.IFCommonService.GetConfigurations.action = "http://www.ifactorconsulting.com/webservices/GetConfigurations";
proxies.IFCommonService.GetConfigurations.params = ["userToken:string"];
proxies.IFCommonService.GetConfigurations.rtype = ["GetConfigurationsResult:string"];

/** Copies configurations from sourceOrganizationName to the organization represented by organizationToken.  Only suitably authorized userToken are permitted to perform this action. */

proxies.IFCommonService.CopyConfigurations = function () { return(proxies.callSoap(arguments)); }
proxies.IFCommonService.CopyConfigurations.fname = "CopyConfigurations";
proxies.IFCommonService.CopyConfigurations.service = proxies.IFCommonService;
proxies.IFCommonService.CopyConfigurations.action = "http://www.ifactorconsulting.com/webservices/CopyConfigurations";
proxies.IFCommonService.CopyConfigurations.params = ["userToken:string","sourceOrganizationName:string"];
proxies.IFCommonService.CopyConfigurations.rtype = ["CopyConfigurationsResult:bool"];

/** Sets the organization's domains column */

proxies.IFCommonService.SetDomains = function () { return(proxies.callSoap(arguments)); }
proxies.IFCommonService.SetDomains.fname = "SetDomains";
proxies.IFCommonService.SetDomains.service = proxies.IFCommonService;
proxies.IFCommonService.SetDomains.action = "http://www.ifactorconsulting.com/webservices/SetDomains";
proxies.IFCommonService.SetDomains.params = ["userToken:string","domains:string"];
proxies.IFCommonService.SetDomains.rtype = ["SetDomainsResult:bool"];

/** Gets the organization's domains column. */

proxies.IFCommonService.GetDomains = function () { return(proxies.callSoap(arguments)); }
proxies.IFCommonService.GetDomains.fname = "GetDomains";
proxies.IFCommonService.GetDomains.service = proxies.IFCommonService;
proxies.IFCommonService.GetDomains.action = "http://www.ifactorconsulting.com/webservices/GetDomains";
proxies.IFCommonService.GetDomains.params = ["userToken:string"];
proxies.IFCommonService.GetDomains.rtype = ["GetDomainsResult:string"];

/** Send invitations to join the current organization to all the e-mail addresses in EMAILS string (comma-delimited). */

proxies.IFCommonService.SendInvitationEmails = function () { return(proxies.callSoap(arguments)); }
proxies.IFCommonService.SendInvitationEmails.fname = "SendInvitationEmails";
proxies.IFCommonService.SendInvitationEmails.service = proxies.IFCommonService;
proxies.IFCommonService.SendInvitationEmails.action = "http://www.ifactorconsulting.com/webservices/SendInvitationEmails";
proxies.IFCommonService.SendInvitationEmails.params = ["userToken:string","emails:string","shortMessage:string"];
proxies.IFCommonService.SendInvitationEmails.rtype = ["SendInvitationEmailsResult:string"];

/** Registers a user based on the invitation defined by invitationToken. */

proxies.IFCommonService.VerifyUser = function () { return(proxies.callSoap(arguments)); }
proxies.IFCommonService.VerifyUser.fname = "VerifyUser";
proxies.IFCommonService.VerifyUser.service = proxies.IFCommonService;
proxies.IFCommonService.VerifyUser.action = "http://www.ifactorconsulting.com/webservices/VerifyUser";
proxies.IFCommonService.VerifyUser.params = ["invitationToken:string","password:string","firstName:string","lastName:string","phone:string"];
proxies.IFCommonService.VerifyUser.rtype = ["VerifyUserResult:bool"];

/** Check if the username exist in database */

proxies.IFCommonService.CheckUserExist = function () { return(proxies.callSoap(arguments)); }
proxies.IFCommonService.CheckUserExist.fname = "CheckUserExist";
proxies.IFCommonService.CheckUserExist.service = proxies.IFCommonService;
proxies.IFCommonService.CheckUserExist.action = "http://www.ifactorconsulting.com/webservices/CheckUserExist";
proxies.IFCommonService.CheckUserExist.params = ["userToken:string","aUserName:string"];
proxies.IFCommonService.CheckUserExist.rtype = ["CheckUserExistResult:bool"];

/** Check if the username exist in database */

proxies.IFCommonService.GetStatusTypesByOrg = function () { return(proxies.callSoap(arguments)); }
proxies.IFCommonService.GetStatusTypesByOrg.fname = "GetStatusTypesByOrg";
proxies.IFCommonService.GetStatusTypesByOrg.service = proxies.IFCommonService;
proxies.IFCommonService.GetStatusTypesByOrg.action = "http://www.ifactorconsulting.com/webservices/GetStatusTypesByOrg";
proxies.IFCommonService.GetStatusTypesByOrg.params = ["userToken:string"];
proxies.IFCommonService.GetStatusTypesByOrg.rtype = ["GetStatusTypesByOrgResult:ArrayOfString"];
