asposeslidescloud 23.1.0 → 23.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,13 +1,12 @@
1
- import request = require("request");
2
1
  import { Configuration } from "./configuration";
3
- export declare function checkMultipartContent(options: request.Options, files: any): void;
2
+ export declare function checkMultipartContent(options: any, files: any): void;
4
3
  /**
5
4
  * Invoke api method
6
5
  * @param requestOptions request parameters
7
6
  * @param confguration api configuration
8
7
  * @param notApplyAuthToRequest if setted to true, auth is not applied to request
9
8
  */
10
- export declare function invokeApiMethod(requestOptions: request.Options, confguration: Configuration, notApplyAuthToRequest?: boolean): Promise<request.RequestResponse>;
9
+ export declare function invokeApiMethod(requestOptions: any, confguration: Configuration, notApplyAuthToRequest?: boolean): Promise<any>;
11
10
  /**
12
11
  * Add parameter to query
13
12
  * @param url url
@@ -33,8 +33,21 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
33
33
  };
34
34
  Object.defineProperty(exports, "__esModule", { value: true });
35
35
  exports.addHeaderParameter = exports.addPathParameterToUrl = exports.addQueryParameterToUrl = exports.invokeApiMethod = exports.checkMultipartContent = void 0;
36
- const request = require("request");
37
- const requestDebug = require("request-debug");
36
+ const axios_1 = require("axios");
37
+ axios_1.default.interceptors.request.use(request => {
38
+ if (request.debug) {
39
+ console.log('>> Request');
40
+ console.log(request);
41
+ }
42
+ return request;
43
+ });
44
+ axios_1.default.interceptors.response.use(response => {
45
+ if (response.config.debug) {
46
+ console.log('<< Response');
47
+ console.log(response);
48
+ }
49
+ return response;
50
+ });
38
51
  const objectSerializer_1 = require("./objectSerializer");
39
52
  function checkMultipartContent(options, files) {
40
53
  if (files && files.length) {
@@ -42,8 +55,8 @@ function checkMultipartContent(options, files) {
42
55
  pipeline: null,
43
56
  attachments: []
44
57
  };
45
- if (options.json !== true && options.json) {
46
- data.pipeline = JSON.stringify(options.json);
58
+ if (options.data) {
59
+ data.pipeline = JSON.stringify(options.data);
47
60
  }
48
61
  else {
49
62
  delete data.pipeline;
@@ -51,8 +64,11 @@ function checkMultipartContent(options, files) {
51
64
  for (var i = 0; i < files.length; i++) {
52
65
  data.attachments.push(files[i]);
53
66
  }
54
- options.formData = data;
55
- options.json = null;
67
+ options.data = data;
68
+ if (!options.headers) {
69
+ options.headers = {};
70
+ }
71
+ options.headers["Content-type"] = "multipart/form-data";
56
72
  }
57
73
  }
58
74
  exports.checkMultipartContent = checkMultipartContent;
@@ -135,21 +151,13 @@ exports.addHeaderParameter = addHeaderParameter;
135
151
  */
