diff --git a/generate.sh b/generate.sh index d5dadd1..86fe3a9 100755 --- a/generate.sh +++ b/generate.sh @@ -1,5 +1,4 @@ #!/usr/bin/env bash set -e -command -v genny >> /dev/null || go get github.com/cheekybits/genny -command -v goimports >> /dev/null || go get golang.org/x/tools/cmd/goimports +command -v goimports >> /dev/null || go install golang.org/x/tools/cmd/goimports@latest golang.org/x/tools/cmd/goimports go generate ./... diff --git a/go.mod b/go.mod index d052722..2c3f96b 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/rkoval/alfred-aws-console-services-workflow -go 1.19 +go 1.22 require ( github.com/aws/aws-sdk-go-v2 v1.16.8 diff --git a/workflow/.snapshots/TestRun-$_@_adsf_asdf b/workflow/.snapshots/TestRun-$_@_adsf_asdf index 4c0c5dc..1dfc9cd 100644 --- a/workflow/.snapshots/TestRun-$_@_adsf_asdf +++ b/workflow/.snapshots/TestRun-$_@_adsf_asdf @@ -1,10 +1,10 @@ -([]*aw.Item) (len=2) { +([]*aw.Item) (len=23) { (*aw.Item)({ - title: (string) (len=25) "No matching regions found", - subtitle: (*string)((len=53) "Try starting over with \"$\" again to see the full list"), + title: (string) (len=9) "eu-west-3", + subtitle: (*string)((len=14) "Europe (Paris)"), match: (*string)(), - uid: (*string)(), - autocomplete: (*string)(), + uid: (*string)((len=9) "eu-west-3"), + autocomplete: (*string)((len=23) "$eu-west-3 @ adsf asdf"), arg: ([]string) , valid: (bool) false, file: (bool) false, @@ -16,43 +16,491 @@ mods: (map[string]*aw.Modifier) , actions: (map[string][]string) , icon: (*aw.Icon)({ - Value: (string) (len=83) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/AlertNoteIcon.icns", + Value: (string) (len=82) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/BookmarkIcon.icns", Type: (aw.IconType) "" }), noUID: (bool) false }), (*aw.Item)({ - title: (string) (len=39) "Update available (current version: 1.0)", - subtitle: (*string)((len=42) "Select this result to navigate to download"), + title: (string) (len=9) "us-east-1", + subtitle: (*string)((len=21) "US East (N. Virginia)"), match: (*string)(), - uid: (*string)(), - autocomplete: (*string)(), - arg: ([]string) (len=1) { - (string) (len=71) "https://github.com/rkoval/alfred-aws-console-services-workflow/releases" + uid: (*string)((len=9) "us-east-1"), + autocomplete: (*string)((len=23) "$us-east-1 @ adsf asdf"), + arg: ([]string) , + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[string]*aw.Modifier) , + actions: (map[string][]string) , + icon: (*aw.Icon)({ + Value: (string) (len=82) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/BookmarkIcon.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=9) "us-west-1", + subtitle: (*string)((len=23) "US West (N. California)"), + match: (*string)(), + uid: (*string)((len=9) "us-west-1"), + autocomplete: (*string)((len=23) "$us-west-1 @ adsf asdf"), + arg: ([]string) , + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[string]*aw.Modifier) , + actions: (map[string][]string) , + icon: (*aw.Icon)({ + Value: (string) (len=82) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/BookmarkIcon.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=9) "us-west-2", + subtitle: (*string)((len=16) "US West (Oregon)"), + match: (*string)(), + uid: (*string)((len=9) "us-west-2"), + autocomplete: (*string)((len=23) "$us-west-2 @ adsf asdf"), + arg: ([]string) , + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[string]*aw.Modifier) , + actions: (map[string][]string) , + icon: (*aw.Icon)({ + Value: (string) (len=82) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/BookmarkIcon.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=9) "eu-west-1", + subtitle: (*string)((len=16) "Europe (Ireland)"), + match: (*string)(), + uid: (*string)((len=9) "eu-west-1"), + autocomplete: (*string)((len=23) "$eu-west-1 @ adsf asdf"), + arg: ([]string) , + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[string]*aw.Modifier) , + actions: (map[string][]string) , + icon: (*aw.Icon)({ + Value: (string) (len=82) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/BookmarkIcon.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=9) "ap-east-1", + subtitle: (*string)((len=24) "Asia Pacific (Hong Kong)"), + match: (*string)(), + uid: (*string)((len=9) "ap-east-1"), + autocomplete: (*string)((len=23) "$ap-east-1 @ adsf asdf"), + arg: ([]string) , + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[string]*aw.Modifier) , + actions: (map[string][]string) , + icon: (*aw.Icon)({ + Value: (string) (len=82) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/BookmarkIcon.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=9) "us-east-2", + subtitle: (*string)((len=14) "US East (Ohio)"), + match: (*string)(), + uid: (*string)((len=9) "us-east-2"), + autocomplete: (*string)((len=23) "$us-east-2 @ adsf asdf"), + arg: ([]string) , + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[string]*aw.Modifier) , + actions: (map[string][]string) , + icon: (*aw.Icon)({ + Value: (string) (len=82) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/BookmarkIcon.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=9) "sa-east-1", + subtitle: (*string)((len=26) "South America (São Paulo)"), + match: (*string)(), + uid: (*string)((len=9) "sa-east-1"), + autocomplete: (*string)((len=23) "$sa-east-1 @ adsf asdf"), + arg: ([]string) , + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[string]*aw.Modifier) , + actions: (map[string][]string) , + icon: (*aw.Icon)({ + Value: (string) (len=82) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/BookmarkIcon.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=9) "eu-west-2", + subtitle: (*string)((len=15) "Europe (London)"), + match: (*string)(), + uid: (*string)((len=9) "eu-west-2"), + autocomplete: (*string)((len=23) "$eu-west-2 @ adsf asdf"), + arg: ([]string) , + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[string]*aw.Modifier) , + actions: (map[string][]string) , + icon: (*aw.Icon)({ + Value: (string) (len=82) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/BookmarkIcon.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=10) "ap-south-1", + subtitle: (*string)((len=21) "Asia Pacific (Mumbai)"), + match: (*string)(), + uid: (*string)((len=10) "ap-south-1"), + autocomplete: (*string)((len=24) "$ap-south-1 @ adsf asdf"), + arg: ([]string) , + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { }, - valid: (bool) true, + mods: (map[string]*aw.Modifier) , + actions: (map[string][]string) , + icon: (*aw.Icon)({ + Value: (string) (len=82) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/BookmarkIcon.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=10) "eu-north-1", + subtitle: (*string)((len=18) "Europe (Stockholm)"), + match: (*string)(), + uid: (*string)((len=10) "eu-north-1"), + autocomplete: (*string)((len=24) "$eu-north-1 @ adsf asdf"), + arg: ([]string) , + valid: (bool) false, file: (bool) false, copytext: (*string)(), largetype: (*string)(), ql: (*string)(), - vars: (map[string]string) (len=1) { - (string) (len=6) "action": (string) (len=8) "open-url" + vars: (map[string]string) { }, - mods: (map[string]*aw.Modifier) (len=1) { - (string) (len=3) "cmd": (*aw.Modifier)({ - Key: (string) (len=3) "cmd", - arg: ([]string) , - subtitle: (*string)((len=21) "Copy URL to clipboard"), - valid: (bool) false, - icon: (*aw.Icon)(), - vars: (map[string]string) (len=1) { - (string) (len=6) "action": (string) (len=17) "copy-to-clipboard" - } - }) + mods: (map[string]*aw.Modifier) , + actions: (map[string][]string) , + icon: (*aw.Icon)({ + Value: (string) (len=82) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/BookmarkIcon.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=10) "eu-south-1", + subtitle: (*string)((len=14) "Europe (Milan)"), + match: (*string)(), + uid: (*string)((len=10) "eu-south-1"), + autocomplete: (*string)((len=24) "$eu-south-1 @ adsf asdf"), + arg: ([]string) , + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { }, + mods: (map[string]*aw.Modifier) , + actions: (map[string][]string) , + icon: (*aw.Icon)({ + Value: (string) (len=82) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/BookmarkIcon.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=10) "me-south-1", + subtitle: (*string)((len=21) "Middle East (Bahrain)"), + match: (*string)(), + uid: (*string)((len=10) "me-south-1"), + autocomplete: (*string)((len=24) "$me-south-1 @ adsf asdf"), + arg: ([]string) , + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[string]*aw.Modifier) , + actions: (map[string][]string) , + icon: (*aw.Icon)({ + Value: (string) (len=82) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/BookmarkIcon.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=10) "cn-north-1", + subtitle: (*string)((len=15) "China (Beijing)"), + match: (*string)(), + uid: (*string)((len=10) "cn-north-1"), + autocomplete: (*string)((len=24) "$cn-north-1 @ adsf asdf"), + arg: ([]string) , + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[string]*aw.Modifier) , + actions: (map[string][]string) , + icon: (*aw.Icon)({ + Value: (string) (len=82) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/BookmarkIcon.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=10) "af-south-1", + subtitle: (*string)((len=18) "Africa (Cape Town)"), + match: (*string)(), + uid: (*string)((len=10) "af-south-1"), + autocomplete: (*string)((len=24) "$af-south-1 @ adsf asdf"), + arg: ([]string) , + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[string]*aw.Modifier) , + actions: (map[string][]string) , + icon: (*aw.Icon)({ + Value: (string) (len=82) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/BookmarkIcon.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=12) "eu-central-1", + subtitle: (*string)((len=18) "Europe (Frankfurt)"), + match: (*string)(), + uid: (*string)((len=12) "eu-central-1"), + autocomplete: (*string)((len=26) "$eu-central-1 @ adsf asdf"), + arg: ([]string) , + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[string]*aw.Modifier) , + actions: (map[string][]string) , + icon: (*aw.Icon)({ + Value: (string) (len=82) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/BookmarkIcon.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=12) "ca-central-1", + subtitle: (*string)((len=16) "Canada (Central)"), + match: (*string)(), + uid: (*string)((len=12) "ca-central-1"), + autocomplete: (*string)((len=26) "$ca-central-1 @ adsf asdf"), + arg: ([]string) , + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[string]*aw.Modifier) , + actions: (map[string][]string) , + icon: (*aw.Icon)({ + Value: (string) (len=82) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/BookmarkIcon.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=14) "cn-northwest-1", + subtitle: (*string)((len=15) "China (Ningxia)"), + match: (*string)(), + uid: (*string)((len=14) "cn-northwest-1"), + autocomplete: (*string)((len=28) "$cn-northwest-1 @ adsf asdf"), + arg: ([]string) , + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[string]*aw.Modifier) , + actions: (map[string][]string) , + icon: (*aw.Icon)({ + Value: (string) (len=82) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/BookmarkIcon.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=14) "ap-northeast-1", + subtitle: (*string)((len=20) "Asia Pacific (Tokyo)"), + match: (*string)(), + uid: (*string)((len=14) "ap-northeast-1"), + autocomplete: (*string)((len=28) "$ap-northeast-1 @ adsf asdf"), + arg: ([]string) , + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[string]*aw.Modifier) , + actions: (map[string][]string) , + icon: (*aw.Icon)({ + Value: (string) (len=82) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/BookmarkIcon.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=14) "ap-southeast-2", + subtitle: (*string)((len=21) "Asia Pacific (Sydney)"), + match: (*string)(), + uid: (*string)((len=14) "ap-southeast-2"), + autocomplete: (*string)((len=28) "$ap-southeast-2 @ adsf asdf"), + arg: ([]string) , + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[string]*aw.Modifier) , + actions: (map[string][]string) , + icon: (*aw.Icon)({ + Value: (string) (len=82) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/BookmarkIcon.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=14) "ap-southeast-1", + subtitle: (*string)((len=24) "Asia Pacific (Singapore)"), + match: (*string)(), + uid: (*string)((len=14) "ap-southeast-1"), + autocomplete: (*string)((len=28) "$ap-southeast-1 @ adsf asdf"), + arg: ([]string) , + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[string]*aw.Modifier) , + actions: (map[string][]string) , + icon: (*aw.Icon)({ + Value: (string) (len=82) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/BookmarkIcon.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=14) "ap-northeast-2", + subtitle: (*string)((len=20) "Asia Pacific (Seoul)"), + match: (*string)(), + uid: (*string)((len=14) "ap-northeast-2"), + autocomplete: (*string)((len=28) "$ap-northeast-2 @ adsf asdf"), + arg: ([]string) , + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[string]*aw.Modifier) , + actions: (map[string][]string) , + icon: (*aw.Icon)({ + Value: (string) (len=82) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/BookmarkIcon.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=14) "ap-northeast-3", + subtitle: (*string)((len=20) "Asia Pacific (Osaka)"), + match: (*string)(), + uid: (*string)((len=14) "ap-northeast-3"), + autocomplete: (*string)((len=28) "$ap-northeast-3 @ adsf asdf"), + arg: ([]string) , + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[string]*aw.Modifier) , actions: (map[string][]string) , icon: (*aw.Icon)({ - Value: (string) (len=81) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/ToolbarInfo.icns", + Value: (string) (len=82) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/BookmarkIcon.icns", Type: (aw.IconType) "" }), noUID: (bool) false diff --git a/workflow/.snapshots/TestRun-$_us- b/workflow/.snapshots/TestRun-$_us- index 8e333e2..7cd53a3 100644 --- a/workflow/.snapshots/TestRun-$_us- +++ b/workflow/.snapshots/TestRun-$_us- @@ -1,10 +1,32 @@ -([]*aw.Item) (len=10) { +([]*aw.Item) (len=23) { + (*aw.Item)({ + title: (string) (len=9) "eu-west-3", + subtitle: (*string)((len=14) "Europe (Paris)"), + match: (*string)(), + uid: (*string)((len=9) "eu-west-3"), + autocomplete: (*string)((len=15) "$eu-west-3 us-"), + arg: ([]string) , + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[string]*aw.Modifier) , + actions: (map[string][]string) , + icon: (*aw.Icon)({ + Value: (string) (len=82) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/BookmarkIcon.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), (*aw.Item)({ title: (string) (len=9) "us-east-1", subtitle: (*string)((len=21) "US East (N. Virginia)"), match: (*string)(), uid: (*string)((len=9) "us-east-1"), - autocomplete: (*string)((len=5) "$ us-"), + autocomplete: (*string)((len=15) "$us-east-1 us-"), arg: ([]string) , valid: (bool) false, file: (bool) false, @@ -26,7 +48,7 @@ subtitle: (*string)((len=23) "US West (N. California)"), match: (*string)(), uid: (*string)((len=9) "us-west-1"), - autocomplete: (*string)((len=5) "$ us-"), + autocomplete: (*string)((len=15) "$us-west-1 us-"), arg: ([]string) , valid: (bool) false, file: (bool) false, @@ -48,7 +70,51 @@ subtitle: (*string)((len=16) "US West (Oregon)"), match: (*string)(), uid: (*string)((len=9) "us-west-2"), - autocomplete: (*string)((len=5) "$ us-"), + autocomplete: (*string)((len=15) "$us-west-2 us-"), + arg: ([]string) , + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[string]*aw.Modifier) , + actions: (map[string][]string) , + icon: (*aw.Icon)({ + Value: (string) (len=82) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/BookmarkIcon.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=9) "eu-west-1", + subtitle: (*string)((len=16) "Europe (Ireland)"), + match: (*string)(), + uid: (*string)((len=9) "eu-west-1"), + autocomplete: (*string)((len=15) "$eu-west-1 us-"), + arg: ([]string) , + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[string]*aw.Modifier) , + actions: (map[string][]string) , + icon: (*aw.Icon)({ + Value: (string) (len=82) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/BookmarkIcon.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=9) "ap-east-1", + subtitle: (*string)((len=24) "Asia Pacific (Hong Kong)"), + match: (*string)(), + uid: (*string)((len=9) "ap-east-1"), + autocomplete: (*string)((len=15) "$ap-east-1 us-"), arg: ([]string) , valid: (bool) false, file: (bool) false, @@ -70,7 +136,95 @@ subtitle: (*string)((len=14) "US East (Ohio)"), match: (*string)(), uid: (*string)((len=9) "us-east-2"), - autocomplete: (*string)((len=5) "$ us-"), + autocomplete: (*string)((len=15) "$us-east-2 us-"), + arg: ([]string) , + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[string]*aw.Modifier) , + actions: (map[string][]string) , + icon: (*aw.Icon)({ + Value: (string) (len=82) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/BookmarkIcon.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=9) "sa-east-1", + subtitle: (*string)((len=26) "South America (São Paulo)"), + match: (*string)(), + uid: (*string)((len=9) "sa-east-1"), + autocomplete: (*string)((len=15) "$sa-east-1 us-"), + arg: ([]string) , + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[string]*aw.Modifier) , + actions: (map[string][]string) , + icon: (*aw.Icon)({ + Value: (string) (len=82) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/BookmarkIcon.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=9) "eu-west-2", + subtitle: (*string)((len=15) "Europe (London)"), + match: (*string)(), + uid: (*string)((len=9) "eu-west-2"), + autocomplete: (*string)((len=15) "$eu-west-2 us-"), + arg: ([]string) , + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[string]*aw.Modifier) , + actions: (map[string][]string) , + icon: (*aw.Icon)({ + Value: (string) (len=82) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/BookmarkIcon.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=10) "ap-south-1", + subtitle: (*string)((len=21) "Asia Pacific (Mumbai)"), + match: (*string)(), + uid: (*string)((len=10) "ap-south-1"), + autocomplete: (*string)((len=16) "$ap-south-1 us-"), + arg: ([]string) , + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[string]*aw.Modifier) , + actions: (map[string][]string) , + icon: (*aw.Icon)({ + Value: (string) (len=82) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/BookmarkIcon.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=10) "eu-north-1", + subtitle: (*string)((len=18) "Europe (Stockholm)"), + match: (*string)(), + uid: (*string)((len=10) "eu-north-1"), + autocomplete: (*string)((len=16) "$eu-north-1 us-"), arg: ([]string) , valid: (bool) false, file: (bool) false, @@ -92,7 +246,7 @@ subtitle: (*string)((len=14) "Europe (Milan)"), match: (*string)(), uid: (*string)((len=10) "eu-south-1"), - autocomplete: (*string)((len=5) "$ us-"), + autocomplete: (*string)((len=16) "$eu-south-1 us-"), arg: ([]string) , valid: (bool) false, file: (bool) false, @@ -110,11 +264,11 @@ noUID: (bool) false }), (*aw.Item)({ - title: (string) (len=9) "eu-west-3", - subtitle: (*string)((len=14) "Europe (Paris)"), + title: (string) (len=10) "me-south-1", + subtitle: (*string)((len=21) "Middle East (Bahrain)"), match: (*string)(), - uid: (*string)((len=9) "eu-west-3"), - autocomplete: (*string)((len=5) "$ us-"), + uid: (*string)((len=10) "me-south-1"), + autocomplete: (*string)((len=16) "$me-south-1 us-"), arg: ([]string) , valid: (bool) false, file: (bool) false, @@ -132,11 +286,11 @@ noUID: (bool) false }), (*aw.Item)({ - title: (string) (len=9) "eu-west-2", - subtitle: (*string)((len=15) "Europe (London)"), + title: (string) (len=10) "cn-north-1", + subtitle: (*string)((len=15) "China (Beijing)"), match: (*string)(), - uid: (*string)((len=9) "eu-west-2"), - autocomplete: (*string)((len=5) "$ us-"), + uid: (*string)((len=10) "cn-north-1"), + autocomplete: (*string)((len=16) "$cn-north-1 us-"), arg: ([]string) , valid: (bool) false, file: (bool) false, @@ -154,11 +308,99 @@ noUID: (bool) false }), (*aw.Item)({ - title: (string) (len=9) "eu-west-1", - subtitle: (*string)((len=16) "Europe (Ireland)"), + title: (string) (len=10) "af-south-1", + subtitle: (*string)((len=18) "Africa (Cape Town)"), match: (*string)(), - uid: (*string)((len=9) "eu-west-1"), - autocomplete: (*string)((len=5) "$ us-"), + uid: (*string)((len=10) "af-south-1"), + autocomplete: (*string)((len=16) "$af-south-1 us-"), + arg: ([]string) , + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[string]*aw.Modifier) , + actions: (map[string][]string) , + icon: (*aw.Icon)({ + Value: (string) (len=82) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/BookmarkIcon.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=12) "eu-central-1", + subtitle: (*string)((len=18) "Europe (Frankfurt)"), + match: (*string)(), + uid: (*string)((len=12) "eu-central-1"), + autocomplete: (*string)((len=18) "$eu-central-1 us-"), + arg: ([]string) , + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[string]*aw.Modifier) , + actions: (map[string][]string) , + icon: (*aw.Icon)({ + Value: (string) (len=82) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/BookmarkIcon.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=12) "ca-central-1", + subtitle: (*string)((len=16) "Canada (Central)"), + match: (*string)(), + uid: (*string)((len=12) "ca-central-1"), + autocomplete: (*string)((len=18) "$ca-central-1 us-"), + arg: ([]string) , + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[string]*aw.Modifier) , + actions: (map[string][]string) , + icon: (*aw.Icon)({ + Value: (string) (len=82) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/BookmarkIcon.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=14) "cn-northwest-1", + subtitle: (*string)((len=15) "China (Ningxia)"), + match: (*string)(), + uid: (*string)((len=14) "cn-northwest-1"), + autocomplete: (*string)((len=20) "$cn-northwest-1 us-"), + arg: ([]string) , + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[string]*aw.Modifier) , + actions: (map[string][]string) , + icon: (*aw.Icon)({ + Value: (string) (len=82) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/BookmarkIcon.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=14) "ap-northeast-1", + subtitle: (*string)((len=20) "Asia Pacific (Tokyo)"), + match: (*string)(), + uid: (*string)((len=14) "ap-northeast-1"), + autocomplete: (*string)((len=20) "$ap-northeast-1 us-"), arg: ([]string) , valid: (bool) false, file: (bool) false, @@ -180,7 +422,7 @@ subtitle: (*string)((len=21) "Asia Pacific (Sydney)"), match: (*string)(), uid: (*string)((len=14) "ap-southeast-2"), - autocomplete: (*string)((len=5) "$ us-"), + autocomplete: (*string)((len=20) "$ap-southeast-2 us-"), arg: ([]string) , valid: (bool) false, file: (bool) false, @@ -202,7 +444,51 @@ subtitle: (*string)((len=24) "Asia Pacific (Singapore)"), match: (*string)(), uid: (*string)((len=14) "ap-southeast-1"), - autocomplete: (*string)((len=5) "$ us-"), + autocomplete: (*string)((len=20) "$ap-southeast-1 us-"), + arg: ([]string) , + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[string]*aw.Modifier) , + actions: (map[string][]string) , + icon: (*aw.Icon)({ + Value: (string) (len=82) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/BookmarkIcon.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=14) "ap-northeast-2", + subtitle: (*string)((len=20) "Asia Pacific (Seoul)"), + match: (*string)(), + uid: (*string)((len=14) "ap-northeast-2"), + autocomplete: (*string)((len=20) "$ap-northeast-2 us-"), + arg: ([]string) , + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[string]*aw.Modifier) , + actions: (map[string][]string) , + icon: (*aw.Icon)({ + Value: (string) (len=82) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/BookmarkIcon.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=14) "ap-northeast-3", + subtitle: (*string)((len=20) "Asia Pacific (Osaka)"), + match: (*string)(), + uid: (*string)((len=14) "ap-northeast-3"), + autocomplete: (*string)((len=20) "$ap-northeast-3 us-"), arg: ([]string) , valid: (bool) false, file: (bool) false, diff --git a/workflow/.snapshots/TestRun-$us-east-1_@prof_asdf_asdf b/workflow/.snapshots/TestRun-$us-east-1_@prof_asdf_asdf index b4c3fc3..8a03bc2 100644 --- a/workflow/.snapshots/TestRun-$us-east-1_@prof_asdf_asdf +++ b/workflow/.snapshots/TestRun-$us-east-1_@prof_asdf_asdf @@ -1,10 +1,10 @@ -([]*aw.Item) (len=2) { +([]*aw.Item) (len=3) { (*aw.Item)({ - title: (string) (len=26) "No matching profiles found", - subtitle: (*string)((len=53) "Try starting over with \"@\" again to see the full list"), + title: (string) (len=8) "profile1", + subtitle: (*string)((len=14) "🌎 us-east-1"), match: (*string)(), - uid: (*string)(), - autocomplete: (*string)(), + uid: (*string)((len=8) "profile1"), + autocomplete: (*string)((len=31) "$us-east-1 @profile1 asdf asdf"), arg: ([]string) , valid: (bool) false, file: (bool) false, @@ -16,43 +16,51 @@ mods: (map[string]*aw.Modifier) , actions: (map[string][]string) , icon: (*aw.Icon)({ - Value: (string) (len=83) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/AlertNoteIcon.icns", + Value: (string) (len=78) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/Accounts.icns", Type: (aw.IconType) "" }), noUID: (bool) false }), (*aw.Item)({ - title: (string) (len=39) "Update available (current version: 1.0)", - subtitle: (*string)((len=42) "Select this result to navigate to download"), + title: (string) (len=8) "profile3", + subtitle: (*string)((len=14) "🌎 sa-east-1"), match: (*string)(), - uid: (*string)(), - autocomplete: (*string)(), - arg: ([]string) (len=1) { - (string) (len=71) "https://github.com/rkoval/alfred-aws-console-services-workflow/releases" - }, - valid: (bool) true, + uid: (*string)((len=8) "profile3"), + autocomplete: (*string)((len=31) "$us-east-1 @profile3 asdf asdf"), + arg: ([]string) , + valid: (bool) false, file: (bool) false, copytext: (*string)(), largetype: (*string)(), ql: (*string)(), - vars: (map[string]string) (len=1) { - (string) (len=6) "action": (string) (len=8) "open-url" + vars: (map[string]string) { }, - mods: (map[string]*aw.Modifier) (len=1) { - (string) (len=3) "cmd": (*aw.Modifier)({ - Key: (string) (len=3) "cmd", - arg: ([]string) , - subtitle: (*string)((len=21) "Copy URL to clipboard"), - valid: (bool) false, - icon: (*aw.Icon)(), - vars: (map[string]string) (len=1) { - (string) (len=6) "action": (string) (len=17) "copy-to-clipboard" - } - }) + mods: (map[string]*aw.Modifier) , + actions: (map[string][]string) , + icon: (*aw.Icon)({ + Value: (string) (len=78) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/Accounts.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=12) "bogusprofile", + subtitle: (*string)((len=10) "🌎 bogus"), + match: (*string)(), + uid: (*string)((len=12) "bogusprofile"), + autocomplete: (*string)((len=35) "$us-east-1 @bogusprofile asdf asdf"), + arg: ([]string) , + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { }, + mods: (map[string]*aw.Modifier) , actions: (map[string][]string) , icon: (*aw.Icon)({ - Value: (string) (len=81) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/ToolbarInfo.icns", + Value: (string) (len=78) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/Accounts.icns", Type: (aw.IconType) "" }), noUID: (bool) false diff --git a/workflow/.snapshots/TestRun-$us-east_1 b/workflow/.snapshots/TestRun-$us-east_1 new file mode 100644 index 0000000..4ebd68b --- /dev/null +++ b/workflow/.snapshots/TestRun-$us-east_1 @@ -0,0 +1,46 @@ +([]*aw.Item) (len=2) { + (*aw.Item)({ + title: (string) (len=9) "us-east-1", + subtitle: (*string)((len=21) "US East (N. Virginia)"), + match: (*string)(), + uid: (*string)((len=9) "us-east-1"), + autocomplete: (*string)((len=13) "$us-east-1 1"), + arg: ([]string) , + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[string]*aw.Modifier) , + actions: (map[string][]string) , + icon: (*aw.Icon)({ + Value: (string) (len=82) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/BookmarkIcon.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=9) "us-east-2", + subtitle: (*string)((len=14) "US East (Ohio)"), + match: (*string)(), + uid: (*string)((len=9) "us-east-2"), + autocomplete: (*string)((len=13) "$us-east-2 1"), + arg: ([]string) , + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[string]*aw.Modifier) , + actions: (map[string][]string) , + icon: (*aw.Icon)({ + Value: (string) (len=82) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/BookmarkIcon.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }) +} diff --git a/workflow/.snapshots/TestRun-@_prof b/workflow/.snapshots/TestRun-@_prof index b8be0b1..351d991 100644 --- a/workflow/.snapshots/TestRun-@_prof +++ b/workflow/.snapshots/TestRun-@_prof @@ -1,10 +1,76 @@ -([]*aw.Item) (len=3) { +([]*aw.Item) (len=7) { + (*aw.Item)({ + title: (string) (len=5) "usgov", + subtitle: (*string)((len=18) "🌎 us-gov-east-1"), + match: (*string)(), + uid: (*string)((len=5) "usgov"), + autocomplete: (*string)((len=12) "@usgov prof"), + arg: ([]string) , + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[string]*aw.Modifier) , + actions: (map[string][]string) , + icon: (*aw.Icon)({ + Value: (string) (len=78) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/Accounts.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=5) "china", + subtitle: (*string)((len=15) "🌎 cn-north-1"), + match: (*string)(), + uid: (*string)((len=5) "china"), + autocomplete: (*string)((len=12) "@china prof"), + arg: ([]string) , + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[string]*aw.Modifier) , + actions: (map[string][]string) , + icon: (*aw.Icon)({ + Value: (string) (len=78) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/Accounts.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=7) "default", + subtitle: (*string)((len=14) "🌎 us-west-2"), + match: (*string)(), + uid: (*string)((len=7) "default"), + autocomplete: (*string)((len=14) "@default prof"), + arg: ([]string) , + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[string]*aw.Modifier) , + actions: (map[string][]string) , + icon: (*aw.Icon)({ + Value: (string) (len=78) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/Accounts.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), (*aw.Item)({ title: (string) (len=8) "profile1", subtitle: (*string)((len=14) "🌎 us-east-1"), match: (*string)(), uid: (*string)((len=8) "profile1"), - autocomplete: (*string)((len=6) "@ prof"), + autocomplete: (*string)((len=15) "@profile1 prof"), arg: ([]string) , valid: (bool) false, file: (bool) false, @@ -26,7 +92,29 @@ subtitle: (*string)((len=14) "🌎 sa-east-1"), match: (*string)(), uid: (*string)((len=8) "profile3"), - autocomplete: (*string)((len=6) "@ prof"), + autocomplete: (*string)((len=15) "@profile3 prof"), + arg: ([]string) , + valid: (bool) false, + file: (bool) false, + copytext: (*string)(), + largetype: (*string)(), + ql: (*string)(), + vars: (map[string]string) { + }, + mods: (map[string]*aw.Modifier) , + actions: (map[string][]string) , + icon: (*aw.Icon)({ + Value: (string) (len=78) "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/Accounts.icns", + Type: (aw.IconType) "" + }), + noUID: (bool) false + }), + (*aw.Item)({ + title: (string) (len=8) "noregion", + subtitle: (*string)((len=76) "⚠️ This profile does not specify a region. Functionality will be limited"), + match: (*string)(), + uid: (*string)((len=8) "noregion"), + autocomplete: (*string)((len=15) "@noregion prof"), arg: ([]string) , valid: (bool) false, file: (bool) false, @@ -48,7 +136,7 @@ subtitle: (*string)((len=10) "🌎 bogus"), match: (*string)(), uid: (*string)((len=12) "bogusprofile"), - autocomplete: (*string)((len=6) "@ prof"), + autocomplete: (*string)((len=19) "@bogusprofile prof"), arg: ([]string) , valid: (bool) false, file: (bool) false, diff --git a/workflow/workflow_test.go b/workflow/workflow_test.go index 9f7c039..ce3ab60 100644 --- a/workflow/workflow_test.go +++ b/workflow/workflow_test.go @@ -70,6 +70,9 @@ var tcs []testCase = []testCase{ { query: "$ @ adsf asdf", }, + { + query: "$us-east 1", + }, { query: "$us-east-1 @", },