models

package
v1.1.7 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const MinPasswordLength int = 8

Variables

View Source
var GlobalPermissions = []string{"contents", "models", "plugins", "media", "logic", "settings",
	"api_explorer", "usages", "addons", "extensions", "teams", "webhook",
	"api_secrets", "roles"}

Functions

This section is empty.

Types

type APIKey

type APIKey struct {
	ProjectID string `json:"project_id,omitempty" firestore:"project_id,omitempty" bson:"project_id,omitempty"`
	Name      string `json:"name,omitempty" firestore:"name,omitempty" bson:"name,omitempty"`
	Token     string `json:"token,omitempty" firestore:"token,omitempty" bson:"token,omitempty"`
	Expire    string `json:"expire,omitempty" firestore:"expire,omitempty" bson:"expire,omitempty"`
}

type APIPermission

type APIPermission struct {
	Read   string `json:"read,omitempty" firestore:"read,omitempty" bson:"read,omitempty"`
	Create string `json:"create,omitempty" firestore:"create,omitempty" bson:"create,omitempty"`
	Update string `json:"update,omitempty" firestore:"update,omitempty" bson:"update,omitempty"`
	Delete string `json:"delete,omitempty" firestore:"delete,omitempty" bson:"delete,omitempty"`
}

type APIToken

type APIToken struct {
	ProjectID string `json:"project_id,omitempty" firestore:"project_id,omitempty" bson:"project_id,omitempty"`
	Name      string `json:"name,omitempty" firestore:"name,omitempty" bson:"name,omitempty"`
	Token     string `json:"token,omitempty" firestore:"token,omitempty" bson:"token,omitempty"`
	Role      string `json:"role,omitempty" firestore:"role,omitempty" bson:"role,omitempty"`
	Expire    string `json:"expire,omitempty" firestore:"expire,omitempty" bson:"expire,omitempty"`
}

type ApiTracking

type ApiTracking struct {
	Increment uint32
	Bandwidth float64
}

type ApitoFunction

type ApitoFunction struct {
	ProjectID          string                            `bun:"type:uuid,pk" json:"project_id,omitempty" firestore:"project_id,omitempty" bson:"project_id,omitempty"`
	ID                 string                            `json:"id,omitempty" firestore:"id,omitempty" bson:"_id,omitempty"`
	Name               string                            `json:"name,omitempty" firestore:"name,omitempty" bson:"name,omitempty"`
	Description        string                            `json:"description,omitempty" firestore:"description,omitempty" bson:"description,omitempty"`
	GraphQLSchemaType  string                            `json:"graphql_schema_type,omitempty" firestore:"graphql_schema_type,omitempty" bson:"graphql_schema_type,omitempty"` // query or mutation
	EnvVars            []*protobuff.EnvVariable          `json:"env_vars,omitempty" firestore:"env_vars,omitempty" bson:"env_vars,omitempty"`
	FunctionPath       string                            `json:"function_path,omitempty" firestore:"function_path,omitempty" bson:"function_path,omitempty"`
	Request            *ApitoFunctionRequestResponseType `json:"request,omitempty" firestore:"request,omitempty" bson:"request,omitempty"`
	Response           *ApitoFunctionRequestResponseType `json:"response,omitempty" firestore:"response,omitempty" bson:"response,omitempty"`
	FunctionProviderID string                            `json:"function_provider_id,omitempty" firestore:"function_provider_id,omitempty" bson:"function_provider_id,omitempty"`
	//FunctionConnected        bool                              `json:"function_connected,omitempty" firestore:"function_connected,omitempty"`
	ProviderExportedVariable string                      `` /* 136-byte string literal not displayed */
	FunctionExportedVariable string                      `` /* 136-byte string literal not displayed */
	RuntimeConfig            *ApitoFunctionRuntimeConfig `json:"runtime_config,omitempty" firestore:"runtime_config,omitempty" bson:"runtime_config,omitempty"`

	UpdatedAt string `json:"updated_at,omitempty" firestore:"updated_at,omitempty" bson:"updated_at,omitempty"`
	CreatedAt string `json:"created_at,omitempty" firestore:"created_at,omitempty" bson:"created_at,omitempty"` // @got

	Language  string `json:"language,omitempty" firestore:"language,omitempty" bson:"language,omitempty"`       // golang, js, python supported
	BinaryURL string `json:"binary_url,omitempty" firestore:"binary_url,omitempty" bson:"binary_url,omitempty"` // s3 upload path

	RestAPISecretURLKey string `` // used to access this function directly via url
	/* 127-byte string literal not displayed */
}

type ApitoFunctionRequestResponseType

type ApitoFunctionRequestResponseType struct {
	Model           string      `json:"model,omitempty" firestore:"model,omitempty" bson:"model,omitempty"`
	Params          interface{} `json:"params,omitempty" firestore:"params,omitempty" bson:"params,omitempty"`
	IsArray         bool        `json:"is_array,omitempty" firestore:"is_array,omitempty" bson:"is_array,omitempty"`
	OptionalPayload bool        `json:"optional_payload,omitempty" firestore:"optional_payload,omitempty" bson:"optional_payload,omitempty"`
}

type ApitoFunctionRuntimeConfig

type ApitoFunctionRuntimeConfig struct {
	Runtime string `json:"runtime,omitempty" firestore:"runtime,omitempty" bson:"runtime,omitempty"`
	Memory  int64  `json:"memory,omitempty" firestore:"memory,omitempty" bson:"memory,omitempty"`
	Handler string `json:"handler,omitempty" firestore:"handler,omitempty" bson:"handler,omitempty"`
	TimeOut int64  `json:"time_out,omitempty" firestore:"time_out,omitempty" bson:"time_out,omitempty"`
}

type ApplicationCache

type ApplicationCache struct {
	Ctx         context.Context         `json:"ctx,omitempty"`
	Project     *Project                `json:"project,omitempty"`
	Param       *CommonSystemParams     `json:"param,omitempty"`
	RawSchemas  *RawSchema              `json:"raw_schema,omitempty"`
	Dataloaders map[string]*dlv6.Loader `json:"dataloaders,omitempty"`

	IncomingRequest []*IncomingRequest      `json:"incoming_request"`
	GraphqlRequest  *GraphQLIncomingRequest `json:"graphql_request,omitempty"`
}

type AuditLogs

type AuditLogs struct {
	XKey      string `json:"_key,omitempty" firestore:"_key,omitempty" bson:"_key,omitempty"`
	ID        string `json:"id,omitempty" firestore:"id,omitempty" bson:"_id,omitempty"`
	UserID    string `json:"user_id,omitempty" firestore:"user_id,omitempty" bson:"user_id,omitempty"`
	ProjectID string `json:"project_id,omitempty" firestore:"project_id,omitempty" bson:"project_id,omitempty"`

	RequestPayload  string `json:"request_payload,omitempty" firestore:"request_payload,omitempty" bson:"request_payload,omitempty"`
	RequestPath     string `json:"request_path,omitempty" firestore:"request_path,omitempty" bson:"request_path,omitempty"`
	ResponseCode    int    `json:"response_code,omitempty" firestore:"response_code,omitempty" bson:"response_code,omitempty"`
	ResponsePayload string `json:"response_payload,omitempty" firestore:"response_payload,omitempty" bson:"response_payload,omitempty"`

	Activity         string `json:"activity,omitempty" firestore:"activity,omitempty" bson:"activity,omitempty"`
	InternalFunction string `json:"internal_function,omitempty" firestore:"internal_function,omitempty" bson:"internal_function,omitempty"`

	GraphqlOperationName string `json:"graphql_operation_name,omitempty" firestore:"graphql_operation_name,omitempty" bson:"graphql_operation_name,omitempty"`
	GraphqlPayload       string `json:"graphql_payload,omitempty" firestore:"graphql_payload,omitempty" bson:"graphql_payload,omitempty"`
	GraphqlVariable      string `json:"graphql_variable,omitempty" firestore:"graphql_variable,omitempty" bson:"graphql_variable,omitempty"`

	InternalError string `json:"internal_error,omitempty" firestore:"internal_error,omitempty" bson:"internal_error,omitempty"`
	CreatedAt     string `json:"created_at,omitempty" firestore:"created_at,omitempty" bson:"created_at,omitempty"`
}

type CSVTemplateGenerator

type CSVTemplateGenerator struct {
	ModelName string `json:"model_name"`
}

type CommonSystemParams

