@frontapp/ui-bridge
Advanced tools
Comparing version 2.0.0-beta0 to 2.0.0-beta1
@@ -26,5 +26,7 @@ import { Observable } from 'rxjs'; | ||
export * from './internal/asyncTypesV2'; | ||
export * from './internal/channelTypesV2'; | ||
export * from './internal/contactTypesV2'; | ||
export * from './internal/contextTypesV2'; | ||
export * from './internal/conversationTypesV2'; | ||
export * from './internal/draftTypesV2'; | ||
export * from './internal/entryPointTypesV2'; | ||
@@ -34,5 +36,9 @@ export * from './internal/errorTypesV2'; | ||
export * from './internal/idTypesV2'; | ||
export * from './internal/inboxTypesV2'; | ||
export * from './internal/messageTypesV2'; | ||
export * from './internal/paginationTypesV2'; | ||
export * from './internal/recipientTypesV2'; | ||
export * from './internal/tagTypesV2'; | ||
export * from './internal/teammateTypesV2'; | ||
export * from './internal/topicTypesV2'; | ||
export * from './internal/widgetTypesV2'; |
@@ -15,3 +15,2 @@ "use strict"; | ||
__export(require("./internal/asyncTypesV2")); | ||
__export(require("./internal/contextTypesV2")); | ||
__export(require("./internal/entryPointTypesV2")); | ||
@@ -18,0 +17,0 @@ __export(require("./internal/errorTypesV2")); |
@@ -6,5 +6,5 @@ import { ApplicationContactGroupId, ApplicationContactId, ApplicationCustomFieldId, ApplicationTeammateId } from './idTypesV2'; | ||
/** Name of the contact. */ | ||
name?: string; | ||
name: string | undefined; | ||
/** Description of the contact. */ | ||
description?: string; | ||
description: string | undefined; | ||
/** List of the contact's handles. */ | ||
@@ -17,3 +17,3 @@ handles: ReadonlyArray<ApplicationContactHandle>; | ||
} | ||
export declare type ApplicationContactHandleType = 'email' | 'phone' | 'twitter' | 'custom' | 'facebook' | 'intercom' | 'smooch' | 'front_chat' | 'whatsapp' | 'google_play'; | ||
export declare type ApplicationContactHandleType = 'email' | 'phone' | 'twitter' | 'custom' | 'facebook' | 'intercom' | 'smooch' | 'frontChat' | 'whatsapp' | 'googlePlay'; | ||
interface ApplicationContactHandle { | ||
@@ -20,0 +20,0 @@ /** Type of the handle. */ |
import { ApplicationCancelToken } from './asyncTypesV2'; | ||
import { ApplicationContact } from './contactTypesV2'; | ||
import { ApplicationConversation, ApplicationConversationStatus } from './conversationTypesV2'; | ||
import { ApplicationChannelList } from './channelTypesV2'; | ||
import { ApplicationConversation, ApplicationConversationStatus, ApplicationSingleConversation } from './conversationTypesV2'; | ||
import { ApplicationDraft, ApplicationDraftTemplate, ApplicationDraftUpdate } from './draftTypesV2'; | ||
import { EntryPointTypesEnum } from './entryPointTypesV2'; | ||
import { HttpRequest, HttpResponse } from './httpTypesV2'; | ||
import { ApplicationContactId, ApplicationInboxId, ApplicationTagId, ApplicationTeammateId } from './idTypesV2'; | ||
import { ApplicationTeammate } from './teammateTypesV2'; | ||
import { ApplicationDraftId, ApplicationInboxId, ApplicationTagId, ApplicationTeammateId } from './idTypesV2'; | ||
import { ApplicationInboxList } from './inboxTypesV2'; | ||
import { ApplicationMessageList } from './messageTypesV2'; | ||
import { ApplicationPaginationToken } from './paginationTypesV2'; | ||
import { ApplicationTagList } from './tagTypesV2'; | ||
import { ApplicationTeammate, ApplicationTeammateList } from './teammateTypesV2'; | ||
import { ApplicationTopic } from './topicTypesV2'; | ||
import { Widget, WidgetTemplate } from './widgetTypesV2'; | ||
export declare enum ApplicationContextTypesEnum { | ||
NO_CONVERSATION = "NO_CONVERSATION", | ||
MULTI_CONVERSATIONS = "MULTI_CONVERSATIONS", | ||
ALL_CONVERSATIONS = "ALL_CONVERSATIONS", | ||
MESSAGE = "MESSAGE" | ||
} | ||
export interface ApplicationContextBase { | ||
@@ -29,4 +28,4 @@ /** Unique ID for this context. */ | ||
preferences: object; | ||
/** ID of the current teammate. */ | ||
teammateId: ApplicationTeammateId; | ||
/** Current teammate. */ | ||
teammate: ApplicationTeammate; | ||
/** | ||
@@ -68,3 +67,3 @@ * Create a new Widget for the current context. | ||
* Perform a search in Front for the current teammate. | ||
* @param query The search query. | ||
* @param query Search query. | ||
* @param cancelToken Cancel the search request. | ||
@@ -74,24 +73,49 @@ */ | ||
/** | ||
* Fetch a single teammate by ID. | ||
* @param teammateId ID of the teammate to fetch. | ||
* @param cancelToken Cancel the teammate fetch. | ||
* @returns Teammate, if found. | ||
* List the teammates of the company. | ||
* @param paginationToken Token of the requested page. If omitted, will return the first page of results. | ||
* @param cancelToken Cancel the request. | ||
* @returns List of teammates. | ||
*/ | ||
fetchTeammate(teammateId: ApplicationTeammateId, cancelToken?: ApplicationCancelToken): Promise<ApplicationTeammate | null>; | ||
listTeammates(paginationToken?: ApplicationPaginationToken, cancelToken?: ApplicationCancelToken): Promise<ApplicationTeammateList>; | ||
/** | ||
* List the inboxes accessible by the current teammate. | ||
* @param paginationToken Token of the requested page. If omitted, will return the first page of results. | ||
* @param cancelToken Cancel the request. | ||
* @returns List of inboxes. | ||
*/ | ||
listInboxes(paginationToken?: ApplicationPaginationToken, cancelToken?: ApplicationCancelToken): Promise<ApplicationInboxList>; | ||
/** | ||
* List the channels accessible by the current teammate. | ||
* @param paginationToken Token of the requested page. If omitted, will return the first page of results. | ||
* @param cancelToken Cancel the request. | ||
* @returns List of channels. | ||
*/ | ||
listChannels(paginationToken?: ApplicationPaginationToken, cancelToken?: ApplicationCancelToken): Promise<ApplicationChannelList>; | ||
/** | ||
* List the tags accessible by the current teammate. | ||
* @param paginationToken Token of the requested page. If omitted, will return the first page of results. | ||
* @param cancelToken Cancel the request. | ||
* @returns List of tags. | ||
*/ | ||
listTags(paginationToken?: ApplicationPaginationToken, cancelToken?: ApplicationCancelToken): Promise<ApplicationTagList>; | ||
/** | ||
* Create a draft. | ||
* @param template Properties of the draft to create | ||
* @param cancelToken Cancel the request. | ||
* @returns The newly created draft. | ||
*/ | ||
createDraft(template: ApplicationDraftTemplate, cancelToken?: ApplicationCancelToken): Promise<ApplicationDraft>; | ||
/** | ||
* Update a draft. | ||
* @param draftId ID of the draft to update. | ||
* @param update Properties of the draft to update. | ||
* @param cancelToken Cancel the request. | ||
*/ | ||
updateDraft(draftId: ApplicationDraftId, update: ApplicationDraftUpdate, cancelToken?: ApplicationCancelToken): Promise<void>; | ||
} | ||
export interface NoConversationContext extends ApplicationContextBase { | ||
type: ApplicationContextTypesEnum.NO_CONVERSATION; | ||
type: 'noConversation'; | ||
} | ||
export interface MultiConversationsContext extends ApplicationContextBase { | ||
type: ApplicationContextTypesEnum.MULTI_CONVERSATIONS; | ||
/** List of the selected conversations */ | ||
conversations: ReadonlyArray<ApplicationConversation>; | ||
export interface ExistingConversationBaseContext extends ApplicationContextBase { | ||
/** | ||
* Fetch one of the conversation's contact by ID. | ||
* @param contactId ID of the contact to fetch. | ||
* @param cancelToken Cancel the fetch request. | ||
* @returns Contact, if found. | ||
*/ | ||
fetchContact(contactId: ApplicationContactId, cancelToken?: ApplicationCancelToken): Promise<ApplicationContact | null>; | ||
/** | ||
* Add a topic to the selected conversations. | ||
@@ -101,4 +125,5 @@ * @param externalUrl URL of the topic. | ||
* @param cancelToken Cancel the creation of the link. | ||
* @returns The added topic. | ||
*/ | ||
addTopicToConversations(externalUrl: string, name: string | undefined, cancelToken?: ApplicationCancelToken): Promise<ApplicationTopic>; | ||
addTopic(externalUrl: string, name: string | undefined, cancelToken?: ApplicationCancelToken): Promise<ApplicationTopic>; | ||
/** | ||
@@ -109,9 +134,9 @@ * Assign or unassign the selected conversations. | ||
*/ | ||
assignConversations(teammateId: ApplicationTeammateId | null, cancelToken?: ApplicationCancelToken): Promise<void>; | ||
assign(teammateId: ApplicationTeammateId | null, cancelToken?: ApplicationCancelToken): Promise<void>; | ||
/** | ||
* Move the selected conversations to an inbox. | ||
* @param inboxId The ID of the inbox. | ||
* @param inboxId ID of the inbox. | ||
* @param cancelToken Cancel the request. | ||
*/ | ||
moveConversations(inboxId: ApplicationInboxId, cancelToken?: ApplicationCancelToken): Promise<void>; | ||
move(inboxId: ApplicationInboxId, cancelToken?: ApplicationCancelToken): Promise<void>; | ||
/** | ||
@@ -122,22 +147,44 @@ * Set the status of the selected conversations. | ||
*/ | ||
setConversationsStatus(status: ApplicationConversationStatus, cancelToken?: ApplicationCancelToken): Promise<void>; | ||
setStatus(status: ApplicationConversationStatus, cancelToken?: ApplicationCancelToken): Promise<void>; | ||
/** | ||
* Add the specified tags to the selected conversations. | ||
* @param tagIds List of tag IDs to add. | ||
* @param tagIds Tag IDs to add. | ||
* @param cancelToken Cancel the request. | ||
*/ | ||
tagConversations(tagIds: ReadonlyArray<ApplicationTagId>, cancelToken?: ApplicationCancelToken): Promise<void>; | ||
tag(tagIds: ReadonlyArray<ApplicationTagId>, cancelToken?: ApplicationCancelToken): Promise<void>; | ||
/** | ||
* Remove the specified tags from the selected conversations. | ||
* @param tagIds List of tag IDs to remove. | ||
* @param tagIds Tag IDs to remove. | ||
* @param cancelToken Cancel the request. | ||
*/ | ||
untagConversations(tagIds: ReadonlyArray<ApplicationTagId>, cancelToken?: ApplicationCancelToken): Promise<void>; | ||
untag(tagIds: ReadonlyArray<ApplicationTagId>, cancelToken?: ApplicationCancelToken): Promise<void>; | ||
} | ||
export interface AllConversationsContext extends ApplicationContextBase { | ||
type: ApplicationContextTypesEnum.ALL_CONVERSATIONS; | ||
export interface SingleConversationContext extends ExistingConversationBaseContext { | ||
type: 'singleConversation'; | ||
/** The selected conversation. */ | ||
conversation: ApplicationSingleConversation; | ||
/** | ||
* Fetch a draft by ID. | ||
* @param draftId ID of the draft to fetch. | ||
* @param cancelToken Cancel the request. | ||
* @returns The draft, if found. | ||
*/ | ||
fetchDraft(draftId: ApplicationDraftId, cancelToken?: ApplicationCancelToken): Promise<ApplicationDraft | undefined>; | ||
/** | ||
* List the messages in the current conversation. | ||
* @param paginationToken Token of the requested page. If omitted, will return the first page of results. | ||
* @param cancelToken Cancel the request. | ||
* @returns List of messages. | ||
*/ | ||
listMessages(paginationToken?: ApplicationPaginationToken, cancelToken?: ApplicationCancelToken): Promise<ApplicationMessageList>; | ||
} | ||
export declare type ConversationContext = NoConversationContext | MultiConversationsContext | AllConversationsContext; | ||
export interface MultiConversationsContext extends ExistingConversationBaseContext { | ||
type: 'multiConversations'; | ||
/** Selected conversations */ | ||
conversations: ReadonlyArray<ApplicationConversation>; | ||
} | ||
export declare type ExistingConversationContext = SingleConversationContext | MultiConversationsContext; | ||
export declare type ConversationContext = NoConversationContext | SingleConversationContext | MultiConversationsContext; | ||
export interface MessageContext extends ApplicationContextBase { | ||
type: ApplicationContextTypesEnum.MESSAGE; | ||
type: 'message'; | ||
messageId: string; | ||
@@ -147,3 +194,3 @@ } | ||
interface ContextMap { | ||
[EntryPointTypesEnum.CONVERSATION_LINK_DROPDOWN]: MultiConversationsContext; | ||
[EntryPointTypesEnum.CONVERSATION_LINK_DROPDOWN]: ExistingConversationContext; | ||
[EntryPointTypesEnum.MESSAGE_MORE_DROPDOWN]: MessageContext; | ||
@@ -150,0 +197,0 @@ [EntryPointTypesEnum.SIDE_PANEL]: ConversationContext; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var entryPointTypesV2_1 = require("./entryPointTypesV2"); | ||
var ApplicationContextTypesEnum; | ||
(function (ApplicationContextTypesEnum) { | ||
ApplicationContextTypesEnum["NO_CONVERSATION"] = "NO_CONVERSATION"; | ||
ApplicationContextTypesEnum["MULTI_CONVERSATIONS"] = "MULTI_CONVERSATIONS"; | ||
ApplicationContextTypesEnum["ALL_CONVERSATIONS"] = "ALL_CONVERSATIONS"; | ||
ApplicationContextTypesEnum["MESSAGE"] = "MESSAGE"; | ||
})(ApplicationContextTypesEnum = exports.ApplicationContextTypesEnum || (exports.ApplicationContextTypesEnum = {})); |
@@ -1,7 +0,11 @@ | ||
import { ApplicationConversationId, ApplicationInboxId, ApplicationTagId, ApplicationTeammateId, ApplicationTopicId } from './idTypesV2'; | ||
import { ApplicationConversationId, ApplicationDraftId } from './idTypesV2'; | ||
import { ApplicationInbox } from './inboxTypesV2'; | ||
import { ApplicationRecipient } from './recipientTypesV2'; | ||
export declare type ApplicationConversationType = 'email' | 'whatsapp' | 'front_chat' | 'internal' | 'phone_call' | 'tweet' | 'twitter_dm' | 'sms' | 'google_play' | 'intercom' | 'smooch' | 'facebook' | 'custom'; | ||
import { ApplicationTag } from './tagTypesV2'; | ||
import { ApplicationTeammate } from './teammateTypesV2'; | ||
import { ApplicationTopic } from './topicTypesV2'; | ||
export declare type ApplicationConversationType = 'email' | 'whatsapp' | 'frontChat' | 'internal' | 'phoneCall' | 'tweet' | 'twitterDm' | 'sms' | 'googlePlay' | 'intercom' | 'smooch' | 'facebook' | 'custom'; | ||
export declare type ApplicationConversationStatus = 'open' | 'archived' | 'trashed' | 'spam'; | ||
export interface ApplicationConversation { | ||
/** ID of the conversation. */ | ||
/** Unique ID of the conversation. */ | ||
id: ApplicationConversationId; | ||
@@ -13,17 +17,19 @@ /** Type of messages in the conversation. */ | ||
/** Subject. */ | ||
subject?: string; | ||
subject: string | undefined; | ||
/** Blurb of the latest message in the conversation. */ | ||
blurb?: string; | ||
/** ID of the teammate assigned to the conversation, if any. */ | ||
assigneeId?: ApplicationTeammateId; | ||
blurb: string | undefined; | ||
/** Teammate assigned to the conversation, if any. */ | ||
assignee: ApplicationTeammate | undefined; | ||
/** Main recipient of the conversation. */ | ||
recipient?: ApplicationRecipient; | ||
/** List of inbox IDs the conversation is in. */ | ||
inboxIds: ReadonlyArray<ApplicationInboxId>; | ||
/** List of tag IDs attached to the conversation. */ | ||
tagIds: ReadonlyArray<ApplicationTagId>; | ||
/** List of topic IDs attached to the conversation. */ | ||
topicIds: ReadonlyArray<ApplicationTopicId>; | ||
/** Whether the conversation contains a draft message. */ | ||
hasDraft: boolean; | ||
recipient: ApplicationRecipient | undefined; | ||
/** Inboxes the conversation is in. */ | ||
inboxes: ReadonlyArray<ApplicationInbox>; | ||
/** Tags attached to the conversation. */ | ||
tags: ReadonlyArray<ApplicationTag>; | ||
/** Topics attached to the conversation. */ | ||
topics: ReadonlyArray<ApplicationTopic>; | ||
} | ||
export interface ApplicationSingleConversation extends ApplicationConversation { | ||
/** ID of the draft message on this conversation, if any. */ | ||
draftId: ApplicationDraftId | undefined; | ||
} |
@@ -32,2 +32,5 @@ import { Branded } from 'io-ts'; | ||
} | ||
interface ApplicationDraftIdBrand { | ||
readonly publicUidDraft: unique symbol; | ||
} | ||
interface ApplicationInboxIdBrand { | ||
@@ -45,2 +48,5 @@ readonly publicIdInbox: unique symbol; | ||
} | ||
interface ApplicationTeamIdBrand { | ||
readonly publicIdTeam: unique symbol; | ||
} | ||
interface ApplicationTeammateIdBrand { | ||
@@ -52,3 +58,5 @@ readonly publicIdTeammate: unique symbol; | ||
} | ||
export declare type ApplicationResourceIdBrand = ApplicationActivityIdBrand & ApplicationAttachmentIdBrand & ApplicationCalendarEventIdBrand & ApplicationCalendarEventVersionIdBrand & ApplicationCardIdBrand & ApplicationCardGroupIdBrand & ApplicationChannelIdBrand & ApplicationCommentIdBrand & ApplicationConversationIdBrand & ApplicationCustomFieldIdBrand & ApplicationInboxIdBrand & ApplicationMessageIdBrand & ApplicationRuleIdBrand & ApplicationTagIdBrand & ApplicationTeammateIdBrand & ApplicationTopicIdBrand; | ||
export declare type ApplicationResourceIdBrand = ApplicationActivityIdBrand & ApplicationAttachmentIdBrand & ApplicationCalendarEventIdBrand & ApplicationCalendarEventVersionIdBrand & ApplicationCardIdBrand & ApplicationCardGroupIdBrand & ApplicationChannelIdBrand & ApplicationCommentIdBrand & ApplicationConversationIdBrand & ApplicationCustomFieldIdBrand & ApplicationDraftIdBrand & ApplicationInboxIdBrand & ApplicationMessageIdBrand & ApplicationRuleIdBrand & ApplicationTagIdBrand & ApplicationTeamIdBrand & ApplicationTeammateIdBrand & ApplicationTopicIdBrand; | ||
export declare type ApplicationAttachmentId = Branded<string, ApplicationAttachmentIdBrand>; | ||
export declare type ApplicationChannelId = Branded<string, ApplicationChannelIdBrand>; | ||
export declare type ApplicationContactId = Branded<string, ApplicationCardIdBrand>; | ||
@@ -58,6 +66,9 @@ export declare type ApplicationContactGroupId = Branded<string, ApplicationCardGroupIdBrand>; | ||
export declare type ApplicationCustomFieldId = Branded<string, ApplicationCustomFieldIdBrand>; | ||
export declare type ApplicationDraftId = Branded<string, ApplicationDraftIdBrand>; | ||
export declare type ApplicationInboxId = Branded<string, ApplicationInboxIdBrand>; | ||
export declare type ApplicationMessageId = Branded<string, ApplicationMessageIdBrand>; | ||
export declare type ApplicationTagId = Branded<string, ApplicationTagIdBrand>; | ||
export declare type ApplicationTeamId = Branded<string, ApplicationTeamIdBrand>; | ||
export declare type ApplicationTeammateId = Branded<string, ApplicationTeammateIdBrand>; | ||
export declare type ApplicationTopicId = Branded<string, ApplicationTopicIdBrand>; | ||
export {}; |
@@ -1,2 +0,2 @@ | ||
import { ApplicationContactId } from './idTypesV2'; | ||
import { ApplicationContact } from './contactTypesV2'; | ||
export interface ApplicationRecipient { | ||
@@ -6,5 +6,5 @@ /** Handle of the recipient. */ | ||
/** Name of the recipient. */ | ||
name?: string; | ||
/** ID of the contact in Front, if any. */ | ||
contactId?: ApplicationContactId; | ||
name: string | undefined; | ||
/** The corresponding contact, if any. */ | ||
contact: ApplicationContact | undefined; | ||
} |
import { ApplicationTeammateId } from './idTypesV2'; | ||
import { ApplicationPaginatedResults } from './paginationTypesV2'; | ||
export interface ApplicationTeammate { | ||
@@ -12,1 +13,2 @@ /** Unique ID of the teammate. */ | ||
} | ||
export declare type ApplicationTeammateList = ApplicationPaginatedResults<ApplicationTeammate>; |
@@ -8,3 +8,3 @@ import { ApplicationTopicId } from './idTypesV2'; | ||
/** Human readable name. */ | ||
name?: string; | ||
name: string | undefined; | ||
/** URL of the topic. */ | ||
@@ -11,0 +11,0 @@ externalUrl: string; |
{ | ||
"name": "@frontapp/ui-bridge", | ||
"version": "2.0.0-beta0", | ||
"version": "2.0.0-beta1", | ||
"description": "Helpers and TypeScript definitions for the Front SDK bridge", | ||
@@ -5,0 +5,0 @@ "author": { |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
36616
41
804
0