@pliancy/salesforce-cpq-sdk 3.23.2 → 3.25.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/lib/price-books/entries/price-book-entries.d.ts +1 -0
- package/dist/lib/price-books/entries/price-book-entries.js +3 -0
- package/dist/lib/price-books/price-books.d.ts +2 -1
- 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 +5 -1
- package/dist/lib/products/products.js +5 -0
- package/package.json +1 -1
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { Connection } from 'jsforce';
|
|
2
2
|
import { FullPriceBook } from './price-book.types';
|
|
3
|
+
import { PriceBookEntries } from './entries/price-book-entries';
|
|
3
4
|
export declare class PriceBooks {
|
|
4
5
|
private readonly connection;
|
|
5
6
|
private readonly client;
|
|
6
|
-
|
|
7
|
+
readonly entries: PriceBookEntries;
|
|
7
8
|
constructor(connection: Connection);
|
|
8
9
|
getByName(name: string): Promise<FullPriceBook | null>;
|
|
9
10
|
}
|
|
@@ -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,13 +1,17 @@
|
|
|
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>;
|
|
11
14
|
getOptionsByProductCode(code: string): Promise<import("./product-options/product-option.types").ProductOption[]>;
|
|
12
15
|
update(id: string, update: Partial<Omit<Product, 'Id'>>, options?: QueryCondition<Schema, ProductEntity>): Promise<SaveResult>;
|
|
16
|
+
create(product: Partial<Omit<Product, 'Id'>>): Promise<SaveResult>;
|
|
13
17
|
}
|
|
@@ -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) {
|
|
@@ -24,5 +26,8 @@ class Products extends base_1.Base {
|
|
|
24
26
|
const query = this.buildQuery({ Id: id, ...update }, options);
|
|
25
27
|
return this.client.update(query);
|
|
26
28
|
}
|
|
29
|
+
async create(product) {
|
|
30
|
+
return this.client.create(product);
|
|
31
|
+
}
|
|
27
32
|
}
|
|
28
33
|
exports.Products = Products;
|