docspring 3.0.0 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/AGENTS.md +33 -0
  2. package/README.md +148 -205
  3. package/dist/ApiClient.js +3 -3
  4. package/dist/api/Client.js +249 -8
  5. package/dist/index.js +28 -0
  6. package/dist/model/AddFieldsData.js +2 -2
  7. package/dist/model/BatchGeneratePdfs201Response.js +4 -7
  8. package/dist/model/CombinePdfsData.js +4 -2
  9. package/dist/model/CombinedSubmission.js +7 -22
  10. package/dist/model/CombinedSubmissionAction.js +22 -6
  11. package/dist/model/CopyTemplateOptions.js +18 -29
  12. package/dist/model/CreateCombinedSubmissionResponse.js +4 -7
  13. package/dist/model/CreateCustomFileData.js +2 -2
  14. package/dist/model/CreateCustomFileResponse.js +4 -7
  15. package/dist/model/CreateFolderData.js +2 -2
  16. package/dist/model/CreateHtmlTemplate.js +2 -2
  17. package/dist/model/CreatePdfSubmissionData.js +2 -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 +4 -7
  22. package/dist/model/CreateSubmissionDataRequestResponse.js +4 -7
  23. package/dist/model/CreateSubmissionDataRequestTokenResponse.js +4 -7
  24. package/dist/model/CreateSubmissionResponse.js +4 -7
  25. package/dist/model/CreateWebhookData.js +108 -0
  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/JsonSchema.js +34 -2
  31. package/dist/model/ListSubmissionsResponse.js +7 -22
  32. package/dist/model/MoveFolderData.js +2 -2
  33. package/dist/model/MoveTemplateData.js +14 -2
  34. package/dist/model/MultipleErrorsResponse.js +4 -2
  35. package/dist/model/PublishVersionData.js +2 -2
  36. package/dist/model/RenameFolderData.js +2 -2
  37. package/dist/model/RestoreVersionData.js +2 -2
  38. package/dist/model/Submission.js +34 -53
  39. package/dist/model/Submission422Response.js +4 -7
  40. package/dist/model/SubmissionAction.js +22 -6
  41. package/dist/model/SubmissionBatch.js +4 -2
  42. package/dist/model/SubmissionBatchData.js +2 -2
  43. package/dist/model/SubmissionBatchWithSubmissions.js +7 -22
  44. package/dist/model/SubmissionDataRequest.js +28 -7
  45. package/dist/model/SubmissionDataRequestEvent.js +4 -2
  46. package/dist/model/SubmissionDataRequestShow.js +28 -7
  47. package/dist/model/SubmissionDataRequestToken.js +4 -2
  48. package/dist/model/SubmissionPreview.js +34 -47
  49. package/dist/model/SuccessErrorResponse.js +4 -2
  50. package/dist/model/SuccessMultipleErrorsResponse.js +4 -2
  51. package/dist/model/Template.js +132 -7
  52. package/dist/model/TemplateAddFieldsResponse.js +4 -2
  53. package/dist/model/TemplateDeleteResponse.js +4 -2
  54. package/dist/model/TemplateModelCodeResponse.js +195 -0
  55. package/dist/model/TemplatePreview.js +108 -7
  56. package/dist/model/TemplatePublishVersionResponse.js +4 -2
  57. package/dist/model/UpdateHtmlTemplate.js +2 -2
  58. package/dist/model/UpdatePdfTemplate.js +2 -2
  59. package/dist/model/UpdateSubmissionDataRequestData.js +2 -2
  60. package/dist/model/UpdateWebhookData.js +108 -0
  61. package/dist/model/UploadPresignResponse.js +4 -2
  62. package/dist/model/Webhook.js +380 -0
  63. package/package.json +14 -4
