api

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 6, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TypeMap = map[int]FieldTypeConfig{
	0: {
		Name:                             "string",
		Display:                          "String",
		ShouldDisplayValidaitonRuleInput: true,
		ShouldShowOption:                 false,
	},
	1: {
		Name:                             "option",
		Display:                          "Option",
		ShouldDisplayValidaitonRuleInput: false,
		ShouldShowOption:                 true,
	},
	2: {
		Name:                             "multi",
		Display:                          "CheckBox",
		ShouldDisplayValidaitonRuleInput: false,
		ShouldShowOption:                 false,
	},
	3: {
		Name:                             "password",
		Display:                          "Password",
		ShouldDisplayValidaitonRuleInput: true,
		ShouldShowOption:                 false,
	},
	4: {
		Name:                             "email",
		Display:                          "Email",
		ShouldDisplayValidaitonRuleInput: true,
		ShouldShowOption:                 false,
	},
	5: {
		Name:                             "text",
		Display:                          "Text",
		ShouldDisplayValidaitonRuleInput: true,
		ShouldShowOption:                 false,
	},
}

Functions

func AddSocialProvider added in v1.0.0

func AddSocialProvider(data AddProviderSchema) error

func CheckHookID added in v0.3.0

func CheckHookID(hookid string) (bool, error)

func CheckLoginMethod added in v1.0.0

func CheckLoginMethod() error

func CheckPlan added in v0.3.3

func CheckPlan() error

func CheckToken added in v1.1.0

func CheckToken(token string) (bool, error)

This function uses Authenticity token to check if SOTT exists.

func CurrentID added in v0.3.0

func CurrentID() (int64, error)

func DeleteCustomField added in v1.0.0

func DeleteCustomField(field string) (*bool, error)

func GetActiveProviders added in v0.3.2

func GetActiveProviders() (map[string]ActiveProvider, error)

func GetAllProviders added in v1.0.0

func GetAllProviders() (map[string]ProviderSchema, error)

func GetAppsInfo added in v0.3.0

func GetAppsInfo() (map[int64]SitesReponse, error)

func IsPasswordLessEnabled added in v1.0.0

func IsPasswordLessEnabled(features FeatureSchema) bool

func IsPhoneLoginEnabled added in v1.0.0

func IsPhoneLoginEnabled(features FeatureSchema) bool

func ResetSecret added in v0.3.0

func ResetSecret() error

func SitesBasic added in v0.3.0

func SitesBasic(tokens *SitesToken) error

func UpdateDomain added in v0.3.0

func UpdateDomain(domains []string) error

func UpdateProviderStatus added in v1.0.0

func UpdateProviderStatus(provider string, status bool) error

Types

type AccountPayment added in v0.3.0

type AccountPayment struct {
	Data struct {
		Order []struct {
			Totalamount         int         `json:"TotalAmount"`
			Recurringprofileid  interface{} `json:"RecurringProfileId"`
			Basediscount        int         `json:"BaseDiscount"`
			Promotionaldiscount int         `json:"PromotionalDiscount"`
			Initialamount       int         `json:"InitialAmount"`
			Tax                 int         `json:"Tax"`
			UUID                interface{} `json:"Uuid"`
			Invoiceno           int         `json:"InvoiceNo"`
			Createddate         time.Time   `json:"CreatedDate"`
			Lastmodifieddate    time.Time   `json:"LastModifiedDate"`
			Isactive            bool        `json:"IsActive"`
			Isdeleted           bool        `json:"IsDeleted"`
			Orderid             int         `json:"OrderId"`
			Paymentdetail       struct {
				Stripecustomerid      string `json:"StripeCustomerId"`
				Stripepaymentmethodid string `json:"StripePaymentMethodId"`
			} `json:"PaymentDetail"`
			Orderdetails []interface{} `json:"OrderDetails"`
		} `json:"Order"`
		Carddetails struct {
			Expmonth int    `json:"expMonth"`
			Expyear  int    `json:"expYear"`
			Last4    string `json:"last4"`
		} `json:"cardDetails"`
	} `json:"data"`
	Sharedsiteownerdata interface{} `json:"sharedSiteOwnerData"`
}

func PaymentInfo added in v0.3.0

func PaymentInfo() (*AccountPayment, error)

type ActiveProvider added in v1.0.0

type ActiveProvider struct {
	HtmlFileName   string   `json:"HtmlFileName"`
	Provider       string   `json:"Provider"`
	ProviderId     int      `json:"ProviderId"`
	ProviderKey    string   `json:"ProviderKey"`
	ProviderSecret string   `json:"ProviderSecret"`
	Scope          []string `json:"Scope"`
	Status         bool     `json:"Status"`
}

Social Provider Schemas

type AddCFRespSchema added in v1.0.0

