qcs

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RELOAD_CREATED   string = "CREATED"
	RELOAD_QUEUED    string = "QUEUED"
	RELOAD_RELOADING string = "RELOADING"
	RELOAD_FAILED    string = "FAILED"
	RELOAD_SUCCEEDED string = "SUCCEEDED"
)
View Source
const (
	CREATE ActionName = "create"
	READ   ActionName = "read"
	UPDATE ActionName = "update"
	DELETE ActionName = "delete"

	MANAGED_SPACE string = "managed"
	SHARED_SPACE  string = "shared"
	DATA_SPACE    string = "data"
)

Variables

Functions

func NewConfigFromEngine

func NewConfigFromEngine(cfg engine.Config) *rac.Config

Types

type ActionName

type ActionName string

type AppUpdateAttributes

type AppUpdateAttributes struct {
	Name        string `json:"name,omitempty"`
	Description string `json:"description,omitempty"`
}

type Client

type Client struct {
	Config rac.Config
	// contains filtered or unexported fields
}

func NewClient

func NewClient(cfg rac.Config) (*Client, *util.Result)

func NewFromEngine

func NewFromEngine(cfg engine.Config) (*Client, *util.Result)

func (*Client) AssignSpace

func (c *Client) AssignSpace(spaceId string, assignment SpaceAssignmentCreate) (*SpaceAssignment, *util.Result)

func (*Client) CheckDataFilesQuota

func (c *Client) CheckDataFilesQuota(filePath string, quota DataFilesQuota) *util.Result

func (*Client) CreateSpace

func (c *Client) CreateSpace(param SpaceCreate) (*Space, *util.Result)

func (*Client) Delete

func (c *Client) Delete(appId string) *util.Result

func (*Client) Do

func (c *Client) Do(req *http.Request) (*http.Response, []byte, *util.Result)

func (*Client) Get

func (c *Client) Get(endpoint string, params map[string]string) (*http.Response, []byte, *util.Result)

func (*Client) GetAppItem

func (c *Client) GetAppItem(appId string) ([]ItemCollection, *util.Result)

func (*Client) GetConnectionDataFiles

func (c *Client) GetConnectionDataFiles(connectionId, fileName string) ([]*DataFilesInfo, *util.Result)

func (*Client) GetConnections

func (c *Client) GetConnections(spaceId string) (*Connections, *util.Result)

func (*Client) GetDataFilesConnection

func (c *Client) GetDataFilesConnection(spaceId string) (*Connection, *util.Result)

func (*Client) GetDataFilesQuota

func (c *Client) GetDataFilesQuota() (*DataFilesQuota, *util.Result)

func (Client) GetEngineBaseUrl

func (c Client) GetEngineBaseUrl() (*url.URL, *util.Result)

func (*Client) GetGroups

func (c *Client) GetGroups() (*Groups, *util.Result)

func (*Client) GetItems

func (c *Client) GetItems(params map[string]string) ([]ItemCollection, *util.Result)

func (*Client) GetPersonalApps

func (c *Client) GetPersonalApps() ([]ItemCollection, *util.Result)

func (*Client) GetPublishedApps

func (c *Client) GetPublishedApps(spaceId string) ([]NxAppAttributes, *util.Result)

func (*Client) GetRawUrl

func (c *Client) GetRawUrl(rawUrl string) (*http.Response, []byte, *util.Result)

func (*Client) GetSpace

func (c *Client) GetSpace(spaceId string) (*Space, *util.Result)

func (*Client) GetSpaceList

func (c *Client) GetSpaceList(option SpaceGetParam) ([]Space, *util.Result)

func (*Client) GetSpaces

func (c *Client) GetSpaces(action string) (*Spaces, *util.Result)

func (*Client) GetUser

func (c *Client) GetUser(userId string) (*User, *util.Result)

func (*Client) GetUsers

func (c *Client) GetUsers() (*Users, *util.Result)

func (*Client) HostUrl

func (c *Client) HostUrl(uri string) (string, *util.Result)

func (*Client) Import

func (c *Client) Import(binPath, appId, appName, spaceId string, skipData bool) (*NxApp, *util.Result)

appId is not used at the moment

func (*Client) ImportDataFile

func (c *Client) ImportDataFile(filePath, spaceId string, replace bool) (*DataFilesInfo, *util.Result)

