models

package
v1.6.4 Latest Latest
Warning

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

Go to latest
Published: May 6, 2026 License: Apache-2.0 Imports: 17 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package models contains common data structures and models used throughout the Apito engine

Index

Constants

View Source
const (
	// ExtKeyRelationCollectionCheck on CommonSystemParams.Ext makes CheckTableOrCollectionExists
	// probe the relation_* collection for param.Model (resolver ↔ driver contract).
	ExtKeyRelationCollectionCheck = "_apito_relation_collection_check"
	// IndexesRelationCollectionToken in CreateTableOrCollection's indexes slice requests creating
	// the relation edge collection for param.Model instead of the document collection.
	IndexesRelationCollectionToken = "__apito_relation_collection__"
)
View Source
const LegacySQLiteTemplateFilename = "apito_project.db"

LegacySQLiteTemplateFilename is the historical single-file SQLite template name used before GENERAL_SQLITE_FILE_PER_PROJECT (sentinel when deciding to assign a per-project file).

View Source
const MinPasswordLength int = 8

Variables

View Source
var ErrSubscriberNotFound = errors.New("subscriber not found")
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 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 AdminResetPasswordRequest added in v1.5.2

type AdminResetPasswordRequest struct {
	Email       string `json:"email"`
	NewPassword string `json:"new_password"`
	AdminSecret string `json:"admin_secret"`
}

