@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 CHANGED
@@ -1,150 +1,148 @@
1
- import { Commission } from '@happyvertical/smrt-sales';
2
- import { CommissionCollection } from '@happyvertical/smrt-sales';
3
- import { CommissionOptions as CommissionOptions_2 } from '@happyvertical/smrt-sales';
4
- import { CommissionPayoutOptions } from '@happyvertical/smrt-sales';
5
- import { EarnerOptions } from '@happyvertical/smrt-sales';
6
- import { Earner as Partner } from '@happyvertical/smrt-sales';
7
- import { EarnerCollection as PartnerCollection } from '@happyvertical/smrt-sales';
8
- import { CommissionPayout as Payout } from '@happyvertical/smrt-sales';
9
- import { CommissionPayoutCollection as PayoutCollection } from '@happyvertical/smrt-sales';
10
-
11
- export { Commission }
12
-
13
- export { CommissionCollection }
14
-
15
- /** @deprecated Use `CommissionOptions` from `@happyvertical/smrt-sales`. */
16
- export declare type CommissionOptions = CommissionOptions_2;
17
-
18
- /**
19
- * Legacy commission status values.
20
- *
21
- * @deprecated Use the `CommissionStatus` union
22
- * (`'pending' | 'earned' | 'approved' | 'payable' | 'paid'`) from
23
- * `@happyvertical/smrt-sales`. `PENDING` and `PAID` align; `INCLUDED` has no
24
- * direct equivalent — the nearest new state is `'payable'` with `payoutId`
25
- * set (a commission gathered into a payout batch). See MIGRATION.md.
26
- */
27
- export declare const CommissionStatus: Readonly<{
28
- readonly PENDING: "pending";
29
- readonly INCLUDED: "included";
30
- readonly PAID: "paid";
31
- }>;
32
-
33
- /** @deprecated Use `CommissionStatus` from `@happyvertical/smrt-sales`. */
34
- export declare type CommissionStatus = (typeof CommissionStatus)[keyof typeof CommissionStatus];
35
-
36
- /**
37
- * Legacy commission type values.
38
- *
39
- * @deprecated Superseded by `CommissionPlan` component keys in
40
- * `@happyvertical/smrt-sales`: a versioned plan's `components` array replaces
41
- * the fixed display/referral/sales/parent/overhead taxonomy — each component
42
- * has its own `key`, `trigger`, `basis`, and `rate`, and every `Commission`
43
- * records the `componentKey` that produced it. See MIGRATION.md for a worked
44
- * plan reproducing the legacy waterfall.
45
- */
46
- export declare const CommissionType: Readonly<{
47
- readonly DISPLAY: "display";
48
- readonly REFERRAL: "referral";
49
- readonly SALES: "sales";
50
- readonly PARENT: "parent";
51
- readonly OVERHEAD: "overhead";
52
- }>;
53
-
54
- /**
55
- * @deprecated Superseded by `CommissionPlan` component keys in
56
- * `@happyvertical/smrt-sales`; see MIGRATION.md.
57
- */
58
- export declare type CommissionType = (typeof CommissionType)[keyof typeof CommissionType];
59
-
60
- export { Partner }
61
-
62
- export { PartnerCollection }
63
-
64
- /** @deprecated Use `EarnerOptions` from `@happyvertical/smrt-sales`. */
65
- export declare type PartnerOptions = EarnerOptions;
66
-
67
- /**
68
- * Legacy partner status values.
69
- *
70
- * @deprecated Use the `EarnerStatus` union
71
- * (`'pending' | 'active' | 'suspended'`) from `@happyvertical/smrt-sales` —
72
- * the string values align exactly.
73
- */
74
- export declare const PartnerStatus: Readonly<{
75
- readonly PENDING: "pending";
76
- readonly ACTIVE: "active";
77
- readonly SUSPENDED: "suspended";
78
- }>;
79
-
80
- /** @deprecated Use `EarnerStatus` from `@happyvertical/smrt-sales`. */
81
- export declare type PartnerStatus = (typeof PartnerStatus)[keyof typeof PartnerStatus];
82
-
83
- /**
84
- * Legacy partner role values.
85
- *
86
- * @deprecated Partner roles have NO direct equivalent in
87
- * `@happyvertical/smrt-sales` — roles are now first-class models instead of a
88
- * JSON array on the financial account: use `Referrer` from
89
- * `@happyvertical/smrt-sales/referrals` and `SalesRepresentative` from
90
- * `@happyvertical/smrt-sales/crm` (each holds an `earnerId`); model
91
- * publisher-style roles in your application domain. See MIGRATION.md.
92
- */
93
- export declare const PartnerType: Readonly<{
94
- readonly PUBLISHER: "publisher";
95
- readonly SALESPERSON: "salesperson";
96
- readonly REFERRER: "referrer";
97
- }>;
98
-
99
- /**
100
- * @deprecated Roles are first-class models in `@happyvertical/smrt-sales`
101
- * (`Referrer`, `SalesRepresentative`); see MIGRATION.md.
102
- */
103
- export declare type PartnerType = (typeof PartnerType)[keyof typeof PartnerType];
104
-
105
- export { Payout }
106
-
107
- export { PayoutCollection }
108
-
109
- /**
110
- * Legacy payout method values.
111
- *
112
- * @deprecated Use the `PayoutMethod` union
113
- * (`'bank_transfer' | 'check' | 'paypal' | 'credit' | 'other'`) from
114
- * `@happyvertical/smrt-sales` — the legacy values align exactly; the new
115
- * union adds `'other'`.
116
- */
117
- export declare const PayoutMethod: Readonly<{
118
- readonly BANK_TRANSFER: "bank_transfer";
119
- readonly CHECK: "check";
120
- readonly PAYPAL: "paypal";
121
- readonly CREDIT: "credit";
122
- }>;
123
-
124
- /** @deprecated Use `PayoutMethod` from `@happyvertical/smrt-sales`. */
125
- export declare type PayoutMethod = (typeof PayoutMethod)[keyof typeof PayoutMethod];
126
-
127
- /** @deprecated Use `CommissionPayoutOptions` from `@happyvertical/smrt-sales`. */
128
- export declare type PayoutOptions = CommissionPayoutOptions;
129
-
130
- /**
131
- * Legacy payout status values.
132
- *
133
- * @deprecated Use the `CommissionPayoutStatus` union
134
- * (`'pending' | 'approved' | 'processing' | 'completed' | 'failed' |
135
- * 'rejected'`) from `@happyvertical/smrt-sales` — the legacy value set is a
136
- * subset (legacy affiliates had no reject) and the shared string values
137
- * align exactly.
138
- */
139
- export declare const PayoutStatus: Readonly<{
140
- readonly PENDING: "pending";
141
- readonly APPROVED: "approved";
142
- readonly PROCESSING: "processing";
143
- readonly COMPLETED: "completed";
144
- readonly FAILED: "failed";
145
- }>;
146
-
147
- /** @deprecated Use `CommissionPayoutStatus` from `@happyvertical/smrt-sales`. */
148
- export declare type PayoutStatus = (typeof PayoutStatus)[keyof typeof PayoutStatus];
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.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,KAAK,EACV,iBAAiB,IAAI,sBAAsB,EAC3C,uBAAuB,IAAI,4BAA4B,EACvD,aAAa,IAAI,kBAAkB,EACpC,MAAM,2BAA2B,CAAC;AAYnC;;;;GAIG;AACH,OAAO,EACL,UAAU,EACV,oBAAoB,EACpB,gBAAgB,IAAI,MAAM,EAC1B,0BAA0B,IAAI,gBAAgB,EAC9C,MAAM,IAAI,OAAO,EACjB,gBAAgB,IAAI,iBAAiB,GACtC,MAAM,2BAA2B,CAAC;AAMnC,wEAAwE;AACxE,MAAM,MAAM,cAAc,GAAG,kBAAkB,CAAC;AAEhD,4EAA4E;AAC5E,MAAM,MAAM,iBAAiB,GAAG,sBAAsB,CAAC;AAEvD,kFAAkF;AAClF,MAAM,MAAM,aAAa,GAAG,4BAA4B,CAAC;AAYzD;;;;;;GAMG;AACH,eAAO,MAAM,aAAa;;;;EAIf,CAAC;AACZ,uEAAuE;AACvE,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,OAAO,aAAa,CAAC,CAAC;AAE/E;;;;;;;;;GASG;AACH,eAAO,MAAM,WAAW;;;;EAIb,CAAC;AACZ;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,OAAO,WAAW,CAAC,CAAC;AAEzE;;;;;;;;;GASG;AACH,eAAO,MAAM,cAAc;;;;;;EAMhB,CAAC;AACZ;;;GAGG;AACH,MAAM,MAAM,cAAc,GACxB,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,OAAO,cAAc,CAAC,CAAC;AAEvD;;;;;;;;GAQG;AACH,eAAO,MAAM,gBAAgB;;;;EAIlB,CAAC;AACZ,2EAA2E;AAC3E,MAAM,MAAM,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"}
@@ -2,7 +2,7 @@
2
2
  "version": "1.0.0",
