@pliancy/salesforce-cpq-sdk 1.0.1 → 1.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.
|
@@ -5,6 +5,9 @@ export declare class Accounts {
|
|
|
5
5
|
private readonly connection;
|
|
6
6
|
private readonly client;
|
|
7
7
|
constructor(connection: Connection);
|
|
8
|
+
getAll(): Promise<({
|
|
9
|
+
[name: string]: import("jsforce").SObjectFieldType | null;
|
|
10
|
+
} & import("jsforce").Record)[]>;
|
|
8
11
|
getById(id: string): Promise<Account | null>;
|
|
9
12
|
getByCustomField(field: string, value: string): Promise<(Account & CustomFieldQuery<Account>) | null>;
|
|
10
13
|
}
|
|
@@ -6,6 +6,9 @@ class Accounts {
|
|
|
6
6
|
this.connection = connection;
|
|
7
7
|
this.client = this.connection.sobject('Account');
|
|
8
8
|
}
|
|
9
|
+
async getAll() {
|
|
10
|
+
return this.client.find({ Type: 'Customer', IsDeleted: false });
|
|
11
|
+
}
|
|
9
12
|
async getById(id) {
|
|
10
13
|
return this.client.findOne({ Id: id });
|
|
11
14
|
}
|
|
@@ -95,4 +95,5 @@ export type QuoteType = 'Quote' | 'Renewal' | 'Amendment' | 'Re-Quote';
|
|
|
95
95
|
export type QuoteWithLineItems = Quote & {
|
|
96
96
|
lineItems: QuoteLine[];
|
|
97
97
|
};
|
|
98
|
-
export type
|
|
98
|
+
export type UpdateQuoteLine = Pick<QuoteLine, 'Id' | 'SBQQ__Quantity__c'>;
|
|
99
|
+
export type UpdateQuoteLinesRequest = UpdateQuoteLine[];
|
|
@@ -7,6 +7,7 @@ export declare class Quotes {
|
|
|
7
7
|
constructor(connection: Connection);
|
|
8
8
|
getById(id: string): Promise<QuoteWithLineItems | null>;
|
|
9
9
|
getRenewalQuoteByAccountId(accountId: string): Promise<QuoteWithLineItems | null>;
|
|
10
|
+
getRenewalQuotesForBillingPeriod(startDate: string, endDate: string): Promise<QuoteWithLineItems[]>;
|
|
10
11
|
updateLineItemQuantities(lineItems: UpdateQuoteLinesRequest): Promise<SaveResult[]>;
|
|
11
12
|
order(quoteId: string): Promise<SaveResult>;
|
|
12
13
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Quotes = void 0;
|
|
4
|
+
const jsforce_1 = require("jsforce");
|
|
4
5
|
const quote_lines_1 = require("./quote-lines/quote-lines");
|
|
5
6
|
class Quotes {
|
|
6
7
|
constructor(connection) {
|
|
@@ -25,6 +26,19 @@ class Quotes {
|
|
|
25
26
|
quote.lineItems = await this.items.getByQuoteId(quote.Id);
|
|
26
27
|
return quote;
|
|
27
28
|
}
|
|
29
|
+
async getRenewalQuotesForBillingPeriod(startDate, endDate) {
|
|
30
|
+
const quotes = (await this.client.find({
|
|
31
|
+
SBQQ__Type__c: 'Renewal',
|
|
32
|
+
SBQQ__StartDate__c: { $eq: new jsforce_1.SfDate(startDate) },
|
|
33
|
+
SBQQ__EndDate__c: { $eq: new jsforce_1.SfDate(endDate) },
|
|
34
|
+
}));
|
|
35
|
+
if (!(quotes && quotes.length))
|
|
36
|
+
return [];
|
|
37
|
+
for (const quote of quotes) {
|
|
38
|
+
quote.lineItems = await this.items.getByQuoteId(quote.Id);
|
|
39
|
+
}
|
|
40
|
+
return quotes;
|
|
41
|
+
}
|
|
28
42
|
async updateLineItemQuantities(lineItems) {
|
|
29
43
|
return this.items.update(lineItems);
|
|
30
44
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pliancy/salesforce-cpq-sdk",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "Salesforce CPQ SDK for Node.js",
|
|
@@ -61,5 +61,8 @@
|
|
|
61
61
|
"path": "./node_modules/@digitalroute/cz-conventional-changelog-for-jira",
|
|
62
62
|
"skipScope": false
|
|
63
63
|
}
|
|
64
|
+
},
|
|
65
|
+
"publishConfig": {
|
|
66
|
+
"access": "public"
|
|
64
67
|
}
|
|
65
68
|
}
|