Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
66 changes: 66 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Publish Package

on:
push:
tags:
- "v*"

permissions:
id-token: write # required for npm trusted publishing (OIDC)
contents: read

concurrency:
group: publish-${{ github.ref }}
cancel-in-progress: false

jobs:
publish:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
registry-url: "https://registry.npmjs.org"

- name: Validate tag matches package version
if: startsWith(github.ref, 'refs/tags/v')
shell: bash
run: |
PKG_VERSION="$(node -p "require('./package.json').version")"
TAG_VERSION="${GITHUB_REF_NAME#v}"
if [[ "$TAG_VERSION" != "$PKG_VERSION" ]]; then
echo "Tag version ($TAG_VERSION) does not match package.json version ($PKG_VERSION)."
exit 1
fi

- name: Install dependencies
run: npm install --ignore-scripts --no-audit --no-fund

- name: Prepare release (sanitize README)
run: node scripts/prepare_release.js

- name: Build package
run: npm run build

- name: Verify package contents
run: npm pack --dry-run --ignore-scripts

- name: Choose npm dist-tag
id: npm_dist_tag
shell: bash
run: |
VERSION="$(node -p "require('./package.json').version")"
if [[ "$VERSION" == *-* ]]; then
echo "tag=next" >> "$GITHUB_OUTPUT"
else
echo "tag=latest" >> "$GITHUB_OUTPUT"
fi

- name: Publish to npm (OIDC)
if: startsWith(github.ref, 'refs/tags/v')
run: npm publish --provenance --tag "${{ steps.npm_dist_tag.outputs.tag }}" --ignore-scripts
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ dist
.idea
.vscode
.history
.npmrc
.npmrc
145 changes: 96 additions & 49 deletions README.md

Large diffs are not rendered by default.

34 changes: 19 additions & 15 deletions docs/APILogsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ All URIs are relative to *https://api.pandadoc.com*

