@happyvertical/smrt-sales 0.57.37 → 0.57.39
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/agreements/models/Agreement.d.ts +2 -2
- package/dist/agreements/models/Agreement.d.ts.map +1 -1
- package/dist/agreements/models/AgreementExecution.d.ts +2 -2
- package/dist/agreements/models/AgreementExecution.d.ts.map +1 -1
- package/dist/agreements/models/AgreementExecutionEvent.d.ts +2 -2
- package/dist/agreements/models/AgreementExecutionEvent.d.ts.map +1 -1
- package/dist/agreements/models/ExecutedAgreement.d.ts +2 -2
- package/dist/agreements/models/ExecutedAgreement.d.ts.map +1 -1
- package/dist/agreements.js +2 -2
- package/dist/chunks/__smrt-register__-B1Rg_X-v.js +6 -0
- package/dist/chunks/__smrt-register__-B1Rg_X-v.js.map +1 -0
- package/dist/chunks/{agreements-RsyRLeDn.js → agreements-C8rxIVGB.js} +9 -9
- package/dist/chunks/agreements-C8rxIVGB.js.map +1 -0
- package/dist/chunks/{commissions-DSVGf1ZX.js → commissions-B1WnBKsn.js} +15 -15
- package/dist/chunks/commissions-B1WnBKsn.js.map +1 -0
- package/dist/chunks/{crm-BENK-hHd.js → crm-Bzk65hv_.js} +13 -13
- package/dist/chunks/crm-Bzk65hv_.js.map +1 -0
- package/dist/chunks/{referrals-o8qZG5fw.js → referrals-DE0tKm5G.js} +12 -12
- package/dist/chunks/referrals-DE0tKm5G.js.map +1 -0
- package/dist/commissions/models/Commission.d.ts +2 -2
- package/dist/commissions/models/Commission.d.ts.map +1 -1
- package/dist/commissions/models/CommissionAdjustment.d.ts +2 -2
- package/dist/commissions/models/CommissionAdjustment.d.ts.map +1 -1
- package/dist/commissions/models/CommissionPayout.d.ts +2 -2
- package/dist/commissions/models/CommissionPayout.d.ts.map +1 -1
- package/dist/commissions/models/CommissionPlan.d.ts +2 -2
- package/dist/commissions/models/CommissionPlan.d.ts.map +1 -1
- package/dist/commissions/models/Earner.d.ts +2 -2
- package/dist/commissions/models/Earner.d.ts.map +1 -1
- package/dist/commissions/models/EarnerSourceAttribution.d.ts +2 -2
- package/dist/commissions/models/EarnerSourceAttribution.d.ts.map +1 -1
- package/dist/commissions/models/EarningEvent.d.ts +2 -2
- package/dist/commissions/models/EarningEvent.d.ts.map +1 -1
- package/dist/commissions.js +2 -2
- package/dist/crm/models/Lead.d.ts +2 -2
- package/dist/crm/models/Lead.d.ts.map +1 -1
- package/dist/crm/models/Opportunity.d.ts +2 -2
- package/dist/crm/models/Opportunity.d.ts.map +1 -1
- package/dist/crm/models/OpportunityConversion.d.ts +2 -2
- package/dist/crm/models/OpportunityConversion.d.ts.map +1 -1
- package/dist/crm/models/SalesActivity.d.ts +2 -2
- package/dist/crm/models/SalesActivity.d.ts.map +1 -1
- package/dist/crm/models/SalesGovernanceEvent.d.ts +2 -2
- package/dist/crm/models/SalesGovernanceEvent.d.ts.map +1 -1
- package/dist/crm/models/SalesGovernanceState.d.ts +2 -2
- package/dist/crm/models/SalesGovernanceState.d.ts.map +1 -1
- package/dist/crm.js +2 -2
- package/dist/index.js +5 -5
- package/dist/manifest.json +155 -23
- package/dist/referrals/models/AttributionPolicy.d.ts +2 -2
- package/dist/referrals/models/AttributionPolicy.d.ts.map +1 -1
- package/dist/referrals/models/Referral.d.ts +2 -2
- package/dist/referrals/models/Referral.d.ts.map +1 -1
- package/dist/referrals/models/ReferralAgreement.d.ts +2 -2
- package/dist/referrals/models/ReferralAgreement.d.ts.map +1 -1
- package/dist/referrals/models/ReferralLink.d.ts +2 -2
- package/dist/referrals/models/ReferralLink.d.ts.map +1 -1
- package/dist/referrals/models/ReferralTermSnapshot.d.ts +2 -2
- package/dist/referrals/models/ReferralTermSnapshot.d.ts.map +1 -1
- package/dist/referrals.js +2 -2
- package/dist/smrt-knowledge.json +69 -3
- package/package.json +8 -8
- package/dist/chunks/__smrt-register__-o8Dm_Ogl.js +0 -6
- package/dist/chunks/__smrt-register__-o8Dm_Ogl.js.map +0 -1
- package/dist/chunks/agreements-RsyRLeDn.js.map +0 -1
- package/dist/chunks/commissions-DSVGf1ZX.js.map +0 -1
- package/dist/chunks/crm-BENK-hHd.js.map +0 -1
- package/dist/chunks/referrals-o8qZG5fw.js.map +0 -1
|
@@ -146,10 +146,10 @@ var Lead = class extends SmrtObject {
|
|
|
146
146
|
* `status` (e.g. un-merging a merged lead) is rejected here regardless of
|
|
147
147
|
* how the instance was constructed.
|
|
148
148
|
*/
|
|
149
|
-
async save() {
|
|
149
|
+
async save(options) {
|
|
150
150
|
const prior = await this.resolvePriorStatus();
|
|
151
151
|
this.assertLeadStatusTransition(prior);
|
|
152
|
-
const result = await super.save();
|
|
152
|
+
const result = await super.save(options);
|
|
153
153
|
loadedLeadStatus.set(this, this.status);
|
|
154
154
|
return result;
|
|
155
155
|
}
|
|
@@ -440,10 +440,10 @@ var Opportunity = class extends SmrtObject {
|
|
|
440
440
|
* `status` (e.g. re-opening a lost deal) is rejected here regardless of
|
|
441
441
|
* how the instance was constructed.
|
|
442
442
|
*/
|
|
443
|
-
async save() {
|
|
443
|
+
async save(options) {
|
|
444
444
|
const prior = await this.resolvePriorStatus();
|
|
445
445
|
this.assertOpportunityStatusTransition(prior);
|
|
446
|
-
const result = await super.save();
|
|
446
|
+
const result = await super.save(options);
|
|
447
447
|
loadedOpportunityStatus.set(this, this.status);
|
|
448
448
|
return result;
|
|
449
449
|
}
|
|
@@ -686,7 +686,7 @@ var SalesActivity = class extends SmrtObject {
|
|
|
686
686
|
* opportunity and imported-history completion flows; only the Lead
|
|
687
687
|
* follow-up workflow owns its task completion transition.
|
|
688
688
|
*/
|
|
689
|
-
async save() {
|
|
689
|
+
async save(options) {
|
|
690
690
|
const persisted = await this.resolvePersistedState();
|
|
691
691
|
const priorCompletedAt = persisted?.completedAt;
|
|
692
692
|
const requestedCompletedAt = this.completedAt;
|
|
@@ -694,7 +694,7 @@ var SalesActivity = class extends SmrtObject {
|
|
|
694
694
|
if (priorCompletedAt && !sameInstant(priorCompletedAt, requestedCompletedAt)) throw new Error("SalesActivity.completedAt is monotonic and cannot be changed once set.");
|
|
695
695
|
if (persisted?.isLeadTask && !isLeadTask(this)) throw new Error("SalesActivity Lead task identity cannot be changed once persisted.");
|
|
696
696
|
if ((persisted?.isLeadTask === true || isLeadTask(this)) && isNewCompletion && !workflowCompletionPermits.has(this)) throw new Error("SalesActivity.completedAt may only be set through LeadWorkflowService.");
|
|
697
|
-
const result = await super.save();
|
|
697
|
+
const result = await super.save(options);
|
|
698
698
|
workflowCompletionPermits.delete(this);
|
|
699
699
|
return result;
|
|
700
700
|
}
|
|
@@ -1680,14 +1680,14 @@ var OpportunityConversion = class extends SmrtObject {
|
|
|
1680
1680
|
* `OpportunityConversionCollection.recordConversion()`, which finds
|
|
1681
1681
|
* first and reports `{ created: false }`.
|
|
1682
1682
|
*/
|
|
1683
|
-
async save() {
|
|
1683
|
+
async save(options) {
|
|
1684
1684
|
if (this.opportunityId && this.targetKind && this.targetId) try {
|
|
1685
1685
|
const res = await this.db.query(`SELECT id FROM ${this.tableName} WHERE opportunity_id = $1 AND target_kind = $2 AND target_id = $3`, this.opportunityId, this.targetKind, this.targetId);
|
|
1686
1686
|
if ((Array.isArray(res) ? res : res.rows ?? []).find((row) => row.id !== this.id)) throw new Error(`OpportunityConversion ${this.opportunityId}/${this.targetKind}/${this.targetId}: this conversion link already exists \u2014 conversion links are append-only. Use OpportunityConversionCollection.recordConversion() for idempotent linking.`);
|
|
1687
1687
|
} catch (error) {
|
|
1688
1688
|
if (error instanceof Error && error.message.includes("append-only")) throw error;
|
|
1689
1689
|
}
|
|
1690
|
-
return await super.save();
|
|
1690
|
+
return await super.save(options);
|
|
1691
1691
|
}
|
|
1692
1692
|
};
|
|
1693
1693
|
__publicField$2(OpportunityConversion, "__smrtPackage__", "@happyvertical/smrt-sales");
|
|
@@ -1812,11 +1812,11 @@ var SalesGovernanceEvent = class extends SmrtObject {
|
|
|
1812
1812
|
if (await this.isSaved()) snapshots.set(this, this.snapshot());
|
|
1813
1813
|
return this;
|
|
1814
1814
|
}
|
|
1815
|
-
async save() {
|
|
1815
|
+
async save(options) {
|
|
1816
1816
|
const previous = snapshots.get(this);
|
|
1817
1817
|
if (previous !== void 0 && previous !== this.snapshot()) throw new Error("Sales governance events are immutable");
|
|
1818
1818
|
assertGovernanceWrite(this.db);
|
|
1819
|
-
await super.save();
|
|
1819
|
+
await super.save(options);
|
|
1820
1820
|
snapshots.set(this, this.snapshot());
|
|
1821
1821
|
return this;
|
|
1822
1822
|
}
|
|
@@ -1870,9 +1870,9 @@ var SalesGovernanceState = class extends SmrtObject {
|
|
|
1870
1870
|
if (options.revision !== void 0) this.revision = options.revision;
|
|
1871
1871
|
if (options.payload !== void 0) this.payload = options.payload;
|
|
1872
1872
|
}
|
|
1873
|
-
async save() {
|
|
1873
|
+
async save(options) {
|
|
1874
1874
|
assertGovernanceWrite(this.db);
|
|
1875
|
-
return super.save();
|
|
1875
|
+
return super.save(options);
|
|
1876
1876
|
}
|
|
1877
1877
|
async delete() {
|
|
1878
1878
|
throw new Error("Sales governance state is service-owned");
|
|
@@ -3540,4 +3540,4 @@ function normalizeIdentityEnvelope(value) {
|
|
|
3540
3540
|
//#endregion
|
|
3541
3541
|
export { OPPORTUNITY_STATUSES as A, SalesActivity as C, DEFAULT_PIPELINE_KEY as D, Opportunity as E, Lead as F, SALES_ACTIVITY_KINDS as M, SALES_ACTIVITY_SUBJECT_KINDS as N, DEFAULT_PIPELINE_STAGES as O, SALES_REPRESENTATIVE_STATUSES as P, SalesActivityCollection as S, PipelineStage as T, SalesRepresentativeCollection as _, LeadWorkflowValidationError as a, PipelineDefinition as b, LeadConversionService as c, SalesGovernanceState as d, SalesGovernanceEventCollection as f, LeadCollection as g, OpportunityConversion as h, LeadWorkflowService as i, PIPELINE_STATUSES as j, LEAD_STATUSES as k, SalesPipelineRecipe as l, OpportunityConversionCollection as m, SalesGovernanceService as n, MAX_LEAD_WORKFLOW_TEXT_LENGTH as o, SalesGovernanceEvent as p, LEAD_HUMAN_ACTIVITY_KINDS as r, projectLeadWorkQueue as s, SalesGovernanceError as t, SalesGovernanceStateCollection as u, SalesRepresentative as v, PipelineStageCollection as w, OpportunityCollection as x, PipelineDefinitionCollection as y };
|
|
3542
3542
|
|
|
3543
|
-
//# sourceMappingURL=crm-
|
|
3543
|
+
//# sourceMappingURL=crm-Bzk65hv_.js.map
|