type CommonSystemParams struct {
	Role          *Role  `json:"role,omitempty"`
	Plan          string `json:"plan,omitempty"`
	UserID        string `json:"user_id,omitempty"`
	RelationModel string `json:"relation_model,omitempty"`
	Email         string `json:"email,omitempty"`
	ProjectID     string `json:"project_id,omitempty"`

	// For SaaS project
	TenantID    string `json:"tenant_id,omitempty"` // used in SaaS project user token
	TenantModel string `json:"tenant_model"`        // used in SaaS project user token

	ResolveParams *graphql.ResolveParams `json:"resolve_params,omitempty"`

	SystemCollectionName string `json:"system_collection_name,omitempty"`

	DocumentID  string   `json:"document_id,omitempty"`
	DocumentIDs []string `json:"document_ids,omitempty"`

	Document    *types.DefaultDocumentStructure `json:"document,omitempty"`
	Model       *ModelType                      `json:"model_type,omitempty"`
	ConDisParam []*ConnectDisconnectParam       `json:"con_dis_param,omitempty"`
	FieldInfo   *FieldInfo                      `json:"field_info,omitempty"`

	KnownAs        string `json:"known_as,omitempty"`
	Revision       bool   `json:"revision,omitempty"`
	SinglePageData bool   `json:"single_page_data,omitempty"`

	DocPublishStatus string `json:"doc_publish_status,omitempty"`

	IsSystemRequest                 bool `json:"is_system_request,omitempty"`
	IsEntireCollectionSearchRequest bool `json:"is_entire_collection_search_request,omitempty"`
	IsDataloaderRequest             bool `json:"is_dataloader_request,omitempty"`
	IsIntersectionResult            bool `json:"is_intersection_result,omitempty"`

	// these three used in intersection of two collections
	SkipSort          bool `json:"skip_sort,omitempty"`
	SkipPagination    bool `json:"skip_pagination,omitempty"`
	SkipWhereFilter   bool `json:"skip_filter,omitempty"`         // used in intersection of two collections, where filter is not needed
	SkipDefaultFilter bool `json:"skip_default_filter,omitempty"` // if you want to skip the default filter

	ReturnOnlyID     bool   `json:"return_only_id,omitempty"`
	OnlyReturnCount  bool   `json:"only_return_count,omitempty"`
	IsAggregateQuery bool   `json:"is_aggregate_query,omitempty"`
	ReturnOverwrite  string `json:"return_overwrite,omitempty"`

	QuerySelectionSets *ast.SelectionSet `json:"query_selection_sets,omitempty"`

	UnmarshalStructure interface{} `json:"unmarshal_structure"`

	ProjectType ProjectType `json:"project_type"`
}

type Config

type Config struct {
	Environment string `env:"ENVIRONMENT" env-default:"local"`

	BrankaKey string `env:"BRANKA_KEY" env-default:""`

	CORSOrigin   string `env:"CORS_ORIGIN" env-default:"http://localhost:4000"`
	CookieDomain string `env:"COOKIE_DOMAIN" env-default:"localhost"`

	UptraceDNS string `env:"UPTRACE_DNS" env-default:""`

	PluginPath string `env:"PLUGIN_PATH" env-default:"plugins"`

	CacheDriver string `env:"CACHE_DRIVER" env-default:"memory"`
	CacheTTL    string `env:"CACHE_TTL" env-default:"600"`

	// Server Information
	ServePort string `env:"SERVE_PORT" env-default:"5050"` // Server Listening Port

	SystemDatabaseEngine string `env:"APITO_SYSTEM_DB_ENGINE" env-default:"coreDB"`

	// System Database Information
	SystemDBUser     string `env:"SYSTEM_DB_USER" env-default:""`
	SystemDBPassword string `env:"SYSTEM_DB_PASSWORD" env-default:""`
	SystemDBHost     string `env:"SYSTEM_DB_HOST" env-default:""`
	SystemDBPort     string `env:"SYSTEM_DB_PORT" env-default:""`
	SystemDBName     string `env:"SYSTEM_DB_NAME" env-default:"~/.apito/engine-data/apito_system.db"`

	DefaultProjectDatabaseEngine string `env:"APITO_PROJECT_DB_ENGINE" env-default:"coreDB"`

	DefaultProjectDBUser     string `env:"PROJECT_DB_USER" env-default:""`
	DefaultProjectDBPassword string `env:"PROJECT_DB_PASSWORD" env-default:""`
	DefaultProjectDBHost     string `env:"PROJECT_DB_HOST" env-default:""`
	DefaultProjectDBPort     string `env:"PROJECT_DB_PORT" env-default:""`
	DefaultProjectDBName     string `env:"PROJECT_DB_NAME" env-default:""`

	DefaultSaaSProjectDBName string `env:"DEFAULT_SAAS_PROJECT_DB_NAME" env-default:""`

	KVStorageEngine         string `env:"KV_ENGINE" env-default:"memory"`
	KVStorageEngineHost     string `env:"KV_HOST" env-default:""`
	KVStorageEnginePort     string `env:"KV_PORT" env-default:""`
	KVStorageEngineUser     string `env:"KV_USER" env-default:""`
	KVStorageEnginePassword string `env:"KV_PASSWORD" env-default:""`
	KVStorageEngineDatabase string `env:"KV_DATABASE" env-default:"0"`

	// Token Encryption Credential
	PublicKeyPath  string `env:"PUBLIC_KEY_PATH" env-default:"keys/public.key"`
	PrivateKeyPath string `env:"PRIVATE_KEY_PATH" env-default:"keys/private.key"`

	// Sentry Credential
	SentryKey     string `env:"SENTRY_KEY" env-default:""`
	SentryProject string `env:"SENTRY_PROJECT" env-default:""`
	SentryAPI     string `env:"SENTRY_API" env-default:""`

	AuthServiceProvider string `env:"AUTH_SERVICE_PROVIDER" env-default:"local"`

	GoogleOauthClientID     string `env:"GOOGLE_OAUTH_CLIENT_ID" env-default:""`
	GoogleOauthClientSecret string `env:"GOOGLE_OAUTH_CLIENT_SECRET" env-default:""`
	GoogleOauthRedirectURL  string `env:"GOOGLE_OAUTH_REDIRECT_URL" env-default:""`

	GithubOauthClientID     string `env:"GITHUB_OAUTH_CLIENT_ID" env-default:""`
	GithubOauthClientSecret string `env:"GITHUB_OAUTH_CLIENT_SECRET" env-default:""`
	GithubOauthRedirectURL  string `env:"GITHUB_OAUTH_REDIRECT_URL" env-default:""`

	TokenTTL string `env:"TOKEN_TTL" env-default:"60"`

	AWSRegion string `env:"AWS_REGION" env-default:""`
	AWSSecret string `env:"AWS_SECRET" env-default:""`
	AWSKey    string `env:"AWS_KEY" env-default:""`

	// Optional driver factory for dependency injection (used by pro version)
	// If nil, falls back to default core drivers
	DriverFactory interface{} `env:"-"` // Will be type-asserted to DatabaseDriverFactory
}

type ConnectDisconnectParam

type ConnectDisconnectParam struct {
	DocCollectionName string
	DocRelationName   string

	ActionIDs       []string
	CurrentActionID string // used in single delete relation
	ActionIDType    string // direct, indirect

	ConnectionType      string
	ForwardConnectionID string

	ForwardConnectionType      *ConnectionType
	ForwardConnectionModelType *ModelType

	BackwardConnectionType      *ConnectionType
	BackwardConnectionModelType *ModelType

	KnownAs string

	InjectableHasOneConnects []*InjectableHasOneConnection
}

type ConnectionType

type ConnectionType struct {
	Model    string `json:"model,omitempty" firestore:"model,omitempty" bson:"model,omitempty"`
	Relation string `json:"relation,omitempty" firestore:"relation,omitempty" bson:"relation,omitempty"`
	Type     string `json:"type,omitempty" firestore:"type,omitempty" bson:"type,omitempty"`
	KnownAs  string `json:"known_as,omitempty" firestore:"known_as,omitempty" bson:"known_as,omitempty"`
}

type DBPaginationFilter

type DBPaginationFilter struct {
	Total int `json:"total"`
	Page  int `json:"page"`
	Limit int `json:"limit"`
}

type DataLoaders

type DataLoaders struct {
	MultiLoader *dataloader.Loader[string, interface{}]
}

DataLoaders Dataloaders

type DocumentRevisionHistory

type DocumentRevisionHistory struct {
	ID         string `json:"id"`
	RevisionAt string `json:"revision_at"`
	Status     string `json:"status"`
}

