index.ts 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. /**
  2. * Generated by orval v7.2.0 🍺
  3. * Do not edit manually.
  4. * Api documentation
  5. * OpenAPI spec version: 1.0.0
  6. */
  7. import axios from 'axios'
  8. import type {
  9. AxiosRequestConfig,
  10. AxiosResponse
  11. } from 'axios'
  12. export type PdfCtrlSyncJobStatus202Status = typeof PdfCtrlSyncJobStatus202Status[keyof typeof PdfCtrlSyncJobStatus202Status];
  13. // eslint-disable-next-line @typescript-eslint/no-redeclare
  14. export const PdfCtrlSyncJobStatus202Status = {
  15. HTML_EXPORT_IN_PROGRESS: 'HTML_EXPORT_IN_PROGRESS',
  16. HTML_EXPORT_DONE: 'HTML_EXPORT_DONE',
  17. FAILED: 'FAILED',
  18. PDF_EXPORT_DONE: 'PDF_EXPORT_DONE',
  19. } as const;
  20. export type PdfCtrlSyncJobStatus202 = {
  21. status: PdfCtrlSyncJobStatus202Status;
  22. };
  23. /**
  24. * @minLength 1
  25. */
  26. export type PdfCtrlSyncJobStatusBodyStatus = typeof PdfCtrlSyncJobStatusBodyStatus[keyof typeof PdfCtrlSyncJobStatusBodyStatus];
  27. // eslint-disable-next-line @typescript-eslint/no-redeclare
  28. export const PdfCtrlSyncJobStatusBodyStatus = {
  29. HTML_EXPORT_IN_PROGRESS: 'HTML_EXPORT_IN_PROGRESS',
  30. HTML_EXPORT_DONE: 'HTML_EXPORT_DONE',
  31. FAILED: 'FAILED',
  32. } as const;
  33. export type PdfCtrlSyncJobStatusBody = {
  34. appId?: number;
  35. /** @minLength 1 */
  36. expirationDate: string;
  37. /** @minLength 1 */
  38. jobId: string;
  39. /** @minLength 1 */
  40. status: PdfCtrlSyncJobStatusBodyStatus;
  41. };
  42. export interface GenericError {
  43. /**
  44. * An error message
  45. * @minLength 1
  46. */
  47. message: string;
  48. /**
  49. * The error name
  50. * @minLength 1
  51. */
  52. name: string;
  53. [key: string]: unknown;
  54. }
  55. export interface InternalServerError {
  56. /** A list of related errors */
  57. errors?: GenericError[];
  58. /**
  59. * An error message
  60. * @minLength 1
  61. */
  62. message: string;
  63. /**
  64. * The error name
  65. * @minLength 1
  66. */
  67. name: string;
  68. /** The stack trace (only in development mode) */
  69. stack?: string;
  70. /** The status code of the exception */
  71. status: number;
  72. }
  73. /**
  74. *
  75. Sync job pdf convert status with GROWI.
  76. Register or update job inside pdf-converter with given jobId, expirationDate, and status.
  77. Return resulting status of job to GROWI.
  78. */
  79. export const pdfCtrlSyncJobStatus = <TData = AxiosResponse<PdfCtrlSyncJobStatus202>>(
  80. pdfCtrlSyncJobStatusBody: PdfCtrlSyncJobStatusBody, options?: AxiosRequestConfig
  81. ): Promise<TData> => {
  82. return axios.post(
  83. `/pdf/sync-job`,
  84. pdfCtrlSyncJobStatusBody,options
  85. );
  86. }
  87. export type PdfCtrlSyncJobStatusResult = AxiosResponse<PdfCtrlSyncJobStatus202>