AdminResetPasswordRequest is the body for POST /admin/reset-password (protected by APITO_ADMIN_RESET_SECRET).

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"`
	PluginSchemasRegistered map[string]bool         `json:"-"`

	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 `bun:"type:uuid,pk" json:"id,omitempty" firestore:"id,omitempty" bson:"_id,omitempty"`
	UserID    string `bun:"user_id,type:uuid,nullzero" json:"user_id,omitempty" firestore:"user_id,omitempty" bson:"user_id,omitempty"`
	ProjectID string `bun:"project_id,type:uuid,nullzero" 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"`

	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"`

	// Ext holds opaque extension data populated by the pro layer (e.g. scoping metadata).
	Ext map[string]interface{} `json:"ext,omitempty"`

	// RuntimeConfig is the engine Config pointer for optional hooks (QueryFilterHook, DocumentPreInsertHook)
	// used by drivers and AQL builders. Set on each request from GraphQLServer (see NewParam / GetApplicationCache).
	RuntimeConfig *Config `json:"-"`

	// ProjectSchemaModels is the full project model list (from cache) for SQL drivers that need to reconcile
	// has_many pivot tables against schema (e.g. connection filters). Not serialized.
	ProjectSchemaModels []*ModelType `json:"-"`
}

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"`

	CacheEngine     string `env:"CACHE_DB" env-default:"memory"`
	CacheDBHost     string `env:"CACHE_DB_HOST" env-default:""`
	CacheDBPort     string `env:"CACHE_DB_PORT" env-default:""`
	CacheDBUser     string `env:"CACHE_DB_USER" env-default:""`
	CacheDBPassword string `env:"CACHE_DB_PASSWORD" env-default:""`
	CacheDBName     string `env:"CACHE_DB_NAME" env-default:"apito_cache.db"`

	CacheTTL string `env:"CACHE_TTL" env-default:"600"`

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

	DefaultDatabaseDir string `env:"DEFAULT_DATABASE_DIR" env-default:"~/.apito/db"`

	// System Database Information
	SystemDatabaseEngine string `env:"SYSTEM_DB_ENGINE" env-default:"coredb"`
	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_system.db"`

	// GeneralPostgresIsolation: "database" (default, CREATE DATABASE per project) or "schema" (CREATE SCHEMA + search_path on shared database name stored on the project driver).
	GeneralPostgresIsolation string `env:"GENERAL_POSTGRES_ISOLATION" env-default:"database"`
	// GeneralSQLiteFilePerProject uses utility.SQLiteProjectFileName(project_id) under DefaultDatabaseDir for new SQLite general projects using default template credentials.
	GeneralSQLiteFilePerProject bool `env:"GENERAL_SQLITE_FILE_PER_PROJECT" env-default:"false"`
	// GeneralMySQLIsolation is only "database" supported: MySQL/MariaDB use CREATE DATABASE per project (no PG-style shared-schema mode in this engine).
	GeneralMySQLIsolation string `env:"GENERAL_MYSQL_ISOLATION" env-default:"database"`

	KVStorageEngine         string `env:"KV_ENGINE" env-default:"coredb"`
	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:"apito_kv.db"`

	QueueStorageEngine         string `env:"QUEUE_ENGINE" env-default:"coredb"`
	QueueStorageEngineHost     string `env:"QUEUE_HOST" env-default:""`
	QueueStorageEnginePort     string `env:"QUEUE_PORT" env-default:""`
	QueueStorageEngineUser     string `env:"QUEUE_USER" env-default:""`
	QueueStorageEnginePassword string `env:"QUEUE_PASSWORD" env-default:""`
	QueueStorageEngineDatabase string `env:"QUEUE_DATABASE" env-default:"apito_queue.db"`

	// 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:""`

	// Admin password reset: secret required to call POST /admin/reset-password (e.g. set in ~/.apito/bin/.env)
	AdminResetSecret string `env:"APITO_ADMIN_RESET_SECRET" env-default:""`

	// Optional driver factory for dependency injection. If nil, built-in defaults are used.
	DriverFactory interface{} `env:"-"` // Will be type-asserted to DatabaseDriverFactory

	// DatabaseCheckWrapper optionally wraps the system database check HTTP handler.
	// Type: func(auth any) echo.HandlerFunc (router type-asserts; avoids importing echo here).
	DatabaseCheckWrapper interface{} `env:"-"`

	// ConnectionRoutingHook returns a scope key for sub-project connection isolation.
	// If it returns (key, true) with a non-empty key, the executor uses a scoped connection.
	ConnectionRoutingHook func(ctx context.Context, projectID string) (scopeKey string, ok bool) `env:"-"`

	// QueryFilterHook returns additional filters to apply before every query (e.g. row-level isolation).
	QueryFilterHook func(ctx context.Context, params *CommonSystemParams) []*QueryFilter `env:"-"`

	// DocumentPreInsertHook is called before a document is inserted; can mutate the document or return an error.
	DocumentPreInsertHook func(ctx context.Context, params *CommonSystemParams, doc map[string]interface{}) error `env:"-"`

	// DocumentPreInsertDocHook is called after the driver builds *types.DefaultDocumentStructure and before persist.
	// Pro may mutate the struct; open-core must not interpret field semantics.
	DocumentPreInsertDocHook func(ctx context.Context, params *CommonSystemParams, doc *types.DefaultDocumentStructure) error `env:"-"`

	// PostTokenValidateHook runs after token validation succeeds (bearer or cookie path).
	// Pro may read scopes/headers/cookies and stamp echo context; open-core stays policy-free.
	PostTokenValidateHook func(ctx echo.Context, claims *TokenClaims) `env:"-"`

	// DDLPostCreateHook is called after a model table/collection is created; can add columns or indexes.
	DDLPostCreateHook func(ctx context.Context, project *Project, model *ModelType, dbHandle interface{}) error `env:"-"`

	// PostDocumentInsertHook is called after a document is successfully inserted.
	PostDocumentInsertHook func(ctx context.Context, params *CommonSystemParams, docID string) error `env:"-"`

	// SchemaIterateHook is called when a schema change needs to propagate to sub-project databases.
	SchemaIterateHook func(ctx context.Context, project *Project, fn func(ctx context.Context, driver interface{}) error) error `env:"-"`

	// TokenClaimsHook allows the pro layer to inject additional claims into JWT/token payloads.
	TokenClaimsHook func(project *Project, claims map[string]interface{}) `env:"-"`

	// ProjectAPITokenClaimsHook allows optional claim enrichment before project API key issuance.
	// Open-core stays policy-free and simply invokes this hook when set.
	ProjectAPITokenClaimsHook func(ctx echo.Context, project *Project, claims *TokenClaims) `env:"-"`

	// EnsureScopedDatabaseHook runs before default scoped DB creation (e.g. Postgres/MySQL per-scope isolation).
	EnsureScopedDatabaseHook func(ctx context.Context, projectID string, base, derived *DriverCredentials) error `env:"-"`

	// LoadProjectCacheHook allows the pro layer to modify a project after loading from the system DB.
	LoadProjectCacheHook func(ctx context.Context, project *Project) `env:"-"`

	// NamingV2ArangoPerModelCollections is used when applying Arango naming V2 physical migration:
	// true means one document collection per model layout; false uses a single p_{projectId} bucket.
	NamingV2ArangoPerModelCollections func(ctx context.Context, project *Project) bool `env:"-"`

	// NamingV2RelationTenantModel returns the tenant root model name for relation edges (e.g. "restaurant").
	// When set, Arango naming migration moves legacy root-level tenant_id into ext and sets ext.tenant_model.
	NamingV2RelationTenantModel func(ctx context.Context, project *Project) string `env:"-"`

	// BuildSystemParamHook allows the pro layer to enrich CommonSystemParams after the base build.
	BuildSystemParamHook func(ctx context.Context, project *Project, param *CommonSystemParams) `env:"-"`

	// InitProjectBaseHook is for extending the project base initialization.
	// driver is the concrete ProjectDBInterface implementation. Default when nil: type-assert and call InitProjectBase.
	InitProjectBaseHook func(ctx context.Context, driver interface{}, param *CommonSystemParams) error `env:"-"`

	// ProjectTypeForClaims maps open-core Project to a JWT "project_type" value (e.g. int32). OSS leaves nil and JWT uses "general".
	ProjectTypeForClaims func(*Project) interface{} `env:"-"`

	// PostApplicationCacheHook runs after GetApplicationCache assembles cache (param, ctx, plugins).
	// Pro may enrich cache.Ctx / cache.Param here so resolvers using the embedded *GraphQLServer see the same context
	// as the outer server. Type: func(echo.Context, *ApplicationCache).
	PostApplicationCacheHook interface{} `env:"-"`

	// SchemaObjectsExtensionHook runs inside BuildServerQueriesAndMutations right after
	// InitPrivateObjects(). The pro layer uses it to AddFieldConfig on core schema objects
	// (e.g. ModelType, ProjectModel) before the schema is sent through channels.
	SchemaObjectsExtensionHook func(objs interface{}) `env:"-"`

	// MaxModelsPerProject caps models processed by publicSchemaBuilder (0 = no limit).
	MaxModelsPerProject int `env:"MAX_MODELS_PER_PROJECT" env-default:"0"`

	// EnableCompiledSchemaCache caches pre-connection GraphQL shape (fingerprint: project + role + schema).
	EnableCompiledSchemaCache bool `env:"ENABLE_COMPILED_SCHEMA_CACHE" env-default:"false"`

	// EnableClosureFreeResolvers reserved for future resolver refactors (relation fields).
	EnableClosureFreeResolvers bool `env:"ENABLE_CLOSURE_FREE_RESOLVERS" env-default:"false"`

	// RoleAgnosticSchemaCache builds one superset schema per project (pre-connection cache key omits role); resolvers enforce real role.
	RoleAgnosticSchemaCache bool `env:"ROLE_AGNOSTIC_SCHEMA_CACHE" env-default:"false"`

	// AdjustPublicSchemaForRequestHook runs after collectFilteredModelsForPublicSchema and may
	// mutate permissions and filteredModels (e.g. tenant-scoped public API shape). When set,
	// the compiled public schema cache fingerprint includes the effective API permission map.
	AdjustPublicSchemaForRequestHook func(ctx context.Context, cache *ApplicationCache, project *Project, permissions map[string]*APIPermission, filteredModels []*PublicSchemaModelFilter) error `env:"-"`

	// SchemaBuildTelemetry emits OTel spans around publicSchemaBuilder when true.
	SchemaBuildTelemetry bool `env:"SCHEMA_BUILD_TELEMETRY" env-default:"true"`

	// SchemaBuildMetrics registers OTel counter schema_build_total and histogram schema_build_duration_seconds.
	SchemaBuildMetrics bool `env:"SCHEMA_BUILD_METRICS" env-default:"false"`

	// MetricsEnabled gates apito_* OpenTelemetry instruments (HTTP, GraphQL, pool, DB decorator, cache, KV, queue, session).
	// When false, telemetry helpers no-op. When true, instruments record if a global MeterProvider is registered (OSS or extended builds).
	MetricsEnabled bool `env:"METRICS_ENABLED" env-default:"true"`

	// SystemMetricsToken is an optional Bearer secret compared by the router when a build exposes a protected metrics scrape path.
	// Open-core does not mount that route; deployments that add one should set this in production.
	SystemMetricsToken string `env:"SYSTEM_METRICS_TOKEN" env-default:""`

	// OTELExporterOTLPEndpoint optional OTLP HTTP endpoint for traces. Empty disables OTLP trace export for builds that wire a TracerProvider.
	OTELExporterOTLPEndpoint string `env:"OTEL_EXPORTER_OTLP_ENDPOINT" env-default:""`
}

