docspring 1.4.0 → 2.0.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 (221) hide show
  1. package/README.md +58 -52
  2. package/dist/ApiClient.js +701 -0
  3. package/dist/api/PDFApi.js +1509 -0
  4. package/dist/index.js +356 -0
  5. package/dist/model/AddFieldsData.js +112 -0
  6. package/dist/model/BatchGeneratePdfs201Response.js +184 -0
  7. package/dist/model/CombinePdfsData.js +156 -0
  8. package/dist/model/CombinedSubmission.js +323 -0
  9. package/dist/model/CombinedSubmissionAction.js +252 -0
  10. package/dist/model/CombinedSubmissionData.js +148 -0
  11. package/dist/model/CopyTemplateOptions.js +124 -0
  12. package/dist/model/CreateCombinedSubmissionResponse.js +158 -0
  13. package/dist/model/CreateCustomFileData.js +112 -0
  14. package/dist/model/CreateCustomFileResponse.js +158 -0
  15. package/dist/model/CreateFolderData.js +108 -0
  16. package/dist/model/CreateHtmlSubmissionData.js +161 -0
  17. package/dist/model/CreateHtmlTemplate.js +108 -0
  18. package/dist/model/CreatePdfSubmissionData.js +190 -0
  19. package/dist/model/CreatePdfTemplate.js +108 -0
  20. package/dist/model/CreateSubmissionDataRequestData.js +210 -0
  21. package/dist/model/CreateSubmissionDataRequestEventRequest.js +215 -0
  22. package/dist/model/CreateSubmissionDataRequestEventResponse.js +158 -0
  23. package/dist/model/CreateSubmissionDataRequestResponse.js +158 -0
  24. package/dist/model/CreateSubmissionDataRequestTokenResponse.js +158 -0
  25. package/dist/model/CreateSubmissionResponse.js +158 -0
  26. package/dist/model/CustomFile.js +126 -0
  27. package/dist/model/ErrorResponse.js +139 -0
  28. package/dist/model/Folder.js +154 -0
  29. package/dist/model/JsonSchema.js +173 -0
  30. package/dist/model/ListSubmissionsResponse.js +154 -0
  31. package/dist/model/MoveFolderData.js +89 -0
  32. package/dist/model/MoveTemplateData.js +112 -0
  33. package/dist/model/MultipleErrorsResponse.js +139 -0
  34. package/dist/model/RenameFolderData.js +112 -0
  35. package/dist/model/Submission.js +537 -0
  36. package/dist/model/SubmissionAction.js +252 -0
  37. package/dist/model/SubmissionBatch.js +213 -0
  38. package/dist/model/SubmissionBatchData.js +128 -0
  39. package/dist/model/SubmissionBatchWithSubmissions.js +243 -0
  40. package/dist/model/SubmissionDataRequest.js +475 -0
  41. package/dist/model/SubmissionDataRequestEvent.js +287 -0
  42. package/dist/model/SubmissionDataRequestShow.js +489 -0
  43. package/dist/model/SubmissionDataRequestToken.js +154 -0
  44. package/dist/model/SubmissionPreview.js +471 -0
  45. package/dist/model/SuccessErrorResponse.js +142 -0
  46. package/dist/model/SuccessMultipleErrorsResponse.js +142 -0
  47. package/dist/model/Template.js +717 -0
  48. package/dist/model/TemplateAddFieldsResponse.js +154 -0
  49. package/dist/model/TemplatePreview.js +593 -0
  50. package/dist/model/UpdateHtmlTemplate.js +108 -0
  51. package/dist/model/UpdateSubmissionDataRequestData.js +160 -0
  52. package/dist/model/UploadPresignResponse.js +157 -0
  53. package/package.json +33 -8
  54. package/.openapi-generator/VERSION +0 -1
  55. package/.openapi-generator-ignore +0 -23
  56. package/.travis.yml +0 -7
  57. package/CHANGELOG.md +0 -33
  58. package/docs/AddFieldsData.md +0 -8
  59. package/docs/AddFieldsTemplateResponse.md +0 -21
  60. package/docs/AuthenticationError.md +0 -18
  61. package/docs/AuthenticationSuccessResponse.md +0 -17
  62. package/docs/CombinePdfsData.md +0 -13
  63. package/docs/CombinedSubmission.md +0 -31
  64. package/docs/CombinedSubmissionAction.md +0 -54
  65. package/docs/CombinedSubmissionData.md +0 -12
  66. package/docs/CopyTemplateData.md +0 -9
  67. package/docs/CreateCombinedSubmissionResponse.md +0 -21
  68. package/docs/CreateCustomFileData.md +0 -8
  69. package/docs/CreateCustomFileResponse.md +0 -21
  70. package/docs/CreateFolderData.md +0 -8
  71. package/docs/CreateHtmlTemplateData.md +0 -8
  72. package/docs/CreateSubmissionBatchResponse.md +0 -23
  73. package/docs/CreateSubmissionBatchSubmissionsResponse.md +0 -23
  74. package/docs/CreateSubmissionDataRequestData.md +0 -60
  75. package/docs/CreateSubmissionDataRequestTokenResponse.md +0 -21
  76. package/docs/CreateSubmissionDataRequestTokenResponseToken.md +0 -11
  77. package/docs/CreateSubmissionResponse.md +0 -21
  78. package/docs/CreateTemplateFromUploadData.md +0 -8
  79. package/docs/CustomFile.md +0 -9
  80. package/docs/Error.md +0 -18
  81. package/docs/Folder.md +0 -11
  82. package/docs/FoldersFolder.md +0 -9
  83. package/docs/FullTemplate.md +0 -59
  84. package/docs/FullTemplateDefaults.md +0 -10
  85. package/docs/HtmlTemplateData.md +0 -48
  86. package/docs/InvalidRequest.md +0 -18
  87. package/docs/ListSubmissionsResponse.md +0 -10
  88. package/docs/MoveFolderData.md +0 -8
  89. package/docs/MoveTemplateData.md +0 -8
  90. package/docs/PDFApi.md +0 -1700
  91. package/docs/PendingTemplate.md +0 -37
  92. package/docs/RenameFolderData.md +0 -8
  93. package/docs/Submission.md +0 -55
  94. package/docs/SubmissionAction.md +0 -54
  95. package/docs/SubmissionBatch.md +0 -29
  96. package/docs/SubmissionBatchData.md +0 -11
  97. package/docs/SubmissionData.md +0 -15
  98. package/docs/SubmissionDataBatchRequest.md +0 -13
  99. package/docs/SubmissionDataRequest.md +0 -78
  100. package/docs/Template.md +0 -40
  101. package/docs/TemplateData.md +0 -36
  102. package/docs/TemplatestemplateIdaddFieldsFields.md +0 -286
  103. package/docs/UpdateDataRequestResponse.md +0 -21
  104. package/docs/UpdateSubmissionDataRequestData.md +0 -60
  105. package/docs/UpdateTemplateData.md +0 -8
  106. package/docs/UpdateTemplateResponse.md +0 -20
  107. package/docs/UploadTemplateData.md +0 -49
  108. package/docs/UploadTemplateDataDocument.md +0 -19
  109. package/docs/UploadTemplateDataDocumentMetadata.md +0 -19
  110. package/git_push.sh +0 -52
  111. package/mocha.opts +0 -1
  112. package/src/ApiClient.js +0 -605
  113. package/src/api/Client.js +0 -395
  114. package/src/api/PDFApi.js +0 -1722
  115. package/src/index.js +0 -334
  116. package/src/model/AddFieldsData.js +0 -82
  117. package/src/model/AddFieldsTemplateResponse.js +0 -114
  118. package/src/model/AuthenticationError.js +0 -102
  119. package/src/model/AuthenticationSuccessResponse.js +0 -93
  120. package/src/model/CombinePdfsData.js +0 -122
  121. package/src/model/CombinedSubmission.js +0 -183
  122. package/src/model/CombinedSubmissionAction.js +0 -198
  123. package/src/model/CombinedSubmissionData.js +0 -114
  124. package/src/model/CopyTemplateData.js +0 -90
  125. package/src/model/CreateCombinedSubmissionResponse.js +0 -114
  126. package/src/model/CreateCustomFileData.js +0 -82
  127. package/src/model/CreateCustomFileResponse.js +0 -114
  128. package/src/model/CreateFolderData.js +0 -82
  129. package/src/model/CreateHtmlTemplateData.js +0 -82
  130. package/src/model/CreateSubmissionBatchResponse.js +0 -130
  131. package/src/model/CreateSubmissionBatchSubmissionsResponse.js +0 -119
  132. package/src/model/CreateSubmissionDataRequestData.js +0 -256
  133. package/src/model/CreateSubmissionDataRequestTokenResponse.js +0 -114
  134. package/src/model/CreateSubmissionDataRequestTokenResponseToken.js +0 -105
  135. package/src/model/CreateSubmissionResponse.js +0 -114
  136. package/src/model/CreateTemplateFromUploadData.js +0 -82
  137. package/src/model/CustomFile.js +0 -89
  138. package/src/model/Error.js +0 -103
  139. package/src/model/Folder.js +0 -105
  140. package/src/model/FoldersFolder.js +0 -89
  141. package/src/model/FullTemplate.js +0 -407
  142. package/src/model/FullTemplateDefaults.js +0 -97
  143. package/src/model/HtmlTemplateData.js +0 -248
  144. package/src/model/InvalidRequest.js +0 -103
  145. package/src/model/ListSubmissionsResponse.js +0 -97
  146. package/src/model/MoveFolderData.js +0 -81
  147. package/src/model/MoveTemplateData.js +0 -82
  148. package/src/model/PendingTemplate.js +0 -231
  149. package/src/model/RenameFolderData.js +0 -82
  150. package/src/model/Submission.js +0 -291
  151. package/src/model/SubmissionAction.js +0 -198
  152. package/src/model/SubmissionBatch.js +0 -167
  153. package/src/model/SubmissionBatchData.js +0 -106
  154. package/src/model/SubmissionData.js +0 -138
  155. package/src/model/SubmissionDataBatchRequest.js +0 -121
  156. package/src/model/SubmissionDataRequest.js +0 -337
  157. package/src/model/Template.js +0 -255
  158. package/src/model/TemplateData.js +0 -223
  159. package/src/model/TemplatestemplateIdaddFieldsFields.js +0 -1128
  160. package/src/model/UpdateDataRequestResponse.js +0 -114
  161. package/src/model/UpdateSubmissionDataRequestData.js +0 -256
  162. package/src/model/UpdateTemplateData.js +0 -82
  163. package/src/model/UpdateTemplateResponse.js +0 -106
  164. package/src/model/UploadTemplateData.js +0 -256
  165. package/src/model/UploadTemplateDataDocument.js +0 -109
  166. package/src/model/UploadTemplateDataDocumentMetadata.js +0 -109
  167. package/test/api/ClientIntegration.spec.js +0 -275
  168. package/test/api/PDFApi.spec.js.original +0 -395
  169. package/test/api/PDFApiIntegration.spec.js +0 -301
  170. package/test/model/AddFieldsData.spec.js +0 -67
  171. package/test/model/AddFieldsTemplateResponse.spec.js +0 -79
  172. package/test/model/AuthenticationError.spec.js +0 -73
  173. package/test/model/AuthenticationSuccessResponse.spec.js +0 -67
  174. package/test/model/CombinePdfsData.spec.js +0 -97
  175. package/test/model/CombinedSubmission.spec.js +0 -127
  176. package/test/model/CombinedSubmissionAction.spec.js +0 -97
  177. package/test/model/CombinedSubmissionData.spec.js +0 -91
  178. package/test/model/CopyTemplateData.spec.js +0 -73
  179. package/test/model/CreateCombinedSubmissionResponse.spec.js +0 -79
  180. package/test/model/CreateCustomFileData.spec.js +0 -67
  181. package/test/model/CreateCustomFileResponse.spec.js +0 -79
  182. package/test/model/CreateFolderData.spec.js +0 -67
  183. package/test/model/CreateHtmlTemplateData.spec.js +0 -67
  184. package/test/model/CreateSubmissionBatchResponse.spec.js +0 -91
  185. package/test/model/CreateSubmissionBatchSubmissionsResponse.spec.js +0 -79
  186. package/test/model/CreateSubmissionDataRequestData.spec.js +0 -139
  187. package/test/model/CreateSubmissionDataRequestTokenResponse.spec.js +0 -79
  188. package/test/model/CreateSubmissionDataRequestTokenResponseToken.spec.js +0 -85
  189. package/test/model/CreateSubmissionResponse.spec.js +0 -79
  190. package/test/model/CreateTemplateFromUploadData.spec.js +0 -67
  191. package/test/model/CustomFile.spec.js +0 -73
  192. package/test/model/Error.spec.js +0 -73
  193. package/test/model/Folder.spec.js +0 -85
  194. package/test/model/FoldersFolder.spec.js +0 -73
  195. package/test/model/FullTemplate.spec.js +0 -295
  196. package/test/model/FullTemplateDefaults.spec.js +0 -79
  197. package/test/model/HtmlTemplateData.spec.js +0 -163
  198. package/test/model/InvalidRequest.spec.js +0 -73
  199. package/test/model/ListSubmissionsResponse.spec.js +0 -79
  200. package/test/model/MoveFolderData.spec.js +0 -67
  201. package/test/model/MoveTemplateData.spec.js +0 -67
  202. package/test/model/PendingTemplate.spec.js +0 -163
  203. package/test/model/RenameFolderData.spec.js +0 -67
  204. package/test/model/Submission.spec.js +0 -175
  205. package/test/model/SubmissionAction.spec.js +0 -97
  206. package/test/model/SubmissionBatch.spec.js +0 -115
  207. package/test/model/SubmissionBatchData.spec.js +0 -85
  208. package/test/model/SubmissionData.spec.js +0 -109
  209. package/test/model/SubmissionDataBatchRequest.spec.js +0 -97
  210. package/test/model/SubmissionDataRequest.spec.js +0 -181
  211. package/test/model/Template.spec.js +0 -181
  212. package/test/model/TemplateData.spec.js +0 -157
  213. package/test/model/TemplatestemplateIdaddFieldsFields.spec.js +0 -577
  214. package/test/model/UpdateDataRequestResponse.spec.js +0 -79
  215. package/test/model/UpdateSubmissionDataRequestData.spec.js +0 -139
  216. package/test/model/UpdateTemplateData.spec.js +0 -67
  217. package/test/model/UpdateTemplateResponse.spec.js +0 -73
  218. package/test/model/UploadTemplateData.spec.js +0 -169
  219. package/test/model/UploadTemplateDataDocument.spec.js +0 -79
  220. package/test/model/UploadTemplateDataDocumentMetadata.spec.js +0 -79
  221. package/yarn.lock +0 -263
