docspring-ts 4.2.0 → 4.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.
Files changed (49) hide show
  1. package/AGENTS.md +2 -2
  2. package/README.md +7 -6
  3. package/dist/RequestSchemas.js +39 -2
  4. package/dist/RequestSchemas.js.map +1 -1
  5. package/dist/apis/Client.d.ts +2 -1
  6. package/dist/apis/Client.js +63 -42
  7. package/dist/apis/Client.js.map +1 -1
  8. package/dist/http/isomorphic-fetch.js +1 -1
  9. package/dist/models/CreateTemplateRequest.d.ts +2 -0
  10. package/dist/models/CreateTemplateRequest.js +6 -0
  11. package/dist/models/CreateTemplateRequest.js.map +1 -1
  12. package/dist/models/GenerateFilesFormat.d.ts +3 -0
  13. package/dist/models/GenerateFilesFormat.js +3 -0
  14. package/dist/models/GenerateFilesFormat.js.map +1 -1
  15. package/dist/models/ModelCodeLanguage.d.ts +1 -0
  16. package/dist/models/ModelCodeLanguage.js +2 -1
  17. package/dist/models/ModelCodeLanguage.js.map +1 -1
  18. package/dist/models/ObjectSerializer.js.map +1 -1
  19. package/dist/models/OutputFormat.d.ts +2 -0
  20. package/dist/models/OutputFormat.js +2 -0
  21. package/dist/models/OutputFormat.js.map +1 -1
  22. package/dist/models/SubmissionFiles.d.ts +2 -0
  23. package/dist/models/SubmissionFiles.js +12 -0
  24. package/dist/models/SubmissionFiles.js.map +1 -1
  25. package/dist/models/Template.d.ts +2 -0
  26. package/dist/models/Template.js +6 -0
  27. package/dist/models/Template.js.map +1 -1
  28. package/dist/models/TemplateDocumentState.d.ts +2 -0
  29. package/dist/models/TemplateDocumentState.js +3 -1
  30. package/dist/models/TemplateDocumentState.js.map +1 -1
  31. package/dist/models/TemplateSummary.d.ts +2 -0
  32. package/dist/models/TemplateSummary.js +6 -0
  33. package/dist/models/TemplateSummary.js.map +1 -1
  34. package/dist/models/TemplateType.d.ts +1 -0
  35. package/dist/models/TemplateType.js +2 -1
  36. package/dist/models/TemplateType.js.map +1 -1
  37. package/dist/models/UpdateTemplateRequest.d.ts +2 -0
  38. package/dist/models/UpdateTemplateRequest.js +6 -0
  39. package/dist/models/UpdateTemplateRequest.js.map +1 -1
  40. package/dist/types/ObjectParamAPI.d.ts +2 -0
  41. package/dist/types/ObjectParamAPI.js +2 -2
  42. package/dist/types/ObjectParamAPI.js.map +1 -1
  43. package/dist/types/ObservableAPI.d.ts +3 -2
  44. package/dist/types/ObservableAPI.js +4 -4
  45. package/dist/types/ObservableAPI.js.map +1 -1
  46. package/dist/types/PromiseAPI.d.ts +3 -2
  47. package/dist/types/PromiseAPI.js +4 -4
  48. package/dist/types/PromiseAPI.js.map +1 -1
  49. package/package.json +2 -2
@@ -2430,7 +2430,7 @@ var ClientRequestFactory = (function (_super) {
2430
2430
  });
2431
2431
  });
2432
2432
  };
