python-sdk-office.mjs 632 B

123456789101112131415
  1. /** Exercise the wheel's external Office package from a shipped dsh profile. */
  2. import { writeFile } from 'node:fs/promises'
  3. import { createConverter } from '@deepseek-ai/libreoffice-kit'
  4. export const name = 'python-sdk-office-smoke'
  5. export async function apply(_ctx, config) {
  6. const converter = await createConverter({ timeoutMs: 120_000 })
  7. try {
  8. const result = await converter.render({ inputPath: config.input, outputPath: config.output })
  9. await writeFile(config.result, JSON.stringify({ ...result, moduleUrl: import.meta.resolve('@deepseek-ai/libreoffice-kit') }))
  10. } finally {
  11. await converter.dispose()
  12. }
  13. }