type AddCFRespSchema struct {
	ResponseAddCustomField struct {
		Data []CustomFieldSchema `json:"Data"`
	} `json:"responseAddCustomField"`
}

func AddCustomField added in v1.0.0

func AddCustomField(customfield string) (*AddCFRespSchema, error)

type AddProviderObj added in v1.0.0

type AddProviderObj struct {
	Provider       string   `json:"Provider"`
	ProviderKey    string   `json:"ProviderKey"`
	ProviderSecret string   `json:"ProviderSecret"`
	Scope          []string `json:"Scope"`
	Status         bool     `json:"status"`
}

type AddProviderSchema added in v1.0.0

type AddProviderSchema struct {
	Data []AddProviderObj `json:"Data"`
}

type CoreAppData added in v0.3.0

type CoreAppData struct {
	Apps struct {
		Data []SitesReponse `json:"Data"`
	} `json:"apps"`
}

type CustomFieldSchema added in v1.0.0

type CustomFieldSchema struct {
	Key     string `json:"Key"`
	Display string `json:"Display"`
}

type Feature added in v1.0.0

type Feature struct {
	Feature string `json:"feature"`
	Status  bool   `json:"status"`
}

type FeatureSchema added in v1.0.0

type FeatureSchema struct {
	Data []Feature `json:"Data"`
}

func GetSiteFeatures added in v1.0.0

func GetSiteFeatures() (*FeatureSchema, error)

func UpdatePhoneLogin added in v1.0.0

func UpdatePhoneLogin(feature string, status bool) (*FeatureSchema, error)

type FieldSchema added in v1.0.0

type FieldSchema struct {
	CustomFields       []CustomFieldSchema `json:"customFields"`
	RegistrationFields map[string]Schema   `json:"registrationFields"`
}

type FieldTypeConfig added in v0.3.0

type FieldTypeConfig struct {
	Name                             string
	Display                          string
	ShouldDisplayValidaitonRuleInput bool
	ShouldShowOption                 bool
}

type HooksResponse added in v0.3.0

type HooksResponse struct {
	Data []struct {
		ID               string    `json:"Id"`
		Appid            int       `json:"AppId"`
		Createddate      time.Time `json:"CreatedDate"`
		Lastmodifieddate time.Time `json:"LastModifiedDate"`
		Targeturl        string    `json:"TargetUrl"`
		Event            string    `json:"Event"`
		Name             string    `json:"Name"`
	} `json:"Data"`
}

func Hooks added in v0.3.0

func Hooks(method string, body string) (*HooksResponse, error)

type HostedPageResponse

type HostedPageResponse struct {
	Pages []struct {
		Pagetype     string        `json:"PageType"`
		Customcss    []string      `json:"CustomCss"`
		Headtags     []interface{} `json:"HeadTags"`
		Favicon      string        `json:"FavIcon"`
		Htmlbody     string        `json:"HtmlBody"`
		Endscript    string        `json:"EndScript"`
		Beforescript string        `json:"BeforeScript"`
		Customjs     []string      `json:"CustomJS"`
		Isactive     bool          `json:"IsActive"`
		Mainscript   string        `json:"MainScript"`
		Commonscript string        `json:"CommonScript"`
		Status       string        `json:"Status"`
	} `json:"Pages"`
}

func GetPage

func GetPage() (*HostedPageResponse, error)

type LoginOpts added in v0.3.1

type LoginOpts struct {
	AccessToken string `schema:"token" json:"accesstoken"`
	AppName     string `schema:"appName"`
	Domain      string `schema:"domain" json:"domain"`
	DataCenter  string `schema:"dataCenter" json:"dataCenter"`
	Plan        string `schema:"plan" json:"plan"`
	Role        string `schema:"role" json:"role"`
	LookingFor  string `schema:"lookingFor" json:"lookingFor"`
}

type LoginResponse

type LoginResponse struct {
	APIVersion    string      `json:"api_Version"`
	AppID         int64       `json:"app_id"`
	AppName       string      `json:"app_name"`
	Authenticated bool        `json:"authenticated"`
	NoOfLogins    int32       `json:"no_of_logins"`
	PlanDetails   interface{} `json"plan_detail"`
	XSign         string      `json:"xsign"`
	XToken        string      `json:"xtoken"`
}

func AuthLogin

func AuthLogin(params LoginOpts) (*LoginResponse, error)

type OptSchema added in v0.4.0

type OptSchema struct {
	Value string `json:"value"`
	Text  string `json:"text"`
}

type PasswordlessLogin added in v1.0.0

type PasswordlessLogin struct {
	Enabled bool `json:"isEnabled"`
}

func UpdatePasswordlessLogin added in v1.0.0

func UpdatePasswordlessLogin(body []byte) (*PasswordlessLogin, error)

