@pakt/psilo 0.0.2 → 0.0.4-beta
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 +501 -74
- package/dist/main.d.mts +839 -0
- package/dist/main.d.ts +630 -4
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -0
- package/dist/main.mjs +2 -0
- package/dist/main.mjs.map +1 -0
- package/package.json +19 -4
package/dist/main.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ declare class Connector {
|
|
|
10
10
|
get<T>(url: string, config?: AxiosRequestConfig): Promise<T>;
|
|
11
11
|
post<T>(url: string, data?: any, config?: AxiosRequestConfig): Promise<T>;
|
|
12
12
|
put<T>(url: string, data?: any, config?: AxiosRequestConfig): Promise<T>;
|
|
13
|
+
patch<T>(url: string, data?: any, config?: AxiosRequestConfig): Promise<T>;
|
|
13
14
|
delete<T>(url: string, config?: AxiosRequestConfig): Promise<T>;
|
|
14
15
|
}
|
|
15
16
|
|
|
@@ -56,16 +57,22 @@ interface EscrowModuleType {
|
|
|
56
57
|
getChains(): Promise<ResponseDto<GetEscrowChainsResponseDto>>;
|
|
57
58
|
getAssets(chainId: string): Promise<ResponseDto<GetEscrowAssetsResponseDto>>;
|
|
58
59
|
}
|
|
60
|
+
interface EscrowWebhookConfigDto {
|
|
61
|
+
webhookUrl: string;
|
|
62
|
+
webHookType: "a2a" | "json";
|
|
63
|
+
}
|
|
59
64
|
interface CreateEscrowDto {
|
|
60
65
|
chainId: string;
|
|
61
66
|
buyer: string;
|
|
62
67
|
seller: string;
|
|
68
|
+
creator?: string;
|
|
63
69
|
title: string;
|
|
64
70
|
description?: string;
|
|
65
71
|
amount: string;
|
|
66
72
|
asset: string;
|
|
67
73
|
expiration?: string;
|
|
68
74
|
releaseType?: string;
|
|
75
|
+
webhookUrls?: EscrowWebhookConfigDto;
|
|
69
76
|
}
|
|
70
77
|
interface CreateEscrowResponse {
|
|
71
78
|
buyerWallet: string;
|
|
@@ -137,7 +144,8 @@ interface ReleaseResponse {
|
|
|
137
144
|
interface UpdateEscrowStatusDto {
|
|
138
145
|
chainId: string;
|
|
139
146
|
escrow: string;
|
|
140
|
-
address
|
|
147
|
+
address?: string;
|
|
148
|
+
webhookUrl?: string;
|
|
141
149
|
}
|
|
142
150
|
interface PrepareTransactionResponse {
|
|
143
151
|
to: string;
|
|
@@ -191,15 +199,633 @@ declare class EscrowService implements EscrowModuleType {
|
|
|
191
199
|
getAssets(chainId: string): Promise<ResponseDto<GetEscrowAssetsResponseDto>>;
|
|
192
200
|
}
|
|
193
201
|
|
|
202
|
+
interface AuthModuleType {
|
|
203
|
+
register(data: RegisterDto): Promise<ResponseDto<RegisterResponse>>;
|
|
204
|
+
nonce(data: NonceDto): Promise<ResponseDto<NonceResponse>>;
|
|
205
|
+
verify(data: VerifyDto): Promise<ResponseDto<VerifyResponse>>;
|
|
206
|
+
}
|
|
207
|
+
interface NonceDto {
|
|
208
|
+
address: string;
|
|
209
|
+
agentId: string;
|
|
210
|
+
agentRegistry?: string;
|
|
211
|
+
}
|
|
212
|
+
interface NonceResponse {
|
|
213
|
+
nonce: string;
|
|
214
|
+
[key: string]: unknown;
|
|
215
|
+
}
|
|
216
|
+
interface VerifyDto {
|
|
217
|
+
message: string;
|
|
218
|
+
signature: string;
|
|
219
|
+
}
|
|
220
|
+
interface VerifyResponse {
|
|
221
|
+
token: string;
|
|
222
|
+
[key: string]: unknown;
|
|
223
|
+
}
|
|
224
|
+
interface RegisterDto {
|
|
225
|
+
address: string;
|
|
226
|
+
agentId: string;
|
|
227
|
+
agentRegistry?: string;
|
|
228
|
+
chainId?: string;
|
|
229
|
+
name?: string;
|
|
230
|
+
webhookUrl?: string;
|
|
231
|
+
}
|
|
232
|
+
interface RegisterResponse {
|
|
233
|
+
[key: string]: unknown;
|
|
234
|
+
}
|
|
235
|
+
interface PaktWeb3RequestResponse {
|
|
236
|
+
message: string;
|
|
237
|
+
tempToken: string;
|
|
238
|
+
}
|
|
239
|
+
interface PaktWeb3ValidateResponse {
|
|
240
|
+
token?: string;
|
|
241
|
+
token_type?: string;
|
|
242
|
+
expiresIn?: number;
|
|
243
|
+
isVerified?: boolean;
|
|
244
|
+
timeZone?: string | null;
|
|
245
|
+
account?: string;
|
|
246
|
+
tempToken?: string;
|
|
247
|
+
}
|
|
248
|
+
interface PaktWeb3OnboardResponse {
|
|
249
|
+
tempToken: string;
|
|
250
|
+
isVerified: boolean;
|
|
251
|
+
timeZone: string | null;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
declare class AuthService implements AuthModuleType {
|
|
255
|
+
private id;
|
|
256
|
+
private connector;
|
|
257
|
+
constructor(id: string);
|
|
258
|
+
register(data: RegisterDto): Promise<ResponseDto<RegisterResponse>>;
|
|
259
|
+
nonce(data: NonceDto): Promise<ResponseDto<NonceResponse>>;
|
|
260
|
+
verify(data: VerifyDto): Promise<ResponseDto<VerifyResponse>>;
|
|
261
|
+
paktWeb3Login(privateKey: string): Promise<string>;
|
|
262
|
+
static generateWallet(): {
|
|
263
|
+
privateKey: string;
|
|
264
|
+
address: string;
|
|
265
|
+
};
|
|
266
|
+
private _paktWeb3Request;
|
|
267
|
+
private _paktWeb3Validate;
|
|
268
|
+
private _paktWeb3Onboard;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
type MessageType = "TEXT" | "MEDIA" | "TEXT_MEDIA";
|
|
272
|
+
interface SendMessagePayload {
|
|
273
|
+
conversationId: string;
|
|
274
|
+
type: MessageType;
|
|
275
|
+
message?: string;
|
|
276
|
+
attachments?: string[];
|
|
277
|
+
}
|
|
278
|
+
interface BroadcastMessage {
|
|
279
|
+
_id: string;
|
|
280
|
+
user: string;
|
|
281
|
+
content?: string;
|
|
282
|
+
conversation: string;
|
|
283
|
+
type: string;
|
|
284
|
+
attachments?: string[];
|
|
285
|
+
seen?: boolean;
|
|
286
|
+
createdAt: string;
|
|
287
|
+
updatedAt: string;
|
|
288
|
+
}
|
|
289
|
+
interface ConversationRecipient {
|
|
290
|
+
_id: string;
|
|
291
|
+
firstName: string;
|
|
292
|
+
lastName: string;
|
|
293
|
+
profileImage?: {
|
|
294
|
+
url: string;
|
|
295
|
+
};
|
|
296
|
+
socket?: {
|
|
297
|
+
status: "ONLINE" | "AWAY" | "OFFLINE";
|
|
298
|
+
};
|
|
299
|
+
}
|
|
300
|
+
interface ConversationMessage {
|
|
301
|
+
_id: string;
|
|
302
|
+
user: string;
|
|
303
|
+
content?: string;
|
|
304
|
+
conversation: string;
|
|
305
|
+
type: string;
|
|
306
|
+
attachments?: {
|
|
307
|
+
url: string;
|
|
308
|
+
}[];
|
|
309
|
+
seen?: boolean;
|
|
310
|
+
createdAt: string;
|
|
311
|
+
}
|
|
312
|
+
interface Conversation {
|
|
313
|
+
_id: string;
|
|
314
|
+
name?: string;
|
|
315
|
+
type: "DIRECT" | "GROUP";
|
|
316
|
+
recipients: ConversationRecipient[];
|
|
317
|
+
messages: ConversationMessage[];
|
|
318
|
+
isPrivate?: boolean;
|
|
319
|
+
updatedAt: string;
|
|
320
|
+
createdAt: string;
|
|
321
|
+
}
|
|
322
|
+
interface FetchedConversation {
|
|
323
|
+
_id: string;
|
|
324
|
+
chats: {
|
|
325
|
+
messages: ConversationMessage[];
|
|
326
|
+
totalMessagesCount: number;
|
|
327
|
+
};
|
|
328
|
+
recipients: ConversationRecipient[];
|
|
329
|
+
createdAt: string;
|
|
330
|
+
updatedAt: string;
|
|
331
|
+
}
|
|
332
|
+
interface UserStatusEvent {
|
|
333
|
+
_id: string;
|
|
334
|
+
firstName: string;
|
|
335
|
+
lastName: string;
|
|
336
|
+
status: "ONLINE" | "AWAY" | "OFFLINE";
|
|
337
|
+
}
|
|
338
|
+
interface JobInviteNotification {
|
|
339
|
+
jobId: string;
|
|
340
|
+
jobTitle: string;
|
|
341
|
+
senderId: string;
|
|
342
|
+
inviteId: string;
|
|
343
|
+
}
|
|
344
|
+
interface WsEnvelope<T> {
|
|
345
|
+
error: boolean;
|
|
346
|
+
statusCode: number;
|
|
347
|
+
message: string;
|
|
348
|
+
data: T;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
declare class MessagingService {
|
|
352
|
+
private readonly messagingUrl;
|
|
353
|
+
private readonly token;
|
|
354
|
+
private socket;
|
|
355
|
+
constructor(messagingUrl: string, token: string);
|
|
356
|
+
connect(): Promise<void>;
|
|
357
|
+
onBroadcast(handler: (msg: BroadcastMessage) => void): void;
|
|
358
|
+
onUserStatus(handler: (event: UserStatusEvent) => void): void;
|
|
359
|
+
onJobInvite(handler: (invite: JobInviteNotification) => void): void;
|
|
360
|
+
sendMessage(payload: SendMessagePayload): void;
|
|
361
|
+
setTyping(conversationId: string, typing: boolean): void;
|
|
362
|
+
loadConversations(): Promise<Conversation[]>;
|
|
363
|
+
createDirectConversation(recipientId: string): Promise<Conversation>;
|
|
364
|
+
createGroupConversation(recipientIds: string[], name?: string): Promise<Conversation>;
|
|
365
|
+
fetchConversation(conversationId: string): Promise<FetchedConversation>;
|
|
366
|
+
markSeen(conversationId: string): void;
|
|
367
|
+
disconnect(): void;
|
|
368
|
+
get connected(): boolean;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
interface JobDeliverableDto {
|
|
372
|
+
name: string;
|
|
373
|
+
description?: string;
|
|
374
|
+
}
|
|
375
|
+
interface CreateJobDto {
|
|
376
|
+
title: string;
|
|
377
|
+
description?: string;
|
|
378
|
+
amount?: string;
|
|
379
|
+
currency?: string;
|
|
380
|
+
tags?: string[];
|
|
381
|
+
chainId?: string;
|
|
382
|
+
asset?: string;
|
|
383
|
+
isPrivate?: boolean;
|
|
384
|
+
deliverables?: JobDeliverableDto[];
|
|
385
|
+
}
|
|
386
|
+
type ConfirmTxStep = "onCreate" | "onAccept" | "onAcceptInvite" | "onInvite" | "onMarkReady" | "onReleasePayment";
|
|
387
|
+
interface ConfirmTxDto {
|
|
388
|
+
step: ConfirmTxStep;
|
|
389
|
+
txHash?: string;
|
|
390
|
+
signedData?: string;
|
|
391
|
+
inviteeId?: string;
|
|
392
|
+
}
|
|
393
|
+
interface EscrowTxPayload {
|
|
394
|
+
to: string;
|
|
395
|
+
data: string;
|
|
396
|
+
value: string;
|
|
397
|
+
chainId?: string;
|
|
398
|
+
gas?: string;
|
|
399
|
+
maxFeePerGas?: string;
|
|
400
|
+
maxPriorityFeePerGas?: string;
|
|
401
|
+
type?: string;
|
|
402
|
+
}
|
|
403
|
+
interface InviteTalentDto {
|
|
404
|
+
inviteeId: string;
|
|
405
|
+
}
|
|
406
|
+
interface PrepareUpdateDto {
|
|
407
|
+
address: string;
|
|
408
|
+
chainId?: string;
|
|
409
|
+
}
|
|
410
|
+
interface ListJobsQuery {
|
|
411
|
+
creator?: string;
|
|
412
|
+
buyer?: string;
|
|
413
|
+
seller?: string;
|
|
414
|
+
chainId?: string;
|
|
415
|
+
page?: number;
|
|
416
|
+
limit?: number;
|
|
417
|
+
}
|
|
418
|
+
interface GetStatsQuery {
|
|
419
|
+
creator?: string;
|
|
420
|
+
startDate?: string;
|
|
421
|
+
endDate?: string;
|
|
422
|
+
}
|
|
423
|
+
interface CreateDeliverablesDto {
|
|
424
|
+
deliverables: JobDeliverableDto[];
|
|
425
|
+
}
|
|
426
|
+
interface ToggleDeliverableProgressDto {
|
|
427
|
+
status: "completed" | "pending";
|
|
428
|
+
}
|
|
429
|
+
interface BulkResetDeliverablesDto {
|
|
430
|
+
deliverableIds: string[];
|
|
431
|
+
}
|
|
432
|
+
interface UpdateJobDto {
|
|
433
|
+
title?: string;
|
|
434
|
+
description?: string;
|
|
435
|
+
amount?: string;
|
|
436
|
+
deliveryDate?: string;
|
|
437
|
+
isPrivate?: boolean;
|
|
438
|
+
tags?: string[];
|
|
439
|
+
meta?: Record<string, any>;
|
|
440
|
+
}
|
|
441
|
+
interface ApplyJobDto {
|
|
442
|
+
coverLetter?: string;
|
|
443
|
+
bid?: number;
|
|
444
|
+
}
|
|
445
|
+
interface CancelJobDto {
|
|
446
|
+
reason: string;
|
|
447
|
+
explanation?: string;
|
|
448
|
+
}
|
|
449
|
+
interface ResolveCancelDto {
|
|
450
|
+
resolution?: string;
|
|
451
|
+
}
|
|
452
|
+
interface ReviewChangeDto {
|
|
453
|
+
reason: string;
|
|
454
|
+
description?: string;
|
|
455
|
+
changes?: Record<string, any>;
|
|
456
|
+
}
|
|
457
|
+
interface CompleteJobDto {
|
|
458
|
+
note?: string;
|
|
459
|
+
}
|
|
460
|
+
interface ReleaseJobPaymentDto {
|
|
461
|
+
}
|
|
462
|
+
interface JobReviewDto {
|
|
463
|
+
receiverId: string;
|
|
464
|
+
rating: number;
|
|
465
|
+
review: string;
|
|
466
|
+
}
|
|
467
|
+
interface PaginationQuery {
|
|
468
|
+
page?: number;
|
|
469
|
+
limit?: number;
|
|
470
|
+
}
|
|
471
|
+
type ListAllInvitesQuery = PaginationQuery;
|
|
472
|
+
type ListApplicationsQuery = PaginationQuery;
|
|
473
|
+
type ListJobInvitesQuery = PaginationQuery;
|
|
474
|
+
interface ApplicationResponse {
|
|
475
|
+
_id: string;
|
|
476
|
+
job: string;
|
|
477
|
+
applicant: any;
|
|
478
|
+
coverLetter: string;
|
|
479
|
+
bid: number;
|
|
480
|
+
status: "pending" | "accepted" | "rejected" | "closed";
|
|
481
|
+
createdAt: string;
|
|
482
|
+
updatedAt: string;
|
|
483
|
+
}
|
|
484
|
+
interface ApplicationListResponse {
|
|
485
|
+
total: number;
|
|
486
|
+
page: number;
|
|
487
|
+
limit: number;
|
|
488
|
+
pages: number;
|
|
489
|
+
data: ApplicationResponse[];
|
|
490
|
+
}
|
|
491
|
+
interface CancelRequestResponse {
|
|
492
|
+
_id: string;
|
|
493
|
+
job: string;
|
|
494
|
+
requestedBy: string;
|
|
495
|
+
reason: string;
|
|
496
|
+
explanation: string;
|
|
497
|
+
status: "pending" | "accepted" | "declined";
|
|
498
|
+
resolution?: string;
|
|
499
|
+
createdAt: string;
|
|
500
|
+
updatedAt: string;
|
|
501
|
+
}
|
|
502
|
+
interface ChangeRequestResponse {
|
|
503
|
+
_id: string;
|
|
504
|
+
job: string;
|
|
505
|
+
requestedBy: string;
|
|
506
|
+
reason: string;
|
|
507
|
+
description: string;
|
|
508
|
+
changes?: Record<string, any>;
|
|
509
|
+
status: "pending" | "accepted" | "declined";
|
|
510
|
+
createdAt: string;
|
|
511
|
+
updatedAt: string;
|
|
512
|
+
}
|
|
513
|
+
interface MakeDepositResponse {
|
|
514
|
+
jobId: string;
|
|
515
|
+
escrowAddress: string;
|
|
516
|
+
chainId: string;
|
|
517
|
+
coinAmount: string;
|
|
518
|
+
tokenDecimal: number;
|
|
519
|
+
coinSymbol: string;
|
|
520
|
+
asset: string;
|
|
521
|
+
onCreate: any | null;
|
|
522
|
+
deposit: any | null;
|
|
523
|
+
approve: any | null;
|
|
524
|
+
}
|
|
525
|
+
interface JobDeliverableResponse {
|
|
526
|
+
_id: string;
|
|
527
|
+
name: string;
|
|
528
|
+
description?: string;
|
|
529
|
+
progress: number;
|
|
530
|
+
meta?: {
|
|
531
|
+
completedAt?: string;
|
|
532
|
+
};
|
|
533
|
+
}
|
|
534
|
+
interface JobInviteResponse {
|
|
535
|
+
inviteeId: string;
|
|
536
|
+
status: "pending" | "accepted" | "declined";
|
|
537
|
+
createdAt: string;
|
|
538
|
+
}
|
|
539
|
+
interface JobResponse {
|
|
540
|
+
_id: string;
|
|
541
|
+
creator: string;
|
|
542
|
+
title: string;
|
|
543
|
+
description: string;
|
|
544
|
+
amount: string;
|
|
545
|
+
currency?: string;
|
|
546
|
+
tags?: string[];
|
|
547
|
+
chainId: string;
|
|
548
|
+
asset: string;
|
|
549
|
+
status: "open" | "filled" | "completed" | "cancelled";
|
|
550
|
+
isPrivate: boolean;
|
|
551
|
+
buyer: string;
|
|
552
|
+
seller?: string;
|
|
553
|
+
sellerId?: string;
|
|
554
|
+
escrowVersion: string;
|
|
555
|
+
escrowChainId: string;
|
|
556
|
+
escrowStatus: string;
|
|
557
|
+
escrowAddress?: string;
|
|
558
|
+
escrowOnCreateTxHash?: string;
|
|
559
|
+
escrowAcceptTxHash?: string;
|
|
560
|
+
invites?: JobInviteResponse[];
|
|
561
|
+
deliverables?: JobDeliverableResponse[];
|
|
562
|
+
createdAt: string;
|
|
563
|
+
updatedAt: string;
|
|
564
|
+
}
|
|
565
|
+
interface JobListResponse {
|
|
566
|
+
total: number;
|
|
567
|
+
page: number;
|
|
568
|
+
limit: number;
|
|
569
|
+
pages: number;
|
|
570
|
+
data: JobResponse[];
|
|
571
|
+
}
|
|
572
|
+
interface JobStatsSummary {
|
|
573
|
+
total: number;
|
|
574
|
+
open: number;
|
|
575
|
+
filled: number;
|
|
576
|
+
completed: number;
|
|
577
|
+
cancelled: number;
|
|
578
|
+
totalValue: number;
|
|
579
|
+
filledValue: number;
|
|
580
|
+
completedValue: number;
|
|
581
|
+
}
|
|
582
|
+
interface JobStatsResponse {
|
|
583
|
+
summary: JobStatsSummary;
|
|
584
|
+
byStatus: {
|
|
585
|
+
status: string;
|
|
586
|
+
count: number;
|
|
587
|
+
totalValue: number;
|
|
588
|
+
}[];
|
|
589
|
+
byChain: {
|
|
590
|
+
chainId: string;
|
|
591
|
+
count: number;
|
|
592
|
+
totalValue: number;
|
|
593
|
+
}[];
|
|
594
|
+
}
|
|
595
|
+
interface JobModuleType {
|
|
596
|
+
create(dto: CreateJobDto): Promise<ResponseDto<{
|
|
597
|
+
job: JobResponse;
|
|
598
|
+
escrowTx: any;
|
|
599
|
+
}>>;
|
|
600
|
+
list(query?: ListJobsQuery): Promise<ResponseDto<JobListResponse>>;
|
|
601
|
+
getStats(query?: GetStatsQuery): Promise<ResponseDto<JobStatsResponse>>;
|
|
602
|
+
getById(id: string): Promise<ResponseDto<{
|
|
603
|
+
job: JobResponse;
|
|
604
|
+
}>>;
|
|
605
|
+
delete(id: string): Promise<ResponseDto<{
|
|
606
|
+
message: string;
|
|
607
|
+
}>>;
|
|
608
|
+
confirmTx(id: string, dto: ConfirmTxDto): Promise<ResponseDto<JobResponse>>;
|
|
609
|
+
getInvites(id: string): Promise<ResponseDto<JobInviteResponse[]>>;
|
|
610
|
+
inviteTalent(id: string, dto: InviteTalentDto): Promise<ResponseDto<{
|
|
611
|
+
job?: JobResponse;
|
|
612
|
+
invitePayload?: EscrowTxPayload;
|
|
613
|
+
}>>;
|
|
614
|
+
acceptInvite(id: string, inviteId: string): Promise<ResponseDto<{
|
|
615
|
+
job: JobResponse;
|
|
616
|
+
acceptPayload: any;
|
|
617
|
+
}>>;
|
|
618
|
+
declineInvite(id: string, inviteId: string): Promise<ResponseDto<{
|
|
619
|
+
job: JobResponse;
|
|
620
|
+
}>>;
|
|
621
|
+
cancelInvite(id: string, inviteeId: string): Promise<ResponseDto<{
|
|
622
|
+
job: JobResponse;
|
|
623
|
+
}>>;
|
|
624
|
+
getEscrowStatus(id: string): Promise<ResponseDto<{
|
|
625
|
+
job: JobResponse;
|
|
626
|
+
onChain: any;
|
|
627
|
+
}>>;
|
|
628
|
+
prepareUpdate(id: string, dto: PrepareUpdateDto): Promise<ResponseDto<{
|
|
629
|
+
job: JobResponse;
|
|
630
|
+
txPayload: any;
|
|
631
|
+
}>>;
|
|
632
|
+
createDeliverables(id: string, dto: CreateDeliverablesDto): Promise<ResponseDto<{
|
|
633
|
+
deliverables: JobDeliverableResponse[];
|
|
634
|
+
}>>;
|
|
635
|
+
replaceDeliverables(id: string, dto: CreateDeliverablesDto): Promise<ResponseDto<{
|
|
636
|
+
deliverables: JobDeliverableResponse[];
|
|
637
|
+
}>>;
|
|
638
|
+
toggleDeliverableProgress(id: string, deliverableId: string, dto: ToggleDeliverableProgressDto): Promise<ResponseDto<{
|
|
639
|
+
deliverable: JobDeliverableResponse;
|
|
640
|
+
}>>;
|
|
641
|
+
bulkResetDeliverables(id: string, dto: BulkResetDeliverablesDto): Promise<ResponseDto<{
|
|
642
|
+
deliverables: JobDeliverableResponse[];
|
|
643
|
+
}>>;
|
|
644
|
+
update(id: string, dto: UpdateJobDto): Promise<ResponseDto<{
|
|
645
|
+
job: JobResponse;
|
|
646
|
+
}>>;
|
|
647
|
+
listAllInvites(query?: ListAllInvitesQuery): Promise<ResponseDto<JobInviteResponse[]>>;
|
|
648
|
+
makeDeposit(id: string, talentId?: string): Promise<ResponseDto<MakeDepositResponse>>;
|
|
649
|
+
validatePayment(id: string): Promise<ResponseDto<{
|
|
650
|
+
job: JobResponse;
|
|
651
|
+
onChain: any;
|
|
652
|
+
}>>;
|
|
653
|
+
apply(id: string, dto: ApplyJobDto): Promise<ResponseDto<{
|
|
654
|
+
application: ApplicationResponse;
|
|
655
|
+
}>>;
|
|
656
|
+
withdrawApplication(id: string): Promise<ResponseDto<{
|
|
657
|
+
message: string;
|
|
658
|
+
}>>;
|
|
659
|
+
listApplications(id: string, query?: ListApplicationsQuery): Promise<ResponseDto<ApplicationListResponse>>;
|
|
660
|
+
acceptApplication(id: string, appId: string): Promise<ResponseDto<{
|
|
661
|
+
application: ApplicationResponse;
|
|
662
|
+
job: JobResponse;
|
|
663
|
+
}>>;
|
|
664
|
+
rejectApplication(id: string, appId: string): Promise<ResponseDto<{
|
|
665
|
+
application: ApplicationResponse;
|
|
666
|
+
}>>;
|
|
667
|
+
requestCancel(id: string, dto: CancelJobDto): Promise<ResponseDto<{
|
|
668
|
+
cancelRequest: CancelRequestResponse;
|
|
669
|
+
}>>;
|
|
670
|
+
acceptCancel(id: string, dto?: ResolveCancelDto): Promise<ResponseDto<{
|
|
671
|
+
cancelRequest: CancelRequestResponse;
|
|
672
|
+
job: JobResponse;
|
|
673
|
+
}>>;
|
|
674
|
+
declineCancel(id: string, dto?: ResolveCancelDto): Promise<ResponseDto<{
|
|
675
|
+
cancelRequest: CancelRequestResponse;
|
|
676
|
+
job: JobResponse;
|
|
677
|
+
}>>;
|
|
678
|
+
getCancelRequest(id: string): Promise<ResponseDto<{
|
|
679
|
+
cancelRequest: CancelRequestResponse | null;
|
|
680
|
+
}>>;
|
|
681
|
+
requestReviewChange(id: string, dto: ReviewChangeDto): Promise<ResponseDto<{
|
|
682
|
+
changeRequest: ChangeRequestResponse;
|
|
683
|
+
}>>;
|
|
684
|
+
acceptReviewChange(id: string): Promise<ResponseDto<{
|
|
685
|
+
changeRequest: ChangeRequestResponse;
|
|
686
|
+
}>>;
|
|
687
|
+
declineReviewChange(id: string): Promise<ResponseDto<{
|
|
688
|
+
changeRequest: ChangeRequestResponse;
|
|
689
|
+
}>>;
|
|
690
|
+
getReviewChange(id: string): Promise<ResponseDto<{
|
|
691
|
+
changeRequest: ChangeRequestResponse | null;
|
|
692
|
+
}>>;
|
|
693
|
+
completeJob(id: string, dto?: CompleteJobDto): Promise<ResponseDto<{
|
|
694
|
+
job: JobResponse;
|
|
695
|
+
markReadyTxHash: string | null;
|
|
696
|
+
}>>;
|
|
697
|
+
releasePayment(id: string, dto?: ReleaseJobPaymentDto): Promise<ResponseDto<{
|
|
698
|
+
escrowReleaseTxHash: string | null;
|
|
699
|
+
}>>;
|
|
700
|
+
submitReview(id: string, dto: JobReviewDto): Promise<ResponseDto<any>>;
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
declare class JobService implements JobModuleType {
|
|
704
|
+
private id;
|
|
705
|
+
private connector;
|
|
706
|
+
constructor(id: string);
|
|
707
|
+
create(dto: CreateJobDto): Promise<ResponseDto<{
|
|
708
|
+
job: JobResponse;
|
|
709
|
+
escrowTx: any;
|
|
710
|
+
}>>;
|
|
711
|
+
list(query?: ListJobsQuery): Promise<ResponseDto<JobListResponse>>;
|
|
712
|
+
getStats(query?: GetStatsQuery): Promise<ResponseDto<JobStatsResponse>>;
|
|
713
|
+
getById(id: string): Promise<ResponseDto<{
|
|
714
|
+
job: JobResponse;
|
|
715
|
+
}>>;
|
|
716
|
+
delete(id: string): Promise<ResponseDto<{
|
|
717
|
+
message: string;
|
|
718
|
+
}>>;
|
|
719
|
+
confirmTx(id: string, dto: ConfirmTxDto): Promise<ResponseDto<JobResponse>>;
|
|
720
|
+
getInvites(id: string): Promise<ResponseDto<JobInviteResponse[]>>;
|
|
721
|
+
inviteTalent(id: string, dto: InviteTalentDto): Promise<ResponseDto<{
|
|
722
|
+
job?: JobResponse;
|
|
723
|
+
invitePayload?: EscrowTxPayload;
|
|
724
|
+
}>>;
|
|
725
|
+
acceptInvite(id: string, inviteId: string): Promise<ResponseDto<{
|
|
726
|
+
job: JobResponse;
|
|
727
|
+
acceptPayload: any;
|
|
728
|
+
}>>;
|
|
729
|
+
declineInvite(id: string, inviteId: string): Promise<ResponseDto<{
|
|
730
|
+
job: JobResponse;
|
|
731
|
+
}>>;
|
|
732
|
+
cancelInvite(id: string, inviteeId: string): Promise<ResponseDto<{
|
|
733
|
+
job: JobResponse;
|
|
734
|
+
}>>;
|
|
735
|
+
getEscrowStatus(id: string): Promise<ResponseDto<{
|
|
736
|
+
job: JobResponse;
|
|
737
|
+
onChain: any;
|
|
738
|
+
}>>;
|
|
739
|
+
prepareUpdate(id: string, dto: PrepareUpdateDto): Promise<ResponseDto<{
|
|
740
|
+
job: JobResponse;
|
|
741
|
+
txPayload: any;
|
|
742
|
+
}>>;
|
|
743
|
+
createDeliverables(id: string, dto: CreateDeliverablesDto): Promise<ResponseDto<{
|
|
744
|
+
deliverables: JobDeliverableResponse[];
|
|
745
|
+
}>>;
|
|
746
|
+
replaceDeliverables(id: string, dto: CreateDeliverablesDto): Promise<ResponseDto<{
|
|
747
|
+
deliverables: JobDeliverableResponse[];
|
|
748
|
+
}>>;
|
|
749
|
+
toggleDeliverableProgress(id: string, deliverableId: string, dto: ToggleDeliverableProgressDto): Promise<ResponseDto<{
|
|
750
|
+
deliverable: JobDeliverableResponse;
|
|
751
|
+
}>>;
|
|
752
|
+
bulkResetDeliverables(id: string, dto: BulkResetDeliverablesDto): Promise<ResponseDto<{
|
|
753
|
+
deliverables: JobDeliverableResponse[];
|
|
754
|
+
}>>;
|
|
755
|
+
update(id: string, dto: UpdateJobDto): Promise<ResponseDto<{
|
|
756
|
+
job: JobResponse;
|
|
757
|
+
}>>;
|
|
758
|
+
listAllInvites(query?: ListAllInvitesQuery): Promise<ResponseDto<JobInviteResponse[]>>;
|
|
759
|
+
makeDeposit(id: string, talentId?: string): Promise<ResponseDto<MakeDepositResponse>>;
|
|
760
|
+
validatePayment(id: string): Promise<ResponseDto<{
|
|
761
|
+
job: JobResponse;
|
|
762
|
+
onChain: any;
|
|
763
|
+
}>>;
|
|
764
|
+
apply(id: string, dto: ApplyJobDto): Promise<ResponseDto<{
|
|
765
|
+
application: ApplicationResponse;
|
|
766
|
+
}>>;
|
|
767
|
+
withdrawApplication(id: string): Promise<ResponseDto<{
|
|
768
|
+
message: string;
|
|
769
|
+
}>>;
|
|
770
|
+
listApplications(id: string, query?: ListApplicationsQuery): Promise<ResponseDto<ApplicationListResponse>>;
|
|
771
|
+
acceptApplication(id: string, appId: string): Promise<ResponseDto<{
|
|
772
|
+
application: ApplicationResponse;
|
|
773
|
+
job: JobResponse;
|
|
774
|
+
}>>;
|
|
775
|
+
rejectApplication(id: string, appId: string): Promise<ResponseDto<{
|
|
776
|
+
application: ApplicationResponse;
|
|
777
|
+
}>>;
|
|
778
|
+
requestCancel(id: string, dto: CancelJobDto): Promise<ResponseDto<{
|
|
779
|
+
cancelRequest: CancelRequestResponse;
|
|
780
|
+
}>>;
|
|
781
|
+
acceptCancel(id: string, dto?: ResolveCancelDto): Promise<ResponseDto<{
|
|
782
|
+
cancelRequest: CancelRequestResponse;
|
|
783
|
+
job: JobResponse;
|
|
784
|
+
}>>;
|
|
785
|
+
declineCancel(id: string, dto?: ResolveCancelDto): Promise<ResponseDto<{
|
|
786
|
+
cancelRequest: CancelRequestResponse;
|
|
787
|
+
job: JobResponse;
|
|
788
|
+
}>>;
|
|
789
|
+
getCancelRequest(id: string): Promise<ResponseDto<{
|
|
790
|
+
cancelRequest: CancelRequestResponse | null;
|
|
791
|
+
}>>;
|
|
792
|
+
requestReviewChange(id: string, dto: ReviewChangeDto): Promise<ResponseDto<{
|
|
793
|
+
changeRequest: ChangeRequestResponse;
|
|
794
|
+
}>>;
|
|
795
|
+
acceptReviewChange(id: string): Promise<ResponseDto<{
|
|
796
|
+
changeRequest: ChangeRequestResponse;
|
|
797
|
+
}>>;
|
|
798
|
+
declineReviewChange(id: string): Promise<ResponseDto<{
|
|
799
|
+
changeRequest: ChangeRequestResponse;
|
|
800
|
+
}>>;
|
|
801
|
+
getReviewChange(id: string): Promise<ResponseDto<{
|
|
802
|
+
changeRequest: ChangeRequestResponse | null;
|
|
803
|
+
}>>;
|
|
804
|
+
completeJob(id: string, dto?: CompleteJobDto): Promise<ResponseDto<{
|
|
805
|
+
job: JobResponse;
|
|
806
|
+
markReadyTxHash: string | null;
|
|
807
|
+
}>>;
|
|
808
|
+
releasePayment(id: string, dto?: ReleaseJobPaymentDto): Promise<ResponseDto<{
|
|
809
|
+
escrowReleaseTxHash: string | null;
|
|
810
|
+
}>>;
|
|
811
|
+
submitReview(id: string, dto: JobReviewDto): Promise<ResponseDto<any>>;
|
|
812
|
+
}
|
|
813
|
+
|
|
194
814
|
interface PsiloSDKConfig {
|
|
195
|
-
|
|
815
|
+
development?: boolean;
|
|
196
816
|
verbose?: boolean;
|
|
817
|
+
baseUrl?: string;
|
|
818
|
+
messagingUrl?: string;
|
|
819
|
+
token?: string;
|
|
197
820
|
}
|
|
198
821
|
declare class PsiloSDK {
|
|
822
|
+
readonly auth: AuthService;
|
|
199
823
|
readonly escrow: EscrowService;
|
|
200
824
|
readonly connector: Connector;
|
|
825
|
+
readonly messaging: MessagingService;
|
|
826
|
+
readonly job: JobService;
|
|
201
827
|
constructor(id: string);
|
|
202
|
-
static init(config
|
|
828
|
+
static init(config?: PsiloSDKConfig): Promise<PsiloSDK>;
|
|
203
829
|
setAuthorizationHeader(token: string): void;
|
|
204
830
|
private static generateRandomString;
|
|
205
831
|
}
|
|
@@ -210,4 +836,4 @@ declare class SDKError extends Error {
|
|
|
210
836
|
constructor(message: string, code?: string, details?: any);
|
|
211
837
|
}
|
|
212
838
|
|
|
213
|
-
export { Connector, CreateEscrowDto, CreateEscrowResponse, DepositDto, DepositResponse, ErrorUtils, EscrowAssetDto, EscrowChainDto, EscrowModuleType, EscrowNativeCurrencyDto, EscrowService, EscrowStatusResponse, GetEscrowAssetsResponseDto, GetEscrowChainsResponseDto, IAny, PrepareTransactionResponse, PsiloSDK, PsiloSDKConfig, ReleaseDto, ReleaseResponse, ResponseDto, SDKError, SignReleaseDto, SignReleaseResponse, StandardResponse, Status, UpdateEscrowStatusDto, parseUrlWithQuery };
|
|
839
|
+
export { ApplicationListResponse, ApplicationResponse, ApplyJobDto, AuthModuleType, AuthService, BroadcastMessage, BulkResetDeliverablesDto, CancelJobDto, CancelRequestResponse, ChangeRequestResponse, CompleteJobDto, ConfirmTxDto, ConfirmTxStep, Connector, Conversation, ConversationMessage, ConversationRecipient, CreateDeliverablesDto, CreateEscrowDto, CreateEscrowResponse, CreateJobDto, DepositDto, DepositResponse, ErrorUtils, EscrowAssetDto, EscrowChainDto, EscrowModuleType, EscrowNativeCurrencyDto, EscrowService, EscrowStatusResponse, EscrowTxPayload, EscrowWebhookConfigDto, FetchedConversation, GetEscrowAssetsResponseDto, GetEscrowChainsResponseDto, GetStatsQuery, IAny, InviteTalentDto, JobDeliverableDto, JobDeliverableResponse, JobInviteNotification, JobInviteResponse, JobListResponse, JobModuleType, JobResponse, JobReviewDto, JobService, JobStatsResponse, JobStatsSummary, ListAllInvitesQuery, ListApplicationsQuery, ListJobInvitesQuery, ListJobsQuery, MakeDepositResponse, MessageType, MessagingService, NonceDto, NonceResponse, PaginationQuery, PaktWeb3OnboardResponse, PaktWeb3RequestResponse, PaktWeb3ValidateResponse, PrepareTransactionResponse, PrepareUpdateDto, PsiloSDK, PsiloSDKConfig, RegisterDto, RegisterResponse, ReleaseDto, ReleaseJobPaymentDto, ReleaseResponse, ResolveCancelDto, ResponseDto, ReviewChangeDto, SDKError, SendMessagePayload, SignReleaseDto, SignReleaseResponse, StandardResponse, Status, ToggleDeliverableProgressDto, UpdateEscrowStatusDto, UpdateJobDto, UserStatusEvent, VerifyDto, VerifyResponse, WsEnvelope, parseUrlWithQuery };
|