func (Client) Logger

func (c Client) Logger() *zerolog.Logger

func (*Client) MakeSheetsPublic

func (c *Client) MakeSheetsPublic(appid string) *util.Result

func (*Client) NewEngineConn

func (c *Client) NewEngineConn(appId string) (conn *engine.Conn, res *util.Result)

func (*Client) NewReloadTask

func (c *Client) NewReloadTask(appid string, partial bool) (*Reload, *util.Result)

func (*Client) NewRequest

func (c *Client) NewRequest(method, endpoint string, params map[string]string) *http.Request

func (*Client) Publish

func (c *Client) Publish(appId, appName, spaceId string, alwaysNew bool) (*ItemResultResponseBody, *util.Result)

func (*Client) Reload

func (c *Client) Reload(appid string, partial bool, timeout *time.Duration) (*Reload, *util.Result)

func (*Client) SetCookieJar

func (c *Client) SetCookieJar(jar http.CookieJar)

func (*Client) SetLogger

func (c *Client) SetLogger(_l *zerolog.Logger)

func (*Client) UpdateSpace

func (c *Client) UpdateSpace(spaceId string, param SpaceUpdate) (*Space, *util.Result)

func (*Client) UploadToTCS

func (c *Client) UploadToTCS(filePath string) (fileId string, res *util.Result)

func (*Client) WaitForReloadResult

func (c *Client) WaitForReloadResult(reloadId string, timeout *time.Duration) (*Reload, *util.Result)

type Connection

type Connection struct {
	ID                  string  `json:"qID"`
	Name                string  `json:"qName"`
	ConnectStatement    string  `json:"qConnectStatement"`
	Type                string  `json:"qType"`
	LogOn               float32 `json:"qLogOn"`
	Architecture        int32   `json:"qArchitecture"`
	EngineObjectID      string  `json:"qEngineObjectID"`
	CredentialsID       *string `json:"qCredentialsID,omitempty"`
	CredentialsName     *string `json:"qCredentialsName,omitempty"`
	SeparateCredentials bool    `json:"qSeparateCredentials"`
	ReferenceKey        *string `json:"qReferenceKey,omitempty"`
	ConnectionSecret    *string `json:"qConnectionSecret,omitempty"`
	Space               *string `json:"space,omitempty"`
	User                string  `json:"user"`
	Tenant              *string `json:"tenant,omitempty"`
	Created             string  `json:"created"`
	Updated             string  `json:"updated"`
	Links               *Link   `json:"links,omitempty"`
}

type Connections

type Connections struct {
	Data   *[]Connection             `json:"data,omitempty"`
	Links  *ItemLink                 `json:"links,omitempty"`
	Errors *[]map[string]interface{} `json:"errors,omitempty"`
}

type DataFilesInfo

type DataFilesInfo struct {
	CreatedDate  string `json:"createdDate,omitempty"`
	ID           string `json:"id,omitempty"`
	ModifiedDate string `json:"modifiedDate,omitempty"`
	Name         string `json:"name,omitempty"`
	OwnerId      string `json:"ownerId,omitempty"`
	Size         *int64 `json:"size,omitempty"`
	SpaceId      string `json:"spaceId,omitempty"`
}

type DataFilesQuota

type DataFilesQuota struct {
	AllowedExtensions         []string `json:"allowedExtensions,omitempty"`
	AllowedInternalExtensions []string `json:"allowedInternalExtensions,omitempty"`
	MaxFileSize               *int64   `json:"maxFileSize,omitempty"`
	MaxLargeFileSize          *int64   `json:"maxLargeFileSize,omitempty"`
	MaxSize                   *int64   `json:"maxSize,omitempty"`
	Size                      *int64   `json:"size,omitempty"`
}

type Group

type Group struct {
	Id            string     `json:"id"`
	Status        *string    `json:"status,omitempty"`
	TenantId      string     `json:"tenantId"`
	Name          string     `json:"name"`
	CreatedAt     *time.Time `json:"createdAt,omitempty"`
	LastUpdatedAt *time.Time `json:"lastUpdatedAt,omitempty"`
}

type Groups

type Groups struct {
	Data  []Group     `json:"data,omitempty"`
	Links *PagesLinks `json:"links,omitempty"`
}

type ItemCollection