func (*Config) StorageEnginesSummary added in v1.6.3

func (c *Config) StorageEnginesSummary() string

StorageEnginesSummary returns one line listing configured storage engines (no hosts, secrets, or DSNs). Use in production logs to verify SYSTEM_DB_ENGINE, CACHE_DB, KV_ENGINE, and QUEUE_ENGINE.

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 embedded database
	DatabaseDir string `json:"database_dir,omitempty" bson:"database_dir,omitempty"`
	// for sqlite and other file based databases
	File string `json:"file,omitempty" bson:"file,omitempty"`
	// Schema is the PostgreSQL schema name for per-project isolation when GENERAL_POSTGRES_ISOLATION=schema
	// (shared database from Database field, separate schema per project). Ignored for non-Postgres engines.
	Schema string `json:"schema,omitempty" bson:"schema,omitempty"`
	// SSLMode for PostgreSQL when the server requires TLS. Empty defaults to disable in DSN builder.
	SSLMode string `json:"ssl_mode,omitempty" bson:"ssl_mode,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"`
	Ext         map[string]interface{} `json:"ext,omitempty" bson:"ext,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"`
}

FileLink represents a file link with metadata

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"`
	// ProDriverExtras is pro-binary-only metadata (e.g. *ProDriverCredentials) for project drivers that need secrets outside DriverCredentials. Not serialized.
	ProDriverExtras interface{} `json:"-" bson:"-"`
}

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"`
	Ext          map[string]interface{} `json:"ext,omitempty"`
}

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"`
	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            `bun:"type:text,pk" 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"`
	EnableRevision  bool              `json:"enable_revision,omitempty" firestore:"enable_revision,omitempty" bson:"enable_revision,omitempty"`
	RevisionFilter  []*KeyValue       `json:"revision_filter,omitempty" firestore:"revision_filter,omitempty" bson:"revision_filter,omitempty"`

	// Ext holds opaque extension data populated by the extension layer (e.g. model classification metadata).
	Ext map[string]interface{} `json:"ext,omitempty" firestore:"ext,omitempty" bson:"ext,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"`
	// Owner/creator FK for SystemUser.Organization has-many (join:id=user_id).
	UserID string        `bun:"user_id,type:uuid" json:"user_id,omitempty" firestore:"user_id,omitempty" bson:"user_id,omitempty"`
	Teams  []*Team       `bun:"m2m:organization_teams,join:Organization=Team" json:"teams,omitempty" firestore:"teams,omitempty" bson:"teams,omitempty"`
	Users  []*SystemUser `bun:"m2m:user_organizations,join:Organization=User" json:"users,omitempty" firestore:"users,omitempty" bson:"users,omitempty"`
}

