docspring 3.1.0 → 3.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/AGENTS.md +33 -0
  2. package/README.md +148 -215
  3. package/dist/ApiClient.js +3 -3
  4. package/dist/api/Client.js +9 -8
  5. package/dist/index.js +7 -0
  6. package/dist/model/AddFieldsData.js +2 -2
  7. package/dist/model/BatchGeneratePdfs201Response.js +17 -7
  8. package/dist/model/CombinePdfsData.js +3 -3
  9. package/dist/model/CombinedSubmission.js +13 -23
  10. package/dist/model/CombinedSubmissionAction.js +4 -2
  11. package/dist/model/CopyTemplateOptions.js +2 -2
  12. package/dist/model/CreateCombinedSubmissionResponse.js +28 -6
  13. package/dist/model/CreateCustomFileData.js +2 -2
  14. package/dist/model/CreateCustomFileResponse.js +15 -6
  15. package/dist/model/CreateFolderData.js +2 -2
  16. package/dist/model/CreateHtmlTemplate.js +2 -2
  17. package/dist/model/CreatePdfSubmissionData.js +3 -2
  18. package/dist/model/CreatePdfTemplate.js +2 -2
  19. package/dist/model/CreateSubmissionDataRequestData.js +2 -2
  20. package/dist/model/CreateSubmissionDataRequestEventRequest.js +2 -2
  21. package/dist/model/CreateSubmissionDataRequestEventResponse.js +15 -6
  22. package/dist/model/CreateSubmissionDataRequestResponse.js +15 -6
  23. package/dist/model/CreateSubmissionDataRequestTokenResponse.js +15 -6
  24. package/dist/model/CreateSubmissionResponse.js +28 -6
  25. package/dist/model/CreateWebhookData.js +2 -2
  26. package/dist/model/CustomFile.js +4 -2
  27. package/dist/model/ErrorOrMultipleErrorsResponse.js +4 -2
  28. package/dist/model/ErrorResponse.js +4 -2
  29. package/dist/model/Folder.js +4 -2
  30. package/dist/model/ForbiddenErrorResponse.js +173 -0
  31. package/dist/model/JsonSchema.js +2 -2
  32. package/dist/model/ListSubmissionsResponse.js +7 -22
  33. package/dist/model/MoveFolderData.js +2 -2
  34. package/dist/model/MoveTemplateData.js +2 -2
  35. package/dist/model/MultipleErrorsResponse.js +4 -2
  36. package/dist/model/PublishVersionData.js +2 -2
  37. package/dist/model/RenameFolderData.js +2 -2
  38. package/dist/model/RestoreVersionData.js +2 -2
  39. package/dist/model/Submission.js +15 -42
  40. package/dist/model/Submission422Response.js +4 -7
  41. package/dist/model/SubmissionAction.js +4 -2
  42. package/dist/model/SubmissionBatch.js +4 -2
  43. package/dist/model/SubmissionBatchData.js +3 -2
  44. package/dist/model/SubmissionBatchWithSubmissions.js +7 -22
  45. package/dist/model/SubmissionDataRequest.js +4 -2
  46. package/dist/model/SubmissionDataRequestEvent.js +4 -2
  47. package/dist/model/SubmissionDataRequestShow.js +4 -2
  48. package/dist/model/SubmissionDataRequestToken.js +4 -2
  49. package/dist/model/SubmissionPreview.js +15 -42
  50. package/dist/model/SuccessErrorResponse.js +4 -2
  51. package/dist/model/SuccessMultipleErrorsResponse.js +4 -2
  52. package/dist/model/Template.js +18 -6
  53. package/dist/model/TemplateAddFieldsResponse.js +4 -2
  54. package/dist/model/TemplateDeleteResponse.js +4 -2
  55. package/dist/model/TemplateModelCodeResponse.js +4 -2
  56. package/dist/model/TemplatePreview.js +18 -6
  57. package/dist/model/TemplatePublishVersionResponse.js +4 -2
  58. package/dist/model/UpdateHtmlTemplate.js +2 -2
  59. package/dist/model/UpdatePdfTemplate.js +2 -2
  60. package/dist/model/UpdateSubmissionDataRequestData.js +2 -2
  61. package/dist/model/UpdateWebhookData.js +2 -2
  62. package/dist/model/UploadPresignResponse.js +4 -2
  63. package/dist/model/Webhook.js +4 -2
  64. package/package.json +13 -3
