Skip to content

Commit 2eff272

Browse files
committed
- Update a pricing table request parameter
1 parent 0ad7a11 commit 2eff272

20 files changed

+39
-579
lines changed

docs/DocumentsApi.md

Lines changed: 7 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,9 @@ const body:pd_api.DocumentsApiCreateDocumentRequest = {
112112
name: "API Sample Document from PandaDoc Template",
113113
templateUuid: "hryJY9mqYZHjQCYQuSjRQg",
114114
folderUuid: "QMDSzwabfFzTgjW4kUijqQ",
115+
owner: {
116+
"key": "key_example",
117+
},
115118
recipients: [
116119
{
117120
@@ -140,24 +143,7 @@ const body:pd_api.DocumentsApiCreateDocumentRequest = {
140143
{
141144
name: "Pricing Table 1",
142145
dataMerge: true,
143-
options: {
144-
currency: "USD",
145-
discount: {
146-
type: "absolute",
147-
name: "Global Discount",
148-
value: 2.26,
149-
},
150-
taxFirst: {
151-
type: "percent",
152-
name: "Tax First",
153-
value: 2.26,
154-
},
155-
taxSecond: {
156-
type: "percent",
157-
name: "Tax Second",
158-
value: 2.26,
159-
},
160-
},
146+
options: {},
161147
sections: [
162148
{
163149
title: "Sample Section",
@@ -170,26 +156,7 @@ const body:pd_api.DocumentsApiCreateDocumentRequest = {
170156
optionalSelected: true,
171157
optional: true,
172158
},
173-
data: {
174-
name: "Toy Panda",
175-
description: "Fluffy!",
176-
price: 10,
177-
cost: 8.5,
178-
qty: 3,
179-
sku: "toy_panda",
180-
discount: {
181-
value: 7.5,
182-
type: "percent",
183-
},
184-
taxFirst: {
185-
value: 7.5,
186-
type: "percent",
187-
},
188-
taxSecond: {
189-
value: 7.5,
190-
type: "percent",
191-
},
192-
},
159+
data: {},
193160
customFields: {},
194161
},
195162
],
@@ -207,24 +174,7 @@ const body:pd_api.DocumentsApiCreateDocumentRequest = {
207174
{
208175
name: "Pricing Table 1",
209176
dataMerge: true,
210-
options: {
211-
currency: "USD",
212-
discount: {
213-
type: "absolute",
214-
name: "Global Discount",
215-
value: 2.26,
216-
},
217-
taxFirst: {
218-
type: "percent",
219-
name: "Tax First",
220-
value: 2.26,
221-
},
222-
taxSecond: {
223-
type: "percent",
224-
name: "Tax Second",
225-
value: 2.26,
226-
},
227-
},
177+
options: {},
228178
sections: [
229179
{
230180
title: "Sample Section",
@@ -237,26 +187,7 @@ const body:pd_api.DocumentsApiCreateDocumentRequest = {
237187
optionalSelected: true,
238188
optional: true,
239189
},
240-
data: {
241-
name: "Toy Panda",
242-
description: "Fluffy!",
243-
price: 10,
244-
cost: 8.5,
245-
qty: 3,
246-
sku: "toy_panda",
247-
discount: {
248-
value: 7.5,
249-
type: "percent",
250-
},
251-
taxFirst: {
252-
value: 7.5,
253-
type: "percent",
254-
},
255-
taxSecond: {
256-
value: 7.5,
257-
type: "percent",
258-
},
259-
},
190+
data: {},
260191
customFields: {},
261192
},
262193
],

examples/createDocumentFromPandadocTemplateAndSend.ts

Lines changed: 16 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,18 @@ async function createDocumentFromPandadocTemplate(
1818
const pricingTables: Array<pd_api.PricingTableRequest> = [
1919
{
2020
name: "Pricing Table 1",
21+
dataMerge: true,
2122
options: {
22-
currency: "USD",
23-
discount: {
23+
Discount: {
2424
type: "absolute",
2525
name: "Global Discount",
2626
value: 2.26,
2727
},
28-
taxFirst: {
28+
Tax: {
2929
type: "percent",
3030
name: "Tax First",
3131
value: 2.26,
3232
},
33-
taxSecond: {
34-
type: "percent",
35-
name: "Tax Second",
36-
value: 2.26,
37-
},
3833
},
3934
sections: [
4035
{
@@ -49,24 +44,20 @@ async function createDocumentFromPandadocTemplate(
4944
optional: true,
5045
},
5146
data: {
52-
name: "Toy Panda",
53-
description: "Fluffy!",
54-
price: 10,
55-
cost: 8.5,
56-
qty: 3,
57-
sku: "toy_panda",
58-
discount: {
59-
value: 7.5,
60-
type: "percent",
61-
},
62-
taxFirst: {
63-
value: 7.5,
64-
type: "percent",
65-
},
66-
taxSecond: {
67-
value: 7.5,
68-
type: "percent",
47+
"Name": "Toy Panda",
48+
"Description": "Fluffy",
49+
"Price": 10,
50+
"Cost": 8.5,
51+
"QTY": 3,
52+
"SKU": "toy_panda",
53+
"Discount": {
54+
"value": 10,
55+
"type": "percent"
6956
},
57+
"Tax": {
58+
"value": 10,
59+
"type": "percent"
60+
}
7061
},
7162
customFields: {},
7263
},

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "pandadoc-node-client",
3-
"version": "4.3.1",
3+
"version": "5.0.0",
44
"description": "The Official PandaDoc Node client SDK",
55
"author": "PandaDoc",
66
"keywords": [

src/http/http.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export type RequestBody = undefined | string | FormData | URLSearchParams;
5050
*/
5151
export class RequestContext {
5252
private headers: { [key: string]: string } = {
53-
"User-Agent": "pandadoc_node_client/4.3.1",
53+
"User-Agent": "pandadoc_node_client/5.0.0",
5454
};
5555
private body: RequestBody = undefined;
5656
private url: URLParse;

src/models/DocumentCreateRequest.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ export class DocumentCreateRequest {
2828
*/
2929
'folderUuid'?: string;
3030
/**
31+
* You can set an owner of a document as an `email` or `membership_id`
32+
*/
33+
'owner'?: { [key: string]: string; };
34+
/**
3135
* The list of recipients you're sending the document to. Every object must contain the `email` parameter. The `role`, `first_name` and `last_name` parameters are optional. If the `role` parameter is passed, a person is assigned all fields matching their corresponding role. If a role was not passed, a person receives a read-only link to view the document. If the `first_name` and `last_name` are not passed, the system does this 1. Creates a new contact, if none exists with the given `email`; or 2. Gets the existing contact with the given `email` that already exists.
3236
*/
3337
'recipients'?: Array<DocumentCreateRequestRecipients>;
@@ -89,6 +93,12 @@ export class DocumentCreateRequest {
8993
"type": "string",
9094
"format": ""
9195
},
96+
{
97+
"name": "owner",
98+
"baseName": "owner",
99+
"type": "{ [key: string]: string; }",
100+
"format": ""
101+
},
92102
{
93103
"name": "recipients",
94104
"baseName": "recipients",

src/models/ObjectSerializer.ts

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,6 @@ export * from './MemberDetailsResponse';
5959
export * from './MemberListResponse';
6060
export * from './OAuth2AccessTokenResponse';
6161
export * from './PricingTableRequest';
62-
export * from './PricingTableRequestOptions';
63-
export * from './PricingTableRequestOptionsDiscount';
64-
export * from './PricingTableRequestOptionsTaxFirst';
65-
export * from './PricingTableRequestOptionsTaxSecond';
66-
export * from './PricingTableRequestRowData';
67-
export * from './PricingTableRequestRowDataDiscount';
68-
export * from './PricingTableRequestRowDataTaxFirst';
69-
export * from './PricingTableRequestRowDataTaxSecond';
7062
export * from './PricingTableRequestRowOptions';
7163
export * from './PricingTableRequestRows';
7264
export * from './PricingTableRequestSections';
@@ -152,14 +144,6 @@ import { MemberDetailsResponse } from './MemberDetailsResponse';
152144
import { MemberListResponse } from './MemberListResponse';
153145
import { OAuth2AccessTokenResponse } from './OAuth2AccessTokenResponse';
154146
import { PricingTableRequest } from './PricingTableRequest';
155-
import { PricingTableRequestOptions } from './PricingTableRequestOptions';
156-
import { PricingTableRequestOptionsDiscount, PricingTableRequestOptionsDiscountTypeEnum } from './PricingTableRequestOptionsDiscount';
157-
import { PricingTableRequestOptionsTaxFirst, PricingTableRequestOptionsTaxFirstTypeEnum } from './PricingTableRequestOptionsTaxFirst';
158-
import { PricingTableRequestOptionsTaxSecond, PricingTableRequestOptionsTaxSecondTypeEnum } from './PricingTableRequestOptionsTaxSecond';
159-
import { PricingTableRequestRowData } from './PricingTableRequestRowData';
160-
import { PricingTableRequestRowDataDiscount } from './PricingTableRequestRowDataDiscount';
161-
import { PricingTableRequestRowDataTaxFirst } from './PricingTableRequestRowDataTaxFirst';
162-
import { PricingTableRequestRowDataTaxSecond } from './PricingTableRequestRowDataTaxSecond';
163147
import { PricingTableRequestRowOptions } from './PricingTableRequestRowOptions';
164148
import { PricingTableRequestRows } from './PricingTableRequestRows';
165149
import { PricingTableRequestSections } from './PricingTableRequestSections';
@@ -207,9 +191,6 @@ let enumsMap: Set<string> = new Set<string>([
207191
"DocumentOrderingFieldsEnum",
208192
"DocumentStatusEnum",
209193
"DocumentStatusRequestEnum",
210-
"PricingTableRequestOptionsDiscountTypeEnum",
211-
"PricingTableRequestOptionsTaxFirstTypeEnum",
212-
"PricingTableRequestOptionsTaxSecondTypeEnum",
213194
]);
214195

215196
let typeMap: {[index: string]: any} = {
@@ -271,14 +252,6 @@ let typeMap: {[index: string]: any} = {
271252
"MemberListResponse": MemberListResponse,
272253
"OAuth2AccessTokenResponse": OAuth2AccessTokenResponse,
273254
"PricingTableRequest": PricingTableRequest,
274-
"PricingTableRequestOptions": PricingTableRequestOptions,
275-
"PricingTableRequestOptionsDiscount": PricingTableRequestOptionsDiscount,
276-
"PricingTableRequestOptionsTaxFirst": PricingTableRequestOptionsTaxFirst,
277-
"PricingTableRequestOptionsTaxSecond": PricingTableRequestOptionsTaxSecond,
278-
"PricingTableRequestRowData": PricingTableRequestRowData,
279-
"PricingTableRequestRowDataDiscount": PricingTableRequestRowDataDiscount,
280-
"PricingTableRequestRowDataTaxFirst": PricingTableRequestRowDataTaxFirst,
281-
"PricingTableRequestRowDataTaxSecond": PricingTableRequestRowDataTaxSecond,
282255
"PricingTableRequestRowOptions": PricingTableRequestRowOptions,
283256
"PricingTableRequestRows": PricingTableRequestRows,
284257
"PricingTableRequestSections": PricingTableRequestSections,

src/models/PricingTableRequest.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
* Do not edit the class manually.
88
*/
99

10-
import { PricingTableRequestOptions } from './PricingTableRequestOptions';
1110
import { PricingTableRequestSections } from './PricingTableRequestSections';
1211
import { HttpFile } from '../http/http';
1312

@@ -17,7 +16,7 @@ export class PricingTableRequest {
1716
* When set to true all field names in data rows must be passed as external names defined in the template.
1817
*/
1918
'dataMerge'?: boolean;
20-
'options'?: PricingTableRequestOptions;
19+
'options'?: any;
2120
'sections'?: Array<PricingTableRequestSections>;
2221

2322
static readonly discriminator: string | undefined = undefined;
@@ -38,7 +37,7 @@ export class PricingTableRequest {
3837
{
3938
"name": "options",
4039
"baseName": "options",
41-
"type": "PricingTableRequestOptions",
40+
"type": "any",
4241
"format": ""
4342
},
4443
{

src/models/PricingTableRequestOptions.ts

Lines changed: 0 additions & 56 deletions
This file was deleted.

0 commit comments

Comments
 (0)