{"version":3,"file":"collections.js","names":[],"sources":["../../../../src/rest/commands/create/collections.ts"],"sourcesContent":["import type { DirectusCollection } from '../../../schema/collection.js';\nimport type { ApplyQueryFields, FieldQuery, NestedPartial, Query } from '../../../types/index.js';\nimport type { RestCommand } from '../../types.js';\n\nexport type CreateCollectionOutput<\n\tSchema,\n\tTQuery extends Query,\n\tItem extends object = DirectusCollection,\n> = ApplyQueryFields;\n\n/**\n * Create a new Collection. This will create a new table in the database as well.\n *\n * @param item This endpoint doesn't currently support any query parameters.\n * @param query Optional return data query\n *\n * @returns The collection object for the collection created in this request.\n */\nexport const createCollection =\n\t>>(\n\t\titem: NestedPartial>,\n\t\tquery?: TQuery,\n\t): RestCommand, Schema> =>\n\t() => ({\n\t\tpath: `/collections`,\n\t\tparams: query ?? {},\n\t\tbody: JSON.stringify(item),\n\t\tmethod: 'POST',\n\t});\n"],"mappings":"AAkBA,MAAa,GAEX,EACA,SAEM,CACN,KAAM,eACN,OAAQ,GAAS,EAAE,CACnB,KAAM,KAAK,UAAU,EAAK,CAC1B,OAAQ,OACR"}