@pliancy/salesforce-cpq-sdk 3.25.0 → 3.26.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.
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/lib/accounts/accounts.d.ts +1 -0
- package/dist/lib/accounts/accounts.js +3 -0
- package/dist/lib/cpq.d.ts +2 -0
- package/dist/lib/cpq.js +2 -0
- package/dist/lib/opportunities/opportunities.d.ts +12 -0
- package/dist/lib/opportunities/opportunities.js +19 -0
- package/dist/lib/opportunities/opportunity.types.d.ts +110 -0
- package/dist/lib/opportunities/opportunity.types.js +20 -0
- package/dist/lib/quotes/quotes.d.ts +1 -0
- package/dist/lib/quotes/quotes.js +3 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -14,6 +14,8 @@ export * from './lib/quotes/quotes';
|
|
|
14
14
|
export * from './lib/quotes/quote.types';
|
|
15
15
|
export * from './lib/quotes/quote-lines/quote-lines';
|
|
16
16
|
export * from './lib/quotes/quote-lines/quote-line.types';
|
|
17
|
+
export * from './lib/opportunities/opportunities';
|
|
18
|
+
export * from './lib/opportunities/opportunity.types';
|
|
17
19
|
export * from './lib/orders/orders';
|
|
18
20
|
export * from './lib/orders/order.types';
|
|
19
21
|
export * from './lib/orders/order-items/order-items';
|
package/dist/index.js
CHANGED
|
@@ -31,6 +31,8 @@ __exportStar(require("./lib/quotes/quotes"), exports);
|
|
|
31
31
|
__exportStar(require("./lib/quotes/quote.types"), exports);
|
|
32
32
|
__exportStar(require("./lib/quotes/quote-lines/quote-lines"), exports);
|
|
33
33
|
__exportStar(require("./lib/quotes/quote-lines/quote-line.types"), exports);
|
|
34
|
+
__exportStar(require("./lib/opportunities/opportunities"), exports);
|
|
35
|
+
__exportStar(require("./lib/opportunities/opportunity.types"), exports);
|
|
34
36
|
__exportStar(require("./lib/orders/orders"), exports);
|
|
35
37
|
__exportStar(require("./lib/orders/order.types"), exports);
|
|
36
38
|
__exportStar(require("./lib/orders/order-items/order-items"), exports);
|
|
@@ -7,6 +7,7 @@ export declare class Accounts {
|
|
|
7
7
|
constructor(connection: Connection);
|
|
8
8
|
getAll(): Promise<Account[]>;
|
|
9
9
|
getById(id: string): Promise<Account | null>;
|
|
10
|
+
create(data: Partial<Omit<Account, 'Id'>>): Promise<SaveResult>;
|
|
10
11
|
update(update: SObjectUpdateRecord<Schema, 'Account'>): Promise<SaveResult>;
|
|
11
12
|
getByCustomField(field: string, value: string): Promise<(Account & CustomFieldQuery<Account>) | null>;
|
|
12
13
|
}
|
package/dist/lib/cpq.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ import { OrderItems } from './orders/order-items/order-items';
|
|
|
10
10
|
import { PriceBooks } from './price-books/price-books';
|
|
11
11
|
import { CustomCollection } from './custom/custom';
|
|
12
12
|
import { Assets } from './assets/assets';
|
|
13
|
+
import { Opportunities } from './opportunities/opportunities';
|
|
13
14
|
export declare class Cpq {
|
|
14
15
|
private readonly config;
|
|
15
16
|
accounts: Accounts;
|
|
@@ -17,6 +18,7 @@ export declare class Cpq {
|
|
|
17
18
|
connection: Connection;
|
|
18
19
|
contracts: Contracts;
|
|
19
20
|
orders: Orders;
|
|
21
|
+
opportunities: Opportunities;
|
|
20
22
|
orderItems: OrderItems;
|
|
21
23
|
priceBooks: PriceBooks;
|
|
22
24
|
products: Products;
|
package/dist/lib/cpq.js
CHANGED
|
@@ -12,6 +12,7 @@ const order_items_1 = require("./orders/order-items/order-items");
|
|
|
12
12
|
const price_books_1 = require("./price-books/price-books");
|
|
13
13
|
const custom_1 = require("./custom/custom");
|
|
14
14
|
const assets_1 = require("./assets/assets");
|
|
15
|
+
const opportunities_1 = require("./opportunities/opportunities");
|
|
15
16
|
class Cpq {
|
|
16
17
|
constructor(config) {
|
|
17
18
|
this.config = config;
|
|
@@ -21,6 +22,7 @@ class Cpq {
|
|
|
21
22
|
this.accounts = new accounts_1.Accounts(this.connection);
|
|
22
23
|
this.assets = new assets_1.Assets(this.connection);
|
|
23
24
|
this.contracts = new contracts_1.Contracts(this.connection);
|
|
25
|
+
this.opportunities = new opportunities_1.Opportunities(this.connection);
|
|
24
26
|
this.orders = new orders_1.Orders(this.connection);
|
|
25
27
|
this.orderItems = new order_items_1.OrderItems(this.connection);
|
|
26
28
|
this.priceBooks = new price_books_1.PriceBooks(this.connection);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Connection, SaveResult } from 'jsforce';
|
|
2
|
+
import { Opportunity, OpportunityEntity } from './opportunity.types';
|
|
3
|
+
import { Base } from '../base/base';
|
|
4
|
+
export declare class Opportunities extends Base<OpportunityEntity> {
|
|
5
|
+
private readonly connection;
|
|
6
|
+
private readonly client;
|
|
7
|
+
constructor(connection: Connection);
|
|
8
|
+
getById(id: string): Promise<({
|
|
9
|
+
[name: string]: import("jsforce").SObjectFieldType | null;
|
|
10
|
+
} & import("jsforce").Record) | null>;
|
|
11
|
+
create(data: Partial<Omit<Opportunity, 'Id'>>): Promise<SaveResult>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Opportunities = void 0;
|
|
4
|
+
const opportunity_types_1 = require("./opportunity.types");
|
|
5
|
+
const base_1 = require("../base/base");
|
|
6
|
+
class Opportunities extends base_1.Base {
|
|
7
|
+
constructor(connection) {
|
|
8
|
+
super();
|
|
9
|
+
this.connection = connection;
|
|
10
|
+
this.client = this.connection.sobject(opportunity_types_1.OpportunitiesCollection);
|
|
11
|
+
}
|
|
12
|
+
async getById(id) {
|
|
13
|
+
return this.client.findOne({ Id: id });
|
|
14
|
+
}
|
|
15
|
+
async create(data) {
|
|
16
|
+
return this.client.create(data);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
exports.Opportunities = Opportunities;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { QueryCondition, Schema } from 'jsforce';
|
|
2
|
+
export interface Opportunity {
|
|
3
|
+
[index: string]: any;
|
|
4
|
+
Id: string;
|
|
5
|
+
IsDeleted: boolean;
|
|
6
|
+
AccountId: string;
|
|
7
|
+
Name: string;
|
|
8
|
+
Description?: string;
|
|
9
|
+
StageName: OpportunityStage;
|
|
10
|
+
Amount: number;
|
|
11
|
+
Probability: number;
|
|
12
|
+
CloseDate: Date;
|
|
13
|
+
Type: OpportunityType;
|
|
14
|
+
NextStep?: string;
|
|
15
|
+
LeadSource?: LeadSource;
|
|
16
|
+
IsClosed: boolean;
|
|
17
|
+
IsWon: boolean;
|
|
18
|
+
ForecastCategory: string;
|
|
19
|
+
ForecastCategoryName: string;
|
|
20
|
+
CampaignId?: string;
|
|
21
|
+
HasOpportunityLineItem: boolean;
|
|
22
|
+
Pricebook2Id: string;
|
|
23
|
+
OwnerId: string;
|
|
24
|
+
CreatedDate: string;
|
|
25
|
+
CreatedById: string;
|
|
26
|
+
LastModifiedDate: string;
|
|
27
|
+
LastModifiedById: string;
|
|
28
|
+
SystemModstamp: string;
|
|
29
|
+
LastActivityDate: Date;
|
|
30
|
+
FiscalQuarter: number;
|
|
31
|
+
FiscalYear: number;
|
|
32
|
+
Fiscal: string;
|
|
33
|
+
ContactId?: string;
|
|
34
|
+
LastViewedDate: string;
|
|
35
|
+
LastReferencedDate: string;
|
|
36
|
+
SyncedQuoteId?: string;
|
|
37
|
+
ContractId?: string;
|
|
38
|
+
HasOpenActivity: boolean;
|
|
39
|
+
HasOverdueTask: boolean;
|
|
40
|
+
LastAmountChangedHistoryId: string;
|
|
41
|
+
LastCloseDateChangedHistoryId?: string;
|
|
42
|
+
sbaa__ApprovalStatus__c?: OpportunityApprovalStatus;
|
|
43
|
+
sbaa__ApprovalStep__c?: string;
|
|
44
|
+
sbaa__Approver__c?: string;
|
|
45
|
+
Outreach_Attributed_Finished_Sequences__c?: string;
|
|
46
|
+
Loss_Reason__c?: string;
|
|
47
|
+
Outreach_Last_Touch_Contact__c?: string;
|
|
48
|
+
Outreach_Last_Touch_Sequence__c?: string;
|
|
49
|
+
Outreach_Sequence_Attributed__c: string;
|
|
50
|
+
sbaa__StepApproved__c: boolean;
|
|
51
|
+
sbaa__SubmittedDate__c?: Date;
|
|
52
|
+
sbaa__SubmittedUser__c?: string;
|
|
53
|
+
Estimate_Headcount__c?: string;
|
|
54
|
+
Competitor_Other__c?: string;
|
|
55
|
+
Source__c?: string;
|
|
56
|
+
Referral_Customer__c?: string;
|
|
57
|
+
Competitor__c?: string;
|
|
58
|
+
Est_Onboard_Date__c?: string;
|
|
59
|
+
Managing_Consultant__c?: string;
|
|
60
|
+
Loss_Reason_Notes__c?: string;
|
|
61
|
+
Compliance_Status__c?: string;
|
|
62
|
+
Referral_Contact__c?: string;
|
|
63
|
+
Won_Reasons__c?: string;
|
|
64
|
+
Confidence_Score__c?: string;
|
|
65
|
+
location__c?: string;
|
|
66
|
+
IT_Managment_Model__c?: string;
|
|
67
|
+
Funding_Stage_During_Opportunity__c?: string;
|
|
68
|
+
Onboard_From_Scratch__c?: string;
|
|
69
|
+
Founded__c?: string;
|
|
70
|
+
Sub_Industry__c?: string;
|
|
71
|
+
Industry__c?: string;
|
|
72
|
+
Client_Folder_URL__c?: string;
|
|
73
|
+
Follow_up_later__c: boolean;
|
|
74
|
+
pandadoc__TrackingNumber__c?: string;
|
|
75
|
+
Lead_Source_lvl2__c?: LeadSourceLvl2;
|
|
76
|
+
Lead_Source_lvl3__c?: string;
|
|
77
|
+
Lead_Source_lvl4__c?: string;
|
|
78
|
+
Annual_Contract_Value__c: number;
|
|
79
|
+
Billable_Hours_Per_User_Per_Month__c: number;
|
|
80
|
+
Service_Offering__c?: string;
|
|
81
|
+
SBQQ__AmendedContract__c: string;
|
|
82
|
+
SBQQ__Contracted__c: boolean;
|
|
83
|
+
SBQQ__CreateContractedPrices__c: boolean;
|
|
84
|
+
SBQQ__OrderGroupID__c?: string;
|
|
85
|
+
SBQQ__Ordered__c: boolean;
|
|
86
|
+
SBQQ__PrimaryQuote__c: string;
|
|
87
|
+
SBQQ__QuotePricebookId__c?: string;
|
|
88
|
+
SBQQ__Renewal__c: boolean;
|
|
89
|
+
SBQQ__RenewedContract__c?: string;
|
|
90
|
+
}
|
|
91
|
+
export declare enum OpportunityStage {
|
|
92
|
+
MEETING_BOOKED = "0 - Meeting Booked",
|
|
93
|
+
PROPOSAL_SENT = "1 - Proposal Sent",
|
|
94
|
+
NEGOTIATION = "2 - Negotiation",
|
|
95
|
+
PRE_CLOSE = "3 - Pre-Close",
|
|
96
|
+
CLOSED_WON = "4 - Closed Won",
|
|
97
|
+
CLOSED_LOST = "4a - Closed Lost"
|
|
98
|
+
}
|
|
99
|
+
export declare enum OpportunityApprovalStatus {
|
|
100
|
+
PENDING = "Pending",
|
|
101
|
+
APPROVED = "Approved",
|
|
102
|
+
REJECTED = "Rejected",
|
|
103
|
+
RECALLED = "Recalled"
|
|
104
|
+
}
|
|
105
|
+
export type OpportunityType = 'Existing Business' | 'New Business';
|
|
106
|
+
export type LeadSource = 'Outbound' | 'Referral' | 'Website' | 'Paid' | 'Webinar' | 'LeadIQ';
|
|
107
|
+
export type LeadSourceLvl2 = 'Networking/Events' | 'Prospecting' | 'Employee' | 'Customer' | 'General Network' | 'Sales Network' | 'Partner' | 'Referral Rewards Program' | 'Sponsored Event -- Attendee list' | 'Organization Membership';
|
|
108
|
+
export declare const OpportunitiesCollection = "Opportunity";
|
|
109
|
+
export type OpportunityEntity = typeof OpportunitiesCollection;
|
|
110
|
+
export type OpportunityQuery = QueryCondition<Schema, OpportunityEntity>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OpportunitiesCollection = exports.OpportunityApprovalStatus = exports.OpportunityStage = void 0;
|
|
4
|
+
var OpportunityStage;
|
|
5
|
+
(function (OpportunityStage) {
|
|
6
|
+
OpportunityStage["MEETING_BOOKED"] = "0 - Meeting Booked";
|
|
7
|
+
OpportunityStage["PROPOSAL_SENT"] = "1 - Proposal Sent";
|
|
8
|
+
OpportunityStage["NEGOTIATION"] = "2 - Negotiation";
|
|
9
|
+
OpportunityStage["PRE_CLOSE"] = "3 - Pre-Close";
|
|
10
|
+
OpportunityStage["CLOSED_WON"] = "4 - Closed Won";
|
|
11
|
+
OpportunityStage["CLOSED_LOST"] = "4a - Closed Lost";
|
|
12
|
+
})(OpportunityStage || (exports.OpportunityStage = OpportunityStage = {}));
|
|
13
|
+
var OpportunityApprovalStatus;
|
|
14
|
+
(function (OpportunityApprovalStatus) {
|
|
15
|
+
OpportunityApprovalStatus["PENDING"] = "Pending";
|
|
16
|
+
OpportunityApprovalStatus["APPROVED"] = "Approved";
|
|
17
|
+
OpportunityApprovalStatus["REJECTED"] = "Rejected";
|
|
18
|
+
OpportunityApprovalStatus["RECALLED"] = "Recalled";
|
|
19
|
+
})(OpportunityApprovalStatus || (exports.OpportunityApprovalStatus = OpportunityApprovalStatus = {}));
|
|
20
|
+
exports.OpportunitiesCollection = 'Opportunity';
|
|
@@ -11,6 +11,7 @@ export declare class Quotes extends Base<QuoteEntity> {
|
|
|
11
11
|
getById(id: string): Promise<QuoteWithLineItems | null>;
|
|
12
12
|
getByAccountId(accountId: string, options?: QuoteQuery): Promise<QuoteWithLineItems[]>;
|
|
13
13
|
getOriginal(accountId: string): Promise<Quote | undefined>;
|
|
14
|
+
create(data: Partial<Omit<Quote, 'Id'>>): Promise<SaveResult>;
|
|
14
15
|
update(quoteId: string, query: Partial<Omit<Quote, 'Id'>>): Promise<SaveResult>;
|
|
15
16
|
updateLineItemQuantities(lineItems: UpdateQuoteLineQuantities[]): Promise<SaveResult[]>;
|
|
16
17
|
updateLineItems(lineItems: UpdateQuoteLine[]): Promise<SaveResult[]>;
|
|
@@ -59,6 +59,9 @@ class Quotes extends base_1.Base {
|
|
|
59
59
|
// Return the first in the array
|
|
60
60
|
return quotes.shift();
|
|
61
61
|
}
|
|
62
|
+
async create(data) {
|
|
63
|
+
return this.client.create(data);
|
|
64
|
+
}
|
|
62
65
|
async update(quoteId, query) {
|
|
63
66
|
return this.client.update({ Id: quoteId, ...query });
|
|
64
67
|
}
|