type DriverCredentials

type DriverCredentials struct {
	// for sql migration purposes
	ProjectID string `bun:"type:uuid,pk" json:"project_id,omitempty" firestore:"project_id,omitempty" bson:"project_id,omitempty"`
	// normal sql & nosql database
	Engine   string `json:"engine,omitempty" bson:"engine,omitempty"`
	Host     string `json:"host,omitempty" bson:"host,omitempty"`
	Port     string `json:"port,omitempty" bson:"port,omitempty"`
	User     string `json:"user,omitempty" bson:"user,omitempty"`
	Password string `json:"password,omitempty" bson:"password,omitempty"`
	Database string `json:"database,omitempty" bson:"database,omitempty"`
	// for firebase
	FirebaseProjectID             string `json:"firebase_project_id,omitempty" bson:"firebase_project_id,omitempty"`
	FirebaseProjectCredentialJSON string `json:"firebase_project_credential_json,omitempty" bson:"firebase_project_credential_json,omitempty"`
	// for dynamodb
	AccessKey string `json:"access_key,omitempty" bson:"access_key,omitempty"`
	SecretKey string `json:"secret_key,omitempty" bson:"secret_key,omitempty"`
	// for embedded database
	DatabaseDir string `json:"database_dir,omitempty" bson:"database_dir,omitempty"`
}

type EdgeRelation

type EdgeRelation struct {
	XFrom string `json:"_from,omitempty" bson:"_from,omitempty"`
	XTo   string `json:"_to,omitempty" bson:"_to,omitempty"`
	Key   string `json:"_key,omitempty" bson:"_id,omitempty"`

	Relation string `json:"relation,omitempty" bson:"relation,omitempty"`
	From     string `json:"from,omitempty" bson:"from,omitempty"`
	FromID   string `json:"from_id,omitempty" bson:"from_id,omitempty"`
	To       string `json:"to,omitempty" bson:"to,omitempty"`
	ToID     string `json:"to_id,omitempty" bson:"to_id,omitempty"`

	Role        string   `json:"role,omitempty" bson:"role,omitempty"`
	KnownAs     string   `json:"known_as,omitempty" bson:"known_as,omitempty"`
	Permissions []string `json:"permissions,omitempty" bson:"permissions,omitempty"`
	CreatedAt   string   `json:"created_at,omitempty" bson:"created_at,omitempty"`

	TenantID    string `json:"tenant_id,omitempty" bson:"tenant_id,omitempty"`
	TenantModel string `json:"tenant_model,omitempty" bson:"tenant_model,omitempty"`
}

type EmailSendRequest

type EmailSendRequest struct {
	AppURL       string   `json:"app_url"`
	Sender       string   `json:"sender"`
	ProjectName  string   `json:"project_name"`
	TempPassword string   `json:"temp_password"`
	Recipients   []string `json:"recipients"`
	Subject      string   `json:"subject"`
	HtmlBody     string   `json:"html_body"`
	TextBody     string   `json:"text_body"`
}

type FieldDetails

type FieldDetails struct {
	Identifier string
	Kind       reflect.Kind
	SubFields  []*FieldInfo
	Local      string

	FieldType  string
	Validation *Validation
	Value      interface{}
}

type FieldInfo

type FieldInfo struct {
	Identifier      string       `json:"identifier,omitempty" firestore:"identifier,omitempty" bson:"identifier,omitempty"`
	Description     string       `json:"description,omitempty" firestore:"description,omitempty" bson:"description,omitempty"`
	InputType       string       `json:"input_type,omitempty" firestore:"input_type,omitempty" bson:"input_type,omitempty"`
	FieldType       string       `json:"field_type,omitempty" firestore:"field_type,omitempty" bson:"field_type,omitempty"`
	FieldSubType    string       `json:"field_sub_type,omitempty" bson:"field_sub_type,omitempty"`
	SubFieldInfo    []*FieldInfo `json:"sub_field_info,omitempty" firestore:"modules,omitempty" bson:"sub_field_info,omitempty"`
	Validation      *Validation  `json:"validation,omitempty" firestore:"validation,omitempty" bson:"validation,omitempty"`
	Serial          uint32       `json:"serial,omitempty" firestore:"serial,omitempty" bson:"serial,omitempty"`
	Label           string       `json:"label,omitempty" firestore:"label,omitempty" bson:"label,omitempty"`
	SystemGenerated bool         `json:"system_generated,omitempty" firestore:"system_generated,omitempty" bson:"system_generated,omitempty"`
	//RepeatedGroupIdentifier string       `json:"repeated_group_identifier,omitempty" firestore:"repeated_group_identifier,omitempty" bson:"repeated_group_identifier,omitempty"`
	IsObjectField  bool   `json:"is_object_field,omitempty" firestore:"is_object_field,omitempty" bson:"is_object_field,omitempty"`
	ParentField    string `json:"parent_field,omitempty" firestore:"parent_field,omitempty" bson:"parent_field,omitempty"`
	EnableIndexing bool   `json:"enable_indexing,omitempty" firestore:"enable_indexing,omitempty" bson:"enable_indexing,omitempty"`
}

type FileDetails

type FileDetails struct {
	ID            string        `json:"id,omitempty" firestore:"id,omitempty" bson:"_id,omitempty"`
	XKey          string        `json:"_key,omitempty" firestore:"_key,omitempty" bson:"_key,omitempty"`
	Type          string        `json:"type,omitempty" firestore:"type,omitempty" bson:"type,omitempty"`
	FileExtension string        `json:"file_extension,omitempty" firestore:"file_extension,omitempty" bson:"file_extension,omitempty"`
	FileName      string        `json:"file_name,omitempty" firestore:"file_name,omitempty" bson:"file_name,omitempty"`
	ContentType   string        `json:"content_type,omitempty" firestore:"content_type,omitempty" bson:"content_type,omitempty"`
	Size          int64         `json:"size,omitempty" firestore:"size,omitempty" bson:"size,omitempty"`
	S3Key         string        `json:"s3_key,omitempty" firestore:"s3_key,omitempty" bson:"s3_key,omitempty"`
	URL           string        `json:"url,omitempty" firestore:"url,omitempty" bson:"url,omitempty"`
	CreatedAt     string        `json:"created_at,omitempty" firestore:"created_at,omitempty" bson:"created_at,omitempty"`
	UploadParam   *UploadParams `json:"upload_param,omitempty" firestore:"upload_param,omitempty" bson:"upload_param,omitempty"`
	Buffer        []byte        `json:"buffer,omitempty" firestore:"upload_param,omitempty" bson:"buffer,omitempty"`
}
type FileLink struct {
	Link      string `json:"link,omitempty" firestore:"link,omitempty" bson:"link,omitempty"`
	Title     string `json:"title,omitempty" firestore:"title,omitempty" bson:"title,omitempty"`
	CreatedAt string `json:"created_at,omitempty" firestore:"created_at,omitempty" bson:"created_at,omitempty"`
	UpdatedAt string `json:"updated_at,omitempty" firestore:"updated_at,omitempty" bson:"updated_at,omitempty"`
}

File Picker

type FilePickParameter

type FilePickParameter struct {
	NumberOfImages uint32      `json:"number_of_images,omitempty" firestore:"number_of_images,omitempty" bson:"number_of_images,omitempty"`
	S3Folder       string      `json:"s3_folder,omitempty" firestore:"s3_folder,omitempty" bson:"s3_folder,omitempty"`
	PickerTitle    string      `json:"picker_title,omitempty" firestore:"picker_title,omitempty" bson:"picker_title,omitempty"`
	Origin         *SystemUser `json:"origin,omitempty" firestore:"origin,omitempty" bson:"origin,omitempty"`
}

type Filter

type Filter struct {
	Page     uint32 `json:"page,omitempty" firestore:"page,omitempty" bson:"page,omitempty"`
	Offset   uint32 `json:"offset,omitempty" firestore:"offset,omitempty" bson:"offset,omitempty"`
	Limit    uint32 `json:"limit,omitempty" firestore:"limit,omitempty" bson:"limit,omitempty"`
	Order    string `json:"order,omitempty" firestore:"order,omitempty" bson:"order,omitempty"`
	Min      uint32 `json:"min,omitempty" firestore:"min,omitempty" bson:"min,omitempty"`
	Max      uint32 `json:"max,omitempty" firestore:"max,omitempty" bson:"max,omitempty"`
	Category string `json:"category,omitempty" firestore:"category,omitempty" bson:"category,omitempty"`
}

type FilterInformation

