@etohq/types 1.5.1-alpha.3 → 1.5.1-alpha.4
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/access-link/common.d.ts +266 -0
- package/dist/access-link/common.d.ts.map +1 -0
- package/dist/access-link/common.js.map +1 -0
- package/dist/access-link/index.d.ts +5 -0
- package/dist/access-link/index.d.ts.map +1 -0
- package/dist/access-link/index.js +21 -0
- package/dist/access-link/index.js.map +1 -0
- package/dist/access-link/mutations.d.ts +226 -0
- package/dist/access-link/mutations.d.ts.map +1 -0
- package/dist/{http/currency/admin/entities.js → access-link/mutations.js} +1 -1
- package/dist/access-link/mutations.js.map +1 -0
- package/dist/access-link/resolution.d.ts +215 -0
- package/dist/access-link/resolution.d.ts.map +1 -0
- package/dist/access-link/resolution.js +7 -0
- package/dist/access-link/resolution.js.map +1 -0
- package/dist/access-link/service.d.ts +166 -0
- package/dist/access-link/service.d.ts.map +1 -0
- package/dist/access-link/service.js.map +1 -0
- package/dist/ambassador/common.d.ts +699 -0
- package/dist/ambassador/common.d.ts.map +1 -0
- package/dist/ambassador/common.js +3 -0
- package/dist/ambassador/common.js.map +1 -0
- package/dist/ambassador/index.d.ts +5 -0
- package/dist/ambassador/index.d.ts.map +1 -0
- package/dist/ambassador/index.js +21 -0
- package/dist/ambassador/index.js.map +1 -0
- package/dist/ambassador/mutations.d.ts +389 -0
- package/dist/ambassador/mutations.d.ts.map +1 -0
- package/dist/{cart/workflows.js → ambassador/mutations.js} +1 -1
- package/dist/ambassador/mutations.js.map +1 -0
- package/dist/ambassador/revenue-sharing.d.ts +42 -0
- package/dist/ambassador/revenue-sharing.d.ts.map +1 -0
- package/dist/ambassador/revenue-sharing.js +4 -0
- package/dist/ambassador/revenue-sharing.js.map +1 -0
- package/dist/ambassador/service.d.ts +115 -0
- package/dist/ambassador/service.d.ts.map +1 -0
- package/dist/ambassador/service.js +3 -0
- package/dist/ambassador/service.js.map +1 -0
- package/dist/audit/common/audit-log.d.ts +65 -0
- package/dist/audit/common/audit-log.d.ts.map +1 -0
- package/dist/audit/common/audit-log.js +3 -0
- package/dist/audit/common/audit-log.js.map +1 -0
- package/dist/audit/common/enums.d.ts +2 -0
- package/dist/audit/common/enums.d.ts.map +1 -0
- package/dist/audit/common/enums.js +3 -0
- package/dist/audit/common/enums.js.map +1 -0
- package/dist/audit/common/index.d.ts +3 -0
- package/dist/audit/common/index.d.ts.map +1 -0
- package/dist/audit/common/index.js +19 -0
- package/dist/audit/common/index.js.map +1 -0
- package/dist/{cart → audit}/index.d.ts +1 -2
- package/dist/audit/index.d.ts.map +1 -0
- package/dist/{cart → audit}/index.js +1 -2
- package/dist/audit/index.js.map +1 -0
- package/dist/audit/mutations/audit-log.d.ts +81 -0
- package/dist/audit/mutations/audit-log.d.ts.map +1 -0
- package/dist/audit/mutations/audit-log.js +3 -0
- package/dist/audit/mutations/audit-log.js.map +1 -0
- package/dist/audit/mutations/index.d.ts +2 -0
- package/dist/audit/mutations/index.d.ts.map +1 -0
- package/dist/audit/mutations/index.js +18 -0
- package/dist/audit/mutations/index.js.map +1 -0
- package/dist/audit/service.d.ts +17 -0
- package/dist/audit/service.d.ts.map +1 -0
- package/dist/audit/service.js +3 -0
- package/dist/audit/service.js.map +1 -0
- package/dist/bundles.d.ts +1 -0
- package/dist/bundles.d.ts.map +1 -1
- package/dist/bundles.js +2 -1
- package/dist/bundles.js.map +1 -1
- package/dist/dal/utils.d.ts +25 -1
- package/dist/dal/utils.d.ts.map +1 -1
- package/dist/dml/index.d.ts +1 -1
- package/dist/dml/index.d.ts.map +1 -1
- package/dist/http/{payment/store → access-link}/index.d.ts +1 -2
- package/dist/http/access-link/index.d.ts.map +1 -0
- package/dist/http/{payment/store → access-link}/index.js +1 -2
- package/dist/http/access-link/index.js.map +1 -0
- package/dist/http/access-link/invitation.d.ts +144 -0
- package/dist/http/access-link/invitation.d.ts.map +1 -0
- package/dist/http/access-link/invitation.js +7 -0
- package/dist/http/access-link/invitation.js.map +1 -0
- package/dist/http/access-link/payloads.d.ts +104 -0
- package/dist/http/access-link/payloads.d.ts.map +1 -0
- package/dist/http/access-link/payloads.js.map +1 -0
- package/dist/http/access-link/queries.d.ts +110 -0
- package/dist/http/access-link/queries.d.ts.map +1 -0
- package/dist/http/access-link/queries.js.map +1 -0
- package/dist/http/access-link/responses.d.ts +169 -0
- package/dist/http/access-link/responses.d.ts.map +1 -0
- package/dist/http/access-link/responses.js.map +1 -0
- package/dist/http/ambassador/admin/index.d.ts +4 -0
- package/dist/http/ambassador/admin/index.d.ts.map +1 -0
- package/dist/http/{currency → ambassador}/admin/index.js +1 -1
- package/dist/http/ambassador/admin/index.js.map +1 -0
- package/dist/http/ambassador/admin/payloads.d.ts +97 -0
- package/dist/http/ambassador/admin/payloads.d.ts.map +1 -0
- package/dist/http/ambassador/admin/payloads.js +3 -0
- package/dist/http/ambassador/admin/payloads.js.map +1 -0
- package/dist/http/ambassador/admin/queries.d.ts +120 -0
- package/dist/http/ambassador/admin/queries.d.ts.map +1 -0
- package/dist/http/ambassador/admin/queries.js.map +1 -0
- package/dist/http/ambassador/admin/responses.d.ts +171 -0
- package/dist/http/ambassador/admin/responses.d.ts.map +1 -0
- package/dist/http/ambassador/admin/responses.js.map +1 -0
- package/dist/http/ambassador/index.d.ts +2 -0
- package/dist/http/ambassador/index.d.ts.map +1 -0
- package/dist/http/ambassador/index.js +18 -0
- package/dist/http/ambassador/index.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/membership/common.d.ts +59 -0
- package/dist/membership/common.d.ts.map +1 -0
- package/dist/membership/common.js +11 -0
- package/dist/membership/common.js.map +1 -0
- package/dist/membership/index.d.ts +3 -0
- package/dist/membership/index.d.ts.map +1 -0
- package/dist/membership/index.js +20 -0
- package/dist/membership/index.js.map +1 -0
- package/dist/membership/service.d.ts +79 -0
- package/dist/membership/service.d.ts.map +1 -0
- package/dist/membership/service.js +3 -0
- package/dist/membership/service.js.map +1 -0
- package/dist/rbac/common.d.ts +54 -0
- package/dist/rbac/common.d.ts.map +1 -0
- package/dist/rbac/common.js +3 -0
- package/dist/{cart → rbac}/common.js.map +1 -1
- package/dist/rbac/index.d.ts +4 -0
- package/dist/rbac/index.d.ts.map +1 -0
- package/dist/rbac/index.js +20 -0
- package/dist/rbac/index.js.map +1 -0
- package/dist/rbac/mutations.d.ts +36 -0
- package/dist/rbac/mutations.d.ts.map +1 -0
- package/dist/rbac/mutations.js +3 -0
- package/dist/rbac/mutations.js.map +1 -0
- package/dist/rbac/service.d.ts +50 -0
- package/dist/rbac/service.d.ts.map +1 -0
- package/dist/rbac/service.js +3 -0
- package/dist/{cart → rbac}/service.js.map +1 -1
- package/dist/space/common.d.ts +82 -0
- package/dist/space/common.d.ts.map +1 -0
- package/dist/space/common.js +3 -0
- package/dist/space/common.js.map +1 -0
- package/dist/space/index.d.ts +4 -0
- package/dist/space/index.d.ts.map +1 -0
- package/dist/space/index.js +21 -0
- package/dist/space/index.js.map +1 -0
- package/dist/space/mutations.d.ts +101 -0
- package/dist/space/mutations.d.ts.map +1 -0
- package/dist/space/mutations.js +3 -0
- package/dist/space/mutations.js.map +1 -0
- package/dist/space/service.d.ts +77 -0
- package/dist/space/service.d.ts.map +1 -0
- package/dist/space/service.js +3 -0
- package/dist/space/service.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +376 -19
- package/dist/cart/common.d.ts +0 -1125
- package/dist/cart/common.d.ts.map +0 -1
- package/dist/cart/index.d.ts.map +0 -1
- package/dist/cart/index.js.map +0 -1
- package/dist/cart/mutations.d.ts +0 -734
- package/dist/cart/mutations.d.ts.map +0 -1
- package/dist/cart/mutations.js +0 -4
- package/dist/cart/mutations.js.map +0 -1
- package/dist/cart/service.d.ts +0 -1888
- package/dist/cart/service.d.ts.map +0 -1
- package/dist/cart/workflows.d.ts +0 -480
- package/dist/cart/workflows.d.ts.map +0 -1
- package/dist/cart/workflows.js.map +0 -1
- package/dist/http/currency/admin/entities.d.ts +0 -4
- package/dist/http/currency/admin/entities.d.ts.map +0 -1
- package/dist/http/currency/admin/entities.js.map +0 -1
- package/dist/http/currency/admin/index.d.ts +0 -4
- package/dist/http/currency/admin/index.d.ts.map +0 -1
- package/dist/http/currency/admin/index.js.map +0 -1
- package/dist/http/currency/admin/queries.d.ts +0 -15
- package/dist/http/currency/admin/queries.d.ts.map +0 -1
- package/dist/http/currency/admin/queries.js.map +0 -1
- package/dist/http/currency/admin/responses.d.ts +0 -16
- package/dist/http/currency/admin/responses.d.ts.map +0 -1
- package/dist/http/currency/admin/responses.js.map +0 -1
- package/dist/http/payment/store/entities.d.ts +0 -20
- package/dist/http/payment/store/entities.d.ts.map +0 -1
- package/dist/http/payment/store/entities.js +0 -3
- package/dist/http/payment/store/entities.js.map +0 -1
- package/dist/http/payment/store/index.d.ts.map +0 -1
- package/dist/http/payment/store/index.js.map +0 -1
- package/dist/http/payment/store/payloads.d.ts +0 -17
- package/dist/http/payment/store/payloads.d.ts.map +0 -1
- package/dist/http/payment/store/payloads.js.map +0 -1
- package/dist/http/payment/store/queries.d.ts +0 -12
- package/dist/http/payment/store/queries.d.ts.map +0 -1
- package/dist/http/payment/store/queries.js.map +0 -1
- package/dist/http/payment/store/responses.d.ts +0 -15
- package/dist/http/payment/store/responses.d.ts.map +0 -1
- package/dist/http/payment/store/responses.js.map +0 -1
- /package/dist/{cart → access-link}/common.js +0 -0
- /package/dist/{cart → access-link}/service.js +0 -0
- /package/dist/http/{payment/store → access-link}/payloads.js +0 -0
- /package/dist/http/{currency/admin → access-link}/queries.js +0 -0
- /package/dist/http/{currency/admin → access-link}/responses.js +0 -0
- /package/dist/http/{payment/store → ambassador/admin}/queries.js +0 -0
- /package/dist/http/{payment/store → ambassador/admin}/responses.js +0 -0
|
@@ -0,0 +1,699 @@
|
|
|
1
|
+
import { BaseFilterable, OperatorMap } from "../dal";
|
|
2
|
+
import { ActionType, AuthorityType, ContextType, RevenueRelationshipType, SourceType } from "./revenue-sharing";
|
|
3
|
+
/**
|
|
4
|
+
* Ambassador source types
|
|
5
|
+
*/
|
|
6
|
+
export type AmbassadorSourceType = "user" | "community";
|
|
7
|
+
/**
|
|
8
|
+
* Ambassador status types
|
|
9
|
+
*/
|
|
10
|
+
export type AmbassadorStatus = "default" | "verified" | "featured";
|
|
11
|
+
/**
|
|
12
|
+
* Ambassador profile types
|
|
13
|
+
*/
|
|
14
|
+
export type AmbassadorProfileType = "individual" | "business";
|
|
15
|
+
/**
|
|
16
|
+
* Program status types
|
|
17
|
+
*/
|
|
18
|
+
export type ProgramStatus = "active" | "inactive" | "suspended";
|
|
19
|
+
/**
|
|
20
|
+
* Commission types - Enhanced for native revenue sharing
|
|
21
|
+
*/
|
|
22
|
+
export type CommissionType = "click" | "lead" | "sale" | "custom" | "revenue_share" | "community_bonus";
|
|
23
|
+
/**
|
|
24
|
+
* Revenue sharing context - Makes revenue sharing conditions explicit
|
|
25
|
+
*/
|
|
26
|
+
export type RevenueShareContext = {
|
|
27
|
+
source_type: "direct" | "community" | "repost";
|
|
28
|
+
community_id?: string;
|
|
29
|
+
creator_id?: string;
|
|
30
|
+
share_percentage?: number;
|
|
31
|
+
sharing_rules?: {
|
|
32
|
+
ambassador_share: number;
|
|
33
|
+
creator_share: number;
|
|
34
|
+
community_share?: number;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Commission status types
|
|
39
|
+
*/
|
|
40
|
+
export type CommissionStatus = "pending" | "confirmed" | "processed" | "paid" | "refunded" | "duplicate" | "fraud" | "canceled";
|
|
41
|
+
/**
|
|
42
|
+
* Enrollment status types
|
|
43
|
+
*/
|
|
44
|
+
export type ProgramEnrollmentStatus = "pending" | "approved" | "rejected" | "invited" | "declined" | "banned" | "archived";
|
|
45
|
+
/**
|
|
46
|
+
* Banned reason types (Dub parity)
|
|
47
|
+
*/
|
|
48
|
+
export type BannedReasonType = "tos_violation" | "inappropriate_content" | "fake_traffic" | "fraud" | "spam" | "brand_abuse";
|
|
49
|
+
/**
|
|
50
|
+
* Reward event types
|
|
51
|
+
*/
|
|
52
|
+
export type RewardEventType = "click" | "lead" | "sale" | "access_grant";
|
|
53
|
+
/**
|
|
54
|
+
* Reward structure types
|
|
55
|
+
*/
|
|
56
|
+
export type RewardStructureType = "percentage" | "flat";
|
|
57
|
+
/**
|
|
58
|
+
* Ambassador DTO
|
|
59
|
+
*/
|
|
60
|
+
export interface AmbassadorDTO {
|
|
61
|
+
id: string;
|
|
62
|
+
source_type: AmbassadorSourceType;
|
|
63
|
+
source_id: string;
|
|
64
|
+
name: string;
|
|
65
|
+
email: string | null;
|
|
66
|
+
profile_type: AmbassadorProfileType;
|
|
67
|
+
company_name: string | null;
|
|
68
|
+
status: AmbassadorStatus;
|
|
69
|
+
description: string | null;
|
|
70
|
+
total_earnings: number | null;
|
|
71
|
+
country: string | null;
|
|
72
|
+
image: string | null;
|
|
73
|
+
website: string | null;
|
|
74
|
+
website_txt_record: string | null;
|
|
75
|
+
website_verified_at: Date | null;
|
|
76
|
+
youtube: string | null;
|
|
77
|
+
youtube_channel_id: string | null;
|
|
78
|
+
youtube_verified_at: Date | null;
|
|
79
|
+
youtube_subscriber_count: number;
|
|
80
|
+
youtube_video_count: number;
|
|
81
|
+
youtube_view_count: number;
|
|
82
|
+
twitter: string | null;
|
|
83
|
+
twitter_verified_at: Date | null;
|
|
84
|
+
linkedin: string | null;
|
|
85
|
+
linkedin_verified_at: Date | null;
|
|
86
|
+
instagram: string | null;
|
|
87
|
+
instagram_verified_at: Date | null;
|
|
88
|
+
tiktok: string | null;
|
|
89
|
+
paypal_email: string | null;
|
|
90
|
+
stripe_connect_id: string | null;
|
|
91
|
+
min_withdrawal_amount: number;
|
|
92
|
+
payouts_enabled_at: Date | null;
|
|
93
|
+
connect_payouts_last_reminded_at: Date | null;
|
|
94
|
+
invoice_settings: Record<string, unknown> | null;
|
|
95
|
+
metadata: Record<string, unknown> | null;
|
|
96
|
+
created_at: Date;
|
|
97
|
+
updated_at: Date;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Reward DTO
|
|
101
|
+
*/
|
|
102
|
+
export interface RewardDTO {
|
|
103
|
+
/**
|
|
104
|
+
* The unique identifier for the reward.
|
|
105
|
+
*/
|
|
106
|
+
id: string;
|
|
107
|
+
/**
|
|
108
|
+
* The associated program's ID for this reward.
|
|
109
|
+
*/
|
|
110
|
+
program_id: string;
|
|
111
|
+
/**
|
|
112
|
+
* The event that triggers this reward (e.g., click, lead, sale).
|
|
113
|
+
*/
|
|
114
|
+
event: RewardEventType;
|
|
115
|
+
/**
|
|
116
|
+
* The reward's structural type (e.g., fixed, percentage).
|
|
117
|
+
*/
|
|
118
|
+
type: RewardStructureType;
|
|
119
|
+
/**
|
|
120
|
+
* The reward amount (could be a number or percent depending on structure).
|
|
121
|
+
*/
|
|
122
|
+
amount: number;
|
|
123
|
+
/**
|
|
124
|
+
* The maximum allowed duration (if applicable) for the reward. Null if not set.
|
|
125
|
+
*/
|
|
126
|
+
max_duration: number | null;
|
|
127
|
+
/**
|
|
128
|
+
* The maximum allowed amount for the reward. Null if not set.
|
|
129
|
+
*/
|
|
130
|
+
max_amount: number | null;
|
|
131
|
+
/**
|
|
132
|
+
* Optional record for any additional modifiers for the reward.
|
|
133
|
+
* Null if not present.
|
|
134
|
+
*/
|
|
135
|
+
modifiers: Record<string, unknown> | null;
|
|
136
|
+
/**
|
|
137
|
+
* Optional human-readable description for the reward. Null if not present.
|
|
138
|
+
*/
|
|
139
|
+
description: string | null;
|
|
140
|
+
/**
|
|
141
|
+
* Timestamp when this reward was created.
|
|
142
|
+
*/
|
|
143
|
+
created_at: Date;
|
|
144
|
+
/**
|
|
145
|
+
* Timestamp when this reward was last updated.
|
|
146
|
+
*/
|
|
147
|
+
updated_at: Date;
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Program DTO
|
|
151
|
+
*
|
|
152
|
+
* Includes all current program fields. All optional fields use `null`
|
|
153
|
+
* instead of being omitted or using `?`.
|
|
154
|
+
* Updated: Now contains additional Dub and platform discovery fields.
|
|
155
|
+
*/
|
|
156
|
+
export interface ProgramDTO {
|
|
157
|
+
/**
|
|
158
|
+
* Unique identifier of the program.
|
|
159
|
+
*/
|
|
160
|
+
id: string;
|
|
161
|
+
/**
|
|
162
|
+
* Owner's unique ID.
|
|
163
|
+
*/
|
|
164
|
+
owner_id: string;
|
|
165
|
+
/**
|
|
166
|
+
* The type of owner (e.g., user, brand, organization).
|
|
167
|
+
*/
|
|
168
|
+
owner_type: string;
|
|
169
|
+
/**
|
|
170
|
+
* Program name.
|
|
171
|
+
*/
|
|
172
|
+
name: string;
|
|
173
|
+
/**
|
|
174
|
+
* Program slug (unique string used in URLs).
|
|
175
|
+
*/
|
|
176
|
+
slug: string;
|
|
177
|
+
/**
|
|
178
|
+
* Program description (null if not provided).
|
|
179
|
+
*/
|
|
180
|
+
description: string | null;
|
|
181
|
+
/**
|
|
182
|
+
* Logo URL or null.
|
|
183
|
+
*/
|
|
184
|
+
logo: string | null;
|
|
185
|
+
/**
|
|
186
|
+
* Brand color hex (null if not provided).
|
|
187
|
+
*/
|
|
188
|
+
brand_color: string | null;
|
|
189
|
+
/**
|
|
190
|
+
* Domain associated with the program (null if not provided).
|
|
191
|
+
*/
|
|
192
|
+
domain: string | null;
|
|
193
|
+
/**
|
|
194
|
+
* Public site URL for the program (null if not provided).
|
|
195
|
+
*/
|
|
196
|
+
url: string | null;
|
|
197
|
+
/**
|
|
198
|
+
* Wordmark image or null.
|
|
199
|
+
*/
|
|
200
|
+
wordmark: string | null;
|
|
201
|
+
/**
|
|
202
|
+
* Primary/category of the program (for discovery/search).
|
|
203
|
+
*/
|
|
204
|
+
primary_category: string | null;
|
|
205
|
+
/**
|
|
206
|
+
* Commission type (either percentage or fixed).
|
|
207
|
+
*/
|
|
208
|
+
commission_type: "percentage" | "fixed";
|
|
209
|
+
/**
|
|
210
|
+
* Commission rate (as percent or fixed value).
|
|
211
|
+
*/
|
|
212
|
+
commission_rate: number;
|
|
213
|
+
/**
|
|
214
|
+
* Cookie length in days for tracking. (Attribution window)
|
|
215
|
+
*/
|
|
216
|
+
cookie_length: number;
|
|
217
|
+
/**
|
|
218
|
+
* Number of days held before payout eligibility.
|
|
219
|
+
*/
|
|
220
|
+
holding_period_days: number;
|
|
221
|
+
/**
|
|
222
|
+
* Minimum payout amount (base units, e.g., cents).
|
|
223
|
+
*/
|
|
224
|
+
min_payout_amount: number;
|
|
225
|
+
/**
|
|
226
|
+
* Whether ambassadors are auto-approved (true or false).
|
|
227
|
+
*/
|
|
228
|
+
auto_approve_ambassadors: boolean;
|
|
229
|
+
/**
|
|
230
|
+
* Timestamp when auto-approve was enabled (null if not set).
|
|
231
|
+
*/
|
|
232
|
+
auto_approve_ambassadors_enabled_at: Date | null;
|
|
233
|
+
/**
|
|
234
|
+
* Maximum number of links allowed per ambassador.
|
|
235
|
+
*/
|
|
236
|
+
max_ambassador_links: number;
|
|
237
|
+
/**
|
|
238
|
+
* URL validation mode.
|
|
239
|
+
*/
|
|
240
|
+
url_validation_mode: "domain" | "exact";
|
|
241
|
+
/**
|
|
242
|
+
* Link structure pattern for access/ambassador links.
|
|
243
|
+
*/
|
|
244
|
+
link_structure: "short" | "query" | "path";
|
|
245
|
+
/**
|
|
246
|
+
* Custom parameter for link construction (null if not used).
|
|
247
|
+
*/
|
|
248
|
+
link_parameter: string | null;
|
|
249
|
+
/**
|
|
250
|
+
* Minimum age for ambassadors (null if no requirement).
|
|
251
|
+
*/
|
|
252
|
+
age_verification: number | null;
|
|
253
|
+
/**
|
|
254
|
+
* Default folder ID for ambassadors (null if not set).
|
|
255
|
+
*/
|
|
256
|
+
default_folder_id: string | null;
|
|
257
|
+
/**
|
|
258
|
+
* Default group ID for ambassadors (null if not set).
|
|
259
|
+
*/
|
|
260
|
+
default_group_id: string | null;
|
|
261
|
+
/**
|
|
262
|
+
* Optional timestamp for published program landing page.
|
|
263
|
+
*/
|
|
264
|
+
lander_published_at: Date | null;
|
|
265
|
+
/**
|
|
266
|
+
* Category for program discovery/marketplace (null if not set).
|
|
267
|
+
*/
|
|
268
|
+
category: string | null;
|
|
269
|
+
/**
|
|
270
|
+
* List of tags or keywords (null if not set).
|
|
271
|
+
*/
|
|
272
|
+
tags: string[] | null;
|
|
273
|
+
/**
|
|
274
|
+
* Target audience or audience description (null if not set).
|
|
275
|
+
*/
|
|
276
|
+
target_audience: string | null;
|
|
277
|
+
/**
|
|
278
|
+
* Commission summary (human-readable, null if not set).
|
|
279
|
+
*/
|
|
280
|
+
commission_summary: string | null;
|
|
281
|
+
/**
|
|
282
|
+
* Array of main program benefits (null if not set).
|
|
283
|
+
*/
|
|
284
|
+
program_benefits: Record<string, unknown> | null;
|
|
285
|
+
/**
|
|
286
|
+
* Array of requirements for ambassadors (null if not set).
|
|
287
|
+
*/
|
|
288
|
+
requirements: Record<string, unknown> | null;
|
|
289
|
+
/**
|
|
290
|
+
* Linked campaign ID (null if not integrated).
|
|
291
|
+
*/
|
|
292
|
+
campaign_id: string | null;
|
|
293
|
+
/**
|
|
294
|
+
* List of active promotion IDs from campaign (null if none).
|
|
295
|
+
*/
|
|
296
|
+
active_promotion_ids: string[] | null;
|
|
297
|
+
/**
|
|
298
|
+
* Whether promotion integration is enabled.
|
|
299
|
+
*/
|
|
300
|
+
promotion_integration_enabled: boolean;
|
|
301
|
+
/**
|
|
302
|
+
* Array of all discounts (null if not present).
|
|
303
|
+
*/
|
|
304
|
+
discounts: Record<string, unknown> | null;
|
|
305
|
+
/**
|
|
306
|
+
* List of all rewards for the program (null if no rewards).
|
|
307
|
+
*/
|
|
308
|
+
rewards: RewardDTO[] | null;
|
|
309
|
+
/**
|
|
310
|
+
* Whether program discounting is enabled.
|
|
311
|
+
*/
|
|
312
|
+
discount_enabled: boolean;
|
|
313
|
+
/**
|
|
314
|
+
* Discount type (percentage or flat).
|
|
315
|
+
*/
|
|
316
|
+
discount_type: "percentage" | "flat";
|
|
317
|
+
/**
|
|
318
|
+
* Discount amount (number, either percent or flat, based on discount_type).
|
|
319
|
+
*/
|
|
320
|
+
discount_amount: number;
|
|
321
|
+
/**
|
|
322
|
+
* Max duration for discount (null if not limited).
|
|
323
|
+
*/
|
|
324
|
+
discount_max_duration: number | null;
|
|
325
|
+
/**
|
|
326
|
+
* Terms and conditions URL (null if not set).
|
|
327
|
+
*/
|
|
328
|
+
terms_url: string | null;
|
|
329
|
+
/**
|
|
330
|
+
* Help/support URL (null if not set).
|
|
331
|
+
*/
|
|
332
|
+
help_url: string | null;
|
|
333
|
+
/**
|
|
334
|
+
* Support email address (null if not set).
|
|
335
|
+
*/
|
|
336
|
+
support_email: string | null;
|
|
337
|
+
/**
|
|
338
|
+
* Revenue sharing mode, affects how commissions or splits are managed.
|
|
339
|
+
*/
|
|
340
|
+
revenue_sharing_mode: "default" | "custom" | "negotiated";
|
|
341
|
+
/**
|
|
342
|
+
* Current program status.
|
|
343
|
+
*/
|
|
344
|
+
status: ProgramStatus;
|
|
345
|
+
/**
|
|
346
|
+
* Metadata for this program (null if not present).
|
|
347
|
+
*/
|
|
348
|
+
metadata: Record<string, unknown> | null;
|
|
349
|
+
/**
|
|
350
|
+
* Timestamp when this program was created.
|
|
351
|
+
*/
|
|
352
|
+
created_at: Date;
|
|
353
|
+
/**
|
|
354
|
+
* Timestamp when this program was last updated.
|
|
355
|
+
*/
|
|
356
|
+
updated_at: Date;
|
|
357
|
+
}
|
|
358
|
+
/**
|
|
359
|
+
* Commission DTO
|
|
360
|
+
*
|
|
361
|
+
* Represents a single commission record within the ambassador program.
|
|
362
|
+
*/
|
|
363
|
+
export interface CommissionDTO {
|
|
364
|
+
/**
|
|
365
|
+
* Unique identifier of the commission.
|
|
366
|
+
*/
|
|
367
|
+
id: string;
|
|
368
|
+
/**
|
|
369
|
+
* Program ID the commission is associated with.
|
|
370
|
+
*/
|
|
371
|
+
program_id: string;
|
|
372
|
+
/**
|
|
373
|
+
* Ambassador/affiliate user ID who earned the commission.
|
|
374
|
+
*/
|
|
375
|
+
ambassador_id: string;
|
|
376
|
+
/**
|
|
377
|
+
* Associated reward ID if applicable, otherwise null.
|
|
378
|
+
*/
|
|
379
|
+
reward_id: string | null;
|
|
380
|
+
/**
|
|
381
|
+
* Associated access link/campaign link ID, or null if not applicable.
|
|
382
|
+
*/
|
|
383
|
+
access_link_id: string | null;
|
|
384
|
+
/**
|
|
385
|
+
* Payout batch ID if commission has been assigned, otherwise null.
|
|
386
|
+
*/
|
|
387
|
+
payout_id: string | null;
|
|
388
|
+
/**
|
|
389
|
+
* Invoice ID for accounting or external payouts, or null.
|
|
390
|
+
*/
|
|
391
|
+
invoice_id: string | null;
|
|
392
|
+
/**
|
|
393
|
+
* Customer ID related to the commission event, or null.
|
|
394
|
+
*/
|
|
395
|
+
customer_id: string | null;
|
|
396
|
+
/**
|
|
397
|
+
* Event ID that triggered the commission if applicable, or null.
|
|
398
|
+
*/
|
|
399
|
+
event_id: string | null;
|
|
400
|
+
/**
|
|
401
|
+
* Human-readable description of the commission, if any.
|
|
402
|
+
*/
|
|
403
|
+
description: string | null;
|
|
404
|
+
/**
|
|
405
|
+
* The commission type (sale, lead, custom, etc).
|
|
406
|
+
*/
|
|
407
|
+
type: CommissionType;
|
|
408
|
+
/**
|
|
409
|
+
* The commission amount (un-multiplied by quantity).
|
|
410
|
+
*/
|
|
411
|
+
amount: number;
|
|
412
|
+
/**
|
|
413
|
+
* Units sold/quantity tracked for this commission.
|
|
414
|
+
*/
|
|
415
|
+
quantity: number;
|
|
416
|
+
/**
|
|
417
|
+
* The final earnings from the commission (amount * quantity, may be negative for clawbacks).
|
|
418
|
+
*/
|
|
419
|
+
earnings: number;
|
|
420
|
+
/**
|
|
421
|
+
* Currency code (e.g., usd, eur).
|
|
422
|
+
*/
|
|
423
|
+
currency: string;
|
|
424
|
+
/**
|
|
425
|
+
* The current status of this commission (e.g., pending, processing, paid).
|
|
426
|
+
*/
|
|
427
|
+
status: CommissionStatus;
|
|
428
|
+
/**
|
|
429
|
+
* (Internal use) User ID that created or processed this commission. May be null.
|
|
430
|
+
*/
|
|
431
|
+
user_id: string | null;
|
|
432
|
+
/**
|
|
433
|
+
* Timestamp the commission was created.
|
|
434
|
+
*/
|
|
435
|
+
created_at: Date;
|
|
436
|
+
/**
|
|
437
|
+
* Timestamp the commission was last updated.
|
|
438
|
+
*/
|
|
439
|
+
updated_at: Date;
|
|
440
|
+
}
|
|
441
|
+
/**
|
|
442
|
+
* Program Enrollment DTO
|
|
443
|
+
*/
|
|
444
|
+
export interface ProgramEnrollmentDTO {
|
|
445
|
+
/**
|
|
446
|
+
* The unique ID for this enrollment.
|
|
447
|
+
*/
|
|
448
|
+
id: string;
|
|
449
|
+
/**
|
|
450
|
+
* The ambassador's ID who enrolled.
|
|
451
|
+
*/
|
|
452
|
+
ambassador_id: string;
|
|
453
|
+
/**
|
|
454
|
+
* The program's ID in which ambassador is enrolled.
|
|
455
|
+
*/
|
|
456
|
+
program_id: string;
|
|
457
|
+
/**
|
|
458
|
+
* (Optional) The group ID associated with enrollment. Null if not present.
|
|
459
|
+
*/
|
|
460
|
+
group_id: string | null;
|
|
461
|
+
/**
|
|
462
|
+
* (Optional) The reward ID for clicks. Null if not present.
|
|
463
|
+
*/
|
|
464
|
+
click_reward_id: string | null;
|
|
465
|
+
/**
|
|
466
|
+
* (Optional) The reward ID for leads. Null if not present.
|
|
467
|
+
*/
|
|
468
|
+
lead_reward_id: string | null;
|
|
469
|
+
/**
|
|
470
|
+
* (Optional) The reward ID for sales. Null if not present.
|
|
471
|
+
*/
|
|
472
|
+
sale_reward_id: string | null;
|
|
473
|
+
/**
|
|
474
|
+
* The current enrollment status (e.g., active, banned).
|
|
475
|
+
*/
|
|
476
|
+
status: ProgramEnrollmentStatus;
|
|
477
|
+
/**
|
|
478
|
+
* Total commissions earned via this enrollment.
|
|
479
|
+
*/
|
|
480
|
+
total_commissions: number;
|
|
481
|
+
/**
|
|
482
|
+
* (Optional) Date/time the ambassador was banned, or null if not banned.
|
|
483
|
+
*/
|
|
484
|
+
banned_at: Date | null;
|
|
485
|
+
/**
|
|
486
|
+
* (Optional) The ban reason type, or null if not banned.
|
|
487
|
+
*/
|
|
488
|
+
banned_reason: BannedReasonType | null;
|
|
489
|
+
/**
|
|
490
|
+
* Application message.
|
|
491
|
+
*/
|
|
492
|
+
application_message: string | null;
|
|
493
|
+
/**
|
|
494
|
+
* Who invited this ambassador (ambassador ID or user ID).
|
|
495
|
+
*/
|
|
496
|
+
invited_by: string | null;
|
|
497
|
+
source: string | null;
|
|
498
|
+
/**
|
|
499
|
+
* Metadata for this enrollment.
|
|
500
|
+
*/
|
|
501
|
+
metadata: Record<string, any> | null;
|
|
502
|
+
/**
|
|
503
|
+
* Timestamp when this enrollment was created.
|
|
504
|
+
*/
|
|
505
|
+
created_at: Date;
|
|
506
|
+
/**
|
|
507
|
+
* Timestamp when the enrollment was last updated.
|
|
508
|
+
*/
|
|
509
|
+
updated_at: Date;
|
|
510
|
+
}
|
|
511
|
+
/**
|
|
512
|
+
* Filterable interfaces
|
|
513
|
+
*/
|
|
514
|
+
export interface FilterableAmbassadorProps extends BaseFilterable<FilterableAmbassadorProps> {
|
|
515
|
+
id?: string | string[];
|
|
516
|
+
source_type?: AmbassadorSourceType | AmbassadorSourceType[];
|
|
517
|
+
source_id?: string | string[];
|
|
518
|
+
status?: AmbassadorStatus | AmbassadorStatus[];
|
|
519
|
+
country?: string | string[];
|
|
520
|
+
email?: string | string[];
|
|
521
|
+
}
|
|
522
|
+
export interface FilterableProgramProps extends BaseFilterable<FilterableProgramProps> {
|
|
523
|
+
id?: string | string[];
|
|
524
|
+
space_id?: string | string[];
|
|
525
|
+
owner_id?: string | string[];
|
|
526
|
+
owner_type?: string | string[];
|
|
527
|
+
status?: ProgramStatus | ProgramStatus[];
|
|
528
|
+
slug?: string | string[];
|
|
529
|
+
}
|
|
530
|
+
export interface FilterableCommissionProps extends BaseFilterable<FilterableCommissionProps> {
|
|
531
|
+
id?: string | string[];
|
|
532
|
+
payout_id?: OperatorMap<string>;
|
|
533
|
+
program_id?: string | string[];
|
|
534
|
+
ambassador_id?: string | string[];
|
|
535
|
+
access_link_id?: string | string[];
|
|
536
|
+
type?: CommissionType | CommissionType[];
|
|
537
|
+
status?: CommissionStatus | CommissionStatus[];
|
|
538
|
+
created_at?: OperatorMap<Date>;
|
|
539
|
+
}
|
|
540
|
+
export interface FilterableRewardProps extends BaseFilterable<FilterableRewardProps> {
|
|
541
|
+
id?: string | string[];
|
|
542
|
+
program_id?: string | string[];
|
|
543
|
+
event?: RewardEventType | RewardEventType[];
|
|
544
|
+
type?: RewardStructureType | RewardStructureType[];
|
|
545
|
+
}
|
|
546
|
+
export interface FilterableProgramEnrollmentProps extends BaseFilterable<FilterableProgramEnrollmentProps> {
|
|
547
|
+
id?: string | string[];
|
|
548
|
+
ambassador_id?: string | string[];
|
|
549
|
+
program_id?: string | string[];
|
|
550
|
+
group_id?: string | string[];
|
|
551
|
+
status?: ProgramEnrollmentStatus | ProgramEnrollmentStatus[];
|
|
552
|
+
}
|
|
553
|
+
/**
|
|
554
|
+
* Filterable props for listing payouts.
|
|
555
|
+
*/
|
|
556
|
+
export interface FilterablePayoutProps extends BaseFilterable<FilterableProgramEnrollmentProps> {
|
|
557
|
+
id?: string | string[];
|
|
558
|
+
program_id?: string | string[];
|
|
559
|
+
ambassador_id?: string | string[];
|
|
560
|
+
status?: string | string[];
|
|
561
|
+
currency?: string;
|
|
562
|
+
}
|
|
563
|
+
/**
|
|
564
|
+
* Program URL validation mode
|
|
565
|
+
*/
|
|
566
|
+
export type ProgramUrlValidationMode = "domain" | "exact";
|
|
567
|
+
/**
|
|
568
|
+
* Program link structure
|
|
569
|
+
*/
|
|
570
|
+
export type ProgramLinkStructure = "short" | "query" | "path";
|
|
571
|
+
/**
|
|
572
|
+
* The payout status string union.
|
|
573
|
+
*/
|
|
574
|
+
export type PayoutStatus = "pending" | "processing" | "processed" | "sent" | "completed" | "failed" | "canceled";
|
|
575
|
+
/**
|
|
576
|
+
* Payout DTO
|
|
577
|
+
*/
|
|
578
|
+
export interface PayoutDTO {
|
|
579
|
+
/**
|
|
580
|
+
* The unique payout ID.
|
|
581
|
+
*/
|
|
582
|
+
id: string;
|
|
583
|
+
/**
|
|
584
|
+
* Program this payout is for.
|
|
585
|
+
*/
|
|
586
|
+
program_id: string;
|
|
587
|
+
/**
|
|
588
|
+
* Ambassador (partner) ID this payout is assigned to.
|
|
589
|
+
*/
|
|
590
|
+
ambassador_id: string;
|
|
591
|
+
/**
|
|
592
|
+
* The payout amount (in cents!).
|
|
593
|
+
*/
|
|
594
|
+
amount: number;
|
|
595
|
+
/**
|
|
596
|
+
* The payout currency (ISO code).
|
|
597
|
+
*/
|
|
598
|
+
currency: string;
|
|
599
|
+
/**
|
|
600
|
+
* The payout status (pending, processing, processed, etc).
|
|
601
|
+
*/
|
|
602
|
+
status: PayoutStatus;
|
|
603
|
+
/**
|
|
604
|
+
* Optional description (nullable).
|
|
605
|
+
*/
|
|
606
|
+
description: string | null;
|
|
607
|
+
/**
|
|
608
|
+
* The payout period start, if applicable.
|
|
609
|
+
*/
|
|
610
|
+
period_start: Date | null;
|
|
611
|
+
/**
|
|
612
|
+
* The payout period end, if applicable.
|
|
613
|
+
*/
|
|
614
|
+
period_end: Date | null;
|
|
615
|
+
/**
|
|
616
|
+
* Spay/PayPal/other payment processor fields (nullable).
|
|
617
|
+
*/
|
|
618
|
+
spay_transfer_id: string | null;
|
|
619
|
+
spay_payout_id: string | null;
|
|
620
|
+
paypal_transfer_id: string | null;
|
|
621
|
+
failure_reason: string | null;
|
|
622
|
+
/**
|
|
623
|
+
* Audit trail.
|
|
624
|
+
*/
|
|
625
|
+
created_by: string | null;
|
|
626
|
+
/**
|
|
627
|
+
* Paid at timestamp, if payout completed.
|
|
628
|
+
*/
|
|
629
|
+
paid_at: Date | null;
|
|
630
|
+
/**
|
|
631
|
+
* Timestamps.
|
|
632
|
+
*/
|
|
633
|
+
created_at: Date;
|
|
634
|
+
updated_at: Date;
|
|
635
|
+
deleted_at: Date | null;
|
|
636
|
+
}
|
|
637
|
+
/**
|
|
638
|
+
* Revenue sharing rule DTO - Materialized rules
|
|
639
|
+
*
|
|
640
|
+
*/
|
|
641
|
+
export type RevenueShareRuleDTO = {
|
|
642
|
+
id: string;
|
|
643
|
+
program_id: string;
|
|
644
|
+
current_source_type: SourceType;
|
|
645
|
+
current_source_id: string;
|
|
646
|
+
/**
|
|
647
|
+
* For cross-context scenarios (away). Null if not set.
|
|
648
|
+
*/
|
|
649
|
+
original_source_type: SourceType | null;
|
|
650
|
+
/**
|
|
651
|
+
* For cross-context scenarios (away). Null if not set.
|
|
652
|
+
*/
|
|
653
|
+
original_source_id: string | null;
|
|
654
|
+
action: ActionType;
|
|
655
|
+
context_type: ContextType;
|
|
656
|
+
/**
|
|
657
|
+
* Relationship for scope. Null if not set.
|
|
658
|
+
*/
|
|
659
|
+
relationship: RevenueRelationshipType | null;
|
|
660
|
+
actor_share: number;
|
|
661
|
+
context_owner_share: number;
|
|
662
|
+
creator_share: number;
|
|
663
|
+
beneficiary_share: number;
|
|
664
|
+
platform_share: number;
|
|
665
|
+
name: string;
|
|
666
|
+
/**
|
|
667
|
+
* Human-readable description. Null if not set.
|
|
668
|
+
*/
|
|
669
|
+
description: string | null;
|
|
670
|
+
/**
|
|
671
|
+
* How this rule was created (authoritative source).
|
|
672
|
+
*/
|
|
673
|
+
rule_origin: AuthorityType;
|
|
674
|
+
/**
|
|
675
|
+
* E.g. agreement_id, etc. Null if not set.
|
|
676
|
+
*/
|
|
677
|
+
rule_origin_id: string | null;
|
|
678
|
+
active: boolean;
|
|
679
|
+
/**
|
|
680
|
+
* Timestamp when this rule expires. Null if not set.
|
|
681
|
+
*/
|
|
682
|
+
expires_at: Date | null;
|
|
683
|
+
created_at: Date;
|
|
684
|
+
updated_at: Date;
|
|
685
|
+
};
|
|
686
|
+
/**
|
|
687
|
+
* Revenue rule filters
|
|
688
|
+
*/
|
|
689
|
+
export interface RevenueShareRuleFilters extends BaseFilterable<FilterableProgramProps> {
|
|
690
|
+
program_id?: string | string[];
|
|
691
|
+
current_source_type?: SourceType | SourceType[];
|
|
692
|
+
current_source_id?: string | string[];
|
|
693
|
+
original_source_type?: SourceType | SourceType[];
|
|
694
|
+
action?: ActionType | ActionType[];
|
|
695
|
+
context_type?: ContextType | ContextType[];
|
|
696
|
+
active?: boolean;
|
|
697
|
+
expires_at?: OperatorMap<Date>;
|
|
698
|
+
}
|
|
699
|
+
//# sourceMappingURL=common.d.ts.map
|