Models: the messenger, tickets and help
The messenger’s, tickets’ and help center’s models, from package:crm_sdk/wire.dart.
import 'package:crm_sdk/wire.dart';| Name | What it is |
|---|---|
Article | One published article, whole. |
ArticleRatingBody | The guest saying whether an article helped. |
ArticleSummary | An article in a list. |
Articles | The answer to a search: the best matches first; with nothing searched for, the featured articles. |
Attachment | A picture in a part. |
AttachmentBody | Asks for somewhere to upload a picture. |
AttachmentUpload | Where to upload a picture: a form POST to url with fields first and the file last, as a field named “file”. |
Author | Who wrote a part, as the guest is shown it: a member of staff by their first name, never their account or their address. |
BotButton | One of a bot part’s buttons. |
BotPart | What a help-bot part asks of the guest, beside its words. |
BotReplyBody | The guest’s answer to the bot part partId: one of its buttons, or the data it asked for. |
Collection | A group of help articles. |
CollectionArticles | One collection and its articles, in staff’s order. |
Collections | Every collection with an article in it, in staff’s order. |
Conversation | One conversation, with every part the guest sees, oldest first. |
ConversationPage | A page of the guest’s conversations, the most recently changed first. |
ConversationSummary | A conversation in a list. |
ConversationUpdate | The answer to a wait: the parts after the one asked after that the guest sees, and the conversation as it is now. parts is empty when the wait ran out with nothing new. |
CrmUnreadCount | PurrCRM’s answer to a ReadBody: how many staff parts are still unread across every one of the guest’s conversations. |
ExportArticleRating | The guest saying whether an article helped, in their export. |
ExportConversation | One of the guest’s conversations, in their export: every part they could see, and their rating. |
ExportPart | One part of an exported conversation. |
ExportTicket | One of the guest’s tickets, in their export. |
HomeCard | One card of the messenger’s home. |
MessageBody | The guest writing: in a new conversation, in one of theirs, or on a ticket. |
MessengerHome | The messenger’s first screen. |
MessengerLayout | The messenger’s home as the app’s staff published it, for one guest at one moment: the greeting with their name in it, the faces, what it says about a reply, the cards they are to see now, in order (those not for them, a status out of its dates and the help center’s while it is off already left out by PurrCRM), and what they may do. |
MessengerOpening | A help bot’s first words to a new conversation, as the guest would be shown them now: the bot’s parts up to its first question, numbered from 1 like a conversation’s, and nothing kept. |
OpeningRef | Names a MessengerOpening in a StartBody: its workflow, and the version it was worked out from. |
Part | One part of a conversation: a message, a reply or a change. |
RatingBody | The guest’s answer to a rating request. |
ReadBody | The guest has seen a conversation up to a part. |
ReplyExpectation | How soon the guest can expect an answer. |
StartBody | The guest starting a conversation: what they wrote (text and attachmentIds, as a MessageBody), or, under the help bot’s opening, a tap on one of its question’s buttons (button) instead. |
SupportTicket | One of the guest’s tickets: the fields staff let the guest see, and the conversation about it, oldest first. |
SupportTicketPage | The guest’s tickets, the most recently changed first. |
SupportTicketSummary | A ticket in a list. |
TicketField | One field of a ticket and its value: text for a text or a list field, number, boolean or date (YYYY-MM-DD). |
attachmentTypes | The only content types a picture may be. |
checkCollected | What the bot would take for field, as the service reads it (CheckCollected): trimmed, an email lower-cased, an order reference as the app’s orderRef keeps it; null when it would refuse it. |
maxAttachmentBytes | The largest picture: five megabytes. |
maxAttachments | The most pictures one message carries. |
maxCollectRunes | The longest answer the help bot collects. |
maxMessageRunes | The longest message a guest may write. |
maxRating | The best rating; 1 is the worst. |
maxRemarkRunes | The longest remark with a rating. |
messengerWait | The longest a wait is held open with nothing new. |
validEmail | Whether s is an email address the service takes (ValidEmail). |
Article
Section titled “Article”class ArticleOne published article, whole.
Members of Article
Section titled “Members of Article”Article.fromJson()
Section titled “Article.fromJson()”factory Article.fromJson(Map<String, Object?> json)Article()
Section titled “Article()”const Article({required String id, required String slug, required String title, required List<ContentBlock> blocks, required DateTime updatedAt, String summary = '', Collection? collection, List<ArticleSummary> related = const <ArticleSummary>[], String language = '', List<String> languages = const <String>[]})blocks
Section titled “blocks”final List<ContentBlock> blockscollection
Section titled “collection”final Collection? collectionThe collection it is in, when it is in one.
final String idlanguage
Section titled “language”final String languageThe language it is in (a BCP 47 tag): PurrCRM picked it for the guest, their own where the article is written in it and the app’s default where it is not. The package shows what it is given; the tag is for a host that says so.
languages
Section titled “languages”final List<String> languagesEvery language it is written in, the app’s default first.
related
Section titled “related”final List<ArticleSummary> relatedOther articles in the same collection, at most three.
final String slugsummary
Section titled “summary”final String summaryfinal String titleupdatedAt
Section titled “updatedAt”final DateTime updatedAtArticleRatingBody
Section titled “ArticleRatingBody”class ArticleRatingBodyThe guest saying whether an article helped. Asked again, the newer answer is kept.
Members of ArticleRatingBody
Section titled “Members of ArticleRatingBody”ArticleRatingBody.fromJson()
Section titled “ArticleRatingBody.fromJson()”factory ArticleRatingBody.fromJson(Map<String, Object?> json)ArticleRatingBody()
Section titled “ArticleRatingBody()”const ArticleRatingBody({required bool helpful})helpful
Section titled “helpful”final bool helpfultoJson
Section titled “toJson”Map<String, Object?> toJson()ArticleSummary
Section titled “ArticleSummary”class ArticleSummaryAn article in a list.
Members of ArticleSummary
Section titled “Members of ArticleSummary”ArticleSummary.fromJson()
Section titled “ArticleSummary.fromJson()”factory ArticleSummary.fromJson(Map<String, Object?> json)ArticleSummary()
Section titled “ArticleSummary()”const ArticleSummary({required String id, required String slug, required String title, required DateTime updatedAt, String summary = '', String collection = ''})collection
Section titled “collection”final String collectionThe slug of the collection it is in; empty for none.
final String idfinal String slugsummary
Section titled “summary”final String summaryfinal String titleupdatedAt
Section titled “updatedAt”final DateTime updatedAtArticles
Section titled “Articles”class ArticlesThe answer to a search: the best matches first; with nothing searched for, the featured articles.
Members of Articles
Section titled “Members of Articles”Articles.fromJson()
Section titled “Articles.fromJson()”factory Articles.fromJson(Map<String, Object?> json)Articles()
Section titled “Articles()”const Articles({required List<ArticleSummary> items})final List<ArticleSummary> itemsAttachment
Section titled “Attachment”class AttachmentA picture in a part.
Members of Attachment
Section titled “Members of Attachment”Attachment.fromJson()
Section titled “Attachment.fromJson()”factory Attachment.fromJson(Map<String, Object?> json)Attachment()
Section titled “Attachment()”const Attachment({required String id, required String contentType, required int bytes, required String url, required DateTime expiresAt})final int bytescontentType
Section titled “contentType”final String contentTypeexpiresAt
Section titled “expiresAt”final DateTime expiresAtfinal String idfinal String urlWhere to fetch it, until expiresAt; the conversation asked for again
has a new one after that.
AttachmentBody
Section titled “AttachmentBody”class AttachmentBodyAsks for somewhere to upload a picture.
Members of AttachmentBody
Section titled “Members of AttachmentBody”AttachmentBody.fromJson()
Section titled “AttachmentBody.fromJson()”factory AttachmentBody.fromJson(Map<String, Object?> json)AttachmentBody()
Section titled “AttachmentBody()”const AttachmentBody({required String contentType, required int bytes})final int bytesThe picture’s size, at most maxAttachmentBytes.
contentType
Section titled “contentType”final String contentTypeOne of attachmentTypes.
toJson
Section titled “toJson”Map<String, Object?> toJson()AttachmentUpload
Section titled “AttachmentUpload”class AttachmentUploadWhere to upload a picture: a form POST to url with fields first and
the file last, as a field named “file”. The picture is sent by naming
id in a MessageBody before expiresAt.
Members of AttachmentUpload
Section titled “Members of AttachmentUpload”AttachmentUpload.fromJson()
Section titled “AttachmentUpload.fromJson()”factory AttachmentUpload.fromJson(Map<String, Object?> json)AttachmentUpload()
Section titled “AttachmentUpload()”const AttachmentUpload({required String id, required String url, required Map<String, String> fields, required int maxBytes, required DateTime expiresAt})expiresAt
Section titled “expiresAt”final DateTime expiresAtfields
Section titled “fields”final Map<String, String> fieldsfinal String idmaxBytes
Section titled “maxBytes”final int maxBytesfinal String urlAuthor
Section titled “Author”class AuthorWho wrote a part, as the guest is shown it: a member of staff by their first name, never their account or their address.
Members of Author
Section titled “Members of Author”Author.fromJson()
Section titled “Author.fromJson()”factory Author.fromJson(Map<String, Object?> json)Author()
Section titled “Author()”const Author({required AuthorKind kind, String name = ''})final AuthorKind kindfinal String nameA teammate’s first name or the bot’s name; empty for the guest and the messenger.
isGuest
Section titled “isGuest”bool get isGuestWritten by the guest, rather than by staff, the bot or the messenger.
BotButton
Section titled “BotButton”class BotButtonOne of a bot part’s buttons.
Members of BotButton
Section titled “Members of BotButton”BotButton.fromJson()
Section titled “BotButton.fromJson()”factory BotButton.fromJson(Map<String, Object?> json)BotButton()
Section titled “BotButton()”const BotButton({required String id, required String label})final String idWhat the answer names.
final String labelWhat the guest reads, and what their answer says they said.
BotPart
Section titled “BotPart”class BotPartWhat a help-bot part asks of the guest, beside its words.
Members of BotPart
Section titled “Members of BotPart”BotPart.fromJson()
Section titled “BotPart.fromJson()”factory BotPart.fromJson(Map<String, Object?> json)BotPart()
Section titled “BotPart()”const BotPart({required BotKind kind, List<BotButton> buttons = const <BotButton>[], CollectField collect = CollectField.unknown, List<ArticleSummary> articles = const <ArticleSummary>[], ReplyExpectation? reply, CrmOrderRef? orderRef})articles
Section titled “articles”final List<ArticleSummary> articlesA suggestion’s, each opened in the help center.
buttons
Section titled “buttons”final List<BotButton> buttonsAn ask’s, and a suggestion’s yes and no.
collect
Section titled “collect”final CollectField collectWhat a collecting part asks for.
final BotKind kindorderRef
Section titled “orderRef”final CrmOrderRef? orderReffinal ReplyExpectation? replyA hand-off’s: how soon a person answers.
BotReplyBody
Section titled “BotReplyBody”class BotReplyBodyThe guest’s answer to the bot part partId: one of its buttons, or
the data it asked for. Exactly one of button and value.
Members of BotReplyBody
Section titled “Members of BotReplyBody”BotReplyBody.fromJson()
Section titled “BotReplyBody.fromJson()”factory BotReplyBody.fromJson(Map<String, Object?> json)BotReplyBody()
Section titled “BotReplyBody()”const BotReplyBody({required String partId, String button = '', String value = ''})button
Section titled “button”final String buttonpartId
Section titled “partId”final String partIdfinal String valuetoJson
Section titled “toJson”Map<String, Object?> toJson()Collection
Section titled “Collection”class CollectionA group of help articles.
Members of Collection
Section titled “Members of Collection”Collection.fromJson()
Section titled “Collection.fromJson()”factory Collection.fromJson(Map<String, Object?> json)Collection()
Section titled “Collection()”const Collection({required String id, required String slug, required String title, required int articles, String description = ''})articles
Section titled “articles”final int articlesHow many published articles the guest can read in it.
description
Section titled “description”final String descriptionfinal String idfinal String slugfinal String titleCollectionArticles
Section titled “CollectionArticles”class CollectionArticlesOne collection and its articles, in staff’s order.
Members of CollectionArticles
Section titled “Members of CollectionArticles”CollectionArticles.fromJson()
Section titled “CollectionArticles.fromJson()”factory CollectionArticles.fromJson(Map<String, Object?> json)CollectionArticles()
Section titled “CollectionArticles()”const CollectionArticles({required Collection collection, required List<ArticleSummary> articles})articles
Section titled “articles”final List<ArticleSummary> articlescollection
Section titled “collection”final Collection collectionCollections
Section titled “Collections”class CollectionsEvery collection with an article in it, in staff’s order.
Members of Collections
Section titled “Members of Collections”Collections.fromJson()
Section titled “Collections.fromJson()”factory Collections.fromJson(Map<String, Object?> json)Collections()
Section titled “Collections()”const Collections({required List<Collection> items})final List<Collection> itemsConversation
Section titled “Conversation”class ConversationOne conversation, with every part the guest sees, oldest first.
Members of Conversation
Section titled “Members of Conversation”Conversation.fromJson()
Section titled “Conversation.fromJson()”factory Conversation.fromJson(Map<String, Object?> json)Conversation()
Section titled “Conversation()”const Conversation({required String id, required ConversationState state, required List<Part> parts, required int lastSeq, required int unread, required ReplyExpectation reply, required DateTime createdAt, required DateTime updatedAt, Author? assignee, String ticketId = '', String awaiting = ''})assignee
Section titled “assignee”final Author? assigneeThe member of staff answering, when one is.
awaiting
Section titled “awaiting”final String awaitingThe bot part the help bot waits on the guest to answer; empty when it waits on nothing. Only that part’s buttons or box are live.
createdAt
Section titled “createdAt”final DateTime createdAtfinal String idlastSeq
Section titled “lastSeq”final int lastSeqThe newest part’s seq, including those the guest is not shown, so that a wait asked after it waits for the next.
final List<Part> partsfinal ReplyExpectation replyfinal ConversationState stateOpen or closed; snoozed is shown as open.
ticketId
Section titled “ticketId”final String ticketIdThe ticket this conversation is about; empty when there is none.
unread
Section titled “unread”final int unreadHow many staff parts the guest has not read.
updatedAt
Section titled “updatedAt”final DateTime updatedAtConversationPage
Section titled “ConversationPage”class ConversationPageA page of the guest’s conversations, the most recently changed first.
Members of ConversationPage
Section titled “Members of ConversationPage”ConversationPage.fromJson()
Section titled “ConversationPage.fromJson()”factory ConversationPage.fromJson(Map<String, Object?> json)ConversationPage()
Section titled “ConversationPage()”const ConversationPage({required List<ConversationSummary> items, String nextBefore = ''})final List<ConversationSummary> itemsnextBefore
Section titled “nextBefore”final String nextBeforeThe conversation to ask for older ones before; empty when there are none.
ConversationSummary
Section titled “ConversationSummary”class ConversationSummaryA conversation in a list.
Members of ConversationSummary
Section titled “Members of ConversationSummary”ConversationSummary.fromJson()
Section titled “ConversationSummary.fromJson()”factory ConversationSummary.fromJson(Map<String, Object?> json)ConversationSummary()
Section titled “ConversationSummary()”const ConversationSummary({required String id, required ConversationState state, required String preview, required Author previewAuthor, required int unread, required DateTime createdAt, required DateTime updatedAt})createdAt
Section titled “createdAt”final DateTime createdAtfinal String idpreview
Section titled “preview”final String previewThe newest part the guest sees, as a line of text.
previewAuthor
Section titled “previewAuthor”final Author previewAuthorfinal ConversationState stateunread
Section titled “unread”final int unreadupdatedAt
Section titled “updatedAt”final DateTime updatedAtConversationUpdate
Section titled “ConversationUpdate”class ConversationUpdateThe answer to a wait: the parts after the one asked after that the
guest sees, and the conversation as it is now. parts is empty when
the wait ran out with nothing new.
Members of ConversationUpdate
Section titled “Members of ConversationUpdate”ConversationUpdate.fromJson()
Section titled “ConversationUpdate.fromJson()”factory ConversationUpdate.fromJson(Map<String, Object?> json)ConversationUpdate()
Section titled “ConversationUpdate()”const ConversationUpdate({required List<Part> parts, required ConversationState state, required int lastSeq, required int unread, String awaiting = ''})awaiting
Section titled “awaiting”final String awaitingThe bot part the help bot waits on now (Conversation.awaiting).
lastSeq
Section titled “lastSeq”final int lastSeqfinal List<Part> partsfinal ConversationState stateunread
Section titled “unread”final int unreadCrmUnreadCount
Section titled “CrmUnreadCount”class CrmUnreadCountPurrCRM’s answer to a ReadBody: how many staff parts are still unread
across every one of the guest’s conversations. PurrCRM answers with the
guest routes’ own unread count, which a host’s own bell can show too;
the Dart name is the package’s, so that a host with a bell of its own
keeps its name for it.
Members of CrmUnreadCount
Section titled “Members of CrmUnreadCount”CrmUnreadCount.fromJson()
Section titled “CrmUnreadCount.fromJson()”factory CrmUnreadCount.fromJson(Map<String, Object?> json)CrmUnreadCount()
Section titled “CrmUnreadCount()”const CrmUnreadCount({required int unread})unread
Section titled “unread”final int unreadExportArticleRating
Section titled “ExportArticleRating”class ExportArticleRatingThe guest saying whether an article helped, in their export.
Members of ExportArticleRating
Section titled “Members of ExportArticleRating”ExportArticleRating.fromJson()
Section titled “ExportArticleRating.fromJson()”factory ExportArticleRating.fromJson(Map<String, Object?> json)ExportArticleRating()
Section titled “ExportArticleRating()”const ExportArticleRating({required String article, required bool helpful, required DateTime ratedAt})article
Section titled “article”final String articleThe article’s title, as it was when rated.
helpful
Section titled “helpful”final bool helpfulratedAt
Section titled “ratedAt”final DateTime ratedAtExportConversation
Section titled “ExportConversation”class ExportConversationOne of the guest’s conversations, in their export: every part they could see, and their rating.
Members of ExportConversation
Section titled “Members of ExportConversation”ExportConversation.fromJson()
Section titled “ExportConversation.fromJson()”factory ExportConversation.fromJson(Map<String, Object?> json)ExportConversation()
Section titled “ExportConversation()”const ExportConversation({required String id, required ConversationState state, required List<ExportPart> parts, required DateTime createdAt, int? rating, String remark = ''})createdAt
Section titled “createdAt”final DateTime createdAtfinal String idfinal List<ExportPart> partsrating
Section titled “rating”final int? ratingremark
Section titled “remark”final String remarkfinal ConversationState stateExportPart
Section titled “ExportPart”class ExportPartOne part of an exported conversation. A picture is named by its content type and size: the file is sent on request, not in the export.
Members of ExportPart
Section titled “Members of ExportPart”ExportPart.fromJson()
Section titled “ExportPart.fromJson()”factory ExportPart.fromJson(Map<String, Object?> json)ExportPart()
Section titled “ExportPart()”const ExportPart({required PartKind kind, required Author author, required DateTime createdAt, String text = '', List<ContentBlock> blocks = const <ContentBlock>[], List<String> attachments = const <String>[]})attachments
Section titled “attachments”final List<String> attachmentsauthor
Section titled “author”final Author authorblocks
Section titled “blocks”final List<ContentBlock> blockscreatedAt
Section titled “createdAt”final DateTime createdAtfinal PartKind kindfinal String textExportTicket
Section titled “ExportTicket”class ExportTicketOne of the guest’s tickets, in their export.
Members of ExportTicket
Section titled “Members of ExportTicket”ExportTicket.fromJson()
Section titled “ExportTicket.fromJson()”factory ExportTicket.fromJson(Map<String, Object?> json)ExportTicket()
Section titled “ExportTicket()”const ExportTicket({required String ref, required String title, required String type, required TicketState state, required List<TicketField> fields, required DateTime createdAt, DateTime? resolvedAt})createdAt
Section titled “createdAt”final DateTime createdAtfields
Section titled “fields”final List<TicketField> fieldsfinal String refresolvedAt
Section titled “resolvedAt”final DateTime? resolvedAtfinal TicketState statefinal String titlefinal String typeHomeCard
Section titled “HomeCard”class HomeCardOne card of the messenger’s home. Only what its kind draws is set: a
link card’s title, text and link; a status card’s text, and its
title and link when it has them; an articles card’s articles.
Members of HomeCard
Section titled “Members of HomeCard”HomeCard.fromJson()
Section titled “HomeCard.fromJson()”factory HomeCard.fromJson(Map<String, Object?> json)HomeCard()
Section titled “HomeCard()”const HomeCard({required String id, required HomeCardKind kind, String title = '', String text = '', String link = '', List<ArticleSummary> articles = const <ArticleSummary>[]})articles
Section titled “articles”final List<ArticleSummary> articlesfinal String idThe card’s own, the same on every read.
final HomeCardKind kindfinal String linkA path in the app or an https link; empty for none.
final String textfinal String titleMessageBody
Section titled “MessageBody”class MessageBodyThe guest writing: in a new conversation, in one of theirs, or on a ticket. Text, pictures, or both.
Members of MessageBody
Section titled “Members of MessageBody”MessageBody.fromJson()
Section titled “MessageBody.fromJson()”factory MessageBody.fromJson(Map<String, Object?> json)MessageBody()
Section titled “MessageBody()”const MessageBody({required String text, List<String> attachmentIds = const []})attachmentIds
Section titled “attachmentIds”final List<String> attachmentIdsPictures uploaded through an AttachmentUpload and not yet sent.
final String texttoJson
Section titled “toJson”Map<String, Object?> toJson()MessengerHome
Section titled “MessengerHome”class MessengerHomeThe messenger’s first screen.
Members of MessengerHome
Section titled “Members of MessengerHome”MessengerHome.fromJson()
Section titled “MessengerHome.fromJson()”factory MessengerHome.fromJson(Map<String, Object?> json)MessengerHome()
Section titled “MessengerHome()”const MessengerHome({required List<ConversationSummary> open, required int unread, required ReplyExpectation reply, List<ArticleSummary> articles = const <ArticleSummary>[], List<SupportTicketSummary> tickets = const <SupportTicketSummary>[], MessengerOpening? opening, MessengerLayout? layout})articles
Section titled “articles”final List<ArticleSummary> articlesThe help center’s featured articles; empty while it is off.
layout
Section titled “layout”final MessengerLayout? layoutThe home as the app’s staff published it, worked out for this guest now; null until they publish one (and from a CRM before 0.4.0’s), when the messenger draws the home it always drew.
final List<ConversationSummary> openThe guest’s open conversations, the most recently changed first, at most three.
opening
Section titled “opening”final MessengerOpening? openingWhat the help bot says to a new conversation before the guest writes; null when no help bot greets them first (it then speaks once they have written), when they may not start one now, and from a CRM before openings.
final ReplyExpectation replytickets
Section titled “tickets”final List<SupportTicketSummary> ticketsThe guest’s tickets not yet resolved, and those resolved in the last week.
unread
Section titled “unread”final int unreadEvery staff part the guest has not read, in every conversation.
picturesAllowed
Section titled “picturesAllowed”bool get picturesAllowedWhether the guest may send pictures: as the published home says, and yes without one.
MessengerLayout
Section titled “MessengerLayout”class MessengerLayoutThe messenger’s home as the app’s staff published it, for one guest at one moment: the greeting with their name in it, the faces, what it says about a reply, the cards they are to see now, in order (those not for them, a status out of its dates and the help center’s while it is off already left out by PurrCRM), and what they may do. The help bot’s opening is not part of it: the home greets, and the bot speaks first in the conversation the send card starts.
Members of MessengerLayout
Section titled “Members of MessengerLayout”MessengerLayout.fromJson()
Section titled “MessengerLayout.fromJson()”factory MessengerLayout.fromJson(Map<String, Object?> json)MessengerLayout()
Section titled “MessengerLayout()”const MessengerLayout({String greeting = '', String intro = '', TeamFaces faces = TeamFaces.auto, List<Author> team = const <Author>[], bool names = false, String replyText = '', String awayText = '', List<HomeCard> cards = const <HomeCard>[], NewConversations newConversation = NewConversations.always, bool attachments = true, bool helpCenter = true})attachments
Section titled “attachments”final bool attachmentsThe guest may send pictures.
awayText
Section titled “awayText”final String awayTextSaid instead while the team is away; empty for “We’re back …”.
final List<HomeCard> cardsThe guest’s cards, in order, those of a kind this version does not know left out.
final TeamFaces facesgreeting
Section titled “greeting”final String greetingThe heading, personalised; empty for the package’s own words.
helpCenter
Section titled “helpCenter”final bool helpCenterThe home points to the help center.
final String introA line under it; empty for none.
final bool namesWrite the chosen teammates’ names under their faces.
newConversation
Section titled “newConversation”final NewConversations newConversationreplyText
Section titled “replyText”final String replyTextHow soon a reply comes, in staff’s words; empty for the line worked out from the reply expectation.
final List<Author> teamThe teammates to show when faces is chosen, by first name.
MessengerOpening
Section titled “MessengerOpening”class MessengerOpeningA help bot’s first words to a new conversation, as the guest would be
shown them now: the bot’s parts up to its first question, numbered
from 1 like a conversation’s, and nothing kept. A new-chat screen shows
them as the bot’s; the conversation is made when the guest taps one of
the awaiting part’s buttons or writes, with MessengerApi.start given
this opening, and its parts then are the conversation’s own, with ids of
their own.
Members of MessengerOpening
Section titled “Members of MessengerOpening”MessengerOpening.fromJson()
Section titled “MessengerOpening.fromJson()”factory MessengerOpening.fromJson(Map<String, Object?> json)MessengerOpening()
Section titled “MessengerOpening()”const MessengerOpening({required String workflow, required int version, required List<Part> parts, String awaiting = ''})awaiting
Section titled “awaiting”final String awaitingThe id of the part whose question the bot waits on, as
Conversation.awaiting: its buttons are live, or the composer asks for
what it collects. Empty when it asks nothing.
final List<Part> partsThe bot’s parts, oldest first.
version
Section titled “version”final int versionworkflow
Section titled “workflow”final String workflowThe help bot’s workflow, and the version the opening is of.
question
Section titled “question”Part? get questionThe part the bot waits on, when it waits on one.
OpeningRef
Section titled “OpeningRef”class OpeningRefNames a MessengerOpening in a StartBody: its workflow, and the
version it was worked out from.
Members of OpeningRef
Section titled “Members of OpeningRef”OpeningRef.fromJson()
Section titled “OpeningRef.fromJson()”factory OpeningRef.fromJson(Map<String, Object?> json)OpeningRef()
Section titled “OpeningRef()”const OpeningRef({required String workflow, required int version})OpeningRef.of()
Section titled “OpeningRef.of()”OpeningRef.of(MessengerOpening o)The opening o names.
version
Section titled “version”final int versionworkflow
Section titled “workflow”final String workflowtoJson
Section titled “toJson”Map<String, Object?> toJson()class PartOne part of a conversation: a message, a reply or a change. Only the
fields its kind names are set.
Members of Part
Section titled “Members of Part”Part.fromJson()
Section titled “Part.fromJson()”factory Part.fromJson(Map<String, Object?> json)Part()
Section titled “Part()”const Part({required String id, required int seq, required PartKind kind, required Author author, required DateTime createdAt, String text = '', List<ContentBlock> blocks = const <ContentBlock>[], List<Attachment> attachments = const <Attachment>[], ConversationState state = ConversationState.unknown, int? rating, BotPart? bot})attachments
Section titled “attachments”final List<Attachment> attachmentsauthor
Section titled “author”final Author authorblocks
Section titled “blocks”final List<ContentBlock> blocksA reply’s or the bot’s words.
final BotPart? botWhat a help-bot part asks of the guest; null for any other part.
createdAt
Section titled “createdAt”final DateTime createdAtfinal String idfinal PartKind kindrating
Section titled “rating”final int? ratingThe guest’s answer to a rating request, 1 to maxRating, once given.
final int seqOrders the conversation’s parts, from 1; what a wait is asked after.
final ConversationState stateWhere a state part moved the conversation to.
final String textWhat the guest wrote, as they wrote it.
RatingBody
Section titled “RatingBody”class RatingBodyThe guest’s answer to a rating request.
Members of RatingBody
Section titled “Members of RatingBody”RatingBody.fromJson()
Section titled “RatingBody.fromJson()”factory RatingBody.fromJson(Map<String, Object?> json)RatingBody()
Section titled “RatingBody()”const RatingBody({required int rating, String remark = ''})rating
Section titled “rating”final int rating1 (bad) to maxRating (great).
remark
Section titled “remark”final String remarkAnything they want to add; at most maxRemarkRunes.
toJson
Section titled “toJson”Map<String, Object?> toJson()ReadBody
Section titled “ReadBody”class ReadBodyThe guest has seen a conversation up to a part.
Members of ReadBody
Section titled “Members of ReadBody”ReadBody.fromJson()
Section titled “ReadBody.fromJson()”factory ReadBody.fromJson(Map<String, Object?> json)ReadBody()
Section titled “ReadBody()”const ReadBody({required int seq})final int seqtoJson
Section titled “toJson”Map<String, Object?> toJson()ReplyExpectation
Section titled “ReplyExpectation”class ReplyExpectationHow soon the guest can expect an answer.
Members of ReplyExpectation
Section titled “Members of ReplyExpectation”ReplyExpectation.fromJson()
Section titled “ReplyExpectation.fromJson()”factory ReplyExpectation.fromJson(Map<String, Object?> json)ReplyExpectation()
Section titled “ReplyExpectation()”const ReplyExpectation({required ReplyTime within, required bool open, DateTime? opensAt})final bool openStaff are at work now, by the team’s office hours.
opensAt
Section titled “opensAt”final DateTime? opensAtWhen they are next at work, when they are not now.
within
Section titled “within”final ReplyTime withinStartBody
Section titled “StartBody”class StartBodyThe guest starting a conversation: what they wrote (text and
attachmentIds, as a MessageBody), or, under the help bot’s
opening, a tap on one of its question’s buttons (button) instead.
With an opening the bot’s parts come first in the conversation, and
the tap or the words are its answer; without one the guest’s words
come first, and the bot after them.
Members of StartBody
Section titled “Members of StartBody”StartBody.fromJson()
Section titled “StartBody.fromJson()”factory StartBody.fromJson(Map<String, Object?> json)StartBody.message()
Section titled “StartBody.message()”StartBody.message(MessageBody body, {OpeningRef? opening})The guest’s words under opening (or with none), as written.
StartBody()
Section titled “StartBody()”const StartBody({String text = '', List<String> attachmentIds = const [], OpeningRef? opening, String button = ''})attachmentIds
Section titled “attachmentIds”final List<String> attachmentIdsPictures uploaded through an AttachmentUpload and not yet sent.
button
Section titled “button”final String buttonThe id of the opening’s button the guest tapped, with no words or
pictures; empty when they wrote.
opening
Section titled “opening”final OpeningRef? openingThe opening the guest was shown when they wrote or tapped; null for none.
final String texttoJson
Section titled “toJson”Map<String, Object?> toJson()SupportTicket
Section titled “SupportTicket”class SupportTicketOne of the guest’s tickets: the fields staff let the guest see, and the conversation about it, oldest first.
Members of SupportTicket
Section titled “Members of SupportTicket”SupportTicket.fromJson()
Section titled “SupportTicket.fromJson()”factory SupportTicket.fromJson(Map<String, Object?> json)SupportTicket()
Section titled “SupportTicket()”const SupportTicket({required String id, required String ref, required String title, required String type, required TicketState state, required DateTime createdAt, required DateTime updatedAt, List<ContentBlock> description = const <ContentBlock>[], List<TicketField> fields = const <TicketField>[], String conversationId = '', List<Part> parts = const <Part>[], DateTime? resolvedAt})conversationId
Section titled “conversationId”final String conversationIdThe conversation the ticket’s parts are in; empty when there is none.
createdAt
Section titled “createdAt”final DateTime createdAtdescription
Section titled “description”final List<ContentBlock> descriptionWhat staff wrote the ticket is for.
fields
Section titled “fields”final List<TicketField> fieldsfinal String idfinal List<Part> partsfinal String refresolvedAt
Section titled “resolvedAt”final DateTime? resolvedAtfinal TicketState statefinal String titlefinal String typeupdatedAt
Section titled “updatedAt”final DateTime updatedAtSupportTicketPage
Section titled “SupportTicketPage”class SupportTicketPageThe guest’s tickets, the most recently changed first.
Members of SupportTicketPage
Section titled “Members of SupportTicketPage”SupportTicketPage.fromJson()
Section titled “SupportTicketPage.fromJson()”factory SupportTicketPage.fromJson(Map<String, Object?> json)SupportTicketPage()
Section titled “SupportTicketPage()”const SupportTicketPage({required List<SupportTicketSummary> items})final List<SupportTicketSummary> itemsSupportTicketSummary
Section titled “SupportTicketSummary”class SupportTicketSummaryA ticket in a list.
Members of SupportTicketSummary
Section titled “Members of SupportTicketSummary”SupportTicketSummary.fromJson()
Section titled “SupportTicketSummary.fromJson()”factory SupportTicketSummary.fromJson(Map<String, Object?> json)SupportTicketSummary()
Section titled “SupportTicketSummary()”const SupportTicketSummary({required String id, required String ref, required String title, required String type, required TicketState state, required DateTime updatedAt})final String idfinal String refHow the guest and staff name it: “T-1042”.
final TicketState statefinal String titlefinal String typeThe ticket’s kind, in staff’s words (“Order issue”).
updatedAt
Section titled “updatedAt”final DateTime updatedAtTicketField
Section titled “TicketField”class TicketFieldOne field of a ticket and its value: text for a text or a list field,
number, boolean or date (YYYY-MM-DD). A field with no value has
none of them.
Members of TicketField
Section titled “Members of TicketField”TicketField.fromJson()
Section titled “TicketField.fromJson()”factory TicketField.fromJson(Map<String, Object?> json)TicketField()
Section titled “TicketField()”const TicketField({required String key, required String label, required FieldType type, String text = '', double? number, bool? boolean, String date = ''})boolean
Section titled “boolean”final bool? booleanfinal String datefinal String keyfinal String labelnumber
Section titled “number”final double? numberfinal String textfinal FieldType typehasValue
Section titled “hasValue”bool get hasValueWhether the field has a value to show.
attachmentTypes
Section titled “attachmentTypes”const List<String> attachmentTypesThe only content types a picture may be. The Go variable is AttachmentTypes.
checkCollected
Section titled “checkCollected”String? checkCollected(CollectField field, String value, [CrmOrderRef? orderRef])What the bot would take for field, as the service reads it
(CheckCollected): trimmed, an email lower-cased, an order reference as
the app’s orderRef keeps it; null when it would refuse it. With no
order reference on the collecting part, any words are taken as they are
and PurrCRM decides: the package has no format of its own to hold them
to.
maxAttachmentBytes
Section titled “maxAttachmentBytes”const int maxAttachmentBytesThe largest picture: five megabytes. The Go constant is MaxAttachmentBytes.
maxAttachments
Section titled “maxAttachments”const int maxAttachmentsThe most pictures one message carries. The Go constant is MaxAttachments.
maxCollectRunes
Section titled “maxCollectRunes”const int maxCollectRunesThe longest answer the help bot collects. The Go constant is MaxCollectRunes.
maxMessageRunes
Section titled “maxMessageRunes”const int maxMessageRunesThe longest message a guest may write. The Go constant is MaxMessageRunes.
maxRating
Section titled “maxRating”const int maxRatingThe best rating; 1 is the worst. The Go constant is MaxRating.
maxRemarkRunes
Section titled “maxRemarkRunes”const int maxRemarkRunesThe longest remark with a rating. The Go constant is MaxRemarkRunes.
messengerWait
Section titled “messengerWait”const Duration messengerWaitThe longest a wait is held open with nothing new. The Go constant is MessengerWait.
validEmail
Section titled “validEmail”bool validEmail(String s)Whether s is an email address the service takes (ValidEmail).