type ItemCollection struct {
	CreatedAt string              `json:"createdAt"`
	CreatorId *string             `json:"creatorId,omitempty"`
	Id        string              `json:"id"`
	ItemCount int64               `json:"itemCount"`
	Links     ItemCollectionLinks `json:"links"`
	TenantId  string              `json:"tenantId"`
	Type      string              `json:"type"`
	UpdatedAt string              `json:"updatedAt"`
	UpdaterId *string             `json:"updaterId,omitempty"`

	ItemsCreateItemRequestBody
}
type ItemCollectionLinks struct {
	Items *Link `json:"items,omitempty"`
	Self  *Link `json:"self,omitempty"`
}
type ItemLink struct {
	Self       *Link `json:"self,omitempty"`
	Next       *Link `json:"next,omitempty"`
	Prev       *Link `json:"prev,omitempty"`
	Collection *Link `json:"collection,omitempty"`
}
type ItemLinks struct {
	Collections *Link `json:"collections,omitempty"`
	Open        *Link `json:"open,omitempty"`
	Self        *Link `json:"self,omitempty"`
	Thumbnail   *Link `json:"thumbnail,omitempty"`
}

type ItemMeta

type ItemMeta struct {
	Actions     *[]string  `json:"actions,omitempty"`
	Collections *[]ItemTag `json:"collections,omitempty"`
	IsFavorited *bool      `json:"isFavorited,omitempty"`
	Tags        *[]ItemTag `json:"tags,omitempty"`
}

type ItemResourceSize

type ItemResourceSize struct {
	AppFile   *float32 `json:"appFile,omitempty"`
	AppMemory *float32 `json:"appMemory,omitempty"`
}

type ItemResultResponseBody

type ItemResultResponseBody struct {
	Actions                  []string          `json:"actions"`
	CollectionIds            []string          `json:"collectionIds"`
	CreatedAt                string            `json:"createdAt"`
	CreatorId                *string           `json:"creatorId,omitempty"`
	Description              *string           `json:"description,omitempty"`
	Id                       string            `json:"id"`
	IsFavorited              bool              `json:"isFavorited"`
	Links                    ItemLinks         `json:"links"`
	Meta                     ItemMeta          `json:"meta"`
	OwnerId                  *string           `json:"ownerId,omitempty"`
	Name                     string            `json:"name"`
	ResourceAttributes       json.RawMessage   `json:"resourceAttributes"`
	ResourceCreatedAt        string            `json:"resourceCreatedAt"`
	ResourceCustomAttributes json.RawMessage   `json:"resourceCustomAttributes"`
	ResourceId               *string           `json:"resourceId,omitempty"`
	ResourceLink             *string           `json:"resourceLink,omitempty"`
	ResourceReloadEndTime    *string           `json:"resourceReloadEndTime,omitempty"`
	ResourceReloadStatus     *string           `json:"resourceReloadStatus,omitempty"`
	ResourceSize             *ItemResourceSize `json:"resourceSize,omitempty"`
	ResourceSubType          *string           `json:"resourceSubType,omitempty"`
	ResourceType             string            `json:"resourceType"`
	ResourceUpdatedAt        string            `json:"resourceUpdatedAt"`
	SpaceId                  *string           `json:"spaceId,omitempty"`
	TenantId                 string            `json:"tenantId"`
	ThumbnailId              *string           `json:"thumbnailId,omitempty"`
	UpdatedAt                string            `json:"updatedAt"`
	UpdaterId                *string           `json:"updaterId,omitempty"`
}

type ItemTag

type ItemTag struct {
	Id   string `json:"id"`
	Name string `json:"name"`
}

type ItemsCreateItemRequestBody

type ItemsCreateItemRequestBody struct {
	Description              *string         `json:"description,omitempty"`
	Name                     string          `json:"name"`
	ResourceAttributes       json.RawMessage `json:"resourceAttributes,omitempty"`
	ResourceCreatedAt        string          `json:"resourceCreatedAt"`
	ResourceCustomAttributes json.RawMessage `json:"resourceCustomAttributes,omitempty"`
	ResourceId               *string         `json:"resourceId,omitempty"`
	ResourceLink             *string         `json:"resourceLink,omitempty"`
	ResourceType             string          `json:"resourceType"`
	ResourceSubType          *string         `json:"resourceSubType,omitempty"`
	ResourceUpdatedAt        *string         `json:"resourceUpdatedAt,omitempty"`
	SpaceId                  *string         `json:"spaceId,omitempty"`
	ThumbnailId              *string         `json:"thumbnailId,omitempty"`
}

