docspring 3.1.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.
- package/AGENTS.md +33 -0
- package/README.md +148 -215
- package/dist/ApiClient.js +2 -2
- package/dist/api/Client.js +1 -1
- package/dist/model/AddFieldsData.js +1 -1
- package/dist/model/BatchGeneratePdfs201Response.js +3 -6
- package/dist/model/CombinePdfsData.js +1 -1
- package/dist/model/CombinedSubmission.js +6 -21
- package/dist/model/CombinedSubmissionAction.js +3 -1
- package/dist/model/CopyTemplateOptions.js +1 -1
- package/dist/model/CreateCombinedSubmissionResponse.js +3 -6
- package/dist/model/CreateCustomFileData.js +1 -1
- package/dist/model/CreateCustomFileResponse.js +3 -6
- package/dist/model/CreateFolderData.js +1 -1
- package/dist/model/CreateHtmlTemplate.js +1 -1
- package/dist/model/CreatePdfSubmissionData.js +1 -1
- package/dist/model/CreatePdfTemplate.js +1 -1
- package/dist/model/CreateSubmissionDataRequestData.js +1 -1
- package/dist/model/CreateSubmissionDataRequestEventRequest.js +1 -1
- package/dist/model/CreateSubmissionDataRequestEventResponse.js +3 -6
- package/dist/model/CreateSubmissionDataRequestResponse.js +3 -6
- package/dist/model/CreateSubmissionDataRequestTokenResponse.js +3 -6
- package/dist/model/CreateSubmissionResponse.js +3 -6
- package/dist/model/CreateWebhookData.js +1 -1
- package/dist/model/CustomFile.js +3 -1
- package/dist/model/ErrorOrMultipleErrorsResponse.js +3 -1
- package/dist/model/ErrorResponse.js +3 -1
- package/dist/model/Folder.js +3 -1
- package/dist/model/JsonSchema.js +1 -1
- package/dist/model/ListSubmissionsResponse.js +6 -21
- package/dist/model/MoveFolderData.js +1 -1
- package/dist/model/MoveTemplateData.js +1 -1
- package/dist/model/MultipleErrorsResponse.js +3 -1
- package/dist/model/PublishVersionData.js +1 -1
- package/dist/model/RenameFolderData.js +1 -1
- package/dist/model/RestoreVersionData.js +1 -1
- package/dist/model/Submission.js +9 -41
- package/dist/model/Submission422Response.js +3 -6
- package/dist/model/SubmissionAction.js +3 -1
- package/dist/model/SubmissionBatch.js +3 -1
- package/dist/model/SubmissionBatchData.js +1 -1
- package/dist/model/SubmissionBatchWithSubmissions.js +6 -21
- package/dist/model/SubmissionDataRequest.js +3 -1
- package/dist/model/SubmissionDataRequestEvent.js +3 -1
- package/dist/model/SubmissionDataRequestShow.js +3 -1
- package/dist/model/SubmissionDataRequestToken.js +3 -1
- package/dist/model/SubmissionPreview.js +9 -41
- package/dist/model/SuccessErrorResponse.js +3 -1
- package/dist/model/SuccessMultipleErrorsResponse.js +3 -1
- package/dist/model/Template.js +17 -5
- package/dist/model/TemplateAddFieldsResponse.js +3 -1
- package/dist/model/TemplateDeleteResponse.js +3 -1
- package/dist/model/TemplateModelCodeResponse.js +3 -1
- package/dist/model/TemplatePreview.js +17 -5
- package/dist/model/TemplatePublishVersionResponse.js +3 -1
- package/dist/model/UpdateHtmlTemplate.js +1 -1
- package/dist/model/UpdatePdfTemplate.js +1 -1
- package/dist/model/UpdateSubmissionDataRequestData.js +1 -1
- package/dist/model/UpdateWebhookData.js +1 -1
- package/dist/model/UploadPresignResponse.js +3 -1
- package/dist/model/Webhook.js +3 -1
- 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.2.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
|
@@ -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.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.
|
|
69
|
+
'User-Agent': 'docspring-javascript-3.2.0'
|
|
70
70
|
};
|
|
71
71
|
|
|
72
72
|
/**
|
package/dist/api/Client.js
CHANGED
|
@@ -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.2.0
|
|
33
33
|
*/
|
|
34
34
|
var AddFieldsData = /*#__PURE__*/function () {
|
|
35
35
|
/**
|
|
@@ -30,12 +30,13 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
|
|
|
30
30
|
/**
|
|
31
31
|
* The BatchGeneratePdfs201Response model module.
|
|
32
32
|
* @module model/BatchGeneratePdfs201Response
|
|
33
|
-
* @version 3.
|
|
33
|
+
* @version 3.2.0
|
|
34
34
|
*/
|
|
35
35
|
var BatchGeneratePdfs201Response = /*#__PURE__*/function () {
|
|
36
36
|
/**
|
|
37
37
|
* Constructs a new <code>BatchGeneratePdfs201Response</code>.
|
|
38
38
|
* @alias module:model/BatchGeneratePdfs201Response
|
|
39
|
+
* @extends Object
|
|
39
40
|
* @param status {module:model/BatchGeneratePdfs201Response.StatusEnum}
|
|
40
41
|
* @param submission_batch {module:model/SubmissionBatch}
|
|
41
42
|
* @param submissions {Array.<Object>}
|
|
@@ -70,6 +71,7 @@ var BatchGeneratePdfs201Response = /*#__PURE__*/function () {
|
|
|
70
71
|
value: function constructFromObject(data, obj) {
|
|
71
72
|
if (data) {
|
|
72
73
|
obj = obj || new BatchGeneratePdfs201Response();
|
|
74
|
+
_ApiClient["default"].constructFromObject(data, obj, 'Object');
|
|
73
75
|
if (data.hasOwnProperty('status')) {
|
|
74
76
|
obj['status'] = _ApiClient["default"].convertToType(data['status'], 'String');
|
|
75
77
|
}
|
|
@@ -124,11 +126,6 @@ var BatchGeneratePdfs201Response = /*#__PURE__*/function () {
|
|
|
124
126
|
if (!Array.isArray(data['errors'])) {
|
|
125
127
|
throw new Error("Expected the field `errors` to be an array in the JSON data but got " + data['errors']);
|
|
126
128
|
}
|
|
127
|
-
// validate the optional field `submission_batch`
|
|
128
|
-
if (data['submission_batch']) {
|
|
129
|
-
// data not null
|
|
130
|
-
_SubmissionBatch["default"].validateJSON(data['submission_batch']);
|
|
131
|
-
}
|
|
132
129
|
// ensure the json data is an array
|
|
133
130
|
if (!Array.isArray(data['submissions'])) {
|
|
134
131
|
throw new Error("Expected the field `submissions` to be an array in the JSON data but got " + data['submissions']);
|
|
@@ -29,7 +29,7 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
|
|
|
29
29
|
/**
|
|
30
30
|
* The CombinePdfsData model module.
|
|
31
31
|
* @module model/CombinePdfsData
|
|
32
|
-
* @version 3.
|
|
32
|
+
* @version 3.2.0
|
|
33
33
|
*/
|
|
34
34
|
var CombinePdfsData = /*#__PURE__*/function () {
|
|
35
35
|
/**
|
|
@@ -30,12 +30,13 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
|
|
|
30
30
|
/**
|
|
31
31
|
* The CombinedSubmission model module.
|
|
32
32
|
* @module model/CombinedSubmission
|
|
33
|
-
* @version 3.
|
|
33
|
+
* @version 3.2.0
|
|
34
34
|
*/
|
|
35
35
|
var CombinedSubmission = /*#__PURE__*/function () {
|
|
36
36
|
/**
|
|
37
37
|
* Constructs a new <code>CombinedSubmission</code>.
|
|
38
38
|
* @alias module:model/CombinedSubmission
|
|
39
|
+
* @extends Object
|
|
39
40
|
* @param id {String}
|
|
40
41
|
* @param state {module:model/CombinedSubmission.StateEnum}
|
|
41
42
|
* @param expired {Boolean}
|
|
@@ -92,6 +93,7 @@ var CombinedSubmission = /*#__PURE__*/function () {
|
|
|
92
93
|
value: function constructFromObject(data, obj) {
|
|
93
94
|
if (data) {
|
|
94
95
|
obj = obj || new CombinedSubmission();
|
|
96
|
+
_ApiClient["default"].constructFromObject(data, obj, 'Object');
|
|
95
97
|
if (data.hasOwnProperty('id')) {
|
|
96
98
|
obj['id'] = _ApiClient["default"].convertToType(data['id'], 'String');
|
|
97
99
|
}
|
|
@@ -201,26 +203,9 @@ var CombinedSubmission = /*#__PURE__*/function () {
|
|
|
201
203
|
if (data['download_url'] && !(typeof data['download_url'] === 'string' || data['download_url'] instanceof String)) {
|
|
202
204
|
throw new Error("Expected the field `download_url` to be a primitive type in the JSON string but got " + data['download_url']);
|
|
203
205
|
}
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
if (!Array.isArray(data['actions'])) {
|
|
208
|
-
throw new Error("Expected the field `actions` to be an array in the JSON data but got " + data['actions']);
|
|
209
|
-
}
|
|
210
|
-
// validate the optional field `actions` (array)
|
|
211
|
-
var _iterator2 = _createForOfIteratorHelper(data['actions']),
|
|
212
|
-
_step2;
|
|
213
|
-
try {
|
|
214
|
-
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
215
|
-
var item = _step2.value;
|
|
216
|
-
_CombinedSubmissionAction["default"].validateJSON(item);
|
|
217
|
-
}
|
|
218
|
-
} catch (err) {
|
|
219
|
-
_iterator2.e(err);
|
|
220
|
-
} finally {
|
|
221
|
-
_iterator2.f();
|
|
222
|
-
}
|
|
223
|
-
;
|
|
206
|
+
// ensure the json data is an array
|
|
207
|
+
if (!Array.isArray(data['actions'])) {
|
|
208
|
+
throw new Error("Expected the field `actions` to be an array in the JSON data but got " + data['actions']);
|
|
224
209
|
}
|
|
225
210
|
return true;
|
|
226
211
|
}
|
|
@@ -29,12 +29,13 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
|
|
|
29
29
|
/**
|
|
30
30
|
* The CombinedSubmissionAction model module.
|
|
31
31
|
* @module model/CombinedSubmissionAction
|
|
32
|
-
* @version 3.
|
|
32
|
+
* @version 3.2.0
|
|
33
33
|
*/
|
|
34
34
|
var CombinedSubmissionAction = /*#__PURE__*/function () {
|
|
35
35
|
/**
|
|
36
36
|
* Constructs a new <code>CombinedSubmissionAction</code>.
|
|
37
37
|
* @alias module:model/CombinedSubmissionAction
|
|
38
|
+
* @extends Object
|
|
38
39
|
* @param id {String}
|
|
39
40
|
* @param integration_id {String}
|
|
40
41
|
* @param state {module:model/CombinedSubmissionAction.StateEnum}
|
|
@@ -77,6 +78,7 @@ var CombinedSubmissionAction = /*#__PURE__*/function () {
|
|
|
77
78
|
value: function constructFromObject(data, obj) {
|
|
78
79
|
if (data) {
|
|
79
80
|
obj = obj || new CombinedSubmissionAction();
|
|
81
|
+
_ApiClient["default"].constructFromObject(data, obj, 'Object');
|
|
80
82
|
if (data.hasOwnProperty('id')) {
|
|
81
83
|
obj['id'] = _ApiClient["default"].convertToType(data['id'], 'String');
|
|
82
84
|
}
|