docspring 3.0.0 → 3.1.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 (62) hide show
  1. package/README.md +11 -1
  2. package/dist/ApiClient.js +3 -3
  3. package/dist/api/Client.js +249 -8
  4. package/dist/index.js +28 -0
  5. package/dist/model/AddFieldsData.js +2 -2
  6. package/dist/model/BatchGeneratePdfs201Response.js +2 -2
  7. package/dist/model/CombinePdfsData.js +4 -2
  8. package/dist/model/CombinedSubmission.js +2 -2
  9. package/dist/model/CombinedSubmissionAction.js +20 -6
  10. package/dist/model/CopyTemplateOptions.js +18 -29
  11. package/dist/model/CreateCombinedSubmissionResponse.js +2 -2
  12. package/dist/model/CreateCustomFileData.js +2 -2
  13. package/dist/model/CreateCustomFileResponse.js +2 -2
  14. package/dist/model/CreateFolderData.js +2 -2
  15. package/dist/model/CreateHtmlTemplate.js +2 -2
  16. package/dist/model/CreatePdfSubmissionData.js +2 -2
  17. package/dist/model/CreatePdfTemplate.js +2 -2
  18. package/dist/model/CreateSubmissionDataRequestData.js +2 -2
  19. package/dist/model/CreateSubmissionDataRequestEventRequest.js +2 -2
  20. package/dist/model/CreateSubmissionDataRequestEventResponse.js +2 -2
  21. package/dist/model/CreateSubmissionDataRequestResponse.js +2 -2
  22. package/dist/model/CreateSubmissionDataRequestTokenResponse.js +2 -2
  23. package/dist/model/CreateSubmissionResponse.js +2 -2
  24. package/dist/model/CreateWebhookData.js +108 -0
  25. package/dist/model/CustomFile.js +2 -2
  26. package/dist/model/ErrorOrMultipleErrorsResponse.js +2 -2
  27. package/dist/model/ErrorResponse.js +2 -2
  28. package/dist/model/Folder.js +2 -2
  29. package/dist/model/JsonSchema.js +34 -2
  30. package/dist/model/ListSubmissionsResponse.js +2 -2
  31. package/dist/model/MoveFolderData.js +2 -2
  32. package/dist/model/MoveTemplateData.js +14 -2
  33. package/dist/model/MultipleErrorsResponse.js +2 -2
  34. package/dist/model/PublishVersionData.js +2 -2
  35. package/dist/model/RenameFolderData.js +2 -2
  36. package/dist/model/RestoreVersionData.js +2 -2
  37. package/dist/model/Submission.js +26 -13
  38. package/dist/model/Submission422Response.js +2 -2
  39. package/dist/model/SubmissionAction.js +20 -6
  40. package/dist/model/SubmissionBatch.js +2 -2
  41. package/dist/model/SubmissionBatchData.js +2 -2
  42. package/dist/model/SubmissionBatchWithSubmissions.js +2 -2
  43. package/dist/model/SubmissionDataRequest.js +26 -7
  44. package/dist/model/SubmissionDataRequestEvent.js +2 -2
  45. package/dist/model/SubmissionDataRequestShow.js +26 -7
  46. package/dist/model/SubmissionDataRequestToken.js +2 -2
  47. package/dist/model/SubmissionPreview.js +26 -7
  48. package/dist/model/SuccessErrorResponse.js +2 -2
  49. package/dist/model/SuccessMultipleErrorsResponse.js +2 -2
  50. package/dist/model/Template.js +120 -7
  51. package/dist/model/TemplateAddFieldsResponse.js +2 -2
  52. package/dist/model/TemplateDeleteResponse.js +2 -2
  53. package/dist/model/TemplateModelCodeResponse.js +193 -0
  54. package/dist/model/TemplatePreview.js +96 -7
  55. package/dist/model/TemplatePublishVersionResponse.js +2 -2
  56. package/dist/model/UpdateHtmlTemplate.js +2 -2
  57. package/dist/model/UpdatePdfTemplate.js +2 -2
  58. package/dist/model/UpdateSubmissionDataRequestData.js +2 -2
  59. package/dist/model/UpdateWebhookData.js +108 -0
  60. package/dist/model/UploadPresignResponse.js +2 -2
  61. package/dist/model/Webhook.js +378 -0
  62. package/package.json +2 -2
