@pliancy/salesforce-cpq-sdk 3.17.0 → 3.19.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.
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { Address, QueryCondition, Schema } from 'jsforce';
|
|
2
2
|
import { Quote } from '../quotes/quote.types';
|
|
3
|
+
import { QuoteLine } from '../quotes/quote-lines/quote-line.types';
|
|
4
|
+
import { PriceBookEntry } from '../price-books/entries/price-book-entries.types';
|
|
3
5
|
export interface Contract {
|
|
4
6
|
[index: string]: any;
|
|
5
7
|
Id: string;
|
|
@@ -95,6 +97,30 @@ export interface Attributes {
|
|
|
95
97
|
}
|
|
96
98
|
export interface ContractAmendmentResponse {
|
|
97
99
|
record: AmendmentQuote;
|
|
100
|
+
lineItems: {
|
|
101
|
+
upgradeSourcesBySourceProductId: any;
|
|
102
|
+
ui_original_record: {
|
|
103
|
+
cloneRecordIfNoCache: boolean;
|
|
104
|
+
};
|
|
105
|
+
record: Attributes & QuoteLine & {
|
|
106
|
+
SBQQ__Product__r: Attributes & {
|
|
107
|
+
PricebookEntries: {
|
|
108
|
+
totalSize: number;
|
|
109
|
+
done: boolean;
|
|
110
|
+
records: (Attributes & PriceBookEntry)[];
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
|
+
reconfigurationDisabled: false;
|
|
115
|
+
productQuantityEditable: boolean;
|
|
116
|
+
productHasDimensions: false;
|
|
117
|
+
key: 5;
|
|
118
|
+
hasConsumptionSchedules: false;
|
|
119
|
+
effectiveStartDate: string;
|
|
120
|
+
descriptionLocked: false;
|
|
121
|
+
configurationType: string;
|
|
122
|
+
configurationEvent: string;
|
|
123
|
+
}[];
|
|
98
124
|
}
|
|
99
125
|
export type AmendmentQuote = Attributes & Quote & {
|
|
100
126
|
SBQQ__Account__r: Attributes & {
|
|
@@ -111,6 +137,7 @@ export type AmendmentQuote = Attributes & Quote & {
|
|
|
111
137
|
Pricebook2Id: string;
|
|
112
138
|
AccountId: string;
|
|
113
139
|
};
|
|
140
|
+
lineItems: QuoteLine[];
|
|
114
141
|
};
|
|
115
142
|
export type ContractStatus = 'Draft' | 'Activated' | 'In Approval Process';
|
|
116
143
|
export declare const ContractsCollection = "Contract";
|
|
@@ -51,7 +51,13 @@ class Contracts extends base_1.Base {
|
|
|
51
51
|
async createAmendmentQuote(contractId) {
|
|
52
52
|
const str = await this.connection.apex.patch(`/SBQQ/ServiceRouter?loader=SBQQ.ContractManipulationAPI.ContractAmender&uid=${contractId}`, {}, { headers: { Accept: 'application/json' } });
|
|
53
53
|
const json = JSON.parse(str);
|
|
54
|
-
|
|
54
|
+
const quote = json.record;
|
|
55
|
+
const lineItems = json.lineItems;
|
|
56
|
+
if (!quote)
|
|
57
|
+
throw new Error('No quote returned from Apex');
|
|
58
|
+
if (!(lineItems && lineItems.length))
|
|
59
|
+
throw new Error('No line items returned from Apex');
|
|
60
|
+
return { ...quote, lineItems: lineItems.map((l) => l.record) };
|
|
55
61
|
}
|
|
56
62
|
}
|
|
57
63
|
exports.Contracts = Contracts;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { Connection, SaveResult } from 'jsforce';
|
|
1
|
+
import { Connection, QueryCondition, SaveResult, Schema } from 'jsforce';
|
|
2
2
|
import { FullOrder, Order, OrderStatus } from './order.types';
|
|
3
3
|
export declare class Orders {
|
|
4
4
|
private readonly connection;
|
|
5
5
|
private readonly client;
|
|
6
6
|
private readonly items;
|
|
7
7
|
constructor(connection: Connection);
|
|
8
|
+
get(query: QueryCondition<Schema, 'Order'>): Promise<Order[]>;
|
|
8
9
|
getByStartDateForAccount(accountId: string, startDate: string, status: OrderStatus): Promise<FullOrder[]>;
|
|
9
10
|
getDraftByQuoteId(id: string): Promise<Order | null>;
|
|
10
11
|
delete(id: string): Promise<SaveResult>;
|
|
@@ -9,6 +9,9 @@ class Orders {
|
|
|
9
9
|
this.client = this.connection.sobject('Order');
|
|
10
10
|
this.items = new order_items_1.OrderItems(this.connection);
|
|
11
11
|
}
|
|
12
|
+
async get(query) {
|
|
13
|
+
return this.client.find(query);
|
|
14
|
+
}
|
|
12
15
|
async getByStartDateForAccount(accountId, startDate, status) {
|
|
13
16
|
const orders = (await this.client.find({
|
|
14
17
|
AccountId: accountId,
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pliancy/salesforce-cpq-sdk",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.19.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "Salesforce CPQ SDK for Node.js",
|
|
7
7
|
"private": false,
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"jsforce": "3.6.
|
|
9
|
+
"jsforce": "3.6.6",
|
|
10
10
|
"tslib": "2.6.2"
|
|
11
11
|
},
|
|
12
12
|
"files": [
|