type FilterInformation struct {
	Condition string         `json:"condition"`
	Filters   []*QueryFilter `json:"filters"`
}

type FilteredModel

type FilteredModel struct {
	Name              string
	WhereFilter       []string
	IsConnectionQuery bool
	HasMetaQuery      bool
	KnownAs           string // used in known_as relation node it is equal tographql alias
	IsDataloaderModel bool   // used in dataloader model
}

func FilterUniqueStrings

func FilterUniqueStrings(models []*FilteredModel) []*FilteredModel

type FunctionCache

type FunctionCache struct {
	Functions         *plugin.Plugin
	FuncConfiguration *ApitoFunction
}

System apito function model ( old )

type GraphQLIncomingRequest

type GraphQLIncomingRequest struct {
	Query         string                 `json:"query" url:"query" schema:"query"`
	Variables     map[string]interface{} `json:"variables" url:"variables" schema:"variables"`
	OperationName string                 `json:"operation_name" url:"operation_name" schema:"operation_name"`
	QueryType     string                 `json:"query_type" url:"query_type" schema:"query_type"` // query, mutation, subscription
}

type HashiCorpPluginCache

type HashiCorpPluginCache struct {
	Client               *hcplugin.Client
	PluginConfigurations *protobuff.PluginDetails
	RPCClient            hcplugin.ClientProtocol
}

HashiCorpPluginCache for HashiCorp go-plugin system

type HttpResponse

type HttpResponse struct {
	Message string      `json:"message,omitempty"`
	Body    interface{} `json:"body,omitempty"`
	Code    uint32      `json:"code,omitempty"`
	Token   string      `json:"token,omitempty"`
	Error   string      `json:"error,omitempty"`
}

type ImageMetaInfo

type ImageMetaInfo struct {
	Identifier string `json:"identifier,omitempty" firestore:"identifier,omitempty" bson:"identifier,omitempty"`
	Name       string `json:"name,omitempty" firestore:"name,omitempty" bson:"name,omitempty"`
	Width      uint32 `json:"width,omitempty" firestore:"width,omitempty" bson:"width,omitempty"`
	Height     uint32 `json:"height,omitempty" firestore:"height,omitempty" bson:"height,omitempty"`
	Type       string `json:"type,omitempty" firestore:"type,omitempty" bson:"type,omitempty"`
}

type IncomingRequest

type IncomingRequest struct {
	OperationType     string
	FilteredModels    []*FilteredModel
	FilteredFunctions []*ApitoFunction
	IsPluginRequest   bool
}

type InitParams

type InitParams struct {
	ProjectID string             `json:"project_id" bson:"project_id,omitempty"`
	ProjectDB *DriverCredentials `json:"system_credentials" bson:"system_credentials,omitempty"`
	CacheDB   *DriverCredentials `json:"cache_db" bson:"cache_db,omitempty"`
	SharedDB  *DriverCredentials `json:"shared_db" bson:"shared_db,omitempty"`
}

type InjectableHasOneConnection

type InjectableHasOneConnection struct {
	ModelName string
	IDs       []string
	Data      map[string]string
}

type JWTTokens

type JWTTokens struct {
	AccessToken  string `json:"access_token"`
	IDToken      string `json:"id_token"`
	RefreshToken string `json:"refresh_token"`

	TenantID string `json:"tenant_id"`
}

type KeyValue

type KeyValue struct {
	Key   string `json:"key,omitempty" firestore:"key,omitempty" bson:"key,omitempty"`
	Value string `json:"value,omitempty" firestore:"value,omitempty" bson:"value,omitempty"`
}

type LoginRequest

type LoginRequest struct {
	Username string `json:"username,omitempty" firestore:"username,omitempty" bson:"username,omitempty"`
	Email    string `json:"email,omitempty" firestore:"email,omitempty" bson:"email,omitempty"`
	Secret   string `json:"secret,omitempty" firestore:"secret,omitempty" bson:"secret,omitempty"`
}

type MetaField

type MetaField struct {
	SourceID string `json:"source_id,omitempty" firestore:"source_id,omitempty" bson:"source_id,omitempty"`

	CreatedAt      string      `json:"created_at,omitempty" firestore:"created_at,omitempty" bson:"created_at,omitempty"`
	UpdatedAt      string      `json:"updated_at,omitempty" firestore:"updated_at,omitempty" bson:"updated_at,omitempty"`
	CreatedBy      *SystemUser `json:"created_by,omitempty" firestore:"title,omitempty" bson:"created_by,omitempty"`
	LastModifiedBy *SystemUser `json:"last_modified_by,omitempty" firestore:"created_by,omitempty" bson:"last_modified_by,omitempty"`

	Status string `json:"status,omitempty" firestore:"status,omitempty" bson:"status,omitempty"`
	//TenantId       string `json:"tenant_id,omitempty" firestore:"tenant_id,omitempty"` move to root removed from meta
	RootRevisionID string `json:"root_revision_id,omitempty" firestore:"root_revision_id,omitempty" bson:"root_revision_id,omitempty"`
	Revision       bool   `json:"revision,omitempty" firestore:"revision,omitempty" bson:"revision,omitempty"`
	RevisionAt     string `json:"revision_at,omitempty" firestore:"revision_at,omitempty" bson:"revision_at,omitempty"`

	// used in filterAbsentStudent where multiple record is processed but we need to return only attendance id
	ResourceID string `json:"resource_id,omitempty" firestore:"resource_id,omitempty" bson:"resource_id,omitempty"`
}

type ModelDocsResponse

type ModelDocsResponse struct {
	Docs  []*types.DefaultDocumentStructure `json:"docs"`
	Count int                               `json:"count"`
}

type ModelType

type ModelType struct {
	ProjectID       string            `bun:"type:uuid,pk" json:"project_id,omitempty" firestore:"project_id,omitempty" bson:"project_id,omitempty"`
	Name            string            `json:"name,omitempty" firestore:"name,omitempty" bson:"name,omitempty"`
	Description     string            `json:"description,omitempty" bson:"description,omitempty"`
	Fields          []*FieldInfo      `json:"fields,omitempty" firestore:"fields,omitempty" bson:"fields,omitempty"`
	Connections     []*ConnectionType `json:"connections,omitempty" firestore:"connections,omitempty" bson:"connections,omitempty"`
	HookIds         []string          `json:"hook_ids,omitempty" firestore:"hook_ids,omitempty" bson:"hook_ids,omitempty"`
	Locals          []string          `json:"locals,omitempty" firestore:"locals,omitempty" bson:"locals,omitempty"`
	RepeatedGroups  []string          `json:"repeated_groups,omitempty" firestore:"locals,omitempty" bson:"repeated_groups,omitempty"`
	SystemGenerated bool              `json:"system_generated,omitempty" firestore:"system_generated,omitempty" bson:"system_generated,omitempty"`
	SinglePage      bool              `json:"single_page,omitempty" firestore:"system_generated,omitempty" bson:"single_page,omitempty"`
	SinglePageUUID  string            `json:"single_page_uuid,omitempty" firestore:"system_generated,omitempty" bson:"single_page_uuid,omitempty"`
	HasConnections  bool              `json:"has_connections,omitempty" firestore:"has_connections,omitempty" bson:"has_connections,omitempty"`
	IsTenantModel   bool              `json:"is_tenant_model,omitempty" firestore:"is_tenant_model,omitempty" bson:"is_tenant_model,omitempty"`
	EnableRevision  bool              `json:"enable_revision,omitempty" firestore:"enable_revision,omitempty" bson:"enable_revision,omitempty"`
	// is common model is used in saas application where inserting or querying data from this model doesnt require tenant id
	IsCommonModel  bool        `json:"is_common_model,omitempty" firestore:"is_common_model,omitempty" bson:"is_common_model,omitempty"`
	RevisionFilter []*KeyValue `json:"revision_filter,omitempty" firestore:"revision_filter,omitempty" bson:"revision_filter,omitempty"`
}

type Organization

type Organization struct {
	XKey        string        `json:"_key,omitempty" firestore:"_key,omitempty" bson:"_key,omitempty"`
	ID          string        `bun:"type:uuid,pk" json:"id,omitempty" firestore:"id,omitempty" bson:"_id,omitempty"`
	Name        string        `json:"name,omitempty" firestore:"name,omitempty" bson:"name,omitempty"`
	Description string        `json:"description,omitempty" firestore:"description,omitempty" bson:"description,omitempty"`
	Teams       []*Team       `bun:"rel:has-many" json:"teams,omitempty" firestore:"teams,omitempty" bson:"teams,omitempty"`
	Users       []*SystemUser `bun:"rel:has-many" json:"users,omitempty" firestore:"users,omitempty" bson:"users,omitempty"`
}

