@pliancy/salesforce-cpq-sdk 3.21.0 → 3.23.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.
@@ -92,3 +92,5 @@ export interface Product {
92
92
  SBQQ__UpgradeTarget__c?: string;
93
93
  SBQQ__ConfigurationEvent__c?: string;
94
94
  }
95
+ export declare const ProductsCollection = "Product2";
96
+ export type ProductEntity = typeof ProductsCollection;
@@ -1,2 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ProductsCollection = void 0;
4
+ exports.ProductsCollection = 'Product2';
@@ -1,11 +1,13 @@
1
- import { Connection, QueryCondition, Schema } from 'jsforce';
2
- import { Product } from './product.types';
3
- export declare class Products {
1
+ import { Connection, QueryCondition, SaveResult, Schema } from 'jsforce';
2
+ import { Product, ProductEntity } from './product.types';
3
+ import { Base } from '../base/base';
4
+ export declare class Products extends Base<ProductEntity> {
4
5
  private readonly connection;
5
6
  private readonly client;
6
7
  private readonly options;
7
8
  constructor(connection: Connection);
8
- get(query: QueryCondition<Schema, 'Product2'>): Promise<Product[]>;
9
+ get(query: QueryCondition<Schema, ProductEntity>): Promise<Product[]>;
9
10
  getById(id: string): Promise<Product | null>;
10
11
  getOptionsByProductCode(code: string): Promise<import("./product-options/product-option.types").ProductOption[]>;
12
+ update(id: string, update: Partial<Omit<Product, 'Id'>>, options?: QueryCondition<Schema, ProductEntity>): Promise<SaveResult>;
11
13
  }
@@ -1,11 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Products = void 0;
4
+ const product_types_1 = require("./product.types");
4
5
  const product_options_1 = require("./product-options/product-options");
5
- class Products {
6
+ const base_1 = require("../base/base");
7
+ class Products extends base_1.Base {
6
8
  constructor(connection) {
9
+ super();
7
10
  this.connection = connection;
8
- this.client = this.connection.sobject('Product2');
11
+ this.client = this.connection.sobject(product_types_1.ProductsCollection);
9
12
  this.options = new product_options_1.ProductOptions(this.connection);
10
13
  }
11
14
  async get(query) {
@@ -14,8 +17,12 @@ class Products {
14
17
  async getById(id) {
15
18
  return this.client.findOne({ Id: id });
16
19
  }
17
- getOptionsByProductCode(code) {
20
+ async getOptionsByProductCode(code) {
18
21
  return this.options.getByProductCode(code);
19
22
  }
23
+ async update(id, update, options) {
24
+ const query = this.buildQuery({ Id: id, ...update }, options);
25
+ return this.client.update(query);
26
+ }
20
27
  }
21
28
  exports.Products = Products;
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@pliancy/salesforce-cpq-sdk",
3
- "version": "3.21.0",
3
+ "version": "3.23.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.6",
10
- "tslib": "2.6.2"
9
+ "jsforce": "3.8.2",
10
+ "tslib": "2.8.1"
11
11
  },
12
12
  "files": [
13
13
  "dist"
@@ -21,7 +21,7 @@
21
21
  "@pliancy/eslint-config-ts": "1.1.1",
22
22
  "@pliancy/semantic-release-config-npm": "2.2.0",
23
23
  "@types/jest": "29.5.14",
24
- "@types/node": "22.10.2",
24
+ "@types/node": "22.15.30",
25
25
  "commitizen": "4.3.1",
26
26
  "cz-conventional-changelog": "3.3.0",
27
27
  "husky": "9.1.7",
@@ -29,8 +29,8 @@
29
29
  "npm-run-all2": "7.0.2",
30
30
  "pinst": "3.0.0",
31
31
  "rimraf": "6.0.1",
32
- "ts-jest": "29.2.5",
33
- "typescript": "5.7.2"
32
+ "ts-jest": "29.3.4",
33
+ "typescript": "5.8.3"
34
34
  },
35
35
  "scripts": {
36
36
  "build": "run-s -l clean test tsc",
@@ -53,8 +53,8 @@
53
53
  "email": "justin.mcmahon@pliancy.com"
54
54
  },
55
55
  "volta": {
56
- "node": "22.12.0",
57
- "yarn": "1.22.21"
56
+ "node": "22.16.0",
57
+ "yarn": "1.22.22"
58
58
  },
59
59
  "config": {
60
60
  "commitizen": {