Initial commit

This commit is contained in:
2025-08-22 21:09:48 +02:00
commit 2d84f535f4
68 changed files with 34807 additions and 0 deletions

View File

@@ -0,0 +1,76 @@
import type { TaskConfig } from "payload"
import { readDocumentHandler } from "./read-document-handler.js"
export const ReadDocumentStepTask = {
slug: 'read-document',
handler: readDocumentHandler,
inputSchema: [
{
name: 'collection',
type: 'text',
admin: {
description: 'The collection slug to read from'
},
required: true
},
{
name: 'id',
type: 'text',
admin: {
description: 'The ID of a specific document to read (leave empty to find multiple)'
}
},
{
name: 'where',
type: 'json',
admin: {
description: 'Query conditions to find documents (used when ID is not provided)'
}
},
{
name: 'limit',
type: 'number',
admin: {
description: 'Maximum number of documents to return (default: 10)'
}
},
{
name: 'sort',
type: 'text',
admin: {
description: 'Field to sort by (prefix with - for descending order)'
}
},
{
name: 'locale',
type: 'text',
admin: {
description: 'Locale for the document (if localization is enabled)'
}
},
{
name: 'depth',
type: 'number',
admin: {
description: 'Depth of relationships to populate (0-10)'
}
}
],
outputSchema: [
{
name: 'doc',
type: 'json',
admin: {
description: 'The document(s) found'
}
},
{
name: 'totalDocs',
type: 'number',
admin: {
description: 'Total number of documents matching the query'
}
}
]
} satisfies TaskConfig<'read-document'>