Documentation ¶
Index ¶
- Constants
- func AddExportToTypesDeclarations(tsSource string) string
- func CallWorkerApi(c model.IntFlagProvider, params ApiCallParams) error
- func CleanImports(source string) string
- func CloseQuietly(c io.Closer)
- func DecryptManifestSecrets(mf *model.Manifest, withPassword ...string) error
- func DecryptSecret(password string, encryptedValue string) (string, error)
- func EncryptSecret(password string, secretValue string) (string, error)
- func ExtractActionUsedTypes(md *model.ActionMetadata) []string
- func ExtractProjectAndKeyFromCommandContext(c stringFlagAware, args []string, minArguments int, onlyGeneric bool) (string, string, error)
- func ExtractUsedTypes(tsSource string) []string
- func FetchWorkerDetails(c model.IntFlagProvider, serverUrl string, accessToken string, ...) (*model.WorkerDetails, error)
- func NewCsvWriter() *csv.Writer
- func PrepareSecretsUpdate(mf *model.Manifest, existingWorker *model.WorkerDetails) []*model.Secret
- func PrettifyJson(in []byte) []byte
- func Print(message string, args ...any) error
- func PrintJson(data []byte) error
- func ReadManifest(dir ...string) (*model.Manifest, error)
- func ReadSecretPassword(prompt ...string) (string, error)
- func ReadSourceCode(mf *model.Manifest) (string, error)
- func SaveManifest(mf *model.Manifest, dir ...string) error
- func ValidateManifest(mf *model.Manifest, actionsMeta ActionsMetadata) error
- type ActionsMetadata
- type ApiCallParams
- type ApiContentHandler
- type ApiError
- type InputReader
Constants ¶
const ( ApiVersionV1 apiVersion = iota + 1 ApiVersionV2 apiVersion = 2 )
Variables ¶
This section is empty.
Functions ¶
func AddExportToTypesDeclarations ¶
AddExportToTypesDeclarations Add export to (interface, class, enum, type) XXX found in the source.
func CallWorkerApi ¶
func CallWorkerApi(c model.IntFlagProvider, params ApiCallParams) error
func CleanImports ¶
func CloseQuietly ¶
func DecryptManifestSecrets ¶
func ExtractActionUsedTypes ¶
func ExtractActionUsedTypes(md *model.ActionMetadata) []string
ExtractActionUsedTypes extracts all the type used in an action's sampleCode and defined in the action's typesDefinitions.
func ExtractProjectAndKeyFromCommandContext ¶
func ExtractProjectAndKeyFromCommandContext(c stringFlagAware, args []string, minArguments int, onlyGeneric bool) (string, string, error)
ExtractProjectAndKeyFromCommandContext Extracts the project key and worker key from the command context. If the project key is not provided, it will be taken from the manifest. The workerKey could either be the first argument or the name in the manifest. The first argument will only be considered as the workerKey if total arguments are greater than minArgument.
func ExtractUsedTypes ¶
ExtractUsedTypes extracts types from a TypeScript source file.
func FetchWorkerDetails ¶
func FetchWorkerDetails(c model.IntFlagProvider, serverUrl string, accessToken string, workerKey string, projectKey string) (*model.WorkerDetails, error)
FetchWorkerDetails Fetch a worker by its name. Returns nil if the worker does not exist (statusCode=404). Any other statusCode other than 200 will result as an error.
func NewCsvWriter ¶
func PrepareSecretsUpdate ¶
func PrettifyJson ¶
func ReadManifest ¶
ReadManifest reads a manifest from the working directory or from the directory provided as argument.
func ReadSecretPassword ¶
func ReadSourceCode ¶
ReadSourceCode reads the content of the file pointed by SourceCodePath
func ValidateManifest ¶
func ValidateManifest(mf *model.Manifest, actionsMeta ActionsMetadata) error
Types ¶
type ActionsMetadata ¶
type ActionsMetadata []*model.ActionMetadata
func FetchActions ¶
func FetchActions(c model.IntFlagProvider, serverUrl string, accessToken string, projectKey string) (ActionsMetadata, error)
func (ActionsMetadata) ActionNeedsCriteria ¶
func (c ActionsMetadata) ActionNeedsCriteria(actionName string, service ...string) bool
func (ActionsMetadata) ActionsNames ¶
func (c ActionsMetadata) ActionsNames() []string
func (ActionsMetadata) FindAction ¶
func (c ActionsMetadata) FindAction(actionName string, service ...string) (*model.ActionMetadata, error)
type ApiCallParams ¶
type ApiContentHandler ¶
type InputReader ¶
type InputReader struct {
// contains filtered or unexported fields
}
func NewInputReader ¶
func NewInputReader(ctx *components.Context) *InputReader
func (*InputReader) ReadDataFromFile ¶
func (c *InputReader) ReadDataFromFile(filePath string) (map[string]any, error)
func (*InputReader) ReadDataFromStdin ¶
func (c *InputReader) ReadDataFromStdin() (map[string]any, error)