UNPKG

asposewordscloud

Version:
81 lines (80 loc) 3.36 kB
"use strict"; /* * -------------------------------------------------------------------------------- * <copyright company="Aspose" file="batchPartRequest.ts"> * Copyright (c) 2025 Aspose.Words for Cloud * </copyright> * <summary> * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * </summary> * -------------------------------------------------------------------------------- */ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", { value: true }); exports.BatchPartRequest = void 0; const stream_1 = require("stream"); const uuid_1 = require("uuid"); /** * BatchPartRequest class */ class BatchPartRequest { constructor(requestObj) { this.id = (0, uuid_1.v4)(); this.parentId = ""; this.innerRequest = requestObj; } /** * set parent request * @param parentRequest */ dependsOn(parentRequest) { this.parentId = parentRequest.id; } /** * create the requst options for this request * @param configuration a configuration for the request * @param data encryptor */ createRequestOptions(configuration, encryptor) { return __awaiter(this, void 0, void 0, function* () { return this.innerRequest.createRequestOptions(configuration, encryptor); }); } /** * create response from string */ createResponse(_response, _headers) { return this.innerRequest.createResponse(_response, _headers); } /** * create resultOf stream */ useAsSource() { return stream_1.Readable.from(Buffer.from("resultOf(" + this.id + ")")); } } exports.BatchPartRequest = BatchPartRequest;