@happyvertical/smrt-affiliates 0.51.32 → 0.51.33
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 +148 -150
- package/dist/index.d.ts.map +1 -0
- package/dist/manifest.json +1 -1
- package/dist/smrt-knowledge.json +4 -4
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -1,150 +1,148 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
readonly
|
|
51
|
-
readonly
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
*
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
*
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
*
|
|
101
|
-
*
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
export
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
*
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
/**
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
*
|
|
134
|
-
*
|
|
135
|
-
*
|
|
136
|
-
*
|
|
137
|
-
* align exactly
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
readonly
|
|
142
|
-
readonly
|
|
143
|
-
readonly
|
|
144
|
-
readonly
|
|
145
|
-
}>;
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
export { }
|
|
1
|
+
/**
|
|
2
|
+
* @happyvertical/smrt-affiliates — DEPRECATED compatibility shim.
|
|
3
|
+
*
|
|
4
|
+
* This package no longer declares any models and owns no persistence. Every
|
|
5
|
+
* export below is a thin alias over the neutral commissions core in
|
|
6
|
+
* `@happyvertical/smrt-sales` (`Earner`, `Commission`, `CommissionPayout`,
|
|
7
|
+
* their collections, and the status vocabularies), kept only so existing
|
|
8
|
+
* imports keep compiling while consumers migrate.
|
|
9
|
+
*
|
|
10
|
+
* Migrate at your own pace:
|
|
11
|
+
*
|
|
12
|
+
* - New code should import from `@happyvertical/smrt-sales` directly
|
|
13
|
+
* (`Earner`, `EarnerCollection`, `Commission`, `CommissionCollection`,
|
|
14
|
+
* `CommissionPayout`, `CommissionPayoutCollection`, plans, earning events,
|
|
15
|
+
* adjustments, services, and money helpers).
|
|
16
|
+
* - The legacy partner ROLES (publisher/salesperson/referrer) are now
|
|
17
|
+
* first-class models: `Referrer` in `@happyvertical/smrt-sales/referrals`
|
|
18
|
+
* and `SalesRepresentative` in `@happyvertical/smrt-sales/crm`, each
|
|
19
|
+
* holding an `earnerId` pointing at the shared financial account.
|
|
20
|
+
* - The data/API migration path (table and column mappings, status mappings,
|
|
21
|
+
* SQL sketches) is documented in this package's `MIGRATION.md`.
|
|
22
|
+
*
|
|
23
|
+
* This shim will be removed in a future major release.
|
|
24
|
+
*
|
|
25
|
+
* @deprecated Use `@happyvertical/smrt-sales` instead. See `MIGRATION.md` in
|
|
26
|
+
* this package for the full data/API migration path.
|
|
27
|
+
* @packageDocumentation
|
|
28
|
+
*/
|
|
29
|
+
import type { CommissionOptions as SalesCommissionOptions, CommissionPayoutOptions as SalesCommissionPayoutOptions, EarnerOptions as SalesEarnerOptions } from '@happyvertical/smrt-sales';
|
|
30
|
+
/**
|
|
31
|
+
* @deprecated Import `Earner` / `EarnerCollection`, `Commission` /
|
|
32
|
+
* `CommissionCollection`, and `CommissionPayout` /
|
|
33
|
+
* `CommissionPayoutCollection` from `@happyvertical/smrt-sales` instead.
|
|
34
|
+
*/
|
|
35
|
+
export { Commission, CommissionCollection, CommissionPayout as Payout, CommissionPayoutCollection as PayoutCollection, Earner as Partner, EarnerCollection as PartnerCollection, } from '@happyvertical/smrt-sales';
|
|
36
|
+
/** @deprecated Use `EarnerOptions` from `@happyvertical/smrt-sales`. */
|
|
37
|
+
export type PartnerOptions = SalesEarnerOptions;
|
|
38
|
+
/** @deprecated Use `CommissionOptions` from `@happyvertical/smrt-sales`. */
|
|
39
|
+
export type CommissionOptions = SalesCommissionOptions;
|
|
40
|
+
/** @deprecated Use `CommissionPayoutOptions` from `@happyvertical/smrt-sales`. */
|
|
41
|
+
export type PayoutOptions = SalesCommissionPayoutOptions;
|
|
42
|
+
/**
|
|
43
|
+
* Legacy partner status values.
|
|
44
|
+
*
|
|
45
|
+
* @deprecated Use the `EarnerStatus` union
|
|
46
|
+
* (`'pending' | 'active' | 'suspended'`) from `@happyvertical/smrt-sales` —
|
|
47
|
+
* the string values align exactly.
|
|
48
|
+
*/
|
|
49
|
+
export declare const PartnerStatus: Readonly<{
|
|
50
|
+
readonly PENDING: "pending";
|
|
51
|
+
readonly ACTIVE: "active";
|
|
52
|
+
readonly SUSPENDED: "suspended";
|
|
53
|
+
}>;
|
|
54
|
+
/** @deprecated Use `EarnerStatus` from `@happyvertical/smrt-sales`. */
|
|
55
|
+
export type PartnerStatus = (typeof PartnerStatus)[keyof typeof PartnerStatus];
|
|
56
|
+
/**
|
|
57
|
+
* Legacy partner role values.
|
|
58
|
+
*
|
|
59
|
+
* @deprecated Partner roles have NO direct equivalent in
|
|
60
|
+
* `@happyvertical/smrt-sales` — roles are now first-class models instead of a
|
|
61
|
+
* JSON array on the financial account: use `Referrer` from
|
|
62
|
+
* `@happyvertical/smrt-sales/referrals` and `SalesRepresentative` from
|
|
63
|
+
* `@happyvertical/smrt-sales/crm` (each holds an `earnerId`); model
|
|
64
|
+
* publisher-style roles in your application domain. See MIGRATION.md.
|
|
65
|
+
*/
|
|
66
|
+
export declare const PartnerType: Readonly<{
|
|
67
|
+
readonly PUBLISHER: "publisher";
|
|
68
|
+
readonly SALESPERSON: "salesperson";
|
|
69
|
+
readonly REFERRER: "referrer";
|
|
70
|
+
}>;
|
|
71
|
+
/**
|
|
72
|
+
* @deprecated Roles are first-class models in `@happyvertical/smrt-sales`
|
|
73
|
+
* (`Referrer`, `SalesRepresentative`); see MIGRATION.md.
|
|
74
|
+
*/
|
|
75
|
+
export type PartnerType = (typeof PartnerType)[keyof typeof PartnerType];
|
|
76
|
+
/**
|
|
77
|
+
* Legacy commission type values.
|
|
78
|
+
*
|
|
79
|
+
* @deprecated Superseded by `CommissionPlan` component keys in
|
|
80
|
+
* `@happyvertical/smrt-sales`: a versioned plan's `components` array replaces
|
|
81
|
+
* the fixed display/referral/sales/parent/overhead taxonomy — each component
|
|
82
|
+
* has its own `key`, `trigger`, `basis`, and `rate`, and every `Commission`
|
|
83
|
+
* records the `componentKey` that produced it. See MIGRATION.md for a worked
|
|
84
|
+
* plan reproducing the legacy waterfall.
|
|
85
|
+
*/
|
|
86
|
+
export declare const CommissionType: Readonly<{
|
|
87
|
+
readonly DISPLAY: "display";
|
|
88
|
+
readonly REFERRAL: "referral";
|
|
89
|
+
readonly SALES: "sales";
|
|
90
|
+
readonly PARENT: "parent";
|
|
91
|
+
readonly OVERHEAD: "overhead";
|
|
92
|
+
}>;
|
|
93
|
+
/**
|
|
94
|
+
* @deprecated Superseded by `CommissionPlan` component keys in
|
|
95
|
+
* `@happyvertical/smrt-sales`; see MIGRATION.md.
|
|
96
|
+
*/
|
|
97
|
+
export type CommissionType = (typeof CommissionType)[keyof typeof CommissionType];
|
|
98
|
+
/**
|
|
99
|
+
* Legacy commission status values.
|
|
100
|
+
*
|
|
101
|
+
* @deprecated Use the `CommissionStatus` union
|
|
102
|
+
* (`'pending' | 'earned' | 'approved' | 'payable' | 'paid'`) from
|
|
103
|
+
* `@happyvertical/smrt-sales`. `PENDING` and `PAID` align; `INCLUDED` has no
|
|
104
|
+
* direct equivalent — the nearest new state is `'payable'` with `payoutId`
|
|
105
|
+
* set (a commission gathered into a payout batch). See MIGRATION.md.
|
|
106
|
+
*/
|
|
107
|
+
export declare const CommissionStatus: Readonly<{
|
|
108
|
+
readonly PENDING: "pending";
|
|
109
|
+
readonly INCLUDED: "included";
|
|
110
|
+
readonly PAID: "paid";
|
|
111
|
+
}>;
|
|
112
|
+
/** @deprecated Use `CommissionStatus` from `@happyvertical/smrt-sales`. */
|
|
113
|
+
export type CommissionStatus = (typeof CommissionStatus)[keyof typeof CommissionStatus];
|
|
114
|
+
/**
|
|
115
|
+
* Legacy payout status values.
|
|
116
|
+
*
|
|
117
|
+
* @deprecated Use the `CommissionPayoutStatus` union
|
|
118
|
+
* (`'pending' | 'approved' | 'processing' | 'completed' | 'failed' |
|
|
119
|
+
* 'rejected'`) from `@happyvertical/smrt-sales` — the legacy value set is a
|
|
120
|
+
* subset (legacy affiliates had no reject) and the shared string values
|
|
121
|
+
* align exactly.
|
|
122
|
+
*/
|
|
123
|
+
export declare const PayoutStatus: Readonly<{
|
|
124
|
+
readonly PENDING: "pending";
|
|
125
|
+
readonly APPROVED: "approved";
|
|
126
|
+
readonly PROCESSING: "processing";
|
|
127
|
+
readonly COMPLETED: "completed";
|
|
128
|
+
readonly FAILED: "failed";
|
|
129
|
+
}>;
|
|
130
|
+
/** @deprecated Use `CommissionPayoutStatus` from `@happyvertical/smrt-sales`. */
|
|
131
|
+
export type PayoutStatus = (typeof PayoutStatus)[keyof typeof PayoutStatus];
|
|
132
|
+
/**
|
|
133
|
+
* Legacy payout method values.
|
|
134
|
+
*
|
|
135
|
+
* @deprecated Use the `PayoutMethod` union
|
|
136
|
+
* (`'bank_transfer' | 'check' | 'paypal' | 'credit' | 'other'`) from
|
|
137
|
+
* `@happyvertical/smrt-sales` — the legacy values align exactly; the new
|
|
138
|
+
* union adds `'other'`.
|
|
139
|
+
*/
|
|
140
|
+
export declare const PayoutMethod: Readonly<{
|
|
141
|
+
readonly BANK_TRANSFER: "bank_transfer";
|
|
142
|
+
readonly CHECK: "check";
|
|
143
|
+
readonly PAYPAL: "paypal";
|
|
144
|
+
readonly CREDIT: "credit";
|
|
145
|
+
}>;
|
|
146
|
+
/** @deprecated Use `PayoutMethod` from `@happyvertical/smrt-sales`. */
|
|
147
|
+
export type PayoutMethod = (typeof PayoutMethod)[keyof typeof PayoutMethod];
|
|
148
|
+
//# sourceMappingURL=index.d.ts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AAM,gBAAgB,GAC1B,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,OAAO,gBAAgB,CAAC,CAAC;AAE3D;;;;;;;;GAQG;AACH,eAAO,MAAM,YAAY;;;;;;EAMd,CAAC;AACZ,iFAAiF;AACjF,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,OAAO,YAAY,CAAC,CAAC;AAE5E;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY;;;;;EAKd,CAAC;AACZ,uEAAuE;AACvE,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,OAAO,YAAY,CAAC,CAAC"}
|
package/dist/manifest.json
CHANGED
package/dist/smrt-knowledge.json
CHANGED
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
"sensitiveFieldsExcluded": true,
|
|
4
4
|
"generatedAt": "1970-01-01T00:00:00.000Z",
|
|
5
5
|
"packageName": "@happyvertical/smrt-affiliates",
|
|
6
|
-
"packageVersion": "0.51.
|
|
6
|
+
"packageVersion": "0.51.33",
|
|
7
7
|
"sourceManifestPath": "dist/manifest.json",
|
|
8
8
|
"agentDocPath": "AGENTS.md",
|
|
9
9
|
"sourceHashes": {
|
|
10
|
-
"manifest": "
|
|
11
|
-
"packageJson": "
|
|
10
|
+
"manifest": "ee741b05e27191d057ed620f7eb3f89c42ee492bd4937cc5a8712ca3b286e99c",
|
|
11
|
+
"packageJson": "ab2031515b99fae80de3c452424222cc9554e8b6130ac4e06befb3e8a9371725",
|
|
12
12
|
"agents": "e88706ca8179c73de1d0cd0b851acac2d2cc1be37cb31c5f9f59529b9de03bf1"
|
|
13
13
|
},
|
|
14
14
|
"exports": [
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"@happyvertical/smrt-sales": "workspace:*",
|
|
21
21
|
"@happyvertical/smrt-vitest": "workspace:*",
|
|
22
22
|
"@types/node": "24.13.6",
|
|
23
|
-
"typescript": "
|
|
23
|
+
"typescript": "6.0.3",
|
|
24
24
|
"vite": "8.1.4",
|
|
25
25
|
"vitest": "4.1.10"
|
|
26
26
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@happyvertical/smrt-affiliates",
|
|
3
|
-
"version": "0.51.
|
|
3
|
+
"version": "0.51.33",
|
|
4
4
|
"description": "DEPRECATED compatibility shim over @happyvertical/smrt-sales — re-exports the legacy Partner/Commission/Payout names. See MIGRATION.md.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -20,12 +20,12 @@
|
|
|
20
20
|
"./manifest.json": "./dist/manifest.json"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@happyvertical/smrt-sales": "0.51.
|
|
23
|
+
"@happyvertical/smrt-sales": "0.51.33"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@happyvertical/smrt-vitest": "0.51.
|
|
26
|
+
"@happyvertical/smrt-vitest": "0.51.33",
|
|
27
27
|
"@types/node": "24.13.6",
|
|
28
|
-
"typescript": "
|
|
28
|
+
"typescript": "6.0.3",
|
|
29
29
|
"vite": "8.1.4",
|
|
30
30
|
"vitest": "4.1.10"
|
|
31
31
|
},
|