package/AGENTS.md ADDED
@@ -0,0 +1,33 @@
1
+ # AGENTS.md
2
+
3
+ Notes for AI coding agents working with the DocSpring JavaScript SDK (`docspring`), in this repository or
4
+ as a dependency of an app.
5
+
6
+ ## This code is generated
7
+
8
+ Every file here is generated from DocSpring's OpenAPI spec by
9
+ [DocSpring's fork of OpenAPI Generator](https://github.com/DocSpring/openapi-generator/tree/docspring/all_patches), and each release replaces
10
+ all of it. Don't edit it or open pull requests that change it, and don't patch an installed copy: the next release
11
+ overwrites the change. Report bugs at https://github.com/DocSpring/docspring-javascript/issues or to support@docspring.com, and DocSpring fixes them in
12
+ the generator.
13
+
14
+ ## Where to look
15
+
16
+ - [README.md](README.md): install, configuration, an example and how errors and API changes are handled.
17
+ - [docs/Client.md](https://github.com/DocSpring/docspring-javascript/blob/main/docs/Client.md): every method, with its parameters and return type.
18
+ - [docs/](https://github.com/DocSpring/docspring-javascript/tree/main/docs): every model and its fields.
19
+ - https://docspring.com/docs/llms.txt: DocSpring's documentation for LLMs (`llms-small.txt`, `llms-full.txt`).
20
+ - https://docspring.com/docs/api/: the API reference, with JavaScript code for every method.
21
+ - https://docspring.com/api-docs/v1/openapi.json: the OpenAPI spec this SDK is generated from.
22
+
23
+ ## Using it in an app
24
+
25
+ - Credentials come from `DOCSPRING_TOKEN_ID` and `DOCSPRING_TOKEN_SECRET`. Keep them in the environment or a secret
26
+ store, never in code. Accounts in the EU region also need `DOCSPRING_REGION=EU`.
27
+ - Template IDs look like `tpl_...` and submission IDs like `sub_...`.
28
+ - Pass `test: true` when you generate PDFs during development: test PDFs are free and watermarked.
29
+ - Generating a PDF waits for it, for up to 95 seconds. For many PDFs or slow templates, set `wait` to false and use
30
+ webhooks or check the submission later (https://docspring.com/docs/api-guide/synchronous-requests/).
31
+ - Errors: The callback gets `(error, data, response)`. For an error response, `error.status` is the HTTP status and `response.body` the parsed body.
32
+ - Responses can be newer than this SDK, because DocSpring adds fields and enum values to API v1 without a new
33
+ version. The model object keeps a response field added to the API after this release as a property. An enum value added to the API after this release comes back as a string, so handle values you don't recognize.
package/README.md CHANGED
@@ -1,236 +1,179 @@
1
- # docspring
1
+ # DocSpring JavaScript SDK
2
2
 
3
- DocSpring - JavaScript client for docspring
4
- Use DocSpring's API to programmatically fill out PDF forms, convert HTML to PDFs, merge PDFs, or request legally binding e-signatures.
5
- This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
3
+ The official JavaScript client for the [DocSpring API](https://docspring.com/docs/api/). DocSpring fills PDF
4
+ templates with your data, generates PDFs from HTML templates, combines PDFs and collects e-signatures.
6
5
 
7
- - API version: v1
8
- - Package version: 3.0.0
9
- - Generator version: 7.16.0-DOCSPRING
10
- - Build package: org.openapitools.codegen.languages.JavascriptClientCodegen
6
+ [Documentation](https://docspring.com/docs/) · [API reference](https://docspring.com/docs/api/) ·
7
+ [npm](https://www.npmjs.com/package/docspring) · [Changelog](https://github.com/DocSpring/docspring-javascript/blob/main/CHANGELOG.md)
11
8
 
12
- ## Installation
9
+ Version 3.2.0.
13
10
 
14
- ### For [Node.js](https://nodejs.org/)
11
+ ## Install and configure
15
12
 
16
- #### npm
13
+ Add docspring to your package.json:
17
14
 
18
- To publish the library as a [npm](https://www.npmjs.com/), please follow the procedure in ["Publishing npm packages"](https://docs.npmjs.com/getting-started/publishing-npm-packages).
19
-
20
- Then install it via:
21
-
22
- ```shell
15
+ ```bash
23
16
  npm install docspring --save
24
17
  ```
25
18
 
26
- Finally, you need to build the module:
27
-
28
- ```shell
29
- npm run build
30
- ```
31
-
32
- ##### Local development
33
-
34
- To use the library locally without publishing to a remote npm registry, first install the dependencies by changing into the directory containing `package.json` (and this README). Let's call this `JAVASCRIPT_CLIENT_DIR`. Then run:
35
-
36
- ```shell
37
- npm install
38
- ```
39
-
40
- Next, [link](https://docs.npmjs.com/cli/link) it globally in npm with the following, also from `JAVASCRIPT_CLIENT_DIR`:
19
+ Or with Yarn:
41
20
 
42
- ```shell
43
- npm link
21
+ ```bash
22
+ yarn add docspring
44
23
  ```
45
24
 
46
- To use the link you just defined in your project, switch to the directory you want to use your docspring from, and run:
25
+ Configure authentication via environment variables:
47
26
 
48
- ```shell
49
- npm link /path/to/<JAVASCRIPT_CLIENT_DIR>
27
+ ```bash
28
+ export DOCSPRING_TOKEN_ID="API_TOKEN_ID"
29
+ export DOCSPRING_TOKEN_SECRET="API_TOKEN_SECRET"
50
30
  ```
51
31
 
52
- Finally, you need to build the module:
32
+ You can also configure the region or host. The host takes priority over the region:
53
33
 
54
- ```shell
55
- npm run build
34
+ ```bash
35
+ export DOCSPRING_REGION="US" # US or EU (defaults to US)
36
+ export DOCSPRING_HOST="docspring.yourcompany.com" # For on-premise deployments
56
37
  ```
57
38
 
58
- #### git
59
-
60
- If the library is hosted at a git repository, e.g.https://github.com/GIT_USER_ID/GIT_REPO_ID
61
- then install it via:
62
-
63
- ```shell
64
- npm install GIT_USER_ID/GIT_REPO_ID --save
65
- ```
39
+ Initialize the DocSpring client with no arguments:
66
40
 
67
- ### For browser
68
-
69
- The library also works in the browser environment via npm and [browserify](http://browserify.org/). After following
70
- the above steps with Node.js and installing browserify with `npm install -g browserify`,
71
- perform the following (assuming *main.js* is your entry file):
72
-
73
- ```shell
74
- browserify main.js > bundle.js
41
+ ```javascript
42
+ const DocSpring = require("docspring");
43
+ const apiInstance = new DocSpring.Client();
75
44
  ```
76
45
 
77
- Then include *bundle.js* in the HTML pages.
78
-
79
- ### Webpack Configuration
80
-
81
- Using Webpack you may encounter the following error: "Module not found: Error:
82
- Cannot resolve module", most certainly you should disable AMD loader. Add/merge
83
- the following section to your webpack config:
46
+ Or provide credentials directly:
84
47
 
85
48
  ```javascript
86
- module: {
87
- rules: [
88
- {
89
- parser: {
90
- amd: false
91
- }
92
- }
93
- ]
94
- }
49
+ const DocSpring = require("docspring");
50
+ const apiInstance = new DocSpring.Client({
51
+ apiTokenId: "API_TOKEN_ID",
52
+ apiTokenSecret: "API_TOKEN_SECRET",
53
+ });
95
54
  ```
96
55
 
97
- ## Getting Started
56
+ ## Generate a PDF
98
57
 
99
- Please follow the [installation](#installation) instruction and execute the following JS code:
58
+ Fill a template with data (use your template's ID in place of `tpl_1234567890abcdef01`):
100
59
 
101
60
  ```javascript
102
- var DocSpring = require('docspring');
103
-
104
- var defaultClient = DocSpring.ApiClient.instance;
105
- // Configure HTTP basic authorization: api_token_basic
106
- var api_token_basic = defaultClient.authentications['api_token_basic'];
107
- api_token_basic.username = 'YOUR USERNAME'
108
- api_token_basic.password = 'YOUR PASSWORD'
109
-
110
- var api = new DocSpring.Client()
111
- var template_id = "tpl_1234567890abcdef02"; // {String}
112
- var data = new DocSpring.AddFieldsData(); // {AddFieldsData}
113
- var callback = function(error, data, response) {
114
- if (error) {
115
- console.error(error);
116
- } else {
117
- console.log('API called successfully. Returned data: ' + data);
61
+ const templateId = 'tpl_1234567890abcdef01'
62
+ const submission = {
63
+ data: {
64
+ first_name: 'John',
65
+ last_name: 'Smith',
66
+ phone_number: '+11234567890',
67
+ },
68
+ metadata: { foo: 123, bar: 'baz' },
69
+ }
70
+ const wait = undefined
71
+
72
+ apiInstance.generatePdf(
73
+ templateId,
74
+ submission,
75
+ { wait: wait },
76
+ (error, data, response) => {
77
+ if (error) {
78
+ console.error('Error calling generatePdf:', error)
79
+ } else {
80
+ console.log('API call completed successfully:', data)
81
+ }
118
82
  }
119
- };
120
- api.addFieldsToTemplate(template_id, data, callback);
121
-
83
+ )
122
84
  ```
123
85
 
124
- ## Documentation for API Endpoints
125
-
126
- All URIs are relative to *https://sync.api.docspring.com/api/v1*
127
-
128
- Class | Method | HTTP request | Description
129
- ------------ | ------------- | ------------- | -------------
130
- *DocSpring.Client* | [**addFieldsToTemplate**](docs/Client.md#addFieldsToTemplate) | **PUT** /templates/{template_id}/add_fields | Add new fields to a Template
131
- *DocSpring.Client* | [**batchGeneratePdfs**](docs/Client.md#batchGeneratePdfs) | **POST** /submissions/batches | Generate multiple PDFs
132
- *DocSpring.Client* | [**combinePdfs**](docs/Client.md#combinePdfs) | **POST** /combined_submissions | Merge submission PDFs, template PDFs, or custom files
133
- *DocSpring.Client* | [**copyTemplate**](docs/Client.md#copyTemplate) | **POST** /templates/{template_id}/copy | Copy a template
134
- *DocSpring.Client* | [**createCustomFileFromUpload**](docs/Client.md#createCustomFileFromUpload) | **POST** /custom_files | Create a new custom file from a cached S3 upload
135
- *DocSpring.Client* | [**createDataRequestEvent**](docs/Client.md#createDataRequestEvent) | **POST** /data_requests/{data_request_id}/events | Create a new event for emailing a signee a request for signature
136
- *DocSpring.Client* | [**createDataRequestToken**](docs/Client.md#createDataRequestToken) | **POST** /data_requests/{data_request_id}/tokens | Create a new data request token for form authentication
137
- *DocSpring.Client* | [**createFolder**](docs/Client.md#createFolder) | **POST** /folders/ | Create a folder
138
- *DocSpring.Client* | [**createHtmlTemplate**](docs/Client.md#createHtmlTemplate) | **POST** /templates?endpoint_variant&#x3D;create_html_template | Create a new HTML template
139
- *DocSpring.Client* | [**createPdfTemplate**](docs/Client.md#createPdfTemplate) | **POST** /templates | Create a new PDF template with a form POST file upload
140
- *DocSpring.Client* | [**createPdfTemplateFromUpload**](docs/Client.md#createPdfTemplateFromUpload) | **POST** /templates?endpoint_variant&#x3D;create_template_from_cached_upload | Create a new PDF template from a cached S3 file upload
141
- *DocSpring.Client* | [**deleteFolder**](docs/Client.md#deleteFolder) | **DELETE** /folders/{folder_id} | Delete a folder
142
- *DocSpring.Client* | [**deleteTemplate**](docs/Client.md#deleteTemplate) | **DELETE** /templates/{template_id} | Delete a template
143
- *DocSpring.Client* | [**expireCombinedSubmission**](docs/Client.md#expireCombinedSubmission) | **DELETE** /combined_submissions/{combined_submission_id} | Expire a combined submission
144
- *DocSpring.Client* | [**expireSubmission**](docs/Client.md#expireSubmission) | **DELETE** /submissions/{submission_id} | Expire a PDF submission
145
- *DocSpring.Client* | [**generatePdf**](docs/Client.md#generatePdf) | **POST** /templates/{template_id}/submissions | Generate a PDF
146
- *DocSpring.Client* | [**generatePreview**](docs/Client.md#generatePreview) | **POST** /submissions/{submission_id}/generate_preview | Generate a preview PDF for partially completed data requests
147
- *DocSpring.Client* | [**getCombinedSubmission**](docs/Client.md#getCombinedSubmission) | **GET** /combined_submissions/{combined_submission_id} | Check the status of a combined submission (merged PDFs)
148
- *DocSpring.Client* | [**getDataRequest**](docs/Client.md#getDataRequest) | **GET** /data_requests/{data_request_id} | Look up a submission data request
149
- *DocSpring.Client* | [**getFullTemplate**](docs/Client.md#getFullTemplate) | **GET** /templates/{template_id}?full&#x3D;true | Fetch the full attributes for a PDF template
150
- *DocSpring.Client* | [**getPresignUrl**](docs/Client.md#getPresignUrl) | **GET** /uploads/presign | Get a presigned S3 URL for direct file upload
151
- *DocSpring.Client* | [**getSubmission**](docs/Client.md#getSubmission) | **GET** /submissions/{submission_id} | Check the status of a PDF
152
- *DocSpring.Client* | [**getSubmissionBatch**](docs/Client.md#getSubmissionBatch) | **GET** /submissions/batches/{submission_batch_id} | Check the status of a submission batch job
153
- *DocSpring.Client* | [**getTemplate**](docs/Client.md#getTemplate) | **GET** /templates/{template_id} | Check the status of an uploaded template
154
- *DocSpring.Client* | [**getTemplateSchema**](docs/Client.md#getTemplateSchema) | **GET** /templates/{template_id}/schema | Fetch the JSON schema for a template
155
- *DocSpring.Client* | [**listCombinedSubmissions**](docs/Client.md#listCombinedSubmissions) | **GET** /combined_submissions | Get a list of all combined submissions
156
- *DocSpring.Client* | [**listFolders**](docs/Client.md#listFolders) | **GET** /folders/ | Get a list of all folders
157
- *DocSpring.Client* | [**listSubmissions**](docs/Client.md#listSubmissions) | **GET** /submissions | List all submissions
158
- *DocSpring.Client* | [**listTemplateSubmissions**](docs/Client.md#listTemplateSubmissions) | **GET** /templates/{template_id}/submissions | List all submissions for a given template
159
- *DocSpring.Client* | [**listTemplates**](docs/Client.md#listTemplates) | **GET** /templates | Get a list of all templates
160
- *DocSpring.Client* | [**moveFolderToFolder**](docs/Client.md#moveFolderToFolder) | **POST** /folders/{folder_id}/move | Move a folder
161
- *DocSpring.Client* | [**moveTemplateToFolder**](docs/Client.md#moveTemplateToFolder) | **POST** /templates/{template_id}/move | Move Template to folder
162
- *DocSpring.Client* | [**publishTemplateVersion**](docs/Client.md#publishTemplateVersion) | **POST** /templates/{template_id}/publish_version | Publish a template version
163
- *DocSpring.Client* | [**renameFolder**](docs/Client.md#renameFolder) | **POST** /folders/{folder_id}/rename | Rename a folder
164
- *DocSpring.Client* | [**restoreTemplateVersion**](docs/Client.md#restoreTemplateVersion) | **POST** /templates/{template_id}/restore_version | Restore a template version
165
- *DocSpring.Client* | [**testAuthentication**](docs/Client.md#testAuthentication) | **GET** /authentication | Test authentication
166
- *DocSpring.Client* | [**updateDataRequest**](docs/Client.md#updateDataRequest) | **PUT** /data_requests/{data_request_id} | Update a submission data request
167
- *DocSpring.Client* | [**updateTemplate**](docs/Client.md#updateTemplate) | **PUT** /templates/{template_id} | Update a Template
168
- *DocSpring.Client* | [**updateTemplateDocument**](docs/Client.md#updateTemplateDocument) | **PUT** /templates/{template_id}?endpoint_variant&#x3D;update_template_pdf_with_form_post | Update a template&#39;s document with a form POST file upload
169
- *DocSpring.Client* | [**updateTemplateDocumentFromUpload**](docs/Client.md#updateTemplateDocumentFromUpload) | **PUT** /templates/{template_id}?endpoint_variant&#x3D;update_template_pdf_with_cached_upload | Update a template&#39;s document with a cached S3 file upload
170
-
171
-
172
- ## Documentation for Models
173
-
174
- - [DocSpring.AddFieldsData](docs/AddFieldsData.md)
175
- - [DocSpring.BatchGeneratePdfs201Response](docs/BatchGeneratePdfs201Response.md)
176
- - [DocSpring.CombinePdfsData](docs/CombinePdfsData.md)
177
- - [DocSpring.CombinedSubmission](docs/CombinedSubmission.md)
178
- - [DocSpring.CombinedSubmissionAction](docs/CombinedSubmissionAction.md)
179
- - [DocSpring.CopyTemplateOptions](docs/CopyTemplateOptions.md)
180
- - [DocSpring.CreateCombinedSubmissionResponse](docs/CreateCombinedSubmissionResponse.md)
181
- - [DocSpring.CreateCustomFileData](docs/CreateCustomFileData.md)
182
- - [DocSpring.CreateCustomFileResponse](docs/CreateCustomFileResponse.md)
183
- - [DocSpring.CreateFolderData](docs/CreateFolderData.md)
184
- - [DocSpring.CreateHtmlTemplate](docs/CreateHtmlTemplate.md)
185
- - [DocSpring.CreatePdfSubmissionData](docs/CreatePdfSubmissionData.md)
186
- - [DocSpring.CreatePdfTemplate](docs/CreatePdfTemplate.md)
187
- - [DocSpring.CreateSubmissionDataRequestData](docs/CreateSubmissionDataRequestData.md)
188
- - [DocSpring.CreateSubmissionDataRequestEventRequest](docs/CreateSubmissionDataRequestEventRequest.md)
189
- - [DocSpring.CreateSubmissionDataRequestEventResponse](docs/CreateSubmissionDataRequestEventResponse.md)
190
- - [DocSpring.CreateSubmissionDataRequestResponse](docs/CreateSubmissionDataRequestResponse.md)
191
- - [DocSpring.CreateSubmissionDataRequestTokenResponse](docs/CreateSubmissionDataRequestTokenResponse.md)
192
- - [DocSpring.CreateSubmissionResponse](docs/CreateSubmissionResponse.md)
193
- - [DocSpring.CustomFile](docs/CustomFile.md)
194
- - [DocSpring.ErrorOrMultipleErrorsResponse](docs/ErrorOrMultipleErrorsResponse.md)
195
- - [DocSpring.ErrorResponse](docs/ErrorResponse.md)
196
- - [DocSpring.Folder](docs/Folder.md)
197
- - [DocSpring.JsonSchema](docs/JsonSchema.md)
198
- - [DocSpring.ListSubmissionsResponse](docs/ListSubmissionsResponse.md)
199
- - [DocSpring.MoveFolderData](docs/MoveFolderData.md)
200
- - [DocSpring.MoveTemplateData](docs/MoveTemplateData.md)
201
- - [DocSpring.MultipleErrorsResponse](docs/MultipleErrorsResponse.md)
202
- - [DocSpring.PublishVersionData](docs/PublishVersionData.md)
203
- - [DocSpring.RenameFolderData](docs/RenameFolderData.md)
204
- - [DocSpring.RestoreVersionData](docs/RestoreVersionData.md)
205
- - [DocSpring.Submission](docs/Submission.md)
206
- - [DocSpring.Submission422Response](docs/Submission422Response.md)
207
- - [DocSpring.SubmissionAction](docs/SubmissionAction.md)
208
- - [DocSpring.SubmissionBatch](docs/SubmissionBatch.md)
209
- - [DocSpring.SubmissionBatchData](docs/SubmissionBatchData.md)
210
- - [DocSpring.SubmissionBatchWithSubmissions](docs/SubmissionBatchWithSubmissions.md)
211
- - [DocSpring.SubmissionDataRequest](docs/SubmissionDataRequest.md)
212
- - [DocSpring.SubmissionDataRequestEvent](docs/SubmissionDataRequestEvent.md)
213
- - [DocSpring.SubmissionDataRequestShow](docs/SubmissionDataRequestShow.md)
214
- - [DocSpring.SubmissionDataRequestToken](docs/SubmissionDataRequestToken.md)
215
- - [DocSpring.SubmissionPreview](docs/SubmissionPreview.md)
216
- - [DocSpring.SuccessErrorResponse](docs/SuccessErrorResponse.md)
217
- - [DocSpring.SuccessMultipleErrorsResponse](docs/SuccessMultipleErrorsResponse.md)
218
- - [DocSpring.Template](docs/Template.md)
219
- - [DocSpring.TemplateAddFieldsResponse](docs/TemplateAddFieldsResponse.md)
220
- - [DocSpring.TemplateDeleteResponse](docs/TemplateDeleteResponse.md)
221
- - [DocSpring.TemplatePreview](docs/TemplatePreview.md)
222
- - [DocSpring.TemplatePublishVersionResponse](docs/TemplatePublishVersionResponse.md)
223
- - [DocSpring.UpdateHtmlTemplate](docs/UpdateHtmlTemplate.md)
224
- - [DocSpring.UpdatePdfTemplate](docs/UpdatePdfTemplate.md)
225
- - [DocSpring.UpdateSubmissionDataRequestData](docs/UpdateSubmissionDataRequestData.md)
226
- - [DocSpring.UploadPresignResponse](docs/UploadPresignResponse.md)
227
-
228
-
229
- ## Documentation for Authorization
230
-
231
-
232
- Authentication schemes defined for the API:
233
- ### api_token_basic
234
-
235
- - **Type**: HTTP basic authentication
236
-
86
+ By default the call waits for the PDF, for up to 95 seconds, and the submission in the response has its
87
+ `download_url`. Set `wait` to false to get a pending submission straight away.
88
+ [Sync vs. async processing](https://docspring.com/docs/api-guide/synchronous-requests/) covers the time limit, status
89
+ checks and webhooks.
90
+
91
+ ## Methods
92
+
93
+ [docs/Client.md](https://github.com/DocSpring/docspring-javascript/blob/main/docs/Client.md) has each method's parameters and return type, and
94
+ [docs/](https://github.com/DocSpring/docspring-javascript/tree/main/docs) has the models. The [API reference](https://docspring.com/docs/api/) has
95
+ JavaScript code for every method.
96
+
97
+ | Method | Description |
98
+ | ------ | ----------- |
99
+ | [`addFieldsToTemplate`](https://github.com/DocSpring/docspring-javascript/blob/main/docs/Client.md#addfieldstotemplate) | Add new fields to a Template |
100
+ | [`batchGeneratePdfs`](https://github.com/DocSpring/docspring-javascript/blob/main/docs/Client.md#batchgeneratepdfs) | Generate multiple PDFs |
101
+ | [`combinePdfs`](https://github.com/DocSpring/docspring-javascript/blob/main/docs/Client.md#combinepdfs) | Merge submission PDFs, template PDFs, or custom files |
102
+ | [`copyTemplate`](https://github.com/DocSpring/docspring-javascript/blob/main/docs/Client.md#copytemplate) | Copy a template |
103
+ | [`createCustomFileFromUpload`](https://github.com/DocSpring/docspring-javascript/blob/main/docs/Client.md#createcustomfilefromupload) | Create a new custom file from a cached S3 upload |
104
+ | [`createDataRequestEvent`](https://github.com/DocSpring/docspring-javascript/blob/main/docs/Client.md#createdatarequestevent) | Create a new event for emailing a signee a request for signature |
105
+ | [`createDataRequestToken`](https://github.com/DocSpring/docspring-javascript/blob/main/docs/Client.md#createdatarequesttoken) | Create a new data request token for form authentication |
106
+ | [`createFolder`](https://github.com/DocSpring/docspring-javascript/blob/main/docs/Client.md#createfolder) | Create a folder |
107
+ | [`createHtmlTemplate`](https://github.com/DocSpring/docspring-javascript/blob/main/docs/Client.md#createhtmltemplate) | Create a new HTML template |
108
+ | [`createPdfTemplate`](https://github.com/DocSpring/docspring-javascript/blob/main/docs/Client.md#createpdftemplate) | Create a new PDF template with a form POST file upload |
109
+ | [`createPdfTemplateFromUpload`](https://github.com/DocSpring/docspring-javascript/blob/main/docs/Client.md#createpdftemplatefromupload) | Create a new PDF template from a cached S3 file upload |
110
+ | [`createWebhook`](https://github.com/DocSpring/docspring-javascript/blob/main/docs/Client.md#createwebhook) | Create a webhook |
111
+ | [`deleteFolder`](https://github.com/DocSpring/docspring-javascript/blob/main/docs/Client.md#deletefolder) | Delete a folder |
112
+ | [`deleteTemplate`](https://github.com/DocSpring/docspring-javascript/blob/main/docs/Client.md#deletetemplate) | Delete a template |
113
+ | [`deleteWebhook`](https://github.com/DocSpring/docspring-javascript/blob/main/docs/Client.md#deletewebhook) | Delete a webhook |
114
+ | [`expireCombinedSubmission`](https://github.com/DocSpring/docspring-javascript/blob/main/docs/Client.md#expirecombinedsubmission) | Expire a combined submission |
115
+ | [`expireSubmission`](https://github.com/DocSpring/docspring-javascript/blob/main/docs/Client.md#expiresubmission) | Expire a PDF submission |
116
+ | [`generatePdf`](https://github.com/DocSpring/docspring-javascript/blob/main/docs/Client.md#generatepdf) | Generate a PDF |
117
+ | [`generatePreview`](https://github.com/DocSpring/docspring-javascript/blob/main/docs/Client.md#generatepreview) | Generate a preview PDF for partially completed data requests |
118
+ | [`getCombinedSubmission`](https://github.com/DocSpring/docspring-javascript/blob/main/docs/Client.md#getcombinedsubmission) | Check the status of a combined submission (merged PDFs) |
119
+ | [`getDataRequest`](https://github.com/DocSpring/docspring-javascript/blob/main/docs/Client.md#getdatarequest) | Look up a submission data request |
120
+ | [`getFullTemplate`](https://github.com/DocSpring/docspring-javascript/blob/main/docs/Client.md#getfulltemplate) | Fetch the full attributes for a PDF template |
121
+ | [`getPresignUrl`](https://github.com/DocSpring/docspring-javascript/blob/main/docs/Client.md#getpresignurl) | Get a presigned S3 URL for direct file upload |
122
+ | [`getSubmission`](https://github.com/DocSpring/docspring-javascript/blob/main/docs/Client.md#getsubmission) | Check the status of a PDF |
123
+ | [`getSubmissionBatch`](https://github.com/DocSpring/docspring-javascript/blob/main/docs/Client.md#getsubmissionbatch) | Check the status of a submission batch job |
124
+ | [`getTemplate`](https://github.com/DocSpring/docspring-javascript/blob/main/docs/Client.md#gettemplate) | Check the status of an uploaded template |
125
+ | [`getTemplateModelCode`](https://github.com/DocSpring/docspring-javascript/blob/main/docs/Client.md#gettemplatemodelcode) | Generate typed model code for a template |
126
+ | [`getTemplateSchema`](https://github.com/DocSpring/docspring-javascript/blob/main/docs/Client.md#gettemplateschema) | Fetch the JSON schema for a template |
127
+ | [`getWebhook`](https://github.com/DocSpring/docspring-javascript/blob/main/docs/Client.md#getwebhook) | Get a webhook |
128
+ | [`listCombinedSubmissions`](https://github.com/DocSpring/docspring-javascript/blob/main/docs/Client.md#listcombinedsubmissions) | Get a list of all combined submissions |
129
+ | [`listFolders`](https://github.com/DocSpring/docspring-javascript/blob/main/docs/Client.md#listfolders) | Get a list of all folders |
130
+ | [`listSubmissions`](https://github.com/DocSpring/docspring-javascript/blob/main/docs/Client.md#listsubmissions) | List all submissions |
131
+ | [`listTemplates`](https://github.com/DocSpring/docspring-javascript/blob/main/docs/Client.md#listtemplates) | Get a list of all templates |
132
+ | [`listTemplateSubmissions`](https://github.com/DocSpring/docspring-javascript/blob/main/docs/Client.md#listtemplatesubmissions) | List all submissions for a given template |
133
+ | [`listWebhooks`](https://github.com/DocSpring/docspring-javascript/blob/main/docs/Client.md#listwebhooks) | Get a list of all webhooks |
134
+ | [`moveFolderToFolder`](https://github.com/DocSpring/docspring-javascript/blob/main/docs/Client.md#movefoldertofolder) | Move a folder |
135
+ | [`moveTemplateToFolder`](https://github.com/DocSpring/docspring-javascript/blob/main/docs/Client.md#movetemplatetofolder) | Move Template to folder |
136
+ | [`publishTemplateVersion`](https://github.com/DocSpring/docspring-javascript/blob/main/docs/Client.md#publishtemplateversion) | Publish a template version |
137
+ | [`renameFolder`](https://github.com/DocSpring/docspring-javascript/blob/main/docs/Client.md#renamefolder) | Rename a folder |
138
+ | [`restoreTemplateVersion`](https://github.com/DocSpring/docspring-javascript/blob/main/docs/Client.md#restoretemplateversion) | Restore a template version |
139
+ | [`testAuthentication`](https://github.com/DocSpring/docspring-javascript/blob/main/docs/Client.md#testauthentication) | Test authentication |
140
+ | [`updateDataRequest`](https://github.com/DocSpring/docspring-javascript/blob/main/docs/Client.md#updatedatarequest) | Update a submission data request |
141
+ | [`updateTemplate`](https://github.com/DocSpring/docspring-javascript/blob/main/docs/Client.md#updatetemplate) | Update a Template |
142
+ | [`updateTemplateDocument`](https://github.com/DocSpring/docspring-javascript/blob/main/docs/Client.md#updatetemplatedocument) | Update a template's document with a form POST file upload |
143
+ | [`updateTemplateDocumentFromUpload`](https://github.com/DocSpring/docspring-javascript/blob/main/docs/Client.md#updatetemplatedocumentfromupload) | Update a template's document with a cached S3 file upload |
144
+ | [`updateWebhook`](https://github.com/DocSpring/docspring-javascript/blob/main/docs/Client.md#updatewebhook) | Update a webhook |
145
+
146
+ ## Errors
147
+
148
+ The callback gets `(error, data, response)`. For an error response, `error.status` is the HTTP status and `response.body` the parsed body.
149
+
150
+ ## API changes
151
+
152
+ DocSpring adds fields and enum values to API v1 without releasing a new API version. Changes that would break
153
+ existing code, such as removing or renaming a field, go in a new API version
154
+ ([API changes](https://docspring.com/docs/api-guide/openapi-schema/#api-changes)). So this SDK keeps working with
155
+ responses that are newer than it is:
156
+
157
+ - The model object keeps a response field added to the API after this release as a property.
158
+ - An enum value added to the API after this release comes back as a string, so handle values you don't recognize.
159
+
160
+ Upgrade the SDK to read new fields and enum values. The [changelog](https://github.com/DocSpring/docspring-javascript/blob/main/CHANGELOG.md) lists
161
+ what each release adds.
162
+
163
+ ## About this SDK
164
+
165
+ This SDK is generated from DocSpring's [OpenAPI spec](https://docspring.com/api-docs/v1/openapi.json) with
166
+ [DocSpring's fork of OpenAPI Generator](https://github.com/DocSpring/openapi-generator/tree/docspring/all_patches) 7.16.0.
167
+ The fork doesn't change the JavaScript generator.
168
+
169
+ On top of the generated code, we add:
170
+
171
+ - A client constructor that reads your credentials, region and host from the environment.
172
+
173
+ Because the code is generated, we can't merge pull requests that change it. Please
174
+ [open an issue](https://github.com/DocSpring/docspring-javascript/issues) or email [support@docspring.com](mailto:support@docspring.com) instead, and
175
+ we'll fix it in the generator. [AGENTS.md](https://github.com/DocSpring/docspring-javascript/blob/main/AGENTS.md) is a short guide for AI coding agents.
176
+
177
+ ## License
178
+
179
+ MIT. See [LICENSE](https://github.com/DocSpring/docspring-javascript/blob/main/LICENSE).
package/dist/ApiClient.js CHANGED
@@ -11,7 +11,7 @@ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Can
11
11
  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); } }
12
12
  function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
13
13
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
14
- 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); } /**
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
16
  * Use DocSpring's API to programmatically fill out PDF forms, convert HTML to PDFs, merge PDFs, or request legally binding e-signatures.
17
17
  *
@@ -25,7 +25,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
25
25
  */
26
26
  /**
27
27
  * @module ApiClient
28
- * @version 3.0.0
28
+ * @version 3.2.0
29
29
  */
30
30
  /**
31
31
  * Manages low level client-server communications, parameter marshalling, etc. There should not be any need for an
@@ -66,7 +66,7 @@ var ApiClient = /*#__PURE__*/function () {
66
66
  * @default {}
67
67
  */
68
68
  this.defaultHeaders = {
69
- 'User-Agent': 'docspring-javascript-3.0.0'
69
+ 'User-Agent': 'docspring-javascript-3.2.0'
70
70
  };
71
71
 
72
72
  /**