136
152
  function invokeApiMethodInternal(requestOptions, configuration, notApplyAuthToRequest) {
137
153
  return __awaiter(this, void 0, void 0, function* () {
138
- requestDebug(request, (type, data, r) => {
139
- if (r.writeDebugToConsole) {
140
- const toLog = {};
141
- toLog[type] = data;
142
- // tslint:disable-next-line:no-console
143
- console.log(JSON.stringify(toLog, undefined, 2));
144
- }
145
- });
146
154
  if (configuration.allowInsecureRequests) {
147
155
  requestOptions.rejectUnauthorized = false;
148
156
  }
149
157
  if (!requestOptions.headers) {
150
158
  requestOptions.headers = {};
151
159
  }
152
- requestOptions.headers["x-aspose-client"] = "nodejs sdk v23.1.0";
160
+ requestOptions.headers["x-aspose-client"] = "nodejs sdk v23.3.0";
153
161
  if (configuration.timeout) {
154
162
  requestOptions.headers["x-aspose-timeout"] = configuration.timeout;
155
163
  }
@@ -159,49 +167,30 @@ function invokeApiMethodInternal(requestOptions, configuration, notApplyAuthToRe
159
167
  if (!notApplyAuthToRequest) {
160
168
  yield addAuthHeader(requestOptions, configuration);
161
169
  }
170
+ else {
171
+ requestOptions.headers["Content-type"] = "application/x-www-form-urlencoded";
172
+ }
173
+ requestOptions.debug = configuration.debugMode;
162
174
  return new Promise((resolve, reject) => {
163
- const r = request(requestOptions, (error, response) => __awaiter(this, void 0, void 0, function* () {
164
- if (error) {
165
- reject(error);
175
+ const r = (0, axios_1.default)(requestOptions)
176
+ .then((response) => __awaiter(this, void 0, void 0, function* () {
177
+ //compatibility with request library responses
178
+ response.body = response.data;
179
+ response.statusCode = response.status;
180
+ if (response.statusCode >= 200 && response.statusCode <= 299) {
181
+ resolve(response);
166
182
  }
167
183
  else {
168
- if (response.statusCode >= 200 && response.statusCode <= 299) {
169
- resolve(response);
170
- }
171
- else if (!notApplyAuthToRequest && response.statusCode === 401) {
172
- yield requestToken(configuration);
173
- reject(new NeedRepeatException());
174
- }
175
- else {
176
- try {
177
- if (response.statusCode == 400 && response.body && response.body.error && typeof response.body.error == "string") {
178
- reject({ message: response.body.error, code: 401 });
179
- }
180
- else if (response.body && (response.body.length === undefined || response.body.length)) {
181
- let bodyContent = response.body;
182
- let bodyString = bodyContent;
183
- if (bodyContent instanceof Buffer) {
184
- bodyString = bodyContent.toString("utf8");
185
- bodyContent = JSON.parse(bodyString);
186
- }
187
- let result = objectSerializer_1.ObjectSerializer.deserialize(bodyContent, "SlidesApiErrorResponse");
188
- try {
189
- result = JSON.parse(result);
190
- }
191
- catch (_a) {
192
- //Error means the object is already deserialized
193
- reject({ message: result.error ? result.error.message : bodyString, code: response.statusCode });
194
- }
195
- }
196
- else {
197
- reject({ message: response.statusMessage, code: response.statusCode });
198
- }
199
- }
200
- catch (error) {
201
- reject({ message: "Error while parse server error: " + error });
202
- }
203
- }
184
+ yield rejectResponse(reject, response, configuration, notApplyAuthToRequest);
185
+ }
186
+ }))
187
+ .catch((error) => __awaiter(this, void 0, void 0, function* () {
188
+ if (error.response) {
189
+ error.response.body = error.response.data;
190
+ error.response.statusCode = error.response.status;
191
+ yield rejectResponse(reject, error.response, configuration, notApplyAuthToRequest);
204
192
  }
193
+ reject(error);
205
194
  }));
206
195
  r.writeDebugToConsole = configuration.debugMode;
207
196
  });
@@ -230,19 +219,55 @@ function requestToken(configuration) {
230
219
  return __awaiter(this, void 0, void 0, function* () {
231
220
  const requestOptions = {
232
221
  method: "POST",
233
- json: true,
234
- uri: configuration.authBaseUrl + "/connect/token",
235
- form: {
222
+ url: configuration.authBaseUrl + "/connect/token",
223
+ data: {
236
224
  grant_type: "client_credentials",
237
225
  client_id: configuration.appSid,
238
226
  client_secret: configuration.appKey,
239
- },
227
+ }
240
228
  };
241
229
  const response = yield invokeApiMethod(requestOptions, configuration, true);
242
230
  configuration.accessToken = response.body.access_token;
243
231
  return Promise.resolve();
244
232
  });
245
233
  }
234
+ function rejectResponse(reject, response, configuration, notApplyAuthToRequest) {
235
+ return __awaiter(this, void 0, void 0, function* () {
236
+ if (!notApplyAuthToRequest && response.statusCode === 401) {
237
+ yield requestToken(configuration);
238
+ reject(new NeedRepeatException());
239
+ }
240
+ else {
241
+ try {
242
+ if (response.statusCode == 400 && response.body && response.body.error && typeof response.body.error == "string") {
243
+ reject({ message: response.body.error, code: 401 });
244
+ }
245
+ else if (response.body && (response.body.length === undefined || response.body.length)) {
246
+ let bodyContent = response.body;
247
+ let bodyString = bodyContent;
248
+ if (bodyContent instanceof Buffer) {
249
+ bodyString = bodyContent.toString("utf8");
250
+ bodyContent = JSON.parse(bodyString);
251
+ }
252
+ let result = objectSerializer_1.ObjectSerializer.deserialize(bodyContent, "SlidesApiErrorResponse");
253
+ try {
254
+ result = JSON.parse(result);
255
+ }
256
+ catch (_a) {
257
+ //Error means the object is already deserialized
258
+ reject({ message: result.error ? result.error.message : bodyString, code: response.statusCode });
259
+ }
260
+ }
261
+ else {
262
+ reject({ message: response.statusMessage, code: response.statusCode });
263
+ }
264
+ }
265
+ catch (error) {
266
+ reject({ message: "Error while parse server error: " + error });
267
+ }
268
+ }
269
+ });
270
+ }
246
271
  var requestingToken = null;
247
272
  var isRequestTokenPending = false;
248
273
  /**
package/model.d.ts CHANGED
@@ -2361,6 +2361,10 @@ export declare class Effect {
2361
2361
  * Specifies if the effect will repeat until the next click.
2362
2362
  */
2363
2363
  repeatUntilNextClick?: boolean;
2364
+ /**
2365
+ * This attribute specifies if the animation effect stops the previous sound.
2366
+ */
2367
+ stopPreviousSound?: boolean;
2364
2368
  }
2365
2369
  export declare namespace Effect {
2366
2370
  enum TypeEnum {
@@ -3372,6 +3376,10 @@ export declare class Hyperlink {
3372
3376
  * Represents the source of hyperlink color
3373
3377
  */
3374
3378
  colorSource?: Hyperlink.ColorSourceEnum;
3379
+ /**
3380
+ * Audio data encoded in base64. Represents the playing sound of the hyperlink.
3381
+ */
3382
+ soundBase64?: string;
3375
3383
  }
3376
3384
  export declare namespace Hyperlink {
3377
3385
  enum ActionTypeEnum {
@@ -3454,6 +3462,10 @@ export declare class ImageExportOptions extends ImageExportOptionsBase {
3454
3462
  * Gets or sets the color of comments area (Applies only if comments are displayed on the right).
3455
3463
  */
3456
3464
  commentsAreaColor?: string;
3465
+ /**
3466
+ * Show hidden slides. If true, hidden are exported.
3467
+ */
3468
+ showHiddenSlides?: boolean;
3457
3469
  }
3458
3470
  export declare namespace ImageExportOptions {
3459
3471
  enum NotesPositionEnum {
@@ -4436,26 +4448,6 @@ export declare class Paragraph extends ResourceBase {
4436
4448
  * Depth.
4437
4449
  */
4438
4450
  depth?: number;
4439
- /**
4440
- * Bullet char.
4441
- */
4442
- bulletChar?: string;
4443
- /**
4444
- * Bullet height.
4445
- */
4446
- bulletHeight?: number;
4447
- /**
4448
- * Bullet type.
4449
- */
4450
- bulletType?: Paragraph.BulletTypeEnum;
4451
- /**
4452
- * Starting number for a numbered bullet.
4453
- */
4454
- numberedBulletStartWith?: number;
4455
- /**
4456
- * Numbered bullet style.
4457
- */
4458
- numberedBulletStyle?: Paragraph.NumberedBulletStyleEnum;
4459
4451
  /**
4460
4452
  * True if hanging punctuation is used with the paragraph.
4461
4453
  */
@@ -4480,6 +4472,30 @@ export declare class Paragraph extends ResourceBase {
4480
4472
  * Default portion format.
4481
4473
  */
4482
4474
  defaultPortionFormat?: PortionFormat;
4475
+ /**
4476
+ * Bullet char.
4477
+ */
4478
+ bulletChar?: string;
4479
+ /**
4480
+ * Bullet height.
4481
+ */
4482
+ bulletHeight?: number;
4483
+ /**
4484
+ * Bullet type.
4485
+ */
4486
+ bulletType?: Paragraph.BulletTypeEnum;
4487
+ /**
4488
+ * Starting number for a numbered bullet.
4489
+ */
4490
+ numberedBulletStartWith?: number;
4491
+ /**
4492
+ * Numbered bullet style.
4493
+ */
4494
+ numberedBulletStyle?: Paragraph.NumberedBulletStyleEnum;
4495
+ /**
4496
+ * Bullet fill format.
4497
+ */
4498
+ bulletFillFormat?: FillFormat;
4483
4499
  }
4484
4500
  export declare namespace Paragraph {
4485
4501
  enum AlignmentEnum {
@@ -4499,6 +4515,26 @@ export declare namespace Paragraph {
4499
4515
  Baseline,
4500
4516
  Default
4501
4517
  }
4518
+ enum HangingPunctuationEnum {
4519
+ False,
4520
+ True,
4521
+ NotDefined
4522
+ }
4523
+ enum EastAsianLineBreakEnum {
4524
+ False,
4525
+ True,
4526
+ NotDefined
4527
+ }
4528
+ enum LatinLineBreakEnum {
4529
+ False,
4530
+ True,
4531
+ NotDefined
4532
+ }
4533
+ enum RightToLeftEnum {
4534
+ False,
4535
+ True,
4536
+ NotDefined
4537
+ }
4502
4538
  enum BulletTypeEnum {
4503
4539
  None,
4504
4540
  Symbol,
@@ -4550,7 +4586,115 @@ export declare namespace Paragraph {
4550
4586
  BulletHindiAlpha1Period,
4551
4587
  NotDefined
4552
4588
  }
4553
- enum HangingPunctuationEnum {
4589
+ }
4590
+ /**
4591
+ * Paragraph formatting properties.
4592
+ */
4593
+ export declare class ParagraphFormat {
4594
+ /**
4595
+ * Depth.
4596
+ */
4597
+ depth?: number;
4598
+ /**
4599
+ * Text alignment.
4600
+ */
4601
+ alignment?: ParagraphFormat.AlignmentEnum;
4602
+ /**
4603
+ * Left margin.
4604
+ */
4605
+ marginLeft?: number;
4606
+ /**
4607
+ * Right margin.
4608
+ */
4609
+ marginRight?: number;
4610
+ /**
4611
+ * Left spacing.
4612
+ */
4613
+ spaceBefore?: number;
4614
+ /**
4615
+ * Right spacing.
4616
+ */
4617
+ spaceAfter?: number;
4618
+ /**
4619
+ * Spacing between lines.
4620
+ */
4621
+ spaceWithin?: number;
4622
+ /**
4623
+ * Font alignment.
4624
+ */
4625
+ fontAlignment?: ParagraphFormat.FontAlignmentEnum;
4626
+ /**
4627
+ * First line indent.
4628
+ */
4629
+ indent?: number;
4630
+ /**
4631
+ * Determines whether the Right to Left writing is used in a paragraph. No inheritance applied.
4632
+ */
4633
+ rightToLeft?: ParagraphFormat.RightToLeftEnum;
4634
+ /**
4635
+ * Determines whether the East Asian line break is used in a paragraph. No inheritance applied.
4636
+ */
4637
+ eastAsianLineBreak?: ParagraphFormat.EastAsianLineBreakEnum;
4638
+ /**
4639
+ * Determines whether the Latin line break is used in a paragraph. No inheritance applied.
4640
+ */
4641
+ latinLineBreak?: ParagraphFormat.LatinLineBreakEnum;
4642
+ /**
4643
+ * Determines whether the hanging punctuation is used in a paragraph. No inheritance applied.
4644
+ */
4645
+ hangingPunctuation?: ParagraphFormat.HangingPunctuationEnum;
4646
+ /**
4647
+ * Returns or sets default tabulation size with no inheritance.
4648
+ */
4649
+ defaultTabSize?: number;
4650
+ /**
4651
+ * Default portion format.
4652
+ */
4653
+ defaultPortionFormat?: PortionFormat;
4654
+ /**
4655
+ * Bullet char.
4656
+ */
4657
+ bulletChar?: string;
4658
+ /**
4659
+ * Bullet height.
4660
+ */
4661
+ bulletHeight?: number;
4662
+ /**
4663
+ * Bullet type.
4664
+ */
4665
+ bulletType?: ParagraphFormat.BulletTypeEnum;
4666
+ /**
4667
+ * Starting number for a numbered bullet.
4668
+ */
4669
+ numberedBulletStartWith?: number;
4670
+ /**
4671
+ * Numbered bullet style.
4672
+ */
4673
+ numberedBulletStyle?: ParagraphFormat.NumberedBulletStyleEnum;
4674
+ /**
4675
+ * Bullet fill format.
4676
+ */
4677
+ bulletFillFormat?: FillFormat;
4678
+ }
4679
+ export declare namespace ParagraphFormat {
4680
+ enum AlignmentEnum {
4681
+ Left,
4682
+ Center,
4683
+ Right,
4684
+ Justify,
4685
+ JustifyLow,
4686
+ Distributed,
4687
+ NotDefined
4688
+ }
4689
+ enum FontAlignmentEnum {
4690
+ Automatic,
4691
+ Top,
4692
+ Center,
4693
+ Bottom,
4694
+ Baseline,
4695
+ Default
4696
+ }
4697
+ enum RightToLeftEnum {
4554
4698
  False,
4555
4699
  True,
4556
4700
  NotDefined
@@ -4565,11 +4709,62 @@ export declare namespace Paragraph {
4565
4709
  True,
4566
4710
  NotDefined
4567
4711
  }
4568
- enum RightToLeftEnum {
4712
+ enum HangingPunctuationEnum {
4569
4713
  False,
4570
4714
  True,
4571
4715
  NotDefined
4572
4716
  }
4717
+ enum BulletTypeEnum {
4718
+ None,
4719
+ Symbol,
4720
+ Numbered,
4721
+ Picture,
4722
+ NotDefined
4723
+ }
4724
+ enum NumberedBulletStyleEnum {
4725
+ BulletAlphaLCPeriod,
4726
+ BulletAlphaUCPeriod,
4727
+ BulletArabicParenRight,
4728
+ BulletArabicPeriod,
4729
+ BulletRomanLCParenBoth,
4730
+ BulletRomanLCParenRight,
4731
+ BulletRomanLCPeriod,
4732
+ BulletRomanUCPeriod,
4733
+ BulletAlphaLCParenBoth,
4734
+ BulletAlphaLCParenRight,
4735
+ BulletAlphaUCParenBoth,
4736
+ BulletAlphaUCParenRight,
4737
+ BulletArabicParenBoth,
4738
+ BulletArabicPlain,
4739
+ BulletRomanUCParenBoth,
4740
+ BulletRomanUCParenRight,
4741
+ BulletSimpChinPlain,
4742
+ BulletSimpChinPeriod,
4743
+ BulletCircleNumDBPlain,
4744
+ BulletCircleNumWDWhitePlain,
4745
+ BulletCircleNumWDBlackPlain,
4746
+ BulletTradChinPlain,
4747
+ BulletTradChinPeriod,
4748
+ BulletArabicAlphaDash,
4749
+ BulletArabicAbjadDash,
4750
+ BulletHebrewAlphaDash,
4751
+ BulletKanjiKoreanPlain,
4752
+ BulletKanjiKoreanPeriod,
4753
+ BulletArabicDBPlain,
4754
+ BulletArabicDBPeriod,
4755
+ BulletThaiAlphaPeriod,
4756
+ BulletThaiAlphaParenRight,
4757
+ BulletThaiAlphaParenBoth,
4758
+ BulletThaiNumPeriod,
4759
+ BulletThaiNumParenRight,
4760
+ BulletThaiNumParenBoth,
4761
+ BulletHindiAlphaPeriod,
4762
+ BulletHindiNumPeriod,
4763
+ BulletKanjiSimpChinDBPeriod,
4764
+ BulletHindiNumParenRight,
4765
+ BulletHindiAlpha1Period,
4766
+ NotDefined
4767
+ }
4573
4768
  }
4574
4769
  /**
4575
4770
  * Represents list of Links to Paragraphs resources
@@ -4780,9 +4975,16 @@ export declare namespace PdfExportOptions {
4780
4975
  }
4781
4976
  enum ComplianceEnum {
4782
4977
  Pdf15,
4978
+ Pdf16,
4979
+ Pdf17,
4783
4980
  PdfA1b,
4784
4981
  PdfA1a,
4785
- PdfUa
4982
+ PdfA2b,
4983
+ PdfA2a,
4984
+ PdfA3b,
4985
+ PdfA3a,
4986
+ PdfUa,
4987
+ PdfA2u
4786
4988
  }
4787
4989
  enum NotesPositionEnum {
4788
4990
  None,
@@ -7368,6 +7570,62 @@ export declare class TextFrameFormat {
7368
7570
  * Gets or sets text wrapping shape.
7369
7571
  */
7370
7572
  transform?: TextFrameFormat.TransformEnum;
7573
+ /**
7574
+ * Left margin. Left margin.
7575
+ */
7576
+ marginLeft?: number;
7577
+ /**
7578
+ * Right margin.
7579
+ */
7580
+ marginRight?: number;
7581
+ /**
7582
+ * Top margin.
7583
+ */
7584
+ marginTop?: number;
7585
+ /**
7586
+ * Bottom margin.
7587
+ */
7588
+ marginBottom?: number;
7589
+ /**
7590
+ * True if text is wrapped at TextFrame's margins.
7591
+ */
7592
+ wrapText?: TextFrameFormat.WrapTextEnum;
7593
+ /**
7594
+ * Returns or sets vertical anchor text in a TextFrame.
7595
+ */
7596
+ anchoringType?: TextFrameFormat.AnchoringTypeEnum;
7597
+ /**
7598
+ * If True then text should be centered in box horizontally.
7599
+ */
7600
+ centerText?: TextFrameFormat.CenterTextEnum;
7601
+ /**
7602
+ * Determines text orientation. The resulted value of visual text rotation summarized from this property and custom angle in property RotationAngle.
7603
+ */
7604
+ textVerticalType?: TextFrameFormat.TextVerticalTypeEnum;
7605
+ /**
7606
+ * Returns or sets text's auto-fit mode.
7607
+ */
7608
+ autofitType?: TextFrameFormat.AutofitTypeEnum;
7609
+ /**
7610
+ * Returns or sets number of columns in the text area. This value must be a positive number. Otherwise, the value will be set to zero. Value 0 means undefined value.
7611
+ */
7612
+ columnCount?: number;
7613
+ /**
7614
+ * Returns or sets the space between text columns in the text area (in points). This should only apply when there is more than 1 column present. This value must be a positive number. Otherwise, the value will be set to zero.
7615
+ */
7616
+ columnSpacing?: number;
7617
+ /**
7618
+ * Returns or set keeping text out of 3D scene entirely.
7619
+ */
7620
+ keepTextFlat?: boolean;
7621
+ /**
7622
+ * Specifies the custom rotation that is being applied to the text within the bounding box.
7623
+ */
7624
+ rotationAngle?: number;
7625
+ /**
7626
+ * Default portion format.
7627
+ */
7628
+ defaultParagraphFormat?: ParagraphFormat;
7371
7629
  }
7372
7630
  export declare namespace TextFrameFormat {
7373
7631
  enum TransformEnum {
@@ -7415,6 +7673,40 @@ export declare namespace TextFrameFormat {
7415
7673
  Custom,
7416
7674
  NotDefined
7417
7675
  }
7676
+ enum WrapTextEnum {
7677
+ False,
7678
+ True,
7679
+ NotDefined
7680
+ }
7681
+ enum AnchoringTypeEnum {
7682
+ Top,
7683
+ Center,
7684
+ Bottom,
7685
+ Justified,
7686
+ Distributed,
7687
+ NotDefined
7688
+ }
7689
+ enum CenterTextEnum {
7690
+ False,
7691
+ True,
7692
+ NotDefined
7693
+ }
7694
+ enum TextVerticalTypeEnum {
7695
+ Horizontal,
7696
+ Vertical,
7697
+ Vertical270,
7698
+ WordArtVertical,
7699
+ EastAsianVertical,
7700
+ MongolianVertical,
7701
+ WordArtVerticalRightToLeft,
7702
+ NotDefined
7703
+ }
7704
+ enum AutofitTypeEnum {
7705
+ None,
7706
+ Normal,
7707
+ Shape,
7708
+ NotDefined
7709
+ }
7418
7710
  }
7419
7711
  /**
7420
7712
  * Represents text item, referenced by TextItems