docspring 4.1.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.
- package/AGENTS.md +5 -4
- package/README.md +10 -6
- package/dist/ApiClient.js +3 -3
- package/dist/RequestSchemas.js +94 -15
- package/dist/WebhookSignature.js +86 -0
- package/dist/api/Client.js +193 -57
- package/dist/index.js +42 -0
- package/dist/model/AddTemplateFieldsRequest.js +2 -2
- package/dist/model/AiFieldNamingLanguage.js +1 -1
- package/dist/model/AuthenticationCheck.js +2 -2
- package/dist/model/BarcodeSymbology.js +1 -1
- package/dist/model/CheckCharacter.js +1 -1
- package/dist/model/CombinedFieldType.js +1 -1
- package/dist/model/CombinedPdf.js +4 -4
- package/dist/model/CombinedPdfFiles.js +2 -2
- package/dist/model/CombinedPdfList.js +2 -2
- package/dist/model/CombinedPdfSource.js +2 -2
- package/dist/model/CombinedPdfSourceInput.js +2 -2
- package/dist/model/CombinedPdfSourcePdf.js +2 -2
- package/dist/model/CombinedPdfSourceType.js +1 -1
- package/dist/model/CombinedPdfState.js +1 -1
- package/dist/model/CopyTemplateRequest.js +2 -2
- package/dist/model/CreateCombinedPdfRequest.js +3 -3
- package/dist/model/CreateCustomFileFromUploadRequest.js +2 -2
- package/dist/model/CreateFolderRequest.js +2 -2
- package/dist/model/CreateSignatureRequestEventRequest.js +2 -2
- package/dist/model/CreateSignatureRequestTokenRequest.js +2 -2
- package/dist/model/CreateSubmissionBatchRequest.js +2 -2
- package/dist/model/CreateSubmissionRequest.js +7 -7
- package/dist/model/CreateTemplatePreviewRequest.js +112 -0
- package/dist/model/CreateTemplateRequest.js +32 -13
- package/dist/model/CreateWebhookRequest.js +2 -2
- package/dist/model/CustomFile.js +2 -2
- package/dist/model/CustomFileList.js +2 -2
- package/dist/model/CustomFileSourcePdf.js +2 -2
- package/dist/model/ErrorCode.js +12 -2
- package/dist/model/ErrorDetail.js +3 -3
- package/dist/model/ErrorInfo.js +7 -7
- package/dist/model/ErrorResponse.js +2 -2
- package/dist/model/ExpirationInterval.js +1 -1
- package/dist/model/Field.js +3 -3
- package/dist/model/FieldComparisonCondition.js +2 -2
- package/dist/model/FieldComparisonOperator.js +1 -1
- package/dist/model/FieldDependency.js +2 -2
- package/dist/model/FieldDependencyInput.js +2 -2
- package/dist/model/FieldDisplayType.js +1 -1
- package/dist/model/FieldEqualsCondition.js +2 -2
- package/dist/model/FieldEqualsOperator.js +1 -1
- package/dist/model/FieldGroup.js +6 -6
- package/dist/model/FieldGroupInput.js +3 -3
- package/dist/model/FieldGroupType.js +1 -1
- package/dist/model/FieldInCondition.js +2 -2
- package/dist/model/FieldInput.js +3 -3
- package/dist/model/FieldOverride.js +2 -2
- package/dist/model/FieldPresenceCondition.js +2 -2
- package/dist/model/FieldPresenceOperator.js +1 -1
- package/dist/model/FieldRangeCondition.js +2 -2
- package/dist/model/FieldReimportState.js +1 -1
- package/dist/model/FieldSetupLogic.js +1 -1
- package/dist/model/FieldSetupNaming.js +1 -1
- package/dist/model/FieldSetupSource.js +1 -1
- package/dist/model/FieldType.js +1 -1
- package/dist/model/Folder.js +2 -2
- package/dist/model/FolderList.js +2 -2
- package/dist/model/GenerateFilesFormat.js +16 -1
- package/dist/model/GenerateSubmissionFilesRequest.js +4 -4
- package/dist/model/GeneratedFile.js +7 -7
- package/dist/model/GeneratedFileState.js +1 -1
- package/dist/model/HtmlEngineOptions.js +2 -2
- package/dist/model/HtmlEngineOptionsInput.js +2 -2
- package/dist/model/ImageGravity.js +1 -1
- package/dist/model/ImageScaleType.js +1 -1
- package/dist/model/ModelCodeLanguage.js +7 -2
- package/dist/model/MoveFolderRequest.js +2 -2
- package/dist/model/MoveTemplateRequest.js +2 -2
- package/dist/model/NumberConditionType.js +1 -1
- package/dist/model/OutputFormat.js +11 -1
- package/dist/model/PageFormat.js +1 -1
- package/dist/model/PageImage.js +2 -2
- package/dist/model/PageImages.js +2 -2
- package/dist/model/PredefinedField.js +2 -2
- package/dist/model/PredefinedFieldInput.js +2 -2
- package/dist/model/PublishTemplateVersionRequest.js +2 -2
- package/dist/model/RemoveTemplateFieldsRequest.js +2 -2
- package/dist/model/RenameFolderRequest.js +2 -2
- package/dist/model/ReorderTemplateFieldsRequest.js +2 -2
- package/dist/model/RestoreTemplateVersionRequest.js +2 -2
- package/dist/model/ShapeType.js +1 -1
- package/dist/model/SignatureRequest.js +2 -2
- package/dist/model/SignatureRequestAuthSecondFactorType.js +1 -1
- package/dist/model/SignatureRequestAuthType.js +1 -1
- package/dist/model/SignatureRequestEvent.js +2 -2
- package/dist/model/SignatureRequestEventType.js +1 -1
- package/dist/model/SignatureRequestInput.js +2 -2
- package/dist/model/SignatureRequestMessageType.js +1 -1
- package/dist/model/SignatureRequestState.js +1 -1
- package/dist/model/SignatureRequestToken.js +2 -2
- package/dist/model/SignatureRequestTokenType.js +1 -1
- package/dist/model/StringConditionType.js +1 -1
- package/dist/model/Submission.js +82 -82
- package/dist/model/SubmissionAction.js +2 -2
- package/dist/model/SubmissionActionState.js +1 -1
- package/dist/model/SubmissionActionType.js +1 -1
- package/dist/model/SubmissionBatch.js +9 -9
- package/dist/model/SubmissionBatchState.js +1 -1
- package/dist/model/SubmissionFiles.js +20 -2
- package/dist/model/SubmissionInput.js +7 -7
- package/dist/model/SubmissionList.js +6 -6
- package/dist/model/SubmissionSource.js +1 -1
- package/dist/model/SubmissionSourcePdf.js +2 -2
- package/dist/model/SubmissionState.js +1 -1
- package/dist/model/SubmissionSummary.js +343 -0
- package/dist/model/SubmissionValidation.js +2 -2
- package/dist/model/Template.js +95 -72
- package/dist/model/TemplateActor.js +4 -4
- package/dist/model/TemplateActorType.js +1 -1
- package/dist/model/TemplateDefaults.js +2 -2
- package/dist/model/TemplateDefaultsInput.js +2 -2
- package/dist/model/TemplateDiff.js +6 -6
- package/dist/model/TemplateDiffSummary.js +2 -2
- package/dist/model/TemplateDocument.js +49 -49
- package/dist/model/TemplateDocumentState.js +12 -2
- package/dist/model/TemplateDocumentSummary.js +152 -0
- package/dist/model/TemplateFieldChange.js +2 -2
- package/dist/model/TemplateFieldChanges.js +2 -2
- package/dist/model/TemplateFieldDependency.js +2 -2
- package/dist/model/TemplateFieldDependencyAction.js +1 -1
- package/dist/model/TemplateFieldDependencyCondition.js +2 -2
- package/dist/model/TemplateFieldDependencyConditionInput.js +2 -2
- package/dist/model/TemplateFieldDependencyInput.js +2 -2
- package/dist/model/TemplateFieldDependencyMatch.js +1 -1
- package/dist/model/TemplateFieldDependencyOperator.js +1 -1
- package/dist/model/TemplateFieldLogicStatus.js +1 -1
- package/dist/model/TemplateFieldMove.js +2 -2
- package/dist/model/TemplateFields.js +2 -2
- package/dist/model/TemplateFormMode.js +1 -1
- package/dist/model/TemplateModelCode.js +2 -2
- package/dist/model/TemplatePageAiError.js +1 -1
- package/dist/model/TemplatePageAiNamingStatus.js +1 -1
- package/dist/model/TemplatePageFieldsStatus.js +1 -1
- package/dist/model/TemplatePageImageStatus.js +1 -1
- package/dist/model/TemplatePageImages.js +2 -2
- package/dist/model/TemplatePageProcessingStatus.js +2 -2
- package/dist/model/TemplatePreview.js +211 -0
- package/dist/model/TemplatePreviewState.js +64 -0
- package/dist/model/TemplateSourcePdf.js +2 -2
- package/dist/model/TemplateSummary.js +29 -291
- package/dist/model/TemplateSummaryList.js +2 -2
- package/dist/model/TemplateType.js +7 -2
- package/dist/model/TemplateVersion.js +2 -2
- package/dist/model/TemplateVersionType.js +1 -1
- package/dist/model/TextAlignment.js +1 -1
- package/dist/model/TextOverflow.js +1 -1
- package/dist/model/TextVerticalAlignment.js +1 -1
- package/dist/model/Typeface.js +1 -1
- package/dist/model/UpdateSignatureRequestRequest.js +2 -2
- package/dist/model/UpdateTemplateDocumentRequest.js +8 -8
- package/dist/model/UpdateTemplateFieldsRequest.js +2 -2
- package/dist/model/UpdateTemplateRequest.js +26 -7
- package/dist/model/UpdateWebhookRequest.js +2 -2
- package/dist/model/UploadMethod.js +1 -1
- package/dist/model/UploadPresign.js +2 -2
- package/dist/model/UrlSourcePdf.js +2 -2
- package/dist/model/ValidateSubmissionRequest.js +7 -7
- package/dist/model/Webhook.js +2 -2
- package/dist/model/WebhookEventType.js +1 -1
- package/dist/model/WebhookList.js +2 -2
- package/dist/model/WebhookMode.js +1 -1
- package/package.json +4 -3
package/dist/api/Client.js
CHANGED
|
@@ -18,6 +18,7 @@ var _CreateSignatureRequestEventRequest = _interopRequireDefault(require("../mod
|
|
|
18
18
|
var _CreateSignatureRequestTokenRequest = _interopRequireDefault(require("../model/CreateSignatureRequestTokenRequest"));
|
|
19
19
|
var _CreateSubmissionBatchRequest = _interopRequireDefault(require("../model/CreateSubmissionBatchRequest"));
|
|
20
20
|
var _CreateSubmissionRequest = _interopRequireDefault(require("../model/CreateSubmissionRequest"));
|
|
21
|
+
var _CreateTemplatePreviewRequest = _interopRequireDefault(require("../model/CreateTemplatePreviewRequest"));
|
|
21
22
|
var _CreateTemplateRequest = _interopRequireDefault(require("../model/CreateTemplateRequest"));
|
|
22
23
|
var _CreateWebhookRequest = _interopRequireDefault(require("../model/CreateWebhookRequest"));
|
|
23
24
|
var _CustomFile = _interopRequireDefault(require("../model/CustomFile"));
|
|
@@ -32,6 +33,7 @@ var _GenerateSubmissionFilesRequest = _interopRequireDefault(require("../model/G
|
|
|
32
33
|
var _ModelCodeLanguage = _interopRequireDefault(require("../model/ModelCodeLanguage"));
|
|
33
34
|
var _MoveFolderRequest = _interopRequireDefault(require("../model/MoveFolderRequest"));
|
|
34
35
|
var _MoveTemplateRequest = _interopRequireDefault(require("../model/MoveTemplateRequest"));
|
|
36
|
+
var _OutputFormat = _interopRequireDefault(require("../model/OutputFormat"));
|
|
35
37
|
var _PublishTemplateVersionRequest = _interopRequireDefault(require("../model/PublishTemplateVersionRequest"));
|
|
36
38
|
var _RemoveTemplateFieldsRequest = _interopRequireDefault(require("../model/RemoveTemplateFieldsRequest"));
|
|
37
39
|
var _RenameFolderRequest = _interopRequireDefault(require("../model/RenameFolderRequest"));
|
|
@@ -43,12 +45,14 @@ var _SignatureRequestToken = _interopRequireDefault(require("../model/SignatureR
|
|
|
43
45
|
var _Submission = _interopRequireDefault(require("../model/Submission"));
|
|
44
46
|
var _SubmissionBatch = _interopRequireDefault(require("../model/SubmissionBatch"));
|
|
45
47
|
var _SubmissionList = _interopRequireDefault(require("../model/SubmissionList"));
|
|
48
|
+
var _SubmissionState = _interopRequireDefault(require("../model/SubmissionState"));
|
|
46
49
|
var _SubmissionValidation = _interopRequireDefault(require("../model/SubmissionValidation"));
|
|
47
50
|
var _Template = _interopRequireDefault(require("../model/Template"));
|
|
48
51
|
var _TemplateDiff = _interopRequireDefault(require("../model/TemplateDiff"));
|
|
49
52
|
var _TemplateFields = _interopRequireDefault(require("../model/TemplateFields"));
|
|
50
53
|
var _TemplateModelCode = _interopRequireDefault(require("../model/TemplateModelCode"));
|
|
51
54
|
var _TemplatePageImages = _interopRequireDefault(require("../model/TemplatePageImages"));
|
|
55
|
+
var _TemplatePreview = _interopRequireDefault(require("../model/TemplatePreview"));
|
|
52
56
|
var _TemplateSummaryList = _interopRequireDefault(require("../model/TemplateSummaryList"));
|
|
53
57
|
var _TemplateVersion = _interopRequireDefault(require("../model/TemplateVersion"));
|
|
54
58
|
var _UpdateSignatureRequestRequest = _interopRequireDefault(require("../model/UpdateSignatureRequestRequest"));
|
|
@@ -70,7 +74,7 @@ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r),
|
|
|
70
74
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
71
75
|
function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r; if ("undefined" != typeof Symbol && void 0 !== (r = t[Symbol.toPrimitive])) { var i = r.call(t, e || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === e ? String : Number)(t); } /**
|
|
72
76
|
* DocSpring API
|
|
73
|
-
* Use DocSpring's API to
|
|
77
|
+
* Use DocSpring's API to fill PDF forms, generate PDFs and Word documents from HTML or Word templates, merge PDFs, and request legally binding e-signatures.
|
|
74
78
|
*
|
|
75
79
|
* The version of the OpenAPI document: v2
|
|
76
80
|
*
|
|
@@ -83,7 +87,7 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
|
|
|
83
87
|
/**
|
|
84
88
|
* Client service.
|
|
85
89
|
* @module api/Client
|
|
86
|
-
* @version 4.
|
|
90
|
+
* @version 4.3.0
|
|
87
91
|
*/
|
|
88
92
|
var Client = exports["default"] = /*#__PURE__*/function () {
|
|
89
93
|
/**
|
|
@@ -238,6 +242,7 @@ var Client = exports["default"] = /*#__PURE__*/function () {
|
|
|
238
242
|
* @param {module:model/CreateCombinedPdfRequest} body The PDFs to merge, and the combined PDF's settings.
|
|
239
243
|
* @param {Object} opts Optional parameters
|
|
240
244
|
* @param {Boolean} [wait] Wait until the PDF has been generated before responding. Default true on sync.api hosts.
|
|
245
|
+
* @param {String} [idempotencyKey] A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and an `Idempotent-Replayed: true` header) instead of creating another combined PDF. Send a new key with each new combined PDF, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422 `idempotency_key_reused`. A 409 `idempotency_key_in_use` means the first request is still being processed: send the request again in a few seconds.
|
|
241
246
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/CombinedPdf} and HTTP response
|
|
242
247
|
*/
|
|
243
248
|
}, {
|
|
@@ -253,7 +258,9 @@ var Client = exports["default"] = /*#__PURE__*/function () {
|
|
|
253
258
|
var queryParams = {
|
|
254
259
|
'wait': opts['wait']
|
|
255
260
|
};
|
|
256
|
-
var headerParams = {
|
|
261
|
+
var headerParams = {
|
|
262
|
+
'Idempotency-Key': opts['idempotencyKey']
|
|
263
|
+
};
|
|
257
264
|
var formParams = {};
|
|
258
265
|
var authNames = ['api_token_basic'];
|
|
259
266
|
var contentTypes = ['application/json'];
|
|
@@ -268,6 +275,7 @@ var Client = exports["default"] = /*#__PURE__*/function () {
|
|
|
268
275
|
* @param {module:model/CreateCombinedPdfRequest} body The PDFs to merge, and the combined PDF's settings.
|
|
269
276
|
* @param {Object} opts Optional parameters
|
|
270
277
|
* @param {Boolean} opts.wait Wait until the PDF has been generated before responding. Default true on sync.api hosts.
|
|
278
|
+
* @param {String} opts.idempotencyKey A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and an `Idempotent-Replayed: true` header) instead of creating another combined PDF. Send a new key with each new combined PDF, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422 `idempotency_key_reused`. A 409 `idempotency_key_in_use` means the first request is still being processed: send the request again in a few seconds.
|
|
271
279
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/CombinedPdf}
|
|
272
280
|
*/
|
|
273
281
|
}, {
|
|
@@ -358,7 +366,7 @@ var Client = exports["default"] = /*#__PURE__*/function () {
|
|
|
358
366
|
|
|
359
367
|
/**
|
|
360
368
|
* Record a signature request event
|
|
361
|
-
* Records something that happened outside DocSpring in the signature request's audit trail: you sent the request to the person (`send_request`). The audit trail shows it as reported by your account.
|
|
369
|
+
* Records something that happened outside DocSpring in the signature request's audit trail: you sent the request to the person (`send_request`). The audit trail shows it as reported by your account. A finished (completed, declined or expired) signature request's audit trail takes no more events, and a test API token can't record one for a live signature request.
|
|
362
370
|
* @param {String} signature_request_id The signature request's ID.
|
|
363
371
|
* @param {module:model/CreateSignatureRequestEventRequest} body The event to record.
|
|
364
372
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/SignatureRequestEvent} and HTTP response
|
|
@@ -390,7 +398,7 @@ var Client = exports["default"] = /*#__PURE__*/function () {
|
|
|
390
398
|
|
|
391
399
|
/**
|
|
392
400
|
* Record a signature request event
|
|
393
|
-
* Records something that happened outside DocSpring in the signature request's audit trail: you sent the request to the person (`send_request`). The audit trail shows it as reported by your account.
|
|
401
|
+
* Records something that happened outside DocSpring in the signature request's audit trail: you sent the request to the person (`send_request`). The audit trail shows it as reported by your account. A finished (completed, declined or expired) signature request's audit trail takes no more events, and a test API token can't record one for a live signature request.
|
|
394
402
|
* @param {String} signature_request_id The signature request's ID.
|
|
395
403
|
* @param {module:model/CreateSignatureRequestEventRequest} body The event to record.
|
|
396
404
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/SignatureRequestEvent}
|
|
@@ -457,6 +465,7 @@ var Client = exports["default"] = /*#__PURE__*/function () {
|
|
|
457
465
|
* @param {Object} opts Optional parameters
|
|
458
466
|
* @param {String} [version] The template version to use: a published version (`1.2.0`, or `1` for the latest 1.x.x), `latest` or `draft`. Default `latest` (the draft when no version has been published).
|
|
459
467
|
* @param {Boolean} [wait] Wait until the files have been generated before responding. Default true on sync.api hosts.
|
|
468
|
+
* @param {String} [idempotencyKey] A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and an `Idempotent-Replayed: true` header) instead of creating another submission. Send a new key with each new submission, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422 `idempotency_key_reused`. A 409 `idempotency_key_in_use` means the first request is still being processed: send the request again in a few seconds.
|
|
460
469
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Submission} and HTTP response
|
|
461
470
|
*/
|
|
462
471
|
}, {
|
|
@@ -479,7 +488,9 @@ var Client = exports["default"] = /*#__PURE__*/function () {
|
|
|
479
488
|
'version': opts['version'],
|
|
480
489
|
'wait': opts['wait']
|
|
481
490
|
};
|
|
482
|
-
var headerParams = {
|
|
491
|
+
var headerParams = {
|
|
492
|
+
'Idempotency-Key': opts['idempotencyKey']
|
|
493
|
+
};
|
|
483
494
|
var formParams = {};
|
|
484
495
|
var authNames = ['api_token_basic'];
|
|
485
496
|
var contentTypes = ['application/json'];
|
|
@@ -496,6 +507,7 @@ var Client = exports["default"] = /*#__PURE__*/function () {
|
|
|
496
507
|
* @param {Object} opts Optional parameters
|
|
497
508
|
* @param {String} opts.version The template version to use: a published version (`1.2.0`, or `1` for the latest 1.x.x), `latest` or `draft`. Default `latest` (the draft when no version has been published).
|
|
498
509
|
* @param {Boolean} opts.wait Wait until the files have been generated before responding. Default true on sync.api hosts.
|
|
510
|
+
* @param {String} opts.idempotencyKey A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and an `Idempotent-Replayed: true` header) instead of creating another submission. Send a new key with each new submission, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422 `idempotency_key_reused`. A 409 `idempotency_key_in_use` means the first request is still being processed: send the request again in a few seconds.
|
|
499
511
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Submission}
|
|
500
512
|
*/
|
|
501
513
|
}, {
|
|
@@ -511,7 +523,8 @@ var Client = exports["default"] = /*#__PURE__*/function () {
|
|
|
511
523
|
* Creates up to 50 submissions in one request, from one template or several. The PDFs are only generated when every submission is valid. On sync.api hosts the request waits until every PDF has been generated (unless you pass `wait=false`), otherwise poll GET /submissions/batches/{submission_batch_id} until `processed_at` is set. When any submission is invalid, nothing is generated and the request returns a 422. Submissions whose data doesn't match their template's fields are still saved with their errors (an `invalid_data` error, with each one's `submission_id` in its details), so you can find them in DocSpring. The other submissions aren't saved.
|
|
512
524
|
* @param {module:model/CreateSubmissionBatchRequest} body The submissions to create, and the settings they share.
|
|
513
525
|
* @param {Object} opts Optional parameters
|
|
514
|
-
* @param {Boolean} [wait] Wait until every
|
|
526
|
+
* @param {Boolean} [wait] Wait until every file in the batch has been generated before responding. Default true on sync.api hosts.
|
|
527
|
+
* @param {String} [idempotencyKey] A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and an `Idempotent-Replayed: true` header) instead of creating another batch. Send a new key with each new batch, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422 `idempotency_key_reused`. A 409 `idempotency_key_in_use` means the first request is still being processed: send the request again in a few seconds.
|
|
515
528
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/SubmissionBatch} and HTTP response
|
|
516
529
|
*/
|
|
517
530
|
}, {
|
|
@@ -527,7 +540,9 @@ var Client = exports["default"] = /*#__PURE__*/function () {
|
|
|
527
540
|
var queryParams = {
|
|
528
541
|
'wait': opts['wait']
|
|
529
542
|
};
|
|
530
|
-
var headerParams = {
|
|
543
|
+
var headerParams = {
|
|
544
|
+
'Idempotency-Key': opts['idempotencyKey']
|
|
545
|
+
};
|
|
531
546
|
var formParams = {};
|
|
532
547
|
var authNames = ['api_token_basic'];
|
|
533
548
|
var contentTypes = ['application/json'];
|
|
@@ -541,7 +556,8 @@ var Client = exports["default"] = /*#__PURE__*/function () {
|
|
|
541
556
|
* Creates up to 50 submissions in one request, from one template or several. The PDFs are only generated when every submission is valid. On sync.api hosts the request waits until every PDF has been generated (unless you pass `wait=false`), otherwise poll GET /submissions/batches/{submission_batch_id} until `processed_at` is set. When any submission is invalid, nothing is generated and the request returns a 422. Submissions whose data doesn't match their template's fields are still saved with their errors (an `invalid_data` error, with each one's `submission_id` in its details), so you can find them in DocSpring. The other submissions aren't saved.
|
|
542
557
|
* @param {module:model/CreateSubmissionBatchRequest} body The submissions to create, and the settings they share.
|
|
543
558
|
* @param {Object} opts Optional parameters
|
|
544
|
-
* @param {Boolean} opts.wait Wait until every
|
|
559
|
+
* @param {Boolean} opts.wait Wait until every file in the batch has been generated before responding. Default true on sync.api hosts.
|
|
560
|
+
* @param {String} opts.idempotencyKey A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and an `Idempotent-Replayed: true` header) instead of creating another batch. Send a new key with each new batch, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422 `idempotency_key_reused`. A 409 `idempotency_key_in_use` means the first request is still being processed: send the request again in a few seconds.
|
|
545
561
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/SubmissionBatch}
|
|
546
562
|
*/
|
|
547
563
|
}, {
|
|
@@ -554,10 +570,10 @@ var Client = exports["default"] = /*#__PURE__*/function () {
|
|
|
554
570
|
|
|
555
571
|
/**
|
|
556
572
|
* Create a template
|
|
557
|
-
* Creates an HTML template, or a PDF template from a
|
|
573
|
+
* Creates an HTML template, or a PDF or Word template from a file you uploaded with the presigned upload (GET /uploads/presign): pass its `fields.key` as `cache_id`. You can send a link to the file (`document_url`) or the file in base64 (`document_base64`) instead, or send the file with the request with POST /templates/upload. A Word template is made from a Word document (.docx) or an OpenDocument text file (.odt), which DocSpring converts to a Word document. It needs its `output_format`: what each submission makes, a Word document (`docx`), an OpenDocument file (`odt`) or a PDF. A PDF template is ready to generate PDFs once DocSpring has processed its PDF, a template created from a `document_url` once its document has been downloaded, and one created from an .odt once it has been converted (`ready` is true). On sync.api hosts the request waits for that unless you pass `wait=false`.
|
|
558
574
|
* @param {module:model/CreateTemplateRequest} body The template to create.
|
|
559
575
|
* @param {Object} opts Optional parameters
|
|
560
|
-
* @param {Boolean} [wait] Wait until the PDF has been processed,
|
|
576
|
+
* @param {Boolean} [wait] Wait until the PDF has been processed, a `document_url`'s PDF or Word document downloaded, and an OpenDocument file converted, before responding. Default true on sync.api hosts.
|
|
561
577
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Template} and HTTP response
|
|
562
578
|
*/
|
|
563
579
|
}, {
|
|
@@ -584,10 +600,10 @@ var Client = exports["default"] = /*#__PURE__*/function () {
|
|
|
584
600
|
|
|
585
601
|
/**
|
|
586
602
|
* Create a template
|
|
587
|
-
* Creates an HTML template, or a PDF template from a
|
|
603
|
+
* Creates an HTML template, or a PDF or Word template from a file you uploaded with the presigned upload (GET /uploads/presign): pass its `fields.key` as `cache_id`. You can send a link to the file (`document_url`) or the file in base64 (`document_base64`) instead, or send the file with the request with POST /templates/upload. A Word template is made from a Word document (.docx) or an OpenDocument text file (.odt), which DocSpring converts to a Word document. It needs its `output_format`: what each submission makes, a Word document (`docx`), an OpenDocument file (`odt`) or a PDF. A PDF template is ready to generate PDFs once DocSpring has processed its PDF, a template created from a `document_url` once its document has been downloaded, and one created from an .odt once it has been converted (`ready` is true). On sync.api hosts the request waits for that unless you pass `wait=false`.
|
|
588
604
|
* @param {module:model/CreateTemplateRequest} body The template to create.
|
|
589
605
|
* @param {Object} opts Optional parameters
|
|
590
|
-
* @param {Boolean} opts.wait Wait until the PDF has been processed,
|
|
606
|
+
* @param {Boolean} opts.wait Wait until the PDF has been processed, a `document_url`'s PDF or Word document downloaded, and an OpenDocument file converted, before responding. Default true on sync.api hosts.
|
|
591
607
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Template}
|
|
592
608
|
*/
|
|
593
609
|
}, {
|
|
@@ -598,6 +614,60 @@ var Client = exports["default"] = /*#__PURE__*/function () {
|
|
|
598
614
|
});
|
|
599
615
|
}
|
|
600
616
|
|
|
617
|
+
/**
|
|
618
|
+
* Preview a template with data
|
|
619
|
+
* Makes PNG images of a template's pages filled in with the data you send (not a PDF), so you can check how an HTML, PDF or Word template prints with your data before you publish a version or send live data. A Word template's pages are its PDF's, whatever its `output_format`. It renders the template's draft, or the published `version` you ask for. A preview makes no submission and uses no credits, and its pages are watermarked like a test submission's PDF. It's `pending` while it renders: get it with GET /templates/{template_id}/previews/{preview_id} until it's `processed`, with an image of each page, or `error`.
|
|
620
|
+
* @param {String} template_id The template's ID.
|
|
621
|
+
* @param {module:model/CreateTemplatePreviewRequest} body The data to render the template with.
|
|
622
|
+
* @param {Object} opts Optional parameters
|
|
623
|
+
* @param {String} [version] A published version (`1.2.0`, or `1` for the latest 1.x.x), `latest` or `draft`. Default `draft`.
|
|
624
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/TemplatePreview} and HTTP response
|
|
625
|
+
*/
|
|
626
|
+
}, {
|
|
627
|
+
key: "createTemplatePreviewWithHttpInfo",
|
|
628
|
+
value: function createTemplatePreviewWithHttpInfo(template_id, body, opts) {
|
|
629
|
+
opts = opts || {};
|
|
630
|
+
var postBody = body;
|
|
631
|
+
// verify the required parameter 'template_id' is set
|
|
632
|
+
if (template_id === undefined || template_id === null) {
|
|
633
|
+
throw new Error("Missing the required parameter 'template_id' when calling createTemplatePreview");
|
|
634
|
+
}
|
|
635
|
+
// verify the required parameter 'body' is set
|
|
636
|
+
if (body === undefined || body === null) {
|
|
637
|
+
throw new Error("Missing the required parameter 'body' when calling createTemplatePreview");
|
|
638
|
+
}
|
|
639
|
+
var pathParams = {
|
|
640
|
+
'template_id': template_id
|
|
641
|
+
};
|
|
642
|
+
var queryParams = {
|
|
643
|
+
'version': opts['version']
|
|
644
|
+
};
|
|
645
|
+
var headerParams = {};
|
|
646
|
+
var formParams = {};
|
|
647
|
+
var authNames = ['api_token_basic'];
|
|
648
|
+
var contentTypes = ['application/json'];
|
|
649
|
+
var accepts = ['application/json'];
|
|
650
|
+
var returnType = _TemplatePreview["default"];
|
|
651
|
+
return this.apiClient.callApi('/templates/{template_id}/previews', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
/**
|
|
655
|
+
* Preview a template with data
|
|
656
|
+
* Makes PNG images of a template's pages filled in with the data you send (not a PDF), so you can check how an HTML, PDF or Word template prints with your data before you publish a version or send live data. A Word template's pages are its PDF's, whatever its `output_format`. It renders the template's draft, or the published `version` you ask for. A preview makes no submission and uses no credits, and its pages are watermarked like a test submission's PDF. It's `pending` while it renders: get it with GET /templates/{template_id}/previews/{preview_id} until it's `processed`, with an image of each page, or `error`.
|
|
657
|
+
* @param {String} template_id The template's ID.
|
|
658
|
+
* @param {module:model/CreateTemplatePreviewRequest} body The data to render the template with.
|
|
659
|
+
* @param {Object} opts Optional parameters
|
|
660
|
+
* @param {String} opts.version A published version (`1.2.0`, or `1` for the latest 1.x.x), `latest` or `draft`. Default `draft`.
|
|
661
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/TemplatePreview}
|
|
662
|
+
*/
|
|
663
|
+
}, {
|
|
664
|
+
key: "createTemplatePreview",
|
|
665
|
+
value: function createTemplatePreview(template_id, body, opts) {
|
|
666
|
+
return this.createTemplatePreviewWithHttpInfo(template_id, body, opts).then(function (response_and_data) {
|
|
667
|
+
return response_and_data.data;
|
|
668
|
+
});
|
|
669
|
+
}
|
|
670
|
+
|
|
601
671
|
/**
|
|
602
672
|
* Create a webhook
|
|
603
673
|
* Creates a webhook that sends a POST request to your endpoint whenever a subscribed event happens. Scope it to API tokens, templates or folders to receive only their events.
|
|
@@ -892,7 +962,7 @@ var Client = exports["default"] = /*#__PURE__*/function () {
|
|
|
892
962
|
|
|
893
963
|
/**
|
|
894
964
|
* Generate more files
|
|
895
|
-
* Adds formats to a processed submission's files, in the background: `png`, a PNG image of each page of the PDF (up to 100 pages). To make them with the submission, add them to `output_formats` when you create it. Each new file is listed in `files` while it's made: on sync.api hosts the request waits for them (unless you pass `wait=false`), otherwise poll GET /submissions/{submission_id} until none of their `state` is `pending`. A file that couldn't be made has the state `error` and an `error_message`, and the submission stays processed. Asking for a format the submission already has (or is making) changes nothing.
|
|
965
|
+
* Adds formats to a processed submission's files, in the background, without using credits again: `pdf`, the PDF of a Word template's submission that made only its Word document (converted from that document), `docx`, the Word document of a Word template's submission that made only its PDF (made again from its data and the template version it used), `odt`, a Word template's submission's OpenDocument file (converted from its Word document, or from one made again when it didn't keep one), and `png`, a PNG image of each page of the PDF (up to 100 pages), which makes the PDF first when the submission doesn't have one. To make them with the submission, add them to `output_formats` when you create it. Each new file is listed in `files` while it's made: on sync.api hosts the request waits for them (unless you pass `wait=false`), otherwise poll GET /submissions/{submission_id} until none of their `state` is `pending`. A file that couldn't be made has the state `error` and an `error_message`, and the submission stays processed. Asking for a format the submission already has (or is making) changes nothing.
|
|
896
966
|
* @param {String} submission_id The submission's ID.
|
|
897
967
|
* @param {module:model/GenerateSubmissionFilesRequest} body The formats to make.
|
|
898
968
|
* @param {Object} opts Optional parameters
|
|
@@ -929,7 +999,7 @@ var Client = exports["default"] = /*#__PURE__*/function () {
|
|
|
929
999
|
|
|
930
1000
|
/**
|
|
931
1001
|
* Generate more files
|
|
932
|
-
* Adds formats to a processed submission's files, in the background: `png`, a PNG image of each page of the PDF (up to 100 pages). To make them with the submission, add them to `output_formats` when you create it. Each new file is listed in `files` while it's made: on sync.api hosts the request waits for them (unless you pass `wait=false`), otherwise poll GET /submissions/{submission_id} until none of their `state` is `pending`. A file that couldn't be made has the state `error` and an `error_message`, and the submission stays processed. Asking for a format the submission already has (or is making) changes nothing.
|
|
1002
|
+
* Adds formats to a processed submission's files, in the background, without using credits again: `pdf`, the PDF of a Word template's submission that made only its Word document (converted from that document), `docx`, the Word document of a Word template's submission that made only its PDF (made again from its data and the template version it used), `odt`, a Word template's submission's OpenDocument file (converted from its Word document, or from one made again when it didn't keep one), and `png`, a PNG image of each page of the PDF (up to 100 pages), which makes the PDF first when the submission doesn't have one. To make them with the submission, add them to `output_formats` when you create it. Each new file is listed in `files` while it's made: on sync.api hosts the request waits for them (unless you pass `wait=false`), otherwise poll GET /submissions/{submission_id} until none of their `state` is `pending`. A file that couldn't be made has the state `error` and an `error_message`, and the submission stays processed. Asking for a format the submission already has (or is making) changes nothing.
|
|
933
1003
|
* @param {String} submission_id The submission's ID.
|
|
934
1004
|
* @param {module:model/GenerateSubmissionFilesRequest} body The formats to make.
|
|
935
1005
|
* @param {Object} opts Optional parameters
|
|
@@ -1369,11 +1439,12 @@ var Client = exports["default"] = /*#__PURE__*/function () {
|
|
|
1369
1439
|
|
|
1370
1440
|
/**
|
|
1371
1441
|
* Generate typed code for a template's submission data
|
|
1372
|
-
* Generates types for a template's submission data in TypeScript, JavaScript, Ruby, Python, PHP, Java, C#, Elixir or
|
|
1442
|
+
* Generates types for a template's submission data in TypeScript, JavaScript, Ruby, Python, PHP, Java, C#, Elixir, Go or Rust, so your app catches mistakes before it calls the API. `root_type_name` is the type of the whole `data` object, and `just_types=true` leaves out the code that converts JSON to and from the types. Java returns every class in `code`, each under a `// ClassName.java` comment. A template with no named fields returns 422.
|
|
1373
1443
|
* @param {String} template_id The template's ID.
|
|
1374
1444
|
* @param {module:model/ModelCodeLanguage} lang The language to generate the code in.
|
|
1375
1445
|
* @param {Object} opts Optional parameters
|
|
1376
1446
|
* @param {String} [version] The template version: a published version (`1.2.0`, or `1` for the latest 1.x.x), `latest` or `draft`. Default `latest` (the draft when no version has been published), the version a submission uses by default.
|
|
1447
|
+
* @param {Boolean} [just_types] Return only the types (interfaces, classes or structs), without the code that converts JSON to and from them. Default false. JavaScript has no types, PHP has no types-only code, and Rust's code is only types (serde converts the JSON), so theirs is the same either way.
|
|
1377
1448
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/TemplateModelCode} and HTTP response
|
|
1378
1449
|
*/
|
|
1379
1450
|
}, {
|
|
@@ -1394,7 +1465,8 @@ var Client = exports["default"] = /*#__PURE__*/function () {
|
|
|
1394
1465
|
};
|
|
1395
1466
|
var queryParams = {
|
|
1396
1467
|
'version': opts['version'],
|
|
1397
|
-
'lang': lang
|
|
1468
|
+
'lang': lang,
|
|
1469
|
+
'just_types': opts['just_types']
|
|
1398
1470
|
};
|
|
1399
1471
|
var headerParams = {};
|
|
1400
1472
|
var formParams = {};
|
|
@@ -1407,11 +1479,12 @@ var Client = exports["default"] = /*#__PURE__*/function () {
|
|
|
1407
1479
|
|
|
1408
1480
|
/**
|
|
1409
1481
|
* Generate typed code for a template's submission data
|
|
1410
|
-
* Generates types for a template's submission data in TypeScript, JavaScript, Ruby, Python, PHP, Java, C#, Elixir or
|
|
1482
|
+
* Generates types for a template's submission data in TypeScript, JavaScript, Ruby, Python, PHP, Java, C#, Elixir, Go or Rust, so your app catches mistakes before it calls the API. `root_type_name` is the type of the whole `data` object, and `just_types=true` leaves out the code that converts JSON to and from the types. Java returns every class in `code`, each under a `// ClassName.java` comment. A template with no named fields returns 422.
|
|
1411
1483
|
* @param {String} template_id The template's ID.
|
|
1412
1484
|
* @param {module:model/ModelCodeLanguage} lang The language to generate the code in.
|
|
1413
1485
|
* @param {Object} opts Optional parameters
|
|
1414
1486
|
* @param {String} opts.version The template version: a published version (`1.2.0`, or `1` for the latest 1.x.x), `latest` or `draft`. Default `latest` (the draft when no version has been published), the version a submission uses by default.
|
|
1487
|
+
* @param {Boolean} opts.just_types Return only the types (interfaces, classes or structs), without the code that converts JSON to and from them. Default false. JavaScript has no types, PHP has no types-only code, and Rust's code is only types (serde converts the JSON), so theirs is the same either way.
|
|
1415
1488
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/TemplateModelCode}
|
|
1416
1489
|
*/
|
|
1417
1490
|
}, {
|
|
@@ -1470,6 +1543,54 @@ var Client = exports["default"] = /*#__PURE__*/function () {
|
|
|
1470
1543
|
});
|
|
1471
1544
|
}
|
|
1472
1545
|
|
|
1546
|
+
/**
|
|
1547
|
+
* Get a template preview
|
|
1548
|
+
* Returns a preview made with POST /templates/{template_id}/previews. Once it's `processed`, `pages` has a PNG image of each page with a temporary link to download it: a preview has no PDF. Previews are deleted an hour after they're created.
|
|
1549
|
+
* @param {String} template_id The template's ID.
|
|
1550
|
+
* @param {String} preview_id The preview's ID.
|
|
1551
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/TemplatePreview} and HTTP response
|
|
1552
|
+
*/
|
|
1553
|
+
}, {
|
|
1554
|
+
key: "getTemplatePreviewWithHttpInfo",
|
|
1555
|
+
value: function getTemplatePreviewWithHttpInfo(template_id, preview_id) {
|
|
1556
|
+
var postBody = null;
|
|
1557
|
+
// verify the required parameter 'template_id' is set
|
|
1558
|
+
if (template_id === undefined || template_id === null) {
|
|
1559
|
+
throw new Error("Missing the required parameter 'template_id' when calling getTemplatePreview");
|
|
1560
|
+
}
|
|
1561
|
+
// verify the required parameter 'preview_id' is set
|
|
1562
|
+
if (preview_id === undefined || preview_id === null) {
|
|
1563
|
+
throw new Error("Missing the required parameter 'preview_id' when calling getTemplatePreview");
|
|
1564
|
+
}
|
|
1565
|
+
var pathParams = {
|
|
1566
|
+
'template_id': template_id,
|
|
1567
|
+
'preview_id': preview_id
|
|
1568
|
+
};
|
|
1569
|
+
var queryParams = {};
|
|
1570
|
+
var headerParams = {};
|
|
1571
|
+
var formParams = {};
|
|
1572
|
+
var authNames = ['api_token_basic'];
|
|
1573
|
+
var contentTypes = [];
|
|
1574
|
+
var accepts = ['application/json'];
|
|
1575
|
+
var returnType = _TemplatePreview["default"];
|
|
1576
|
+
return this.apiClient.callApi('/templates/{template_id}/previews/{preview_id}', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
|
|
1577
|
+
}
|
|
1578
|
+
|
|
1579
|
+
/**
|
|
1580
|
+
* Get a template preview
|
|
1581
|
+
* Returns a preview made with POST /templates/{template_id}/previews. Once it's `processed`, `pages` has a PNG image of each page with a temporary link to download it: a preview has no PDF. Previews are deleted an hour after they're created.
|
|
1582
|
+
* @param {String} template_id The template's ID.
|
|
1583
|
+
* @param {String} preview_id The preview's ID.
|
|
1584
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/TemplatePreview}
|
|
1585
|
+
*/
|
|
1586
|
+
}, {
|
|
1587
|
+
key: "getTemplatePreview",
|
|
1588
|
+
value: function getTemplatePreview(template_id, preview_id) {
|
|
1589
|
+
return this.getTemplatePreviewWithHttpInfo(template_id, preview_id).then(function (response_and_data) {
|
|
1590
|
+
return response_and_data.data;
|
|
1591
|
+
});
|
|
1592
|
+
}
|
|
1593
|
+
|
|
1473
1594
|
/**
|
|
1474
1595
|
* Get the JSON Schema of a template's submission data
|
|
1475
1596
|
* Returns the JSON Schema that a submission's `data` must match. Use it to check data before you create submissions, or to build a form for the template's fields.
|
|
@@ -1695,7 +1816,7 @@ var Client = exports["default"] = /*#__PURE__*/function () {
|
|
|
1695
1816
|
|
|
1696
1817
|
/**
|
|
1697
1818
|
* List submissions
|
|
1698
|
-
* Returns the submissions in your account, newest first, one page at a time.
|
|
1819
|
+
* Returns the submissions in your account, newest first, one page at a time. Each one is a summary: its `data` is null unless you pass `include_data=true`, and its `files` are empty unless you pass `include_files=true`. Get a submission by its ID for its signature requests, uploads and page images.
|
|
1699
1820
|
* @param {Object} opts Optional parameters
|
|
1700
1821
|
* @param {String} [template_id] Only list this template's submissions.
|
|
1701
1822
|
* @param {Boolean} [test] Only list test submissions (true) or live submissions (false).
|
|
@@ -1704,6 +1825,8 @@ var Client = exports["default"] = /*#__PURE__*/function () {
|
|
|
1704
1825
|
* @param {Boolean} [include_data] Include each submission's `data` (null without it).
|
|
1705
1826
|
* @param {Number} [limit = 50)] How many items to return (1-100, default 50).
|
|
1706
1827
|
* @param {String} [cursor] The previous page's `next_cursor`, to get the next page. It's the ID of that page's last item, so get the next page before you delete or change the items on this one.
|
|
1828
|
+
* @param {module:model/SubmissionState} [state] Only list submissions in this state (one state per request). The ones that failed are `invalid_data`, `error`, `syntax_error`, `image_download_failed` and `image_processing_failed`, and one still `pending` an hour after it was created is stuck.
|
|
1829
|
+
* @param {Boolean} [include_files] Include each submission's generated files and their download links (`files`, empty without it), without the page images' links.
|
|
1707
1830
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/SubmissionList} and HTTP response
|
|
1708
1831
|
*/
|
|
1709
1832
|
}, {
|
|
@@ -1719,7 +1842,9 @@ var Client = exports["default"] = /*#__PURE__*/function () {
|
|
|
1719
1842
|
'created_before': opts['created_before'],
|
|
1720
1843
|
'include_data': opts['include_data'],
|
|
1721
1844
|
'limit': opts['limit'],
|
|
1722
|
-
'cursor': opts['cursor']
|
|
1845
|
+
'cursor': opts['cursor'],
|
|
1846
|
+
'state': opts['state'],
|
|
1847
|
+
'include_files': opts['include_files']
|
|
1723
1848
|
};
|
|
1724
1849
|
var headerParams = {};
|
|
1725
1850
|
var formParams = {};
|
|
@@ -1732,7 +1857,7 @@ var Client = exports["default"] = /*#__PURE__*/function () {
|
|
|
1732
1857
|
|
|
1733
1858
|
/**
|
|
1734
1859
|
* List submissions
|
|
1735
|
-
* Returns the submissions in your account, newest first, one page at a time.
|
|
1860
|
+
* Returns the submissions in your account, newest first, one page at a time. Each one is a summary: its `data` is null unless you pass `include_data=true`, and its `files` are empty unless you pass `include_files=true`. Get a submission by its ID for its signature requests, uploads and page images.
|
|
1736
1861
|
* @param {Object} opts Optional parameters
|
|
1737
1862
|
* @param {String} opts.template_id Only list this template's submissions.
|
|
1738
1863
|
* @param {Boolean} opts.test Only list test submissions (true) or live submissions (false).
|
|
@@ -1741,6 +1866,8 @@ var Client = exports["default"] = /*#__PURE__*/function () {
|
|
|
1741
1866
|
* @param {Boolean} opts.include_data Include each submission's `data` (null without it).
|
|
1742
1867
|
* @param {Number} opts.limit How many items to return (1-100, default 50). (default to 50)
|
|
1743
1868
|
* @param {String} opts.cursor The previous page's `next_cursor`, to get the next page. It's the ID of that page's last item, so get the next page before you delete or change the items on this one.
|
|
1869
|
+
* @param {module:model/SubmissionState} opts.state Only list submissions in this state (one state per request). The ones that failed are `invalid_data`, `error`, `syntax_error`, `image_download_failed` and `image_processing_failed`, and one still `pending` an hour after it was created is stuck.
|
|
1870
|
+
* @param {Boolean} opts.include_files Include each submission's generated files and their download links (`files`, empty without it), without the page images' links.
|
|
1744
1871
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/SubmissionList}
|
|
1745
1872
|
*/
|
|
1746
1873
|
}, {
|
|
@@ -1810,6 +1937,8 @@ var Client = exports["default"] = /*#__PURE__*/function () {
|
|
|
1810
1937
|
* @param {Boolean} [include_data] Include each submission's `data` (null without it).
|
|
1811
1938
|
* @param {Number} [limit = 50)] How many items to return (1-100, default 50).
|
|
1812
1939
|
* @param {String} [cursor] The previous page's `next_cursor`, to get the next page. It's the ID of that page's last item, so get the next page before you delete or change the items on this one.
|
|
1940
|
+
* @param {module:model/SubmissionState} [state] Only list submissions in this state (one state per request). The ones that failed are `invalid_data`, `error`, `syntax_error`, `image_download_failed` and `image_processing_failed`, and one still `pending` an hour after it was created is stuck.
|
|
1941
|
+
* @param {Boolean} [include_files] Include each submission's generated files and their download links (`files`, empty without it), without the page images' links.
|
|
1813
1942
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/SubmissionList} and HTTP response
|
|
1814
1943
|
*/
|
|
1815
1944
|
}, {
|
|
@@ -1830,7 +1959,9 @@ var Client = exports["default"] = /*#__PURE__*/function () {
|
|
|
1830
1959
|
'created_before': opts['created_before'],
|
|
1831
1960
|
'include_data': opts['include_data'],
|
|
1832
1961
|
'limit': opts['limit'],
|
|
1833
|
-
'cursor': opts['cursor']
|
|
1962
|
+
'cursor': opts['cursor'],
|
|
1963
|
+
'state': opts['state'],
|
|
1964
|
+
'include_files': opts['include_files']
|
|
1834
1965
|
};
|
|
1835
1966
|
var headerParams = {};
|
|
1836
1967
|
var formParams = {};
|
|
@@ -1852,6 +1983,8 @@ var Client = exports["default"] = /*#__PURE__*/function () {
|
|
|
1852
1983
|
* @param {Boolean} opts.include_data Include each submission's `data` (null without it).
|
|
1853
1984
|
* @param {Number} opts.limit How many items to return (1-100, default 50). (default to 50)
|
|
1854
1985
|
* @param {String} opts.cursor The previous page's `next_cursor`, to get the next page. It's the ID of that page's last item, so get the next page before you delete or change the items on this one.
|
|
1986
|
+
* @param {module:model/SubmissionState} opts.state Only list submissions in this state (one state per request). The ones that failed are `invalid_data`, `error`, `syntax_error`, `image_download_failed` and `image_processing_failed`, and one still `pending` an hour after it was created is stuck.
|
|
1987
|
+
* @param {Boolean} opts.include_files Include each submission's generated files and their download links (`files`, empty without it), without the page images' links.
|
|
1855
1988
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/SubmissionList}
|
|
1856
1989
|
*/
|
|
1857
1990
|
}, {
|
|
@@ -1864,7 +1997,7 @@ var Client = exports["default"] = /*#__PURE__*/function () {
|
|
|
1864
1997
|
|
|
1865
1998
|
/**
|
|
1866
1999
|
* List templates
|
|
1867
|
-
* Returns the templates in your account (their drafts), newest first, one page at a time.
|
|
2000
|
+
* Returns the templates in your account (their drafts), newest first, one page at a time. Each one is a summary: get a template by its ID for its settings, its PDF in full, its HTML, defaults and published versions.
|
|
1868
2001
|
* @param {Object} opts Optional parameters
|
|
1869
2002
|
* @param {String} [query] Only list templates whose name contains this text (ignoring case).
|
|
1870
2003
|
* @param {String} [parent_folder_id] Only list the templates in this folder (not in its subfolders).
|
|
@@ -1895,7 +2028,7 @@ var Client = exports["default"] = /*#__PURE__*/function () {
|
|
|
1895
2028
|
|
|
1896
2029
|
/**
|
|
1897
2030
|
* List templates
|
|
1898
|
-
* Returns the templates in your account (their drafts), newest first, one page at a time.
|
|
2031
|
+
* Returns the templates in your account (their drafts), newest first, one page at a time. Each one is a summary: get a template by its ID for its settings, its PDF in full, its HTML, defaults and published versions.
|
|
1899
2032
|
* @param {Object} opts Optional parameters
|
|
1900
2033
|
* @param {String} opts.query Only list templates whose name contains this text (ignoring case).
|
|
1901
2034
|
* @param {String} opts.parent_folder_id Only list the templates in this folder (not in its subfolders).
|
|
@@ -2065,7 +2198,7 @@ var Client = exports["default"] = /*#__PURE__*/function () {
|
|
|
2065
2198
|
|
|
2066
2199
|
/**
|
|
2067
2200
|
* Publish a template version
|
|
2068
|
-
* Publishes the template's draft as a new version
|
|
2201
|
+
* Publishes the template's draft as a new version. Its content (the PDF or HTML, fields, name and description) never changes, while settings such as `webhook_url` and `public_submissions` keep following the draft. `version_type` says which part of the latest version number goes up. While the template's PDF is downloading or being processed, or DocSpring is setting up its fields, it returns a 409 that says so.
|
|
2069
2202
|
* @param {String} template_id The template's ID.
|
|
2070
2203
|
* @param {module:model/PublishTemplateVersionRequest} body The version to publish.
|
|
2071
2204
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/TemplateVersion} and HTTP response
|
|
@@ -2097,7 +2230,7 @@ var Client = exports["default"] = /*#__PURE__*/function () {
|
|
|
2097
2230
|
|
|
2098
2231
|
/**
|
|
2099
2232
|
* Publish a template version
|
|
2100
|
-
* Publishes the template's draft as a new version
|
|
2233
|
+
* Publishes the template's draft as a new version. Its content (the PDF or HTML, fields, name and description) never changes, while settings such as `webhook_url` and `public_submissions` keep following the draft. `version_type` says which part of the latest version number goes up. While the template's PDF is downloading or being processed, or DocSpring is setting up its fields, it returns a 409 that says so.
|
|
2101
2234
|
* @param {String} template_id The template's ID.
|
|
2102
2235
|
* @param {module:model/PublishTemplateVersionRequest} body The version to publish.
|
|
2103
2236
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/TemplateVersion}
|
|
@@ -2253,7 +2386,7 @@ var Client = exports["default"] = /*#__PURE__*/function () {
|
|
|
2253
2386
|
|
|
2254
2387
|
/**
|
|
2255
2388
|
* Restore a template version
|
|
2256
|
-
* Replaces the template's draft with a copy of one of its published versions.
|
|
2389
|
+
* Replaces the template's draft with a copy of one of its published versions. The draft keeps its settings that apply to every version, such as `webhook_url`.
|
|
2257
2390
|
* @param {String} template_id The template's ID.
|
|
2258
2391
|
* @param {module:model/RestoreTemplateVersionRequest} body The version to restore.
|
|
2259
2392
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Template} and HTTP response
|
|
@@ -2285,7 +2418,7 @@ var Client = exports["default"] = /*#__PURE__*/function () {
|
|
|
2285
2418
|
|
|
2286
2419
|
/**
|
|
2287
2420
|
* Restore a template version
|
|
2288
|
-
* Replaces the template's draft with a copy of one of its published versions.
|
|
2421
|
+
* Replaces the template's draft with a copy of one of its published versions. The draft keeps its settings that apply to every version, such as `webhook_url`.
|
|
2289
2422
|
* @param {String} template_id The template's ID.
|
|
2290
2423
|
* @param {module:model/RestoreTemplateVersionRequest} body The version to restore.
|
|
2291
2424
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Template}
|
|
@@ -2380,7 +2513,7 @@ var Client = exports["default"] = /*#__PURE__*/function () {
|
|
|
2380
2513
|
|
|
2381
2514
|
/**
|
|
2382
2515
|
* Update a template
|
|
2383
|
-
* Changes a template's draft. Properties left out keep their values. `defaults` and `html_engine_options` replace the whole object, and `field_groups` changes only the groups it lists.
|
|
2516
|
+
* Changes a template's draft. Properties left out keep their values. `defaults` and `html_engine_options` replace the whole object, and `field_groups` changes only the groups it lists. Settings such as `webhook_url`, `public_submissions` and `expire_after` apply to every published version too, and setting `parent_folder_id` moves the template and all of its published versions.
|
|
2384
2517
|
* @param {String} template_id The template's ID.
|
|
2385
2518
|
* @param {module:model/UpdateTemplateRequest} body The settings to change. Properties left out keep their values.
|
|
2386
2519
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Template} and HTTP response
|
|
@@ -2412,7 +2545,7 @@ var Client = exports["default"] = /*#__PURE__*/function () {
|
|
|
2412
2545
|
|
|
2413
2546
|
/**
|
|
2414
2547
|
* Update a template
|
|
2415
|
-
* Changes a template's draft. Properties left out keep their values. `defaults` and `html_engine_options` replace the whole object, and `field_groups` changes only the groups it lists.
|
|
2548
|
+
* Changes a template's draft. Properties left out keep their values. `defaults` and `html_engine_options` replace the whole object, and `field_groups` changes only the groups it lists. Settings such as `webhook_url`, `public_submissions` and `expire_after` apply to every published version too, and setting `parent_folder_id` moves the template and all of its published versions.
|
|
2416
2549
|
* @param {String} template_id The template's ID.
|
|
2417
2550
|
* @param {module:model/UpdateTemplateRequest} body The settings to change. Properties left out keep their values.
|
|
2418
2551
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Template}
|
|
@@ -2426,12 +2559,12 @@ var Client = exports["default"] = /*#__PURE__*/function () {
|
|
|
2426
2559
|
}
|
|
2427
2560
|
|
|
2428
2561
|
/**
|
|
2429
|
-
* Replace a template's
|
|
2430
|
-
* Replaces a PDF template's PDF with one you uploaded with the presigned upload (GET /uploads/presign) (`cache_id`), a link to download it from (`document_url`), or the file in base64 (`document_base64`).
|
|
2562
|
+
* Replace a template's document
|
|
2563
|
+
* Replaces a PDF template's PDF, or a Word template's Word document (from a .docx or an .odt), with one you uploaded with the presigned upload (GET /uploads/presign) (`cache_id`), a link to download it from (`document_url`), or the file in base64 (`document_base64`). A PDF template's fields stay where they are, unless `reimport_fields` replaces them with the new PDF's fillable fields, and a Word template gets a field for each new tag. To send the file as `multipart/form-data` instead, use PUT /templates/{template_id}/document/upload.
|
|
2431
2564
|
* @param {String} template_id The template's ID.
|
|
2432
|
-
* @param {module:model/UpdateTemplateDocumentRequest} body The new PDF, as one of `cache_id`, `document_url` and `document_base64`.
|
|
2565
|
+
* @param {module:model/UpdateTemplateDocumentRequest} body The new PDF, or a Word template's new Word document, as one of `cache_id`, `document_url` and `document_base64`.
|
|
2433
2566
|
* @param {Object} opts Optional parameters
|
|
2434
|
-
* @param {Boolean} [wait] Wait until the PDF has been processed,
|
|
2567
|
+
* @param {Boolean} [wait] Wait until the PDF has been processed, a `document_url`'s PDF or Word document downloaded, and an OpenDocument file converted, before responding. Default true on sync.api hosts.
|
|
2435
2568
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Template} and HTTP response
|
|
2436
2569
|
*/
|
|
2437
2570
|
}, {
|
|
@@ -2463,12 +2596,12 @@ var Client = exports["default"] = /*#__PURE__*/function () {
|
|
|
2463
2596
|
}
|
|
2464
2597
|
|
|
2465
2598
|
/**
|
|
2466
|
-
* Replace a template's
|
|
2467
|
-
* Replaces a PDF template's PDF with one you uploaded with the presigned upload (GET /uploads/presign) (`cache_id`), a link to download it from (`document_url`), or the file in base64 (`document_base64`).
|
|
2599
|
+
* Replace a template's document
|
|
2600
|
+
* Replaces a PDF template's PDF, or a Word template's Word document (from a .docx or an .odt), with one you uploaded with the presigned upload (GET /uploads/presign) (`cache_id`), a link to download it from (`document_url`), or the file in base64 (`document_base64`). A PDF template's fields stay where they are, unless `reimport_fields` replaces them with the new PDF's fillable fields, and a Word template gets a field for each new tag. To send the file as `multipart/form-data` instead, use PUT /templates/{template_id}/document/upload.
|
|
2468
2601
|
* @param {String} template_id The template's ID.
|
|
2469
|
-
* @param {module:model/UpdateTemplateDocumentRequest} body The new PDF, as one of `cache_id`, `document_url` and `document_base64`.
|
|
2602
|
+
* @param {module:model/UpdateTemplateDocumentRequest} body The new PDF, or a Word template's new Word document, as one of `cache_id`, `document_url` and `document_base64`.
|
|
2470
2603
|
* @param {Object} opts Optional parameters
|
|
2471
|
-
* @param {Boolean} opts.wait Wait until the PDF has been processed,
|
|
2604
|
+
* @param {Boolean} opts.wait Wait until the PDF has been processed, a `document_url`'s PDF or Word document downloaded, and an OpenDocument file converted, before responding. Default true on sync.api hosts.
|
|
2472
2605
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Template}
|
|
2473
2606
|
*/
|
|
2474
2607
|
}, {
|
|
@@ -2574,11 +2707,11 @@ var Client = exports["default"] = /*#__PURE__*/function () {
|
|
|
2574
2707
|
}
|
|
2575
2708
|
|
|
2576
2709
|
/**
|
|
2577
|
-
* Create a
|
|
2578
|
-
* Creates a PDF template from a PDF sent with the request (`multipart/form-data`). For large files, upload the
|
|
2579
|
-
* @param {File} document
|
|
2710
|
+
* Create a template from an uploaded PDF or Word document
|
|
2711
|
+
* Creates a PDF template from a PDF, or a Word template from a Word document (.docx) or an OpenDocument text file (.odt), sent with the request (`multipart/form-data`). A Word template needs its `output_format`. For large files, upload the file with the presigned upload (GET /uploads/presign) and create the template with POST /templates.
|
|
2712
|
+
* @param {File} document A PDF (for a PDF template) or a Word document (.docx or .odt, for a Word template). DocSpring converts an OpenDocument text file (.odt) to a Word document after responding: the template's `document.state` is `converting` until then (sync.api hosts wait for it).
|
|
2580
2713
|
* @param {Object} opts Optional parameters
|
|
2581
|
-
* @param {Boolean} [wait] Wait until the PDF has been processed,
|
|
2714
|
+
* @param {Boolean} [wait] Wait until the PDF has been processed, a `document_url`'s PDF or Word document downloaded, and an OpenDocument file converted, before responding. Default true on sync.api hosts.
|
|
2582
2715
|
* @param {String} [name] The template's name.
|
|
2583
2716
|
* @param {String} [description] The template's description.
|
|
2584
2717
|
* @param {String} [parent_folder_id] The folder to put the template in. Left out, it's created at the root.
|
|
@@ -2587,6 +2720,7 @@ var Client = exports["default"] = /*#__PURE__*/function () {
|
|
|
2587
2720
|
* @param {module:model/FieldSetupSource} [field_source] With `detect_fields`, where the fields come from. `auto` (the default) imports the form fields of a fillable PDF and detects the fields of a PDF without them; `pdf_detection` detects the fields from the page layout, even on a fillable PDF; `pdf_form_fields` only imports the PDF's form fields.
|
|
2588
2721
|
* @param {module:model/FieldSetupNaming} [field_naming] With `detect_fields`, how the fields are named. `ai` (the default) names them and sets their types and settings with AI; `preserve` keeps the names of the PDF's form fields, and AI only names the fields it detected. `preserve` needs `field_source` `auto` or `pdf_form_fields`.
|
|
2589
2722
|
* @param {module:model/FieldSetupLogic} [field_logic] With `detect_fields`, whether AI reads the whole form once the fields are named and sets up conditional logic and required fields (`ai`) or not (`none`). Default: your account's template settings.
|
|
2723
|
+
* @param {module:model/OutputFormat} [output_format] What each submission of a Word template makes unless its request sets `output_formats`: `docx` (a Word document), `odt` (an OpenDocument file, converted from the Word document) or `pdf`. Required when `document` is a Word document.
|
|
2590
2724
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Template} and HTTP response
|
|
2591
2725
|
*/
|
|
2592
2726
|
}, {
|
|
@@ -2612,7 +2746,8 @@ var Client = exports["default"] = /*#__PURE__*/function () {
|
|
|
2612
2746
|
'detect_fields': opts['detect_fields'],
|
|
2613
2747
|
'field_source': opts['field_source'],
|
|
2614
2748
|
'field_naming': opts['field_naming'],
|
|
2615
|
-
'field_logic': opts['field_logic']
|
|
2749
|
+
'field_logic': opts['field_logic'],
|
|
2750
|
+
'output_format': opts['output_format']
|
|
2616
2751
|
};
|
|
2617
2752
|
var authNames = ['api_token_basic'];
|
|
2618
2753
|
var contentTypes = ['multipart/form-data'];
|
|
@@ -2622,11 +2757,11 @@ var Client = exports["default"] = /*#__PURE__*/function () {
|
|
|
2622
2757
|
}
|
|
2623
2758
|
|
|
2624
2759
|
/**
|
|
2625
|
-
* Create a
|
|
2626
|
-
* Creates a PDF template from a PDF sent with the request (`multipart/form-data`). For large files, upload the
|
|
2627
|
-
* @param {File} document
|
|
2760
|
+
* Create a template from an uploaded PDF or Word document
|
|
2761
|
+
* Creates a PDF template from a PDF, or a Word template from a Word document (.docx) or an OpenDocument text file (.odt), sent with the request (`multipart/form-data`). A Word template needs its `output_format`. For large files, upload the file with the presigned upload (GET /uploads/presign) and create the template with POST /templates.
|
|
2762
|
+
* @param {File} document A PDF (for a PDF template) or a Word document (.docx or .odt, for a Word template). DocSpring converts an OpenDocument text file (.odt) to a Word document after responding: the template's `document.state` is `converting` until then (sync.api hosts wait for it).
|
|
2628
2763
|
* @param {Object} opts Optional parameters
|
|
2629
|
-
* @param {Boolean} opts.wait Wait until the PDF has been processed,
|
|
2764
|
+
* @param {Boolean} opts.wait Wait until the PDF has been processed, a `document_url`'s PDF or Word document downloaded, and an OpenDocument file converted, before responding. Default true on sync.api hosts.
|
|
2630
2765
|
* @param {String} opts.name The template's name.
|
|
2631
2766
|
* @param {String} opts.description The template's description.
|
|
2632
2767
|
* @param {String} opts.parent_folder_id The folder to put the template in. Left out, it's created at the root.
|
|
@@ -2635,6 +2770,7 @@ var Client = exports["default"] = /*#__PURE__*/function () {
|
|
|
2635
2770
|
* @param {module:model/FieldSetupSource} opts.field_source With `detect_fields`, where the fields come from. `auto` (the default) imports the form fields of a fillable PDF and detects the fields of a PDF without them; `pdf_detection` detects the fields from the page layout, even on a fillable PDF; `pdf_form_fields` only imports the PDF's form fields.
|
|
2636
2771
|
* @param {module:model/FieldSetupNaming} opts.field_naming With `detect_fields`, how the fields are named. `ai` (the default) names them and sets their types and settings with AI; `preserve` keeps the names of the PDF's form fields, and AI only names the fields it detected. `preserve` needs `field_source` `auto` or `pdf_form_fields`.
|
|
2637
2772
|
* @param {module:model/FieldSetupLogic} opts.field_logic With `detect_fields`, whether AI reads the whole form once the fields are named and sets up conditional logic and required fields (`ai`) or not (`none`). Default: your account's template settings.
|
|
2773
|
+
* @param {module:model/OutputFormat} opts.output_format What each submission of a Word template makes unless its request sets `output_formats`: `docx` (a Word document), `odt` (an OpenDocument file, converted from the Word document) or `pdf`. Required when `document` is a Word document.
|
|
2638
2774
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Template}
|
|
2639
2775
|
*/
|
|
2640
2776
|
}, {
|
|
@@ -2646,13 +2782,13 @@ var Client = exports["default"] = /*#__PURE__*/function () {
|
|
|
2646
2782
|
}
|
|
2647
2783
|
|
|
2648
2784
|
/**
|
|
2649
|
-
* Replace a template's
|
|
2650
|
-
* Replaces a PDF template's PDF with one sent with the request (`multipart/form-data`).
|
|
2785
|
+
* Replace a template's document with an uploaded file
|
|
2786
|
+
* Replaces a PDF template's PDF, or a Word template's Word document, with one sent with the request (`multipart/form-data`). A PDF template's fields stay where they are, unless `reimport_fields` replaces them with the new PDF's fillable fields, and a Word template gets a field for each new tag.
|
|
2651
2787
|
* @param {String} template_id The template's ID.
|
|
2652
|
-
* @param {File} document The new PDF.
|
|
2788
|
+
* @param {File} document The new PDF, or the new Word document (.docx or .odt) of a Word template.
|
|
2653
2789
|
* @param {Object} opts Optional parameters
|
|
2654
|
-
* @param {Boolean} [wait] Wait until the PDF has been processed,
|
|
2655
|
-
* @param {Boolean} [reimport_fields] Replace all of the template's fields with the fillable fields in the new PDF, once DocSpring has processed it (`document.field_reimport_state`). As on a first upload, the default typeface, font size, bold and color are taken from the PDF's fields; the template's other settings are kept. If the PDF has no fillable fields, the template keeps its fields. A locked template can't re-import its fields.
|
|
2790
|
+
* @param {Boolean} [wait] Wait until the PDF has been processed, a `document_url`'s PDF or Word document downloaded, and an OpenDocument file converted, before responding. Default true on sync.api hosts.
|
|
2791
|
+
* @param {Boolean} [reimport_fields] Replace all of the template's fields with the fillable fields in the new PDF, once DocSpring has processed it (`document.field_reimport_state`). As on a first upload, the default typeface, font size, bold and color are taken from the PDF's fields; the template's other settings are kept. If the PDF has no fillable fields, the template keeps its fields. A locked template can't re-import its fields. Only for PDF templates: a Word template adds a field for each new tag.
|
|
2656
2792
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Template} and HTTP response
|
|
2657
2793
|
*/
|
|
2658
2794
|
}, {
|
|
@@ -2687,13 +2823,13 @@ var Client = exports["default"] = /*#__PURE__*/function () {
|
|
|
2687
2823
|
}
|
|
2688
2824
|
|
|
2689
2825
|
/**
|
|
2690
|
-
* Replace a template's
|
|
2691
|
-
* Replaces a PDF template's PDF with one sent with the request (`multipart/form-data`).
|
|
2826
|
+
* Replace a template's document with an uploaded file
|
|
2827
|
+
* Replaces a PDF template's PDF, or a Word template's Word document, with one sent with the request (`multipart/form-data`). A PDF template's fields stay where they are, unless `reimport_fields` replaces them with the new PDF's fillable fields, and a Word template gets a field for each new tag.
|
|
2692
2828
|
* @param {String} template_id The template's ID.
|
|
2693
|
-
* @param {File} document The new PDF.
|
|
2829
|
+
* @param {File} document The new PDF, or the new Word document (.docx or .odt) of a Word template.
|
|
2694
2830
|
* @param {Object} opts Optional parameters
|
|
2695
|
-
* @param {Boolean} opts.wait Wait until the PDF has been processed,
|
|
2696
|
-
* @param {Boolean} opts.reimport_fields Replace all of the template's fields with the fillable fields in the new PDF, once DocSpring has processed it (`document.field_reimport_state`). As on a first upload, the default typeface, font size, bold and color are taken from the PDF's fields; the template's other settings are kept. If the PDF has no fillable fields, the template keeps its fields. A locked template can't re-import its fields.
|
|
2831
|
+
* @param {Boolean} opts.wait Wait until the PDF has been processed, a `document_url`'s PDF or Word document downloaded, and an OpenDocument file converted, before responding. Default true on sync.api hosts.
|
|
2832
|
+
* @param {Boolean} opts.reimport_fields Replace all of the template's fields with the fillable fields in the new PDF, once DocSpring has processed it (`document.field_reimport_state`). As on a first upload, the default typeface, font size, bold and color are taken from the PDF's fields; the template's other settings are kept. If the PDF has no fillable fields, the template keeps its fields. A locked template can't re-import its fields. Only for PDF templates: a Word template adds a field for each new tag.
|
|
2697
2833
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Template}
|
|
2698
2834
|
*/
|
|
2699
2835
|
}, {
|