type PassChangeRequest

type PassChangeRequest struct {
	OldPassword string `json:"old_password,omitempty" firestore:"old_password,omitempty" bson:"old_password,omitempty"`
	NewPassword string `json:"new_password,omitempty" firestore:"new_password,omitempty" bson:"new_password,omitempty"`
}

type PictureDeleteRequest

type PictureDeleteRequest struct {
	Urls      []string `json:"urls,omitempty" firestore:"urls,omitempty" bson:"urls,omitempty"`
	Model     string   `json:"model,omitempty" firestore:"model,omitempty" bson:"model,omitempty"`
	ID        string   `json:"id,omitempty" firestore:"id,omitempty" bson:"_id,omitempty"`
	FieldName string   `json:"field_name,omitempty" firestore:"field_name,omitempty" bson:"field_name,omitempty"`
}

type PluginCache

type PluginCache struct {
	Plugin               *plugin.Plugin
	PluginConfigurations *protobuff.PluginDetails
}

new plugin system models

type PreviewMode

type PreviewMode struct {
	Title  string `json:"title,omitempty" firestore:"title,omitempty" bson:"title,omitempty"`
	Icon   string `json:"icon,omitempty" firestore:"icon,omitempty" bson:"icon,omitempty"`
	Status string `json:"status,omitempty" firestore:"status,omitempty" bson:"status,omitempty"`
	ID     string `json:"id,omitempty" firestore:"id,omitempty" bson:"_id,omitempty"`
}

type Project

type Project struct {
	XKey string `json:"_key,omitempty" firestore:"_key,omitempty" bson:"_key,omitempty"`
	ID   string `bun:"type:uuid,pk" json:"id,omitempty" firestore:"id,omitempty" bson:"_id,omitempty"`

	Name        string                     `json:"name,omitempty" firestore:"name,omitempty" bson:"name,omitempty"`
	Description string                     `json:"description,omitempty" firestore:"description,omitempty" bson:"description,omitempty"`
	Schema      *ProjectSchema             `bun:"rel:belongs-to,join:id=project_id" json:"schema,omitempty" firestore:"schema,omitempty" bson:"schema,omitempty"`
	CreatedAt   string                     `json:"created_at,omitempty" firestore:"created_at,omitempty" bson:"created_at,omitempty"`
	UpdatedAt   string                     `json:"updated_at,omitempty" firestore:"updated_at,omitempty" bson:"updated_at,omitempty"`
	ExpireAt    string                     `json:"expire_at,omitempty" firestore:"expire_at,omitempty" bson:"expire_at,omitempty"`
	Plugins     []*protobuff.PluginDetails `bun:"rel:has-many" json:"plugins,omitempty" firestore:"plugins,omitempty" bson:"plugins,omitempty"`
	Settings    *ProjectSettings           `bun:"rel:belongs-to,join:id=project_id" json:"settings,omitempty"  firestore:"settings,omitempty" bson:"settings,omitempty"`

	Tokens  []*APIToken `bun:"rel:has-many" json:"tokens,omitempty" firestore:"tokens,omitempty" bson:"tokens,omitempty"`
	APIKeys []*APIKey   `bun:"rel:has-many" json:"api_keys,omitempty" firestore:"api_keys,omitempty" bson:"api_keys,omitempty"`

	Roles      map[string]*Role   `` /* 178-byte string literal not displayed */
	Driver     *DriverCredentials `bun:"rel:belongs-to,join:id=project_id" json:"driver,omitempty"  firestore:"driver,omitempty" bson:"driver,omitempty"`
	TempBanned bool               `json:"temp_banned,omitempty" firestore:"temp_banned,omitempty" bson:"temp_banned,omitempty"`

	ProjectTemplate string `json:"project_template,omitempty" firestore:"project_template,omitempty" bson:"project_template,omitempty"`

	Teams          []*Team       `bun:"m2m:team_projects,join:Project=Team" json:"teams,omitempty"  firestore:"teams,omitempty" bson:"teams,omitempty"`
	Users          []*SystemUser `bun:"m2m:user_projects,join:Project=User" json:"users,omitempty"  firestore:"users,omitempty" bson:"users,omitempty"`
	OrganizationID string        `json:"organization_id,omitempty" firestore:"organization_id,omitempty" bson:"organization_id,omitempty"`
	Organization   *Organization `` /* 139-byte string literal not displayed */

	SystemMessages []*SystemMessage `bun:"rel:has-many" json:"system_messages,omitempty" firestore:"system_messages,omitempty" bson:"system_messages,omitempty"`
	Workspaces     []*Workspace     `bun:"rel:has-many" json:"workspaces,omitempty" firestore:"workspaces,omitempty" bson:"workspaces,omitempty"`

	PlanType       string `json:"plan_type,omitempty" firestore:"plan_type,omitempty" bson:"plan_type,omitempty"` // dedicated, byod
	TireType       string `json:"tire_type,omitempty" firestore:"tire_type,omitempty" bson:"tire_type,omitempty"` // free, pro, business
	TrialEnds      string `json:"trial_ends,omitempty" firestore:"trial_ends,omitempty" bson:"trial_ends,omitempty"`
	PaymentDueDate string `json:"payment_due_date,omitempty" firestore:"payment_due_date,omitempty" bson:"payment_due_date,omitempty"`

	// for microservice
	MicroServicePort string `json:"micro_service_port,omitempty" firestore:"micro_service_port,omitempty" bson:"micro_service_port,omitempty"`

	// for sync
	SyncedProperty *SyncProject `` /* 143-byte string literal not displayed */

	// for SaaS Project
	ProjectType               ProjectType `json:"project_type,omitempty" firestore:"project_type,omitempty" bson:"project_type,omitempty"` // general, saas, ecom etc
	PerTenantSeparateDatabase bool        ``                                                                                               /* 142-byte string literal not displayed */
	ProjectSecretKey          string      `json:"project_secret_key,omitempty" firestore:"project_secret_key,omitempty" bson:"project_secret_key,omitempty"`
	TenantModelName           string      `json:"tenant_model_name,omitempty" firestore:"tenant_model_name,omitempty" bson:"tenant_model_name,omitempty"`
}

Project user project

type ProjectApiTracking

type ProjectApiTracking map[string]ApiTracking

type ProjectCreateRequest

type ProjectCreateRequest struct {
	ID          string             `json:"id" bson:"_id,omitempty"`
	Name        string             `json:"name" bson:"name,omitempty"`
	Description string             `json:"description" bson:"description,omitempty"`
	Token       string             `json:"token" bson:"token,omitempty"`
	Engine      string             `json:"engine" bson:"engine,omitempty"`
	Driver      *DriverCredentials `json:"driver" bson:"driver,omitempty"`
	Example     string             `json:"example" bson:"example,omitempty"`
}

type ProjectSchema

type ProjectSchema struct {
	ProjectID string           `bun:"type:uuid,pk" json:"project_id,omitempty" firestore:"project_id,omitempty" bson:"_id,omitempty"`
	Models    []*ModelType     `bun:"rel:has-many" json:"models,omitempty" firestore:"models,omitempty" bson:"models,omitempty"`
	Functions []*ApitoFunction `bun:"rel:has-many" json:"functions,omitempty" firestore:"functions,omitempty" bson:"functions,omitempty"`
}

type ProjectSettings

type ProjectSettings struct {
	ProjectID             string   `bun:"type:uuid,pk" json:"project_id,omitempty" firestore:"project_id,omitempty" bson:"_id,omitempty"`
	Locals                []string `json:"locals,omitempty" firestore:"locals,omitempty" bson:"locals,omitempty"`
	SystemGraphqlHooks    bool     `json:"system_graphql_hooks,omitempty" firestore:"system_graphql_hooks,omitempty" bson:"system_graphql_hooks,omitempty"`
	EnableRevisionHistory bool     `json:"enable_revision_history,omitempty" firestore:"revision_history,omitempty" bson:"enable_revision_history,omitempty"`

	DefaultStoragePlugin  string `json:"default_storage_plugin,omitempty" firestore:"default_storage_plugin,omitempty" bson:"default_storage_plugin,omitempty"`
	DefaultFunctionPlugin string `` /* 127-byte string literal not displayed */

	DefaultLocale string `json:"default_locale,omitempty" firestore:"default_locale,omitempty" bson:"default_locale,omitempty"`
}