type ItemsListResponseBody

type ItemsListResponseBody struct {
	Data []ItemCollection `json:"data"`
}
type Link struct {
	Href *string `json:"href,omitempty"`
}
type Links struct {
	Self Link  `json:"self"`
	Prev *Link `json:"prev,omitempty"`
	Next *Link `json:"next,omitempty"`
}

type Meta

type Meta struct {
	Fault     *bool `json:"fault,omitempty"`
	Temporary *bool `json:"temporary,omitempty"`
	Timeout   *bool `json:"timeout,omitempty"`
}

type NxApp

type NxApp struct {
	Attributes NxAppAttributes          `json:"attributes,omitempty"`
	Privileges []string                 `json:"privileges,omitempty"`
	Create     *[]NxAppCreatePrivileges `json:"create,omitempty"`
}

type NxAppAttributes

type NxAppAttributes struct {
	//shared attributes with on-prem qrs
	ID             string `json:"id,omitempty"`
	Name           string `json:"name,omitempty"`
	Description    string `json:"description,omitempty"`
	Thumbnail      string `json:"thumbnail,omitempty"`
	LastReloadTime string `json:"lastReloadTime,omitempty"`
	CreatedDate    string `json:"createdDate,omitempty"`
	ModifiedDate   string `json:"modifiedDate,omitempty"`
	DynamicColor   string `json:"dynamicColor,omitempty"`
	Published      bool   `json:"published"`
	PublishTime    string `json:"publishTime,omitempty"`

	//special attributes in cloud
	Owner            string          `json:"owner,omitempty"`
	OwnerID          string          `json:"ownerId,omitempty"`
	Custom           json.RawMessage `json:"custom,omitempty"`
	HasSectionAccess bool            `json:"hasSectionAccess,omitempty"`
	Encrypted        bool            `json:"encrypted,omitempty"`
	OriginAppId      string          `json:"originAppId,omitempty"`
	ResourceType     string          `json:"_resourcetype,omitempty"`
}

type NxAppCreatePrivileges

type NxAppCreatePrivileges struct {
	Resource  *string `json:"resource,omitempty"`
	CanCreate *bool   `json:"canCreate,omitempty"`
}
type PagesLinks struct {
	Self Link  `json:"self"`
	Prev *Link `json:"prev,omitempty"`
	Next *Link `json:"next,omitempty"`
}

type PublishApp

type PublishApp struct {
	SpaceId    string              `json:"spaceId,omitempty"`
	Attributes AppUpdateAttributes `json:"attributes,omitempty"`
	Data       string              `json:"data,omitempty"`
}

type Reload

type Reload struct {
	ResponseBase

	Status string  `json:"status,omitempty"`
	Log    *string `json:"log,omitempty"`
}

func (Reload) Failed

func (r Reload) Failed() bool

func (Reload) Finished

func (r Reload) Finished() bool

func (Reload) Succeeded

func (r Reload) Succeeded() bool

type ReloadRequest

type ReloadRequest struct {
	AppId   string `json:"appId,omitempty"`
	Partial bool   `json:"partial,omitempty"`
}

type RepublishApp

type RepublishApp struct {
	TargetId         string              `json:"targetId,omitempty"`
	Data             string              `json:"data,omitempty"` // The republished app will have data from source or target app. The default is source.  * source: Publish with source data * target: Publish with target data
	Attributes       AppUpdateAttributes `json:"attributes,omitempty"`
	CheckOriginAppId bool                `json:"checkOriginAppId,omitempty"`
}

type ResponseBase

type ResponseBase struct {
	ID       *string `json:"id,omitempty"`
	AppID    *string `json:"appId,omitempty"`
	TenantID *string `json:"tenantId,omitempty"`
	UserID   *string `json:"userId,omitempty"`
	Type     *string `json:"type,omitempty"`
}

type Role

type Role struct {
	Id    string `json:"id,omitempty"`
	Name  string `json:"name,omitempty"`
	Type  string `json:"type,omitempty"`
	Level string `json:"level,omitempty"`
}

type RoleType

