chore: import upstream snapshot with attribution
CI / Migrate Dev DB (push) Has been skipped
CI / Detect Version (push) Has been cancelled
CI / Migrate DB (push) Has been cancelled
CI / Build Dev ECR (./docker/app.Dockerfile, ECR_APP) (push) Has been cancelled
CI / Build Dev ECR (./docker/db.Dockerfile, ECR_MIGRATIONS) (push) Has been cancelled
CI / Build Dev ECR (./docker/pii.Dockerfile, ECR_PII) (push) Has been cancelled
CI / Build Dev ECR (./docker/realtime.Dockerfile, ECR_REALTIME) (push) Has been cancelled
CI / Deploy Trigger.dev (Dev) (push) Has been cancelled
CI / Build AMD64 (./docker/app.Dockerfile, ECR_APP, ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Build AMD64 (./docker/db.Dockerfile, ECR_MIGRATIONS, ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Build AMD64 (./docker/pii.Dockerfile, ECR_PII, ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Build AMD64 (./docker/realtime.Dockerfile, ECR_REALTIME, ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/app.Dockerfile, ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/db.Dockerfile, ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/pii.Dockerfile, ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/realtime.Dockerfile, ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Check Docs Changes (push) Has been cancelled
CI / Process Docs (push) Has been cancelled
CI / Create GitHub Release (push) Has been cancelled
CI / Test and Build (push) Has been cancelled
Publish CLI Package / publish-npm (push) Has been cancelled
Publish Python SDK / publish-pypi (push) Has been cancelled
Publish TypeScript SDK / publish-npm (push) Has been cancelled
CI / Migrate Dev DB (push) Has been skipped
CI / Detect Version (push) Has been cancelled
CI / Migrate DB (push) Has been cancelled
CI / Build Dev ECR (./docker/app.Dockerfile, ECR_APP) (push) Has been cancelled
CI / Build Dev ECR (./docker/db.Dockerfile, ECR_MIGRATIONS) (push) Has been cancelled
CI / Build Dev ECR (./docker/pii.Dockerfile, ECR_PII) (push) Has been cancelled
CI / Build Dev ECR (./docker/realtime.Dockerfile, ECR_REALTIME) (push) Has been cancelled
CI / Deploy Trigger.dev (Dev) (push) Has been cancelled
CI / Build AMD64 (./docker/app.Dockerfile, ECR_APP, ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Build AMD64 (./docker/db.Dockerfile, ECR_MIGRATIONS, ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Build AMD64 (./docker/pii.Dockerfile, ECR_PII, ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Build AMD64 (./docker/realtime.Dockerfile, ECR_REALTIME, ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/app.Dockerfile, ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/db.Dockerfile, ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/pii.Dockerfile, ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/realtime.Dockerfile, ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Check Docs Changes (push) Has been cancelled
CI / Process Docs (push) Has been cancelled
CI / Create GitHub Release (push) Has been cancelled
CI / Test and Build (push) Has been cancelled
Publish CLI Package / publish-npm (push) Has been cancelled
Publish Python SDK / publish-pypi (push) Has been cancelled
Publish TypeScript SDK / publish-npm (push) Has been cancelled
This commit is contained in:
@@ -0,0 +1,80 @@
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
import type { BoxSignCancelRequestParams, BoxSignResponse } from './types'
|
||||
import { SIGN_REQUEST_OUTPUT_PROPERTIES } from './types'
|
||||
|
||||
export const boxSignCancelRequestTool: ToolConfig<BoxSignCancelRequestParams, BoxSignResponse> = {
|
||||
id: 'box_sign_cancel_request',
|
||||
name: 'Box Sign Cancel Request',
|
||||
description: 'Cancel a pending Box Sign request',
|
||||
version: '1.0.0',
|
||||
|
||||
oauth: {
|
||||
required: true,
|
||||
provider: 'box',
|
||||
},
|
||||
|
||||
params: {
|
||||
accessToken: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'hidden',
|
||||
description: 'OAuth access token for Box API',
|
||||
},
|
||||
signRequestId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'The ID of the sign request to cancel',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => `https://api.box.com/2.0/sign_requests/${params.signRequestId}/cancel`,
|
||||
method: 'POST',
|
||||
headers: (params) => ({
|
||||
Authorization: `Bearer ${params.accessToken}`,
|
||||
'Content-Type': 'application/json',
|
||||
}),
|
||||
body: () => ({}),
|
||||
},
|
||||
|
||||
transformResponse: async (response) => {
|
||||
const data = await response.json()
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error(data.message || `Box Sign API error: ${response.status}`)
|
||||
}
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
id: data.id ?? '',
|
||||
status: data.status ?? '',
|
||||
name: data.name ?? null,
|
||||
shortId: data.short_id ?? null,
|
||||
signers: (data.signers ?? []).map((s: Record<string, unknown>) => ({
|
||||
email: s.email ?? null,
|
||||
role: s.role ?? null,
|
||||
hasViewedDocument: s.has_viewed_document ?? null,
|
||||
signerDecision: s.signer_decision ?? null,
|
||||
embedUrl: s.embed_url ?? null,
|
||||
order: s.order ?? null,
|
||||
})),
|
||||
sourceFiles: (data.source_files ?? []).map((f: Record<string, unknown>) => ({
|
||||
id: f.id ?? null,
|
||||
type: f.type ?? null,
|
||||
name: f.name ?? null,
|
||||
})),
|
||||
emailSubject: data.email_subject ?? null,
|
||||
emailMessage: data.email_message ?? null,
|
||||
daysValid: data.days_valid ?? null,
|
||||
createdAt: data.created_at ?? null,
|
||||
autoExpireAt: data.auto_expire_at ?? null,
|
||||
prepareUrl: data.prepare_url ?? null,
|
||||
senderEmail: data.sender_email ?? null,
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: SIGN_REQUEST_OUTPUT_PROPERTIES,
|
||||
}
|
||||
@@ -0,0 +1,225 @@
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
import type { BoxSignCreateRequestParams, BoxSignResponse } from './types'
|
||||
import { SIGN_REQUEST_OUTPUT_PROPERTIES } from './types'
|
||||
|
||||
export const boxSignCreateRequestTool: ToolConfig<BoxSignCreateRequestParams, BoxSignResponse> = {
|
||||
id: 'box_sign_create_request',
|
||||
name: 'Box Sign Create Request',
|
||||
description: 'Create a new Box Sign request to send documents for e-signature',
|
||||
version: '1.0.0',
|
||||
|
||||
oauth: {
|
||||
required: true,
|
||||
provider: 'box',
|
||||
},
|
||||
|
||||
params: {
|
||||
accessToken: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'hidden',
|
||||
description: 'OAuth access token for Box API',
|
||||
},
|
||||
sourceFileIds: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Comma-separated Box file IDs to send for signing',
|
||||
},
|
||||
signerEmail: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Primary signer email address',
|
||||
},
|
||||
signerRole: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Primary signer role: signer, approver, or final_copy_reader (default: signer)',
|
||||
},
|
||||
additionalSigners: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'JSON array of additional signers, e.g. [{"email":"user@example.com","role":"signer"}]',
|
||||
},
|
||||
parentFolderId: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Box folder ID where signed documents will be stored (default: user root)',
|
||||
},
|
||||
emailSubject: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Custom subject line for the signing email',
|
||||
},
|
||||
emailMessage: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Custom message in the signing email body',
|
||||
},
|
||||
name: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Name for the sign request',
|
||||
},
|
||||
daysValid: {
|
||||
type: 'number',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Number of days before the request expires (0-730)',
|
||||
},
|
||||
areRemindersEnabled: {
|
||||
type: 'boolean',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Whether to send automatic signing reminders',
|
||||
},
|
||||
areTextSignaturesEnabled: {
|
||||
type: 'boolean',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Whether to allow typed (text) signatures',
|
||||
},
|
||||
signatureColor: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Signature color: blue, black, or red',
|
||||
},
|
||||
redirectUrl: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'URL to redirect signers to after signing',
|
||||
},
|
||||
declinedRedirectUrl: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'URL to redirect signers to after declining',
|
||||
},
|
||||
isDocumentPreparationNeeded: {
|
||||
type: 'boolean',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Whether document preparation is needed before sending',
|
||||
},
|
||||
externalId: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'External system reference ID',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: 'https://api.box.com/2.0/sign_requests',
|
||||
method: 'POST',
|
||||
headers: (params) => ({
|
||||
Authorization: `Bearer ${params.accessToken}`,
|
||||
'Content-Type': 'application/json',
|
||||
}),
|
||||
body: (params) => {
|
||||
const fileIds = params.sourceFileIds
|
||||
.split(',')
|
||||
.map((id: string) => id.trim())
|
||||
.filter(Boolean)
|
||||
const sourceFiles = fileIds.map((id: string) => ({ type: 'file', id }))
|
||||
|
||||
const signers: Array<Record<string, unknown>> = [
|
||||
{
|
||||
email: params.signerEmail,
|
||||
role: params.signerRole || 'signer',
|
||||
},
|
||||
]
|
||||
|
||||
if (params.additionalSigners) {
|
||||
try {
|
||||
const additional =
|
||||
typeof params.additionalSigners === 'string'
|
||||
? JSON.parse(params.additionalSigners)
|
||||
: params.additionalSigners
|
||||
if (Array.isArray(additional)) {
|
||||
signers.push(...additional)
|
||||
}
|
||||
} catch {
|
||||
throw new Error(
|
||||
'Invalid JSON in additionalSigners. Expected a JSON array of signer objects.'
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
const body: Record<string, unknown> = {
|
||||
source_files: sourceFiles,
|
||||
signers,
|
||||
}
|
||||
|
||||
if (params.parentFolderId) {
|
||||
body.parent_folder = { type: 'folder', id: params.parentFolderId }
|
||||
}
|
||||
if (params.emailSubject) body.email_subject = params.emailSubject
|
||||
if (params.emailMessage) body.email_message = params.emailMessage
|
||||
if (params.name) body.name = params.name
|
||||
if (params.daysValid !== undefined) body.days_valid = params.daysValid
|
||||
if (params.areRemindersEnabled !== undefined)
|
||||
body.are_reminders_enabled = params.areRemindersEnabled
|
||||
if (params.areTextSignaturesEnabled !== undefined)
|
||||
body.are_text_signatures_enabled = params.areTextSignaturesEnabled
|
||||
if (params.signatureColor) body.signature_color = params.signatureColor
|
||||
if (params.redirectUrl) body.redirect_url = params.redirectUrl
|
||||
if (params.declinedRedirectUrl) body.declined_redirect_url = params.declinedRedirectUrl
|
||||
if (params.isDocumentPreparationNeeded !== undefined)
|
||||
body.is_document_preparation_needed = params.isDocumentPreparationNeeded
|
||||
if (params.externalId) body.external_id = params.externalId
|
||||
|
||||
return body
|
||||
},
|
||||
},
|
||||
|
||||
transformResponse: async (response) => {
|
||||
const data = await response.json()
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error(data.message || `Box Sign API error: ${response.status}`)
|
||||
}
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
id: data.id ?? '',
|
||||
status: data.status ?? '',
|
||||
name: data.name ?? null,
|
||||
shortId: data.short_id ?? null,
|
||||
signers: (data.signers ?? []).map((s: Record<string, unknown>) => ({
|
||||
email: s.email ?? null,
|
||||
role: s.role ?? null,
|
||||
hasViewedDocument: s.has_viewed_document ?? null,
|
||||
signerDecision: s.signer_decision ?? null,
|
||||
embedUrl: s.embed_url ?? null,
|
||||
order: s.order ?? null,
|
||||
})),
|
||||
sourceFiles: (data.source_files ?? []).map((f: Record<string, unknown>) => ({
|
||||
id: f.id ?? null,
|
||||
type: f.type ?? null,
|
||||
name: f.name ?? null,
|
||||
})),
|
||||
emailSubject: data.email_subject ?? null,
|
||||
emailMessage: data.email_message ?? null,
|
||||
daysValid: data.days_valid ?? null,
|
||||
createdAt: data.created_at ?? null,
|
||||
autoExpireAt: data.auto_expire_at ?? null,
|
||||
prepareUrl: data.prepare_url ?? null,
|
||||
senderEmail: data.sender_email ?? null,
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: SIGN_REQUEST_OUTPUT_PROPERTIES,
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
import type { BoxSignGetRequestParams, BoxSignResponse } from './types'
|
||||
import { SIGN_REQUEST_OUTPUT_PROPERTIES } from './types'
|
||||
|
||||
export const boxSignGetRequestTool: ToolConfig<BoxSignGetRequestParams, BoxSignResponse> = {
|
||||
id: 'box_sign_get_request',
|
||||
name: 'Box Sign Get Request',
|
||||
description: 'Get the details and status of a Box Sign request',
|
||||
version: '1.0.0',
|
||||
|
||||
oauth: {
|
||||
required: true,
|
||||
provider: 'box',
|
||||
},
|
||||
|
||||
params: {
|
||||
accessToken: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'hidden',
|
||||
description: 'OAuth access token for Box API',
|
||||
},
|
||||
signRequestId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'The ID of the sign request to retrieve',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => `https://api.box.com/2.0/sign_requests/${params.signRequestId}`,
|
||||
method: 'GET',
|
||||
headers: (params) => ({
|
||||
Authorization: `Bearer ${params.accessToken}`,
|
||||
}),
|
||||
},
|
||||
|
||||
transformResponse: async (response) => {
|
||||
const data = await response.json()
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error(data.message || `Box Sign API error: ${response.status}`)
|
||||
}
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
id: data.id ?? '',
|
||||
status: data.status ?? '',
|
||||
name: data.name ?? null,
|
||||
shortId: data.short_id ?? null,
|
||||
signers: (data.signers ?? []).map((s: Record<string, unknown>) => ({
|
||||
email: s.email ?? null,
|
||||
role: s.role ?? null,
|
||||
hasViewedDocument: s.has_viewed_document ?? null,
|
||||
signerDecision: s.signer_decision ?? null,
|
||||
embedUrl: s.embed_url ?? null,
|
||||
order: s.order ?? null,
|
||||
})),
|
||||
sourceFiles: (data.source_files ?? []).map((f: Record<string, unknown>) => ({
|
||||
id: f.id ?? null,
|
||||
type: f.type ?? null,
|
||||
name: f.name ?? null,
|
||||
})),
|
||||
emailSubject: data.email_subject ?? null,
|
||||
emailMessage: data.email_message ?? null,
|
||||
daysValid: data.days_valid ?? null,
|
||||
createdAt: data.created_at ?? null,
|
||||
autoExpireAt: data.auto_expire_at ?? null,
|
||||
prepareUrl: data.prepare_url ?? null,
|
||||
senderEmail: data.sender_email ?? null,
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: SIGN_REQUEST_OUTPUT_PROPERTIES,
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
export { boxSignCancelRequestTool } from '@/tools/box_sign/cancel_request'
|
||||
export { boxSignCreateRequestTool } from '@/tools/box_sign/create_request'
|
||||
export { boxSignGetRequestTool } from '@/tools/box_sign/get_request'
|
||||
export { boxSignListRequestsTool } from '@/tools/box_sign/list_requests'
|
||||
export { boxSignResendRequestTool } from '@/tools/box_sign/resend_request'
|
||||
@@ -0,0 +1,100 @@
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
import type { BoxSignListRequestsParams, BoxSignListResponse } from './types'
|
||||
import { SIGN_REQUEST_LIST_OUTPUT_PROPERTIES } from './types'
|
||||
|
||||
export const boxSignListRequestsTool: ToolConfig<BoxSignListRequestsParams, BoxSignListResponse> = {
|
||||
id: 'box_sign_list_requests',
|
||||
name: 'Box Sign List Requests',
|
||||
description: 'List all Box Sign requests',
|
||||
version: '1.0.0',
|
||||
|
||||
oauth: {
|
||||
required: true,
|
||||
provider: 'box',
|
||||
},
|
||||
|
||||
params: {
|
||||
accessToken: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'hidden',
|
||||
description: 'OAuth access token for Box API',
|
||||
},
|
||||
limit: {
|
||||
type: 'number',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Maximum number of sign requests to return (max 1000)',
|
||||
},
|
||||
marker: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Pagination marker from a previous response',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => {
|
||||
const queryParams = new URLSearchParams()
|
||||
if (params.limit !== undefined) queryParams.set('limit', String(params.limit))
|
||||
if (params.marker) queryParams.set('marker', params.marker)
|
||||
const qs = queryParams.toString()
|
||||
return `https://api.box.com/2.0/sign_requests${qs ? `?${qs}` : ''}`
|
||||
},
|
||||
method: 'GET',
|
||||
headers: (params) => ({
|
||||
Authorization: `Bearer ${params.accessToken}`,
|
||||
}),
|
||||
},
|
||||
|
||||
transformResponse: async (response) => {
|
||||
const data = await response.json()
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error(data.message || `Box Sign API error: ${response.status}`)
|
||||
}
|
||||
|
||||
const entries = data.entries ?? []
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
signRequests: entries.map((req: Record<string, unknown>) => ({
|
||||
id: req.id ?? '',
|
||||
status: req.status ?? '',
|
||||
name: req.name ?? null,
|
||||
shortId: req.short_id ?? null,
|
||||
signers: ((req.signers as Array<Record<string, unknown>> | undefined) ?? []).map(
|
||||
(s: Record<string, unknown>) => ({
|
||||
email: s.email ?? null,
|
||||
role: s.role ?? null,
|
||||
hasViewedDocument: s.has_viewed_document ?? null,
|
||||
signerDecision: s.signer_decision ?? null,
|
||||
embedUrl: s.embed_url ?? null,
|
||||
order: s.order ?? null,
|
||||
})
|
||||
),
|
||||
sourceFiles: ((req.source_files as Array<Record<string, unknown>> | undefined) ?? []).map(
|
||||
(f: Record<string, unknown>) => ({
|
||||
id: f.id ?? null,
|
||||
type: f.type ?? null,
|
||||
name: f.name ?? null,
|
||||
})
|
||||
),
|
||||
emailSubject: req.email_subject ?? null,
|
||||
emailMessage: req.email_message ?? null,
|
||||
daysValid: req.days_valid ?? null,
|
||||
createdAt: req.created_at ?? null,
|
||||
autoExpireAt: req.auto_expire_at ?? null,
|
||||
prepareUrl: req.prepare_url ?? null,
|
||||
senderEmail: req.sender_email ?? null,
|
||||
})),
|
||||
count: entries.length,
|
||||
nextMarker: data.next_marker ?? null,
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: SIGN_REQUEST_LIST_OUTPUT_PROPERTIES,
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
import type { ToolConfig, ToolResponse } from '@/tools/types'
|
||||
import type { BoxSignResendRequestParams } from './types'
|
||||
|
||||
export const boxSignResendRequestTool: ToolConfig<BoxSignResendRequestParams, ToolResponse> = {
|
||||
id: 'box_sign_resend_request',
|
||||
name: 'Box Sign Resend Request',
|
||||
description: 'Resend a Box Sign request to signers who have not yet signed',
|
||||
version: '1.0.0',
|
||||
|
||||
oauth: {
|
||||
required: true,
|
||||
provider: 'box',
|
||||
},
|
||||
|
||||
params: {
|
||||
accessToken: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'hidden',
|
||||
description: 'OAuth access token for Box API',
|
||||
},
|
||||
signRequestId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'The ID of the sign request to resend',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => `https://api.box.com/2.0/sign_requests/${params.signRequestId}/resend`,
|
||||
method: 'POST',
|
||||
headers: (params) => ({
|
||||
Authorization: `Bearer ${params.accessToken}`,
|
||||
}),
|
||||
},
|
||||
|
||||
transformResponse: async (response) => {
|
||||
if (!response.ok) {
|
||||
const data = await response.json()
|
||||
throw new Error(data.message || `Box Sign API error: ${response.status}`)
|
||||
}
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
message: 'Sign request resent successfully',
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
message: { type: 'string', description: 'Success confirmation message' },
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,162 @@
|
||||
import type { OutputProperty, ToolResponse } from '@/tools/types'
|
||||
|
||||
export interface BoxSignCreateRequestParams {
|
||||
accessToken: string
|
||||
sourceFileIds: string
|
||||
signerEmail: string
|
||||
signerRole?: string
|
||||
additionalSigners?: string
|
||||
parentFolderId?: string
|
||||
emailSubject?: string
|
||||
emailMessage?: string
|
||||
name?: string
|
||||
daysValid?: number
|
||||
areRemindersEnabled?: boolean
|
||||
areTextSignaturesEnabled?: boolean
|
||||
signatureColor?: string
|
||||
redirectUrl?: string
|
||||
declinedRedirectUrl?: string
|
||||
isDocumentPreparationNeeded?: boolean
|
||||
externalId?: string
|
||||
}
|
||||
|
||||
export interface BoxSignGetRequestParams {
|
||||
accessToken: string
|
||||
signRequestId: string
|
||||
}
|
||||
|
||||
export interface BoxSignListRequestsParams {
|
||||
accessToken: string
|
||||
limit?: number
|
||||
marker?: string
|
||||
}
|
||||
|
||||
export interface BoxSignCancelRequestParams {
|
||||
accessToken: string
|
||||
signRequestId: string
|
||||
}
|
||||
|
||||
export interface BoxSignResendRequestParams {
|
||||
accessToken: string
|
||||
signRequestId: string
|
||||
}
|
||||
|
||||
export interface BoxSignResponse extends ToolResponse {
|
||||
output: {
|
||||
id: string
|
||||
status: string
|
||||
name: string | null
|
||||
shortId: string | null
|
||||
signers: Array<Record<string, unknown>>
|
||||
sourceFiles: Array<Record<string, unknown>>
|
||||
emailSubject: string | null
|
||||
emailMessage: string | null
|
||||
daysValid: number | null
|
||||
createdAt: string | null
|
||||
autoExpireAt: string | null
|
||||
prepareUrl: string | null
|
||||
senderEmail: string | null
|
||||
}
|
||||
}
|
||||
|
||||
export interface BoxSignListResponse extends ToolResponse {
|
||||
output: {
|
||||
signRequests: Array<Record<string, unknown>>
|
||||
count: number
|
||||
nextMarker: string | null
|
||||
}
|
||||
}
|
||||
|
||||
const SIGNER_OUTPUT_PROPERTIES = {
|
||||
email: { type: 'string', description: 'Signer email address' },
|
||||
role: { type: 'string', description: 'Signer role (signer, approver, final_copy_reader)' },
|
||||
hasViewedDocument: {
|
||||
type: 'boolean',
|
||||
description: 'Whether the signer has viewed the document',
|
||||
optional: true,
|
||||
},
|
||||
signerDecision: {
|
||||
type: 'json',
|
||||
description: 'Signer decision details (type, finalized_at, additional_info)',
|
||||
optional: true,
|
||||
},
|
||||
embedUrl: {
|
||||
type: 'string',
|
||||
description: 'URL for embedded signing experience',
|
||||
optional: true,
|
||||
},
|
||||
order: { type: 'number', description: 'Order in signing sequence', optional: true },
|
||||
} as const satisfies Record<string, OutputProperty>
|
||||
|
||||
const SOURCE_FILE_OUTPUT_PROPERTIES = {
|
||||
id: { type: 'string', description: 'File ID' },
|
||||
type: { type: 'string', description: 'File type' },
|
||||
name: { type: 'string', description: 'File name', optional: true },
|
||||
} as const satisfies Record<string, OutputProperty>
|
||||
|
||||
export const SIGN_REQUEST_OUTPUT_PROPERTIES = {
|
||||
id: { type: 'string', description: 'Sign request ID' },
|
||||
status: {
|
||||
type: 'string',
|
||||
description:
|
||||
'Request status (converting, created, sent, viewed, signed, cancelled, declined, expired, error_converting, error_sending, finalizing, error_finalizing)',
|
||||
},
|
||||
name: { type: 'string', description: 'Sign request name', optional: true },
|
||||
shortId: { type: 'string', description: 'Human-readable short ID', optional: true },
|
||||
signers: {
|
||||
type: 'array',
|
||||
description: 'List of signers',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: SIGNER_OUTPUT_PROPERTIES,
|
||||
},
|
||||
},
|
||||
sourceFiles: {
|
||||
type: 'array',
|
||||
description: 'Source files for signing',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: SOURCE_FILE_OUTPUT_PROPERTIES,
|
||||
},
|
||||
},
|
||||
emailSubject: {
|
||||
type: 'string',
|
||||
description: 'Custom email subject line',
|
||||
optional: true,
|
||||
},
|
||||
emailMessage: {
|
||||
type: 'string',
|
||||
description: 'Custom email message body',
|
||||
optional: true,
|
||||
},
|
||||
daysValid: {
|
||||
type: 'number',
|
||||
description: 'Number of days the request is valid',
|
||||
optional: true,
|
||||
},
|
||||
createdAt: { type: 'string', description: 'Creation timestamp', optional: true },
|
||||
autoExpireAt: { type: 'string', description: 'Auto-expiration timestamp', optional: true },
|
||||
prepareUrl: {
|
||||
type: 'string',
|
||||
description: 'URL for document preparation (if preparation is needed)',
|
||||
optional: true,
|
||||
},
|
||||
senderEmail: { type: 'string', description: 'Email of the sender', optional: true },
|
||||
} as const satisfies Record<string, OutputProperty>
|
||||
|
||||
export const SIGN_REQUEST_LIST_OUTPUT_PROPERTIES = {
|
||||
signRequests: {
|
||||
type: 'array',
|
||||
description: 'List of sign requests',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: SIGN_REQUEST_OUTPUT_PROPERTIES,
|
||||
},
|
||||
},
|
||||
count: { type: 'number', description: 'Number of sign requests returned in this page' },
|
||||
nextMarker: {
|
||||
type: 'string',
|
||||
description: 'Marker for next page of results',
|
||||
optional: true,
|
||||
},
|
||||
} as const satisfies Record<string, OutputProperty>
|
||||
Reference in New Issue
Block a user