type ProjectType

type ProjectType int32
const (
	ProjectType_General ProjectType = 0
	ProjectType_SaaS    ProjectType = 1
)

type ProjectWithRoles

type ProjectWithRoles struct {
	User        *SystemUser `json:"user,omitempty" firestore:"user,omitempty" bson:"user,omitempty"`
	Project     *Project    `json:"project,omitempty" firestore:"project" bson:"project,omitempty"`
	Role        string      `json:"role,omitempty" firestore:"role,omitempty" bson:"role,omitempty"`
	Permissions []string    `json:"permissions,omitempty" firestore:"permissions,omitempty" bson:"permissions,omitempty"`
}

type QueryBuilder

type QueryBuilder struct {
	RawFilterData map[string]interface{}
	DefaultModel  *ModelType

	UserID                   string   `json:"user_id"`
	ProjectID                string   `json:"project_id"`
	RootCollectionFilterType string   `json:"doc_filter_type"`
	DocumentID               string   `json:"document_id"`
	DocumentIDs              []string `json:"document_ids"`

	ParentVariableName string `json:"parent_variable_name"`
	VariablePrefix     string `json:"variable_prefix"`
	VariableName       string `json:"variable_name"`
	CollectionName     string `json:"main_collection_name"`

	RelationCollectionName string               `json:"relation_collection_name"`
	RelationConnection     *ConnectionType      `json:"relation_connection"`
	RelationWhereFilter    []*FilterInformation `json:"relation_where_filter"`

	DefaultFilterCondition string `json:"filter_condition"`

	WhereFilter      []*FilterInformation `json:"where_filter"`   // filter by the user
	DefaultFilter    []*FilterInformation `json:"default_filter"` // default filter that needs to be appended like _key or type of meta.status == 'published'
	SortFilter       []*QueryFilter       `json:"sort_and_limit_param"`
	PaginationFilter *DBPaginationFilter  `json:"limit_filter"`
	FilterByLocal    string               `json:"local"`
	FilterByStatus   string               `json:"status"`

	GroupByFilter map[string]interface{} `json:"group_by_filter"` // used for colelct or group by results

	ConnectionFilter map[string]interface{} `json:"connection_filter"`

	ApitoFields []*FieldInfo `json:"apito_fields"`

	//QueryFilters  []*FilterInformation     `json:"query_filters"`
	SubQueries      []*QueryBuilder          `json:"sub_queries"`
	NestedQueries   []*QueryBuilder          `json:"nested_queries"`
	ReturnFields    map[string]*FieldDetails `json:"return_fields"`
	ReturnOverwrite string                   `json:"return_overwrite"`

	ReturnFieldsSelection *ast.SelectionSet `json:"return_fields_selection"`

	IncludeDefaultSortAndLimit bool `json:"include_default_sort_and_limit"`
	IntersectResult            bool `json:"intersect_result"`
	FetchRevisionDocumentsOnly bool `json:"fetch_revision_documents_only"`
	IsDataloaderQuery          bool `json:"is_dataloader_query"`

	GroupByVariable1 string `json:"group_by_variable1"`
	GroupByVariable2 string `json:"group_by_variable2"`

	IsSystemRequest         bool `json:"is_system_query"`
	IsSystemCollectionQuery bool `json:"is_system_collection_query"`
	IsEntireCollectionQuery bool `json:"is_entire_collection_query"`

	SkipSort          bool `json:"skip_sort"`
	SkipPagination    bool `json:"skip_limit"`
	SkipWhereFilter   bool `json:"skip_where_filter"`
	SkipDefaultFilter bool `json:"skip_default_filter"`

	ReturnOnlyID     bool `json:"return_only_id"`
	ReturnOnlyCount  bool `json:"return_only_count"`
	IsAggregateQuery bool `json:"is_aggregate_query"`

	ProjectType ProjectType `json:"project_type"`

	FinalQuery string `json:"final_query"`

	TenantID    string `json:"tenant_id"`
	TenantModel string `json:"tenant_model"`
}

type QueryFilter

type QueryFilter struct {
	KeyWrapperFunction     string      `json:"key_wrapper_function"`     // LOWER(x.name)
	Variable               string      `json:"variable"`                 // x
	Key                    string      `json:"key"`                      // name
	Condition              string      `json:"condition"`                // ==
	Value                  interface{} `json:"value"`                    // fahim
	ComplexPredefinedQuery string      `json:"complex_predefined_query"` // for array filter -> COUNT(array[* FILTER CONTAINS(name, CURRENT)])
	IgnoreValue            bool        `json:"ignore_value"`             // for sub query or IntersectIDs sometime we need to ignore the value ex: NOT IN IntersectIDs null
}

type RawSchema

type RawSchema struct {
	Queries   graphql.Fields
	Mutations graphql.Fields
}

type RegisterRequest

type RegisterRequest struct {
	User             *SystemUser `json:"user,omitempty" firestore:"user,omitempty" bson:"user,omitempty"`
	VerificationCode string      `json:"verification_code,omitempty" firestore:"profession,omitempty" bson:"verification_code,omitempty"`
	AddedByAdmin     bool        `json:"added_by_admin,omitempty" firestore:"added_by_admin,omitempty" bson:"added_by_admin,omitempty"`
}

type Request

type Request struct {
	ID           string  `json:"id,omitempty" firestore:"id,omitempty" bson:"_id,omitempty"`
	Type         string  `json:"type,omitempty" firestore:"type,omitempty" bson:"type,omitempty"`
	Filter       *Filter `json:"filter,omitempty" firestore:"filter,omitempty" bson:"filter,omitempty"`
	SearchString string  `json:"search_string,omitempty" firestore:"search_string,omitempty" bson:"search_string,omitempty"`
	Retry        bool    `json:"retry,omitempty" firestore:"retry,omitempty" bson:"retry,omitempty"`
}

type ResolverKey

type ResolverKey struct {
	Key  interface{}
	Meta *MetaField
}

func NewResolverKey

func NewResolverKey(key interface{}, meta *MetaField) *ResolverKey

func (*ResolverKey) GetMeta

func (rk *ResolverKey) GetMeta() *MetaField

func (*ResolverKey) Raw

func (rk *ResolverKey) Raw() interface{}

func (*ResolverKey) String

func (rk *ResolverKey) String() string

type Response

type Response struct {
	Message string `json:"message,omitempty" bson:"message,omitempty"`
	Code    string `json:"code,omitempty" bson:"code,omitempty"`
}

type Role

type Role struct {
	ID                        string                    `bun:"id,pk,notnull,type:uuid,default:gen_random_uuid()" json:"id,omitempty" firestore:"id,omitempty" bson:"_id,omitempty"`
	APIPermissions            map[string]*APIPermission `bun:",type:jsonb" json:"api_permissions,omitempty" firestore:"permissions,omitempty" bson:"api_permissions,omitempty"`
	AdministrativePermissions []string                  `` /* 136-byte string literal not displayed */
	LogicExecutions           []string                  `json:"logic_executions,omitempty" firestore:"logic_executions,omitempty" bson:"logic_executions,omitempty"`
	SystemGenerated           bool                      `json:"system_generated,omitempty" firestore:"system_generated,omitempty" bson:"system_generated,omitempty"`
	IsAdmin                   bool                      `json:"is_admin,omitempty" firestore:"is_admin,omitempty" bson:"is_admin,omitempty"`
	IsProjectUser             bool                      `json:"is_project_user,omitempty" firestore:"is_project_user,omitempty" bson:"is_project_user,omitempty"`
	ReadOnlyProject           bool                      `json:"read_only_project,omitempty" firestore:"read_only_project,omitempty" bson:"read_only_project,omitempty"`
}

func (*Role) MarshalAPIPermissions

func (u *Role) MarshalAPIPermissions() ([]byte, error)

MarshalApiPermissions serializes ApiPermissions to JSON.

func (*Role) UnmarshalAPIPermissions

func (u *Role) UnmarshalAPIPermissions(data []byte) error

UnmarshalApiPermissions deserializes JSON to ApiPermissions.

type SchemaBuildPermission

type SchemaBuildPermission struct {
	CanQuery        bool
	CanCreateRecord bool
	CanEditRecord   bool
	CanDeleteRecord bool
}

func BuildPermissions

func BuildPermissions(role string) *SchemaBuildPermission

type SearchResponse

type SearchResponse[T any] struct {
	Results        []*T
	GroupedResults map[string][]*T
}

type Subscriber

type Subscriber struct {
	Data   chan interface{}
	UserID string
}

