{"version":3,"file":"diff.cjs","names":[],"sources":["../../../../src/rest/commands/schema/diff.ts"],"sourcesContent":["import type { RestCommand } from '../../types.js';\nimport type { SchemaSnapshotOutput } from './snapshot.js';\n\n// TODO improve typing\nexport type SchemaDiffOutput = {\n\thash: string;\n\tdiff: Record<string, any>;\n};\n\n/**\n * Compare the current instance's schema against the schema snapshot in JSON request body and retrieve the difference. This endpoint is only available to admin users.\n * @param snapshot JSON object containing collections, fields, and relations to apply.\n * @param force Bypass version and database vendor restrictions.\n * @returns Returns the differences between the current instance's schema and the schema passed in the request body.\n */\nexport const schemaDiff =\n\t<Schema>(snapshot: SchemaSnapshotOutput, force = false): RestCommand<SchemaDiffOutput, Schema> =>\n\t() => ({\n\t\tmethod: 'POST',\n\t\tpath: '/schema/diff',\n\t\tparams: force ? { force } : {},\n\t\tbody: JSON.stringify(snapshot),\n\t});\n"],"mappings":"AAeA,MAAa,GACH,EAAgC,EAAQ,UAC1C,CACN,OAAQ,OACR,KAAM,eACN,OAAQ,EAAQ,CAAE,QAAO,CAAG,EAAE,CAC9B,KAAM,KAAK,UAAU,EAAS,CAC9B"}