3
3
  "timestamp": 0,
4
4
  "packageName": "@happyvertical/smrt-affiliates",
5
- "packageVersion": "0.51.32",
5
+ "packageVersion": "0.51.33",
6
6
  "objects": {},
7
7
  "moduleType": "smrt",
8
8
  "smrtDependencies": [
@@ -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.32",
6
+ "packageVersion": "0.51.33",
7
7
  "sourceManifestPath": "dist/manifest.json",
8
8
  "agentDocPath": "AGENTS.md",
9
9
  "sourceHashes": {
10
- "manifest": "ac4986b5c2740c1bfe9735c448b0735167b01078963e9972becbe8f6fbce8587",
11
- "packageJson": "d8dcffc3cb17433321f98587638ff3d3ba26b0efe59e37c7d41c61cdcccd842a",
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": "5.9.3",
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.32",
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.32"
23
+ "@happyvertical/smrt-sales": "0.51.33"
24
24
  },
25
25
  "devDependencies": {
26
- "@happyvertical/smrt-vitest": "0.51.32",
26
+ "@happyvertical/smrt-vitest": "0.51.33",
27
27
  "@types/node": "24.13.6",
28
- "typescript": "5.9.3",
28
+ "typescript": "6.0.3",
29
29
  "vite": "8.1.4",
30
30
  "vitest": "4.1.10"
31
31
  },