type ProviderOptSchema added in v1.0.0

type ProviderOptSchema struct {
	Display  string `json:"display"`
	Name     string `json:"name"`
	Value    string `json:"value"`
	Required bool   `json:"required"`
}

type ProviderSchema added in v1.0.0

type ProviderSchema struct {
	Name       string              `json:"name"`
	Display    string              `json:"display"`
	Selected   bool                `json:"selected"`
	Order      int                 `json:"order"`
	Configured bool                `json:"configured"`
	Options    []ProviderOptSchema `json:"options"`
	Mdfile     string              `json:"mdfile"`
	Scopes     []string            `json:"scopes"`
}

type RegistrationSchema added in v1.0.0

type RegistrationSchema struct {
	Data FieldSchema `json:"data"`
}

func GetRegistrationFields added in v1.0.0

func GetRegistrationFields() (*RegistrationSchema, error)

func UpdateRegField added in v1.0.0

func UpdateRegField(data UpdateRegFieldSchema) (*RegistrationSchema, error)

type ResetResponse added in v0.3.0

type ResetResponse struct {
	Secret string `json:"Secret"`
	XSign  string `json:"xsign"`
	XToken string `json:"xtoken"`
}

type Schema added in v0.3.0

type Schema struct {
	Display string      `json:"Display"`
	Enabled bool        `json:"Enabled"`
	Name    string      `json:"Name"`
	Options []OptSchema `json:"Options"`
	Rules   string      `json:"Rules"`
	Type    string      `json:"Type"`
}

type SitesReponse

type SitesReponse struct {
	Appname               string      `json:"AppName"`
	Customername          *string     `json:"CustomerName"`
	Webtechnology         int         `json:"WebTechnology"`
	Domain                string      `json:"Domain"`
	Callbackurl           string      `json:"CallbackUrl"`
	Devdomain             string      `json:"DevDomain"`
	Ismobile              bool        `json:"IsMobile"`
	Appid                 int64       `json:"AppId"`
	Key                   string      `json:"Key"`
	Secret                string      `json:"Secret"`
	Role                  string      `json:"Role"`
	Iswelcomeemailenabled bool        `json:"IsWelcomeEmailEnabled"`
	Ishttps               bool        `json:"Ishttps"`
	Interfaceid           int         `json:"InterfaceId"`
	Recurlyaccountcode    *string     `json:"RecurlyAccountCode"`
	Userlimit             int         `json:"UserLimit"`
	Domainlimit           int         `json:"DomainLimit"`
	Datecreated           time.Time   `json:"DateCreated"`
	Datemodified          time.Time   `json:"DateModified"`
	Status                bool        `json:"Status"`
	Profilephoto          *string     `json:"ProfilePhoto"`
	Apiversion            string      `json:"ApiVersion"`
	Israasenabled         bool        `json:"IsRaasEnabled"`
	Privacypolicy         interface{} `json:"PrivacyPolicy"`
	Termsofservice        interface{} `json:"TermsOfService"`
	Ownerid               string      `json:"OwnerId"`
	Productplan           *struct {
		Name         string      `json:"Name"`
		Expirytime   time.Time   `json:"ExpiryTime"`
		Billingcycle interface{} `json:"BillingCycle"`
		Fromdate     interface{} `json:"FromDate"`
	} `json:"ProductPlan"`
}

func GetSites

func GetSites() (*SitesReponse, error)

type SitesToken added in v0.3.0

type SitesToken struct {
	APIVersion    string `json:"ApiVersion"`
	AppID         int64  `json:"AppId"`
	AppName       string `json:"AppName"`
	Authenticated bool   `json:"authenticated"`
	XSign         string `json:"xsign"`
	XToken        string `json:"xtoken"`
}

func SetSites added in v0.3.0

func SetSites(appid int64) (*SitesToken, error)

type SottResponse added in v1.1.0

type SottResponse struct {
	Data []struct {
		AuthenticityToken string `json:"AuthenticityToken"`
		Comment           string `json:"Comment"`
		CreatedDate       string `json:"CreatedDate"`
		DateRange         string `json:"DateRange"`
		IsEncoded         bool   `json:"IsEncoded"`
		Technology        string `json:"Technology"`
	} `json:"Data"`
}

func GetSott added in v1.1.0

func GetSott() (*SottResponse, error)

type UpdateRegFieldSchema added in v1.0.0

type UpdateRegFieldSchema struct {
	Fields []Schema `json:"fields"`
}

type ValidateTokenResp

type ValidateTokenResp struct {
	AccessToken  string    `json:"access_token"`
	ExpiresIn    time.Time `json:"expires_in"`
	RefreshToken string    `json:"refresh_token"`
}

func AuthValidateToken

func AuthValidateToken() (*ValidateTokenResp, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL