{"version":3,"file":"versions.cjs","names":[],"sources":["../../../../src/rest/commands/create/versions.ts"],"sourcesContent":["import type { DirectusVersion } from '../../../schema/version.js';\nimport type { ApplyQueryFields, NestedPartial, Query } from '../../../types/index.js';\nimport type { RestCommand } from '../../types.js';\n\nexport type CreateContentVersionOutput<\n\tSchema,\n\tTQuery extends Query<Schema, Item>,\n\tItem extends object = DirectusVersion<Schema>,\n> = ApplyQueryFields<Schema, Item, TQuery['fields']>;\n\n/**\n * Create multiple new Content Versions.\n *\n * @param items The Content Versions to create\n * @param query Optional return data query\n *\n * @returns Returns the Content Version object for the created Content Versions.\n */\nexport const createContentVersions =\n\t<Schema, const TQuery extends Query<Schema, DirectusVersion<Schema>>>(\n\t\titems: NestedPartial<DirectusVersion<Schema>>[],\n\t\tquery?: TQuery,\n\t): RestCommand<CreateContentVersionOutput<Schema, TQuery>[], Schema> =>\n\t() => ({\n\t\tpath: `/versions`,\n\t\tparams: query ?? {},\n\t\tbody: JSON.stringify(items),\n\t\tmethod: 'POST',\n\t});\n\n/**\n * Create a new Content Version.\n *\n * @param item The Content Version to create\n * @param query Optional return data query\n *\n * @returns Returns the Content Version object for the created Content Version.\n */\nexport const createContentVersion =\n\t<Schema, const TQuery extends Query<Schema, DirectusVersion<Schema>>>(\n\t\titem: NestedPartial<DirectusVersion<Schema>>,\n\t\tquery?: TQuery,\n\t): RestCommand<CreateContentVersionOutput<Schema, TQuery>, Schema> =>\n\t() => ({\n\t\tpath: `/versions`,\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,YACN,OAAQ,GAAS,EAAE,CACnB,KAAM,KAAK,UAAU,EAAM,CAC3B,OAAQ,OACR,EAUW,GAEX,EACA,SAEM,CACN,KAAM,YACN,OAAQ,GAAS,EAAE,CACnB,KAAM,KAAK,UAAU,EAAK,CAC1B,OAAQ,OACR"}