@pliancy/salesforce-cpq-sdk 3.24.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/products/product-features/product-feature.types.d.ts +23 -0
- package/dist/lib/products/product-features/product-feature.types.js +2 -0
- package/dist/lib/products/product-features/product-features.d.ts +9 -0
- package/dist/lib/products/product-features/product-features.js +16 -0
- package/dist/lib/products/product-options/product-option.types.d.ts +4 -0
- package/dist/lib/products/product-options/product-option.types.js +2 -0
- package/dist/lib/products/product-options/product-options.d.ts +2 -0
- package/dist/lib/products/product-options/product-options.js +16 -0
- package/dist/lib/products/product.types.d.ts +4 -2
- package/dist/lib/products/products.d.ts +4 -1
- package/dist/lib/products/products.js +2 -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';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export interface ProductFeature {
|
|
2
|
+
[index: string]: any;
|
|
3
|
+
Id: string;
|
|
4
|
+
OwnerId: string;
|
|
5
|
+
IsDeleted: boolean;
|
|
6
|
+
Name: FeatureName;
|
|
7
|
+
CreatedDate: string;
|
|
8
|
+
CreatedById: string;
|
|
9
|
+
LastModifiedDate: string;
|
|
10
|
+
LastModifiedById: string;
|
|
11
|
+
SystemModstamp: string;
|
|
12
|
+
SBQQ__Category__c: string;
|
|
13
|
+
SBQQ__ConfigurationFieldSet__c?: string;
|
|
14
|
+
SBQQ__ConfiguredSKU__c: string;
|
|
15
|
+
SBQQ__DiscountSchedule__c?: string;
|
|
16
|
+
SBQQ__DynamicProductFilterFieldSet__c?: string;
|
|
17
|
+
SBQQ__DynamicProductLookupFieldSet__c?: string;
|
|
18
|
+
SBQQ__MaxOptionCount__c?: string;
|
|
19
|
+
SBQQ__MinOptionCount__c: number;
|
|
20
|
+
SBQQ__Number__c: number;
|
|
21
|
+
SBQQ__OptionSelectionMethod__c: string;
|
|
22
|
+
}
|
|
23
|
+
export type FeatureName = 'Subscription' | 'Addon' | 'Renewal' | 'Upgrade';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Connection } from 'jsforce';
|
|
2
|
+
import { ProductFeature } from './product-feature.types';
|
|
3
|
+
export declare class ProductFeatures {
|
|
4
|
+
private readonly connection;
|
|
5
|
+
private readonly client;
|
|
6
|
+
constructor(connection: Connection);
|
|
7
|
+
getById(Id: string): Promise<ProductFeature | null>;
|
|
8
|
+
getByName(Name: string): Promise<ProductFeature | null>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ProductFeatures = void 0;
|
|
4
|
+
class ProductFeatures {
|
|
5
|
+
constructor(connection) {
|
|
6
|
+
this.connection = connection;
|
|
7
|
+
this.client = this.connection.sobject('SBQQ__ProductFeature__c');
|
|
8
|
+
}
|
|
9
|
+
async getById(Id) {
|
|
10
|
+
return this.client.findOne({ Id });
|
|
11
|
+
}
|
|
12
|
+
async getByName(Name) {
|
|
13
|
+
return this.client.findOne({ Name });
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.ProductFeatures = ProductFeatures;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { QueryCondition, Schema } from 'jsforce';
|
|
1
2
|
export interface ProductOption {
|
|
2
3
|
[index: string]: any;
|
|
3
4
|
Id: string;
|
|
@@ -48,3 +49,6 @@ export interface ProductOption {
|
|
|
48
49
|
SBQQ__ProductQuantityScale__c?: unknown;
|
|
49
50
|
SBQQ__ProductSubscriptionPricing__c: string;
|
|
50
51
|
}
|
|
52
|
+
export declare const ProductOptionsCollection = "SBQQ__ProductOption__c";
|
|
53
|
+
export type ProductOptionEntity = typeof ProductOptionsCollection;
|
|
54
|
+
export type ProductOptionQuery = QueryCondition<Schema, ProductOptionEntity>;
|
|
@@ -5,4 +5,6 @@ export declare class ProductOptions {
|
|
|
5
5
|
private readonly client;
|
|
6
6
|
constructor(connection: Connection);
|
|
7
7
|
getByProductCode(code: string): Promise<ProductOption[]>;
|
|
8
|
+
getChildren(parentProductId: string): Promise<ProductOption[]>;
|
|
9
|
+
createChildOption(productId: string, parentProductId: string, sortOrder?: number, options?: Partial<Omit<ProductOption, 'Id'>>): Promise<import("jsforce").SaveResult>;
|
|
8
10
|
}
|
|
@@ -9,5 +9,21 @@ class ProductOptions {
|
|
|
9
9
|
async getByProductCode(code) {
|
|
10
10
|
return this.client.find({ SBQQ__ProductCode__c: code });
|
|
11
11
|
}
|
|
12
|
+
async getChildren(parentProductId) {
|
|
13
|
+
return this.client.find({
|
|
14
|
+
SBQQ__ConfiguredSKU__c: parentProductId,
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
async createChildOption(productId, parentProductId, sortOrder = 0, options) {
|
|
18
|
+
const query = {
|
|
19
|
+
SBQQ__ConfiguredSKU__c: parentProductId,
|
|
20
|
+
SBQQ__OptionalSKU__c: productId,
|
|
21
|
+
SBQQ__Number__c: sortOrder,
|
|
22
|
+
SBQQ__Type__c: 'Related Product',
|
|
23
|
+
};
|
|
24
|
+
if (options)
|
|
25
|
+
Object.assign(query, options);
|
|
26
|
+
return this.client.create(query);
|
|
27
|
+
}
|
|
12
28
|
}
|
|
13
29
|
exports.ProductOptions = ProductOptions;
|
|
@@ -33,7 +33,7 @@ export interface Product {
|
|
|
33
33
|
SBQQ__ConfigurationFieldSet__c?: string;
|
|
34
34
|
SBQQ__ConfigurationFields__c?: string;
|
|
35
35
|
SBQQ__ConfigurationFormTitle__c?: string;
|
|
36
|
-
SBQQ__ConfigurationType__c?:
|
|
36
|
+
SBQQ__ConfigurationType__c?: ProductConfigurationType;
|
|
37
37
|
SBQQ__ConfigurationValidator__c?: string;
|
|
38
38
|
SBQQ__ConfiguredCodePattern__c?: string;
|
|
39
39
|
SBQQ__ConfiguredDescriptionPattern__c?: string;
|
|
@@ -90,7 +90,9 @@ export interface Product {
|
|
|
90
90
|
SBQQ__UpgradeRatio__c?: string;
|
|
91
91
|
SBQQ__UpgradeSource__c?: string;
|
|
92
92
|
SBQQ__UpgradeTarget__c?: string;
|
|
93
|
-
SBQQ__ConfigurationEvent__c?:
|
|
93
|
+
SBQQ__ConfigurationEvent__c?: ProductConfigurationEvent;
|
|
94
94
|
}
|
|
95
95
|
export declare const ProductsCollection = "Product2";
|
|
96
96
|
export type ProductEntity = typeof ProductsCollection;
|
|
97
|
+
export type ProductConfigurationType = 'Allowed' | 'Required' | 'Disabled';
|
|
98
|
+
export type ProductConfigurationEvent = 'Always' | 'Add' | 'Edit';
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { Connection, QueryCondition, SaveResult, Schema } from 'jsforce';
|
|
2
2
|
import { Product, ProductEntity } from './product.types';
|
|
3
|
+
import { ProductOptions } from './product-options/product-options';
|
|
3
4
|
import { Base } from '../base/base';
|
|
5
|
+
import { ProductFeatures } from './product-features/product-features';
|
|
4
6
|
export declare class Products extends Base<ProductEntity> {
|
|
5
7
|
private readonly connection;
|
|
6
8
|
private readonly client;
|
|
7
|
-
|
|
9
|
+
readonly features: ProductFeatures;
|
|
10
|
+
readonly options: ProductOptions;
|
|
8
11
|
constructor(connection: Connection);
|
|
9
12
|
get(query: QueryCondition<Schema, ProductEntity>): Promise<Product[]>;
|
|
10
13
|
getById(id: string): Promise<Product | null>;
|
|
@@ -4,11 +4,13 @@ exports.Products = void 0;
|
|
|
4
4
|
const product_types_1 = require("./product.types");
|
|
5
5
|
const product_options_1 = require("./product-options/product-options");
|
|
6
6
|
const base_1 = require("../base/base");
|
|
7
|
+
const product_features_1 = require("./product-features/product-features");
|
|
7
8
|
class Products extends base_1.Base {
|
|
8
9
|
constructor(connection) {
|
|
9
10
|
super();
|
|
10
11
|
this.connection = connection;
|
|
11
12
|
this.client = this.connection.sobject(product_types_1.ProductsCollection);
|
|
13
|
+
this.features = new product_features_1.ProductFeatures(this.connection);
|
|
12
14
|
this.options = new product_options_1.ProductOptions(this.connection);
|
|
13
15
|
}
|
|
14
16
|
async get(query) {
|
|
@@ -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
|
}
|