@@ -0,0 +1,378 @@
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.
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 Webhook model module.
31
+ * @module model/Webhook
32
+ * @version 3.1.0
33
+ */
34
+ var Webhook = /*#__PURE__*/function () {
35
+ /**
36
+ * Constructs a new <code>Webhook</code>.
37
+ * @alias module:model/Webhook
38
+ * @param id {String}
39
+ * @param name {String}
40
+ * @param url {String}
41
+ * @param enabled {Boolean}
42
+ * @param event_types {Array.<String>}
43
+ * @param mode {module:model/Webhook.ModeEnum}
44
+ * @param version {Number}
45
+ * @param api_token_ids {Array.<String>}
46
+ * @param template_ids {Array.<String>}
47
+ * @param folder_ids {Array.<String>}
48
+ * @param include_submission_data {Boolean}
49
+ * @param strip_fields {Array.<String>}
50
+ * @param headers {Object.<String, String>}
51
+ * @param consecutive_failures {Number}
52
+ * @param last_failure_at {String}
53
+ * @param disabled_at {String}
54
+ * @param disabled_reason {String}
55
+ * @param secret {String}
56
+ * @param created_at {String}
57
+ * @param updated_at {String}
58
+ */
59
+ function Webhook(id, name, url, enabled, event_types, mode, version, api_token_ids, template_ids, folder_ids, include_submission_data, strip_fields, headers, consecutive_failures, last_failure_at, disabled_at, disabled_reason, secret, created_at, updated_at) {
60
+ _classCallCheck(this, Webhook);
61
+ Webhook.initialize(this, id, name, url, enabled, event_types, mode, version, api_token_ids, template_ids, folder_ids, include_submission_data, strip_fields, headers, consecutive_failures, last_failure_at, disabled_at, disabled_reason, secret, created_at, updated_at);
62
+ }
63
+
64
+ /**
65
+ * Initializes the fields of this object.
66
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
67
+ * Only for internal use.
68
+ */
69
+ return _createClass(Webhook, null, [{
70
+ key: "initialize",
71
+ value: function initialize(obj, id, name, url, enabled, event_types, mode, version, api_token_ids, template_ids, folder_ids, include_submission_data, strip_fields, headers, consecutive_failures, last_failure_at, disabled_at, disabled_reason, secret, created_at, updated_at) {
72
+ obj['id'] = id;
73
+ obj['name'] = name;
74
+ obj['url'] = url;
75
+ obj['enabled'] = enabled;
76
+ obj['event_types'] = event_types;
77
+ obj['mode'] = mode;
78
+ obj['version'] = version;
79
+ obj['api_token_ids'] = api_token_ids;
80
+ obj['template_ids'] = template_ids;
81
+ obj['folder_ids'] = folder_ids;
82
+ obj['include_submission_data'] = include_submission_data;
83
+ obj['strip_fields'] = strip_fields;
84
+ obj['headers'] = headers;
85
+ obj['consecutive_failures'] = consecutive_failures;
86
+ obj['last_failure_at'] = last_failure_at;
87
+ obj['disabled_at'] = disabled_at;
88
+ obj['disabled_reason'] = disabled_reason;
89
+ obj['secret'] = secret;
90
+ obj['created_at'] = created_at;
91
+ obj['updated_at'] = updated_at;
92
+ }
93
+
94
+ /**
95
+ * Constructs a <code>Webhook</code> from a plain JavaScript object, optionally creating a new instance.
96
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
97
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
98
+ * @param {module:model/Webhook} obj Optional instance to populate.
99
+ * @return {module:model/Webhook} The populated <code>Webhook</code> instance.
100
+ */
101
+ }, {
102
+ key: "constructFromObject",
103
+ value: function constructFromObject(data, obj) {
104
+ if (data) {
105
+ obj = obj || new Webhook();
106
+ if (data.hasOwnProperty('id')) {
107
+ obj['id'] = _ApiClient["default"].convertToType(data['id'], 'String');
108
+ }
109
+ if (data.hasOwnProperty('name')) {
110
+ obj['name'] = _ApiClient["default"].convertToType(data['name'], 'String');
111
+ }
112
+ if (data.hasOwnProperty('url')) {
113
+ obj['url'] = _ApiClient["default"].convertToType(data['url'], 'String');
114
+ }
115
+ if (data.hasOwnProperty('enabled')) {
116
+ obj['enabled'] = _ApiClient["default"].convertToType(data['enabled'], 'Boolean');
117
+ }
118
+ if (data.hasOwnProperty('event_types')) {
119
+ obj['event_types'] = _ApiClient["default"].convertToType(data['event_types'], ['String']);
120
+ }
121
+ if (data.hasOwnProperty('mode')) {
122
+ obj['mode'] = _ApiClient["default"].convertToType(data['mode'], 'String');
123
+ }
124
+ if (data.hasOwnProperty('version')) {
125
+ obj['version'] = _ApiClient["default"].convertToType(data['version'], 'Number');
126
+ }
127
+ if (data.hasOwnProperty('api_token_ids')) {
128
+ obj['api_token_ids'] = _ApiClient["default"].convertToType(data['api_token_ids'], ['String']);
129
+ }
130
+ if (data.hasOwnProperty('template_ids')) {
131
+ obj['template_ids'] = _ApiClient["default"].convertToType(data['template_ids'], ['String']);
132
+ }
133
+ if (data.hasOwnProperty('folder_ids')) {
134
+ obj['folder_ids'] = _ApiClient["default"].convertToType(data['folder_ids'], ['String']);
135
+ }
136
+ if (data.hasOwnProperty('include_submission_data')) {
137
+ obj['include_submission_data'] = _ApiClient["default"].convertToType(data['include_submission_data'], 'Boolean');
138
+ }
139
+ if (data.hasOwnProperty('strip_fields')) {
140
+ obj['strip_fields'] = _ApiClient["default"].convertToType(data['strip_fields'], ['String']);
141
+ }
142
+ if (data.hasOwnProperty('headers')) {
143
+ obj['headers'] = _ApiClient["default"].convertToType(data['headers'], {
144
+ 'String': 'String'
145
+ });
146
+ }
147
+ if (data.hasOwnProperty('consecutive_failures')) {
148
+ obj['consecutive_failures'] = _ApiClient["default"].convertToType(data['consecutive_failures'], 'Number');
149
+ }
150
+ if (data.hasOwnProperty('last_failure_at')) {
151
+ obj['last_failure_at'] = _ApiClient["default"].convertToType(data['last_failure_at'], 'String');
152
+ }
153
+ if (data.hasOwnProperty('disabled_at')) {
154
+ obj['disabled_at'] = _ApiClient["default"].convertToType(data['disabled_at'], 'String');
155
+ }
156
+ if (data.hasOwnProperty('disabled_reason')) {
157
+ obj['disabled_reason'] = _ApiClient["default"].convertToType(data['disabled_reason'], 'String');
158
+ }
159
+ if (data.hasOwnProperty('secret')) {
160
+ obj['secret'] = _ApiClient["default"].convertToType(data['secret'], 'String');
161
+ }
162
+ if (data.hasOwnProperty('created_at')) {
163
+ obj['created_at'] = _ApiClient["default"].convertToType(data['created_at'], 'String');
164
+ }
165
+ if (data.hasOwnProperty('updated_at')) {
166
+ obj['updated_at'] = _ApiClient["default"].convertToType(data['updated_at'], 'String');
167
+ }
168
+ }
169
+ return obj;
170
+ }
171
+
172
+ /**
173
+ * Validates the JSON data with respect to <code>Webhook</code>.
174
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
175
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>Webhook</code>.
176
+ */
177
+ }, {
178
+ key: "validateJSON",
179
+ value: function validateJSON(data) {
180
+ // check to make sure all required properties are present in the JSON string
181
+ var _iterator = _createForOfIteratorHelper(Webhook.RequiredProperties),
182
+ _step;
183
+ try {
184
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
185
+ var property = _step.value;
186
+ if (!data.hasOwnProperty(property)) {
187
+ throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
188
+ }
189
+ }
190
+ // ensure the json data is a string
191
+ } catch (err) {
192
+ _iterator.e(err);
193
+ } finally {
194
+ _iterator.f();
195
+ }
196
+ if (data['id'] && !(typeof data['id'] === 'string' || data['id'] instanceof String)) {
197
+ throw new Error("Expected the field `id` to be a primitive type in the JSON string but got " + data['id']);
198
+ }
199
+ // ensure the json data is a string
200
+ if (data['name'] && !(typeof data['name'] === 'string' || data['name'] instanceof String)) {
201
+ throw new Error("Expected the field `name` to be a primitive type in the JSON string but got " + data['name']);
202
+ }
203
+ // ensure the json data is a string
204
+ if (data['url'] && !(typeof data['url'] === 'string' || data['url'] instanceof String)) {
205
+ throw new Error("Expected the field `url` to be a primitive type in the JSON string but got " + data['url']);
206
+ }
207
+ // ensure the json data is an array
208
+ if (!Array.isArray(data['event_types'])) {
209
+ throw new Error("Expected the field `event_types` to be an array in the JSON data but got " + data['event_types']);
210
+ }
211
+ // ensure the json data is a string
212
+ if (data['mode'] && !(typeof data['mode'] === 'string' || data['mode'] instanceof String)) {
213
+ throw new Error("Expected the field `mode` to be a primitive type in the JSON string but got " + data['mode']);
214
+ }
215
+ // ensure the json data is an array
216
+ if (!Array.isArray(data['api_token_ids'])) {
217
+ throw new Error("Expected the field `api_token_ids` to be an array in the JSON data but got " + data['api_token_ids']);
218
+ }
219
+ // ensure the json data is an array
220
+ if (!Array.isArray(data['template_ids'])) {
221
+ throw new Error("Expected the field `template_ids` to be an array in the JSON data but got " + data['template_ids']);
222
+ }
223
+ // ensure the json data is an array
224
+ if (!Array.isArray(data['folder_ids'])) {
225
+ throw new Error("Expected the field `folder_ids` to be an array in the JSON data but got " + data['folder_ids']);
226
+ }
227
+ // ensure the json data is an array
228
+ if (!Array.isArray(data['strip_fields'])) {
229
+ throw new Error("Expected the field `strip_fields` to be an array in the JSON data but got " + data['strip_fields']);
230
+ }
231
+ // ensure the json data is a string
232
+ if (data['last_failure_at'] && !(typeof data['last_failure_at'] === 'string' || data['last_failure_at'] instanceof String)) {
233
+ throw new Error("Expected the field `last_failure_at` to be a primitive type in the JSON string but got " + data['last_failure_at']);
234
+ }
235
+ // ensure the json data is a string
236
+ if (data['disabled_at'] && !(typeof data['disabled_at'] === 'string' || data['disabled_at'] instanceof String)) {
237
+ throw new Error("Expected the field `disabled_at` to be a primitive type in the JSON string but got " + data['disabled_at']);
238
+ }
239
+ // ensure the json data is a string
240
+ if (data['disabled_reason'] && !(typeof data['disabled_reason'] === 'string' || data['disabled_reason'] instanceof String)) {
241
+ throw new Error("Expected the field `disabled_reason` to be a primitive type in the JSON string but got " + data['disabled_reason']);
242
+ }
243
+ // ensure the json data is a string
244
+ if (data['secret'] && !(typeof data['secret'] === 'string' || data['secret'] instanceof String)) {
245
+ throw new Error("Expected the field `secret` to be a primitive type in the JSON string but got " + data['secret']);
246
+ }
247
+ // ensure the json data is a string
248
+ if (data['created_at'] && !(typeof data['created_at'] === 'string' || data['created_at'] instanceof String)) {
249
+ throw new Error("Expected the field `created_at` to be a primitive type in the JSON string but got " + data['created_at']);
250
+ }
251
+ // ensure the json data is a string
252
+ if (data['updated_at'] && !(typeof data['updated_at'] === 'string' || data['updated_at'] instanceof String)) {
253
+ throw new Error("Expected the field `updated_at` to be a primitive type in the JSON string but got " + data['updated_at']);
254
+ }
255
+ return true;
256
+ }
257
+ }]);
258
+ }();
259
+ Webhook.RequiredProperties = ["id", "name", "url", "enabled", "event_types", "mode", "version", "api_token_ids", "template_ids", "folder_ids", "include_submission_data", "strip_fields", "headers", "consecutive_failures", "last_failure_at", "disabled_at", "disabled_reason", "secret", "created_at", "updated_at"];
260
+
261
+ /**
262
+ * @member {String} id
263
+ */
264
+ Webhook.prototype['id'] = undefined;
265
+
266
+ /**
267
+ * @member {String} name
268
+ */
269
+ Webhook.prototype['name'] = undefined;
270
+
271
+ /**
272
+ * @member {String} url
273
+ */
274
+ Webhook.prototype['url'] = undefined;
275
+
276
+ /**
277
+ * @member {Boolean} enabled
278
+ */
279
+ Webhook.prototype['enabled'] = undefined;
280
+
281
+ /**
282
+ * @member {Array.<String>} event_types
283
+ */
284
+ Webhook.prototype['event_types'] = undefined;
285
+
286
+ /**
287
+ * @member {module:model/Webhook.ModeEnum} mode
288
+ */
289
+ Webhook.prototype['mode'] = undefined;
290
+
291
+ /**
292
+ * @member {Number} version
293
+ */
294
+ Webhook.prototype['version'] = undefined;
295
+
296
+ /**
297
+ * @member {Array.<String>} api_token_ids
298
+ */
299
+ Webhook.prototype['api_token_ids'] = undefined;
300
+
301
+ /**
302
+ * @member {Array.<String>} template_ids
303
+ */
304
+ Webhook.prototype['template_ids'] = undefined;
305
+
306
+ /**
307
+ * @member {Array.<String>} folder_ids
308
+ */
309
+ Webhook.prototype['folder_ids'] = undefined;
310
+
311
+ /**
312
+ * @member {Boolean} include_submission_data
313
+ */
314
+ Webhook.prototype['include_submission_data'] = undefined;
315
+
316
+ /**
317
+ * @member {Array.<String>} strip_fields
318
+ */
319
+ Webhook.prototype['strip_fields'] = undefined;
320
+
321
+ /**
322
+ * @member {Object.<String, String>} headers
323
+ */
324
+ Webhook.prototype['headers'] = undefined;
325
+
326
+ /**
327
+ * @member {Number} consecutive_failures
328
+ */
329
+ Webhook.prototype['consecutive_failures'] = undefined;
330
+
331
+ /**
332
+ * @member {String} last_failure_at
333
+ */
334
+ Webhook.prototype['last_failure_at'] = undefined;
335
+
336
+ /**
337
+ * @member {String} disabled_at
338
+ */
339
+ Webhook.prototype['disabled_at'] = undefined;
340
+
341
+ /**
342
+ * @member {String} disabled_reason
343
+ */
344
+ Webhook.prototype['disabled_reason'] = undefined;
345
+
346
+ /**
347
+ * @member {String} secret
348
+ */
349
+ Webhook.prototype['secret'] = undefined;
350
+
351
+ /**
352
+ * @member {String} created_at
353
+ */
354
+ Webhook.prototype['created_at'] = undefined;
355
+
356
+ /**
357
+ * @member {String} updated_at
358
+ */
359
+ Webhook.prototype['updated_at'] = undefined;
360
+
361
+ /**
362
+ * Allowed values for the <code>mode</code> property.
363
+ * @enum {String}
364
+ * @readonly
365
+ */
366
+ Webhook['ModeEnum'] = {
367
+ /**
368
+ * value: "test"
369
+ * @const
370
+ */
371
+ "test": "test",
372
+ /**
373
+ * value: "live"
374
+ * @const
375
+ */
376
+ "live": "live"
377
+ };
378
+ var _default = exports["default"] = Webhook;
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "docspring",
3
- "version": "3.0.0",
3
+ "version": "3.1.0",
4
4
  "description": "An API client for the DocSpring PDF generation service",
5
- "license": "Unlicense",
5
+ "license": "MIT",
6
6
  "main": "dist/index.js",
7
7
  "scripts": {
8
8
  "build": "babel src -d dist",