type SubscriptionEvent

type SubscriptionEvent struct {
	Type      string `json:"type"`
	ProjectID string `json:"project_id"`
	UserID    string `json:"user_id"`
	Message   string `json:"message"`
}

type SupportAndTicket

type SupportAndTicket struct {
	XKey             string         `json:"_key,omitempty" bson:"_key,omitempty"`
	ID               string         `json:"id,omitempty" bson:"_id,omitempty"`
	Type             string         `json:"type,omitempty" bson:"type,omitempty"`
	ProjectID        string         `json:"project_id,omitempty" bson:"project_id,omitempty"`
	Resolved         bool           `json:"resolved,omitempty" bson:"resolved,omitempty"`
	Title            string         `json:"title,omitempty" bson:"title,omitempty"`
	IssueDescription string         `json:"issue_description,omitempty" bson:"issue_description,omitempty"`
	CreatedAt        string         `json:"created_at,omitempty" bson:"created_at,omitempty"`
	UpdatedAt        string         `json:"updated_at,omitempty" bson:"updated_at,omitempty"`
	Replies          []*TicketReply `json:"replies,omitempty" bson:"replies,omitempty"`
}

type SyncProject

type SyncProject struct {
	ProjectID                string `bun:"type:uuid,pk" json:"project_id,omitempty" firestore:"project_id,omitempty" bson:"_id,omitempty"`
	SyncedTokenUsed          string `json:"synced_token_used,omitempty" firestore:"synced_token_used,omitempty" bson:"synced_token_used,omitempty"`
	LocalProjectID           string `json:"local_project_id,omitempty" firestore:"local_project_id,omitempty" bson:"local_project_id,omitempty"`
	MergeWithExistingProject bool   `` /* 139-byte string literal not displayed */
	LastSyncedAt             string `json:"last_synced_at,omitempty" firestore:"last_synced_at,omitempty" bson:"last_synced_at,omitempty"`
}

type SystemMessage

type SystemMessage struct {
	ProjectID   string `json:"project_id,omitempty" firestore:"project_id,omitempty" bson:"project_id,omitempty"`
	Message     string `json:"message,omitempty" firestore:"message,omitempty" bson:"message,omitempty"`
	Code        string `json:"code,omitempty" firestore:"code,omitempty" bson:"code,omitempty"`
	Redirection string `json:"redirection,omitempty" firestore:"redirection,omitempty" bson:"redirection,omitempty"`
	Hide        bool   `json:"hide,omitempty" firestore:"hide,omitempty" bson:"hide,omitempty"`
}

type SystemUser

type SystemUser struct {
	XKey string `json:"_key,omitempty" firestore:"_key,omitempty" bson:"_key,omitempty"`
	ID   string `bun:"type:uuid,pk" json:"id,omitempty" firestore:"id,omitempty" bson:"_id,omitempty"`

	Secret       string `json:"secret,omitempty" firestore:"secret,omitempty" bson:"secret,omitempty"`
	TempPassword string `json:"temp_password,omitempty" firestore:"temp_password,omitempty" bson:"temp_password,omitempty"`

	FirstName string `json:"first_name,omitempty" firestore:"first_name,omitempty" bson:"first_name,omitempty"`
	LastName  string `json:"last_name,omitempty" firestore:"last_name,omitempty" bson:"last_name,omitempty"`
	Role      string `json:"role,omitempty" firestore:"role,omitempty" bson:"role,omitempty"`
	Username  string `json:"username,omitempty" firestore:"username,omitempty" bson:"username,omitempty"`
	Email     string `json:"email,omitempty" firestore:"email,omitempty" bson:"email,omitempty"`
	Avatar    string `json:"avatar,omitempty" firestore:"avatar,omitempty" bson:"avatar,omitempty"`

	CurrentProjectID string `json:"current_project_id,omitempty" firestore:"current_project_id,omitempty" bson:"current_project_id,omitempty"`
	RegisterProvider string `json:"register_provider,omitempty" firestore:"register_provider,omitempty" bson:"register_provider,omitempty"`

	ProjectUser               bool     `json:"project_user,omitempty" firestore:"project_user,omitempty" bson:"project_user,omitempty"`
	AdministrativePermissions []string `json:"administrative_permissions,omitempty" firestore:"email,omitempty" bson:"administrative_permissions,omitempty"`

	ProjectAssignedRole      string   `json:"project_assigned_role,omitempty" bson:"project_assigned_role,omitempty"`
	ProjectAccessPermissions []string `json:"project_access_permissions,omitempty" bson:"project_access_permissions,omitempty"`

	IsAdmin bool `json:"is_admin,omitempty" firestore:"is_admin,omitempty" bson:"is_admin,omitempty"`

	RefreshToken    string `json:"refresh_token,omitempty" firestore:"refresh_token,omitempty" bson:"refresh_token,omitempty"`
	AccessToken     string `json:"access_token,omitempty" firestore:"access_token,omitempty" bson:"access_token,omitempty"`
	ReadOnlyProject bool   `json:"read_only_project,omitempty" firestore:"read_only_project,omitempty" bson:"read_only_project,omitempty"`
	LastLoggedIn    string `json:"last_logged_in,omitempty" firestore:"last_logged_in,omitempty" bson:"last_logged_in,omitempty"`

	ProjectLimit uint32 `json:"project_limit,omitempty" firestore:"project_limit,omitempty" bson:"project_limit,omitempty"`

	CreatedAt string `` /* 143-byte string literal not displayed */
	UpdatedAt string `bun:"type:timestamp,notnull" json:"updated_at,omitempty" firestore:"updated_at,omitempty" bson:"updated_at,omitempty"`

	IsPaymentDue bool `json:"is_payment_due,omitempty" firestore:"is_payment_due,omitempty" bson:"is_payment_due,omitempty"`

	DefaultTeam         *Team         `` /* 144-byte string literal not displayed */
	DefaultOrganization *Organization `` /* 166-byte string literal not displayed */

	Projects     []*Project      `bun:"m2m:user_projects,join:User=Project" json:"projects,omitempty" firestore:"projects,omitempty" bson:"projects,omitempty"`
	Teams        []*Team         `bun:"m2m:user_to_teams,join:SystemUser=Team" json:"teams,omitempty" firestore:"teams,omitempty" bson:"teams,omitempty"`
	Organization []*Organization `` /* 129-byte string literal not displayed */

	IsActive bool `json:"is_active,omitempty" firestore:"is_active,omitempty" bson:"is_active,omitempty"`
}

type Team

type Team struct {
	XKey        string        `json:"_key,omitempty" firestore:"_key,omitempty" bson:"_key,omitempty"`
	ID          string        `bun:"type:uuid,pk" json:"id,omitempty" firestore:"id,omitempty" bson:"_id,omitempty"`
	Name        string        `json:"name,omitempty" firestore:"name,omitempty" bson:"name,omitempty"`
	Description string        `json:"description,omitempty" firestore:"description,omitempty" bson:"description,omitempty"`
	CreatedBy   string        `json:"created_by,omitempty" firestore:"created_by,omitempty" bson:"created_by,omitempty"`
	Users       []*SystemUser `bun:"m2m:user_teams,join:Team=User" json:"users,omitempty" firestore:"users,omitempty" bson:"users,omitempty"`
	Projects    []*Project    `bun:"m2m:team_projects,join:Team=Project" json:"projects,omitempty" firestore:"projects,omitempty" bson:"projects,omitempty"`
}

type TeamMemberAddRequest

type TeamMemberAddRequest struct {
	ProjectID   string   `json:"project_id,omitempty" firestore:"project_id,omitempty" bson:"project_id,omitempty"`
	UserID      string   `json:"user_id,omitempty" firestore:"user_id,omitempty" bson:"user_id,omitempty"`
	Email       string   `json:"email,omitempty" firestore:"email,omitempty" bson:"email,omitempty"`
	Role        string   `json:"role,omitempty" firestore:"role,omitempty" bson:"role,omitempty"`
	TeamID      string   `json:"team_id,omitempty" firestore:"team_id,omitempty" bson:"team_id,omitempty"`
	Permissions []string `json:"permissions,omitempty" firestore:"permissions,omitempty" bson:"permissions,omitempty"`
}

type TeamProject

type TeamProject struct {
	TeamID    string   `bun:"type:uuid,pk" json:"team_id" bson:"team_id,omitempty"`
	ProjectID string   `bun:"type:uuid,pk" json:"project_id" bson:"project_id,omitempty"`
	Team      *Team    `bun:"rel:belongs-to,join:team_id=team_id" bson:"team,omitempty"`
	Project   *Project `bun:"rel:belongs-to,join:project_id=project_id" bson:"project,omitempty"`
}

