Documentation ¶
Index ¶
- Variables
- func Clone(data []byte, depMapping map[uuids.UUID]uuids.UUID) ([]byte, error)
- func GetObjectUUID(o any) uuids.UUID
- func MigrateToLatest(data []byte, cfg *Config) ([]byte, error)
- func MigrateToVersion(data []byte, to *semver.Version, cfg *Config) ([]byte, error)
- func Registered() map[*semver.Version]MigrationFunc
- func RewriteTemplates(f Flow, catalog *TemplateCatalog, tx func(string) string)
- type Action
- type Config
- type Flow
- func Migrate13_1(f Flow, cfg *Config) (Flow, error)
- func Migrate13_2(f Flow, cfg *Config) (Flow, error)
- func Migrate13_3(f Flow, cfg *Config) (Flow, error)
- func Migrate13_4(f Flow, cfg *Config) (Flow, error)
- func Migrate13_5(f Flow, cfg *Config) (Flow, error)
- func Migrate13_6(f Flow, cfg *Config) (Flow, error)
- func Migrate13_6_1(f Flow, cfg *Config) (Flow, error)
- func ReadFlow(data []byte) (Flow, error)
- type Header13
- type ItemTranslation
- type LanguageTranslation
- type Localization
- type MigrationFunc
- type Node
- type Router
- type TemplateCatalog
Constants ¶
This section is empty.
Variables ¶
var DefaultConfig = &Config{}
Functions ¶
func Clone ¶ added in v0.63.0
Clone clones the given flow definition by replacing all UUIDs using the provided mapping and generating new random UUIDs if they aren't in the mapping
func GetObjectUUID ¶ added in v0.204.0
GetObjectUUID gets the UUID property of o, if o is an object, if it has "uuid" property, and if the type of that property is a string
func MigrateToLatest ¶
MigrateToLatest migrates the given flow definition to the latest version
func MigrateToVersion ¶
MigrateToVersion migrates the given flow definition to the given version
func Registered ¶
func Registered() map[*semver.Version]MigrationFunc
Registered gets all registered migrations
func RewriteTemplates ¶ added in v0.204.0
func RewriteTemplates(f Flow, catalog *TemplateCatalog, tx func(string) string)
Types ¶
type Config ¶
type Config struct {
BaseMediaURL string
}
Config configures how flow migrations are handled
type Flow ¶
Flow holds a flow definition
func Migrate13_1 ¶
Migrate13_1 adds a `uuid` property to templating objects in [action:send_msg] actions.
@version 13_1 "13.1"
func Migrate13_2 ¶ added in v0.179.0
Migrate13_2 replaces `base` as a flow language with `und` which indicates text with undetermined language in the ISO-639-3 standard.
@version 13_2 "13.2"
func Migrate13_3 ¶ added in v0.204.0
Migrate13_3 refactors template expressions that reference @webhook to use @webhook.json
@version 13_3 "13.3"
func Migrate13_4 ¶ added in v0.206.0
Migrate13_4 converts the `templating` object in [action:send_msg] actions to use a list of components.
@version 13_4 "13.4"
func Migrate13_5 ¶ added in v0.210.0
Migrate13_5 converts the `templating` object in [action:send_msg] actions to use a merged list of variables.
@version 13_5 "13.5"
func Migrate13_6 ¶ added in v0.225.0
Migrate13_6 ensures that names of results and categories respect definition limits.
@version 13_6 "13.6"
func Migrate13_6_1 ¶ added in v0.225.3
Migrate13_6_1 fixes result lookups that need to be truncated.
@version 13_6_1 "13.6.1"
func (Flow) Localization ¶ added in v0.179.0
func (f Flow) Localization() Localization
Localization returns the localization of this flow
type Header13 ¶
type Header13 struct { UUID assets.FlowUUID `json:"uuid" validate:"required,uuid4"` Name string `json:"name"` SpecVersion *semver.Version `json:"spec_version" validate:"required"` }
Header13 is the set of fields common to all 13+ flow spec versions
type ItemTranslation ¶ added in v0.204.0
func (ItemTranslation) Delete ¶ added in v0.206.0
func (it ItemTranslation) Delete(property string)
func (ItemTranslation) Get ¶ added in v0.204.0
func (it ItemTranslation) Get(property string) []string
func (ItemTranslation) Set ¶ added in v0.204.0
func (it ItemTranslation) Set(property string, trans []string)
type LanguageTranslation ¶ added in v0.204.0
func (LanguageTranslation) DeleteTranslation ¶ added in v0.206.0
func (lt LanguageTranslation) DeleteTranslation(uuid uuids.UUID, property string)
func (LanguageTranslation) GetTranslation ¶ added in v0.206.0
func (lt LanguageTranslation) GetTranslation(uuid uuids.UUID, property string) []string
func (LanguageTranslation) SetTranslation ¶ added in v0.206.0
func (lt LanguageTranslation) SetTranslation(uuid uuids.UUID, property string, trans []string)
type Localization ¶ added in v0.179.0
func (Localization) GetLanguageTranslation ¶ added in v0.204.0
func (l Localization) GetLanguageTranslation(lang i18n.Language) LanguageTranslation
func (Localization) Languages ¶ added in v0.204.0
func (l Localization) Languages() []i18n.Language
type MigrationFunc ¶
MigrationFunc is a function that can migrate a flow definition from one version to another
type TemplateCatalog ¶ added in v0.204.0
type TemplateCatalog struct { Actions map[string][]string `json:"actions"` Routers map[string][]string `json:"routers"` }
func GetTemplateCatalog ¶ added in v0.204.0
func GetTemplateCatalog(v *semver.Version) *TemplateCatalog