2433
- ClientRequestFactory.prototype.uploadTemplate = function (document, wait, name, description, parentFolderId, aiFieldNamingLanguage, detectFields, fieldSource, fieldNaming, fieldLogic, _options) {
2433
+ ClientRequestFactory.prototype.uploadTemplate = function (document, wait, name, description, parentFolderId, aiFieldNamingLanguage, detectFields, fieldSource, fieldNaming, fieldLogic, outputFormat, _options) {
2434
2434
  return __awaiter(this, void 0, void 0, function () {
2435
2435
  var _config, localVarPath, requestContext, useForm, localVarFormParams, contentType, authMethod, defaultAuth;
2436
2436
  var _a;
@@ -2485,6 +2485,9 @@ var ClientRequestFactory = (function (_super) {
2485
2485
  if (fieldLogic !== undefined) {
2486
2486
  localVarFormParams.append('field_logic', fieldLogic);
2487
2487
  }
2488
+ if (outputFormat !== undefined) {
2489
+ localVarFormParams.append('output_format', outputFormat);
2490
+ }
2488
2491
  requestContext.setBody(localVarFormParams);
2489
2492
  if (!useForm) {
2490
2493
  contentType = ObjectSerializer_1.ObjectSerializer.getPreferredMediaType([
@@ -3484,7 +3487,7 @@ var ClientResponseProcessor = (function () {
3484
3487
  case 3:
3485
3488
  body = _f.apply(_e, [_h.apply(_g, [_y.sent(), contentType]),
3486
3489
  "ErrorResponse", ""]);
3487
- throw new exception_1.ApiException(response.httpStatusCode, "the template\'s PDF hasn\'t been processed", body, response.headers);
3490
+ throw new exception_1.ApiException(response.httpStatusCode, "this server can\'t convert Word documents to PDF", body, response.headers);
3488
3491
  case 4:
3489
3492
  if (!(0, util_1.isCodeInRange)("422", response.httpStatusCode)) return [3, 6];
3490
3493
  _k = (_j = ObjectSerializer_1.ObjectSerializer).deserialize;
@@ -3523,9 +3526,9 @@ var ClientResponseProcessor = (function () {
3523
3526
  };
3524
3527
  ClientResponseProcessor.prototype.createWebhookWithHttpInfo = function (response) {
3525
3528
  return __awaiter(this, void 0, void 0, function () {
3526
- var contentType, body, _a, _b, _c, _d, body, _e, _f, _g, _h, body, _j, _k, _l, _m, body, _o, _p, _q, _r, body, _s, _t, _u, _v, _w, _x;
3527
- return __generator(this, function (_y) {
3528
- switch (_y.label) {
3529
+ var contentType, body, _a, _b, _c, _d, body, _e, _f, _g, _h, body, _j, _k, _l, _m, body, _o, _p, _q, _r, body, _s, _t, _u, _v, body, _w, _x, _y, _z, _0, _1;
3530
+ return __generator(this, function (_2) {
3531
+ switch (_2.label) {
3529
3532
  case 0:
3530
3533
  contentType = ObjectSerializer_1.ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
3531
3534
  if (!(0, util_1.isCodeInRange)("201", response.httpStatusCode)) return [3, 2];
@@ -3533,7 +3536,7 @@ var ClientResponseProcessor = (function () {
3533
3536
  _d = (_c = ObjectSerializer_1.ObjectSerializer).parse;
3534
3537
  return [4, response.body.text()];
3535
3538
  case 1:
3536
- body = _b.apply(_a, [_d.apply(_c, [_y.sent(), contentType]),
3539
+ body = _b.apply(_a, [_d.apply(_c, [_2.sent(), contentType]),
3537
3540
  "Webhook", ""]);
3538
3541
  return [2, new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body)];
3539
3542
  case 2:
@@ -3542,41 +3545,50 @@ var ClientResponseProcessor = (function () {
3542
3545
  _h = (_g = ObjectSerializer_1.ObjectSerializer).parse;
3543
3546
  return [4, response.body.text()];
3544
3547
  case 3:
3545
- body = _f.apply(_e, [_h.apply(_g, [_y.sent(), contentType]),
3548
+ body = _f.apply(_e, [_h.apply(_g, [_2.sent(), contentType]),
3546
3549
  "ErrorResponse", ""]);
3547
3550
  throw new exception_1.ApiException(response.httpStatusCode, "invalid webhook", body, response.headers);
3548
3551
  case 4:
3549
- if (!(0, util_1.isCodeInRange)("401", response.httpStatusCode)) return [3, 6];
3552
+ if (!(0, util_1.isCodeInRange)("403", response.httpStatusCode)) return [3, 6];
3550
3553
  _k = (_j = ObjectSerializer_1.ObjectSerializer).deserialize;
3551
3554
  _m = (_l = ObjectSerializer_1.ObjectSerializer).parse;
3552
3555
  return [4, response.body.text()];
3553
3556
  case 5:
3554
- body = _k.apply(_j, [_m.apply(_l, [_y.sent(), contentType]),
3557
+ body = _k.apply(_j, [_m.apply(_l, [_2.sent(), contentType]),
3555
3558
  "ErrorResponse", ""]);
3556
- throw new exception_1.ApiException(response.httpStatusCode, "authentication failed", body, response.headers);
3559
+ throw new exception_1.ApiException(response.httpStatusCode, "the plan\'s integration limit is reached", body, response.headers);
3557
3560
  case 6:
3558
- if (!(0, util_1.isCodeInRange)("429", response.httpStatusCode)) return [3, 8];
3561
+ if (!(0, util_1.isCodeInRange)("401", response.httpStatusCode)) return [3, 8];
3559
3562
  _p = (_o = ObjectSerializer_1.ObjectSerializer).deserialize;
3560
3563
  _r = (_q = ObjectSerializer_1.ObjectSerializer).parse;
3561
3564
  return [4, response.body.text()];
3562
3565
  case 7:
3563
- body = _p.apply(_o, [_r.apply(_q, [_y.sent(), contentType]),
3566
+ body = _p.apply(_o, [_r.apply(_q, [_2.sent(), contentType]),
3564
3567
  "ErrorResponse", ""]);
3565
- throw new exception_1.ApiException(response.httpStatusCode, "Too many requests: wait the number of seconds in the Retry-After header, then send the request again.", body, response.headers);
3568
+ throw new exception_1.ApiException(response.httpStatusCode, "authentication failed", body, response.headers);
3566
3569
  case 8:
3567
- if (!(response.httpStatusCode >= 200 && response.httpStatusCode <= 299)) return [3, 10];
3570
+ if (!(0, util_1.isCodeInRange)("429", response.httpStatusCode)) return [3, 10];
3568
3571
  _t = (_s = ObjectSerializer_1.ObjectSerializer).deserialize;
3569
3572
  _v = (_u = ObjectSerializer_1.ObjectSerializer).parse;
3570
3573
  return [4, response.body.text()];
3571
3574
  case 9:
3572
- body = _t.apply(_s, [_v.apply(_u, [_y.sent(), contentType]),
3575
+ body = _t.apply(_s, [_v.apply(_u, [_2.sent(), contentType]),
3576
+ "ErrorResponse", ""]);
3577
+ throw new exception_1.ApiException(response.httpStatusCode, "Too many requests: wait the number of seconds in the Retry-After header, then send the request again.", body, response.headers);
3578
+ case 10:
3579
+ if (!(response.httpStatusCode >= 200 && response.httpStatusCode <= 299)) return [3, 12];
3580
+ _x = (_w = ObjectSerializer_1.ObjectSerializer).deserialize;
3581
+ _z = (_y = ObjectSerializer_1.ObjectSerializer).parse;
3582
+ return [4, response.body.text()];
3583
+ case 11:
3584
+ body = _x.apply(_w, [_z.apply(_y, [_2.sent(), contentType]),
3573
3585
  "Webhook", ""]);
3574
3586
  return [2, new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body)];
3575
- case 10:
3576
- _w = exception_1.ApiException.bind;
3577
- _x = [void 0, response.httpStatusCode, "Unknown API Status Code!"];
3587
+ case 12:
3588
+ _0 = exception_1.ApiException.bind;
3589
+ _1 = [void 0, response.httpStatusCode, "Unknown API Status Code!"];
3578
3590
  return [4, response.getBodyAsAny()];
3579
- case 11: throw new (_w.apply(exception_1.ApiException, _x.concat([_y.sent(), response.headers])))();
3591
+ case 13: throw new (_0.apply(exception_1.ApiException, _1.concat([_2.sent(), response.headers])))();
3580
3592
  }
3581
3593
  });
3582
3594
  });
@@ -6373,9 +6385,9 @@ var ClientResponseProcessor = (function () {
6373
6385
  };
6374
6386
  ClientResponseProcessor.prototype.updateWebhookWithHttpInfo = function (response) {
6375
6387
  return __awaiter(this, void 0, void 0, function () {
6376
- var contentType, body, _a, _b, _c, _d, body, _e, _f, _g, _h, body, _j, _k, _l, _m, body, _o, _p, _q, _r, body, _s, _t, _u, _v, body, _w, _x, _y, _z, _0, _1;
6377
- return __generator(this, function (_2) {
6378
- switch (_2.label) {
6388
+ var contentType, body, _a, _b, _c, _d, body, _e, _f, _g, _h, body, _j, _k, _l, _m, body, _o, _p, _q, _r, body, _s, _t, _u, _v, body, _w, _x, _y, _z, body, _0, _1, _2, _3, _4, _5;
6389
+ return __generator(this, function (_6) {
6390
+ switch (_6.label) {
6379
6391
  case 0:
6380
6392
  contentType = ObjectSerializer_1.ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
6381
6393
  if (!(0, util_1.isCodeInRange)("200", response.httpStatusCode)) return [3, 2];
@@ -6383,59 +6395,68 @@ var ClientResponseProcessor = (function () {
6383
6395
  _d = (_c = ObjectSerializer_1.ObjectSerializer).parse;
6384
6396
  return [4, response.body.text()];
6385
6397
  case 1:
6386
- body = _b.apply(_a, [_d.apply(_c, [_2.sent(), contentType]),
6398
+ body = _b.apply(_a, [_d.apply(_c, [_6.sent(), contentType]),
6387
6399
  "Webhook", ""]);
6388
6400
  return [2, new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body)];
6389
6401
  case 2:
6390
- if (!(0, util_1.isCodeInRange)("404", response.httpStatusCode)) return [3, 4];
6402
+ if (!(0, util_1.isCodeInRange)("403", response.httpStatusCode)) return [3, 4];
6391
6403
  _f = (_e = ObjectSerializer_1.ObjectSerializer).deserialize;
6392
6404
  _h = (_g = ObjectSerializer_1.ObjectSerializer).parse;
6393
6405
  return [4, response.body.text()];
6394
6406
  case 3:
6395
- body = _f.apply(_e, [_h.apply(_g, [_2.sent(), contentType]),
6407
+ body = _f.apply(_e, [_h.apply(_g, [_6.sent(), contentType]),
6396
6408
  "ErrorResponse", ""]);
6397
- throw new exception_1.ApiException(response.httpStatusCode, "webhook not found", body, response.headers);
6409
+ throw new exception_1.ApiException(response.httpStatusCode, "turning the webhook on would go over the plan\&#39;s integration limit", body, response.headers);
6398
6410
  case 4:
6399
- if (!(0, util_1.isCodeInRange)("422", response.httpStatusCode)) return [3, 6];
6411
+ if (!(0, util_1.isCodeInRange)("404", response.httpStatusCode)) return [3, 6];
6400
6412
  _k = (_j = ObjectSerializer_1.ObjectSerializer).deserialize;
6401
6413
  _m = (_l = ObjectSerializer_1.ObjectSerializer).parse;
6402
6414
  return [4, response.body.text()];
6403
6415
  case 5:
6404
- body = _k.apply(_j, [_m.apply(_l, [_2.sent(), contentType]),
6416
+ body = _k.apply(_j, [_m.apply(_l, [_6.sent(), contentType]),
6405
6417
  "ErrorResponse", ""]);
6406
- throw new exception_1.ApiException(response.httpStatusCode, "invalid webhook", body, response.headers);
6418
+ throw new exception_1.ApiException(response.httpStatusCode, "webhook not found", body, response.headers);
6407
6419
  case 6:
6408
- if (!(0, util_1.isCodeInRange)("401", response.httpStatusCode)) return [3, 8];
6420
+ if (!(0, util_1.isCodeInRange)("422", response.httpStatusCode)) return [3, 8];
6409
6421
  _p = (_o = ObjectSerializer_1.ObjectSerializer).deserialize;
6410
6422
  _r = (_q = ObjectSerializer_1.ObjectSerializer).parse;
6411
6423
  return [4, response.body.text()];
6412
6424
  case 7:
6413
- body = _p.apply(_o, [_r.apply(_q, [_2.sent(), contentType]),
6425
+ body = _p.apply(_o, [_r.apply(_q, [_6.sent(), contentType]),
6414
6426
  "ErrorResponse", ""]);
6415
- throw new exception_1.ApiException(response.httpStatusCode, "authentication failed", body, response.headers);
6427
+ throw new exception_1.ApiException(response.httpStatusCode, "invalid webhook", body, response.headers);
6416
6428
  case 8:
6417
- if (!(0, util_1.isCodeInRange)("429", response.httpStatusCode)) return [3, 10];
6429
+ if (!(0, util_1.isCodeInRange)("401", response.httpStatusCode)) return [3, 10];
6418
6430
  _t = (_s = ObjectSerializer_1.ObjectSerializer).deserialize;
6419
6431
  _v = (_u = ObjectSerializer_1.ObjectSerializer).parse;
6420
6432
  return [4, response.body.text()];
6421
6433
  case 9:
6422
- body = _t.apply(_s, [_v.apply(_u, [_2.sent(), contentType]),
6434
+ body = _t.apply(_s, [_v.apply(_u, [_6.sent(), contentType]),
6423
6435
  "ErrorResponse", ""]);
6424
- throw new exception_1.ApiException(response.httpStatusCode, "Too many requests: wait the number of seconds in the Retry-After header, then send the request again.", body, response.headers);
6436
+ throw new exception_1.ApiException(response.httpStatusCode, "authentication failed", body, response.headers);
6425
6437
  case 10:
6426
- if (!(response.httpStatusCode >= 200 && response.httpStatusCode <= 299)) return [3, 12];
6438
+ if (!(0, util_1.isCodeInRange)("429", response.httpStatusCode)) return [3, 12];
6427
6439
  _x = (_w = ObjectSerializer_1.ObjectSerializer).deserialize;
6428
6440
  _z = (_y = ObjectSerializer_1.ObjectSerializer).parse;
6429
6441
  return [4, response.body.text()];
6430
6442
  case 11:
6431
- body = _x.apply(_w, [_z.apply(_y, [_2.sent(), contentType]),
6443
+ body = _x.apply(_w, [_z.apply(_y, [_6.sent(), contentType]),
6444
+ "ErrorResponse", ""]);
6445
+ throw new exception_1.ApiException(response.httpStatusCode, "Too many requests: wait the number of seconds in the Retry-After header, then send the request again.", body, response.headers);
6446
+ case 12:
6447
+ if (!(response.httpStatusCode >= 200 && response.httpStatusCode <= 299)) return [3, 14];
6448
+ _1 = (_0 = ObjectSerializer_1.ObjectSerializer).deserialize;
6449
+ _3 = (_2 = ObjectSerializer_1.ObjectSerializer).parse;
6450
+ return [4, response.body.text()];
6451
+ case 13:
6452
+ body = _1.apply(_0, [_3.apply(_2, [_6.sent(), contentType]),
6432
6453
  "Webhook", ""]);
6433
6454
  return [2, new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body)];
6434
- case 12:
6435
- _0 = exception_1.ApiException.bind;
6436
- _1 = [void 0, response.httpStatusCode, "Unknown API Status Code!"];
6455
+ case 14:
6456
+ _4 = exception_1.ApiException.bind;
6457
+ _5 = [void 0, response.httpStatusCode, "Unknown API Status Code!"];
6437
6458
  return [4, response.getBodyAsAny()];
6438
- case 13: throw new (_0.apply(exception_1.ApiException, _1.concat([_2.sent(), response.headers])))();
6459
+ case 15: throw new (_4.apply(exception_1.ApiException, _5.concat([_6.sent(), response.headers])))();
6439
6460
  }
6440
6461
  });
6441
6462
  });
@@ -6541,7 +6562,7 @@ var ClientResponseProcessor = (function () {
6541
6562
  case 3:
6542
6563
  body = _f.apply(_e, [_h.apply(_g, [_6.sent(), contentType]),
6543
6564
  "ErrorResponse", ""]);
6544
- throw new exception_1.ApiException(response.httpStatusCode, "not a PDF template", body, response.headers);
6565
+ throw new exception_1.ApiException(response.httpStatusCode, "an HTML template", body, response.headers);
6545
6566
  case 4:
6546
6567
  if (!(0, util_1.isCodeInRange)("404", response.httpStatusCode)) return [3, 6];
6547
6568
  _k = (_j = ObjectSerializer_1.ObjectSerializer).deserialize;