commons

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	INTEGRATION_TYPE = "integration_type"
	INTEGRATION_ID   = "integration_id"
)

Variables

View Source
var (
	AllowedIntegrations = []IntegrationType{Github, Gitlab, Vercel, ASM, CircleCI, GSM, Supabase, Netlify}
)

Functions

func DecryptCredentials

func DecryptCredentials(ctx context.ServiceContext, org_id string, payload []byte) ([]byte, error)

func EncryptCredentials

func EncryptCredentials(ctx context.ServiceContext, org_id string, payload map[string]interface{}) ([]byte, error)

Types

type AddIntegrationOptions

type AddIntegrationOptions struct {

	//	Global
	OrgID          string          `json:"org_id"`
	InstallationID string          `json:"installation_id"`
	Type           IntegrationType `json:"type"`

	//	Especially for Vercel
	Credentials string                 `json:"credentials,omitempty"`
	Scope       map[string]interface{} `json:"scope,omitempty"`
}

type Entities

type Entities []Entity

type Entity

type Entity struct {
	ID             string          `json:"id"`
	Slug           string          `json:"slug"`
	ParentName     string          `json:"parent_name"`
	Name           string          `json:"name"`
	URL            string          `json:"url"`
	InstallationID string          `json:"installation_id"`
	Type           IntegrationType `json:"type"`
}

type Integration

type Integration struct {
	ID             string          `json:"id,omitempty" graphql:"id,omitempty"`
	CreatedAt      time.Time       `json:"created_at,omitempty" graphql:"created_at,omitempty"`
	UpdatedAt      time.Time       `json:"updated_at,omitempty" graphql:"updated_at,omitempty"`
	UserID         string          `json:"user_id,omitempty" graphql:"user_id,omitempty"`
	OrgID          string          `json:"org_id"`
	InstallationID string          `json:"installation_id"`
	Type           IntegrationType `json:"type"`
	Credentials    string          `json:"credentials,omitempty"`
}

func (*Integration) GetDescription

func (i *Integration) GetDescription() string

Get the description of the integration by it's type.

func (*Integration) GetSubtitle

func (i *Integration) GetSubtitle() string

Get the subtitle of the integration by it's type.

func (*Integration) GetTitle

func (i *Integration) GetTitle() string

Get the title of the integration by it's type.

type IntegrationType

type IntegrationType string
const (
	Github   IntegrationType = "github"
	Gitlab   IntegrationType = "gitlab"
	Vercel   IntegrationType = "vercel"
	ASM      IntegrationType = "asm"
	GSM      IntegrationType = "gsm"
	CircleCI IntegrationType = "circleci"
	Supabase IntegrationType = "supabase"
	Netlify  IntegrationType = "netlify"
)

func (*IntegrationType) IsValid

func (t *IntegrationType) IsValid() bool

type Integrations

type Integrations []Integration

type ListEntitiesRequest

type ListEntitiesRequest struct {
	OrgID string          `json:"org_id"`
	Type  IntegrationType `json:"type"`
}

type ListEntitiesRequestOptions

type ListEntitiesRequestOptions struct {
	OrgID          string          `json:"org_id"`
	Type           IntegrationType `json:"type"`
	InstallationID string          `json:"installation_id"`
}

type ListIntegrationFilters

type ListIntegrationFilters struct {
	OrgID string          `json:"org_id"`
	Type  IntegrationType `json:"type"`
}

type OauthAuthResponse

type OauthAuthResponse struct {
	AccessToken  string `json:"access_token"`
	RefreshToken string `json:"refresh_token"`
	ExpiresIn    string `json:"expires_in"`
	Scope        string `json:"scope"`
	TokenType    string `json:"token_type"`
}

type SetupOptions

type SetupOptions struct {
	Options map[string]interface{} `json:"options"`
	OrgID   string                 `json:"org_id"`
}

type SyncOptions

type SyncOptions struct {
	EventID       string                 `json:"event_id"`
	IntegrationID string                 `json:"integration_id"`
	EntityDetails map[string]interface{} `json:"entity_details"`
	Data          *keypayload.KPMap      `json:"data"`
}

type UpdateCredentialsOptions

type UpdateCredentialsOptions struct {
	ID          string `json:"id"`
	Credentials string `json:"credentials"`
}

type UpdateDetailsOptions

type UpdateDetailsOptions struct {
	ID            string                 `json:"id"`
	EntityDetails map[string]interface{} `json:"entity_details"`
}

Jump to

Keyboard shortcuts

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