type TicketReply

type TicketReply struct {
	Description string      `json:"description,omitempty" bson:"description,omitempty"`
	User        *SystemUser `json:"user,omitempty" bson:"user,omitempty"`
	CreatedAt   string      `json:"created_at,omitempty" bson:"created_at,omitempty"`
	Edited      bool        `json:"edited,omitempty" bson:"edited,omitempty"`
}

type TokenClaims

type TokenClaims struct {
	ProjectID     string `json:"project_id"`
	TokenUniqueID string `json:"token_unique_id"`

	Role   string `json:"role"`
	UserID string `json:"user_id"`
	Email  string `json:"email"`

	IsProjectUser bool `json:"is_project_user"`
	IsReadOnly    bool `json:"is_read_only"`

	AccessPermissions []string `json:"access_permissions"`

	TenantID       string `json:"tenant_id"`        // used for SaaS app only
	TokenType      string `json:"token_type"`       // access_token or id_token
	PaymentDueDate string `json:"payment_due_date"` // used if the user dosnt pay

	ExpireAt time.Time `json:"expire_at"` // unix timestamp

	Scopes []string `json:"scopes"` // ['read', 'write']
}

type UploadParams

type UploadParams struct {
	DocID      string `json:"doc_id,omitempty" firestore:"doc_id,omitempty" bson:"doc_id,omitempty"`
	ProjectID  string `json:"project_id,omitempty" firestore:"project_id,omitempty" bson:"project_id,omitempty"`
	ModelName  string `json:"model_name,omitempty" firestore:"model_name,omitempty" bson:"model_name,omitempty"`
	FieldName  string `json:"field_name,omitempty" firestore:"field_name,omitempty" bson:"field_name,omitempty"`
	AllowMulti bool   `json:"allow_multi,omitempty" firestore:"allow_multi,omitempty" bson:"allow_multi,omitempty"`
	Provider   string `json:"provider,omitempty" firestore:"provider,omitempty" bson:"provider,omitempty"`
}

type UserProject

type UserProject struct {
	UserID    string      `bun:"type:uuid,pk" json:"user_id" bson:"user_id,omitempty"`
	ProjectID string      `bun:"type:uuid,pk" json:"project_id" bson:"project_id,omitempty"`
	User      *SystemUser `bun:"rel:belongs-to,join:user_id=user_id" bson:"user,omitempty"`
	Project   *Project    `bun:"rel:belongs-to,join:project_id=project_id" bson:"project,omitempty"`
}

type UserTeam

type UserTeam struct {
	UserID string      `bun:"type:uuid,pk" json:"user_id" bson:"user_id,omitempty"`
	TeamID string      `bun:"type:uuid,pk" json:"team_id" bson:"team_id,omitempty"`
	User   *SystemUser `bun:"rel:belongs-to,join:user_id=user_id" bson:"user,omitempty"`
	Team   *Team       `bun:"rel:belongs-to,join:team_id=team_id" bson:"team,omitempty"`
}

type UserToTeams

type UserToTeams struct {
	UserID     string      `bun:"type:uuid,pk" json:"user_id,omitempty" firestore:"user_id,omitempty" bson:"user_id,omitempty"`
	SystemUser *SystemUser `` /* 128-byte string literal not displayed */
	TeamID     string      `bun:"type:uuid,pk" json:"team_id,omitempty" firestore:"team_id,omitempty" bson:"team_id,omitempty"`
	Team       *Team       `bun:"rel:belongs-to,join:team_id=id" json:"team,omitempty" firestore:"team,omitempty" bson:"team,omitempty"`
}

type ValidIdentifier added in v1.1.4

type ValidIdentifier struct {
	Label       string
	Identifier  string
	ParentField string
}

type Validation

type Validation struct {
	Required bool `json:"required,omitempty" firestore:"required,omitempty" bson:"required,omitempty"`
	Hide     bool `json:"hide,omitempty" firestore:"hide,omitempty" bson:"hide,omitempty"`
	//AsTitle  bool     `json:"as_title,omitempty" firestore:"as_title,omitempty" bson:"as_title,omitempty"`
	Locals []string `json:"locals,omitempty" firestore:"locals,omitempty" bson:"locals,omitempty"`
	Unique bool     `json:"unique,omitempty" firestore:"unique,omitempty" bson:"unique,omitempty"`

	CharLimit        []uint32  `json:"char_limit,omitempty" firestore:"char_limit,omitempty" bson:"char_limit,omitempty"`
	IntRangeLimit    []uint32  `json:"int_range_limit,omitempty" firestore:"int_range_limit,omitempty" bson:"int_range_limit,omitempty"`
	DoubleRangeLimit []float64 `json:"double_range_limit,omitempty" firestore:"double_range_limit,omitempty" bson:"double_range_limit,omitempty"`

	Placeholder          string        `json:"placeholder,omitempty" firestore:"placeholder,omitempty" bson:"placeholder,omitempty"`
	FixedListElements    []interface{} `json:"fixed_list_elements,omitempty" firestore:"fixed_list_elements,omitempty" bson:"fixed_list_elements,omitempty"`
	FixedListElementType string        `` // if the list element is string or int or float
	/* 127-byte string literal not displayed */

	IsMultiChoice bool `json:"is_multi_choice,omitempty" firestore:"is_multi_choice,omitempty" bson:"is_multi_choice,omitempty"`
	IsEmail       bool `json:"is_email,omitempty" firestore:"is_email,omitempty" bson:"is_email,omitempty"`
	IsGallery     bool `json:"is_gallery,omitempty" firestore:"is_gallery,omitempty" bson:"is_gallery,omitempty"`
	IsPassword    bool `json:"is_password,omitempty" firestore:"is_gallery,omitempty" bson:"is_password,omitempty"`
	//IsSystemRole      bool      `json:"is_system_role,omitempty" firestore:"is_gallery,omitempty" bson:"is_system_role,omitempty"`
	IsURL bool `json:"is_url,omitempty" firestore:"is_url,omitempty" bson:"is_url,omitempty"`
	// hide the field for the roles
	HideForRoles []string `json:"hide_for_roles,omitempty" firestore:"hide_for_roles,omitempty" bson:"hide_for_roles,omitempty"`
}

type Webhook

type Webhook struct {
	ID              string   `json:"id,omitempty" firestore:"id,omitempty" bson:"_id,omitempty"`
	XKey            string   `json:"_key,omitempty" firestore:"_key,omitempty" bson:"_key,omitempty"`
	Type            string   `json:"type,omitempty" firestore:"type,omitempty" bson:"type,omitempty"`
	Model           string   `json:"model,omitempty" firestore:"model,omitempty" bson:"model,omitempty"`
	ProjectID       string   `json:"project_id,omitempty" firestore:"project_id,omitempty" bson:"project_id,omitempty"` //
	Name            string   `json:"name,omitempty" firestore:"name,omitempty" bson:"name,omitempty"`
	Events          []string `json:"events,omitempty" firestore:"events,omitempty" bson:"events,omitempty"`
	URL             string   `json:"url,omitempty" firestore:"url,omitempty" bson:"url,omitempty"`
	LogicExecutions []string `json:"logic_executions,omitempty" firestore:"logic_executions,omitempty" bson:"logic_executions,omitempty"`
}

type WebhookPost

type WebhookPost struct {
	Id      string      `json:"id"`
	Event   string      `json:"event"`
	Model   string      `json:"model"`
	Payload interface{} `json:"payload"`
}

type Workspace

type Workspace struct {
	ProjectID    string `json:"project_id,omitempty" firestore:"project_id,omitempty" bson:"project_id,omitempty"`
	Name         string `json:"name,omitempty" firestore:"name,omitempty" bson:"name,omitempty"`
	Active       bool   `json:"active,omitempty" firestore:"active,omitempty" bson:"active,omitempty"`
	IsProduction bool   `json:"is_production,omitempty" firestore:"is_production,omitempty" bson:"is_production,omitempty"`
	IsDefault    bool   `json:"is_default,omitempty" firestore:"is_default,omitempty" bson:"is_default,omitempty"`
}

type XResponse

type XResponse struct {
	Data       interface{}            `json:"data,omitempty"`
	Errors     json.RawMessage        `json:"errors,omitempty"`
	Extensions map[string]interface{} `json:"extensions,omitempty"`
}

Jump to

Keyboard shortcuts

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