{"version":3,"file":"relations.cjs","names":[],"sources":["../../../../src/rest/commands/create/relations.ts"],"sourcesContent":["import type { DirectusRelation } from '../../../schema/relation.js';\nimport type { ApplyQueryFields, NestedPartial } from '../../../types/index.js';\nimport type { RestCommand } from '../../types.js';\n\nexport type CreateRelationOutput<Schema, Item extends object = DirectusRelation<Schema>> = ApplyQueryFields<\n\tSchema,\n\tItem,\n\t'*'\n>;\n\n/**\n * Create a new relation.\n *\n * @param item The relation to create\n * @param query Optional return data query\n *\n * @returns Returns the relation object for the created relation.\n */\nexport const createRelation =\n\t<Schema>(item: NestedPartial<DirectusRelation<Schema>>): RestCommand<CreateRelationOutput<Schema>, Schema> =>\n\t() => ({\n\t\tpath: `/relations`,\n\t\tbody: JSON.stringify(item),\n\t\tmethod: 'POST',\n\t});\n"],"mappings":"AAkBA,MAAa,EACH,QACF,CACN,KAAM,aACN,KAAM,KAAK,UAAU,EAAK,CAC1B,OAAQ,OACR"}