voyage-lib 0.0.3 → 0.1.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 +64 -64
- package/fesm2022/voyage-lib.mjs +519 -452
- package/fesm2022/voyage-lib.mjs.map +1 -1
- package/package.json +2 -3
- package/types/voyage-lib.d.ts +114 -2
package/types/voyage-lib.d.ts
CHANGED
|
@@ -411,6 +411,7 @@ interface Trip {
|
|
|
411
411
|
spent: number;
|
|
412
412
|
status: 'planning' | 'ongoing' | 'completed';
|
|
413
413
|
currency: string;
|
|
414
|
+
isCreator?: boolean;
|
|
414
415
|
}
|
|
415
416
|
interface TripDTO {
|
|
416
417
|
id: string;
|
|
@@ -423,6 +424,7 @@ interface TripDTO {
|
|
|
423
424
|
spent: number;
|
|
424
425
|
status: 'planning' | 'ongoing' | 'completed';
|
|
425
426
|
currency: string;
|
|
427
|
+
isCreator?: boolean;
|
|
426
428
|
}
|
|
427
429
|
interface TripStatusStyle {
|
|
428
430
|
color: string;
|
|
@@ -444,7 +446,60 @@ declare class TripStatusStylePipe implements PipeTransform {
|
|
|
444
446
|
static ɵpipe: _angular_core.ɵɵPipeDeclaration<TripStatusStylePipe, "vlTripStatusStyle", true>;
|
|
445
447
|
}
|
|
446
448
|
|
|
449
|
+
type InviteStatus = 'pending' | 'accepted' | 'declined' | 'revoked' | 'expired';
|
|
450
|
+
interface TripInvite {
|
|
451
|
+
id: string;
|
|
452
|
+
tripId: string;
|
|
453
|
+
email: string;
|
|
454
|
+
status: InviteStatus;
|
|
455
|
+
expiresAt: Date;
|
|
456
|
+
createdAt: Date;
|
|
457
|
+
}
|
|
458
|
+
interface TripInviteDTO {
|
|
459
|
+
id: string;
|
|
460
|
+
tripId: string;
|
|
461
|
+
email: string;
|
|
462
|
+
status: InviteStatus;
|
|
463
|
+
expiresAt: string;
|
|
464
|
+
createdAt: string;
|
|
465
|
+
}
|
|
466
|
+
interface MyInvite {
|
|
467
|
+
id: string;
|
|
468
|
+
tripId: string;
|
|
469
|
+
tripName: string;
|
|
470
|
+
destination: string;
|
|
471
|
+
country: string;
|
|
472
|
+
startDate: Date;
|
|
473
|
+
endDate: Date;
|
|
474
|
+
status: InviteStatus;
|
|
475
|
+
expiresAt: Date;
|
|
476
|
+
}
|
|
477
|
+
interface MyInviteDTO {
|
|
478
|
+
id: string;
|
|
479
|
+
tripId: string;
|
|
480
|
+
tripName: string;
|
|
481
|
+
destination: string;
|
|
482
|
+
country: string;
|
|
483
|
+
startDate: string;
|
|
484
|
+
endDate: string;
|
|
485
|
+
status: InviteStatus;
|
|
486
|
+
expiresAt: string;
|
|
487
|
+
}
|
|
488
|
+
interface TripMember {
|
|
489
|
+
userId: string;
|
|
490
|
+
email: string;
|
|
491
|
+
displayName: string;
|
|
492
|
+
}
|
|
493
|
+
|
|
447
494
|
type ExpenseCategory = 'food' | 'accommodation' | 'transport' | 'activities' | 'souvenirs' | 'other';
|
|
495
|
+
interface ExpenseSplitInput {
|
|
496
|
+
userId: string;
|
|
497
|
+
share: number;
|
|
498
|
+
}
|
|
499
|
+
interface OwedShare {
|
|
500
|
+
userId: string;
|
|
501
|
+
share: number;
|
|
502
|
+
}
|
|
448
503
|
interface Expense {
|
|
449
504
|
id: string;
|
|
450
505
|
tripId: string;
|
|
@@ -452,6 +507,11 @@ interface Expense {
|
|
|
452
507
|
amount: number;
|
|
453
508
|
description: string;
|
|
454
509
|
date: Date;
|
|
510
|
+
paidBy?: string;
|
|
511
|
+
splits?: ExpenseSplitInput[];
|
|
512
|
+
yourShare?: number;
|
|
513
|
+
paidByYou?: boolean;
|
|
514
|
+
owedToYou?: OwedShare[];
|
|
455
515
|
}
|
|
456
516
|
interface ExpenseDTO {
|
|
457
517
|
id: string;
|
|
@@ -460,6 +520,11 @@ interface ExpenseDTO {
|
|
|
460
520
|
amount: number;
|
|
461
521
|
description: string;
|
|
462
522
|
date: string;
|
|
523
|
+
paidBy?: string;
|
|
524
|
+
splits?: ExpenseSplitInput[];
|
|
525
|
+
yourShare?: number;
|
|
526
|
+
paidByYou?: boolean;
|
|
527
|
+
owedToYou?: OwedShare[];
|
|
463
528
|
}
|
|
464
529
|
interface CategorySpending {
|
|
465
530
|
category: ExpenseCategory;
|
|
@@ -475,6 +540,29 @@ interface DailyExpenses {
|
|
|
475
540
|
declare const CATEGORY_ICONS: Record<ExpenseCategory, string>;
|
|
476
541
|
declare const CATEGORY_COLORS: Record<ExpenseCategory, string>;
|
|
477
542
|
|
|
543
|
+
interface SettlementBalance {
|
|
544
|
+
userId: string;
|
|
545
|
+
email: string;
|
|
546
|
+
displayName: string;
|
|
547
|
+
paid: number;
|
|
548
|
+
owes: number;
|
|
549
|
+
net: number;
|
|
550
|
+
isYou: boolean;
|
|
551
|
+
}
|
|
552
|
+
interface SettlementTransaction {
|
|
553
|
+
from: string;
|
|
554
|
+
to: string;
|
|
555
|
+
amount: number;
|
|
556
|
+
}
|
|
557
|
+
interface Settlement {
|
|
558
|
+
balances: SettlementBalance[];
|
|
559
|
+
transactions: SettlementTransaction[];
|
|
560
|
+
}
|
|
561
|
+
interface TripBalance {
|
|
562
|
+
tripId: string;
|
|
563
|
+
net: number;
|
|
564
|
+
}
|
|
565
|
+
|
|
478
566
|
interface ErrorInterface {
|
|
479
567
|
success: false;
|
|
480
568
|
message: string;
|
|
@@ -526,6 +614,22 @@ declare class TripService {
|
|
|
526
614
|
static ɵprov: _angular_core.ɵɵInjectableDeclaration<TripService>;
|
|
527
615
|
}
|
|
528
616
|
|
|
617
|
+
declare class TripInviteService {
|
|
618
|
+
private readonly httpService;
|
|
619
|
+
createInvite(tripId: string, email: string): Observable<TripInvite>;
|
|
620
|
+
listInvites(tripId: string): Observable<TripInvite[]>;
|
|
621
|
+
revokeInvite(tripId: string, inviteId: string): Observable<void>;
|
|
622
|
+
listMembers(tripId: string): Observable<TripMember[]>;
|
|
623
|
+
removeMember(tripId: string, userId: string): Observable<void>;
|
|
624
|
+
listMyInvites(): Observable<MyInvite[]>;
|
|
625
|
+
acceptInvite(inviteId: string): Observable<void>;
|
|
626
|
+
declineInvite(inviteId: string): Observable<void>;
|
|
627
|
+
private dtoToInvite;
|
|
628
|
+
private dtoToMyInvite;
|
|
629
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<TripInviteService, never>;
|
|
630
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<TripInviteService>;
|
|
631
|
+
}
|
|
632
|
+
|
|
529
633
|
declare class ExpenseService {
|
|
530
634
|
private readonly httpService;
|
|
531
635
|
getExpensesByTripId(tripId: string): Observable<Expense[]>;
|
|
@@ -540,6 +644,14 @@ declare class ExpenseService {
|
|
|
540
644
|
static ɵprov: _angular_core.ɵɵInjectableDeclaration<ExpenseService>;
|
|
541
645
|
}
|
|
542
646
|
|
|
647
|
+
declare class SettlementService {
|
|
648
|
+
private readonly httpService;
|
|
649
|
+
getSettlement(tripId: string): Observable<Settlement>;
|
|
650
|
+
getMyBalances(): Observable<TripBalance[]>;
|
|
651
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SettlementService, never>;
|
|
652
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<SettlementService>;
|
|
653
|
+
}
|
|
654
|
+
|
|
543
655
|
interface IEnvironment {
|
|
544
656
|
app: string;
|
|
545
657
|
apiUrl: string;
|
|
@@ -555,5 +667,5 @@ declare const CURRENCIES: Currency[];
|
|
|
555
667
|
declare function getCurrency(code: string): Currency | undefined;
|
|
556
668
|
declare function formatCurrency(amount: number, currencyCode?: string): string;
|
|
557
669
|
|
|
558
|
-
export { AvatarComponent, BadgeComponent, ButtonComponent, CATEGORY_COLORS, CATEGORY_ICONS, CURRENCIES, CardComponent, ConfirmDialogComponent, CurrencyFormatPipe, DateFormatPipe, DialogComponent, EmptyStateComponent, EnvironmentToken, ExpenseService, InputComponent, LoaderComponent, PasswordStrengthComponent, ProgressBarComponent, SelectComponent, SharedHttpService, SkeletonComponent, SnackbarComponent, SnackbarService, StatCardComponent, TRIP_STATUS_COLORS, TooltipDirective, TripDurationPipe, TripService, TripStatusStylePipe, formatCurrency, getCurrency };
|
|
559
|
-
export type { ApiResponse, BadgeVariant, ButtonSize, ButtonVariant, CategorySpending, Currency, DailyExpenses, DatePreset, DialogConfig, DialogFooterButton, DialogSize, ErrorInterface, Expense, ExpenseCategory, ExpenseDTO, HttpOptions, PasswordStrength, ProgressVariant, SnackbarConfig, SnackbarItem, SnackbarType, TooltipPosition, Trip, TripDTO, TripStatusStyle };
|
|
670
|
+
export { AvatarComponent, BadgeComponent, ButtonComponent, CATEGORY_COLORS, CATEGORY_ICONS, CURRENCIES, CardComponent, ConfirmDialogComponent, CurrencyFormatPipe, DateFormatPipe, DialogComponent, EmptyStateComponent, EnvironmentToken, ExpenseService, InputComponent, LoaderComponent, PasswordStrengthComponent, ProgressBarComponent, SelectComponent, SettlementService, SharedHttpService, SkeletonComponent, SnackbarComponent, SnackbarService, StatCardComponent, TRIP_STATUS_COLORS, TooltipDirective, TripDurationPipe, TripInviteService, TripService, TripStatusStylePipe, formatCurrency, getCurrency };
|
|
671
|
+
export type { ApiResponse, BadgeVariant, ButtonSize, ButtonVariant, CategorySpending, Currency, DailyExpenses, DatePreset, DialogConfig, DialogFooterButton, DialogSize, ErrorInterface, Expense, ExpenseCategory, ExpenseDTO, ExpenseSplitInput, HttpOptions, InviteStatus, MyInvite, MyInviteDTO, OwedShare, PasswordStrength, ProgressVariant, Settlement, SettlementBalance, SettlementTransaction, SnackbarConfig, SnackbarItem, SnackbarType, TooltipPosition, Trip, TripBalance, TripDTO, TripInvite, TripInviteDTO, TripMember, TripStatusStyle };
|