docspring 3.1.0 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +33 -0
- package/README.md +148 -215
- package/dist/ApiClient.js +3 -3
- package/dist/api/Client.js +9 -8
- package/dist/index.js +7 -0
- package/dist/model/AddFieldsData.js +2 -2
- package/dist/model/BatchGeneratePdfs201Response.js +17 -7
- package/dist/model/CombinePdfsData.js +3 -3
- package/dist/model/CombinedSubmission.js +13 -23
- package/dist/model/CombinedSubmissionAction.js +4 -2
- package/dist/model/CopyTemplateOptions.js +2 -2
- package/dist/model/CreateCombinedSubmissionResponse.js +28 -6
- package/dist/model/CreateCustomFileData.js +2 -2
- package/dist/model/CreateCustomFileResponse.js +15 -6
- package/dist/model/CreateFolderData.js +2 -2
- package/dist/model/CreateHtmlTemplate.js +2 -2
- package/dist/model/CreatePdfSubmissionData.js +3 -2
- package/dist/model/CreatePdfTemplate.js +2 -2
- package/dist/model/CreateSubmissionDataRequestData.js +2 -2
- package/dist/model/CreateSubmissionDataRequestEventRequest.js +2 -2
- package/dist/model/CreateSubmissionDataRequestEventResponse.js +15 -6
- package/dist/model/CreateSubmissionDataRequestResponse.js +15 -6
- package/dist/model/CreateSubmissionDataRequestTokenResponse.js +15 -6
- package/dist/model/CreateSubmissionResponse.js +28 -6
- package/dist/model/CreateWebhookData.js +2 -2
- package/dist/model/CustomFile.js +4 -2
- package/dist/model/ErrorOrMultipleErrorsResponse.js +4 -2
- package/dist/model/ErrorResponse.js +4 -2
- package/dist/model/Folder.js +4 -2
- package/dist/model/ForbiddenErrorResponse.js +173 -0
- package/dist/model/JsonSchema.js +2 -2
- package/dist/model/ListSubmissionsResponse.js +7 -22
- package/dist/model/MoveFolderData.js +2 -2
- package/dist/model/MoveTemplateData.js +2 -2
- package/dist/model/MultipleErrorsResponse.js +4 -2
- package/dist/model/PublishVersionData.js +2 -2
- package/dist/model/RenameFolderData.js +2 -2
- package/dist/model/RestoreVersionData.js +2 -2
- package/dist/model/Submission.js +15 -42
- package/dist/model/Submission422Response.js +4 -7
- package/dist/model/SubmissionAction.js +4 -2
- package/dist/model/SubmissionBatch.js +4 -2
- package/dist/model/SubmissionBatchData.js +3 -2
- package/dist/model/SubmissionBatchWithSubmissions.js +7 -22
- package/dist/model/SubmissionDataRequest.js +4 -2
- package/dist/model/SubmissionDataRequestEvent.js +4 -2
- package/dist/model/SubmissionDataRequestShow.js +4 -2
- package/dist/model/SubmissionDataRequestToken.js +4 -2
- package/dist/model/SubmissionPreview.js +15 -42
- package/dist/model/SuccessErrorResponse.js +4 -2
- package/dist/model/SuccessMultipleErrorsResponse.js +4 -2
- package/dist/model/Template.js +18 -6
- package/dist/model/TemplateAddFieldsResponse.js +4 -2
- package/dist/model/TemplateDeleteResponse.js +4 -2
- package/dist/model/TemplateModelCodeResponse.js +4 -2
- package/dist/model/TemplatePreview.js +18 -6
- package/dist/model/TemplatePublishVersionResponse.js +4 -2
- package/dist/model/UpdateHtmlTemplate.js +2 -2
- package/dist/model/UpdatePdfTemplate.js +2 -2
- package/dist/model/UpdateSubmissionDataRequestData.js +2 -2
- package/dist/model/UpdateWebhookData.js +2 -2
- package/dist/model/UploadPresignResponse.js +4 -2
- package/dist/model/Webhook.js +4 -2
- package/package.json +13 -3
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,246 +1,179 @@
|
|
|
1
|
-
#
|
|
1
|
+
# DocSpring JavaScript SDK
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
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
|
-
|
|
8
|
-
|
|
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
|
-
|
|
9
|
+
Version 3.3.0.
|
|
13
10
|
|
|
14
|
-
|
|
11
|
+
## Install and configure
|
|
15
12
|
|
|
16
|
-
|
|
13
|
+
Add docspring to your package.json:
|
|
17
14
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
Then install it via:
|
|
21
|
-
|
|
22
|
-
```shell
|
|
15
|
+
```bash
|
|
23
16
|
npm install docspring --save
|
|
24
17
|
```
|
|
25
18
|
|
|
26
|
-
|
|
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
|
-
```
|
|
43
|
-
|
|
21
|
+
```bash
|
|
22
|
+
yarn add docspring
|
|
44
23
|
```
|
|
45
24
|
|
|
46
|
-
|
|
25
|
+
Configure authentication via environment variables:
|
|
47
26
|
|
|
48
|
-
```
|
|
49
|
-
|
|
27
|
+
```bash
|
|
28
|
+
export DOCSPRING_TOKEN_ID="API_TOKEN_ID"
|
|
29
|
+
export DOCSPRING_TOKEN_SECRET="API_TOKEN_SECRET"
|
|
50
30
|
```
|
|
51
31
|
|
|
52
|
-
|
|
32
|
+
You can also configure the region or host. The host takes priority over the region:
|
|
53
33
|
|
|
54
|
-
```
|
|
55
|
-
|
|
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
|
-
|
|
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
|
-
|
|
68
|
-
|
|
69
|
-
|
|
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
|
-
|
|
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
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
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
|
-
##
|
|
56
|
+
## Generate a PDF
|
|
98
57
|
|
|
99
|
-
|
|
58
|
+
Fill a template with data (use your template's ID in place of `tpl_1234567890abcdef01`):
|
|
100
59
|
|
|
101
60
|
```javascript
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
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
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
- [
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
- [DocSpring.SubmissionDataRequest](docs/SubmissionDataRequest.md)
|
|
219
|
-
- [DocSpring.SubmissionDataRequestEvent](docs/SubmissionDataRequestEvent.md)
|
|
220
|
-
- [DocSpring.SubmissionDataRequestShow](docs/SubmissionDataRequestShow.md)
|
|
221
|
-
- [DocSpring.SubmissionDataRequestToken](docs/SubmissionDataRequestToken.md)
|
|
222
|
-
- [DocSpring.SubmissionPreview](docs/SubmissionPreview.md)
|
|
223
|
-
- [DocSpring.SuccessErrorResponse](docs/SuccessErrorResponse.md)
|
|
224
|
-
- [DocSpring.SuccessMultipleErrorsResponse](docs/SuccessMultipleErrorsResponse.md)
|
|
225
|
-
- [DocSpring.Template](docs/Template.md)
|
|
226
|
-
- [DocSpring.TemplateAddFieldsResponse](docs/TemplateAddFieldsResponse.md)
|
|
227
|
-
- [DocSpring.TemplateDeleteResponse](docs/TemplateDeleteResponse.md)
|
|
228
|
-
- [DocSpring.TemplateModelCodeResponse](docs/TemplateModelCodeResponse.md)
|
|
229
|
-
- [DocSpring.TemplatePreview](docs/TemplatePreview.md)
|
|
230
|
-
- [DocSpring.TemplatePublishVersionResponse](docs/TemplatePublishVersionResponse.md)
|
|
231
|
-
- [DocSpring.UpdateHtmlTemplate](docs/UpdateHtmlTemplate.md)
|
|
232
|
-
- [DocSpring.UpdatePdfTemplate](docs/UpdatePdfTemplate.md)
|
|
233
|
-
- [DocSpring.UpdateSubmissionDataRequestData](docs/UpdateSubmissionDataRequestData.md)
|
|
234
|
-
- [DocSpring.UpdateWebhookData](docs/UpdateWebhookData.md)
|
|
235
|
-
- [DocSpring.UploadPresignResponse](docs/UploadPresignResponse.md)
|
|
236
|
-
- [DocSpring.Webhook](docs/Webhook.md)
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
## Documentation for Authorization
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
Authentication schemes defined for the API:
|
|
243
|
-
### api_token_basic
|
|
244
|
-
|
|
245
|
-
- **Type**: HTTP basic authentication
|
|
246
|
-
|
|
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
|
@@ -13,7 +13,7 @@ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r),
|
|
|
13
13
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
14
14
|
function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r; if ("undefined" != typeof Symbol && void 0 !== (r = t[Symbol.toPrimitive])) { var i = r.call(t, e || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === e ? String : Number)(t); } /**
|
|
15
15
|
* DocSpring API
|
|
16
|
-
* Use DocSpring's API to programmatically fill out PDF forms, convert HTML to PDFs, merge PDFs, or request legally binding e-signatures.
|
|
16
|
+
* Use DocSpring's API to programmatically fill out PDF forms, convert HTML to PDFs, merge PDFs, or request legally binding e-signatures. Requests are rate limited per account, and live PDFs use credits: a request over the limit returns 429 with a Retry-After header, and one your credits can't cover returns 402. See [Credits & Rate Limits](https://docspring.com/docs/api-guide/credits-and-rate-limits/).
|
|
17
17
|
*
|
|
18
18
|
* The version of the OpenAPI document: v1
|
|
19
19
|
*
|
|
@@ -25,7 +25,7 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
|
|
|
25
25
|
*/
|
|
26
26
|
/**
|
|
27
27
|
* @module ApiClient
|
|
28
|
-
* @version 3.
|
|
28
|
+
* @version 3.3.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.
|
|
69
|
+
'User-Agent': 'docspring-javascript-3.3.0'
|
|
70
70
|
};
|
|
71
71
|
|
|
72
72
|
/**
|
package/dist/api/Client.js
CHANGED
|
@@ -26,6 +26,7 @@ var _CreateWebhookData = _interopRequireDefault(require("../model/CreateWebhookD
|
|
|
26
26
|
var _ErrorOrMultipleErrorsResponse = _interopRequireDefault(require("../model/ErrorOrMultipleErrorsResponse"));
|
|
27
27
|
var _ErrorResponse = _interopRequireDefault(require("../model/ErrorResponse"));
|
|
28
28
|
var _Folder = _interopRequireDefault(require("../model/Folder"));
|
|
29
|
+
var _ForbiddenErrorResponse = _interopRequireDefault(require("../model/ForbiddenErrorResponse"));
|
|
29
30
|
var _JsonSchema = _interopRequireDefault(require("../model/JsonSchema"));
|
|
30
31
|
var _ListSubmissionsResponse = _interopRequireDefault(require("../model/ListSubmissionsResponse"));
|
|
31
32
|
var _MoveFolderData = _interopRequireDefault(require("../model/MoveFolderData"));
|
|
@@ -62,7 +63,7 @@ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r),
|
|
|
62
63
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
63
64
|
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); } /**
|
|
64
65
|
* DocSpring API
|
|
65
|
-
* Use DocSpring's API to programmatically fill out PDF forms, convert HTML to PDFs, merge PDFs, or request legally binding e-signatures.
|
|
66
|
+
* Use DocSpring's API to programmatically fill out PDF forms, convert HTML to PDFs, merge PDFs, or request legally binding e-signatures. Requests are rate limited per account, and live PDFs use credits: a request over the limit returns 429 with a Retry-After header, and one your credits can't cover returns 402. See [Credits & Rate Limits](https://docspring.com/docs/api-guide/credits-and-rate-limits/).
|
|
66
67
|
*
|
|
67
68
|
* The version of the OpenAPI document: v1
|
|
68
69
|
*
|
|
@@ -75,7 +76,7 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
|
|
|
75
76
|
/**
|
|
76
77
|
* Client service.
|
|
77
78
|
* @module api/Client
|
|
78
|
-
* @version 3.
|
|
79
|
+
* @version 3.3.0
|
|
79
80
|
*/
|
|
80
81
|
var Client = exports["default"] = /*#__PURE__*/function () {
|
|
81
82
|
/**
|
|
@@ -171,7 +172,7 @@ var Client = exports["default"] = /*#__PURE__*/function () {
|
|
|
171
172
|
|
|
172
173
|
/**
|
|
173
174
|
* Generate multiple PDFs
|
|
174
|
-
* Generates up to 50 PDFs in a single request. Each submission can use a different template and data. Supports both synchronous (wait for all PDFs) and asynchronous processing. More efficient than individual requests when creating multiple PDFs. See also: - [Batch Generate PDFs](https://docspring.com/docs/api-guide/generate-pdfs/batch-generate-pdfs/) - Request format, responses, and limits
|
|
175
|
+
* Generates up to 50 PDFs in a single request. Each submission can use a different template and data. Supports both synchronous (wait for all PDFs) and asynchronous processing. More efficient than individual requests when creating multiple PDFs. Live PDFs use credits. If any live submission is waiting for credits, the API returns 402 and the others are still processed: check each submission's `state`. See [Credits & Rate Limits](https://docspring.com/docs/api-guide/credits-and-rate-limits/). See also: - [Batch Generate PDFs](https://docspring.com/docs/api-guide/generate-pdfs/batch-generate-pdfs/) - Request format, responses, and limits
|
|
175
176
|
* @param {module:model/SubmissionBatchData} data
|
|
176
177
|
* @param {Object} opts Optional parameters
|
|
177
178
|
* @param {Boolean} [wait = true)] Wait for submission batch to be processed before returning. Set to false to return immediately. Default: true (on sync.* subdomain)
|
|
@@ -210,7 +211,7 @@ var Client = exports["default"] = /*#__PURE__*/function () {
|
|
|
210
211
|
|
|
211
212
|
/**
|
|
212
213
|
* Merge submission PDFs, template PDFs, or custom files
|
|
213
|
-
* Combines multiple PDFs from various sources into a single PDF file. Supports merging submission PDFs, template PDFs, custom files, other merged PDFs, and PDFs from URLs. Merges the PDFs in the order provided.
|
|
214
|
+
* Combines multiple PDFs from various sources into a single PDF file. Supports merging submission PDFs, template PDFs, custom files, other merged PDFs, and PDFs from URLs. Merges the PDFs in the order provided. Combining uses credits (4 per source PDF, plus 4 per unit of the combined PDF), even with a test API token or watermarked source PDFs. If your balance can't cover it, the API returns 402 and the combined submission waits in the `insufficient_credits` state until you add credits. See [Credits & Rate Limits](https://docspring.com/docs/api-guide/credits-and-rate-limits/).
|
|
214
215
|
* @param {module:model/CombinePdfsData} data
|
|
215
216
|
* @param {module:api/Client~combinePdfsCallback} callback The callback function, accepting three arguments: error, data, response
|
|
216
217
|
* data is of type: {@link module:model/CreateCombinedSubmissionResponse}
|
|
@@ -771,7 +772,7 @@ var Client = exports["default"] = /*#__PURE__*/function () {
|
|
|
771
772
|
|
|
772
773
|
/**
|
|
773
774
|
* Generate a PDF
|
|
774
|
-
* Creates a PDF submission by filling in a template with data. Supports both synchronous (default) and asynchronous processing. Add the `wait=false` query parameter to return immediately. See also: - [Customize the PDF Title and Filename](https://docspring.com/docs/api-guide/generate-pdfs/customize-pdf-title-and-filename/) - Set custom metadata - [Handling Truncated Text](https://docspring.com/docs/api-guide/generate-pdfs/handle-truncated-text/) - Handle text that doesn't fit in fields
|
|
775
|
+
* Creates a PDF submission by filling in a template with data. Supports both synchronous (default) and asynchronous processing. Add the `wait=false` query parameter to return immediately. Live PDFs use credits; test PDFs (`test: true`) are free and watermarked. If your balance can't cover a live PDF, the API returns 402 and the submission waits in the `insufficient_credits` state until you add credits. See [Credits & Rate Limits](https://docspring.com/docs/api-guide/credits-and-rate-limits/). See also: - [Customize the PDF Title and Filename](https://docspring.com/docs/api-guide/generate-pdfs/customize-pdf-title-and-filename/) - Set custom metadata - [Handling Truncated Text](https://docspring.com/docs/api-guide/generate-pdfs/handle-truncated-text/) - Handle text that doesn't fit in fields
|
|
775
776
|
* @param {String} template_id
|
|
776
777
|
* @param {module:model/CreatePdfSubmissionData} submission
|
|
777
778
|
* @param {Object} opts Optional parameters
|
|
@@ -853,7 +854,7 @@ var Client = exports["default"] = /*#__PURE__*/function () {
|
|
|
853
854
|
|
|
854
855
|
/**
|
|
855
856
|
* Check the status of a combined submission (merged PDFs)
|
|
856
|
-
* Retrieves the details and status of a combined submission. Returns processing state, download URL (if processed), metadata, and information about any integrated actions (e.g., S3 uploads).
|
|
857
|
+
* Retrieves the details and status of a combined submission. Returns processing state, download URL (if processed), metadata, and information about any integrated actions (e.g., S3 uploads). `insufficient_credits` means the combined submission is waiting for credits and is processed once you add them. If it's still waiting after 30 days, it moves to `error`.
|
|
857
858
|
* @param {String} combined_submission_id
|
|
858
859
|
* @param {module:api/Client~getCombinedSubmissionCallback} callback The callback function, accepting three arguments: error, data, response
|
|
859
860
|
* data is of type: {@link module:model/CombinedSubmission}
|
|
@@ -990,7 +991,7 @@ var Client = exports["default"] = /*#__PURE__*/function () {
|
|
|
990
991
|
|
|
991
992
|
/**
|
|
992
993
|
* Check the status of a PDF
|
|
993
|
-
* Retrieves the details and status of a PDF submission. Returns processing state, download URL (if processed), metadata, submission data (optional), and information about any integrated actions. Use this to poll for completion when using asynchronous processing.
|
|
994
|
+
* Retrieves the details and status of a PDF submission. Returns processing state, download URL (if processed), metadata, submission data (optional), and information about any integrated actions. Use this to poll for completion when using asynchronous processing. `insufficient_credits` means the submission is waiting for credits and is processed once you add them. If it's still waiting after 30 days, it moves to `error`.
|
|
994
995
|
* @param {String} submission_id
|
|
995
996
|
* @param {Object} opts Optional parameters
|
|
996
997
|
* @param {Boolean} [include_data]
|
|
@@ -1031,7 +1032,7 @@ var Client = exports["default"] = /*#__PURE__*/function () {
|
|
|
1031
1032
|
|
|
1032
1033
|
/**
|
|
1033
1034
|
* Check the status of a submission batch job
|
|
1034
|
-
* Retrieves the status and results of a batch PDF generation job. Returns processing state, completion statistics, and optionally includes all individual submission details. Use this to poll for completion when using asynchronous batch processing.
|
|
1035
|
+
* Retrieves the status and results of a batch PDF generation job. Returns processing state, completion statistics, and optionally includes all individual submission details. Use this to poll for completion when using asynchronous batch processing. Submissions waiting for credits are in the `insufficient_credits` state and count as pending, so the batch stays `pending` until you add credits or they stop waiting after 30 days.
|
|
1035
1036
|
* @param {String} submission_batch_id
|
|
1036
1037
|
* @param {Object} opts Optional parameters
|
|
1037
1038
|
* @param {Boolean} [include_submissions]
|
package/dist/index.js
CHANGED
|
@@ -159,6 +159,12 @@ Object.defineProperty(exports, "Folder", {
|
|
|
159
159
|
return _Folder["default"];
|
|
160
160
|
}
|
|
161
161
|
});
|
|
162
|
+
Object.defineProperty(exports, "ForbiddenErrorResponse", {
|
|
163
|
+
enumerable: true,
|
|
164
|
+
get: function get() {
|
|
165
|
+
return _ForbiddenErrorResponse["default"];
|
|
166
|
+
}
|
|
167
|
+
});
|
|
162
168
|
Object.defineProperty(exports, "JsonSchema", {
|
|
163
169
|
enumerable: true,
|
|
164
170
|
get: function get() {
|
|
@@ -382,6 +388,7 @@ var _CustomFile = _interopRequireDefault(require("./model/CustomFile"));
|
|
|
382
388
|
var _ErrorOrMultipleErrorsResponse = _interopRequireDefault(require("./model/ErrorOrMultipleErrorsResponse"));
|
|
383
389
|
var _ErrorResponse = _interopRequireDefault(require("./model/ErrorResponse"));
|
|
384
390
|
var _Folder = _interopRequireDefault(require("./model/Folder"));
|
|
391
|
+
var _ForbiddenErrorResponse = _interopRequireDefault(require("./model/ForbiddenErrorResponse"));
|
|
385
392
|
var _JsonSchema = _interopRequireDefault(require("./model/JsonSchema"));
|
|
386
393
|
var _ListSubmissionsResponse = _interopRequireDefault(require("./model/ListSubmissionsResponse"));
|
|
387
394
|
var _MoveFolderData = _interopRequireDefault(require("./model/MoveFolderData"));
|
|
@@ -16,7 +16,7 @@ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r),
|
|
|
16
16
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
17
17
|
function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r; if ("undefined" != typeof Symbol && void 0 !== (r = t[Symbol.toPrimitive])) { var i = r.call(t, e || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === e ? String : Number)(t); } /**
|
|
18
18
|
* DocSpring API
|
|
19
|
-
* Use DocSpring's API to programmatically fill out PDF forms, convert HTML to PDFs, merge PDFs, or request legally binding e-signatures.
|
|
19
|
+
* Use DocSpring's API to programmatically fill out PDF forms, convert HTML to PDFs, merge PDFs, or request legally binding e-signatures. Requests are rate limited per account, and live PDFs use credits: a request over the limit returns 429 with a Retry-After header, and one your credits can't cover returns 402. See [Credits & Rate Limits](https://docspring.com/docs/api-guide/credits-and-rate-limits/).
|
|
20
20
|
*
|
|
21
21
|
* The version of the OpenAPI document: v1
|
|
22
22
|
*
|
|
@@ -29,7 +29,7 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
|
|
|
29
29
|
/**
|
|
30
30
|
* The AddFieldsData model module.
|
|
31
31
|
* @module model/AddFieldsData
|
|
32
|
-
* @version 3.
|
|
32
|
+
* @version 3.3.0
|
|
33
33
|
*/
|
|
34
34
|
var AddFieldsData = /*#__PURE__*/function () {
|
|
35
35
|
/**
|