Skip to content

Commit f970447

Browse files
authored
Merge pull request #1 from PandaDoc/add-sdk
Add TS client
2 parents 3a8acd4 + 976d27c commit f970447

File tree

115 files changed

+14345
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+14345
-0
lines changed

README.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# The Official PandaDoc Node client SDK
2+
PandaDoc SDK spans a broad range of functionality to help you build incredible documents automation experiences inside your product.
3+
4+
## Docs
5+
- [Official public API documentation](https://developers.pandadoc.com/reference/about)
6+
7+
## Requirements
8+
Node >= 12
9+
10+
## Installation
11+
#### npm install
12+
If the package is hosted on a repository, you can install directly using:
13+
```sh
14+
npm install git+https://github.com/PandaDoc/pandadoc-api-node-client.git
15+
```
16+
(you may need to run `npm` with root permission: `sudo npm install git+https://github.com/PandaDoc/pandadoc-api-node-client.git`)
17+
18+
Then import the package:
19+
```typescript
20+
import * as pd_client from "pandadoc-node-client";
21+
```
22+
23+
## Getting Started
24+
25+
```typescript
26+
import * as pd_api from "pandadoc-node-client";
27+
28+
// replace it with your API key
29+
const API_KEY = "YOUR_API_KEY";
30+
const configuration = pd_api.createConfiguration(
31+
{ authMethods: {apiKey: `API-Key ${API_KEY}`} }
32+
);
33+
34+
const apiInstance = new pd_api.TemplatesApi(configuration);
35+
36+
apiInstance.listTemplates({ deleted: false, tag: ["doe-inc-proposals"] }).then((data) => {
37+
console.log('API called successfully. Returned data: %o', data);
38+
}).catch((error) => console.error(error));
39+
```
40+
41+
## Examples
42+
- [Create and send document from a template](examples/createDocumentFromPandadocTemplateAndSend.ts)
43+
- [Create and send document from the pdf url](examples/createDocumentFromPdfUrlAndSend.ts)
44+
45+
### Documentation for API Endpoints
46+
All URIs are relative to *https://api.pandadoc.com*
47+
48+
Class | Method | HTTP request | Description
49+
------------ | ------------- | ------------- | -------------
50+
*APILogsApi* | [**detailsApiLog**](APILogsApi.md#detailsapilog) | **GET** /public/v1/logs/{id} | Details API Log
51+
*APILogsApi* | [**listApiLogs**](APILogsApi.md#listapilogs) | **GET** /public/v1/logs | List API Log
52+
*ContentLibraryItemsApi* | [**detailsContentLibraryItem**](ContentLibraryItemsApi.md#detailscontentlibraryitem) | **GET** /public/v1/content-library-items/{id}/details | Details Content Library Item
53+
*ContentLibraryItemsApi* | [**listContentLibraryItems**](ContentLibraryItemsApi.md#listcontentlibraryitems) | **GET** /public/v1/content-library-items | List Content Library Item
54+
*DocumentsApi* | [**deleteDocument**](DocumentsApi.md#deletedocument) | **DELETE** /public/v1/documents/{id} | Delete document by id
55+
*DocumentsApi* | [**documentCreate**](DocumentsApi.md#documentcreate) | **POST** /public/v1/documents | Create document
56+
*DocumentsApi* | [**documentCreateLink**](DocumentsApi.md#documentcreatelink) | **POST** /public/v1/documents/{id}/session | Create a Document Link
57+
*DocumentsApi* | [**documentDetails**](DocumentsApi.md#documentdetails) | **GET** /public/v1/documents/{id}/details | Document details
58+
*DocumentsApi* | [**documentList**](DocumentsApi.md#documentlist) | **GET** /public/v1/documents | List documents
59+
*DocumentsApi* | [**documentStatus**](DocumentsApi.md#documentstatus) | **GET** /public/v1/documents/{id} | Document status
60+
*DocumentsApi* | [**downloadDocument**](DocumentsApi.md#downloaddocument) | **GET** /public/v1/documents/{id}/download | Document download
61+
*DocumentsApi* | [**downloadProtectedDocument**](DocumentsApi.md#downloadprotecteddocument) | **GET** /public/v1/documents/{id}/download-protected | Download document protected
62+
*DocumentsApi* | [**linkedObjectDelete**](DocumentsApi.md#linkedobjectdelete) | **DELETE** /public/v1/documents/{id}/linked-objects/{linked_object_id} | Delete Linked Object
63+
*DocumentsApi* | [**linkedObjectList**](DocumentsApi.md#linkedobjectlist) | **GET** /public/v1/documents/{id}/linked-objects | List Linked Objects
64+
*DocumentsApi* | [**linkedObjectsCreate**](DocumentsApi.md#linkedobjectscreate) | **POST** /public/v1/documents/{id}/linked-objects | Create Linked Object
65+
*DocumentsApi* | [**sendDocument**](DocumentsApi.md#senddocument) | **POST** /public/v1/documents/{id}/send | Send Document
66+
*FoldersAPIApi* | [**createDocumentFolder**](FoldersAPIApi.md#createdocumentfolder) | **POST** /public/v1/documents/folders | Create Documents Folder
67+
*FoldersAPIApi* | [**createTemplateFolder**](FoldersAPIApi.md#createtemplatefolder) | **POST** /public/v1/templates/folders | Create Templates Folder
68+
*FoldersAPIApi* | [**listDocumentFolders**](FoldersAPIApi.md#listdocumentfolders) | **GET** /public/v1/documents/folders | List Documents Folders
69+
*FoldersAPIApi* | [**listTemplateFolders**](FoldersAPIApi.md#listtemplatefolders) | **GET** /public/v1/templates/folders | List Templates Folders
70+
*FoldersAPIApi* | [**renameDocumentFolder**](FoldersAPIApi.md#renamedocumentfolder) | **PUT** /public/v1/documents/folders/{id} | Rename Documents Folder
71+
*FoldersAPIApi* | [**renameTemplateFolder**](FoldersAPIApi.md#renametemplatefolder) | **PUT** /public/v1/templates/folders/{id} | Rename Templates Folder
72+
*FormsApi* | [**listForm**](FormsApi.md#listform) | **GET** /public/v1/forms | Forms
73+
*OAuth20AuthenticationApi* | [**accessToken**](OAuth20AuthenticationApi.md#accesstoken) | **POST** /oauth2/access_token | Create/Refresh Access Token
74+
*TemplatesApi* | [**deleteTemplate**](TemplatesApi.md#deletetemplate) | **DELETE** /public/v1/templates/{id} | Delete Template
75+
*TemplatesApi* | [**detailsTemaplate**](TemplatesApi.md#detailstemaplate) | **GET** /public/v1/templates/{id}/details | Details Template
76+
*TemplatesApi* | [**listTemplates**](TemplatesApi.md#listtemplates) | **GET** /public/v1/templates | List Templates
77+
78+
79+
## License
80+
SDK is licensed under the following [License](MIT).

docs/APILogsApi.md

Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
# .APILogsApi
2+
3+
All URIs are relative to *https://api.pandadoc.com*
4+
5+
Method | HTTP request | Description
6+
------------- | ------------- | -------------
7+
[**detailsApiLog**](APILogsApi.md#detailsApiLog) | **GET** /public/v1/logs/{id} | Details API Log
8+
[**listApiLogs**](APILogsApi.md#listApiLogs) | **GET** /public/v1/logs | List API Log
9+
10+
11+
# **detailsApiLog**
12+
> APILogDetailsResponse detailsApiLog()
13+
14+
Returns details of the specific API log event.
15+
16+
### Example
17+
18+
19+
```typescript
20+
import * as pd_api from 'pandadoc-node-client';
21+
22+
// replace it with your API key
23+
const API_KEY = "YOUR_API_KEY";
24+
const configuration = pd_api.createConfiguration(
25+
{ authMethods: {apiKey: `API-Key ${API_KEY}`} }
26+
);
27+
const apiInstance = new pd_api.APILogsApi(configuration);
28+
29+
const body:pd_api.APILogsApiDetailsApiLogRequest = {
30+
// string | Log event id.
31+
id: "id_example",
32+
};
33+
34+
apiInstance.detailsApiLog(body).then((data) => {
35+
console.log('API called successfully. Returned data: %o', data);
36+
}).catch((error) => console.error(error));
37+
```
38+
39+
40+
### Parameters
41+
42+
Name | Type | Description | Notes
43+
------------- | ------------- | ------------- | -------------
44+
**id** | [**string**] | Log event id. | defaults to undefined
45+
46+
47+
### Return type
48+
49+
**APILogDetailsResponse**
50+
51+
### Authorization
52+
53+
[apiKey](README.md#apiKey), [oauth2](README.md#oauth2)
54+
55+
### HTTP request headers
56+
57+
- **Content-Type**: Not defined
58+
- **Accept**: application/json
59+
60+
61+
### HTTP response details
62+
| Status code | Description | Response headers |
63+
|-------------|-------------|------------------|
64+
**200** | OK | - |
65+
**401** | Authentication error | - |
66+
**404** | Not found | - |
67+
**429** | Too Many Requests | - |
68+
69+
[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)
70+
71+
# **listApiLogs**
72+
> APILogListResponse listApiLogs()
73+
74+
Get the list of all logs within the selected workspace. Optionally filter by date, page, and `#` of items per page.
75+
76+
### Example
77+
78+
79+
```typescript
80+
import * as pd_api from 'pandadoc-node-client';
81+
82+
// replace it with your API key
83+
const API_KEY = "YOUR_API_KEY";
84+
const configuration = pd_api.createConfiguration(
85+
{ authMethods: {apiKey: `API-Key ${API_KEY}`} }
86+
);
87+
const apiInstance = new pd_api.APILogsApi(configuration);
88+
89+
const body:pd_api.APILogsApiListApiLogsRequest = {
90+
// string | Determines a point in time from which logs should be fetched. Either a specific ISO 8601 datetime or a relative identifier such as \"-90d\" (for past 90 days). (optional)
91+
since: "since_example",
92+
// string | Determines a point in time from which logs should be fetched. Either a specific ISO 8601 datetime or a relative identifier such as \"-10d\" (for past 10 days) or a special \"now\" value. (optional)
93+
to: "to_example",
94+
// number | The amount of items on each page. (optional)
95+
count: 1,
96+
// number | Page number of the results returned. (optional)
97+
page: 1,
98+
// Array<100 | 200 | 300 | 400 | 500> | Returns only the predefined status codes. Allows 1xx, 2xx, 3xx, 4xx, and 5xx. (optional)
99+
statuses: [
100+
100,
101+
],
102+
// Array<'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE'> | Returns only the predefined HTTP methods. Allows GET, POST, PUT, PATCH, and DELETE. (optional)
103+
methods: [
104+
"GET",
105+
],
106+
// string | Returns the results containing a string. (optional)
107+
search: "search_example",
108+
// 'PRODUCTION' | 'SANDBOX' | Returns logs for production/sandbox. (optional)
109+
environmentType: "PRODUCTION",
110+
};
111+
112+
apiInstance.listApiLogs(body).then((data) => {
113+
console.log('API called successfully. Returned data: %o', data);
114+
}).catch((error) => console.error(error));
115+
```
116+
117+
118+
### Parameters
119+
120+
Name | Type | Description | Notes
121+
------------- | ------------- | ------------- | -------------
122+
**since** | [**string**] | Determines a point in time from which logs should be fetched. Either a specific ISO 8601 datetime or a relative identifier such as \&quot;-90d\&quot; (for past 90 days). | (optional) defaults to undefined
123+
**to** | [**string**] | Determines a point in time from which logs should be fetched. Either a specific ISO 8601 datetime or a relative identifier such as \&quot;-10d\&quot; (for past 10 days) or a special \&quot;now\&quot; value. | (optional) defaults to undefined
124+
**count** | [**number**] | The amount of items on each page. | (optional) defaults to undefined
125+
**page** | [**number**] | Page number of the results returned. | (optional) defaults to undefined
126+
**statuses** | **Array<100 &#124; 200 &#124; 300 &#124; 400 &#124; 500>** | Returns only the predefined status codes. Allows 1xx, 2xx, 3xx, 4xx, and 5xx. | (optional) defaults to undefined
127+
**methods** | **Array<&#39;GET&#39; &#124; &#39;POST&#39; &#124; &#39;PUT&#39; &#124; &#39;PATCH&#39; &#124; &#39;DELETE&#39;>** | Returns only the predefined HTTP methods. Allows GET, POST, PUT, PATCH, and DELETE. | (optional) defaults to undefined
128+
**search** | [**string**] | Returns the results containing a string. | (optional) defaults to undefined
129+
**environmentType** | [**&#39;PRODUCTION&#39; | &#39;SANDBOX&#39;**]**Array<&#39;PRODUCTION&#39; &#124; &#39;SANDBOX&#39;>** | Returns logs for production/sandbox. | (optional) defaults to undefined
130+
131+
132+
### Return type
133+
134+
**APILogListResponse**
135+
136+
### Authorization
137+
138+
[apiKey](README.md#apiKey), [oauth2](README.md#oauth2)
139+
140+
### HTTP request headers
141+
142+
- **Content-Type**: Not defined
143+
- **Accept**: application/json
144+
145+
146+
### HTTP response details
147+
| Status code | Description | Response headers |
148+
|-------------|-------------|------------------|
149+
**200** | OK | - |
150+
**400** | Bad Request | - |
151+
**401** | Authentication error | - |
152+
**429** | Too Many Requests | - |
153+
154+
[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)
155+

docs/ContentLibraryItemsApi.md

Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
# .ContentLibraryItemsApi
2+
3+
All URIs are relative to *https://api.pandadoc.com*
4+
5+
Method | HTTP request | Description
6+
------------- | ------------- | -------------
7+
[**detailsContentLibraryItem**](ContentLibraryItemsApi.md#detailsContentLibraryItem) | **GET** /public/v1/content-library-items/{id}/details | Details Content Library Item
8+
[**listContentLibraryItems**](ContentLibraryItemsApi.md#listContentLibraryItems) | **GET** /public/v1/content-library-items | List Content Library Item
9+
10+
11+
# **detailsContentLibraryItem**
12+
> ContentLibraryItemResponse detailsContentLibraryItem()
13+
14+
Return detailed data about a content library item.
15+
16+
### Example
17+
18+
19+
```typescript
20+
import * as pd_api from 'pandadoc-node-client';
21+
22+
// replace it with your API key
23+
const API_KEY = "YOUR_API_KEY";
24+
const configuration = pd_api.createConfiguration(
25+
{ authMethods: {apiKey: `API-Key ${API_KEY}`} }
26+
);
27+
const apiInstance = new pd_api.ContentLibraryItemsApi(configuration);
28+
29+
const body:pd_api.ContentLibraryItemsApiDetailsContentLibraryItemRequest = {
30+
// string | Content Library Item ID
31+
id: "id_example",
32+
};
33+
34+
apiInstance.detailsContentLibraryItem(body).then((data) => {
35+
console.log('API called successfully. Returned data: %o', data);
36+
}).catch((error) => console.error(error));
37+
```
38+
39+
40+
### Parameters
41+
42+
Name | Type | Description | Notes
43+
------------- | ------------- | ------------- | -------------
44+
**id** | [**string**] | Content Library Item ID | defaults to undefined
45+
46+
47+
### Return type
48+
49+
**ContentLibraryItemResponse**
50+
51+
### Authorization
52+
53+
[apiKey](README.md#apiKey), [oauth2](README.md#oauth2)
54+
55+
### HTTP request headers
56+
57+
- **Content-Type**: Not defined
58+
- **Accept**: application/json
59+
60+
61+
### HTTP response details
62+
| Status code | Description | Response headers |
63+
|-------------|-------------|------------------|
64+
**200** | OK | - |
65+
**401** | Authentication error | - |
66+
**403** | Permission error | - |
67+
**404** | Not found | - |
68+
**429** | Too Many Requests | - |
69+
70+
[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)
71+
72+
# **listContentLibraryItems**
73+
> ContentLibraryItemListResponse listContentLibraryItems()
74+
75+
Optionally filter by a search query or tags.
76+
77+
### Example
78+
79+
80+
```typescript
81+
import * as pd_api from 'pandadoc-node-client';
82+
83+
// replace it with your API key
84+
const API_KEY = "YOUR_API_KEY";
85+
const configuration = pd_api.createConfiguration(
86+
{ authMethods: {apiKey: `API-Key ${API_KEY}`} }
87+
);
88+
const apiInstance = new pd_api.ContentLibraryItemsApi(configuration);
89+
90+
const body:pd_api.ContentLibraryItemsApiListContentLibraryItemsRequest = {
91+
// string | Search query. Filter by content library item name. (optional)
92+
q: "name",
93+
// string | Specify content library item ID. (optional)
94+
id: "id_example",
95+
// boolean | Returns only the deleted content library items. (optional)
96+
deleted: true,
97+
// string | The UUID of the folder where the content library items are stored. (optional)
98+
folderUuid: "folder_uuid_example",
99+
// number | Specify how many content library items to return. Default is 50 content library items, maximum is 100 content library items. (optional)
100+
count: 1,
101+
// number | Specify which page of the dataset to return. (optional)
102+
page: 1,
103+
// string | Search tag. Filter by content library item tag. (optional)
104+
tag: "tag_example",
105+
};
106+
107+
apiInstance.listContentLibraryItems(body).then((data) => {
108+
console.log('API called successfully. Returned data: %o', data);
109+
}).catch((error) => console.error(error));
110+
```
111+
112+
113+
### Parameters
114+
115+
Name | Type | Description | Notes
116+
------------- | ------------- | ------------- | -------------
117+
**q** | [**string**] | Search query. Filter by content library item name. | (optional) defaults to undefined
118+
**id** | [**string**] | Specify content library item ID. | (optional) defaults to undefined
119+
**deleted** | [**boolean**] | Returns only the deleted content library items. | (optional) defaults to undefined
120+
**folderUuid** | [**string**] | The UUID of the folder where the content library items are stored. | (optional) defaults to undefined
121+
**count** | [**number**] | Specify how many content library items to return. Default is 50 content library items, maximum is 100 content library items. | (optional) defaults to undefined
122+
**page** | [**number**] | Specify which page of the dataset to return. | (optional) defaults to undefined
123+
**tag** | [**string**] | Search tag. Filter by content library item tag. | (optional) defaults to undefined
124+
125+
126+
### Return type
127+
128+
**ContentLibraryItemListResponse**
129+
130+
### Authorization
131+
132+
[apiKey](README.md#apiKey), [oauth2](README.md#oauth2)
133+
134+
### HTTP request headers
135+
136+
- **Content-Type**: Not defined
137+
- **Accept**: application/json
138+
139+
140+
### HTTP response details
141+
| Status code | Description | Response headers |
142+
|-------------|-------------|------------------|
143+
**200** | OK | - |
144+
**400** | Bad Request | - |
145+
**401** | Authentication error | - |
146+
**429** | Too Many Requests | - |
147+
148+
[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)
149+

0 commit comments

Comments
 (0)