type OrganizationTeam added in v1.6.1

type OrganizationTeam struct {
	OrganizationID string        `bun:"type:uuid,pk" json:"organization_id,omitempty" firestore:"organization_id,omitempty" bson:"organization_id,omitempty"`
	TeamID         string        `bun:"type:uuid,pk" json:"team_id,omitempty" firestore:"team_id,omitempty" bson:"team_id,omitempty"`
	AssignedBy     string        `` /* 128-byte string literal not displayed */
	AssignedAt     string        `` /* 133-byte string literal not displayed */
	Organization   *Organization `` /* 139-byte string literal not displayed */
	Team           *Team         `bun:"rel:belongs-to,join:team_id=id" json:"team,omitempty" firestore:"team,omitempty" bson:"team,omitempty"`
}

OrganizationTeam is the SQL join row for organization ↔ team (see organization_teams).

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     []*SavedPluginDetails `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 []*ProjectToken `bun:"rel:has-many" json:"tokens,omitempty" firestore:"tokens,omitempty" bson:"tokens,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"`

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

	ProjectSecretKey string `json:"project_secret_key,omitempty" firestore:"project_secret_key,omitempty" bson:"project_secret_key,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"`
	// NamingSchemaVersion 0 = legacy; 1 = canonical snake_case model ids (see utility.NamingSchemaVersionV2).
	NamingSchemaVersion int `json:"naming_schema_version,omitempty" firestore:"naming_schema_version,omitempty" bson:"naming_schema_version,omitempty"`
}

type ProjectSettings

type ProjectSettings struct {
	bun.BaseModel `bun:"table:project_settings"`

	ProjectID             string   `bun:"type:uuid,pk" json:"project_id,omitempty" firestore:"project_id,omitempty" bson:"_id,omitempty"`
	Locals                []string `bun:"type:json,nullzero" json:"locals,omitempty" firestore:"locals,omitempty" bson:"locals,omitempty"`
	SystemGraphqlHooks    bool     `` /* 133-byte string literal not displayed */
	EnableRevisionHistory bool     `` /* 135-byte string literal not displayed */

	DefaultStoragePlugin  string `` /* 140-byte string literal not displayed */
	DefaultFunctionPlugin string `` /* 143-byte string literal not displayed */

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

type ProjectToken added in v1.2.1

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

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 PublicSchemaModelFilter added in v1.6.1

type PublicSchemaModelFilter struct {
	Model             *ModelType
	Filter            *FilteredModel
	HasMetaQuery      bool
	IsDataloaderModel bool
	KnownAs           string
}

PublicSchemaModelFilter is one model (plus optional request filter metadata) participating in a public GraphQL schema build.

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"`

	FinalQuery string `json:"final_query"`

	Ext map[string]interface{} `json:"ext,omitempty"`

	// RuntimeConfig and HookParam wire QueryFilterHook from AQL builder without importing drivers.
	RuntimeConfig *Config             `json:"-"`
	HookParam     *CommonSystemParams `json:"-"`
}

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 SavedPluginDetails added in v1.5.0