type RoleType string
const (
	CONSUMER      RoleType = "consumer"
	DATA_CONSUMER RoleType = "dataconsumer"
	FACILITATOR   RoleType = "facilitator"
	PRODUCER      RoleType = "producer"
	CONTRIBUTOR   RoleType = "contributor"
	PUBLISHER     RoleType = "publisher"
	OPERATOR      RoleType = "operator"
)

func (RoleType) IsValid

func (r RoleType) IsValid() bool

func (*RoleType) Normalize

func (r *RoleType) Normalize()

type Space

type Space struct {
	Id          string     `json:"id"`
	Type        *string    `json:"type,omitempty"`
	OwnerId     *string    `json:"ownerId,omitempty"`
	TenantId    string     `json:"tenantId"`
	Name        string     `json:"name"`
	Description *string    `json:"description,omitempty"`
	CreatedAt   *time.Time `json:"createdAt,omitempty"`
	CreatedBy   *string    `json:"createdBy,omitempty"`
	UpdatedAt   *time.Time `json:"updatedAt,omitempty"`
	Meta        *SpaceMeta `json:"meta,omitempty"`
	Links       SpaceLinks `json:"links"`
}

type SpaceAssignment

type SpaceAssignment struct {
	ID            string     `json:"id,omitempty"`
	Type          string     `json:"type,omitempty"`
	AssigneeId    string     `json:"assigneeId,omitempty"`
	Roles         []RoleType `json:"roles,omitempty"`
	SpaceID       string     `json:"spaceId,omitempty"`
	TenantID      string     `json:"tenantId,omitempty"`
	CreatedAt     *time.Time `json:"createdAt,omitempty"`
	CreatedBy     *string    `json:"createdBy,omitempty"`
	LastUpdatedAt *time.Time `json:"lastUpdatedAt,omitempty"`
}

type SpaceAssignmentCreate

type SpaceAssignmentCreate struct {
	Type       string     `json:"type,omitempty"`
	AssigneeId string     `json:"assigneeId,omitempty"`
	Roles      []RoleType `json:"roles,omitempty"`
}

type SpaceCreate

type SpaceCreate struct {
	Name        string `json:"name,omitempty"`
	Description string `json:"description,omitempty"`
	Type        string `json:"type,omitempty"`
}

type SpaceGetParam

type SpaceGetParam struct {
	Name    string `json:"name,omitempty"`
	Action  string `json:"action,omitempty"`
	Type    string `json:"type,omitempty"`
	OwnerId string `json:"ownerId,omitempty"`
}

func (SpaceGetParam) GetRequestParams

func (p SpaceGetParam) GetRequestParams() map[string]string
type SpaceLinks struct {
	Self        Link `json:"self"`
	Assignments Link `json:"assignments"`
}

type SpaceMeta

type SpaceMeta struct {
	Actions         []ActionName `json:"actions"`
	Roles           []RoleType   `json:"roles"`
	AssignableRoles []RoleType   `json:"assignableRoles"`
}

type SpaceUpdate

type SpaceUpdate struct {
	Name        string `json:"name,omitempty"`
	Description string `json:"description,omitempty"`
	OwnerId     string `json:"ownerId,omitempty"`
}

type Spaces

type Spaces struct {
	Data  []Space     `json:"data,omitempty"`
	Meta  *SpacesMeta `json:"meta,omitempty"`
	Links *PagesLinks `json:"links,omitempty"`
}

type SpacesMeta

type SpacesMeta struct {
	Count int32 `json:"count"`
}

type User

type User struct {
	Id            string     `json:"id"`
	TenantId      string     `json:"tenantId"`
	Subject       *string    `json:"subject,omitempty"`
	Status        *string    `json:"status,omitempty"`
	InviteExpiry  *int       `json:"inviteExpiry,omitempty"`
	Name          string     `json:"name"`
	Email         *string    `json:"email,omitempty"`
	CreatedAt     *time.Time `json:"createdAt,omitempty"`
	LastUpdatedAt *time.Time `json:"lastUpdatedAt,omitempty"`
	AssignedRoles []Role     `json:"assignedRoles,omitempty"`
	Links         Link       `json:"links"`
}

type Users

type Users struct {
	Data  []User `json:"data,omitempty"`
	Links *Links `json:"links,omitempty"`
}

Jump to

Keyboard shortcuts

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