@pliancy/salesforce-cpq-sdk 3.0.0 → 3.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.
@@ -94,7 +94,12 @@ export interface Quote {
94
94
  SBQQ__NetAmount__c: number;
95
95
  SBQQ__RegularAmount__c: number;
96
96
  }
97
- export type QuoteType = 'Quote' | 'Renewal' | 'Amendment' | 'Re-Quote';
97
+ export declare enum QuoteType {
98
+ QUOTE = "Quote",
99
+ RENEWAL = "Renewal",
100
+ AMENDMENT = "Amendment",
101
+ REQUOTE = "Re-Quote"
102
+ }
98
103
  export type QuoteWithLineItems = Quote & {
99
104
  lineItems: QuoteLine[];
100
105
  };
@@ -1,6 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ApprovalStatus = void 0;
3
+ exports.ApprovalStatus = exports.QuoteType = void 0;
4
+ var QuoteType;
5
+ (function (QuoteType) {
6
+ QuoteType["QUOTE"] = "Quote";
7
+ QuoteType["RENEWAL"] = "Renewal";
8
+ QuoteType["AMENDMENT"] = "Amendment";
9
+ QuoteType["REQUOTE"] = "Re-Quote";
10
+ })(QuoteType || (exports.QuoteType = QuoteType = {}));
4
11
  var ApprovalStatus;
5
12
  (function (ApprovalStatus) {
6
13
  ApprovalStatus["APPROVED"] = "Approved";
@@ -70,18 +70,18 @@ class Quotes {
70
70
  try {
71
71
  const { ApprovalProcess } = require('jsforce/lib/process');
72
72
  const approvalProcess = new ApprovalProcess(this.connection);
73
- const submission = (await approvalProcess.submit(quoteId, comments, {
73
+ const sResult = (await approvalProcess.submit(quoteId, comments, {
74
74
  skipEntryCriteria: true,
75
75
  }));
76
- if ((submission === null || submission === void 0 ? void 0 : submission.newWorkItemIds) && (submission === null || submission === void 0 ? void 0 : submission.newWorkItemIds.length)) {
77
- const workItemId = submission.newWorkItemIds[0];
78
- if (!workItemId)
76
+ if ((sResult === null || sResult === void 0 ? void 0 : sResult.newWorkItemIds) && (sResult === null || sResult === void 0 ? void 0 : sResult.newWorkItemIds.length)) {
77
+ const id = sResult.newWorkItemIds[0];
78
+ if (!id)
79
79
  return { success: false, errors: ['No workItemId returned'] };
80
- await approvalProcess.approve(workItemId);
81
- return { success: true, workItemId };
80
+ await approvalProcess.approve(id);
81
+ return { success: true, workItemId: id };
82
82
  }
83
83
  else {
84
- return { success: false, errors: submission.errors };
84
+ return { success: false, errors: sResult.errors };
85
85
  }
86
86
  }
87
87
  catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pliancy/salesforce-cpq-sdk",
3
- "version": "3.0.0",
3
+ "version": "3.2.0",
4
4
  "main": "dist/index.js",
5
5
  "license": "MIT",
6
6
  "description": "Salesforce CPQ SDK for Node.js",