type SavedPluginDetails struct {
	ProjectID      string                         `bun:"type:uuid,notnull" json:"project_id,omitempty" firestore:"project_id,omitempty" bson:"project_id,omitempty"`
	ID             string                         `json:"id,omitempty" firestore:"id,omitempty" bson:"id,omitempty"`
	EnvVars        []*protobuff.EnvVariable       `json:"env_vars,omitempty" firestore:"env_vars,omitempty" bson:"env_vars,omitempty"`
	ActivateStatus protobuff.PluginActivateStatus `json:"activate_status,omitempty" firestore:"activate_status,omitempty" bson:"activate_status,omitempty"`
	LoadStatus     protobuff.PluginLoadStatus     `json:"load_status,omitempty" firestore:"load_status,omitempty" bson:"load_status,omitempty"`
	Enable         bool                           `json:"enable,omitempty" firestore:"enable,omitempty" bson:"enable,omitempty"`
}

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
	IsActive bool
}

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 SyncToken added in v1.2.1

type SyncToken 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"`
	CreatedAt string `json:"created_at,omitempty" firestore:"created_at,omitempty" bson:"created_at,omitempty"`
	// extra information
	ProjectIDs []string `json:"project_ids,omitempty" firestore:"project_ids,omitempty" bson:"project_ids,omitempty"`
	Scopes     []string `json:"scopes,omitempty" firestore:"scopes,omitempty" bson:"scopes,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"`

	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"`

	// Stored as JSON in SQL (nested document); not a separate sync_token table (avoids invalid has-many FK).
	SyncTokens []*SyncToken `bun:"type:jsonb,nullzero" json:"sync_tokens,omitempty" firestore:"sync_tokens,omitempty" bson:"sync_tokens,omitempty"`

	DefaultTeamID         string        `` /* 135-byte string literal not displayed */
	DefaultOrganizationID string        `` /* 131-byte string literal not displayed */
	DefaultTeam           *Team         `` /* 139-byte string literal not displayed */
	DefaultOrganization   *Organization `` /* 162-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_teams,join:User=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"`
	LinkedAt  string   `bun:"linked_at,type:timestamp,nullzero" json:"linked_at,omitempty" bson:"linked_at,omitempty"`
	Team      *Team    `bun:"rel:belongs-to,join:team_id=id" bson:"team,omitempty"`
	Project   *Project `bun:"rel:belongs-to,join:project_id=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"`

	TokenType      string `json:"token_type"`       // access_token or id_token
	PaymentDueDate string `json:"payment_due_date"` // used if the user dosnt pay

	ExpireAt int64 `json:"expire_at"` // unix timestamp

	ProjectIDs []string               `json:"project_ids"` // ['project_id_1', 'project_id_2']
	Scopes     []string               `json:"scopes"`      // ['read', 'write']
	Ext        map[string]interface{} `json:"ext,omitempty"`
}

func (*TokenClaims) HasAllScopes added in v1.2.1

func (claims *TokenClaims) HasAllScopes(scopes []string) bool

HasAllScopes checks if token has all of the specified scopes

func (*TokenClaims) HasAnyScope added in v1.2.1

func (claims *TokenClaims) HasAnyScope(scopes []string) bool

HasAnyScope checks if token has any of the specified scopes

func (*TokenClaims) HasScope added in v1.2.1

func (claims *TokenClaims) HasScope(scope string) bool

HasScope checks if token has a specific scope

func (*TokenClaims) IsExpired added in v1.2.1

func (claims *TokenClaims) IsExpired() bool

IsExpired checks if token is expired

func (*TokenClaims) TimeRemaining added in v1.2.1

func (claims *TokenClaims) TimeRemaining() int64

TimeRemaining returns seconds until token expires

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 UserOrganization added in v1.6.1

type UserOrganization struct {
	UserID         string        `bun:"type:uuid,pk" json:"user_id,omitempty" firestore:"user_id,omitempty" bson:"user_id,omitempty"`
	OrganizationID string        `bun:"type:uuid,pk" json:"organization_id,omitempty" firestore:"organization_id,omitempty" bson:"organization_id,omitempty"`
	Role           string        `bun:"role,type:text,nullzero" json:"role,omitempty" firestore:"role,omitempty" bson:"role,omitempty"`
	JoinedAt       string        `bun:"joined_at,type:timestamp,nullzero" json:"joined_at,omitempty" firestore:"joined_at,omitempty" bson:"joined_at,omitempty"`
	User           *SystemUser   `bun:"rel:belongs-to,join:user_id=id" json:"user,omitempty" firestore:"user,omitempty" bson:"user,omitempty"`
	Organization   *Organization `` /* 139-byte string literal not displayed */
}

UserOrganization is the SQL join row for user ↔ organization membership (see user_organizations).

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"`
	Role        string      `bun:"role,type:text,nullzero" json:"role,omitempty" bson:"role,omitempty"`
	Permissions string      `bun:"permissions,type:text,nullzero" json:"permissions,omitempty" bson:"permissions,omitempty"`
	User        *SystemUser `bun:"rel:belongs-to,join:user_id=id" bson:"user,omitempty"`
	Project     *Project    `bun:"rel:belongs-to,join:project_id=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=id" bson:"user,omitempty"`
	Team   *Team       `bun:"rel:belongs-to,join:team_id=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   `bun:"id,type:uuid,pk" 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   `bun:"project_id,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"`
	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