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
+27
View File
@@ -0,0 +1,27 @@
import { RuntimeError } from '@botpress/client'
import { AxiosError } from 'axios'
import { getAxiosClient } from './utils/axiosClient'
import * as bp from '.botpress'
export const register: bp.IntegrationProps['register'] = async ({ ctx, client, logger }) => {
try {
const mintlifyClient = await getAxiosClient({ ctx, client })
await mintlifyClient.get('jobs')
logger.forBot().info('Validated API key and project ID')
} catch (error: unknown) {
if (error instanceof AxiosError) {
const status = error.response?.status
if (status === 400) {
throw new RuntimeError('400 - Bad Request: Invalid project ID')
}
if (status === 401) {
throw new RuntimeError(`401 - Unauthorized: ${error.response?.data?.error || 'Unable to validate API key'}`)
}
}
const message = error instanceof Error ? error.message : String(error)
throw new RuntimeError(`Failed to validate configuration: ${message}`)
}
}
export const unregister: bp.IntegrationProps['unregister'] = async () => {}