Documentation
¶
Index ¶
- Constants
- func GetCollectionPreviewPath(ID string) string
- func GetCollectionPreviewURL(ID string) string
- func NewCollectionCommand(client client.API, w io.Writer) *cobra.Command
- func NewCreateCollectionCommand(c client.API, w io.Writer) *cobra.Command
- func NewExportCommand(c client.API, w io.Writer) *cobra.Command
- func NewGetCommand(c client.API, w io.Writer) *cobra.Command
- func NewListCommand(c client.API, w io.Writer) *cobra.Command
- func NewPreviewCommand(c client.API, w io.Writer) *cobra.Command
- func NewPreviewCommandWithOpener(c client.API, w io.Writer, browserOpener BrowserOpener) *cobra.Command
- func NewPublishCommand(c client.API, w io.Writer) *cobra.Command
- func NewUpdateCommand(client client.API, w io.Writer) *cobra.Command
- func RenderCollection(collection *model.Collection, w io.Writer) error
- type BrowserOpener
- type CreateCollectionOptions
- type ExportOptions
- type GetOptions
- type InteractiveRenderer
- type ListOptions
- type ListView
- type PreviewOptions
- type PublishOptions
- type UpdateOptions
Constants ¶
const ( // Error messages ErrCollectionItemsRequired = "at least one collection item must be provided" ErrPageItemsRequired = "each page must have at least one item in page_items" ErrWorkspaceIDRequired = "workspace ID is required" ErrNameRequired = "name is required" ErrWorkspaceNotFound = "workspace not found" ErrTaskDetailsRequired = "task_details is required" ErrTaskNameRequired = "task_details.task_name is required" ErrTaskIntroductionRequired = "task_details.task_introduction is required" ErrTaskStepsRequired = "task_details.task_steps is required" // Feature access constants for AI Task Builder Collections (see DCP-2152) FeatureNameAITBCollection = "AI Task Builder Collections" FeatureContactURLAITBCollection = "https://researcher-help.prolific.com/en/" )
Variables ¶
This section is empty.
Functions ¶
func GetCollectionPreviewPath ¶ added in v1.0.0
GetCollectionPreviewPath returns the URL path to a collection preview, agnostic of domain
func GetCollectionPreviewURL ¶ added in v1.0.0
GetCollectionPreviewURL returns the full URL to a collection preview using configuration
func NewCollectionCommand ¶
NewCollectionCommand creates a new `collection` command
func NewCreateCollectionCommand ¶
NewCreateCollectionCommand creates a new `collection create` command to allow you to create a collection.
func NewExportCommand ¶ added in v0.0.64
NewExportCommand creates a new `collection export` command to export a collection's responses as a ZIP archive.
func NewGetCommand ¶
NewGetCommand creates a new `collection get` command to retrieve details about a specific collection.
func NewListCommand ¶
NewListCommand creates a new `collection list` command to give you details about your collections.
func NewPreviewCommand ¶
NewPreviewCommand creates a new `collection preview` command to open a collection preview in the browser.
func NewPreviewCommandWithOpener ¶
func NewPreviewCommandWithOpener(c client.API, w io.Writer, browserOpener BrowserOpener) *cobra.Command
NewPreviewCommandWithOpener creates a new `collection preview` command with a custom browser opener. This is useful for testing to avoid opening actual browser windows.
func NewPublishCommand ¶
NewPublishCommand creates a new `collection publish` command to publish a collection as a study.
func NewUpdateCommand ¶
NewUpdateCommand creates a new `collection update` command to update a collection
func RenderCollection ¶ added in v1.0.0
func RenderCollection(collection *model.Collection, w io.Writer) error
RenderCollection will write a detailed view of the selected collection to the provided writer.
Types ¶
type BrowserOpener ¶
BrowserOpener is a function type for opening URLs in a browser. This allows for dependency injection in tests.
var DefaultBrowserOpener BrowserOpener = browser.OpenURL
DefaultBrowserOpener uses the system browser to open URLs.
type CreateCollectionOptions ¶
CreateCollectionOptions is the options for creating a collection command.
type ExportOptions ¶ added in v0.0.64
ExportOptions is the options for the collection export command.
type GetOptions ¶
type GetOptions struct {
Args []string
}
GetOptions is the options for the get collection command.
type InteractiveRenderer ¶ added in v1.0.0
type InteractiveRenderer struct{}
InteractiveRenderer runs the bubbles UI framework to provide a rich UI experience for the user.
func (*InteractiveRenderer) Render ¶ added in v1.0.0
func (r *InteractiveRenderer) Render(c client.API, collections client.ListCollectionsResponse, w io.Writer) error
Render will render the list in an interactive manner.
type ListOptions ¶
type ListOptions struct {
Args []string
Fields string
Output shared.OutputOptions
WorkspaceID string
Limit int
Offset int
}
ListOptions is the options for the listing collections command.
type ListView ¶ added in v1.0.0
type ListView struct {
List list.Model
Collections map[string]model.Collection
Collection *model.Collection
Client client.API
}
ListView is responsible for presenting a list view to the user.
type PreviewOptions ¶
type PreviewOptions struct {
Args []string
BrowserOpener BrowserOpener
}
PreviewOptions is the options for the preview collection command.
type PublishOptions ¶
type PublishOptions struct {
Args []string
Participants int
Name string
Description string
TemplatePath string
Draft bool
}
PublishOptions is the options for the publish collection command.
type UpdateOptions ¶
type UpdateOptions struct {
TemplatePath string
}