import { PDFServicesJob } from "./PDFServicesJob"; import { Asset } from "../../io/Asset"; import { DocumentMergeParams } from "../params/documentmerge/DocumentMergeParams"; import { ExecutionContext } from "../../internal/ExecutionContext"; import { NotifierConfig } from "../../config/notifier/NotifierConfig"; /** * A job that enables the clients to produce high fidelity PDF and Word documents with dynamic data inputs. * This operation merges the JSON data with the Word template to create dynamic documents for contracts and * agreements, invoices, proposals, reports, forms, branded marketing documents and more. *

* To know more about document generation and document templates, please see the * documentation *

* * @example * Sample Usage: * ```js * const readStream = fs.createReadStream(""); * * const credentials = new ServicePrincipalCredentials({ * clientId: process.env.PDF_SERVICES_CLIENT_ID, * clientSecret: process.env.PDF_SERVICES_CLIENT_SECRET * }); * * const pdfServices = new PDFServices({credentials}); * * const inputAsset = await pdfServices.upload({ * readStream, * mimeType: MimeType.DOCX * }); * * const jsonDataForMerge = JSON.parse("{\"customerName\": \"James\", \"customerVisits\": 100}"); * * const params = new DocumentMergeParams({ * jsonDataForMerge, * outputFormat: OutputFormat.DOCX * }); * * const job = new DocumentMergeJob({inputAsset, params}); * * const pollingURL = await pdfServices.submit({job}); * * const pdfServicesResponse = await pdfServices.getJobResult({ * pollingURL, * resultType: DocumentMergeResult * }); * * const resultAsset = pdfServicesResponse.result.asset; * const streamAsset = await pdfServices.getContent({asset: resultAsset}); * ``` */ export declare class DocumentMergeJob extends PDFServicesJob { private readonly _inputAsset; private readonly _documentMergeParams; private readonly _outputAsset?; /** * Constructs a new `DocumentMergeJob` instance. * * @param params The parameters for constructing an instance of `DocumentMergeJob`. * @param params.inputAsset {@link Asset} object containing the input file. Cannot be undefined. * @param params.params {@link DocumentMergeParams} object containing the parameters for document * generation. Cannot be undefined. * @param [params.outputAsset] {@link Asset} object representing the output asset. * @remarks External assets can be set as output only when input is external asset as well. */ constructor(params: { inputAsset: Asset; params: DocumentMergeParams; outputAsset?: Asset; }); /** * @hidden */ process(executionContext: ExecutionContext, notifierConfigList?: NotifierConfig[]): Promise; private generatePDFServicesAPIRequest; }