@@ -17,7 +17,7 @@ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r),
17
17
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
18
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
- * Use DocSpring's API to programmatically fill out PDF forms, convert HTML to PDFs, merge PDFs, or request legally binding e-signatures.
20
+ * Use DocSpring's API to programmatically fill out PDF forms, convert HTML to PDFs, merge PDFs, or request legally binding e-signatures. Requests are rate limited per account, and live PDFs use credits: a request over the limit returns 429 with a Retry-After header, and one your credits can't cover returns 402. See [Credits & Rate Limits](https://docspring.com/docs/api-guide/credits-and-rate-limits/).
21
21
  *
22
22
  * The version of the OpenAPI document: v1
23
23
  *
@@ -30,12 +30,13 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
30
30
  /**
31
31
  * The CreateSubmissionDataRequestResponse model module.
32
32
  * @module model/CreateSubmissionDataRequestResponse
33
- * @version 3.1.0
33
+ * @version 3.3.0
34
34
  */
35
35
  var CreateSubmissionDataRequestResponse = /*#__PURE__*/function () {
36
36
  /**
37
37
  * Constructs a new <code>CreateSubmissionDataRequestResponse</code>.
38
38
  * @alias module:model/CreateSubmissionDataRequestResponse
39
+ * @extends Object
39
40
  * @param status {module:model/CreateSubmissionDataRequestResponse.StatusEnum}
40
41
  * @param data_request {module:model/SubmissionDataRequestShow}
41
42
  */
@@ -68,12 +69,16 @@ var CreateSubmissionDataRequestResponse = /*#__PURE__*/function () {
68
69
  value: function constructFromObject(data, obj) {
69
70
  if (data) {
70
71
  obj = obj || new CreateSubmissionDataRequestResponse();
72
+ _ApiClient["default"].constructFromObject(data, obj, 'Object');
71
73
  if (data.hasOwnProperty('status')) {
72
74
  obj['status'] = _ApiClient["default"].convertToType(data['status'], 'String');
73
75
  }
74
76
  if (data.hasOwnProperty('data_request')) {
75
77
  obj['data_request'] = _SubmissionDataRequestShow["default"].constructFromObject(data['data_request']);
76
78
  }
79
+ if (data.hasOwnProperty('error')) {
80
+ obj['error'] = _ApiClient["default"].convertToType(data['error'], 'String');
81
+ }
77
82
  if (data.hasOwnProperty('errors')) {
78
83
  obj['errors'] = _ApiClient["default"].convertToType(data['errors'], ['String']);
79
84
  }
@@ -108,10 +113,9 @@ var CreateSubmissionDataRequestResponse = /*#__PURE__*/function () {
108
113
  if (data['status'] && !(typeof data['status'] === 'string' || data['status'] instanceof String)) {
109
114
  throw new Error("Expected the field `status` to be a primitive type in the JSON string but got " + data['status']);
110
115
  }
111
- // validate the optional field `data_request`
112
- if (data['data_request']) {
113
- // data not null
114
- _SubmissionDataRequestShow["default"].validateJSON(data['data_request']);
116
+ // ensure the json data is a string
117
+ if (data['error'] && !(typeof data['error'] === 'string' || data['error'] instanceof String)) {
118
+ throw new Error("Expected the field `error` to be a primitive type in the JSON string but got " + data['error']);
115
119
  }
116
120
  // ensure the json data is an array
117
121
  if (!Array.isArray(data['errors'])) {
@@ -133,6 +137,11 @@ CreateSubmissionDataRequestResponse.prototype['status'] = undefined;
133
137
  */
134
138
  CreateSubmissionDataRequestResponse.prototype['data_request'] = undefined;
135
139
 
140
+ /**
141
+ * @member {String} error
142
+ */
143
+ CreateSubmissionDataRequestResponse.prototype['error'] = undefined;
144
+
136
145
  /**
137
146
  * @member {Array.<String>} errors
138
147
  */
@@ -17,7 +17,7 @@ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r),
17
17
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
18
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
- * Use DocSpring's API to programmatically fill out PDF forms, convert HTML to PDFs, merge PDFs, or request legally binding e-signatures.
20
+ * Use DocSpring's API to programmatically fill out PDF forms, convert HTML to PDFs, merge PDFs, or request legally binding e-signatures. Requests are rate limited per account, and live PDFs use credits: a request over the limit returns 429 with a Retry-After header, and one your credits can't cover returns 402. See [Credits & Rate Limits](https://docspring.com/docs/api-guide/credits-and-rate-limits/).
21
21
  *
22
22
  * The version of the OpenAPI document: v1
23
23
  *
@@ -30,12 +30,13 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
30
30
  /**
31
31
  * The CreateSubmissionDataRequestTokenResponse model module.
32
32
  * @module model/CreateSubmissionDataRequestTokenResponse
33
- * @version 3.1.0
33
+ * @version 3.3.0
34
34
  */
35
35
  var CreateSubmissionDataRequestTokenResponse = /*#__PURE__*/function () {
36
36
  /**
37
37
  * Constructs a new <code>CreateSubmissionDataRequestTokenResponse</code>.
38
38
  * @alias module:model/CreateSubmissionDataRequestTokenResponse
39
+ * @extends Object
39
40
  * @param status {module:model/CreateSubmissionDataRequestTokenResponse.StatusEnum}
40
41
  * @param token {module:model/SubmissionDataRequestToken}
41
42
  */
@@ -68,12 +69,16 @@ var CreateSubmissionDataRequestTokenResponse = /*#__PURE__*/function () {
68
69
  value: function constructFromObject(data, obj) {
69
70
  if (data) {
70
71
  obj = obj || new CreateSubmissionDataRequestTokenResponse();
72
+ _ApiClient["default"].constructFromObject(data, obj, 'Object');
71
73
  if (data.hasOwnProperty('status')) {
72
74
  obj['status'] = _ApiClient["default"].convertToType(data['status'], 'String');
73
75
  }
74
76
  if (data.hasOwnProperty('token')) {
75
77
  obj['token'] = _SubmissionDataRequestToken["default"].constructFromObject(data['token']);
76
78
  }
79
+ if (data.hasOwnProperty('error')) {
80
+ obj['error'] = _ApiClient["default"].convertToType(data['error'], 'String');
81
+ }
77
82
  if (data.hasOwnProperty('errors')) {
78
83
  obj['errors'] = _ApiClient["default"].convertToType(data['errors'], ['String']);
79
84
  }
@@ -108,10 +113,9 @@ var CreateSubmissionDataRequestTokenResponse = /*#__PURE__*/function () {
108
113
  if (data['status'] && !(typeof data['status'] === 'string' || data['status'] instanceof String)) {
109
114
  throw new Error("Expected the field `status` to be a primitive type in the JSON string but got " + data['status']);
110
115
  }
111
- // validate the optional field `token`
112
- if (data['token']) {
113
- // data not null
114
- _SubmissionDataRequestToken["default"].validateJSON(data['token']);
116
+ // ensure the json data is a string
117
+ if (data['error'] && !(typeof data['error'] === 'string' || data['error'] instanceof String)) {
118
+ throw new Error("Expected the field `error` to be a primitive type in the JSON string but got " + data['error']);
115
119
  }
116
120
  // ensure the json data is an array
117
121
  if (!Array.isArray(data['errors'])) {
@@ -133,6 +137,11 @@ CreateSubmissionDataRequestTokenResponse.prototype['status'] = undefined;
133
137
  */
134
138
  CreateSubmissionDataRequestTokenResponse.prototype['token'] = undefined;
135
139
 
140
+ /**
141
+ * @member {String} error
142
+ */
143
+ CreateSubmissionDataRequestTokenResponse.prototype['error'] = undefined;
144
+
136
145
  /**
137
146
  * @member {Array.<String>} errors
138
147
  */
@@ -17,7 +17,7 @@ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r),
17
17
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
18
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
- * Use DocSpring's API to programmatically fill out PDF forms, convert HTML to PDFs, merge PDFs, or request legally binding e-signatures.
20
+ * Use DocSpring's API to programmatically fill out PDF forms, convert HTML to PDFs, merge PDFs, or request legally binding e-signatures. Requests are rate limited per account, and live PDFs use credits: a request over the limit returns 429 with a Retry-After header, and one your credits can't cover returns 402. See [Credits & Rate Limits](https://docspring.com/docs/api-guide/credits-and-rate-limits/).
21
21
  *
22
22
  * The version of the OpenAPI document: v1
23
23
  *
@@ -30,12 +30,13 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
30
30
  /**
31
31
  * The CreateSubmissionResponse model module.
32
32
  * @module model/CreateSubmissionResponse
33
- * @version 3.1.0
33
+ * @version 3.3.0
34
34
  */
35
35
  var CreateSubmissionResponse = /*#__PURE__*/function () {
36
36
  /**
37
37
  * Constructs a new <code>CreateSubmissionResponse</code>.
38
38
  * @alias module:model/CreateSubmissionResponse
39
+ * @extends Object
39
40
  * @param status {module:model/CreateSubmissionResponse.StatusEnum}
40
41
  * @param submission {module:model/SubmissionPreview}
41
42
  */
@@ -68,15 +69,22 @@ var CreateSubmissionResponse = /*#__PURE__*/function () {
68
69
  value: function constructFromObject(data, obj) {
69
70
  if (data) {
70
71
  obj = obj || new CreateSubmissionResponse();
72
+ _ApiClient["default"].constructFromObject(data, obj, 'Object');
71
73
  if (data.hasOwnProperty('status')) {
72
74
  obj['status'] = _ApiClient["default"].convertToType(data['status'], 'String');
73
75
  }
74
76
  if (data.hasOwnProperty('submission')) {
75
77
  obj['submission'] = _SubmissionPreview["default"].constructFromObject(data['submission']);
76
78
  }
79
+ if (data.hasOwnProperty('error')) {
80
+ obj['error'] = _ApiClient["default"].convertToType(data['error'], 'String');
81
+ }
77
82
  if (data.hasOwnProperty('errors')) {
78
83
  obj['errors'] = _ApiClient["default"].convertToType(data['errors'], ['String']);
79
84
  }
85
+ if (data.hasOwnProperty('code')) {
86
+ obj['code'] = _ApiClient["default"].convertToType(data['code'], 'String');
87
+ }
80
88
  }
81
89
  return obj;
82
90
  }
@@ -108,15 +116,18 @@ var CreateSubmissionResponse = /*#__PURE__*/function () {
108
116
  if (data['status'] && !(typeof data['status'] === 'string' || data['status'] instanceof String)) {
109
117
  throw new Error("Expected the field `status` to be a primitive type in the JSON string but got " + data['status']);
110
118
  }
111
- // validate the optional field `submission`
112
- if (data['submission']) {
113
- // data not null
114
- _SubmissionPreview["default"].validateJSON(data['submission']);
119
+ // ensure the json data is a string
120
+ if (data['error'] && !(typeof data['error'] === 'string' || data['error'] instanceof String)) {
121
+ throw new Error("Expected the field `error` to be a primitive type in the JSON string but got " + data['error']);
115
122
  }
116
123
  // ensure the json data is an array
117
124
  if (!Array.isArray(data['errors'])) {
118
125
  throw new Error("Expected the field `errors` to be an array in the JSON data but got " + data['errors']);
119
126
  }
127
+ // ensure the json data is a string
128
+ if (data['code'] && !(typeof data['code'] === 'string' || data['code'] instanceof String)) {
129
+ throw new Error("Expected the field `code` to be a primitive type in the JSON string but got " + data['code']);
130
+ }
120
131
  return true;
121
132
  }
122
133
  }]);
@@ -133,11 +144,22 @@ CreateSubmissionResponse.prototype['status'] = undefined;
133
144
  */
134
145
  CreateSubmissionResponse.prototype['submission'] = undefined;
135
146
 
147
+ /**
148
+ * @member {String} error
149
+ */
150
+ CreateSubmissionResponse.prototype['error'] = undefined;
151
+
136
152
  /**
137
153
  * @member {Array.<String>} errors
138
154
  */
139
155
  CreateSubmissionResponse.prototype['errors'] = undefined;
140
156
 
157
+ /**
158
+ * `insufficient_credits` when the response is a 402.
159
+ * @member {String} code
160
+ */
161
+ CreateSubmissionResponse.prototype['code'] = undefined;
162
+
141
163
  /**
142
164
  * Allowed values for the <code>status</code> property.
143
165
  * @enum {String}
@@ -16,7 +16,7 @@ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r),
16
16
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
17
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
- * Use DocSpring's API to programmatically fill out PDF forms, convert HTML to PDFs, merge PDFs, or request legally binding e-signatures.
19
+ * Use DocSpring's API to programmatically fill out PDF forms, convert HTML to PDFs, merge PDFs, or request legally binding e-signatures. Requests are rate limited per account, and live PDFs use credits: a request over the limit returns 429 with a Retry-After header, and one your credits can't cover returns 402. See [Credits & Rate Limits](https://docspring.com/docs/api-guide/credits-and-rate-limits/).
20
20
  *
21
21
  * The version of the OpenAPI document: v1
22
22
  *
@@ -29,7 +29,7 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
29
29
  /**
30
30
  * The CreateWebhookData model module.
31
31
  * @module model/CreateWebhookData
32
- * @version 3.1.0
32
+ * @version 3.3.0
33
33
  */
34
34
  var CreateWebhookData = /*#__PURE__*/function () {
35
35
  /**
@@ -16,7 +16,7 @@ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r),
16
16
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
17
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
- * Use DocSpring's API to programmatically fill out PDF forms, convert HTML to PDFs, merge PDFs, or request legally binding e-signatures.
19
+ * Use DocSpring's API to programmatically fill out PDF forms, convert HTML to PDFs, merge PDFs, or request legally binding e-signatures. Requests are rate limited per account, and live PDFs use credits: a request over the limit returns 429 with a Retry-After header, and one your credits can't cover returns 402. See [Credits & Rate Limits](https://docspring.com/docs/api-guide/credits-and-rate-limits/).
20
20
  *
21
21
  * The version of the OpenAPI document: v1
22
22
  *
@@ -29,12 +29,13 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
29
29
  /**
30
30
  * The CustomFile model module.
31
31
  * @module model/CustomFile
32
- * @version 3.1.0
32
+ * @version 3.3.0
33
33
  */
34
34
  var CustomFile = /*#__PURE__*/function () {
35
35
  /**
36
36
  * Constructs a new <code>CustomFile</code>.
37
37
  * @alias module:model/CustomFile
38
+ * @extends Object
38
39
  * @param id {String}
39
40
  * @param url {String}
40
41
  */
@@ -67,6 +68,7 @@ var CustomFile = /*#__PURE__*/function () {
67
68
  value: function constructFromObject(data, obj) {
68
69
  if (data) {
69
70
  obj = obj || new CustomFile();
71
+ _ApiClient["default"].constructFromObject(data, obj, 'Object');
70
72
  if (data.hasOwnProperty('id')) {
71
73
  obj['id'] = _ApiClient["default"].convertToType(data['id'], 'String');
72
74
  }
@@ -16,7 +16,7 @@ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r),
16
16
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
17
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
- * Use DocSpring's API to programmatically fill out PDF forms, convert HTML to PDFs, merge PDFs, or request legally binding e-signatures.
19
+ * Use DocSpring's API to programmatically fill out PDF forms, convert HTML to PDFs, merge PDFs, or request legally binding e-signatures. Requests are rate limited per account, and live PDFs use credits: a request over the limit returns 429 with a Retry-After header, and one your credits can't cover returns 402. See [Credits & Rate Limits](https://docspring.com/docs/api-guide/credits-and-rate-limits/).
20
20
  *
21
21
  * The version of the OpenAPI document: v1
22
22
  *
@@ -29,12 +29,13 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
29
29
  /**
30
30
  * The ErrorOrMultipleErrorsResponse model module.
31
31
  * @module model/ErrorOrMultipleErrorsResponse
32
- * @version 3.1.0
32
+ * @version 3.3.0
33
33
  */
34
34
  var ErrorOrMultipleErrorsResponse = /*#__PURE__*/function () {
35
35
  /**
36
36
  * Constructs a new <code>ErrorOrMultipleErrorsResponse</code>.
37
37
  * @alias module:model/ErrorOrMultipleErrorsResponse
38
+ * @extends Object
38
39
  * @param status {module:model/ErrorOrMultipleErrorsResponse.StatusEnum}
39
40
  */
40
41
  function ErrorOrMultipleErrorsResponse(status) {
@@ -65,6 +66,7 @@ var ErrorOrMultipleErrorsResponse = /*#__PURE__*/function () {
65
66
  value: function constructFromObject(data, obj) {
66
67
  if (data) {
67
68
  obj = obj || new ErrorOrMultipleErrorsResponse();
69
+ _ApiClient["default"].constructFromObject(data, obj, 'Object');
68
70
  if (data.hasOwnProperty('status')) {
69
71
  obj['status'] = _ApiClient["default"].convertToType(data['status'], 'String');
70
72
  }
@@ -16,7 +16,7 @@ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r),
16
16
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
17
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
- * Use DocSpring's API to programmatically fill out PDF forms, convert HTML to PDFs, merge PDFs, or request legally binding e-signatures.
19
+ * Use DocSpring's API to programmatically fill out PDF forms, convert HTML to PDFs, merge PDFs, or request legally binding e-signatures. Requests are rate limited per account, and live PDFs use credits: a request over the limit returns 429 with a Retry-After header, and one your credits can't cover returns 402. See [Credits & Rate Limits](https://docspring.com/docs/api-guide/credits-and-rate-limits/).
20
20
  *
21
21
  * The version of the OpenAPI document: v1
22
22
  *
@@ -29,12 +29,13 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
29
29
  /**
30
30
  * The ErrorResponse model module.
31
31
  * @module model/ErrorResponse
32
- * @version 3.1.0
32
+ * @version 3.3.0
33
33
  */
34
34
  var ErrorResponse = /*#__PURE__*/function () {
35
35
  /**
36
36
  * Constructs a new <code>ErrorResponse</code>.
37
37
  * @alias module:model/ErrorResponse
38
+ * @extends Object
38
39
  * @param status {module:model/ErrorResponse.StatusEnum}
39
40
  * @param error {String}
40
41
  */
@@ -67,6 +68,7 @@ var ErrorResponse = /*#__PURE__*/function () {
67
68
  value: function constructFromObject(data, obj) {
68
69
  if (data) {
69
70
  obj = obj || new ErrorResponse();
71
+ _ApiClient["default"].constructFromObject(data, obj, 'Object');
70
72
  if (data.hasOwnProperty('status')) {
71
73
  obj['status'] = _ApiClient["default"].convertToType(data['status'], 'String');
72
74
  }
@@ -16,7 +16,7 @@ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r),
16
16
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
17
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
- * Use DocSpring's API to programmatically fill out PDF forms, convert HTML to PDFs, merge PDFs, or request legally binding e-signatures.
19
+ * Use DocSpring's API to programmatically fill out PDF forms, convert HTML to PDFs, merge PDFs, or request legally binding e-signatures. Requests are rate limited per account, and live PDFs use credits: a request over the limit returns 429 with a Retry-After header, and one your credits can't cover returns 402. See [Credits & Rate Limits](https://docspring.com/docs/api-guide/credits-and-rate-limits/).
20
20
  *
21
21
  * The version of the OpenAPI document: v1
22
22
  *
@@ -29,12 +29,13 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
29
29
  /**
30
30
  * The Folder model module.
31
31
  * @module model/Folder
32
- * @version 3.1.0
32
+ * @version 3.3.0
33
33
  */
34
34
  var Folder = /*#__PURE__*/function () {
35
35
  /**
36
36
  * Constructs a new <code>Folder</code>.
37
37
  * @alias module:model/Folder
38
+ * @extends Object
38
39
  * @param id {String}
39
40
  * @param name {String}
40
41
  * @param path {String}
@@ -71,6 +72,7 @@ var Folder = /*#__PURE__*/function () {
71
72
  value: function constructFromObject(data, obj) {
72
73
  if (data) {
73
74
  obj = obj || new Folder();
75
+ _ApiClient["default"].constructFromObject(data, obj, 'Object');
74
76
  if (data.hasOwnProperty('id')) {
75
77
  obj['id'] = _ApiClient["default"].convertToType(data['id'], 'String');
76
78
  }
@@ -0,0 +1,173 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
9
+ 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); }
10
+ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
11
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
12
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
13
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
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
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
16
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
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
+ * DocSpring API
19
+ * Use DocSpring's API to programmatically fill out PDF forms, convert HTML to PDFs, merge PDFs, or request legally binding e-signatures. Requests are rate limited per account, and live PDFs use credits: a request over the limit returns 429 with a Retry-After header, and one your credits can't cover returns 402. See [Credits & Rate Limits](https://docspring.com/docs/api-guide/credits-and-rate-limits/).
20
+ *
21
+ * The version of the OpenAPI document: v1
22
+ *
23
+ *
24
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
25
+ * https://openapi-generator.tech
26
+ * Do not edit the class manually.
27
+ *
28
+ */
29
+ /**
30
+ * The ForbiddenErrorResponse model module.
31
+ * @module model/ForbiddenErrorResponse
32
+ * @version 3.3.0
33
+ */
34
+ var ForbiddenErrorResponse = /*#__PURE__*/function () {
35
+ /**
36
+ * Constructs a new <code>ForbiddenErrorResponse</code>.
37
+ * @alias module:model/ForbiddenErrorResponse
38
+ * @extends Object
39
+ * @param status {module:model/ForbiddenErrorResponse.StatusEnum}
40
+ * @param error {String}
41
+ * @param code {module:model/ForbiddenErrorResponse.CodeEnum}
42
+ */
43
+ function ForbiddenErrorResponse(status, error, code) {
44
+ _classCallCheck(this, ForbiddenErrorResponse);
45
+ ForbiddenErrorResponse.initialize(this, status, error, code);
46
+ }
47
+
48
+ /**
49
+ * Initializes the fields of this object.
50
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
51
+ * Only for internal use.
52
+ */
53
+ return _createClass(ForbiddenErrorResponse, null, [{
54
+ key: "initialize",
55
+ value: function initialize(obj, status, error, code) {
56
+ obj['status'] = status;
57
+ obj['error'] = error;
58
+ obj['code'] = code;
59
+ }
60
+
61
+ /**
62
+ * Constructs a <code>ForbiddenErrorResponse</code> from a plain JavaScript object, optionally creating a new instance.
63
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
64
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
65
+ * @param {module:model/ForbiddenErrorResponse} obj Optional instance to populate.
66
+ * @return {module:model/ForbiddenErrorResponse} The populated <code>ForbiddenErrorResponse</code> instance.
67
+ */
68
+ }, {
69
+ key: "constructFromObject",
70
+ value: function constructFromObject(data, obj) {
71
+ if (data) {
72
+ obj = obj || new ForbiddenErrorResponse();
73
+ _ApiClient["default"].constructFromObject(data, obj, 'Object');
74
+ if (data.hasOwnProperty('status')) {
75
+ obj['status'] = _ApiClient["default"].convertToType(data['status'], 'String');
76
+ }
77
+ if (data.hasOwnProperty('error')) {
78
+ obj['error'] = _ApiClient["default"].convertToType(data['error'], 'String');
79
+ }
80
+ if (data.hasOwnProperty('code')) {
81
+ obj['code'] = _ApiClient["default"].convertToType(data['code'], 'String');
82
+ }
83
+ }
84
+ return obj;
85
+ }
86
+
87
+ /**
88
+ * Validates the JSON data with respect to <code>ForbiddenErrorResponse</code>.
89
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
90
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>ForbiddenErrorResponse</code>.
91
+ */
92
+ }, {
93
+ key: "validateJSON",
94
+ value: function validateJSON(data) {
95
+ // check to make sure all required properties are present in the JSON string
96
+ var _iterator = _createForOfIteratorHelper(ForbiddenErrorResponse.RequiredProperties),
97
+ _step;
98
+ try {
99
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
100
+ var property = _step.value;
101
+ if (!data.hasOwnProperty(property)) {
102
+ throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
103
+ }
104
+ }
105
+ // ensure the json data is a string
106
+ } catch (err) {
107
+ _iterator.e(err);
108
+ } finally {
109
+ _iterator.f();
110
+ }
111
+ if (data['status'] && !(typeof data['status'] === 'string' || data['status'] instanceof String)) {
112
+ throw new Error("Expected the field `status` to be a primitive type in the JSON string but got " + data['status']);
113
+ }
114
+ // ensure the json data is a string
115
+ if (data['error'] && !(typeof data['error'] === 'string' || data['error'] instanceof String)) {
116
+ throw new Error("Expected the field `error` to be a primitive type in the JSON string but got " + data['error']);
117
+ }
118
+ // ensure the json data is a string
119
+ if (data['code'] && !(typeof data['code'] === 'string' || data['code'] instanceof String)) {
120
+ throw new Error("Expected the field `code` to be a primitive type in the JSON string but got " + data['code']);
121
+ }
122
+ return true;
123
+ }
124
+ }]);
125
+ }();
126
+ ForbiddenErrorResponse.RequiredProperties = ["status", "error", "code"];
127
+
128
+ /**
129
+ * @member {module:model/ForbiddenErrorResponse.StatusEnum} status
130
+ */
131
+ ForbiddenErrorResponse.prototype['status'] = undefined;
132
+
133
+ /**
134
+ * @member {String} error
135
+ */
136
+ ForbiddenErrorResponse.prototype['error'] = undefined;
137
+
138
+ /**
139
+ * @member {module:model/ForbiddenErrorResponse.CodeEnum} code
140
+ */
141
+ ForbiddenErrorResponse.prototype['code'] = undefined;
142
+
143
+ /**
144
+ * Allowed values for the <code>status</code> property.
145
+ * @enum {String}
146
+ * @readonly
147
+ */
148
+ ForbiddenErrorResponse['StatusEnum'] = {
149
+ /**
150
+ * value: "error"
151
+ * @const
152
+ */
153
+ "error": "error"
154
+ };
155
+
156
+ /**
157
+ * Allowed values for the <code>code</code> property.
158
+ * @enum {String}
159
+ * @readonly
160
+ */
161
+ ForbiddenErrorResponse['CodeEnum'] = {
162
+ /**
163
+ * value: "upgrade_required"
164
+ * @const
165
+ */
166
+ "upgrade_required": "upgrade_required",
167
+ /**
168
+ * value: "account_suspended"
169
+ * @const
170
+ */
171
+ "account_suspended": "account_suspended"
172
+ };
173
+ var _default = exports["default"] = ForbiddenErrorResponse;
@@ -13,7 +13,7 @@ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r),
13
13
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
14
14
  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); } /**
15
15
  * DocSpring API
16
- * Use DocSpring's API to programmatically fill out PDF forms, convert HTML to PDFs, merge PDFs, or request legally binding e-signatures.
16
+ * Use DocSpring's API to programmatically fill out PDF forms, convert HTML to PDFs, merge PDFs, or request legally binding e-signatures. Requests are rate limited per account, and live PDFs use credits: a request over the limit returns 429 with a Retry-After header, and one your credits can't cover returns 402. See [Credits & Rate Limits](https://docspring.com/docs/api-guide/credits-and-rate-limits/).
17
17
  *
18
18
  * The version of the OpenAPI document: v1
19
19
  *
@@ -26,7 +26,7 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
26
26
  /**
27
27
  * The JsonSchema model module.
28
28
  * @module model/JsonSchema
29
- * @version 3.1.0
29
+ * @version 3.3.0
30
30
  */
31
31
  var JsonSchema = /*#__PURE__*/function () {
32
32
  /**
@@ -17,7 +17,7 @@ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r),
17
17
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
18
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
- * Use DocSpring's API to programmatically fill out PDF forms, convert HTML to PDFs, merge PDFs, or request legally binding e-signatures.
20
+ * Use DocSpring's API to programmatically fill out PDF forms, convert HTML to PDFs, merge PDFs, or request legally binding e-signatures. Requests are rate limited per account, and live PDFs use credits: a request over the limit returns 429 with a Retry-After header, and one your credits can't cover returns 402. See [Credits & Rate Limits](https://docspring.com/docs/api-guide/credits-and-rate-limits/).
21
21
  *
22
22
  * The version of the OpenAPI document: v1
23
23
  *
@@ -30,12 +30,13 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
30
30
  /**
31
31
  * The ListSubmissionsResponse model module.
32
32
  * @module model/ListSubmissionsResponse
33
- * @version 3.1.0
33
+ * @version 3.3.0
34
34
  */
35
35
  var ListSubmissionsResponse = /*#__PURE__*/function () {
36
36
  /**
37
37
  * Constructs a new <code>ListSubmissionsResponse</code>.
38
38
  * @alias module:model/ListSubmissionsResponse
39
+ * @extends Object
39
40
  * @param submissions {Array.<module:model/Submission>}
40
41
  * @param limit {Number}
41
42
  * @param next_cursor {String}
@@ -70,6 +71,7 @@ var ListSubmissionsResponse = /*#__PURE__*/function () {
70
71
  value: function constructFromObject(data, obj) {
71
72
  if (data) {
72
73
  obj = obj || new ListSubmissionsResponse();
74
+ _ApiClient["default"].constructFromObject(data, obj, 'Object');
73
75
  if (data.hasOwnProperty('submissions')) {
74
76
  obj['submissions'] = _ApiClient["default"].convertToType(data['submissions'], [_Submission["default"]]);
75
77
  }
@@ -101,31 +103,14 @@ var ListSubmissionsResponse = /*#__PURE__*/function () {
101
103
  throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
102
104
  }
103
105
  }
106
+ // ensure the json data is an array
104
107
  } catch (err) {
105
108
  _iterator.e(err);
106
109
  } finally {
107
110
  _iterator.f();
108
111
  }
109
- if (data['submissions']) {
110
- // data not null
111
- // ensure the json data is an array
112
- if (!Array.isArray(data['submissions'])) {
113
- throw new Error("Expected the field `submissions` to be an array in the JSON data but got " + data['submissions']);
114
- }
115
- // validate the optional field `submissions` (array)
116
- var _iterator2 = _createForOfIteratorHelper(data['submissions']),
117
- _step2;
118
- try {
119
- for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
120
- var item = _step2.value;
121
- _Submission["default"].validateJSON(item);
122
- }
123
- } catch (err) {
124
- _iterator2.e(err);
125
- } finally {
126
- _iterator2.f();
127
- }
128
- ;
112
+ if (!Array.isArray(data['submissions'])) {
113
+ throw new Error("Expected the field `submissions` to be an array in the JSON data but got " + data['submissions']);
129
114
  }
130
115
  // ensure the json data is a string
131
116
  if (data['next_cursor'] && !(typeof data['next_cursor'] === 'string' || data['next_cursor'] instanceof String)) {