docspring 3.0.0 → 3.2.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 +33 -0
- package/README.md +148 -205
- package/dist/ApiClient.js +3 -3
- package/dist/api/Client.js +249 -8
- package/dist/index.js +28 -0
- package/dist/model/AddFieldsData.js +2 -2
- package/dist/model/BatchGeneratePdfs201Response.js +4 -7
- package/dist/model/CombinePdfsData.js +4 -2
- package/dist/model/CombinedSubmission.js +7 -22
- package/dist/model/CombinedSubmissionAction.js +22 -6
- package/dist/model/CopyTemplateOptions.js +18 -29
- package/dist/model/CreateCombinedSubmissionResponse.js +4 -7
- package/dist/model/CreateCustomFileData.js +2 -2
- package/dist/model/CreateCustomFileResponse.js +4 -7
- package/dist/model/CreateFolderData.js +2 -2
- package/dist/model/CreateHtmlTemplate.js +2 -2
- package/dist/model/CreatePdfSubmissionData.js +2 -2
- package/dist/model/CreatePdfTemplate.js +2 -2
- package/dist/model/CreateSubmissionDataRequestData.js +2 -2
- package/dist/model/CreateSubmissionDataRequestEventRequest.js +2 -2
- package/dist/model/CreateSubmissionDataRequestEventResponse.js +4 -7
- package/dist/model/CreateSubmissionDataRequestResponse.js +4 -7
- package/dist/model/CreateSubmissionDataRequestTokenResponse.js +4 -7
- package/dist/model/CreateSubmissionResponse.js +4 -7
- package/dist/model/CreateWebhookData.js +108 -0
- package/dist/model/CustomFile.js +4 -2
- package/dist/model/ErrorOrMultipleErrorsResponse.js +4 -2
- package/dist/model/ErrorResponse.js +4 -2
- package/dist/model/Folder.js +4 -2
- package/dist/model/JsonSchema.js +34 -2
- package/dist/model/ListSubmissionsResponse.js +7 -22
- package/dist/model/MoveFolderData.js +2 -2
- package/dist/model/MoveTemplateData.js +14 -2
- package/dist/model/MultipleErrorsResponse.js +4 -2
- package/dist/model/PublishVersionData.js +2 -2
- package/dist/model/RenameFolderData.js +2 -2
- package/dist/model/RestoreVersionData.js +2 -2
- package/dist/model/Submission.js +34 -53
- package/dist/model/Submission422Response.js +4 -7
- package/dist/model/SubmissionAction.js +22 -6
- package/dist/model/SubmissionBatch.js +4 -2
- package/dist/model/SubmissionBatchData.js +2 -2
- package/dist/model/SubmissionBatchWithSubmissions.js +7 -22
- package/dist/model/SubmissionDataRequest.js +28 -7
- package/dist/model/SubmissionDataRequestEvent.js +4 -2
- package/dist/model/SubmissionDataRequestShow.js +28 -7
- package/dist/model/SubmissionDataRequestToken.js +4 -2
- package/dist/model/SubmissionPreview.js +34 -47
- package/dist/model/SuccessErrorResponse.js +4 -2
- package/dist/model/SuccessMultipleErrorsResponse.js +4 -2
- package/dist/model/Template.js +132 -7
- package/dist/model/TemplateAddFieldsResponse.js +4 -2
- package/dist/model/TemplateDeleteResponse.js +4 -2
- package/dist/model/TemplateModelCodeResponse.js +195 -0
- package/dist/model/TemplatePreview.js +108 -7
- package/dist/model/TemplatePublishVersionResponse.js +4 -2
- package/dist/model/UpdateHtmlTemplate.js +2 -2
- package/dist/model/UpdatePdfTemplate.js +2 -2
- package/dist/model/UpdateSubmissionDataRequestData.js +2 -2
- package/dist/model/UpdateWebhookData.js +108 -0
- package/dist/model/UploadPresignResponse.js +4 -2
- package/dist/model/Webhook.js +380 -0
- package/package.json +14 -4
package/dist/api/Client.js
CHANGED
|
@@ -22,6 +22,7 @@ var _CreateSubmissionDataRequestEventResponse = _interopRequireDefault(require("
|
|
|
22
22
|
var _CreateSubmissionDataRequestResponse = _interopRequireDefault(require("../model/CreateSubmissionDataRequestResponse"));
|
|
23
23
|
var _CreateSubmissionDataRequestTokenResponse = _interopRequireDefault(require("../model/CreateSubmissionDataRequestTokenResponse"));
|
|
24
24
|
var _CreateSubmissionResponse = _interopRequireDefault(require("../model/CreateSubmissionResponse"));
|
|
25
|
+
var _CreateWebhookData = _interopRequireDefault(require("../model/CreateWebhookData"));
|
|
25
26
|
var _ErrorOrMultipleErrorsResponse = _interopRequireDefault(require("../model/ErrorOrMultipleErrorsResponse"));
|
|
26
27
|
var _ErrorResponse = _interopRequireDefault(require("../model/ErrorResponse"));
|
|
27
28
|
var _Folder = _interopRequireDefault(require("../model/Folder"));
|
|
@@ -44,19 +45,22 @@ var _SuccessMultipleErrorsResponse = _interopRequireDefault(require("../model/Su
|
|
|
44
45
|
var _Template = _interopRequireDefault(require("../model/Template"));
|
|
45
46
|
var _TemplateAddFieldsResponse = _interopRequireDefault(require("../model/TemplateAddFieldsResponse"));
|
|
46
47
|
var _TemplateDeleteResponse = _interopRequireDefault(require("../model/TemplateDeleteResponse"));
|
|
48
|
+
var _TemplateModelCodeResponse = _interopRequireDefault(require("../model/TemplateModelCodeResponse"));
|
|
47
49
|
var _TemplatePreview = _interopRequireDefault(require("../model/TemplatePreview"));
|
|
48
50
|
var _TemplatePublishVersionResponse = _interopRequireDefault(require("../model/TemplatePublishVersionResponse"));
|
|
49
51
|
var _UpdateHtmlTemplate = _interopRequireDefault(require("../model/UpdateHtmlTemplate"));
|
|
50
52
|
var _UpdatePdfTemplate = _interopRequireDefault(require("../model/UpdatePdfTemplate"));
|
|
51
53
|
var _UpdateSubmissionDataRequestData = _interopRequireDefault(require("../model/UpdateSubmissionDataRequestData"));
|
|
54
|
+
var _UpdateWebhookData = _interopRequireDefault(require("../model/UpdateWebhookData"));
|
|
52
55
|
var _UploadPresignResponse = _interopRequireDefault(require("../model/UploadPresignResponse"));
|
|
56
|
+
var _Webhook = _interopRequireDefault(require("../model/Webhook"));
|
|
53
57
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
54
58
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
55
59
|
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
56
60
|
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
57
61
|
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
58
62
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
59
|
-
function _toPrimitive(t,
|
|
63
|
+
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); } /**
|
|
60
64
|
* DocSpring API
|
|
61
65
|
* Use DocSpring's API to programmatically fill out PDF forms, convert HTML to PDFs, merge PDFs, or request legally binding e-signatures.
|
|
62
66
|
*
|
|
@@ -71,7 +75,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
71
75
|
/**
|
|
72
76
|
* Client service.
|
|
73
77
|
* @module api/Client
|
|
74
|
-
* @version 3.
|
|
78
|
+
* @version 3.2.0
|
|
75
79
|
*/
|
|
76
80
|
var Client = exports["default"] = /*#__PURE__*/function () {
|
|
77
81
|
/**
|
|
@@ -106,9 +110,10 @@ var Client = exports["default"] = /*#__PURE__*/function () {
|
|
|
106
110
|
if (r === 'US') host = 'sync.api.docspring.com';else if (r === 'EU') host = 'sync.api-eu.docspring.com';else throw new Error("".concat(region, " is not a valid region. Valid regions: US, EU"));
|
|
107
111
|
}
|
|
108
112
|
if (host) {
|
|
109
|
-
var url = host;
|
|
113
|
+
var url = String(host).trim();
|
|
110
114
|
if (!/^https?:\/\//i.test(url)) url = "https://".concat(url);
|
|
111
|
-
|
|
115
|
+
url = url.replace(/\/+$/, '');
|
|
116
|
+
if (!/\/api\/v1$/i.test(url)) url = "".concat(url, "/api/v1");
|
|
112
117
|
apiClient.basePath = url;
|
|
113
118
|
}
|
|
114
119
|
this.apiClient = apiClient;
|
|
@@ -166,7 +171,7 @@ var Client = exports["default"] = /*#__PURE__*/function () {
|
|
|
166
171
|
|
|
167
172
|
/**
|
|
168
173
|
* Generate multiple PDFs
|
|
169
|
-
* Generates up to 50 PDFs in a single request. Each submission can use a different template and data. Supports both synchronous (wait for all PDFs) and asynchronous processing. More efficient than individual requests when creating multiple PDFs. See also: - [Batch
|
|
174
|
+
* Generates up to 50 PDFs in a single request. Each submission can use a different template and data. Supports both synchronous (wait for all PDFs) and asynchronous processing. More efficient than individual requests when creating multiple PDFs. See also: - [Batch Generate PDFs](https://docspring.com/docs/api-guide/generate-pdfs/batch-generate-pdfs/) - Request format, responses, and limits
|
|
170
175
|
* @param {module:model/SubmissionBatchData} data
|
|
171
176
|
* @param {Object} opts Optional parameters
|
|
172
177
|
* @param {Boolean} [wait = true)] Wait for submission batch to be processed before returning. Set to false to return immediately. Default: true (on sync.* subdomain)
|
|
@@ -353,7 +358,7 @@ var Client = exports["default"] = /*#__PURE__*/function () {
|
|
|
353
358
|
|
|
354
359
|
/**
|
|
355
360
|
* Create a new data request token for form authentication
|
|
356
|
-
* Creates an authentication token for accessing a data request form.
|
|
361
|
+
* Creates an authentication token for accessing a data request form. Returns a token and a pre-authenticated URL for the data request form. The token remains valid until the data request is completed. See also: - [Embedded Data Requests Guide](https://docspring.com/docs/guides/embedded-forms/embedded-data-requests/)
|
|
357
362
|
* @param {String} data_request_id
|
|
358
363
|
* @param {Object} opts Optional parameters
|
|
359
364
|
* @param {module:model/String} [type]
|
|
@@ -537,6 +542,40 @@ var Client = exports["default"] = /*#__PURE__*/function () {
|
|
|
537
542
|
return this.apiClient.callApi('/templates?endpoint_variant=create_template_from_cached_upload', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
|
|
538
543
|
}
|
|
539
544
|
|
|
545
|
+
/**
|
|
546
|
+
* Callback function to receive the result of the createWebhook operation.
|
|
547
|
+
* @callback module:api/Client~createWebhookCallback
|
|
548
|
+
* @param {String} error Error message, if any.
|
|
549
|
+
* @param {module:model/Webhook} data The data returned by the service call.
|
|
550
|
+
* @param {String} response The complete HTTP response.
|
|
551
|
+
*/
|
|
552
|
+
|
|
553
|
+
/**
|
|
554
|
+
* Create a webhook
|
|
555
|
+
* Creates a webhook that delivers a POST request to your endpoint whenever a subscribed event occurs. Optionally scope the webhook to specific API tokens, templates, or folders.
|
|
556
|
+
* @param {module:model/CreateWebhookData} data
|
|
557
|
+
* @param {module:api/Client~createWebhookCallback} callback The callback function, accepting three arguments: error, data, response
|
|
558
|
+
* data is of type: {@link module:model/Webhook}
|
|
559
|
+
*/
|
|
560
|
+
}, {
|
|
561
|
+
key: "createWebhook",
|
|
562
|
+
value: function createWebhook(data, callback) {
|
|
563
|
+
var postBody = data;
|
|
564
|
+
// verify the required parameter 'data' is set
|
|
565
|
+
if (data === undefined || data === null) {
|
|
566
|
+
throw new Error("Missing the required parameter 'data' when calling createWebhook");
|
|
567
|
+
}
|
|
568
|
+
var pathParams = {};
|
|
569
|
+
var queryParams = {};
|
|
570
|
+
var headerParams = {};
|
|
571
|
+
var formParams = {};
|
|
572
|
+
var authNames = ['api_token_basic'];
|
|
573
|
+
var contentTypes = ['application/json'];
|
|
574
|
+
var accepts = ['application/json'];
|
|
575
|
+
var returnType = _Webhook["default"];
|
|
576
|
+
return this.apiClient.callApi('/webhooks', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
|
|
577
|
+
}
|
|
578
|
+
|
|
540
579
|
/**
|
|
541
580
|
* Callback function to receive the result of the deleteFolder operation.
|
|
542
581
|
* @callback module:api/Client~deleteFolderCallback
|
|
@@ -614,6 +653,42 @@ var Client = exports["default"] = /*#__PURE__*/function () {
|
|
|
614
653
|
return this.apiClient.callApi('/templates/{template_id}', 'DELETE', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
|
|
615
654
|
}
|
|
616
655
|
|
|
656
|
+
/**
|
|
657
|
+
* Callback function to receive the result of the deleteWebhook operation.
|
|
658
|
+
* @callback module:api/Client~deleteWebhookCallback
|
|
659
|
+
* @param {String} error Error message, if any.
|
|
660
|
+
* @param {module:model/Webhook} data The data returned by the service call.
|
|
661
|
+
* @param {String} response The complete HTTP response.
|
|
662
|
+
*/
|
|
663
|
+
|
|
664
|
+
/**
|
|
665
|
+
* Delete a webhook
|
|
666
|
+
* Permanently deletes a webhook so it stops receiving events, and returns the deleted webhook.
|
|
667
|
+
* @param {String} webhook_id
|
|
668
|
+
* @param {module:api/Client~deleteWebhookCallback} callback The callback function, accepting three arguments: error, data, response
|
|
669
|
+
* data is of type: {@link module:model/Webhook}
|
|
670
|
+
*/
|
|
671
|
+
}, {
|
|
672
|
+
key: "deleteWebhook",
|
|
673
|
+
value: function deleteWebhook(webhook_id, callback) {
|
|
674
|
+
var postBody = null;
|
|
675
|
+
// verify the required parameter 'webhook_id' is set
|
|
676
|
+
if (webhook_id === undefined || webhook_id === null) {
|
|
677
|
+
throw new Error("Missing the required parameter 'webhook_id' when calling deleteWebhook");
|
|
678
|
+
}
|
|
679
|
+
var pathParams = {
|
|
680
|
+
'webhook_id': webhook_id
|
|
681
|
+
};
|
|
682
|
+
var queryParams = {};
|
|
683
|
+
var headerParams = {};
|
|
684
|
+
var formParams = {};
|
|
685
|
+
var authNames = ['api_token_basic'];
|
|
686
|
+
var contentTypes = [];
|
|
687
|
+
var accepts = ['application/json'];
|
|
688
|
+
var returnType = _Webhook["default"];
|
|
689
|
+
return this.apiClient.callApi('/webhooks/{webhook_id}', 'DELETE', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
|
|
690
|
+
}
|
|
691
|
+
|
|
617
692
|
/**
|
|
618
693
|
* Callback function to receive the result of the expireCombinedSubmission operation.
|
|
619
694
|
* @callback module:api/Client~expireCombinedSubmissionCallback
|
|
@@ -696,7 +771,7 @@ var Client = exports["default"] = /*#__PURE__*/function () {
|
|
|
696
771
|
|
|
697
772
|
/**
|
|
698
773
|
* Generate a PDF
|
|
699
|
-
* Creates a PDF submission by filling in a template with data. Supports both synchronous (default) and asynchronous processing.
|
|
774
|
+
* Creates a PDF submission by filling in a template with data. Supports both synchronous (default) and asynchronous processing. Add the `wait=false` query parameter to return immediately. See also: - [Customize the PDF Title and Filename](https://docspring.com/docs/api-guide/generate-pdfs/customize-pdf-title-and-filename/) - Set custom metadata - [Handling Truncated Text](https://docspring.com/docs/api-guide/generate-pdfs/handle-truncated-text/) - Handle text that doesn't fit in fields
|
|
700
775
|
* @param {String} template_id
|
|
701
776
|
* @param {module:model/CreatePdfSubmissionData} submission
|
|
702
777
|
* @param {Object} opts Optional parameters
|
|
@@ -1023,6 +1098,49 @@ var Client = exports["default"] = /*#__PURE__*/function () {
|
|
|
1023
1098
|
return this.apiClient.callApi('/templates/{template_id}', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
|
|
1024
1099
|
}
|
|
1025
1100
|
|
|
1101
|
+
/**
|
|
1102
|
+
* Callback function to receive the result of the getTemplateModelCode operation.
|
|
1103
|
+
* @callback module:api/Client~getTemplateModelCodeCallback
|
|
1104
|
+
* @param {String} error Error message, if any.
|
|
1105
|
+
* @param {module:model/TemplateModelCodeResponse} data The data returned by the service call.
|
|
1106
|
+
* @param {String} response The complete HTTP response.
|
|
1107
|
+
*/
|
|
1108
|
+
|
|
1109
|
+
/**
|
|
1110
|
+
* Generate typed model code for a template
|
|
1111
|
+
* Generates typed model code for a template's submission data from its JSON schema, in TypeScript, JavaScript, Ruby, Python, PHP, Java, C#, Elixir or Go. Build your submission data with the generated types so your app catches mistakes before it calls the API. `root_type_name` is the type that describes the whole submission data object, qualified with its namespace or package where there is one. Java returns every class in `code`, each under a `// ClassName.java` comment: split them into one file per class. A template with no named fields returns 422, since there are no types to generate. See also: - [Generate Model Code](https://docspring.com/docs/template-editor/generate-model-code/) - Use the generated types
|
|
1112
|
+
* @param {String} template_id
|
|
1113
|
+
* @param {module:model/String} lang The language to generate code for
|
|
1114
|
+
* @param {module:api/Client~getTemplateModelCodeCallback} callback The callback function, accepting three arguments: error, data, response
|
|
1115
|
+
* data is of type: {@link module:model/TemplateModelCodeResponse}
|
|
1116
|
+
*/
|
|
1117
|
+
}, {
|
|
1118
|
+
key: "getTemplateModelCode",
|
|
1119
|
+
value: function getTemplateModelCode(template_id, lang, callback) {
|
|
1120
|
+
var postBody = null;
|
|
1121
|
+
// verify the required parameter 'template_id' is set
|
|
1122
|
+
if (template_id === undefined || template_id === null) {
|
|
1123
|
+
throw new Error("Missing the required parameter 'template_id' when calling getTemplateModelCode");
|
|
1124
|
+
}
|
|
1125
|
+
// verify the required parameter 'lang' is set
|
|
1126
|
+
if (lang === undefined || lang === null) {
|
|
1127
|
+
throw new Error("Missing the required parameter 'lang' when calling getTemplateModelCode");
|
|
1128
|
+
}
|
|
1129
|
+
var pathParams = {
|
|
1130
|
+
'template_id': template_id
|
|
1131
|
+
};
|
|
1132
|
+
var queryParams = {
|
|
1133
|
+
'lang': lang
|
|
1134
|
+
};
|
|
1135
|
+
var headerParams = {};
|
|
1136
|
+
var formParams = {};
|
|
1137
|
+
var authNames = ['api_token_basic'];
|
|
1138
|
+
var contentTypes = [];
|
|
1139
|
+
var accepts = ['application/json'];
|
|
1140
|
+
var returnType = _TemplateModelCodeResponse["default"];
|
|
1141
|
+
return this.apiClient.callApi('/templates/{template_id}/model_code', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
|
|
1142
|
+
}
|
|
1143
|
+
|
|
1026
1144
|
/**
|
|
1027
1145
|
* Callback function to receive the result of the getTemplateSchema operation.
|
|
1028
1146
|
* @callback module:api/Client~getTemplateSchemaCallback
|
|
@@ -1059,6 +1177,42 @@ var Client = exports["default"] = /*#__PURE__*/function () {
|
|
|
1059
1177
|
return this.apiClient.callApi('/templates/{template_id}/schema', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
|
|
1060
1178
|
}
|
|
1061
1179
|
|
|
1180
|
+
/**
|
|
1181
|
+
* Callback function to receive the result of the getWebhook operation.
|
|
1182
|
+
* @callback module:api/Client~getWebhookCallback
|
|
1183
|
+
* @param {String} error Error message, if any.
|
|
1184
|
+
* @param {module:model/Webhook} data The data returned by the service call.
|
|
1185
|
+
* @param {String} response The complete HTTP response.
|
|
1186
|
+
*/
|
|
1187
|
+
|
|
1188
|
+
/**
|
|
1189
|
+
* Get a webhook
|
|
1190
|
+
* Retrieves a single webhook by its ID.
|
|
1191
|
+
* @param {String} webhook_id
|
|
1192
|
+
* @param {module:api/Client~getWebhookCallback} callback The callback function, accepting three arguments: error, data, response
|
|
1193
|
+
* data is of type: {@link module:model/Webhook}
|
|
1194
|
+
*/
|
|
1195
|
+
}, {
|
|
1196
|
+
key: "getWebhook",
|
|
1197
|
+
value: function getWebhook(webhook_id, callback) {
|
|
1198
|
+
var postBody = null;
|
|
1199
|
+
// verify the required parameter 'webhook_id' is set
|
|
1200
|
+
if (webhook_id === undefined || webhook_id === null) {
|
|
1201
|
+
throw new Error("Missing the required parameter 'webhook_id' when calling getWebhook");
|
|
1202
|
+
}
|
|
1203
|
+
var pathParams = {
|
|
1204
|
+
'webhook_id': webhook_id
|
|
1205
|
+
};
|
|
1206
|
+
var queryParams = {};
|
|
1207
|
+
var headerParams = {};
|
|
1208
|
+
var formParams = {};
|
|
1209
|
+
var authNames = ['api_token_basic'];
|
|
1210
|
+
var contentTypes = [];
|
|
1211
|
+
var accepts = ['application/json'];
|
|
1212
|
+
var returnType = _Webhook["default"];
|
|
1213
|
+
return this.apiClient.callApi('/webhooks/{webhook_id}', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
|
|
1214
|
+
}
|
|
1215
|
+
|
|
1062
1216
|
/**
|
|
1063
1217
|
* Callback function to receive the result of the listCombinedSubmissions operation.
|
|
1064
1218
|
* @callback module:api/Client~listCombinedSubmissionsCallback
|
|
@@ -1264,6 +1418,52 @@ var Client = exports["default"] = /*#__PURE__*/function () {
|
|
|
1264
1418
|
return this.apiClient.callApi('/templates', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
|
|
1265
1419
|
}
|
|
1266
1420
|
|
|
1421
|
+
/**
|
|
1422
|
+
* Callback function to receive the result of the listWebhooks operation.
|
|
1423
|
+
* @callback module:api/Client~listWebhooksCallback
|
|
1424
|
+
* @param {String} error Error message, if any.
|
|
1425
|
+
* @param {Array.<module:model/Webhook>} data The data returned by the service call.
|
|
1426
|
+
* @param {String} response The complete HTTP response.
|
|
1427
|
+
*/
|
|
1428
|
+
|
|
1429
|
+
/**
|
|
1430
|
+
* Get a list of all webhooks
|
|
1431
|
+
* Returns a list of the webhooks configured for your account. Supports pagination and filtering by event type, mode, and the API token, template, or folder a webhook is scoped to.
|
|
1432
|
+
* @param {Object} opts Optional parameters
|
|
1433
|
+
* @param {Number} [page] Default: 1
|
|
1434
|
+
* @param {Number} [per_page] Default: 50
|
|
1435
|
+
* @param {String} [event_type] Filter by a subscribed event type
|
|
1436
|
+
* @param {String} [mode] Filter by mode (test or live)
|
|
1437
|
+
* @param {String} [template_id] Filter by a scoped template ID
|
|
1438
|
+
* @param {String} [folder_id] Filter by a scoped folder ID
|
|
1439
|
+
* @param {String} [api_token_id] Filter by a scoped API token ID
|
|
1440
|
+
* @param {module:api/Client~listWebhooksCallback} callback The callback function, accepting three arguments: error, data, response
|
|
1441
|
+
* data is of type: {@link Array.<module:model/Webhook>}
|
|
1442
|
+
*/
|
|
1443
|
+
}, {
|
|
1444
|
+
key: "listWebhooks",
|
|
1445
|
+
value: function listWebhooks(opts, callback) {
|
|
1446
|
+
opts = opts || {};
|
|
1447
|
+
var postBody = null;
|
|
1448
|
+
var pathParams = {};
|
|
1449
|
+
var queryParams = {
|
|
1450
|
+
'page': opts['page'],
|
|
1451
|
+
'per_page': opts['per_page'],
|
|
1452
|
+
'event_type': opts['event_type'],
|
|
1453
|
+
'mode': opts['mode'],
|
|
1454
|
+
'template_id': opts['template_id'],
|
|
1455
|
+
'folder_id': opts['folder_id'],
|
|
1456
|
+
'api_token_id': opts['api_token_id']
|
|
1457
|
+
};
|
|
1458
|
+
var headerParams = {};
|
|
1459
|
+
var formParams = {};
|
|
1460
|
+
var authNames = ['api_token_basic'];
|
|
1461
|
+
var contentTypes = [];
|
|
1462
|
+
var accepts = ['application/json'];
|
|
1463
|
+
var returnType = [_Webhook["default"]];
|
|
1464
|
+
return this.apiClient.callApi('/webhooks', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
|
|
1465
|
+
}
|
|
1466
|
+
|
|
1267
1467
|
/**
|
|
1268
1468
|
* Callback function to receive the result of the moveFolderToFolder operation.
|
|
1269
1469
|
* @callback module:api/Client~moveFolderToFolderCallback
|
|
@@ -1549,7 +1749,7 @@ var Client = exports["default"] = /*#__PURE__*/function () {
|
|
|
1549
1749
|
|
|
1550
1750
|
/**
|
|
1551
1751
|
* Update a Template
|
|
1552
|
-
* Updates template content and properties. For HTML templates, you can modify the HTML, SCSS, headers, footers, name, and description. Changes are applied to your draft template and do not affect published template versions.
|
|
1752
|
+
* Updates template content and properties. For HTML templates, you can modify the HTML, SCSS, headers, footers, name, and description. Changes are applied to your draft template and do not affect published template versions. The exception is `parent_folder_id`: moving the template to another folder moves its published versions too.
|
|
1553
1753
|
* @param {String} template_id
|
|
1554
1754
|
* @param {module:model/UpdateHtmlTemplate} data
|
|
1555
1755
|
* @param {module:api/Client~updateTemplateCallback} callback The callback function, accepting three arguments: error, data, response
|
|
@@ -1667,5 +1867,46 @@ var Client = exports["default"] = /*#__PURE__*/function () {
|
|
|
1667
1867
|
var returnType = _SuccessMultipleErrorsResponse["default"];
|
|
1668
1868
|
return this.apiClient.callApi('/templates/{template_id}?endpoint_variant=update_template_pdf_with_cached_upload', 'PUT', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
|
|
1669
1869
|
}
|
|
1870
|
+
|
|
1871
|
+
/**
|
|
1872
|
+
* Callback function to receive the result of the updateWebhook operation.
|
|
1873
|
+
* @callback module:api/Client~updateWebhookCallback
|
|
1874
|
+
* @param {String} error Error message, if any.
|
|
1875
|
+
* @param {module:model/Webhook} data The data returned by the service call.
|
|
1876
|
+
* @param {String} response The complete HTTP response.
|
|
1877
|
+
*/
|
|
1878
|
+
|
|
1879
|
+
/**
|
|
1880
|
+
* Update a webhook
|
|
1881
|
+
* Updates the configuration of an existing webhook.
|
|
1882
|
+
* @param {String} webhook_id
|
|
1883
|
+
* @param {module:model/UpdateWebhookData} data
|
|
1884
|
+
* @param {module:api/Client~updateWebhookCallback} callback The callback function, accepting three arguments: error, data, response
|
|
1885
|
+
* data is of type: {@link module:model/Webhook}
|
|
1886
|
+
*/
|
|
1887
|
+
}, {
|
|
1888
|
+
key: "updateWebhook",
|
|
1889
|
+
value: function updateWebhook(webhook_id, data, callback) {
|
|
1890
|
+
var postBody = data;
|
|
1891
|
+
// verify the required parameter 'webhook_id' is set
|
|
1892
|
+
if (webhook_id === undefined || webhook_id === null) {
|
|
1893
|
+
throw new Error("Missing the required parameter 'webhook_id' when calling updateWebhook");
|
|
1894
|
+
}
|
|
1895
|
+
// verify the required parameter 'data' is set
|
|
1896
|
+
if (data === undefined || data === null) {
|
|
1897
|
+
throw new Error("Missing the required parameter 'data' when calling updateWebhook");
|
|
1898
|
+
}
|
|
1899
|
+
var pathParams = {
|
|
1900
|
+
'webhook_id': webhook_id
|
|
1901
|
+
};
|
|
1902
|
+
var queryParams = {};
|
|
1903
|
+
var headerParams = {};
|
|
1904
|
+
var formParams = {};
|
|
1905
|
+
var authNames = ['api_token_basic'];
|
|
1906
|
+
var contentTypes = ['application/json'];
|
|
1907
|
+
var accepts = ['application/json'];
|
|
1908
|
+
var returnType = _Webhook["default"];
|
|
1909
|
+
return this.apiClient.callApi('/webhooks/{webhook_id}', 'PUT', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
|
|
1910
|
+
}
|
|
1670
1911
|
}]);
|
|
1671
1912
|
}();
|
package/dist/index.js
CHANGED
|
@@ -129,6 +129,12 @@ Object.defineProperty(exports, "CreateSubmissionResponse", {
|
|
|
129
129
|
return _CreateSubmissionResponse["default"];
|
|
130
130
|
}
|
|
131
131
|
});
|
|
132
|
+
Object.defineProperty(exports, "CreateWebhookData", {
|
|
133
|
+
enumerable: true,
|
|
134
|
+
get: function get() {
|
|
135
|
+
return _CreateWebhookData["default"];
|
|
136
|
+
}
|
|
137
|
+
});
|
|
132
138
|
Object.defineProperty(exports, "CustomFile", {
|
|
133
139
|
enumerable: true,
|
|
134
140
|
get: function get() {
|
|
@@ -297,6 +303,12 @@ Object.defineProperty(exports, "TemplateDeleteResponse", {
|
|
|
297
303
|
return _TemplateDeleteResponse["default"];
|
|
298
304
|
}
|
|
299
305
|
});
|
|
306
|
+
Object.defineProperty(exports, "TemplateModelCodeResponse", {
|
|
307
|
+
enumerable: true,
|
|
308
|
+
get: function get() {
|
|
309
|
+
return _TemplateModelCodeResponse["default"];
|
|
310
|
+
}
|
|
311
|
+
});
|
|
300
312
|
Object.defineProperty(exports, "TemplatePreview", {
|
|
301
313
|
enumerable: true,
|
|
302
314
|
get: function get() {
|
|
@@ -327,12 +339,24 @@ Object.defineProperty(exports, "UpdateSubmissionDataRequestData", {
|
|
|
327
339
|
return _UpdateSubmissionDataRequestData["default"];
|
|
328
340
|
}
|
|
329
341
|
});
|
|
342
|
+
Object.defineProperty(exports, "UpdateWebhookData", {
|
|
343
|
+
enumerable: true,
|
|
344
|
+
get: function get() {
|
|
345
|
+
return _UpdateWebhookData["default"];
|
|
346
|
+
}
|
|
347
|
+
});
|
|
330
348
|
Object.defineProperty(exports, "UploadPresignResponse", {
|
|
331
349
|
enumerable: true,
|
|
332
350
|
get: function get() {
|
|
333
351
|
return _UploadPresignResponse["default"];
|
|
334
352
|
}
|
|
335
353
|
});
|
|
354
|
+
Object.defineProperty(exports, "Webhook", {
|
|
355
|
+
enumerable: true,
|
|
356
|
+
get: function get() {
|
|
357
|
+
return _Webhook["default"];
|
|
358
|
+
}
|
|
359
|
+
});
|
|
336
360
|
var _ApiClient = _interopRequireDefault(require("./ApiClient"));
|
|
337
361
|
var _AddFieldsData = _interopRequireDefault(require("./model/AddFieldsData"));
|
|
338
362
|
var _BatchGeneratePdfs201Response = _interopRequireDefault(require("./model/BatchGeneratePdfs201Response"));
|
|
@@ -353,6 +377,7 @@ var _CreateSubmissionDataRequestEventResponse = _interopRequireDefault(require("
|
|
|
353
377
|
var _CreateSubmissionDataRequestResponse = _interopRequireDefault(require("./model/CreateSubmissionDataRequestResponse"));
|
|
354
378
|
var _CreateSubmissionDataRequestTokenResponse = _interopRequireDefault(require("./model/CreateSubmissionDataRequestTokenResponse"));
|
|
355
379
|
var _CreateSubmissionResponse = _interopRequireDefault(require("./model/CreateSubmissionResponse"));
|
|
380
|
+
var _CreateWebhookData = _interopRequireDefault(require("./model/CreateWebhookData"));
|
|
356
381
|
var _CustomFile = _interopRequireDefault(require("./model/CustomFile"));
|
|
357
382
|
var _ErrorOrMultipleErrorsResponse = _interopRequireDefault(require("./model/ErrorOrMultipleErrorsResponse"));
|
|
358
383
|
var _ErrorResponse = _interopRequireDefault(require("./model/ErrorResponse"));
|
|
@@ -381,11 +406,14 @@ var _SuccessMultipleErrorsResponse = _interopRequireDefault(require("./model/Suc
|
|
|
381
406
|
var _Template = _interopRequireDefault(require("./model/Template"));
|
|
382
407
|
var _TemplateAddFieldsResponse = _interopRequireDefault(require("./model/TemplateAddFieldsResponse"));
|
|
383
408
|
var _TemplateDeleteResponse = _interopRequireDefault(require("./model/TemplateDeleteResponse"));
|
|
409
|
+
var _TemplateModelCodeResponse = _interopRequireDefault(require("./model/TemplateModelCodeResponse"));
|
|
384
410
|
var _TemplatePreview = _interopRequireDefault(require("./model/TemplatePreview"));
|
|
385
411
|
var _TemplatePublishVersionResponse = _interopRequireDefault(require("./model/TemplatePublishVersionResponse"));
|
|
386
412
|
var _UpdateHtmlTemplate = _interopRequireDefault(require("./model/UpdateHtmlTemplate"));
|
|
387
413
|
var _UpdatePdfTemplate = _interopRequireDefault(require("./model/UpdatePdfTemplate"));
|
|
388
414
|
var _UpdateSubmissionDataRequestData = _interopRequireDefault(require("./model/UpdateSubmissionDataRequestData"));
|
|
415
|
+
var _UpdateWebhookData = _interopRequireDefault(require("./model/UpdateWebhookData"));
|
|
389
416
|
var _UploadPresignResponse = _interopRequireDefault(require("./model/UploadPresignResponse"));
|
|
417
|
+
var _Webhook = _interopRequireDefault(require("./model/Webhook"));
|
|
390
418
|
var _Client = _interopRequireDefault(require("./api/Client"));
|
|
391
419
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
@@ -14,7 +14,7 @@ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Can
|
|
|
14
14
|
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
15
15
|
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
16
16
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
17
|
-
function _toPrimitive(t,
|
|
17
|
+
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); } /**
|
|
18
18
|
* DocSpring API
|
|
19
19
|
* Use DocSpring's API to programmatically fill out PDF forms, convert HTML to PDFs, merge PDFs, or request legally binding e-signatures.
|
|
20
20
|
*
|
|
@@ -29,7 +29,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
29
29
|
/**
|
|
30
30
|
* The AddFieldsData model module.
|
|
31
31
|
* @module model/AddFieldsData
|
|
32
|
-
* @version 3.
|
|
32
|
+
* @version 3.2.0
|
|
33
33
|
*/
|
|
34
34
|
var AddFieldsData = /*#__PURE__*/function () {
|
|
35
35
|
/**
|
|
@@ -15,7 +15,7 @@ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Can
|
|
|
15
15
|
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
16
16
|
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
17
17
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
18
|
-
function _toPrimitive(t,
|
|
18
|
+
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); } /**
|
|
19
19
|
* DocSpring API
|
|
20
20
|
* Use DocSpring's API to programmatically fill out PDF forms, convert HTML to PDFs, merge PDFs, or request legally binding e-signatures.
|
|
21
21
|
*
|
|
@@ -30,12 +30,13 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
30
30
|
/**
|
|
31
31
|
* The BatchGeneratePdfs201Response model module.
|
|
32
32
|
* @module model/BatchGeneratePdfs201Response
|
|
33
|
-
* @version 3.
|
|
33
|
+
* @version 3.2.0
|
|
34
34
|
*/
|
|
35
35
|
var BatchGeneratePdfs201Response = /*#__PURE__*/function () {
|
|
36
36
|
/**
|
|
37
37
|
* Constructs a new <code>BatchGeneratePdfs201Response</code>.
|
|
38
38
|
* @alias module:model/BatchGeneratePdfs201Response
|
|
39
|
+
* @extends Object
|
|
39
40
|
* @param status {module:model/BatchGeneratePdfs201Response.StatusEnum}
|
|
40
41
|
* @param submission_batch {module:model/SubmissionBatch}
|
|
41
42
|
* @param submissions {Array.<Object>}
|
|
@@ -70,6 +71,7 @@ var BatchGeneratePdfs201Response = /*#__PURE__*/function () {
|
|
|
70
71
|
value: function constructFromObject(data, obj) {
|
|
71
72
|
if (data) {
|
|
72
73
|
obj = obj || new BatchGeneratePdfs201Response();
|
|
74
|
+
_ApiClient["default"].constructFromObject(data, obj, 'Object');
|
|
73
75
|
if (data.hasOwnProperty('status')) {
|
|
74
76
|
obj['status'] = _ApiClient["default"].convertToType(data['status'], 'String');
|
|
75
77
|
}
|
|
@@ -124,11 +126,6 @@ var BatchGeneratePdfs201Response = /*#__PURE__*/function () {
|
|
|
124
126
|
if (!Array.isArray(data['errors'])) {
|
|
125
127
|
throw new Error("Expected the field `errors` to be an array in the JSON data but got " + data['errors']);
|
|
126
128
|
}
|
|
127
|
-
// validate the optional field `submission_batch`
|
|
128
|
-
if (data['submission_batch']) {
|
|
129
|
-
// data not null
|
|
130
|
-
_SubmissionBatch["default"].validateJSON(data['submission_batch']);
|
|
131
|
-
}
|
|
132
129
|
// ensure the json data is an array
|
|
133
130
|
if (!Array.isArray(data['submissions'])) {
|
|
134
131
|
throw new Error("Expected the field `submissions` to be an array in the JSON data but got " + data['submissions']);
|
|
@@ -14,7 +14,7 @@ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Can
|
|
|
14
14
|
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
15
15
|
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
16
16
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
17
|
-
function _toPrimitive(t,
|
|
17
|
+
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); } /**
|
|
18
18
|
* DocSpring API
|
|
19
19
|
* Use DocSpring's API to programmatically fill out PDF forms, convert HTML to PDFs, merge PDFs, or request legally binding e-signatures.
|
|
20
20
|
*
|
|
@@ -29,7 +29,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
29
29
|
/**
|
|
30
30
|
* The CombinePdfsData model module.
|
|
31
31
|
* @module model/CombinePdfsData
|
|
32
|
-
* @version 3.
|
|
32
|
+
* @version 3.2.0
|
|
33
33
|
*/
|
|
34
34
|
var CombinePdfsData = /*#__PURE__*/function () {
|
|
35
35
|
/**
|
|
@@ -125,6 +125,7 @@ var CombinePdfsData = /*#__PURE__*/function () {
|
|
|
125
125
|
CombinePdfsData.RequiredProperties = ["source_pdfs"];
|
|
126
126
|
|
|
127
127
|
/**
|
|
128
|
+
* Delete the custom files in source_pdfs once the combined PDF has been processed (they're kept if it fails). Other combined submissions can't use them after that. A test API token can't delete custom files.
|
|
128
129
|
* @member {Boolean} delete_custom_files
|
|
129
130
|
*/
|
|
130
131
|
CombinePdfsData.prototype['delete_custom_files'] = undefined;
|
|
@@ -150,6 +151,7 @@ CombinePdfsData.prototype['password'] = undefined;
|
|
|
150
151
|
CombinePdfsData.prototype['source_pdfs'] = undefined;
|
|
151
152
|
|
|
152
153
|
/**
|
|
154
|
+
* Deprecated, and has no effect. A combined PDF is a test or live document because of its source PDFs.
|
|
153
155
|
* @member {Boolean} test
|
|
154
156
|
*/
|
|
155
157
|
CombinePdfsData.prototype['test'] = undefined;
|
|
@@ -15,7 +15,7 @@ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Can
|
|
|
15
15
|
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
16
16
|
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
17
17
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
18
|
-
function _toPrimitive(t,
|
|
18
|
+
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); } /**
|
|
19
19
|
* DocSpring API
|
|
20
20
|
* Use DocSpring's API to programmatically fill out PDF forms, convert HTML to PDFs, merge PDFs, or request legally binding e-signatures.
|
|
21
21
|
*
|
|
@@ -30,12 +30,13 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
30
30
|
/**
|
|
31
31
|
* The CombinedSubmission model module.
|
|
32
32
|
* @module model/CombinedSubmission
|
|
33
|
-
* @version 3.
|
|
33
|
+
* @version 3.2.0
|
|
34
34
|
*/
|
|
35
35
|
var CombinedSubmission = /*#__PURE__*/function () {
|
|
36
36
|
/**
|
|
37
37
|
* Constructs a new <code>CombinedSubmission</code>.
|
|
38
38
|
* @alias module:model/CombinedSubmission
|
|
39
|
+
* @extends Object
|
|
39
40
|
* @param id {String}
|
|
40
41
|
* @param state {module:model/CombinedSubmission.StateEnum}
|
|
41
42
|
* @param expired {Boolean}
|
|
@@ -92,6 +93,7 @@ var CombinedSubmission = /*#__PURE__*/function () {
|
|
|
92
93
|
value: function constructFromObject(data, obj) {
|
|
93
94
|
if (data) {
|
|
94
95
|
obj = obj || new CombinedSubmission();
|
|
96
|
+
_ApiClient["default"].constructFromObject(data, obj, 'Object');
|
|
95
97
|
if (data.hasOwnProperty('id')) {
|
|
96
98
|
obj['id'] = _ApiClient["default"].convertToType(data['id'], 'String');
|
|
97
99
|
}
|
|
@@ -201,26 +203,9 @@ var CombinedSubmission = /*#__PURE__*/function () {
|
|
|
201
203
|
if (data['download_url'] && !(typeof data['download_url'] === 'string' || data['download_url'] instanceof String)) {
|
|
202
204
|
throw new Error("Expected the field `download_url` to be a primitive type in the JSON string but got " + data['download_url']);
|
|
203
205
|
}
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
if (!Array.isArray(data['actions'])) {
|
|
208
|
-
throw new Error("Expected the field `actions` to be an array in the JSON data but got " + data['actions']);
|
|
209
|
-
}
|
|
210
|
-
// validate the optional field `actions` (array)
|
|
211
|
-
var _iterator2 = _createForOfIteratorHelper(data['actions']),
|
|
212
|
-
_step2;
|
|
213
|
-
try {
|
|
214
|
-
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
215
|
-
var item = _step2.value;
|
|
216
|
-
_CombinedSubmissionAction["default"].validateJSON(item);
|
|
217
|
-
}
|
|
218
|
-
} catch (err) {
|
|
219
|
-
_iterator2.e(err);
|
|
220
|
-
} finally {
|
|
221
|
-
_iterator2.f();
|
|
222
|
-
}
|
|
223
|
-
;
|
|
206
|
+
// ensure the json data is an array
|
|
207
|
+
if (!Array.isArray(data['actions'])) {
|
|
208
|
+
throw new Error("Expected the field `actions` to be an array in the JSON data but got " + data['actions']);
|
|
224
209
|
}
|
|
225
210
|
return true;
|
|
226
211
|
}
|