app

package
v0.0.0-...-113aa42 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetManifestEnvTeamVars

func SetManifestEnvTeamVars(manifestEnv map[string]string, appTeamDomain string, isDev bool) map[string]string

SetManifestEnvTeamVars sets environment variables that may affect app manifest values

func UpdateDefaultProjectFiles

func UpdateDefaultProjectFiles(fs afero.Fs, dirPath string, appDirName string) error

UpdateDefaultProjectFiles should update any project specific files if any

Types

type AppClient

type AppClient struct {
	// contains filtered or unexported fields
}

AppClient reflects the states of the project's apps files and keeps track of all deployed and dev apps

func NewAppClient

func NewAppClient(config *config.Config, fs afero.Fs, os types.Os) *AppClient

NewAppClient returns a new, empty instance of the AppClient TODO(@mbrooks) - Should this constructor read the file (looks like all public funcs always read first)?

func (*AppClient) CleanUp

func (ac *AppClient) CleanUp()

CleanUp will first read the contents of apps*.json files and if empty, it would delete these files. It will also go ahead to delete the .slack folder if it is also empty.

func (*AppClient) GetDeployed

func (ac *AppClient) GetDeployed(ctx context.Context, teamID string) (types.App, error)

GetDeployed returns a deployed App by its team ID

IMPORTANT: Pass an explicit teamID in all cases! Legacy behavior will rely on a default team domain used to mark a current app, but it is not a safe action.

func (*AppClient) GetDeployedAll

func (ac *AppClient) GetDeployedAll(ctx context.Context) ([]types.App, string, error)

GetDeployedAll returns all deployed apps (does not include dev apps)

func (*AppClient) GetLocal

func (ac *AppClient) GetLocal(ctx context.Context, teamID string) (types.App, error)

GetLocal returns the local app for the provided teamID

func (*AppClient) GetLocalAll

func (ac *AppClient) GetLocalAll(ctx context.Context) ([]types.App, error)

GetLocalAll returns all local apps

func (*AppClient) NewDeployed

func (ac *AppClient) NewDeployed(ctx context.Context, teamID string) (types.App, error)

NewDeployed returns a new App named for the provided teamID

func (*AppClient) Remove

func (ac *AppClient) Remove(ctx context.Context, app types.App) (types.App, error)

Remove takes the app out of the saved project apps.*.json file

func (*AppClient) RemoveDeployed

func (ac *AppClient) RemoveDeployed(ctx context.Context, teamID string) (types.App, error)

RemoveDeployed removes the app with teamID from the apps.json file

func (*AppClient) RemoveLocal

func (ac *AppClient) RemoveLocal(ctx context.Context, teamID string) (types.App, error)

RemoveLocal removes the app with the provided teamID from apps.dev.json

func (*AppClient) SaveDeployed

func (ac *AppClient) SaveDeployed(ctx context.Context, app types.App) error

SaveDeployed saves the provided app to the deployed apps file

func (*AppClient) SaveLocal

func (ac *AppClient) SaveLocal(ctx context.Context, app types.App) error

SaveLocal saves the provided app as the local app for the provided teamID

type AppClientInterface

type AppClientInterface interface {
	NewDeployed(ctx context.Context, teamID string) (types.App, error)
	GetDeployed(ctx context.Context, teamID string) (types.App, error)
	GetDeployedAll(ctx context.Context) ([]types.App, string, error)
	GetLocal(ctx context.Context, teamID string) (types.App, error)
	GetLocalAll(ctx context.Context) ([]types.App, error)
	RemoveDeployed(ctx context.Context, teamID string) (types.App, error)
	RemoveLocal(ctx context.Context, teamID string) (types.App, error)
	SaveDeployed(ctx context.Context, app types.App) error
	SaveLocal(ctx context.Context, app types.App) error

	Remove(ctx context.Context, app types.App) (types.App, error)
	CleanUp()
}

type AppClientMock

type AppClientMock struct {
	mock.Mock
}

func (*AppClientMock) CleanUp

func (m *AppClientMock) CleanUp()

func (*AppClientMock) GetDeployed

func (m *AppClientMock) GetDeployed(ctx context.Context, teamID string) (types.App, error)

func (*AppClientMock) GetDeployedAll

func (m *AppClientMock) GetDeployedAll(ctx context.Context) ([]types.App, string, error)

func (*AppClientMock) GetLocal

func (m *AppClientMock) GetLocal(ctx context.Context, teamID string) (types.App, error)

func (*AppClientMock) GetLocalAll

func (m *AppClientMock) GetLocalAll(ctx context.Context) ([]types.App, error)

func (*AppClientMock) NewDeployed

func (m *AppClientMock) NewDeployed(ctx context.Context, teamID string) (types.App, error)

func (*AppClientMock) Remove

func (m *AppClientMock) Remove(ctx context.Context, app types.App) (types.App, error)

func (*AppClientMock) RemoveDeployed

func (m *AppClientMock) RemoveDeployed(ctx context.Context, teamID string) (types.App, error)

func (*AppClientMock) RemoveLocal

func (m *AppClientMock) RemoveLocal(ctx context.Context, userID string) (types.App, error)

func (*AppClientMock) SaveDeployed

func (m *AppClientMock) SaveDeployed(ctx context.Context, app types.App) error

func (*AppClientMock) SaveLocal

func (m *AppClientMock) SaveLocal(ctx context.Context, app types.App) error

type Client

type Client struct {
	Manifest ManifestClientInterface
	AppClientInterface
}

Client to access the app/project

func NewClient

func NewClient(
	apiClient api.APIInterface,
	config *config.Config,
	fs afero.Fs,
	os types.Os,
) *Client

NewClient returns a client with access to the API

type ManifestClient

type ManifestClient struct {
	Env map[string]string
	// contains filtered or unexported fields
}

ManifestClient can manage the state of the project's app manifest file

func NewManifestClient

func NewManifestClient(
	apiClient api.APIInterface,
	config *config.Config,
) *ManifestClient

NewManifestClient returns a new, empty instance of the ManifestClient

func (*ManifestClient) GetManifestLocal

func (c *ManifestClient) GetManifestLocal(ctx context.Context, sdkConfig hooks.SDKCLIConfig, hookExecutor hooks.HookExecutor) (types.SlackYaml, error)

GetManifestLocal gathers manifest content from the "get-manifest" hook

func (*ManifestClient) GetManifestRemote

func (c *ManifestClient) GetManifestRemote(ctx context.Context, token string, appID string) (types.SlackYaml, error)

GetManifestRemote retrieves the current app manifest from app settings

type ManifestClientInterface

type ManifestClientInterface interface {
	GetManifestLocal(ctx context.Context, sdkConfig hooks.SDKCLIConfig, hookExecutor hooks.HookExecutor) (types.SlackYaml, error)
	GetManifestRemote(ctx context.Context, token string, appID string) (types.SlackYaml, error)
}

type ManifestMockObject

type ManifestMockObject struct {
	mock.Mock
}

func (*ManifestMockObject) GetManifestLocal

func (m *ManifestMockObject) GetManifestLocal(ctx context.Context, sdkConfig hooks.SDKCLIConfig, hookExecutor hooks.HookExecutor) (types.SlackYaml, error)

func (*ManifestMockObject) GetManifestRemote

func (m *ManifestMockObject) GetManifestRemote(ctx context.Context, token string, appID string) (types.SlackYaml, error)

Jump to

Keyboard shortcuts

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