graphql

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package graphql

Copyright © 2023 runtimeracer@gmail.com

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Package graphql

Copyright © 2023 runtimeracer@gmail.com

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Package graphql

Copyright © 2023 runtimeracer@gmail.com

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Package graphql

Copyright © 2023 runtimeracer@gmail.com

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AIDocument

type AIDocument struct {
	ID          gql.String
	Order       gql.Int
	Title       gql.String
	Content     gql.String
	QueueStatus gql.String
	QueuedAt    uint64
	BuiltAt     uint64
	CreatedAt   uint64
	UpdatedAt   uint64
}

type AIEditorResult

type AIEditorResult struct {
	Added            []DatasetLine
	AITrainerGroupID gql.String
	Count            gql.Int
	DeletedIDs       []gql.String
	Generated        []DatasetLine
	Message          gql.String
	MessageType      gql.String
}

type AITrainerGroup

type AITrainerGroup struct {
	ID              gql.String
	Name            gql.String
	Count           gql.Int
	Deleted         gql.Boolean
	Description     gql.String
	DominantColors  []gql.String
	Kudos           Kudos
	NSFW            gql.Boolean
	Personalities   [][]gql.String
	Price           gql.Int
	ProfilePhotoUri gql.String
	Purchased       gql.Boolean
	Status          gql.String
	Tags            []gql.String
	UpdatedAt       uint64
	User            User
}

type AITrainingCondition

type AITrainingCondition struct {
	ASM        *string `json:"asm"`
	Endearment *string `json:"endearment"`
	Recent     *string `json:"recent"`
	Time       *string `json:"time"`
}

func (*AITrainingCondition) Equals

type AiDialogueInput

type AiDialogueInput struct {
	Conditions  AITrainingCondition `json:"conditions"`
	Generated   gql.Boolean         `json:"generated"`
	History     []gql.String        `json:"history"`
	Message     gql.String          `json:"message"`
	UserMessage gql.String          `json:"userMessage"`
}

func (*AiDialogueInput) IsDuplicate

func (e *AiDialogueInput) IsDuplicate(c *AiDialogueInput) bool

type Announcement

type Announcement struct {
	Date      uint64
	Title     gql.String
	Emojis    gql.String
	Content   []gql.String
	TextColor gql.String
}

type ChatMessage

type ChatMessage struct {
	ID              gql.String
	AttachmentUri   gql.String
	ClientID        gql.String
	ChatRoomID      gql.String
	CreatedAt       int64
	DisplayName     gql.String
	InteractionType gql.String
	KajiwotoPetId   gql.String
	Message         gql.String
	ProfilePhotoUri gql.String
	ShowScene       gql.Boolean
	UpdatedAt       int64
	UserID          gql.String
	Username        gql.String
}

type ChatRoom

type ChatRoom struct {
	ID      gql.String
	Deleted gql.Boolean
	Door    ChatRoomDoor
	Note    gql.String
	Private gql.Boolean
}

type ChatRoomDoor

type ChatRoomDoor struct {
	ID              gql.String
	BackgroundColor gql.String
	PhotoUri        gql.String
	Theme           []gql.String
}

type Creator

type Creator struct {
	AllowSubscriptions gql.Boolean
	DatasetTags        []gql.String
}

type DatasetLine

type DatasetLine struct {
	ID               gql.String
	UserMessage      gql.String
	Message          gql.String
	ASM              gql.String
	Endearment       gql.String
	Recent           gql.String
	Time             gql.String
	Deleted          gql.Boolean
	History          []gql.String
	AITrainerGroupID gql.String
}

type Email

type Email struct {
	ID       gql.String
	Address  gql.String
	Verified gql.Boolean
}

type Kaji

type Kaji struct {
	ID              gql.String
	CreatedAt       int64
	Creators        []KajiCreator
	Description     gql.String
	DominantColors  []gql.String
	Kudos           Kudos
	Name            gql.String
	Price           gql.Int
	ProfilePhotoUri gql.String
	Purchased       gql.Boolean
	Scenes          []KajiScene
	SocialMedia     [][]gql.String
	Status          gql.String
	Tags            []gql.String
	UpdatedAt       int64
}

type KajiCreator

type KajiCreator struct {
	ID              gql.String
	Accepted        gql.Boolean
	DisplayName     gql.String
	Owner           gql.Boolean
	Permission      gql.String
	ProfilePhotoUri gql.String
	Username        gql.String
}

type KajiScene

type KajiScene struct {
	ID                gql.String
	CreatedAt         int64
	DominantColors    []gql.String
	Emojis            gql.String
	Messages          []gql.String
	Mood              gql.String
	PhotoUri          gql.String
	State             gql.String
	SuggestedMessages []gql.String
	UpdatedAt         int64
}

