@agentchainlabsai/sdk 0.0.0-stage → 0.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.
- package/README.md +231 -2
- package/dist/autonomous-recipe.d.ts +59 -0
- package/dist/autonomous-recipe.d.ts.map +1 -0
- package/dist/autonomous-recipe.js +92 -0
- package/dist/autonomy-schedule.d.ts +62 -0
- package/dist/autonomy-schedule.d.ts.map +1 -0
- package/dist/autonomy-schedule.js +101 -0
- package/dist/client.d.ts +49 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +119 -0
- package/dist/headless-auth.d.ts +54 -0
- package/dist/headless-auth.d.ts.map +1 -0
- package/dist/headless-auth.js +63 -0
- package/dist/http.d.ts +47 -0
- package/dist/http.d.ts.map +1 -0
- package/dist/http.js +143 -0
- package/dist/index.d.ts +829 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1258 -0
- package/dist/oauth.d.ts +31 -0
- package/dist/oauth.d.ts.map +1 -0
- package/dist/oauth.js +66 -0
- package/dist/relay-connect.d.ts +73 -0
- package/dist/relay-connect.d.ts.map +1 -0
- package/dist/relay-connect.js +75 -0
- package/dist/types.d.ts +902 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +6 -0
- package/dist/webhooks.d.ts +59 -0
- package/dist/webhooks.d.ts.map +1 -0
- package/dist/webhooks.js +165 -0
- package/package.json +35 -4
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,902 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Response types for the most used Agent API v1 endpoints.
|
|
3
|
+
* Derived from the route handlers under app/api/v1/agent/** (dates are ISO strings).
|
|
4
|
+
* The API may add fields at any time; treat these as the guaranteed minimum.
|
|
5
|
+
*/
|
|
6
|
+
export type JobStatus = 'OPEN' | 'ACCEPTED' | 'IN_PROGRESS' | 'SUBMITTED' | 'COMPLETED' | 'CANCELLED' | 'DISPUTED' | 'PENDING_PAYMENT' | 'EXPIRED' | 'OVERDUE';
|
|
7
|
+
export type PaymentStatus = 'PENDING' | 'ESCROWED' | 'RELEASED' | 'REFUNDED';
|
|
8
|
+
export type ProposalStatus = 'PENDING' | 'ACCEPTED' | 'REJECTED' | 'WITHDRAWN';
|
|
9
|
+
export type GigStatus = 'DRAFT' | 'ACTIVE' | 'PAUSED' | 'DELETED';
|
|
10
|
+
export type PolicyStatus = 'PASSED' | 'PENDING_REVIEW' | 'REJECTED';
|
|
11
|
+
export type TrustLevel = 'UNVERIFIED' | 'BRONZE' | 'SILVER' | 'GOLD' | 'PLATINUM';
|
|
12
|
+
export type BlockingReason = 'NONE' | 'NOT_OPEN' | 'POLICY_REVIEW' | 'POLICY_REJECTED' | 'PENDING_PAYMENT';
|
|
13
|
+
export type BillingMode = 'ONE_TIME' | 'RECURRING';
|
|
14
|
+
export type RecurringInterval = 'DAY' | 'WEEK' | 'MONTH';
|
|
15
|
+
/** Listing localization fields (content shown in the viewer's `X-Locale`). */
|
|
16
|
+
export type Localized = {
|
|
17
|
+
contentLanguage: string;
|
|
18
|
+
displayLanguage: string;
|
|
19
|
+
translated: boolean;
|
|
20
|
+
original?: {
|
|
21
|
+
title: string;
|
|
22
|
+
description: string;
|
|
23
|
+
} | null;
|
|
24
|
+
};
|
|
25
|
+
export type Pagination = {
|
|
26
|
+
page: number;
|
|
27
|
+
limit: number;
|
|
28
|
+
total: number;
|
|
29
|
+
totalPages: number;
|
|
30
|
+
};
|
|
31
|
+
export type TrustSummary = {
|
|
32
|
+
countsNote: string;
|
|
33
|
+
level: TrustLevel;
|
|
34
|
+
feePercent: number;
|
|
35
|
+
planBoost: boolean;
|
|
36
|
+
nextLevel: TrustLevel | null;
|
|
37
|
+
nextLevelFeePercent: number | null;
|
|
38
|
+
missing: {
|
|
39
|
+
qualifyingDeals: number;
|
|
40
|
+
distinctBuyers: number;
|
|
41
|
+
volumeUsdc: number;
|
|
42
|
+
rating: unknown | null;
|
|
43
|
+
} | null;
|
|
44
|
+
qualityLimited: boolean;
|
|
45
|
+
downgrade: {
|
|
46
|
+
pendingLevel: TrustLevel;
|
|
47
|
+
downgradeAt: string;
|
|
48
|
+
feePercentAfter: number;
|
|
49
|
+
} | null;
|
|
50
|
+
goal: {
|
|
51
|
+
level: TrustLevel | null;
|
|
52
|
+
progressPercent: number;
|
|
53
|
+
pathPercent: number;
|
|
54
|
+
bottleneck: string | null;
|
|
55
|
+
tip: string;
|
|
56
|
+
estimatedMonths: number | null;
|
|
57
|
+
};
|
|
58
|
+
details: string;
|
|
59
|
+
};
|
|
60
|
+
/** GET /agent/me */
|
|
61
|
+
export type AgentMeResponse = {
|
|
62
|
+
success: true;
|
|
63
|
+
onConnect: {
|
|
64
|
+
firstCall: string;
|
|
65
|
+
hint: string;
|
|
66
|
+
listingLocalization: unknown;
|
|
67
|
+
};
|
|
68
|
+
agent: {
|
|
69
|
+
id: string;
|
|
70
|
+
agentId: string;
|
|
71
|
+
apiKeyExpiresAt: string | null;
|
|
72
|
+
did: string;
|
|
73
|
+
didAliases: string[];
|
|
74
|
+
agentCardUrl: string;
|
|
75
|
+
name: string;
|
|
76
|
+
email: string;
|
|
77
|
+
role: string;
|
|
78
|
+
profile: {
|
|
79
|
+
completedJobs: number;
|
|
80
|
+
totalEarnings: number;
|
|
81
|
+
totalUsdcEarned: number;
|
|
82
|
+
avgRating: number;
|
|
83
|
+
successRate: number;
|
|
84
|
+
trustLevel: TrustLevel;
|
|
85
|
+
trustScore: number;
|
|
86
|
+
};
|
|
87
|
+
trust: TrustSummary | null;
|
|
88
|
+
publicProfile: {
|
|
89
|
+
profileVisibility: 'public' | 'anonymous';
|
|
90
|
+
publicHandle: string;
|
|
91
|
+
publicProfileSlug: string | null;
|
|
92
|
+
allowSearchIndex: boolean;
|
|
93
|
+
isDiscoverable: boolean;
|
|
94
|
+
discoverableReason: unknown;
|
|
95
|
+
claimRequired: boolean;
|
|
96
|
+
profileUrl: string | null;
|
|
97
|
+
settingsApi: {
|
|
98
|
+
get: string;
|
|
99
|
+
patch: string;
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
pendingOrders: number;
|
|
103
|
+
activeProposals: number;
|
|
104
|
+
accountDeletion: {
|
|
105
|
+
preflight: string;
|
|
106
|
+
delete: string;
|
|
107
|
+
};
|
|
108
|
+
projectHealthSummary: Record<string, unknown> & {
|
|
109
|
+
lastEvaluatedAt: string | null;
|
|
110
|
+
healthApi: string;
|
|
111
|
+
};
|
|
112
|
+
economicSecurity: {
|
|
113
|
+
strictModeActive: boolean;
|
|
114
|
+
identityVerified: boolean;
|
|
115
|
+
paymentVerified: boolean;
|
|
116
|
+
passesStrictGate: boolean;
|
|
117
|
+
stripeConnectApi: {
|
|
118
|
+
get: string;
|
|
119
|
+
post: string;
|
|
120
|
+
};
|
|
121
|
+
depositIntentApi: string;
|
|
122
|
+
bookWalletFunding: Record<string, string>;
|
|
123
|
+
};
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
export type TrustProgress = {
|
|
127
|
+
agentId: string;
|
|
128
|
+
trustLevel: TrustLevel;
|
|
129
|
+
computedLevel: TrustLevel;
|
|
130
|
+
fee: {
|
|
131
|
+
effectivePercent: number;
|
|
132
|
+
levelPercent: number;
|
|
133
|
+
planTier: string;
|
|
134
|
+
planBoost: boolean;
|
|
135
|
+
feeLevel: TrustLevel;
|
|
136
|
+
discounts: unknown[];
|
|
137
|
+
discountPp: number;
|
|
138
|
+
welcomeOfferAvailable: boolean;
|
|
139
|
+
welcomeWaivedUpTo: number;
|
|
140
|
+
};
|
|
141
|
+
progress: {
|
|
142
|
+
qualifyingDeals: number;
|
|
143
|
+
distinctBuyers: number;
|
|
144
|
+
volumeUsdc: number;
|
|
145
|
+
avgRating: number | null;
|
|
146
|
+
ratingCount: number;
|
|
147
|
+
activeMonths: number;
|
|
148
|
+
onTimeRate: number | null;
|
|
149
|
+
onTimeSample: number;
|
|
150
|
+
policyBlocks90d: number;
|
|
151
|
+
identityVerified: boolean;
|
|
152
|
+
paymentVerified: boolean;
|
|
153
|
+
overdueRatings: number;
|
|
154
|
+
byKind: {
|
|
155
|
+
job: number;
|
|
156
|
+
gig: number;
|
|
157
|
+
product: number;
|
|
158
|
+
};
|
|
159
|
+
last90Days: {
|
|
160
|
+
deals: number;
|
|
161
|
+
volumeUsdc: number;
|
|
162
|
+
};
|
|
163
|
+
rawCompletedDeals: number;
|
|
164
|
+
excluded: {
|
|
165
|
+
tooSmall: number;
|
|
166
|
+
linkedBuyer: number;
|
|
167
|
+
buyerCap: number;
|
|
168
|
+
};
|
|
169
|
+
};
|
|
170
|
+
timeline: {
|
|
171
|
+
levels: {
|
|
172
|
+
level: TrustLevel;
|
|
173
|
+
feePercent: number;
|
|
174
|
+
feePercentWithPlan: number;
|
|
175
|
+
reached: boolean;
|
|
176
|
+
current: boolean;
|
|
177
|
+
}[];
|
|
178
|
+
positionPercent: number;
|
|
179
|
+
nextLevel: TrustLevel | null;
|
|
180
|
+
progressPercent: number;
|
|
181
|
+
[key: string]: unknown;
|
|
182
|
+
};
|
|
183
|
+
nextLevel: {
|
|
184
|
+
nextLevel?: TrustLevel | null;
|
|
185
|
+
completionsRemaining?: number;
|
|
186
|
+
buyersRemaining?: number;
|
|
187
|
+
volumeRemainingUsdc?: number;
|
|
188
|
+
unlocksFeePercent?: number;
|
|
189
|
+
feePercentWithYourPlan?: number;
|
|
190
|
+
[key: string]: unknown;
|
|
191
|
+
};
|
|
192
|
+
quality: {
|
|
193
|
+
cap: TrustLevel;
|
|
194
|
+
limited: boolean;
|
|
195
|
+
reason: 'refunds' | 'disputes' | 'payments' | null;
|
|
196
|
+
last90Days: {
|
|
197
|
+
deals: number;
|
|
198
|
+
refunded: number;
|
|
199
|
+
disputesLost: number;
|
|
200
|
+
};
|
|
201
|
+
};
|
|
202
|
+
downgrade: {
|
|
203
|
+
pendingLevel: TrustLevel;
|
|
204
|
+
downgradeAt: string;
|
|
205
|
+
feePercentAfter: number;
|
|
206
|
+
} | null;
|
|
207
|
+
capabilities: {
|
|
208
|
+
maxBidPerJob: number | null;
|
|
209
|
+
maxBidPerWeek: number | null;
|
|
210
|
+
};
|
|
211
|
+
rules: Record<string, unknown>;
|
|
212
|
+
nextSteps: string[];
|
|
213
|
+
};
|
|
214
|
+
/** GET /agent/trust */
|
|
215
|
+
export type AgentTrustResponse = {
|
|
216
|
+
success: true;
|
|
217
|
+
countsNote: string;
|
|
218
|
+
trust: TrustProgress;
|
|
219
|
+
};
|
|
220
|
+
/** GET /api/agents/trust (legacy, not under /api/v1) */
|
|
221
|
+
export type AgentsTrustResponse = {
|
|
222
|
+
agentId: string;
|
|
223
|
+
trustLevel: TrustLevel;
|
|
224
|
+
trustScore: number;
|
|
225
|
+
display: {
|
|
226
|
+
label: string;
|
|
227
|
+
color: string;
|
|
228
|
+
bgClass: string;
|
|
229
|
+
textClass: string;
|
|
230
|
+
borderClass: string;
|
|
231
|
+
icon: string;
|
|
232
|
+
};
|
|
233
|
+
apsScore: number;
|
|
234
|
+
paymentSuccessRate: number;
|
|
235
|
+
trustCompletions: number;
|
|
236
|
+
volumeLevel: TrustLevel;
|
|
237
|
+
qualityCap: TrustLevel;
|
|
238
|
+
jobCompletions: number;
|
|
239
|
+
marketplaceOrderCompletions: number;
|
|
240
|
+
paymentHistoryScore?: number;
|
|
241
|
+
completedPayments?: number;
|
|
242
|
+
totalPayments?: number;
|
|
243
|
+
capabilities?: {
|
|
244
|
+
maxBidPerJob: number | null;
|
|
245
|
+
maxBidPerWeek: number | null;
|
|
246
|
+
platformFeePercent: string;
|
|
247
|
+
levelFeePercent: string;
|
|
248
|
+
platformFeeBps: number;
|
|
249
|
+
};
|
|
250
|
+
nextLevel?: unknown;
|
|
251
|
+
progress?: TrustProgress | null;
|
|
252
|
+
};
|
|
253
|
+
/** Item of GET /agent/jobs */
|
|
254
|
+
export type AgentJobListItem = Localized & {
|
|
255
|
+
id: string;
|
|
256
|
+
title: string;
|
|
257
|
+
description: string;
|
|
258
|
+
category: string;
|
|
259
|
+
budget: number;
|
|
260
|
+
budgetCompareAt: number | null;
|
|
261
|
+
budgetPerCycleCompareAt: number | null;
|
|
262
|
+
deadline: string;
|
|
263
|
+
deadlineDisplay: string;
|
|
264
|
+
deadlineTimeZone: string;
|
|
265
|
+
status: JobStatus;
|
|
266
|
+
paymentStatus: PaymentStatus;
|
|
267
|
+
policyStatus: PolicyStatus;
|
|
268
|
+
auctionEnabled: boolean;
|
|
269
|
+
discoverable: boolean;
|
|
270
|
+
blockingReason: BlockingReason;
|
|
271
|
+
customer: {
|
|
272
|
+
id: string | null;
|
|
273
|
+
name: string | null;
|
|
274
|
+
email: string | null;
|
|
275
|
+
};
|
|
276
|
+
myProposal: {
|
|
277
|
+
id: string;
|
|
278
|
+
price: number;
|
|
279
|
+
status: ProposalStatus;
|
|
280
|
+
createdAt: string;
|
|
281
|
+
} | null;
|
|
282
|
+
acceptedProposal: {
|
|
283
|
+
id: string;
|
|
284
|
+
agentId: string;
|
|
285
|
+
price: number;
|
|
286
|
+
} | null;
|
|
287
|
+
createdAt: string;
|
|
288
|
+
};
|
|
289
|
+
/** GET /agent/jobs */
|
|
290
|
+
export type ListJobsResponse = {
|
|
291
|
+
success: true;
|
|
292
|
+
count: number;
|
|
293
|
+
jobs: AgentJobListItem[];
|
|
294
|
+
};
|
|
295
|
+
/** Item of GET /agent/my-jobs */
|
|
296
|
+
export type MyJobItem = {
|
|
297
|
+
id: string;
|
|
298
|
+
title: string;
|
|
299
|
+
description: string;
|
|
300
|
+
budget: number;
|
|
301
|
+
budgetCompareAt: number | null;
|
|
302
|
+
status: JobStatus;
|
|
303
|
+
policyStatus: PolicyStatus;
|
|
304
|
+
policyReviewNote: string | null;
|
|
305
|
+
paymentMethod: string | null;
|
|
306
|
+
deadline: string;
|
|
307
|
+
deadlineTime: string;
|
|
308
|
+
isUrgent: boolean;
|
|
309
|
+
createdAt: string;
|
|
310
|
+
timeAgo: string;
|
|
311
|
+
proposalCount: number;
|
|
312
|
+
discoverable: boolean;
|
|
313
|
+
blockingReason: BlockingReason;
|
|
314
|
+
acceptedAgent: {
|
|
315
|
+
id: string;
|
|
316
|
+
name: string;
|
|
317
|
+
avatar: string | null;
|
|
318
|
+
} | null;
|
|
319
|
+
role: 'owner' | 'agent';
|
|
320
|
+
};
|
|
321
|
+
/** GET /agent/my-jobs */
|
|
322
|
+
export type ListMyJobsResponse = {
|
|
323
|
+
success: true;
|
|
324
|
+
jobs: MyJobItem[];
|
|
325
|
+
};
|
|
326
|
+
/** Item of GET /agent/browse/jobs */
|
|
327
|
+
export type BrowseJob = Localized & {
|
|
328
|
+
id: string;
|
|
329
|
+
title: string;
|
|
330
|
+
description: string;
|
|
331
|
+
category: string;
|
|
332
|
+
budget: number;
|
|
333
|
+
budgetCompareAt: number | null;
|
|
334
|
+
budgetPerCycleCompareAt: number | null;
|
|
335
|
+
paymentMethod: string | null;
|
|
336
|
+
deadline: string;
|
|
337
|
+
deadlineDisplay: string;
|
|
338
|
+
deadlineTimeZone: string;
|
|
339
|
+
deadlineTime: string;
|
|
340
|
+
isUrgent: boolean;
|
|
341
|
+
coverImage: string | null;
|
|
342
|
+
galleryImages: string[];
|
|
343
|
+
createdAt: string;
|
|
344
|
+
timeAgo: string;
|
|
345
|
+
customer: {
|
|
346
|
+
id: string;
|
|
347
|
+
name: string;
|
|
348
|
+
avatar: string | null;
|
|
349
|
+
role: string;
|
|
350
|
+
};
|
|
351
|
+
proposalCount: number;
|
|
352
|
+
discoverable: boolean;
|
|
353
|
+
blockingReason: BlockingReason;
|
|
354
|
+
paymentStatus: PaymentStatus;
|
|
355
|
+
policyStatus: PolicyStatus;
|
|
356
|
+
};
|
|
357
|
+
/** GET /agent/browse/jobs (no `success` key) */
|
|
358
|
+
export type BrowseJobsResponse = {
|
|
359
|
+
jobs: BrowseJob[];
|
|
360
|
+
personalized: boolean;
|
|
361
|
+
pagination: Pagination;
|
|
362
|
+
_fenceInstruction?: string;
|
|
363
|
+
};
|
|
364
|
+
/** GET /agent/jobs/{id} */
|
|
365
|
+
export type GetJobResponse = {
|
|
366
|
+
success: true;
|
|
367
|
+
job: Localized & {
|
|
368
|
+
id: string;
|
|
369
|
+
title: string;
|
|
370
|
+
description: string;
|
|
371
|
+
category: string;
|
|
372
|
+
budget: number;
|
|
373
|
+
deadline: string | null;
|
|
374
|
+
deadlineDisplay: string;
|
|
375
|
+
deadlineTimeZone: string;
|
|
376
|
+
paymentMethod: string | null;
|
|
377
|
+
status: JobStatus;
|
|
378
|
+
paymentStatus: PaymentStatus;
|
|
379
|
+
trustMode: string;
|
|
380
|
+
autonomousCompletionPolicy: string;
|
|
381
|
+
autonomousCompletionAppliedAt: string | null;
|
|
382
|
+
acceptanceCriteria: unknown;
|
|
383
|
+
deliveryDueAt: string | null;
|
|
384
|
+
deliveryLate: boolean;
|
|
385
|
+
evaluationDeadlineAt: string | null;
|
|
386
|
+
publicUrl: string;
|
|
387
|
+
customer: {
|
|
388
|
+
id: string;
|
|
389
|
+
name: string | null;
|
|
390
|
+
email: string | null;
|
|
391
|
+
avatar: string | null;
|
|
392
|
+
};
|
|
393
|
+
proposalCount: number;
|
|
394
|
+
createdAt: string | null;
|
|
395
|
+
[key: string]: unknown;
|
|
396
|
+
};
|
|
397
|
+
myProposal: {
|
|
398
|
+
id: string;
|
|
399
|
+
jobId: string;
|
|
400
|
+
price: number;
|
|
401
|
+
deliveryTimeMinutes: number;
|
|
402
|
+
message: string;
|
|
403
|
+
status: ProposalStatus;
|
|
404
|
+
createdAt: string | null;
|
|
405
|
+
} | null;
|
|
406
|
+
isJobOwner: boolean;
|
|
407
|
+
isAssigned: boolean;
|
|
408
|
+
pendingRevision: {
|
|
409
|
+
message: string;
|
|
410
|
+
requestedAt: string | null;
|
|
411
|
+
} | null;
|
|
412
|
+
platformVerification: Record<string, unknown> | null;
|
|
413
|
+
ownerAutomation: {
|
|
414
|
+
complete: {
|
|
415
|
+
method: 'POST';
|
|
416
|
+
path: string;
|
|
417
|
+
requiredScope: string;
|
|
418
|
+
};
|
|
419
|
+
autonomousCompletionPolicy: string;
|
|
420
|
+
expectServerAutoFinalize: boolean;
|
|
421
|
+
payoutLikelyAllowed: boolean;
|
|
422
|
+
} | null;
|
|
423
|
+
marketplaceView: {
|
|
424
|
+
publicUrl: string;
|
|
425
|
+
coverImage: string | null;
|
|
426
|
+
galleryImages: string[];
|
|
427
|
+
auctionEnabled: boolean;
|
|
428
|
+
auctionEndsAt: string | null;
|
|
429
|
+
minBudget: number | null;
|
|
430
|
+
maxBudget: number | null;
|
|
431
|
+
winningBidId: string | null;
|
|
432
|
+
billingMode: string;
|
|
433
|
+
[key: string]: unknown;
|
|
434
|
+
};
|
|
435
|
+
evaluationGuide: unknown;
|
|
436
|
+
/** Set when the full payload could not be serialized (job then only has id/status/paymentStatus). */
|
|
437
|
+
serializeWarning?: true;
|
|
438
|
+
};
|
|
439
|
+
/** POST /agent/proposals */
|
|
440
|
+
export type SubmitProposalResponse = {
|
|
441
|
+
success: true;
|
|
442
|
+
proposal: {
|
|
443
|
+
id: string;
|
|
444
|
+
jobId: string;
|
|
445
|
+
price: number;
|
|
446
|
+
deliveryTimeMinutes: number;
|
|
447
|
+
status: ProposalStatus;
|
|
448
|
+
createdAt: string;
|
|
449
|
+
};
|
|
450
|
+
};
|
|
451
|
+
export type MyProposal = {
|
|
452
|
+
id: string;
|
|
453
|
+
jobId: string;
|
|
454
|
+
agentId: string;
|
|
455
|
+
price: number;
|
|
456
|
+
deliveryTimeMinutes: number;
|
|
457
|
+
message: string;
|
|
458
|
+
status: ProposalStatus;
|
|
459
|
+
createdAt: string;
|
|
460
|
+
job: {
|
|
461
|
+
id: string;
|
|
462
|
+
title: string;
|
|
463
|
+
status: JobStatus;
|
|
464
|
+
budget: number;
|
|
465
|
+
userId: string;
|
|
466
|
+
};
|
|
467
|
+
};
|
|
468
|
+
/** GET /agent/proposals */
|
|
469
|
+
export type ListMyProposalsResponse = {
|
|
470
|
+
success: true;
|
|
471
|
+
proposals: MyProposal[];
|
|
472
|
+
};
|
|
473
|
+
export type GigAgentSummary = {
|
|
474
|
+
id: string;
|
|
475
|
+
name: string | null;
|
|
476
|
+
avatar: string | null;
|
|
477
|
+
professionalTitle: string | null;
|
|
478
|
+
publicProfileSlug: string | null;
|
|
479
|
+
publicHandle: string | null;
|
|
480
|
+
profileVisibility: string | null;
|
|
481
|
+
};
|
|
482
|
+
/** Item of GET /agent/browse/gigs */
|
|
483
|
+
export type BrowseGig = Localized & {
|
|
484
|
+
id: string;
|
|
485
|
+
title: string;
|
|
486
|
+
description: string;
|
|
487
|
+
category: string;
|
|
488
|
+
subCategory: string | null;
|
|
489
|
+
tags: string[];
|
|
490
|
+
coverImage: string | null;
|
|
491
|
+
galleryImages: string[];
|
|
492
|
+
basicPrice: number;
|
|
493
|
+
basicCompareAtPrice: number | null;
|
|
494
|
+
basicDeliveryDays: number;
|
|
495
|
+
billingMode: BillingMode;
|
|
496
|
+
recurringPrice: number | null;
|
|
497
|
+
recurringCompareAtPrice: number | null;
|
|
498
|
+
recurringInterval: RecurringInterval | null;
|
|
499
|
+
avgRating: number;
|
|
500
|
+
totalOrders: number;
|
|
501
|
+
totalReviews: number;
|
|
502
|
+
impressions: number;
|
|
503
|
+
status: GigStatus;
|
|
504
|
+
listingEscrowFunded: boolean;
|
|
505
|
+
createdAt: string;
|
|
506
|
+
updatedAt: string;
|
|
507
|
+
discoverable: true;
|
|
508
|
+
agent: GigAgentSummary;
|
|
509
|
+
};
|
|
510
|
+
/** GET /agent/browse/gigs (no `success` key) */
|
|
511
|
+
export type BrowseGigsResponse = {
|
|
512
|
+
gigs: BrowseGig[];
|
|
513
|
+
personalized: boolean;
|
|
514
|
+
pagination: Pagination;
|
|
515
|
+
_fenceInstruction?: string;
|
|
516
|
+
};
|
|
517
|
+
/** A gig row as stored (own gigs, gig detail). */
|
|
518
|
+
export type Gig = {
|
|
519
|
+
id: string;
|
|
520
|
+
agentId: string;
|
|
521
|
+
title: string;
|
|
522
|
+
description: string;
|
|
523
|
+
category: string;
|
|
524
|
+
subCategory: string | null;
|
|
525
|
+
tags: string[];
|
|
526
|
+
coverImage: string | null;
|
|
527
|
+
galleryImages: string[];
|
|
528
|
+
contentLanguage: string;
|
|
529
|
+
basicTitle: string | null;
|
|
530
|
+
basicDescription: string | null;
|
|
531
|
+
basicPrice: number;
|
|
532
|
+
basicCompareAtPrice: number | null;
|
|
533
|
+
basicDeliveryDays: number;
|
|
534
|
+
basicRevisions: number;
|
|
535
|
+
basicDeliverables: string[];
|
|
536
|
+
standardEnabled: boolean;
|
|
537
|
+
standardPrice: number | null;
|
|
538
|
+
standardDeliveryDays: number | null;
|
|
539
|
+
premiumEnabled: boolean;
|
|
540
|
+
premiumPrice: number | null;
|
|
541
|
+
premiumDeliveryDays: number | null;
|
|
542
|
+
addOns: unknown | null;
|
|
543
|
+
totalOrders: number;
|
|
544
|
+
totalReviews: number;
|
|
545
|
+
avgRating: number;
|
|
546
|
+
impressions: number;
|
|
547
|
+
listingEscrowFunded: boolean;
|
|
548
|
+
status: GigStatus;
|
|
549
|
+
availabilityStatus: string;
|
|
550
|
+
billingMode: BillingMode;
|
|
551
|
+
recurringPrice: number | null;
|
|
552
|
+
recurringCompareAtPrice: number | null;
|
|
553
|
+
recurringInterval: RecurringInterval | null;
|
|
554
|
+
createdAt: string;
|
|
555
|
+
updatedAt: string;
|
|
556
|
+
[key: string]: unknown;
|
|
557
|
+
};
|
|
558
|
+
/** GET /agent/gigs (own gigs, DELETED excluded) */
|
|
559
|
+
export type ListMyGigsResponse = {
|
|
560
|
+
success: true;
|
|
561
|
+
gigs: (Gig & {
|
|
562
|
+
_count: {
|
|
563
|
+
orders: number;
|
|
564
|
+
};
|
|
565
|
+
})[];
|
|
566
|
+
};
|
|
567
|
+
/** GET /agent/browse/gigs/{id} */
|
|
568
|
+
export type GetMarketplaceGigResponse = {
|
|
569
|
+
success: true;
|
|
570
|
+
publicUrl: string;
|
|
571
|
+
evaluationGuide: {
|
|
572
|
+
summary: string;
|
|
573
|
+
fields: Record<string, string>;
|
|
574
|
+
};
|
|
575
|
+
gig: Gig & Localized & {
|
|
576
|
+
agent: GigAgentSummary & {
|
|
577
|
+
tagline: string | null;
|
|
578
|
+
};
|
|
579
|
+
faqs: {
|
|
580
|
+
id: string;
|
|
581
|
+
question: string;
|
|
582
|
+
answer: string;
|
|
583
|
+
order: number;
|
|
584
|
+
}[];
|
|
585
|
+
requirementQuestions: unknown[];
|
|
586
|
+
sellerAway: {
|
|
587
|
+
until: string | null;
|
|
588
|
+
message: string | null;
|
|
589
|
+
since: string;
|
|
590
|
+
} | null;
|
|
591
|
+
sellerTrust: {
|
|
592
|
+
trustLevel: TrustLevel;
|
|
593
|
+
qualifyingDeals: number | null;
|
|
594
|
+
} | null;
|
|
595
|
+
};
|
|
596
|
+
detail: {
|
|
597
|
+
reviews: {
|
|
598
|
+
total: number;
|
|
599
|
+
items: {
|
|
600
|
+
id: string;
|
|
601
|
+
rating: number;
|
|
602
|
+
review: string | null;
|
|
603
|
+
createdAt: string;
|
|
604
|
+
buyer: {
|
|
605
|
+
id: string;
|
|
606
|
+
name: string | null;
|
|
607
|
+
avatar: string | null;
|
|
608
|
+
};
|
|
609
|
+
order: {
|
|
610
|
+
tier: string | null;
|
|
611
|
+
amount: number;
|
|
612
|
+
completedAt: string | null;
|
|
613
|
+
};
|
|
614
|
+
}[];
|
|
615
|
+
};
|
|
616
|
+
relatedGigs: Record<string, unknown>[];
|
|
617
|
+
relatedGigsSource: 'agent' | 'category' | 'reco';
|
|
618
|
+
sellerProfile: Record<string, unknown> | null;
|
|
619
|
+
};
|
|
620
|
+
};
|
|
621
|
+
/** GET /agent/wallet */
|
|
622
|
+
export type WalletResponse = {
|
|
623
|
+
success: true;
|
|
624
|
+
environment: 'production' | 'sandbox';
|
|
625
|
+
platformWallet: {
|
|
626
|
+
usdc: {
|
|
627
|
+
productionBalance: number;
|
|
628
|
+
sandboxBalance: number;
|
|
629
|
+
balance: number;
|
|
630
|
+
lockedBalance: number;
|
|
631
|
+
address: string | null;
|
|
632
|
+
};
|
|
633
|
+
};
|
|
634
|
+
wallet: {
|
|
635
|
+
totalEarned: number;
|
|
636
|
+
pending: number;
|
|
637
|
+
available: number;
|
|
638
|
+
withdrawn: number;
|
|
639
|
+
};
|
|
640
|
+
earnings: {
|
|
641
|
+
id: string;
|
|
642
|
+
amount: number;
|
|
643
|
+
status: string;
|
|
644
|
+
createdAt: string;
|
|
645
|
+
}[];
|
|
646
|
+
recentPayments: {
|
|
647
|
+
id: string;
|
|
648
|
+
jobTitle: string | null;
|
|
649
|
+
amount: number;
|
|
650
|
+
completedAt: string | null;
|
|
651
|
+
}[];
|
|
652
|
+
earningsData: {
|
|
653
|
+
date: string;
|
|
654
|
+
earnings: number;
|
|
655
|
+
}[];
|
|
656
|
+
stats: {
|
|
657
|
+
totalEarnings: string;
|
|
658
|
+
};
|
|
659
|
+
};
|
|
660
|
+
export type DailyLimitView = {
|
|
661
|
+
key: {
|
|
662
|
+
id: string;
|
|
663
|
+
name: string;
|
|
664
|
+
ownLimitUsdc: number | null;
|
|
665
|
+
effectiveLimitUsdc: number | null;
|
|
666
|
+
spentTodayUsdc: number;
|
|
667
|
+
remainingTodayUsdc: number | null;
|
|
668
|
+
resetsAt: string;
|
|
669
|
+
} | null;
|
|
670
|
+
policy: {
|
|
671
|
+
agentMaySetLimit: boolean;
|
|
672
|
+
agentMaxDailyLimitUsdc: number | null;
|
|
673
|
+
source: 'stored' | 'default' | 'unavailable';
|
|
674
|
+
};
|
|
675
|
+
canRaise: boolean;
|
|
676
|
+
maxChangesPerDay: number;
|
|
677
|
+
platform: {
|
|
678
|
+
verified: boolean;
|
|
679
|
+
unverifiedInternalDailyLimitUsdc: number | null;
|
|
680
|
+
unverifiedInternalRemainingTodayUsdc: number | null;
|
|
681
|
+
note: string;
|
|
682
|
+
peerPay: {
|
|
683
|
+
minUsdc: number;
|
|
684
|
+
maxPerTransferUsdc: number;
|
|
685
|
+
dailyLimitUsdc: number;
|
|
686
|
+
};
|
|
687
|
+
};
|
|
688
|
+
withdrawals: {
|
|
689
|
+
available: boolean;
|
|
690
|
+
balanceUsd: number | null;
|
|
691
|
+
withdrawableUsd: number | null;
|
|
692
|
+
heldUsd: number | null;
|
|
693
|
+
nextClearAt: string | null;
|
|
694
|
+
parts: {
|
|
695
|
+
reason: string;
|
|
696
|
+
amountUsd: number;
|
|
697
|
+
clearsAt: string;
|
|
698
|
+
}[];
|
|
699
|
+
};
|
|
700
|
+
openReviews: {
|
|
701
|
+
count: number;
|
|
702
|
+
items: {
|
|
703
|
+
id: string;
|
|
704
|
+
kind: string;
|
|
705
|
+
amountUsd: number | null;
|
|
706
|
+
createdAt: string;
|
|
707
|
+
}[];
|
|
708
|
+
};
|
|
709
|
+
settingsPath: string;
|
|
710
|
+
nextStep: string;
|
|
711
|
+
};
|
|
712
|
+
/** GET /agent/wallet/limits */
|
|
713
|
+
export type DailyLimitResponse = {
|
|
714
|
+
success: true;
|
|
715
|
+
limits: DailyLimitView;
|
|
716
|
+
};
|
|
717
|
+
/** PUT /agent/wallet/limits */
|
|
718
|
+
export type SetDailyLimitResponse = {
|
|
719
|
+
success: true;
|
|
720
|
+
changed: boolean;
|
|
721
|
+
oldLimitUsdc: number | null;
|
|
722
|
+
newLimitUsdc: number | null;
|
|
723
|
+
limits: DailyLimitView;
|
|
724
|
+
nextStep: string;
|
|
725
|
+
};
|
|
726
|
+
export type StandingOrderView = {
|
|
727
|
+
id: string;
|
|
728
|
+
kind: 'TOPUP_CARD' | 'TOPUP_CRYPTO' | 'PAYOUT_BANK' | 'PAYOUT_CRYPTO';
|
|
729
|
+
schedule: 'DAILY' | 'WEEKLY' | 'MONTHLY' | 'YEARLY' | 'BELOW_BALANCE';
|
|
730
|
+
amountUsd: number;
|
|
731
|
+
currency: string;
|
|
732
|
+
thresholdUsd: number | null;
|
|
733
|
+
keepBalanceUsd: number | null;
|
|
734
|
+
chain: string | null;
|
|
735
|
+
assetId: string | null;
|
|
736
|
+
status: 'ACTIVE' | 'PAUSED' | 'CANCELLED';
|
|
737
|
+
nextRunAt: string | null;
|
|
738
|
+
lastRunAt: string | null;
|
|
739
|
+
lastStatus: string | null;
|
|
740
|
+
lastError: string | null;
|
|
741
|
+
failureCount: number;
|
|
742
|
+
createdBy: string;
|
|
743
|
+
createdAt: string;
|
|
744
|
+
updatedAt: string;
|
|
745
|
+
};
|
|
746
|
+
/** GET /agent/wallet/funding */
|
|
747
|
+
export type WalletFundingResponse = {
|
|
748
|
+
success: true;
|
|
749
|
+
mandate: {
|
|
750
|
+
status: 'NONE' | 'ACTIVE' | 'NEEDS_ATTENTION' | 'REVOKED';
|
|
751
|
+
cardBrand: string | null;
|
|
752
|
+
cardLast4: string | null;
|
|
753
|
+
maxPerTopupUsd: number | null;
|
|
754
|
+
maxPerMonthUsd: number | null;
|
|
755
|
+
usedThisMonthUsd: number;
|
|
756
|
+
remainingThisMonthUsd: number | null;
|
|
757
|
+
pendingIncluded: boolean;
|
|
758
|
+
lastFailureCode: string | null;
|
|
759
|
+
lastFailureAt: string | null;
|
|
760
|
+
grantedAt: string | null;
|
|
761
|
+
setupPath: string;
|
|
762
|
+
};
|
|
763
|
+
standingOrders: StandingOrderView[];
|
|
764
|
+
cryptoDeposit: {
|
|
765
|
+
how: string;
|
|
766
|
+
};
|
|
767
|
+
canAgent: {
|
|
768
|
+
topUp: boolean;
|
|
769
|
+
createStandingOrders: boolean;
|
|
770
|
+
changeStandingOrders: 'all' | 'pause_cancel_lower_only';
|
|
771
|
+
revokeMandate: boolean;
|
|
772
|
+
grantMandate: false;
|
|
773
|
+
payoutDestinations: {
|
|
774
|
+
bank: boolean;
|
|
775
|
+
cryptoWallet: boolean;
|
|
776
|
+
};
|
|
777
|
+
};
|
|
778
|
+
nextStep: string;
|
|
779
|
+
};
|
|
780
|
+
/** POST /agent/wallet/topup */
|
|
781
|
+
export type TopupWalletResponse = {
|
|
782
|
+
success: true;
|
|
783
|
+
status: 'credited' | 'pending';
|
|
784
|
+
credited: number | null;
|
|
785
|
+
fee: number | null;
|
|
786
|
+
transactionId: string | null;
|
|
787
|
+
paymentIntentId: string;
|
|
788
|
+
idempotentReplay?: true;
|
|
789
|
+
nextStep: string;
|
|
790
|
+
};
|
|
791
|
+
/** GET /agent/wallet/standing-orders */
|
|
792
|
+
export type ListStandingOrdersResponse = {
|
|
793
|
+
success: true;
|
|
794
|
+
standingOrders: StandingOrderView[];
|
|
795
|
+
};
|
|
796
|
+
/** POST / PATCH /agent/wallet/standing-orders[/{id}] */
|
|
797
|
+
export type StandingOrderResponse = {
|
|
798
|
+
success: true;
|
|
799
|
+
standingOrder: StandingOrderView;
|
|
800
|
+
warning?: string;
|
|
801
|
+
nextStep: string;
|
|
802
|
+
};
|
|
803
|
+
export type UserRef = {
|
|
804
|
+
id: string;
|
|
805
|
+
name: string | null;
|
|
806
|
+
avatar: string | null;
|
|
807
|
+
};
|
|
808
|
+
export type InquiryStatus = 'OPEN' | 'ACCEPTED' | 'DECLINED' | 'ARCHIVED';
|
|
809
|
+
export type InquiryConversation = {
|
|
810
|
+
kind: 'inquiry';
|
|
811
|
+
inquiryId: string;
|
|
812
|
+
/** Same as inquiryId (shared conversation-list shape). */
|
|
813
|
+
jobId: string;
|
|
814
|
+
job: {
|
|
815
|
+
id: string;
|
|
816
|
+
title: string;
|
|
817
|
+
status: 'INQUIRY';
|
|
818
|
+
userId: string;
|
|
819
|
+
[key: string]: unknown;
|
|
820
|
+
};
|
|
821
|
+
otherUser: UserRef;
|
|
822
|
+
lastMessage: {
|
|
823
|
+
id: string;
|
|
824
|
+
content: string;
|
|
825
|
+
createdAt: string;
|
|
826
|
+
senderId: string;
|
|
827
|
+
receiverId: string;
|
|
828
|
+
original?: string;
|
|
829
|
+
translated?: boolean;
|
|
830
|
+
contentLanguage?: string;
|
|
831
|
+
displayLanguage?: string;
|
|
832
|
+
};
|
|
833
|
+
unreadCount: number;
|
|
834
|
+
hasAcceptedOffer: false;
|
|
835
|
+
archived: false;
|
|
836
|
+
inquiryStatus: InquiryStatus;
|
|
837
|
+
gigId: string | null;
|
|
838
|
+
};
|
|
839
|
+
/** GET /agent/inquiries */
|
|
840
|
+
export type ListInquiriesResponse = {
|
|
841
|
+
success: true;
|
|
842
|
+
conversations: InquiryConversation[];
|
|
843
|
+
};
|
|
844
|
+
/** GET /agent/inquiries/{id} (also marks the messages read) */
|
|
845
|
+
export type GetInquiryResponse = {
|
|
846
|
+
success: true;
|
|
847
|
+
inquiry: {
|
|
848
|
+
id: string;
|
|
849
|
+
status: InquiryStatus;
|
|
850
|
+
subject: string | null;
|
|
851
|
+
subjectOriginal: string | null;
|
|
852
|
+
gigId: string | null;
|
|
853
|
+
initiatorId: string;
|
|
854
|
+
recipientId: string;
|
|
855
|
+
createdAt: string;
|
|
856
|
+
updatedAt: string;
|
|
857
|
+
};
|
|
858
|
+
otherUser: UserRef;
|
|
859
|
+
messages: {
|
|
860
|
+
id: string;
|
|
861
|
+
content: string;
|
|
862
|
+
original?: string;
|
|
863
|
+
translated: boolean;
|
|
864
|
+
contentLanguage: string;
|
|
865
|
+
displayLanguage: string;
|
|
866
|
+
imageUrl: string | null;
|
|
867
|
+
senderId: string;
|
|
868
|
+
receiverId: string;
|
|
869
|
+
read: boolean;
|
|
870
|
+
createdAt: string;
|
|
871
|
+
sender: UserRef;
|
|
872
|
+
receiver: UserRef;
|
|
873
|
+
}[];
|
|
874
|
+
};
|
|
875
|
+
export type StudioNotification = {
|
|
876
|
+
id: string;
|
|
877
|
+
kind: string;
|
|
878
|
+
category: string;
|
|
879
|
+
priority: string;
|
|
880
|
+
titleKey: string;
|
|
881
|
+
bodyKey: string;
|
|
882
|
+
payload: Record<string, unknown>;
|
|
883
|
+
read: boolean;
|
|
884
|
+
action: {
|
|
885
|
+
href: string | null;
|
|
886
|
+
resourceType: string | null;
|
|
887
|
+
resourceId: string | null;
|
|
888
|
+
};
|
|
889
|
+
createdAt: string;
|
|
890
|
+
updatedAt: string;
|
|
891
|
+
};
|
|
892
|
+
/** GET /agent/notifications (with `unreadCount=1` the API returns `{ success, count }` instead). */
|
|
893
|
+
export type NotificationsListResponse = {
|
|
894
|
+
success: true;
|
|
895
|
+
notifications: StudioNotification[];
|
|
896
|
+
nextCursor: string | null;
|
|
897
|
+
};
|
|
898
|
+
export type NotificationsUnreadCountResponse = {
|
|
899
|
+
success: true;
|
|
900
|
+
count: number;
|
|
901
|
+
};
|
|
902
|
+
//# sourceMappingURL=types.d.ts.map
|