@@ -0,0 +1,156 @@
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, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
18
+ * DocSpring API
19
+ * DocSpring provides an API that helps you fill out and sign PDF templates.
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 CombinePdfsData model module.
31
+ * @module model/CombinePdfsData
32
+ * @version 2.0.0
33
+ */
34
+ var CombinePdfsData = /*#__PURE__*/function () {
35
+ /**
36
+ * Constructs a new <code>CombinePdfsData</code>.
37
+ * @alias module:model/CombinePdfsData
38
+ * @param sourcePdfs {Array.<Object>}
39
+ */
40
+ function CombinePdfsData(sourcePdfs) {
41
+ _classCallCheck(this, CombinePdfsData);
42
+ CombinePdfsData.initialize(this, sourcePdfs);
43
+ }
44
+
45
+ /**
46
+ * Initializes the fields of this object.
47
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
48
+ * Only for internal use.
49
+ */
50
+ return _createClass(CombinePdfsData, null, [{
51
+ key: "initialize",
52
+ value: function initialize(obj, sourcePdfs) {
53
+ obj['source_pdfs'] = sourcePdfs;
54
+ }
55
+
56
+ /**
57
+ * Constructs a <code>CombinePdfsData</code> from a plain JavaScript object, optionally creating a new instance.
58
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
59
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
60
+ * @param {module:model/CombinePdfsData} obj Optional instance to populate.
61
+ * @return {module:model/CombinePdfsData} The populated <code>CombinePdfsData</code> instance.
62
+ */
63
+ }, {
64
+ key: "constructFromObject",
65
+ value: function constructFromObject(data, obj) {
66
+ if (data) {
67
+ obj = obj || new CombinePdfsData();
68
+ if (data.hasOwnProperty('delete_custom_files')) {
69
+ obj['delete_custom_files'] = _ApiClient["default"].convertToType(data['delete_custom_files'], 'Boolean');
70
+ }
71
+ if (data.hasOwnProperty('expires_in')) {
72
+ obj['expires_in'] = _ApiClient["default"].convertToType(data['expires_in'], 'Number');
73
+ }
74
+ if (data.hasOwnProperty('metadata')) {
75
+ obj['metadata'] = _ApiClient["default"].convertToType(data['metadata'], Object);
76
+ }
77
+ if (data.hasOwnProperty('password')) {
78
+ obj['password'] = _ApiClient["default"].convertToType(data['password'], 'String');
79
+ }
80
+ if (data.hasOwnProperty('source_pdfs')) {
81
+ obj['source_pdfs'] = _ApiClient["default"].convertToType(data['source_pdfs'], [Object]);
82
+ }
83
+ if (data.hasOwnProperty('test')) {
84
+ obj['test'] = _ApiClient["default"].convertToType(data['test'], 'Boolean');
85
+ }
86
+ }
87
+ return obj;
88
+ }
89
+
90
+ /**
91
+ * Validates the JSON data with respect to <code>CombinePdfsData</code>.
92
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
93
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>CombinePdfsData</code>.
94
+ */
95
+ }, {
96
+ key: "validateJSON",
97
+ value: function validateJSON(data) {
98
+ // check to make sure all required properties are present in the JSON string
99
+ var _iterator = _createForOfIteratorHelper(CombinePdfsData.RequiredProperties),
100
+ _step;
101
+ try {
102
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
103
+ var property = _step.value;
104
+ if (!data.hasOwnProperty(property)) {
105
+ throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
106
+ }
107
+ }
108
+ // ensure the json data is a string
109
+ } catch (err) {
110
+ _iterator.e(err);
111
+ } finally {
112
+ _iterator.f();
113
+ }
114
+ if (data['password'] && !(typeof data['password'] === 'string' || data['password'] instanceof String)) {
115
+ throw new Error("Expected the field `password` to be a primitive type in the JSON string but got " + data['password']);
116
+ }
117
+ // ensure the json data is an array
118
+ if (!Array.isArray(data['source_pdfs'])) {
119
+ throw new Error("Expected the field `source_pdfs` to be an array in the JSON data but got " + data['source_pdfs']);
120
+ }
121
+ return true;
122
+ }
123
+ }]);
124
+ }();
125
+ CombinePdfsData.RequiredProperties = ["source_pdfs"];
126
+
127
+ /**
128
+ * @member {Boolean} delete_custom_files
129
+ */
130
+ CombinePdfsData.prototype['delete_custom_files'] = undefined;
131
+
132
+ /**
133
+ * @member {Number} expires_in
134
+ */
135
+ CombinePdfsData.prototype['expires_in'] = undefined;
136
+
137
+ /**
138
+ * @member {Object} metadata
139
+ */
140
+ CombinePdfsData.prototype['metadata'] = undefined;
141
+
142
+ /**
143
+ * @member {String} password
144
+ */
145
+ CombinePdfsData.prototype['password'] = undefined;
146
+
147
+ /**
148
+ * @member {Array.<Object>} source_pdfs
149
+ */
150
+ CombinePdfsData.prototype['source_pdfs'] = undefined;
151
+
152
+ /**
153
+ * @member {Boolean} test
154
+ */
155
+ CombinePdfsData.prototype['test'] = undefined;
156
+ var _default = exports["default"] = CombinePdfsData;
@@ -0,0 +1,323 @@
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
+ var _CombinedSubmissionAction = _interopRequireDefault(require("./CombinedSubmissionAction"));
9
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
10
+ 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); }
11
+ 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; } } }; }
12
+ 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; } }
13
+ 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; }
14
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
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
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
17
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
18
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
19
+ * DocSpring API
20
+ * DocSpring provides an API that helps you fill out and sign PDF templates.
21
+ *
22
+ * The version of the OpenAPI document: v1
23
+ *
24
+ *
25
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
26
+ * https://openapi-generator.tech
27
+ * Do not edit the class manually.
28
+ *
29
+ */
30
+ /**
31
+ * The CombinedSubmission model module.
32
+ * @module model/CombinedSubmission
33
+ * @version 2.0.0
34
+ */
35
+ var CombinedSubmission = /*#__PURE__*/function () {
36
+ /**
37
+ * Constructs a new <code>CombinedSubmission</code>.
38
+ * @alias module:model/CombinedSubmission
39
+ * @param id {String}
40
+ * @param state {module:model/CombinedSubmission.StateEnum}
41
+ * @param expired {Boolean}
42
+ * @param expiresIn {Number}
43
+ * @param expiresAt {String}
44
+ * @param processedAt {String}
45
+ * @param errorMessage {String}
46
+ * @param submissionIds {Array.<String>}
47
+ * @param sourcePdfs {Array.<Object>}
48
+ * @param metadata {Object}
49
+ * @param password {String}
50
+ * @param pdfHash {String}
51
+ * @param downloadUrl {String}
52
+ * @param actions {Array.<module:model/CombinedSubmissionAction>}
53
+ */
54
+ function CombinedSubmission(id, state, expired, expiresIn, expiresAt, processedAt, errorMessage, submissionIds, sourcePdfs, metadata, password, pdfHash, downloadUrl, actions) {
55
+ _classCallCheck(this, CombinedSubmission);
56
+ CombinedSubmission.initialize(this, id, state, expired, expiresIn, expiresAt, processedAt, errorMessage, submissionIds, sourcePdfs, metadata, password, pdfHash, downloadUrl, actions);
57
+ }
58
+
59
+ /**
60
+ * Initializes the fields of this object.
61
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
62
+ * Only for internal use.
63
+ */
64
+ return _createClass(CombinedSubmission, null, [{
65
+ key: "initialize",
66
+ value: function initialize(obj, id, state, expired, expiresIn, expiresAt, processedAt, errorMessage, submissionIds, sourcePdfs, metadata, password, pdfHash, downloadUrl, actions) {
67
+ obj['id'] = id;
68
+ obj['state'] = state;
69
+ obj['expired'] = expired;
70
+ obj['expires_in'] = expiresIn;
71
+ obj['expires_at'] = expiresAt;
72
+ obj['processed_at'] = processedAt;
73
+ obj['error_message'] = errorMessage;
74
+ obj['submission_ids'] = submissionIds;
75
+ obj['source_pdfs'] = sourcePdfs;
76
+ obj['metadata'] = metadata;
77
+ obj['password'] = password;
78
+ obj['pdf_hash'] = pdfHash;
79
+ obj['download_url'] = downloadUrl;
80
+ obj['actions'] = actions;
81
+ }
82
+
83
+ /**
84
+ * Constructs a <code>CombinedSubmission</code> from a plain JavaScript object, optionally creating a new instance.
85
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
86
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
87
+ * @param {module:model/CombinedSubmission} obj Optional instance to populate.
88
+ * @return {module:model/CombinedSubmission} The populated <code>CombinedSubmission</code> instance.
89
+ */
90
+ }, {
91
+ key: "constructFromObject",
92
+ value: function constructFromObject(data, obj) {
93
+ if (data) {
94
+ obj = obj || new CombinedSubmission();
95
+ if (data.hasOwnProperty('id')) {
96
+ obj['id'] = _ApiClient["default"].convertToType(data['id'], 'String');
97
+ }
98
+ if (data.hasOwnProperty('state')) {
99
+ obj['state'] = _ApiClient["default"].convertToType(data['state'], 'String');
100
+ }
101
+ if (data.hasOwnProperty('expired')) {
102
+ obj['expired'] = _ApiClient["default"].convertToType(data['expired'], 'Boolean');
103
+ }
104
+ if (data.hasOwnProperty('expires_in')) {
105
+ obj['expires_in'] = _ApiClient["default"].convertToType(data['expires_in'], 'Number');
106
+ }
107
+ if (data.hasOwnProperty('expires_at')) {
108
+ obj['expires_at'] = _ApiClient["default"].convertToType(data['expires_at'], 'String');
109
+ }
110
+ if (data.hasOwnProperty('processed_at')) {
111
+ obj['processed_at'] = _ApiClient["default"].convertToType(data['processed_at'], 'String');
112
+ }
113
+ if (data.hasOwnProperty('error_message')) {
114
+ obj['error_message'] = _ApiClient["default"].convertToType(data['error_message'], 'String');
115
+ }
116
+ if (data.hasOwnProperty('submission_ids')) {
117
+ obj['submission_ids'] = _ApiClient["default"].convertToType(data['submission_ids'], ['String']);
118
+ }
119
+ if (data.hasOwnProperty('source_pdfs')) {
120
+ obj['source_pdfs'] = _ApiClient["default"].convertToType(data['source_pdfs'], [Object]);
121
+ }
122
+ if (data.hasOwnProperty('metadata')) {
123
+ obj['metadata'] = _ApiClient["default"].convertToType(data['metadata'], Object);
124
+ }
125
+ if (data.hasOwnProperty('password')) {
126
+ obj['password'] = _ApiClient["default"].convertToType(data['password'], 'String');
127
+ }
128
+ if (data.hasOwnProperty('pdf_hash')) {
129
+ obj['pdf_hash'] = _ApiClient["default"].convertToType(data['pdf_hash'], 'String');
130
+ }
131
+ if (data.hasOwnProperty('download_url')) {
132
+ obj['download_url'] = _ApiClient["default"].convertToType(data['download_url'], 'String');
133
+ }
134
+ if (data.hasOwnProperty('actions')) {
135
+ obj['actions'] = _ApiClient["default"].convertToType(data['actions'], [_CombinedSubmissionAction["default"]]);
136
+ }
137
+ }
138
+ return obj;
139
+ }
140
+
141
+ /**
142
+ * Validates the JSON data with respect to <code>CombinedSubmission</code>.
143
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
144
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>CombinedSubmission</code>.
145
+ */
146
+ }, {
147
+ key: "validateJSON",
148
+ value: function validateJSON(data) {
149
+ // check to make sure all required properties are present in the JSON string
150
+ var _iterator = _createForOfIteratorHelper(CombinedSubmission.RequiredProperties),
151
+ _step;
152
+ try {
153
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
154
+ var property = _step.value;
155
+ if (!data.hasOwnProperty(property)) {
156
+ throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
157
+ }
158
+ }
159
+ // ensure the json data is a string
160
+ } catch (err) {
161
+ _iterator.e(err);
162
+ } finally {
163
+ _iterator.f();
164
+ }
165
+ if (data['id'] && !(typeof data['id'] === 'string' || data['id'] instanceof String)) {
166
+ throw new Error("Expected the field `id` to be a primitive type in the JSON string but got " + data['id']);
167
+ }
168
+ // ensure the json data is a string
169
+ if (data['state'] && !(typeof data['state'] === 'string' || data['state'] instanceof String)) {
170
+ throw new Error("Expected the field `state` to be a primitive type in the JSON string but got " + data['state']);
171
+ }
172
+ // ensure the json data is a string
173
+ if (data['expires_at'] && !(typeof data['expires_at'] === 'string' || data['expires_at'] instanceof String)) {
174
+ throw new Error("Expected the field `expires_at` to be a primitive type in the JSON string but got " + data['expires_at']);
175
+ }
176
+ // ensure the json data is a string
177
+ if (data['processed_at'] && !(typeof data['processed_at'] === 'string' || data['processed_at'] instanceof String)) {
178
+ throw new Error("Expected the field `processed_at` to be a primitive type in the JSON string but got " + data['processed_at']);
179
+ }
180
+ // ensure the json data is a string
181
+ if (data['error_message'] && !(typeof data['error_message'] === 'string' || data['error_message'] instanceof String)) {
182
+ throw new Error("Expected the field `error_message` to be a primitive type in the JSON string but got " + data['error_message']);
183
+ }
184
+ // ensure the json data is an array
185
+ if (!Array.isArray(data['submission_ids'])) {
186
+ throw new Error("Expected the field `submission_ids` to be an array in the JSON data but got " + data['submission_ids']);
187
+ }
188
+ // ensure the json data is an array
189
+ if (!Array.isArray(data['source_pdfs'])) {
190
+ throw new Error("Expected the field `source_pdfs` to be an array in the JSON data but got " + data['source_pdfs']);
191
+ }
192
+ // ensure the json data is a string
193
+ if (data['password'] && !(typeof data['password'] === 'string' || data['password'] instanceof String)) {
194
+ throw new Error("Expected the field `password` to be a primitive type in the JSON string but got " + data['password']);
195
+ }
196
+ // ensure the json data is a string
197
+ if (data['pdf_hash'] && !(typeof data['pdf_hash'] === 'string' || data['pdf_hash'] instanceof String)) {
198
+ throw new Error("Expected the field `pdf_hash` to be a primitive type in the JSON string but got " + data['pdf_hash']);
199
+ }
200
+ // ensure the json data is a string
201
+ if (data['download_url'] && !(typeof data['download_url'] === 'string' || data['download_url'] instanceof String)) {
202
+ throw new Error("Expected the field `download_url` to be a primitive type in the JSON string but got " + data['download_url']);
203
+ }
204
+ if (data['actions']) {
205
+ // data not null
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']);
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
+ ;
224
+ }
225
+ return true;
226
+ }
227
+ }]);
228
+ }();
229
+ CombinedSubmission.RequiredProperties = ["id", "state", "expired", "expires_in", "expires_at", "processed_at", "error_message", "submission_ids", "source_pdfs", "metadata", "password", "pdf_hash", "download_url", "actions"];
230
+
231
+ /**
232
+ * @member {String} id
233
+ */
234
+ CombinedSubmission.prototype['id'] = undefined;
235
+
236
+ /**
237
+ * @member {module:model/CombinedSubmission.StateEnum} state
238
+ */
239
+ CombinedSubmission.prototype['state'] = undefined;
240
+
241
+ /**
242
+ * @member {Boolean} expired
243
+ */
244
+ CombinedSubmission.prototype['expired'] = undefined;
245
+
246
+ /**
247
+ * @member {Number} expires_in
248
+ */
249
+ CombinedSubmission.prototype['expires_in'] = undefined;
250
+
251
+ /**
252
+ * @member {String} expires_at
253
+ */
254
+ CombinedSubmission.prototype['expires_at'] = undefined;
255
+
256
+ /**
257
+ * @member {String} processed_at
258
+ */
259
+ CombinedSubmission.prototype['processed_at'] = undefined;
260
+
261
+ /**
262
+ * @member {String} error_message
263
+ */
264
+ CombinedSubmission.prototype['error_message'] = undefined;
265
+
266
+ /**
267
+ * @member {Array.<String>} submission_ids
268
+ */
269
+ CombinedSubmission.prototype['submission_ids'] = undefined;
270
+
271
+ /**
272
+ * @member {Array.<Object>} source_pdfs
273
+ */
274
+ CombinedSubmission.prototype['source_pdfs'] = undefined;
275
+
276
+ /**
277
+ * @member {Object} metadata
278
+ */
279
+ CombinedSubmission.prototype['metadata'] = undefined;
280
+
281
+ /**
282
+ * @member {String} password
283
+ */
284
+ CombinedSubmission.prototype['password'] = undefined;
285
+
286
+ /**
287
+ * @member {String} pdf_hash
288
+ */
289
+ CombinedSubmission.prototype['pdf_hash'] = undefined;
290
+
291
+ /**
292
+ * @member {String} download_url
293
+ */
294
+ CombinedSubmission.prototype['download_url'] = undefined;
295
+
296
+ /**
297
+ * @member {Array.<module:model/CombinedSubmissionAction>} actions
298
+ */
299
+ CombinedSubmission.prototype['actions'] = undefined;
300
+
301
+ /**
302
+ * Allowed values for the <code>state</code> property.
303
+ * @enum {String}
304
+ * @readonly
305
+ */
306
+ CombinedSubmission['StateEnum'] = {
307
+ /**
308
+ * value: "pending"
309
+ * @const
310
+ */
311
+ "pending": "pending",
312
+ /**
313
+ * value: "processed"
314
+ * @const
315
+ */
316
+ "processed": "processed",
317
+ /**
318
+ * value: "error"
319
+ * @const
320
+ */
321
+ "error": "error"
322
+ };
323
+ var _default = exports["default"] = CombinedSubmission;