Method | HTTP request | Description
------------- | ------------- | -------------
[**detailsLog**](APILogsApi.md#detailsLog) | **GET** /public/v1/logs/{id} | Details API Log
[**detailsLog**](APILogsApi.md#detailsLog) | **GET** /public/v1/logs/{id} | API Log Details
[**listLogs**](APILogsApi.md#listLogs) | **GET** /public/v1/logs | List API Log


Expand All @@ -28,7 +28,7 @@ const apiInstance = new pd_api.APILogsApi(configuration);

const body:pd_api.APILogsApiDetailsLogRequest = {
// string | Log event id.
id: "AXp2jrHMK2MKv_lRqmQ",
id: "AZC86i5PYKMjQjMMMw9e",
};

apiInstance.detailsLog(body).then((data) => {
Expand Down Expand Up @@ -71,7 +71,7 @@ Name | Type | Description | Notes
# **listLogs**
> APILogListResponse listLogs()

Get the list of all logs within the selected workspace. Optionally filter by date, page, and `#` of items per page.
Get the list of all logs within the selected workspace.\\ Optionally filter by date, page, and `#` of items per page.

### Example

Expand All @@ -93,15 +93,19 @@ const body:pd_api.APILogsApiListLogsRequest = {
to: "now",
// number | The amount of items on each page. (optional)
count: 10,
// number | Page number of the results returned. (optional)
// number | Returns page of the results by number. (optional)
page: 1,
// Array<100 | 200 | 300 | 400 | 500> | Returns only the predefined status codes. Allows 1xx, 2xx, 3xx, 4xx, and 5xx. (optional)
statuses: [400,500],
// Array<'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE'> | Returns only the predefined HTTP methods. Allows GET, POST, PUT, PATCH, and DELETE. (optional)
methods: ["GET","POST"],
// Array<ApiLogStatusEnum> | Returns only the predefined status codes. (optional)
statuses: [
[400,500],
],
// Array<ApiLogMethodEnum> | Returns only the predefined HTTP methods. Allows GET, POST, PUT, PATCH, and DELETE. (optional)
methods: [
"["GET","POST"]",
],
// string | Returns the results containing a string. (optional)
search: "documents/hryJY9mqYZHjQCYQuSjRQg/send",
// 'PRODUCTION' | 'SANDBOX' | Returns logs for production/sandbox. (optional)
// ApiLogEnvironmentTypeEnum | Returns logs for production/sandbox. (optional)
environmentType: "PRODUCTION",
};

Expand All @@ -115,14 +119,14 @@ apiInstance.listLogs(body).then((data) => {

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**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
**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 '-90d'
**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
**count** | [**number**] | The amount of items on each page. | (optional) defaults to undefined
**page** | [**number**] | Page number of the results returned. | (optional) defaults to undefined
**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
**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
**count** | [**number**] | The amount of items on each page. | (optional) defaults to 100
**page** | [**number**] | Returns page of the results by number. | (optional) defaults to 1
**statuses** | **Array&lt;ApiLogStatusEnum&gt;** | Returns only the predefined status codes. | (optional) defaults to undefined
**methods** | **Array&lt;ApiLogMethodEnum&gt;** | Returns only the predefined HTTP methods. Allows GET, POST, PUT, PATCH, and DELETE. | (optional) defaults to undefined
**search** | [**string**] | Returns the results containing a string. | (optional) defaults to undefined
**environmentType** | [**&#39;PRODUCTION&#39; | &#39;SANDBOX&#39;**]**Array<&#39;PRODUCTION&#39; &#124; &#39;SANDBOX&#39;>** | Returns logs for production/sandbox. | (optional) defaults to undefined
**environmentType** | **ApiLogEnvironmentTypeEnum** | Returns logs for production/sandbox. | (optional) defaults to undefined


### Return type
Expand Down
73 changes: 73 additions & 0 deletions docs/CommunicationPreferencesApi.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# .CommunicationPreferencesApi

All URIs are relative to *https://api.pandadoc.com*

Method | HTTP request | Description
------------- | ------------- | -------------
[**listRecentSmsOptOuts**](CommunicationPreferencesApi.md#listRecentSmsOptOuts) | **GET** /public/v1/sms-opt-outs | Recent SMS Opt-out


# **listRecentSmsOptOuts**
> ListSmsOptOutChangelogResponse listRecentSmsOptOuts()

Retrieves a list of the most recent SMS opt-out changes for each phone numbers used in your workspace. > 📘 You can filter results by time range using `timestamp_from` and `timestamp_to`.

### Example


```typescript
import * as pd_api from 'pandadoc-node-client';

// replace it with your API key
const API_KEY = "YOUR_API_KEY";
const configuration = pd_api.createConfiguration(
{ authMethods: {apiKey: `API-Key ${API_KEY}`} }
);
const apiInstance = new pd_api.CommunicationPreferencesApi(configuration);

const body:pd_api.CommunicationPreferencesApiListRecentSmsOptOutsRequest = {
// Date | The start of the timestamp. If no timestamp is provided, 1 hour before the current time will be used. (optional)
timestampFrom: new Date('2025-01-28T00:00:00Z'),
// Date | The end of the timestamp range. If no timestamp is provided the current time will be used. (optional)
timestampTo: new Date('2025-01-28T23:59:59Z'),
};

apiInstance.listRecentSmsOptOuts(body).then((data) => {
console.log('API called successfully. Returned data: %o', data);
}).catch((error) => console.error(error));
```


### Parameters

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**timestampFrom** | [**Date**] | The start of the timestamp. If no timestamp is provided, 1 hour before the current time will be used. | (optional) defaults to undefined
**timestampTo** | [**Date**] | The end of the timestamp range. If no timestamp is provided the current time will be used. | (optional) defaults to undefined


### Return type

**ListSmsOptOutChangelogResponse**

### Authorization

[apiKey](../README.md#apiKey), [oauth2](../README.md#oauth2)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | A list of phone numbers, their SMS current opt-out statuses and timestamp of the last change. | - |
**400** | Bad Request | - |
**401** | Authentication error | - |
**403** | Permission error | - |
**429** | Too Many Requests | - |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

15 changes: 10 additions & 5 deletions docs/ContactsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@ All URIs are relative to *https://api.pandadoc.com*
Method | HTTP request | Description
------------- | ------------- | -------------
[**createContact**](ContactsApi.md#createContact) | **POST** /public/v1/contacts | Create contact
[**deleteContact**](ContactsApi.md#deleteContact) | **DELETE** /public/v1/contacts/{id} | Delete contact by id
[**detailsContact**](ContactsApi.md#detailsContact) | **GET** /public/v1/contacts/{id} | Get contact details by id
[**deleteContact**](ContactsApi.md#deleteContact) | **DELETE** /public/v1/contacts/{id} | Delete Contact
[**detailsContact**](ContactsApi.md#detailsContact) | **GET** /public/v1/contacts/{id} | Contact Details
[**listContacts**](ContactsApi.md#listContacts) | **GET** /public/v1/contacts | List contacts
[**updateContact**](ContactsApi.md#updateContact) | **PATCH** /public/v1/contacts/{id} | Update contact by id
[**updateContact**](ContactsApi.md#updateContact) | **PATCH** /public/v1/contacts/{id} | Update Contact


# **createContact**
> ContactDetailsResponse createContact(contactCreateRequest)

This method adds a contact into a contacts list.

### Example

Expand All @@ -37,6 +38,7 @@ const body:pd_api.ContactsApiCreateContactRequest = {
company: "John Doe Inc.",
jobTitle: "CTO",
phone: "+14842634627",
country: "USA",
state: "Texas",
streetAddress: "1313 Mockingbird Lane",
city: "Austin",
Expand Down Expand Up @@ -84,6 +86,7 @@ Name | Type | Description | Notes
# **deleteContact**
> void deleteContact()

This method deletes a contact.

### Example

Expand Down Expand Up @@ -144,6 +147,7 @@ Name | Type | Description | Notes
# **detailsContact**
> ContactDetailsResponse detailsContact()

Returns contact details by its ID.

### Example

Expand Down Expand Up @@ -204,6 +208,7 @@ Name | Type | Description | Notes
# **listContacts**
> ContactListResponse listContacts()

This method returns a list of contacts associated with a workspace.

### Example

Expand All @@ -220,7 +225,7 @@ const apiInstance = new pd_api.ContactsApi(configuration);

const body:pd_api.ContactsApiListContactsRequest = {
// string | Optional search parameter. Filter results by exact match. (optional)
email: "josh@example.com",
email: "",
};

apiInstance.listContacts(body).then((data) => {
Expand Down Expand Up @@ -264,6 +269,7 @@ Name | Type | Description | Notes
# **updateContact**
> ContactDetailsResponse updateContact(contactUpdateRequest)

This method updates a contact details.

### Example

Expand All @@ -283,7 +289,6 @@ const body:pd_api.ContactsApiUpdateContactRequest = {
id: "SyoufNkJiHRn24LpuJ7RXb",
// ContactUpdateRequest
contactUpdateRequest: {
email: "user01@pandadoc.com",
firstName: "John",
lastName: "Doe",
company: "John Doe Inc.",
Expand Down
Loading
Loading