type KajiwotoGraphQLClient

type KajiwotoGraphQLClient struct {

	// Auth ID for Client Session
	AuthId string
	// contains filtered or unexported fields
}

KajiwotoGraphQLClient is a custom graphql client for kajiwoto reqeusts using the graphql API

func NewKajiwotoGraphQLClient added in v0.1.1

func NewKajiwotoGraphQLClient(endpoint string) *KajiwotoGraphQLClient

func (*KajiwotoGraphQLClient) AddHeaders

func (c *KajiwotoGraphQLClient) AddHeaders(newHeaders map[string]string)

func (*KajiwotoGraphQLClient) AddToDataset

func (c *KajiwotoGraphQLClient) AddToDataset(aiTrainerGroupID, authToken string, dialogues []*AiDialogueInput) (result AIEditorResult, err error)

func (*KajiwotoGraphQLClient) DoLoginAuthToken

func (c *KajiwotoGraphQLClient) DoLoginAuthToken(authToken string) (result LoginResult, err error)

DoLoginAuthToken performs login via session key if available

func (*KajiwotoGraphQLClient) DoLoginUserPW

func (c *KajiwotoGraphQLClient) DoLoginUserPW(username, password string) (result LoginResult, err error)

DoLoginUserPW performs login via user / pw combination

func (*KajiwotoGraphQLClient) GetAITrainerGroup

func (c *KajiwotoGraphQLClient) GetAITrainerGroup(aiTrainerGroupID, authToken string) (result AITrainerGroup, err error)

func (*KajiwotoGraphQLClient) GetDatasetLines

func (c *KajiwotoGraphQLClient) GetDatasetLines(aiTrainerGroupID, searchQuery, authToken string, limit, offset int) (result []DatasetLine, err error)

func (*KajiwotoGraphQLClient) GetHeaders

func (c *KajiwotoGraphQLClient) GetHeaders() map[string]string

func (*KajiwotoGraphQLClient) GetRoom

func (c *KajiwotoGraphQLClient) GetRoom(chatRoomID, kajiID, authToken string) (result Room, err error)

func (*KajiwotoGraphQLClient) GetRoomHistory

func (c *KajiwotoGraphQLClient) GetRoomHistory(chatRoomID, kajiID, authToken string) (result RoomHistory, err error)

type Kudos

type Kudos struct {
	ID       gql.String
	Upvoted  gql.Boolean
	Upvotes  gql.Int
	Comments gql.Int
}

type Login

type Login struct {
	AuthToken   string
	AppVersion  gql.String
	WebVersion  gql.String
	HasPassword gql.Boolean
	User        User
}

type LoginResult

type LoginResult struct {
	Login   Login
	Welcome Welcome
}

type Phone added in v0.1.5

type Phone struct {
	ID       gql.String
	Number   gql.String
	Verified gql.Boolean
}

type Plus

type Plus struct {
	ExpireAt  uint64
	Cancelled gql.Boolean
	Icon      gql.Int
	Coins     gql.Int
	Type      gql.String
}

type Profile

type Profile struct {
	ID          gql.String
	Color       gql.String
	Description gql.String
	Gender      gql.String
	PhotoUri    gql.String
}

type Room

type Room struct {
	ID                   gql.String
	AITrainerGroupIds    []gql.String
	Birthday             int64
	ChatRoom             ChatRoom
	ChatRoomID           gql.String
	DominantColors       []gql.String
	Gender               gql.String
	Kaji                 Kaji
	KajiDisplayName      gql.String
	KajiID               gql.String
	Mode                 gql.String
	OwnerDisplayName     gql.String
	OwnerID              gql.String
	OwnerProfilePhotoUri gql.String
	OwnerUsername        gql.String
	Persona              gql.String
	PreviewRoom          gql.Boolean
	ProfilePhotoUri      gql.String
	Weight               gql.Int
}

type RoomHistory

type RoomHistory struct {
	ID         gql.String
	ChatRoomID gql.String
	KajiID     gql.String
	Messages   []ChatMessage
}

type Settings

type Settings struct {
	FavoriteRoomIds []gql.String
	FavoriteEmojis  []gql.String
}

type Usage

type Usage struct {
	Generator gql.Int
}

type User

type User struct {
	ID             gql.String
	Banned         gql.Boolean
	Activated      gql.Boolean
	Moderator      gql.Boolean
	Username       gql.String
	DisplayName    gql.String
	BlockedUserIds []gql.String
	Plus           Plus
	Profile        Profile
	Email          Email
	Phone          Phone
}

type Welcome

type Welcome struct {
	Announcement Announcement
}

Jump to

Keyboard shortcuts

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