chore: import upstream snapshot with attribution

This commit is contained in:
wehub-resource-sync
2026-07-13 13:34:48 +08:00
commit 77bb5bf71f
3762 changed files with 353249 additions and 0 deletions
@@ -0,0 +1,63 @@
import { ActionDefinition, z } from '@botpress/sdk'
const boardModel = {
id: z.string().title('id').describe('The unique identifier of the board.'),
category: z.string().title('Category').describe('The name of the board/category. Example: "Feature Requests"'),
private: z.boolean().title('Private').optional().describe('Flag indicating whether this board is private.'),
segmentIds: z.array(z.string()).title('Segment Ids').describe('An array of segment IDs associated with this board.'),
roles: z.array(z.string()).title('Roles').describe('An array of roles that have access to this board.'),
hiddenFromRoles: z
.array(z.string())
.title('Hidden From Roles')
.describe('An array of roles that cannot see this board.'),
disablePostCreation: z
.boolean()
.title('Disable Post Creation')
.optional()
.describe('Flag indicating whether post creation is disabled for this board.'),
disableFollowUpQuestions: z
.boolean()
.title('Disable Follow Up Questions')
.optional()
.describe('Flag indicating whether follow-up questions are disabled for this board.'),
customInputFields: z
.array(z.string())
.title('Custom Input Fields')
.describe('An array of custom input fields ids that apply to this board.'),
defaultAuthorOnly: z
.boolean()
.title('Default Author Only')
.optional()
.describe('Flag indicating whether posts in this board are visible to the author only by default.'),
defaultCompanyOnly: z
.boolean()
.title('Default Company Only')
.optional()
.describe('Flag indicating whether posts in this board are visible to the company only by default.'),
}
export const listBoards = {
title: 'List boards',
description: 'List all boards',
input: {
schema: z.object({}),
},
output: {
schema: z.object({
results: z.array(z.object(boardModel)).title('Results').describe('An array of boards.'),
}),
},
} satisfies ActionDefinition
export const getBoard = {
title: 'Get a board',
description: 'Get a board by ID',
input: {
schema: z.object({
id: z.string().optional().title('ID').describe('The unique identifier of the board to retrieve.'),
}),
},
output: {
schema: z.object(boardModel).title('Board').describe('A single board'),
},
} satisfies ActionDefinition
@@ -0,0 +1,81 @@
import { z, ActionDefinition } from '@botpress/sdk'
export const getComments = {
title: 'Get Comments',
description: 'Get a comments thread',
input: {
schema: z.object({
submissionId: z
.string()
.title('SubmissionId')
.describe('The id of the submission to get comments for.')
.optional(),
changelogId: z
.string()
.title('changelogId')
.describe(
'The id of the changelog to get comments for. Accepts both ObjectId and slug. Example: "65f5f3c037fc63b7d43d0f16" or "my-changelog-slug"'
)
.optional(),
privacy: z
.enum(['public', 'private', 'all'])
.title('Privacy')
.describe('Filter comments by privacy setting. Allowed values: "public", "private", "all"')
.optional(),
inReview: z
.boolean()
.title('In Review')
.describe('Filter comments by whether they are in review. Set to true to get only comments that are in review.')
.optional(),
commentThreadId: z
.string()
.title('Comment Thread Id')
.describe(
'Given a specific comment id, this will return all comments in the thread with the root comment being the comment with the given id.'
)
.optional(),
limit: z.number().title('Limit').describe('Number of results per page. Default is 10.').optional(),
page: z.number().title('Page').describe('Page number. Default is 1.').optional(),
sortBy: z.enum(['best', 'top', 'new', 'old']).title('SortBy').describe('Sort order of the results.').optional(),
nextToken: z.string().title('Next Token').optional().describe('Page number. Starts at 1'),
}),
},
output: {
schema: z.object({
results: z
.array(
z
.object({
id: z.string().title('ID').describe('Comment ID'),
upvoted: z.boolean().optional().title('Upvoted').describe('Whether the comment is upvoted'),
downvoted: z.boolean().optional().title('Downvoted').describe('Whether the comment is downvoted'),
inReview: z.boolean().optional().title('In Review').describe('Whether the comment is in review'),
isSpam: z.boolean().optional().title('Is Spam').describe('Whether the comment is marked as spam'),
pinned: z.boolean().optional().title('Pinned').describe('Whether the comment is pinned'),
emailSent: z.boolean().optional().title('Email Sent').describe('Whether an email notification was sent'),
sendNotification: z
.boolean()
.optional()
.title('Send Notification')
.describe('Whether to send notifications'),
organization: z.string().optional().title('Organization').describe('Organization ID'),
submission: z.string().optional().title('Submission').describe('Submission ID'),
author: z.string().optional().title('Author').describe('Author name'),
authorId: z.string().optional().title('Author ID').describe('Author ID'),
authorPicture: z.string().optional().title('Author Picture').describe('Author profile picture URL'),
isPrivate: z.boolean().optional().title('Is Private').describe('Whether the comment is private'),
isDeleted: z.boolean().optional().title('Is Deleted').describe('Whether the comment is deleted'),
content: z.string().optional().title('Content').describe('Comment content'),
upvotes: z.number().optional().title('Upvotes').describe('Number of upvotes'),
downvotes: z.number().optional().title('Downvotes').describe('Number of downvotes'),
parentComment: z.string().nullable().optional().title('Parent Comment').describe('Parent comment ID'),
path: z.string().optional().title('Path').describe('Comment path'),
})
.title('Comment')
.describe('Represent a single comment.')
)
.title('Comments')
.describe('A list of comments.'),
}),
},
} satisfies ActionDefinition
@@ -0,0 +1,3 @@
export * from './boards'
export * from './comments'
export * from './posts'
@@ -0,0 +1,158 @@
import { z, ActionDefinition } from '@botpress/sdk'
export const createPost = {
title: 'Create a post',
description: 'Create a post on feature base',
input: {
schema: z.object({
title: z.string().title('Title').describe('The title of the submission. It must be at least 2 characters long.'),
category: z.string().title('Category').describe('The board (a.k.a category) of the submission.'),
content: z
.string()
.title('Content')
.optional()
.describe('The content of the submission. Can be an empty string.'),
email: z
.string()
.title('Email')
.optional()
.describe(
'The email of the user submitting the post. Will create a new user if the email is not associated with an existing user.'
),
authorName: z
.string()
.title('Author Name')
.optional()
.describe(
'Used when you provide an email. If the email is not associated with an existing user, a new user will be created with this name.'
),
tags: z
.array(z.string())
.title('Tags')
.optional()
.describe('The tags associated with the submission. Needs to be an array of tag names.'),
commentsAllowed: z
.boolean()
.title('Comments Allowed')
.optional()
.describe('Flag indicating whether comments are allowed on the submission.'),
status: z.string().title('Status').optional().describe('The status of the submission.'),
date: z.date().title('Date').optional().describe('Set the post creation date.'),
}),
},
output: {
schema: z.object({
submission: z
.object({
id: z.string().title('ID').describe('Submission ID'),
})
.title('Submission')
.describe('Represent the created post.'),
}),
},
} satisfies ActionDefinition
export const listPosts = {
title: 'List posts',
description: 'List all posts',
input: {
schema: z.object({
id: z.string().title('ID').optional().describe("Find submission by it's id."),
q: z.string().title('Query').optional().describe('Search for posts by title or content.'),
category: z
.array(z.string())
.title('Category')
.optional()
.describe('Filter posts by providing an array of category(board) names.'),
status: z.array(z.string()).title('Status').optional().describe('Filter posts by status ids.'),
sortBy: z.string().title('Sort By').optional().describe('Sort posts by a specific attribute.'),
startDate: z.date().title('Start Date').optional().describe('Get posts created after a specific date.'),
endDate: z.date().title('End Date').optional().describe('Get posts created before a specific date.'),
limit: z.number().title('Limit').optional().describe('Number of results per page'),
page: z.number().title('Page').optional().describe('Page number. Starts at 1'),
nextToken: z.string().title('Next Token').optional().describe('Page number. Starts at 1'),
}),
},
output: {
schema: z.object({
nextToken: z.string().title('Next Token').optional().describe('Use the token to fetch the next page of posts.'),
results: z
.array(
z.object({
title: z.string(),
content: z.string(),
author: z.string(),
authorId: z.string(),
organization: z.string(),
postCategory: z.object({
category: z.string(),
}),
id: z.string(),
})
)
.title('Results')
.describe('An array of posts.'),
}),
},
} satisfies ActionDefinition
export const updatePost = {
title: 'Update post',
description: 'Update a post',
input: {
schema: z.object({
id: z.string().title('ID').describe('The id of the submission.'),
title: z.string().title('Title').optional().describe('The title of the post. Example: "Add dark mode support"'),
content: z
.string()
.title('Content')
.optional()
.describe(
'The HTML content of the post. Example: "<p>It would be great to have dark mode support for better viewing at night.</p>"'
),
status: z.string().title('Status').optional().describe('The status of the submission. Example: "In Progress"'),
commentsAllowed: z
.boolean()
.title('Comments Allowed')
.optional()
.describe('Flag indicating whether comments are allowed on the submission. Example: true'),
category: z
.string()
.title('Category')
.optional()
.describe('The category of the submission. Example: "💡 Feature Request"'),
sendStatusUpdateEmail: z
.boolean()
.title('Send Status Update Email')
.optional()
.describe('Flag indicating whether to send a status update email to the upvoters. Default: false'),
tags: z
.array(z.string())
.title('Tags')
.optional()
.describe('The tags of the submission. Example: ["tag1", "tag2"]'),
inReview: z
.boolean()
.title('In Review')
.optional()
.describe('Flag indicating whether the submission is in review. In review posts are not visible to users.'),
date: z.date().title('Date').optional().describe('The post creation date.'),
}),
},
output: {
schema: z.object({}),
},
} satisfies ActionDefinition
export const deletePost = {
title: 'Delete post',
description: 'Delete a post',
input: {
schema: z.object({
id: z.string().title('ID').describe('The id of the submission.'),
}),
},
output: {
schema: z.object({}),
},
} satisfies ActionDefinition
@@ -0,0 +1,29 @@
import * as sdk from '@botpress/sdk'
export const comments = {
title: 'Comments',
description: 'Comment section of a post',
messages: {
text: sdk.messages.defaults.text,
},
message: {
tags: {
id: {
title: 'ID',
description: 'The Feature Base ID of the comment',
},
},
},
conversation: {
tags: {
rootCommentId: {
title: 'Root Comment ID',
description: 'The Feature Base ID of the root comment of the reply chain',
},
submissionId: {
title: 'Submission ID',
description: 'The Feature Base ID of the submission (post) where the comment was posted',
},
},
},
} satisfies sdk.ChannelDefinition
@@ -0,0 +1,23 @@
import { z } from '@botpress/sdk'
export const webhookEvent = z.object({
type: z.string().title('Type').describe('The type of event'),
organizationId: z.string().title('Organization Id').describe('Organization associated with the event'),
id: z.string().title('Id').describe('ID of the event'),
webhookId: z.string().title('Webhook Id').describe('The ID of the webhook').optional(),
createdAt: z.string().title('Created At').describe('Date when the event was created').optional(),
deliveryStatus: z.string().title('Delivery Status').describe('The status of the event').optional(),
firstSentAt: z.string().title('First Sent At').describe('First delivery time').optional(),
deliveryAttempts: z
.number()
.title('Delivery Attempts')
.describe('The number of times the event tried to be delivered')
.optional(),
})
export const userSchema = z.object({
id: z.string(),
email: z.string().optional(),
name: z.string().optional(),
profilePicture: z.string().optional(),
})
@@ -0,0 +1 @@
export * from './posts'
@@ -0,0 +1,96 @@
import { z, EventDefinition } from '@botpress/sdk'
import { webhookEvent, userSchema } from './common'
const postSchema = z.object({
id: z.string().title('Id').optional(),
type: z.string().title('Type').optional(),
title: z.string().title('Title').optional(),
content: z.string().title('Content').optional(),
user: userSchema.title('User').optional(),
postStatus: z
.object({
name: z.string().optional(),
type: z.string().optional(),
id: z.string().optional(),
})
.title('Post Status')
.optional(),
postCategory: z
.object({
category: z.string().optional(),
id: z.string().optional(),
})
.title('Post Category')
.optional(),
date: z.string().title('Date').optional(),
slug: z.string().title('Slug').optional(),
categoryId: z.string().title('Category Id').optional(),
})
export const postCreated = {
title: 'Post Created',
description: 'A post was created on a board.',
schema: webhookEvent.extend({
topic: z.literal('post.created').title('Topic').describe('The topic of the event'),
data: z
.object({
item: postSchema,
})
.title('Data')
.describe('Event data'),
}),
} satisfies EventDefinition
export const postUpdated = {
title: 'Post Updated',
description: 'A post was updated on a board.',
schema: webhookEvent.extend({
topic: z.literal('post.updated').title('Topic').describe('The topic of the event'),
data: z
.object({
item: postSchema,
changes: z.array(
z.object({
field: z.string(),
oldValue: z.any(),
newValue: z.any(),
})
),
})
.title('Data')
.describe('Event data'),
}),
} satisfies EventDefinition
export const postDeleted = {
title: 'Post Deleted',
description: 'A post was deleted on a board.',
schema: webhookEvent.extend({
topic: z.literal('post.deleted').title('Topic').describe('The topic of the event'),
data: z
.object({
item: postSchema,
})
.title('Data')
.describe('Event data'),
}),
} satisfies EventDefinition
export const postVoted = {
title: 'Post voted',
description: 'A post was voted on a board.',
schema: webhookEvent.extend({
topic: z.literal('post.voted').title('Topic').describe('The topic of the event'),
data: z
.object({
item: z.object({
type: z.string().optional(),
action: z.string().optional(),
submissionId: z.string().optional(),
user: userSchema.optional(),
}),
})
.title('Data')
.describe('Event data'),
}),
} satisfies EventDefinition