collection

package
v0.0.62 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
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 NewCollectionCommand

func NewCollectionCommand(client client.API, w io.Writer) *cobra.Command

NewCollectionCommand creates a new `collection` command

func NewCreateCollectionCommand

func NewCreateCollectionCommand(c client.API, w io.Writer) *cobra.Command

NewCreateCollectionCommand creates a new `collection create` command to allow you to create a collection.

func NewGetCommand

func NewGetCommand(c client.API, w io.Writer) *cobra.Command

NewGetCommand creates a new `collection get` command to retrieve details about a specific collection.

func NewListCommand

func NewListCommand(c client.API, w io.Writer) *cobra.Command

NewListCommand creates a new `collection list` command to give you details about your collections.

func NewPreviewCommand

func NewPreviewCommand(c client.API, w io.Writer) *cobra.Command

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

func NewPublishCommand(c client.API, w io.Writer) *cobra.Command

NewPublishCommand creates a new `collection publish` command to publish a collection as a study.

func NewUpdateCommand

func NewUpdateCommand(client client.API, w io.Writer) *cobra.Command

NewUpdateCommand creates a new `collection update` command to update a collection

Types

type BrowserOpener

type BrowserOpener func(url string) error

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

type CreateCollectionOptions struct {
	Args         []string
	TemplatePath string
}

CreateCollectionOptions is the options for creating a collection command.

type GetOptions

type GetOptions struct {
	Args []string
}

GetOptions is the options for the get collection command.

type ListOptions

type ListOptions struct {
	Args           []string
	Csv            bool
	Json           bool
	Fields         string
	NonInteractive bool
	WorkspaceID    string
	Limit          int
	Offset         int
}

ListOptions is the options for the listing collections command.

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
}

Jump to

Keyboard shortcuts

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