From b0746bbc58d3ce0f01bdc1e9fd18e2df936266a1 Mon Sep 17 00:00:00 2001 From: Mathias Vagni Date: Fri, 9 Feb 2024 10:49:55 +0100 Subject: [PATCH] Add component input types --- .changeset/empty-suits-brake.md | 5 ++ src/graphql/types.ts | 106 +++++++++++++++++++++++++++++++- src/index.ts | 2 + 3 files changed, 112 insertions(+), 1 deletion(-) create mode 100644 .changeset/empty-suits-brake.md diff --git a/.changeset/empty-suits-brake.md b/.changeset/empty-suits-brake.md new file mode 100644 index 0000000..cbfa442 --- /dev/null +++ b/.changeset/empty-suits-brake.md @@ -0,0 +1,5 @@ +--- +'@team-plain/typescript-sdk': minor +--- + +Expose ComponentInput and EventComponentInput diff --git a/src/graphql/types.ts b/src/graphql/types.ts index e3789a5..bcb50ad 100644 --- a/src/graphql/types.ts +++ b/src/graphql/types.ts @@ -815,6 +815,8 @@ export type Customer = { assignedAt: Maybe; /** The user the customer is assigned to. */ assignedToUser: Maybe; + /** The avatar URL of the customer. */ + avatarUrl: Maybe; /** The company the customer belongs to. */ company: Maybe; createdAt: DateTime; @@ -1480,11 +1482,21 @@ export enum EmailAuthenticity { Unknown = 'UNKNOWN' } +export type EmailBounce = { + __typename?: 'EmailBounce'; + bouncedAt: DateTime; + isSendRetriable: Scalars['Boolean']; + recipient: EmailParticipant; +}; + export type EmailEntry = { __typename?: 'EmailEntry'; additionalRecipients: Array; + /** All the attachments included in this email. */ attachments: Array; authenticity: EmailAuthenticity; + /** If any of the recipients bounces the email, this will contain the list of bounces. */ + bounces: Array; emailId: Scalars['ID']; from: EmailParticipant; /** The full email's markdown content, including all replies. */ @@ -1502,7 +1514,9 @@ export type EmailEntry = { markdownContent: Maybe; /** When the email was received by Plain. */ receivedAt: Maybe; - /** When the email was sent. Initially set to null while the email is being processed. */ + /** Informs whether the email was sent successfully, bounced or failed. If the email is still being sent, the status will be 'PENDING'. Only set for outbound emails. */ + sendStatus: Maybe; + /** When the email was sent. Only set for outbound emails and will be null until the email is sent. */ sentAt: Maybe; subject: Maybe; /** The most recent email's text content. */ @@ -1528,6 +1542,17 @@ export type EmailPreviewUrl = { previewUrl: Scalars['String']; }; +export enum EmailSendStatus { + /** Some (or all) of the recipients bounced the email, meaning they did not recieve it. Check 'bounces' for more details on which recipients bounced. */ + Bounced = 'BOUNCED', + /** The email failed to send. This will happen if the main recipient (To) bounced the email, or if there was an unexpected error sending the email. */ + Failed = 'FAILED', + /** The email is being sent. */ + Pending = 'PENDING', + /** The email was sent successfully to all recipients. */ + Sent = 'SENT' +} + export type EmailSignature = { __typename?: 'EmailSignature'; createdAt: DateTime; @@ -1561,6 +1586,17 @@ export type FileSize = { megaBytes: Scalars['Float']; }; +export type ForkThreadInput = { + threadId: Scalars['ID']; + timelineEntryId: Scalars['ID']; +}; + +export type ForkThreadOutput = { + __typename?: 'ForkThreadOutput'; + error: Maybe; + thread: Maybe; +}; + export type IntInput = { value: Scalars['Int']; }; @@ -1798,6 +1834,7 @@ export type Mutation = { deleteWorkspaceInvite: DeleteWorkspaceInviteOutput; deleteWorkspaceSlackChannelIntegration: DeleteWorkspaceSlackChannelIntegrationOutput; deleteWorkspaceSlackIntegration: DeleteWorkspaceSlackIntegrationOutput; + forkThread: ForkThreadOutput; inviteUserToWorkspace: InviteUserToWorkspaceOutput; /** Marks a customer as spam. */ markCustomerAsSpam: MarkCustomerAsSpamOutput; @@ -1848,6 +1885,7 @@ export type Mutation = { /** Updates a setting. */ updateSetting: UpdateSettingOutput; updateSnippet: UpdateSnippetOutput; + updateThreadTitle: UpdateThreadTitleOutput; /** Updates a webhook target. */ updateWebhookTarget: UpdateWebhookTargetOutput; updateWorkspace: UpdateWorkspaceOutput; @@ -2096,6 +2134,11 @@ export type MutationDeleteWorkspaceSlackIntegrationArgs = { }; +export type MutationForkThreadArgs = { + input: ForkThreadInput; +}; + + export type MutationInviteUserToWorkspaceArgs = { input: InviteUserToWorkspaceInput; }; @@ -2231,6 +2274,11 @@ export type MutationUpdateSnippetArgs = { }; +export type MutationUpdateThreadTitleArgs = { + input: UpdateThreadTitleInput; +}; + + export type MutationUpdateWebhookTargetArgs = { input: UpdateWebhookTargetInput; }; @@ -2412,6 +2460,11 @@ export type Query = { thread: Maybe; /** Get a thread by its external ID. A thread's external ID is unique within a customer, hence why the customer ID is required. */ threadByExternalId: Maybe; + /** + * Gets all slack users involved in a thread + * Note: This endpoint currently only returns a max of 25 users, pagination is NYI. + */ + threadSlackUsers: SlackUserConnection; threads: ThreadConnection; timelineEntries: TimelineEntryConnection; timelineEntry: Maybe; @@ -2600,6 +2653,15 @@ export type QueryThreadByExternalIdArgs = { }; +export type QueryThreadSlackUsersArgs = { + after?: InputMaybe; + before?: InputMaybe; + first?: InputMaybe; + last?: InputMaybe; + threadId: Scalars['ID']; +}; + + export type QueryThreadsArgs = { after?: InputMaybe; before?: InputMaybe; @@ -2954,6 +3016,7 @@ export type SlackMessageEntry = { customerId: Scalars['ID']; deletedOnSlackAt: Maybe; lastEditedOnSlackAt: Maybe; + reactions: Array; relatedThread: Maybe; slackMessageLink: Scalars['String']; text: Scalars['String']; @@ -2964,16 +3027,44 @@ export type SlackMessageEntryRelatedThread = { threadId: Scalars['ID']; }; +export type SlackReaction = { + __typename?: 'SlackReaction'; + actors: Array; + imageUrl: Maybe; + name: Scalars['String']; +}; + export type SlackReplyEntry = { __typename?: 'SlackReplyEntry'; attachments: Array; customerId: Scalars['ID']; deletedOnSlackAt: Maybe; lastEditedOnSlackAt: Maybe; + reactions: Array; slackMessageLink: Scalars['String']; text: Scalars['String']; }; +export type SlackUser = { + __typename?: 'SlackUser'; + fullName: Scalars['String']; + handle: Scalars['String']; + slackAvatarUrl72px: Maybe; + slackUserId: Scalars['ID']; +}; + +export type SlackUserConnection = { + __typename?: 'SlackUserConnection'; + edges: Array; + pageInfo: PageInfo; +}; + +export type SlackUserEdge = { + __typename?: 'SlackUserEdge'; + cursor: Scalars['String']; + node: SlackUser; +}; + export type Snippet = { __typename?: 'Snippet'; createdAt: DateTime; @@ -3539,6 +3630,17 @@ export type UpdateSnippetOutput = { snippet: Maybe; }; +export type UpdateThreadTitleInput = { + threadId: Scalars['ID']; + title: Scalars['String']; +}; + +export type UpdateThreadTitleOutput = { + __typename?: 'UpdateThreadTitleOutput'; + error: Maybe; + thread: Maybe; +}; + export type UpdateWebhookTargetInput = { description?: InputMaybe; eventSubscriptions?: InputMaybe>; @@ -3679,6 +3781,8 @@ export enum UpsertResult { export type User = { __typename?: 'User'; + /** The avatar URL of the user. */ + avatarUrl: Maybe; createdAt: DateTime; createdBy: InternalActor; deletedAt: Maybe; diff --git a/src/index.ts b/src/index.ts index 46ab0cd..f81e8ec 100644 --- a/src/index.ts +++ b/src/index.ts @@ -96,6 +96,8 @@ export type { CreateCustomerCardConfigInput, CreateCustomerEventInput, CreateThreadInput, + ComponentInput, + EventComponentInput, CreateThreadEventInput, DeleteCustomerCardConfigInput, DeleteCustomerInput,