tonightpass 0.0.43 → 0.0.45
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/.turbo/turbo-build.log +10 -10
- package/CHANGELOG.md +14 -0
- package/dist/index.d.mts +120 -50
- package/dist/index.d.ts +120 -50
- package/dist/index.js +13 -13
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -2
- package/src/rest/dtos/organizations/events/tickets/create-organization-event-ticket.dto.ts +2 -1
- package/src/rest/types/index.ts +71 -0
- package/src/rest/types/organizations/events/index.ts +37 -6
- package/src/rest/types/organizations/members/index.ts +13 -3
- package/src/sdk/organizations/events/index.ts +3 -0
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { ParamValue, Query } from 'pathcat';
|
|
|
3
3
|
export * from 'pathcat';
|
|
4
4
|
import * as stripe from 'stripe';
|
|
5
5
|
import stripe__default from 'stripe';
|
|
6
|
+
import { Populate } from '@mikro-orm/core';
|
|
6
7
|
import { Options, Response } from 'redaxios';
|
|
7
8
|
|
|
8
9
|
declare const DEFAULT_API_URL = "https://api.tonightpass.com";
|
|
@@ -288,7 +289,11 @@ declare enum OrganizationEventVisibilityType {
|
|
|
288
289
|
Unlisted = "unlisted",
|
|
289
290
|
Private = "private"
|
|
290
291
|
}
|
|
291
|
-
type OrganizationEventEndpoints = Endpoint<"GET", "/organizations
|
|
292
|
+
type OrganizationEventEndpoints = Endpoint<"GET", "/organizations/events", ArrayResult<OrganizationEvent>, ArrayOptions<OrganizationEvent>> | Endpoint<"GET", "/organizations/events/suggestions", ArrayResult<OrganizationEvent>, ArrayOptions<OrganizationEvent>> | Endpoint<"GET", "/organizations/events/nearby", ArrayResult<OrganizationEvent>, ArrayOptions<OrganizationEvent> & {
|
|
293
|
+
latitude: number;
|
|
294
|
+
longitude: number;
|
|
295
|
+
radius?: number;
|
|
296
|
+
}> | Endpoint<"GET", "/organizations/:slug/events", ArrayResult<OrganizationEvent>, ArrayOptions<OrganizationEvent>> | Endpoint<"GET", "/organizations/:organizationSlug/events/:eventSlug", OrganizationEvent> | Endpoint<"POST", "/organizations/:slug/events", OrganizationEvent, CreateOrganizationEventDto> | Endpoint<"PUT", "/organizations/:organizationSlug/events/:eventSlug", OrganizationEvent, UpdateOrganizationEventDto> | Endpoint<"DELETE", "/organizations/:organizationSlug/events/:eventSlug", OrganizationEvent, null> | OrganizationEventStyleEndpoints | OrganizationEventTicketEndpoints;
|
|
292
297
|
|
|
293
298
|
declare class UpdateOrganizationMemberDto {
|
|
294
299
|
role: OrganizationMemberRole;
|
|
@@ -328,7 +333,7 @@ declare enum OrganizationMemberRole {
|
|
|
328
333
|
Admin = "admin",
|
|
329
334
|
Owner = "owner"
|
|
330
335
|
}
|
|
331
|
-
type OrganizationMembersEndpoints = Endpoint<"GET", "/organizations/members", OrganizationMember
|
|
336
|
+
type OrganizationMembersEndpoints = Endpoint<"GET", "/organizations/members", ArrayResult<OrganizationMember>, ArrayOptions<OrganizationMember>> | Endpoint<"DELETE", "/organizations/members/:id", OrganizationMember[], null> | Endpoint<"GET", "/organizations/:slug/members", ArrayResult<OrganizationMember>, ArrayOptions<OrganizationMember>> | Endpoint<"POST", "/organizations/:slug/members", OrganizationMember, CreateOrganizationMemberDto> | Endpoint<"PUT", "/organizations/:organizationSlug/members/:userId", OrganizationMember, UpdateOrganizationMemberDto> | Endpoint<"DELETE", "/organizations/:organizationSlug/members/:userId", OrganizationMember[], null>;
|
|
332
337
|
|
|
333
338
|
type Organization = Base & {
|
|
334
339
|
slug: string;
|
|
@@ -449,6 +454,56 @@ declare enum Language {
|
|
|
449
454
|
FR = "fr",
|
|
450
455
|
EN = "en"
|
|
451
456
|
}
|
|
457
|
+
type ArraySortOptions = {
|
|
458
|
+
/**
|
|
459
|
+
* Field to sort
|
|
460
|
+
*/
|
|
461
|
+
field: string;
|
|
462
|
+
/**
|
|
463
|
+
* Order to sort
|
|
464
|
+
*/
|
|
465
|
+
order: "asc" | "desc";
|
|
466
|
+
};
|
|
467
|
+
type ArrayPaginationOptions = {
|
|
468
|
+
/**
|
|
469
|
+
* Page number
|
|
470
|
+
*/
|
|
471
|
+
page?: number;
|
|
472
|
+
/**
|
|
473
|
+
* Number of items per page
|
|
474
|
+
*/
|
|
475
|
+
limit?: number;
|
|
476
|
+
/**
|
|
477
|
+
* Offset to start from
|
|
478
|
+
*/
|
|
479
|
+
offset?: number;
|
|
480
|
+
};
|
|
481
|
+
type ArrayFilterOptions = {
|
|
482
|
+
/**
|
|
483
|
+
* Field to filter
|
|
484
|
+
*/
|
|
485
|
+
field: string;
|
|
486
|
+
/**
|
|
487
|
+
* Value to filter
|
|
488
|
+
*/
|
|
489
|
+
value: string;
|
|
490
|
+
/**
|
|
491
|
+
* Operator to use
|
|
492
|
+
*/
|
|
493
|
+
operator: "eq" | "ne" | "gt" | "lt" | "gte" | "lte" | "in" | "nin";
|
|
494
|
+
};
|
|
495
|
+
type ArrayOptions<T> = {
|
|
496
|
+
/**
|
|
497
|
+
* Populate relations
|
|
498
|
+
*/
|
|
499
|
+
populate?: Populate<T>;
|
|
500
|
+
};
|
|
501
|
+
type ArrayResult<T> = {
|
|
502
|
+
data: T[];
|
|
503
|
+
total: number;
|
|
504
|
+
page: number;
|
|
505
|
+
limit: number;
|
|
506
|
+
};
|
|
452
507
|
|
|
453
508
|
declare class CreateOrganizationMemberDto {
|
|
454
509
|
user: string;
|
|
@@ -598,27 +653,27 @@ declare class Client {
|
|
|
598
653
|
path: Path;
|
|
599
654
|
method: "GET";
|
|
600
655
|
}> | Extract<Endpoint<"GET", "/careers/categories", CareersCategory[], {
|
|
601
|
-
language?: string
|
|
656
|
+
language?: string;
|
|
602
657
|
}>, {
|
|
603
658
|
path: Path;
|
|
604
659
|
method: "GET";
|
|
605
660
|
}> | Extract<Endpoint<"GET", "/careers/employmentTypes", CareersEmploymentType[], {
|
|
606
|
-
language?: string
|
|
661
|
+
language?: string;
|
|
607
662
|
}>, {
|
|
608
663
|
path: Path;
|
|
609
664
|
method: "GET";
|
|
610
665
|
}> | Extract<Endpoint<"GET", "/careers/jobs", CareersJob[], {
|
|
611
|
-
page?: number
|
|
612
|
-
pageSize?: number
|
|
666
|
+
page?: number;
|
|
667
|
+
pageSize?: number;
|
|
613
668
|
createdAtGte: string;
|
|
614
|
-
createdAtLt?: string
|
|
615
|
-
updatedAtGte?: string
|
|
616
|
-
updatedAtLt?: string
|
|
617
|
-
status?: "ALL" | "ONLINE" | "ARCHIVED"
|
|
618
|
-
content?: boolean
|
|
619
|
-
titleLike?: string
|
|
620
|
-
countryCode?: string
|
|
621
|
-
externalId?: string
|
|
669
|
+
createdAtLt?: string;
|
|
670
|
+
updatedAtGte?: string;
|
|
671
|
+
updatedAtLt?: string;
|
|
672
|
+
status?: "ALL" | "ONLINE" | "ARCHIVED";
|
|
673
|
+
content?: boolean;
|
|
674
|
+
titleLike?: string;
|
|
675
|
+
countryCode?: string;
|
|
676
|
+
externalId?: string;
|
|
622
677
|
}>, {
|
|
623
678
|
path: Path;
|
|
624
679
|
method: "GET";
|
|
@@ -628,10 +683,10 @@ declare class Client {
|
|
|
628
683
|
path: Path;
|
|
629
684
|
method: "GET";
|
|
630
685
|
}> | Extract<Endpoint<"GET", "/careers/offices", CareersOffice[], {
|
|
631
|
-
page?: number
|
|
632
|
-
pageSize?: number
|
|
633
|
-
countryCode?: string
|
|
634
|
-
cityNameLike?: string
|
|
686
|
+
page?: number;
|
|
687
|
+
pageSize?: number;
|
|
688
|
+
countryCode?: string;
|
|
689
|
+
cityNameLike?: string;
|
|
635
690
|
}>, {
|
|
636
691
|
path: Path;
|
|
637
692
|
method: "GET";
|
|
@@ -659,10 +714,23 @@ declare class Client {
|
|
|
659
714
|
}> | Extract<Endpoint<"GET", "/organizations/:slug/billing/dashboard", void>, {
|
|
660
715
|
path: Path;
|
|
661
716
|
method: "GET";
|
|
662
|
-
}> | Extract<Endpoint<"GET", "/organizations
|
|
717
|
+
}> | Extract<Endpoint<"GET", "/organizations/events", ArrayResult<OrganizationEvent>, ArrayOptions<OrganizationEvent>>, {
|
|
718
|
+
path: Path;
|
|
719
|
+
method: "GET";
|
|
720
|
+
}> | Extract<Endpoint<"GET", "/organizations/events/suggestions", ArrayResult<OrganizationEvent>, ArrayOptions<OrganizationEvent>>, {
|
|
721
|
+
path: Path;
|
|
722
|
+
method: "GET";
|
|
723
|
+
}> | Extract<Endpoint<"GET", "/organizations/events/nearby", ArrayResult<OrganizationEvent>, ArrayOptions<OrganizationEvent> & {
|
|
724
|
+
latitude: number;
|
|
725
|
+
longitude: number;
|
|
726
|
+
radius?: number;
|
|
727
|
+
}>, {
|
|
728
|
+
path: Path;
|
|
729
|
+
method: "GET";
|
|
730
|
+
}> | Extract<Endpoint<"GET", "/organizations/:slug/events", ArrayResult<OrganizationEvent>, ArrayOptions<OrganizationEvent>>, {
|
|
663
731
|
path: Path;
|
|
664
732
|
method: "GET";
|
|
665
|
-
}> | Extract<Endpoint<"GET", "/organizations/:organizationSlug/events/:eventSlug",
|
|
733
|
+
}> | Extract<Endpoint<"GET", "/organizations/:organizationSlug/events/:eventSlug", OrganizationEvent>, {
|
|
666
734
|
path: Path;
|
|
667
735
|
method: "GET";
|
|
668
736
|
}> | Extract<Endpoint<"GET", "/organizations/events/styles", OrganizationEventStyle[]>, {
|
|
@@ -677,10 +745,10 @@ declare class Client {
|
|
|
677
745
|
}> | Extract<Endpoint<"GET", "/organizations/:slug/events/:eventSlug/tickets/:ticketId", OrganizationEventTicket>, {
|
|
678
746
|
path: Path;
|
|
679
747
|
method: "GET";
|
|
680
|
-
}> | Extract<Endpoint<"GET", "/organizations/members", OrganizationMember
|
|
748
|
+
}> | Extract<Endpoint<"GET", "/organizations/members", ArrayResult<OrganizationMember>, ArrayOptions<OrganizationMember>>, {
|
|
681
749
|
path: Path;
|
|
682
750
|
method: "GET";
|
|
683
|
-
}> | Extract<Endpoint<"GET", "/organizations/:slug/members", OrganizationMember
|
|
751
|
+
}> | Extract<Endpoint<"GET", "/organizations/:slug/members", ArrayResult<OrganizationMember>, ArrayOptions<OrganizationMember>>, {
|
|
684
752
|
path: Path;
|
|
685
753
|
method: "GET";
|
|
686
754
|
}> | Extract<ProfileEndpoints, {
|
|
@@ -700,10 +768,10 @@ declare class Client {
|
|
|
700
768
|
}> | Extract<Endpoint<"GET", "/users/check/:identifier", {
|
|
701
769
|
exists: boolean;
|
|
702
770
|
identifier: UserIdentifier;
|
|
703
|
-
suggestions?: string[]
|
|
771
|
+
suggestions?: string[];
|
|
704
772
|
}, {
|
|
705
773
|
identifier: boolean;
|
|
706
|
-
suggestions?: boolean
|
|
774
|
+
suggestions?: boolean;
|
|
707
775
|
}>, {
|
|
708
776
|
path: Path;
|
|
709
777
|
method: "GET";
|
|
@@ -728,7 +796,7 @@ declare class Client {
|
|
|
728
796
|
}> | Extract<Endpoint<"POST", "/organizations", Organization, CreateOrganizationDto>, {
|
|
729
797
|
path: Path;
|
|
730
798
|
method: "POST";
|
|
731
|
-
}> | Extract<Endpoint<"POST", "/organizations/:slug/events",
|
|
799
|
+
}> | Extract<Endpoint<"POST", "/organizations/:slug/events", OrganizationEvent, CreateOrganizationEventDto>, {
|
|
732
800
|
path: Path;
|
|
733
801
|
method: "POST";
|
|
734
802
|
}> | Extract<Endpoint<"POST", "/organizations/events/styles", OrganizationEventStyle, CreateOrganizationEventStyleDto>, {
|
|
@@ -749,7 +817,7 @@ declare class Client {
|
|
|
749
817
|
}>["body"], query?: Query<Path>, options?: APIRequestOptions): Promise<(Extract<Endpoint<"PUT", "/organizations/:slug", Organization, UpdateOrganizationDto>, {
|
|
750
818
|
path: Path;
|
|
751
819
|
method: "PUT";
|
|
752
|
-
}> | Extract<Endpoint<"PUT", "/organizations/:organizationSlug/events/:eventSlug",
|
|
820
|
+
}> | Extract<Endpoint<"PUT", "/organizations/:organizationSlug/events/:eventSlug", OrganizationEvent, UpdateOrganizationEventDto>, {
|
|
753
821
|
path: Path;
|
|
754
822
|
method: "PUT";
|
|
755
823
|
}> | Extract<Endpoint<"PUT", "/organizations/events/styles/:slug", OrganizationEventStyle, UpdateOrganizationEventStyleDto>, {
|
|
@@ -779,7 +847,7 @@ declare class Client {
|
|
|
779
847
|
}>["body"], query?: Query<Path>, options?: APIRequestOptions): Promise<(Extract<Endpoint<"DELETE", "/organizations/:slug", Organization, null>, {
|
|
780
848
|
path: Path;
|
|
781
849
|
method: "DELETE";
|
|
782
|
-
}> | Extract<Endpoint<"DELETE", "/organizations/:organizationSlug/events/:eventSlug",
|
|
850
|
+
}> | Extract<Endpoint<"DELETE", "/organizations/:organizationSlug/events/:eventSlug", OrganizationEvent, null>, {
|
|
783
851
|
path: Path;
|
|
784
852
|
method: "DELETE";
|
|
785
853
|
}> | Extract<Endpoint<"DELETE", "/organizations/events/styles/:slug", OrganizationEventStyle[], null>, {
|
|
@@ -852,11 +920,12 @@ declare const organizations: (client: Client) => {
|
|
|
852
920
|
dashboard: (slug: string) => void;
|
|
853
921
|
};
|
|
854
922
|
events: {
|
|
855
|
-
getAll: (slug: string) => Promise<
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
923
|
+
getAll: (slug: string) => Promise<ArrayResult<OrganizationEvent>>;
|
|
924
|
+
getSuggestions: (options?: ArrayOptions) => Promise<ArrayResult<OrganizationEvent>>;
|
|
925
|
+
get: (organizationSlug: string, eventSlug: string) => Promise<OrganizationEvent>;
|
|
926
|
+
create: (slug: string, data: CreateOrganizationEventDto) => Promise<OrganizationEvent>;
|
|
927
|
+
update: (organizationSlug: string, eventSlug: string, data: UpdateOrganizationEventDto) => Promise<OrganizationEvent>;
|
|
928
|
+
delete: (organizationSlug: string, eventSlug: string) => Promise<OrganizationEvent>;
|
|
860
929
|
styles: {
|
|
861
930
|
getAll: () => Promise<OrganizationEventStyle[]>;
|
|
862
931
|
get: (slug: string) => Promise<OrganizationEventStyle>;
|
|
@@ -873,7 +942,7 @@ declare const organizations: (client: Client) => {
|
|
|
873
942
|
};
|
|
874
943
|
};
|
|
875
944
|
members: {
|
|
876
|
-
getAll: () => Promise<OrganizationMember
|
|
945
|
+
getAll: () => Promise<ArrayResult<OrganizationMember>>;
|
|
877
946
|
delete: (id: string) => Promise<OrganizationMember[]>;
|
|
878
947
|
};
|
|
879
948
|
};
|
|
@@ -889,7 +958,7 @@ declare const users: (client: Client) => {
|
|
|
889
958
|
check: (identifier: string, suggestions?: boolean) => Promise<{
|
|
890
959
|
exists: boolean;
|
|
891
960
|
identifier: UserIdentifier;
|
|
892
|
-
suggestions?: string[]
|
|
961
|
+
suggestions?: string[];
|
|
893
962
|
}>;
|
|
894
963
|
update: (id: string, data: UpdateUserDto) => Promise<User>;
|
|
895
964
|
};
|
|
@@ -903,29 +972,29 @@ declare class TonightPass {
|
|
|
903
972
|
refreshToken: () => Promise<null>;
|
|
904
973
|
oauth2: {
|
|
905
974
|
google: {
|
|
906
|
-
connect: (params?: Record<string, pathcat.ParamValue>
|
|
975
|
+
connect: (params?: Record<string, pathcat.ParamValue>) => void;
|
|
907
976
|
};
|
|
908
977
|
twitter: {
|
|
909
|
-
connect: (params?: Record<string, pathcat.ParamValue>
|
|
978
|
+
connect: (params?: Record<string, pathcat.ParamValue>) => void;
|
|
910
979
|
};
|
|
911
980
|
facebook: {
|
|
912
|
-
connect: (params?: Record<string, pathcat.ParamValue>
|
|
981
|
+
connect: (params?: Record<string, pathcat.ParamValue>) => void;
|
|
913
982
|
};
|
|
914
983
|
};
|
|
915
984
|
};
|
|
916
985
|
readonly careers: {
|
|
917
986
|
categories: {
|
|
918
|
-
getAll: (query?: pathcat.Query<"/careers/categories">
|
|
987
|
+
getAll: (query?: pathcat.Query<"/careers/categories">) => Promise<CareersCategory[]>;
|
|
919
988
|
};
|
|
920
989
|
employmentTypes: {
|
|
921
|
-
getAll: (query?: pathcat.Query<"/careers/employmentTypes">
|
|
990
|
+
getAll: (query?: pathcat.Query<"/careers/employmentTypes">) => Promise<CareersEmploymentType[]>;
|
|
922
991
|
};
|
|
923
992
|
jobs: {
|
|
924
|
-
getAll: (query?: pathcat.Query<"/careers/jobs">
|
|
993
|
+
getAll: (query?: pathcat.Query<"/careers/jobs">) => Promise<CareersJob[]>;
|
|
925
994
|
get: (id: number) => Promise<CareersJob>;
|
|
926
995
|
};
|
|
927
996
|
offices: {
|
|
928
|
-
getAll: (query?: pathcat.Query<"/careers/offices">
|
|
997
|
+
getAll: (query?: pathcat.Query<"/careers/offices">) => Promise<CareersOffice[]>;
|
|
929
998
|
};
|
|
930
999
|
};
|
|
931
1000
|
readonly health: {
|
|
@@ -945,11 +1014,12 @@ declare class TonightPass {
|
|
|
945
1014
|
dashboard: (slug: string) => void;
|
|
946
1015
|
};
|
|
947
1016
|
events: {
|
|
948
|
-
getAll: (slug: string) => Promise<
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
1017
|
+
getAll: (slug: string) => Promise<ArrayResult<OrganizationEvent>>;
|
|
1018
|
+
getSuggestions: (options?: ArrayOptions) => Promise<ArrayResult<OrganizationEvent>>;
|
|
1019
|
+
get: (organizationSlug: string, eventSlug: string) => Promise<OrganizationEvent>;
|
|
1020
|
+
create: (slug: string, data: CreateOrganizationEventDto) => Promise<OrganizationEvent>;
|
|
1021
|
+
update: (organizationSlug: string, eventSlug: string, data: UpdateOrganizationEventDto) => Promise<OrganizationEvent>;
|
|
1022
|
+
delete: (organizationSlug: string, eventSlug: string) => Promise<OrganizationEvent>;
|
|
953
1023
|
styles: {
|
|
954
1024
|
getAll: () => Promise<OrganizationEventStyle[]>;
|
|
955
1025
|
get: (slug: string) => Promise<OrganizationEventStyle>;
|
|
@@ -966,7 +1036,7 @@ declare class TonightPass {
|
|
|
966
1036
|
};
|
|
967
1037
|
};
|
|
968
1038
|
members: {
|
|
969
|
-
getAll: () => Promise<OrganizationMember
|
|
1039
|
+
getAll: () => Promise<ArrayResult<OrganizationMember>>;
|
|
970
1040
|
delete: (id: string) => Promise<OrganizationMember[]>;
|
|
971
1041
|
};
|
|
972
1042
|
};
|
|
@@ -977,10 +1047,10 @@ declare class TonightPass {
|
|
|
977
1047
|
getAll: () => Promise<User[]>;
|
|
978
1048
|
get: (id: string) => Promise<User[]>;
|
|
979
1049
|
me: () => Promise<User>;
|
|
980
|
-
check: (identifier: string, suggestions?: boolean
|
|
1050
|
+
check: (identifier: string, suggestions?: boolean) => Promise<{
|
|
981
1051
|
exists: boolean;
|
|
982
1052
|
identifier: UserIdentifier;
|
|
983
|
-
suggestions?: string[]
|
|
1053
|
+
suggestions?: string[];
|
|
984
1054
|
}>;
|
|
985
1055
|
update: (id: string, data: UpdateUserDto) => Promise<User>;
|
|
986
1056
|
};
|
|
@@ -989,4 +1059,4 @@ declare class TonightPass {
|
|
|
989
1059
|
|
|
990
1060
|
declare const isBrowser: boolean;
|
|
991
1061
|
|
|
992
|
-
export { type APIRequestOptions, type APIResponse, type AuthEndpoints, BCRYPT_HASH, type Base, type CareersCategory, type CareersEmploymentType, type CareersEndpoints, type CareersJob, type CareersOffice, Client, type ClientOptions, CreateOrganizationDto, CreateOrganizationEventDto, CreateOrganizationEventTicketDto, CreateOrganizationIdentityDto, CreateOrganizationMemberDto, CreateUserDto, Currency, DEFAULT_API_URL, EMAIL_REGEX, type Endpoint, type Endpoints, type ErroredAPIResponse, type ExcludeBase, type Health, type HealthEndpoints, IMAGE_URL_REGEX, Language, type Location$1 as Location, NAME_REGEX, type Order, type OrderItem, OrderStatus, type Organization, type OrganizationBilling, type OrganizationBillingAccount, type OrganizationEndpoints, type OrganizationEvent, type OrganizationEventEndpoints, type OrganizationEventStyle, type OrganizationEventStyleEndpoints, OrganizationEventStyleType, type OrganizationEventTicket, OrganizationEventTicketCategory, type OrganizationEventTicketEndpoints, OrganizationEventTicketType, OrganizationEventType, OrganizationEventVisibilityType, type OrganizationIdentity, type OrganizationMember, OrganizationMemberRole, OrganizationMemberStatus, type OrganizationMembersEndpoints, type OrganizationSocialLink, OrganizationSocialType, PASSWORD_REGEX, PHONE_NUMBER_REGEX, type PathsFor, type Profile, type ProfileEndpoints, type ProfileMetadata, type PromisedAPIResponse, type PromoCode, SLUG_REGEX, SignInUserDto, type SuccessfulAPIResponse, TonightPass, TonightPassAPIError, UpdateOrganizationDto, UpdateOrganizationEventDto, UpdateOrganizationEventTicketDto, UpdateOrganizationIdentityDto, UpdateOrganizationMemberDto, UpdateUserDto, type User, type UserConnection, type UserConnectionClient, type UserConnectionDevice, type UserConnectionOS, type UserEndpoints, type UserIdentifier, type UserIdentity, type UserIdentityGender, type UserPreferences, UserRole, type UserToken, UserTokenType, auth, careers, health, isBrowser, organizations, profiles, request, sdk, users };
|
|
1062
|
+
export { type APIRequestOptions, type APIResponse, type ArrayFilterOptions, type ArrayOptions, type ArrayPaginationOptions, type ArrayResult, type ArraySortOptions, type AuthEndpoints, BCRYPT_HASH, type Base, type CareersCategory, type CareersEmploymentType, type CareersEndpoints, type CareersJob, type CareersOffice, Client, type ClientOptions, CreateOrganizationDto, CreateOrganizationEventDto, CreateOrganizationEventTicketDto, CreateOrganizationIdentityDto, CreateOrganizationMemberDto, CreateUserDto, Currency, DEFAULT_API_URL, EMAIL_REGEX, type Endpoint, type Endpoints, type ErroredAPIResponse, type ExcludeBase, type Health, type HealthEndpoints, IMAGE_URL_REGEX, Language, type Location$1 as Location, NAME_REGEX, type Order, type OrderItem, OrderStatus, type Organization, type OrganizationBilling, type OrganizationBillingAccount, type OrganizationEndpoints, type OrganizationEvent, type OrganizationEventEndpoints, type OrganizationEventStyle, type OrganizationEventStyleEndpoints, OrganizationEventStyleType, type OrganizationEventTicket, OrganizationEventTicketCategory, type OrganizationEventTicketEndpoints, OrganizationEventTicketType, OrganizationEventType, OrganizationEventVisibilityType, type OrganizationIdentity, type OrganizationMember, OrganizationMemberRole, OrganizationMemberStatus, type OrganizationMembersEndpoints, type OrganizationSocialLink, OrganizationSocialType, PASSWORD_REGEX, PHONE_NUMBER_REGEX, type PathsFor, type Profile, type ProfileEndpoints, type ProfileMetadata, type PromisedAPIResponse, type PromoCode, SLUG_REGEX, SignInUserDto, type SuccessfulAPIResponse, TonightPass, TonightPassAPIError, UpdateOrganizationDto, UpdateOrganizationEventDto, UpdateOrganizationEventTicketDto, UpdateOrganizationIdentityDto, UpdateOrganizationMemberDto, UpdateUserDto, type User, type UserConnection, type UserConnectionClient, type UserConnectionDevice, type UserConnectionOS, type UserEndpoints, type UserIdentifier, type UserIdentity, type UserIdentityGender, type UserPreferences, UserRole, type UserToken, UserTokenType, auth, careers, health, isBrowser, organizations, profiles, request, sdk, users };
|
package/dist/index.js
CHANGED
|
@@ -3,47 +3,47 @@
|
|
|
3
3
|
require('reflect-metadata');
|
|
4
4
|
var classValidator = require('class-validator');
|
|
5
5
|
var classTransformer = require('class-transformer');
|
|
6
|
-
var
|
|
6
|
+
var lt = require('redaxios');
|
|
7
7
|
var pathcat = require('pathcat');
|
|
8
8
|
|
|
9
9
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var lt__default = /*#__PURE__*/_interopDefault(lt);
|
|
12
12
|
|
|
13
|
-
var Ye=Object.defineProperty;var o=(e,t)=>Ye(e,"name",{value:t,configurable:!0});var Q="https://api.tonightpass.com";var ht=/^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$/,bt=/((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/,X=/(^[\p{L}\d'\\.\s\\-]*$)/u,xt=/^[a-z\d]+(?:(\.|-|_)[a-z\d]+)*$/,vt=/\$2[abxy]?\$\d{1,2}\$[A-Za-z\d\\./]{53}/,wt=/^\s*(?:\+?(\d{1,3}))?([-. (]*(\d{3})[-. )]*)?((\d{3})[-. ]*(\d{2,4})(?:[-.x ]*(\d+))?)\s*$/,Rt=/(((http:\/\/www)|(http:\/\/)|(www))[-a-zA-Z0-9@:%_\\+.~#?&//=]+)\.(jpg|jpeg|gif|png|bmp|tiff|tga|svg)/i;function v(e,t,r,s){var i=arguments.length,n=i<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,r):s,p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,r,s);else for(var a=e.length-1;a>=0;a--)(p=e[a])&&(n=(i<3?p(n):i>3?p(t,r,n):p(t,r))||n);return i>3&&n&&Object.defineProperty(t,r,n),n}o(v,"_ts_decorate");function w(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}o(w,"_ts_metadata");var D=class{static{o(this,"CreateOrganizationDto");}slug;identity;members;location};v([classValidator.IsOptional(),classValidator.IsString(),classValidator.IsLowercase(),classValidator.Length(1,48),w("design:type",String)],D.prototype,"slug",void 0);v([classValidator.IsObject(),w("design:type",typeof x>"u"?Object:x)],D.prototype,"identity",void 0);v([classValidator.IsArray(),w("design:type",Array)],D.prototype,"members",void 0);v([classValidator.IsOptional(),classValidator.IsObject(),w("design:type",typeof Location>"u"?Object:Location)],D.prototype,"location",void 0);var x=class{static{o(this,"CreateOrganizationIdentityDto");}displayName;description;avatarUrl;bannerUrl;socialLinks};v([classValidator.IsString(),classValidator.IsNotEmpty(),classValidator.Length(1,32),w("design:type",String)],x.prototype,"displayName",void 0);v([classValidator.IsString(),classValidator.Length(16,1024),classValidator.IsOptional(),w("design:type",String)],x.prototype,"description",void 0);v([classValidator.IsUrl({protocols:["http","https"]}),w("design:type",String)],x.prototype,"avatarUrl",void 0);v([classValidator.IsOptional(),classValidator.IsUrl({protocols:["http","https"]}),w("design:type",String)],x.prototype,"bannerUrl",void 0);v([classValidator.IsOptional(),classValidator.IsArray(),w("design:type",Array)],x.prototype,"socialLinks",void 0);function j(e,t,r,s){var i=arguments.length,n=i<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,r):s,p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,r,s);else for(var a=e.length-1;a>=0;a--)(p=e[a])&&(n=(i<3?p(n):i>3?p(t,r,n):p(t,r))||n);return i>3&&n&&Object.defineProperty(t,r,n),n}o(j,"_ts_decorate");function _(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}o(_,"_ts_metadata");var P=class{static{o(this,"UpdateOrganizationDto");}slug;identity;members;location};j([classValidator.IsOptional(),classValidator.IsString(),classValidator.IsLowercase(),classValidator.Length(1,48),_("design:type",String)],P.prototype,"slug",void 0);j([classValidator.IsObject(),classValidator.IsOptional(),_("design:type",typeof R>"u"?Object:R)],P.prototype,"identity",void 0);j([classValidator.IsOptional(),classValidator.IsArray(),_("design:type",Array)],P.prototype,"members",void 0);j([classValidator.IsOptional(),classValidator.IsObject(),_("design:type",typeof Location>"u"?Object:Location)],P.prototype,"location",void 0);var R=class{static{o(this,"UpdateOrganizationIdentityDto");}displayName;description;avatarUrl;bannerUrl;socialLinks};j([classValidator.IsString(),classValidator.IsNotEmpty(),classValidator.Length(1,32),classValidator.IsOptional(),_("design:type",String)],R.prototype,"displayName",void 0);j([classValidator.IsString(),classValidator.Length(16,1024),classValidator.IsOptional(),_("design:type",String)],R.prototype,"description",void 0);j([classValidator.IsUrl({protocols:["http","https"]}),classValidator.IsOptional(),_("design:type",String)],R.prototype,"avatarUrl",void 0);j([classValidator.IsOptional(),classValidator.IsUrl({protocols:["http","https"]}),_("design:type",String)],R.prototype,"bannerUrl",void 0);j([classValidator.IsOptional(),classValidator.IsArray(),_("design:type",Array)],R.prototype,"socialLinks",void 0);exports.OrganizationEventTicketType = void 0;(function(e){e.ETicket="e-ticket",e.Other="other";})(exports.OrganizationEventTicketType||(exports.OrganizationEventTicketType={}));exports.OrganizationEventTicketCategory = void 0;(function(e){e.Entry="entry",e.Package="package",e.Meal="meal",e.Drink="drink",e.Parking="parking",e.Accommodation="accommodation",e.Camping="camping",e.Locker="locker",e.Shuttle="shuttle",e.Other="other";})(exports.OrganizationEventTicketCategory||(exports.OrganizationEventTicketCategory={}));exports.OrganizationEventStyleType = void 0;(function(e){e.Music="music",e.Dress="dress",e.Sport="sport",e.Food="food",e.Art="art";})(exports.OrganizationEventStyleType||(exports.OrganizationEventStyleType={}));exports.OrganizationEventType = void 0;(function(e){e.Clubbing="clubbing",e.Concert="concert",e.Afterwork="afterwork",e.DancingLunch="dancing_lunch",e.Diner="diner",e.Garden="garden",e.AfterBeach="after_beach",e.Festival="festival",e.Spectacle="spectacle",e.Cruise="cruise",e.OutsideAnimation="outside_animation",e.Sport="sport",e.Match="match",e.Seminar="seminar",e.Conference="conference",e.WellnessDay="wellness_day",e.Workshop="workshop",e.TradeFair="trade_fair",e.ConsumerShow="consumer_show",e.Membership="membership";})(exports.OrganizationEventType||(exports.OrganizationEventType={}));exports.OrganizationEventVisibilityType = void 0;(function(e){e.Public="public",e.Unlisted="unlisted",e.Private="private";})(exports.OrganizationEventVisibilityType||(exports.OrganizationEventVisibilityType={}));exports.OrganizationMemberStatus = void 0;(function(e){e.Pending="pending",e.Accepted="accepted",e.Rejected="rejected";})(exports.OrganizationMemberStatus||(exports.OrganizationMemberStatus={}));exports.OrganizationMemberRole = void 0;(function(e){e.Member="member",e.Manager="manager",e.Admin="admin",e.Owner="owner";})(exports.OrganizationMemberRole||(exports.OrganizationMemberRole={}));exports.OrganizationSocialType = void 0;(function(e){e.Facebook="facebook",e.Twitter="twitter",e.Instagram="instagram",e.Linkedin="linkedin",e.Youtube="youtube",e.Website="website";})(exports.OrganizationSocialType||(exports.OrganizationSocialType={}));exports.UserTokenType = void 0;(function(e){e.Authentication="authentication",e.OrganizationInvite="organization_invite",e.PasswordRecovery="password_recovery",e.EmailValidation="email_validation",e.PhoneValidation="phone_validation";})(exports.UserTokenType||(exports.UserTokenType={}));exports.UserRole = void 0;(function(e){e.User="user",e.Developer="developer",e.Admin="admin";})(exports.UserRole||(exports.UserRole={}));exports.OrderStatus = void 0;(function(e){e.Created="created",e.Cancelled="cancelled",e.Completed="completed",e.Pending="pending",e.Confirmed="confirmed",e.Declined="declined",e.Refunded="refunded",e.PartiallyRefunded="partially_refunded",e.Expired="expired";})(exports.OrderStatus||(exports.OrderStatus={}));exports.Currency = void 0;(function(e){e.EUR="EUR",e.USD="USD",e.GBP="GBP";})(exports.Currency||(exports.Currency={}));exports.Language = void 0;(function(e){e.FR="fr",e.EN="en";})(exports.Language||(exports.Language={}));function S(e,t,r,s){var i=arguments.length,n=i<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,r):s,p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,r,s);else for(var a=e.length-1;a>=0;a--)(p=e[a])&&(n=(i<3?p(n):i>3?p(t,r,n):p(t,r))||n);return i>3&&n&&Object.defineProperty(t,r,n),n}o(S,"_ts_decorate");function L(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}o(L,"_ts_metadata");var u=class{static{o(this,"CreateOrganizationEventDto");}title;slug;description;type;visibility;flyers;trailers;location;tickets;styles;startAt;endAt};S([classValidator.IsString(),classValidator.Length(1,64),L("design:type",String)],u.prototype,"title",void 0);S([classValidator.IsOptional(),classValidator.IsString(),classValidator.IsLowercase(),classValidator.Length(1,48),L("design:type",String)],u.prototype,"slug",void 0);S([classValidator.IsString(),classValidator.Length(16,2048),L("design:type",String)],u.prototype,"description",void 0);S([classValidator.IsEnum(exports.OrganizationEventType),L("design:type",typeof exports.OrganizationEventType>"u"?Object:exports.OrganizationEventType)],u.prototype,"type",void 0);S([classValidator.IsEnum(exports.OrganizationEventVisibilityType),L("design:type",typeof exports.OrganizationEventVisibilityType>"u"?Object:exports.OrganizationEventVisibilityType)],u.prototype,"visibility",void 0);S([classValidator.IsDateString(),L("design:type",typeof Date>"u"?Object:Date)],u.prototype,"startAt",void 0);S([classValidator.IsDateString(),L("design:type",typeof Date>"u"?Object:Date)],u.prototype,"endAt",void 0);var ye=class extends u{static{o(this,"UpdateOrganizationEventDto");}};function g(e,t,r,s){var i=arguments.length,n=i<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,r):s,p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,r,s);else for(var a=e.length-1;a>=0;a--)(p=e[a])&&(n=(i<3?p(n):i>3?p(t,r,n):p(t,r))||n);return i>3&&n&&Object.defineProperty(t,r,n),n}o(g,"_ts_decorate");function h(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}o(h,"_ts_metadata");var c=class{static{o(this,"CreateOrganizationEventTicketDto");}name;description;price;quantity;type;category;currency;isVisible;isFeesIncluded;startAt;endAt};g([classValidator.IsString(),classValidator.Length(1,128),h("design:type",String)],c.prototype,"name",void 0);g([classValidator.IsString(),classValidator.Length(1,512),h("design:type",String)],c.prototype,"description",void 0);g([classValidator.IsNumber(),classValidator.Min(0),h("design:type",Number)],c.prototype,"price",void 0);g([classValidator.IsNumber(),classValidator.Min(0),h("design:type",Number)],c.prototype,"quantity",void 0);g([classValidator.IsEnum(exports.OrganizationEventTicketCategory),h("design:type",typeof exports.OrganizationEventTicketCategory>"u"?Object:exports.OrganizationEventTicketCategory)],c.prototype,"category",void 0);g([classValidator.IsEnum(exports.Currency),h("design:type",typeof exports.Currency>"u"?Object:exports.Currency)],c.prototype,"currency",void 0);g([classValidator.IsBoolean(),h("design:type",Boolean)],c.prototype,"isVisible",void 0);g([classValidator.IsBoolean(),h("design:type",Boolean)],c.prototype,"isFeesIncluded",void 0);g([classValidator.IsDateString(),classValidator.IsOptional(),h("design:type",typeof Date>"u"?Object:Date)],c.prototype,"startAt",void 0);g([classValidator.IsDateString(),classValidator.IsOptional(),h("design:type",typeof Date>"u"?Object:Date)],c.prototype,"endAt",void 0);var _e=class extends c{static{o(this,"UpdateOrganizationEventTicketDto");}};function Ae(e,t,r,s){var i=arguments.length,n=i<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,r):s,p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,r,s);else for(var a=e.length-1;a>=0;a--)(p=e[a])&&(n=(i<3?p(n):i>3?p(t,r,n):p(t,r))||n);return i>3&&n&&Object.defineProperty(t,r,n),n}o(Ae,"_ts_decorate");function Ie(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}o(Ie,"_ts_metadata");var q=class{static{o(this,"CreateOrganizationMemberDto");}user;role};Ae([classValidator.IsString(),classValidator.IsNotEmpty(),Ie("design:type",String)],q.prototype,"user",void 0);Ae([classValidator.IsEnum(exports.OrganizationMemberRole),classValidator.IsNotEmpty(),Ie("design:type",typeof exports.OrganizationMemberRole>"u"?Object:exports.OrganizationMemberRole)],q.prototype,"role",void 0);function st(e,t,r,s){var i=arguments.length,n=i<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,r):s,p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,r,s);else for(var a=e.length-1;a>=0;a--)(p=e[a])&&(n=(i<3?p(n):i>3?p(t,r,n):p(t,r))||n);return i>3&&n&&Object.defineProperty(t,r,n),n}o(st,"_ts_decorate");function nt(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}o(nt,"_ts_metadata");var J=class{static{o(this,"UpdateOrganizationMemberDto");}role};st([classValidator.IsEnum(exports.OrganizationMemberRole),classValidator.IsNotEmpty(),nt("design:type",typeof exports.OrganizationMemberRole>"u"?Object:exports.OrganizationMemberRole)],J.prototype,"role",void 0);var Le=class{static{o(this,"CreateUserDto");}identifier;password;identity;addresses};var De=class{static{o(this,"SignInUserDto");}identifier;password};function d(e,t,r,s){var i=arguments.length,n=i<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,r):s,p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,r,s);else for(var a=e.length-1;a>=0;a--)(p=e[a])&&(n=(i<3?p(n):i>3?p(t,r,n):p(t,r))||n);return i>3&&n&&Object.defineProperty(t,r,n),n}o(d,"_ts_decorate");function l(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}o(l,"_ts_metadata");var k=class{static{o(this,"UpdateUserDto");}identifier;identity;password};d([classValidator.IsOptional(),classValidator.IsObject(),classValidator.ValidateNested(),classTransformer.Type(()=>G),l("design:type",typeof G>"u"?Object:G)],k.prototype,"identifier",void 0);d([classValidator.IsOptional(),classValidator.IsObject(),classValidator.ValidateNested(),classTransformer.Type(()=>m),l("design:type",typeof m>"u"?Object:m)],k.prototype,"identity",void 0);d([classValidator.IsOptional(),classValidator.IsString(),classValidator.MinLength(8),classValidator.MaxLength(128),l("design:type",String)],k.prototype,"password",void 0);var G=class{static{o(this,"UpdateIdentifierDto");}email;phoneNumber;username};d([classValidator.IsOptional(),classValidator.IsString(),classValidator.IsEmail(),l("design:type",String)],G.prototype,"email",void 0);d([classValidator.IsOptional(),classValidator.IsString(),classValidator.IsPhoneNumber(),l("design:type",String)],G.prototype,"phoneNumber",void 0);d([classValidator.IsOptional(),classValidator.IsString(),classValidator.MinLength(3),l("design:type",String)],G.prototype,"username",void 0);var m=class{static{o(this,"UpdateIdentityDto");}firstName;lastName;displayName;description;avatarUrl;bannerUrl;gender;birthDate};d([classValidator.IsOptional(),classValidator.IsString(),classValidator.Length(2,32),classValidator.Matches(X,{message:"First name must be composed of letters only"}),l("design:type",String)],m.prototype,"firstName",void 0);d([classValidator.IsOptional(),classValidator.IsString(),classValidator.Length(2,32),classValidator.Matches(X,{message:"Last name must be composed of letters only"}),l("design:type",String)],m.prototype,"lastName",void 0);d([classValidator.IsOptional(),classValidator.IsString(),classValidator.Length(1,32),l("design:type",String)],m.prototype,"displayName",void 0);d([classValidator.IsOptional(),classValidator.IsString(),classValidator.Length(1,128),l("design:type",String)],m.prototype,"description",void 0);d([classValidator.IsOptional(),classValidator.IsUrl(),l("design:type",Object)],m.prototype,"avatarUrl",void 0);d([classValidator.IsOptional(),classValidator.IsUrl(),l("design:type",Object)],m.prototype,"bannerUrl",void 0);d([classValidator.IsOptional(),l("design:type",String)],m.prototype,"gender",void 0);d([classValidator.IsOptional(),classValidator.IsDateString(),l("design:type",typeof Date>"u"?Object:Date)],m.prototype,"birthDate",void 0);var b=typeof window<"u";var ut=ft__default.default.create({headers:{"Content-Type":"application/json",Accept:"application/json",...!b&&{"User-Agent":"tonightpass-api-client"}},responseType:"json",transformRequest:[function(e){return JSON.stringify(e)}],withCredentials:b}),Oe=o(async(e,t)=>ut(e,{...t}).then(s=>s).catch(s=>{throw s.data||console.error(s),s.data}),"request");var K=class extends Error{static{o(this,"TonightPassAPIError");}response;data;status;constructor(t,r){super(r.message),this.response=t,this.data=r,this.status=t.status;}},F=class{static{o(this,"Client");}options;url;constructor(t){this.options=t,this.url=(r,s)=>{let i=this.options.baseURL||Q;return pathcat.pathcat(i,r,s)};}setOptions(t){this.options=t;}async get(t,r,s){return this.requester("GET",t,void 0,r,s)}async post(t,r,s,i){return this.requester("POST",t,r,s,i)}async put(t,r,s,i){return this.requester("PUT",t,r,s,i)}async patch(t,r,s,i){return this.requester("PATCH",t,r,s,i)}async delete(t,r,s,i){return this.requester("DELETE",t,r,s,i)}async requester(t,r,s,i={},n={}){let p=this.url(r,i);if(s!==void 0&&t==="GET")throw new Error("Cannot send a GET request with a body");let a=await Oe(p,{method:t,data:s,...n}),$=a.data;if(!$.success)throw new K(a,$);return $.data}};function O(e){return e}o(O,"sdk");var Me=e=>({signIn:o(async t=>e.post("/auth/sign-in",t),"signIn"),signUp:o(async t=>e.post("/auth/sign-up",t),"signUp"),signOut:o(async()=>e.post("/auth/sign-out",null),"signOut"),refreshToken:o(async()=>e.post("/auth/refresh-token",null),"refreshToken"),oauth2:{google:{connect:o(t=>{if(b)window.location.href=e.url("/oauth2/google",t||{});else throw new Error("Google OAuth2 is only available in the browser")},"connect")},twitter:{connect:o(t=>{if(b)window.location.href=e.url("/oauth2/twitter",t||{});else throw new Error("Twitter OAuth2 is only available in the browser")},"connect")},facebook:{connect:o(t=>{if(b)window.location.href=e.url("/oauth2/facebook",t||{});else throw new Error("Facebook OAuth2 is only available in the browser")},"connect")}}});var ke=e=>({categories:{getAll:o(async t=>e.get("/careers/categories",t),"getAll")},employmentTypes:{getAll:o(async t=>e.get("/careers/employmentTypes",t),"getAll")},jobs:{getAll:o(async t=>e.get("/careers/jobs",t),"getAll"),get:o(async t=>e.get("/careers/jobs/:id",{id:t}),"get")},offices:{getAll:o(async t=>e.get("/careers/offices",t),"getAll")}});var qe=e=>({getAll:o(async()=>e.get("/health"),"getAll"),database:o(async()=>e.get("/health/database"),"database"),http:o(async()=>e.get("/health/http"),"http")});var ze=o(e=>({account:o(async t=>e.get("/organizations/:slug/billing/account",{slug:t}),"account"),link:o(t=>{if(b)window.location.href=e.url("/organizations/:slug/billing/link",{slug:t});else throw new Error("Billing link is only available in the browser")},"link"),dashboard:o(t=>{if(b)window.location.href=e.url("/organizations/:slug/billing/dashboard",{slug:t});else throw new Error("Billing dashboard is only available in the browser")},"dashboard")}),"organizationsBilling");var Fe=o(e=>({getAll:o(async()=>e.get("/organizations/events/styles"),"getAll"),get:o(async t=>e.get("/organizations/events/styles/:slug",{slug:t}),"get"),create:o(async t=>e.post("/organizations/events/styles",t),"create"),update:o(async(t,r)=>e.put("/organizations/events/styles/:slug",r,{slug:t}),"update"),delete:o(async t=>e.delete("/organizations/events/styles/:slug",null,{slug:t}),"delete")}),"organizationsEventsStyles");var $e=o(e=>({getAll:o(async(t,r)=>e.get("/organizations/:slug/events/:eventSlug/tickets",{slug:t,eventSlug:r}),"getAll"),get:o(async(t,r,s)=>e.get("/organizations/:slug/events/:eventSlug/tickets/:ticketId",{slug:t,eventSlug:r,ticketId:s}),"get"),create:o(async(t,r,s)=>e.post("/organizations/:slug/events/:eventSlug/tickets",s,{slug:t,eventSlug:r}),"create"),update:o(async(t,r,s,i)=>e.put("/organizations/:slug/events/:eventSlug/tickets/:ticketId",i,{slug:t,eventSlug:r,ticketId:s}),"update"),delete:o(async(t,r,s)=>e.delete("/organizations/:slug/events/:eventSlug/tickets/:ticketId",null,{slug:t,eventSlug:r,ticketId:s}),"delete")}),"organizationsEventsTickets");var Xe=o(e=>({getAll:o(async t=>e.get("/organizations/:slug/events",{slug:t}),"getAll"),get:o(async(t,r)=>e.get("/organizations/:organizationSlug/events/:eventSlug",{organizationSlug:t,eventSlug:r}),"get"),create:o(async(t,r)=>e.post("/organizations/:slug/events",r,{slug:t}),"create"),update:o(async(t,r,s)=>e.put("/organizations/:organizationSlug/events/:eventSlug",s,{organizationSlug:t,eventSlug:r}),"update"),delete:o(async(t,r)=>e.delete("/organizations/:organizationSlug/events/:eventSlug",null,{organizationSlug:t,eventSlug:r}),"delete"),styles:Fe(e),tickets:$e(e)}),"organizationsEvents");var Ce=o(e=>({getAll:o(async()=>e.get("/organizations/members"),"getAll"),delete:o(async t=>e.delete("/organizations/members/:id",null,{id:t}),"delete")}),"organizationsMembers");var Ve=e=>({getAll:o(async()=>e.get("/organizations"),"getAll"),get:o(async t=>e.get("/organizations/:slug",{slug:t}),"get"),create:o(async t=>e.post("/organizations",t),"create"),update:o(async(t,r)=>e.put("/organizations/:slug",r,{slug:t}),"update"),delete:o(async t=>e.delete("/organizations/:slug",null,{slug:t}),"delete"),billing:ze(e),events:Xe(e),members:Ce(e)});var We=e=>({get:o(async t=>e.get("/profiles/:username",{username:t}),"get")});var He=e=>({getAll:o(async()=>e.get("/users"),"getAll"),get:o(async t=>e.get("/users",{id:t}),"get"),me:o(async()=>e.get("/users/me"),"me"),check:o(async(t,r)=>e.get("/users/check/:identifier",{identifier:t,suggestions:r}),"check"),update:o(async(t,r)=>e.put("/users/:id",r,{id:t}),"update")});var Ze=class{static{o(this,"TonightPass");}client;auth;careers;health;organizations;profiles;users;constructor(t){this.client=new F(t),this.auth=Me(this.client),this.careers=ke(this.client),this.health=qe(this.client),this.organizations=Ve(this.client),this.profiles=We(this.client),this.users=He(this.client);}};
|
|
13
|
+
var Ye=Object.defineProperty;var o=(e,t)=>Ye(e,"name",{value:t,configurable:!0});var ee="https://api.tonightpass.com";var ht=/^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$/,bt=/((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/,C=/(^[\p{L}\d'\\.\s\\-]*$)/u,xt=/^[a-z\d]+(?:(\.|-|_)[a-z\d]+)*$/,vt=/\$2[abxy]?\$\d{1,2}\$[A-Za-z\d\\./]{53}/,wt=/^\s*(?:\+?(\d{1,3}))?([-. (]*(\d{3})[-. )]*)?((\d{3})[-. ]*(\d{2,4})(?:[-.x ]*(\d+))?)\s*$/,Rt=/(((http:\/\/www)|(http:\/\/)|(www))[-a-zA-Z0-9@:%_\\+.~#?&//=]+)\.(jpg|jpeg|gif|png|bmp|tiff|tga|svg)/i;function v(e,t,r,s){var i=arguments.length,n=i<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,r):s,p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,r,s);else for(var a=e.length-1;a>=0;a--)(p=e[a])&&(n=(i<3?p(n):i>3?p(t,r,n):p(t,r))||n);return i>3&&n&&Object.defineProperty(t,r,n),n}o(v,"_ts_decorate");function w(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}o(w,"_ts_metadata");var D=class{static{o(this,"CreateOrganizationDto");}slug;identity;members;location};v([classValidator.IsOptional(),classValidator.IsString(),classValidator.IsLowercase(),classValidator.Length(1,48),w("design:type",String)],D.prototype,"slug",void 0);v([classValidator.IsObject(),w("design:type",typeof x>"u"?Object:x)],D.prototype,"identity",void 0);v([classValidator.IsArray(),w("design:type",Array)],D.prototype,"members",void 0);v([classValidator.IsOptional(),classValidator.IsObject(),w("design:type",typeof Location>"u"?Object:Location)],D.prototype,"location",void 0);var x=class{static{o(this,"CreateOrganizationIdentityDto");}displayName;description;avatarUrl;bannerUrl;socialLinks};v([classValidator.IsString(),classValidator.IsNotEmpty(),classValidator.Length(1,32),w("design:type",String)],x.prototype,"displayName",void 0);v([classValidator.IsString(),classValidator.Length(16,1024),classValidator.IsOptional(),w("design:type",String)],x.prototype,"description",void 0);v([classValidator.IsUrl({protocols:["http","https"]}),w("design:type",String)],x.prototype,"avatarUrl",void 0);v([classValidator.IsOptional(),classValidator.IsUrl({protocols:["http","https"]}),w("design:type",String)],x.prototype,"bannerUrl",void 0);v([classValidator.IsOptional(),classValidator.IsArray(),w("design:type",Array)],x.prototype,"socialLinks",void 0);function j(e,t,r,s){var i=arguments.length,n=i<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,r):s,p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,r,s);else for(var a=e.length-1;a>=0;a--)(p=e[a])&&(n=(i<3?p(n):i>3?p(t,r,n):p(t,r))||n);return i>3&&n&&Object.defineProperty(t,r,n),n}o(j,"_ts_decorate");function _(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}o(_,"_ts_metadata");var P=class{static{o(this,"UpdateOrganizationDto");}slug;identity;members;location};j([classValidator.IsOptional(),classValidator.IsString(),classValidator.IsLowercase(),classValidator.Length(1,48),_("design:type",String)],P.prototype,"slug",void 0);j([classValidator.IsObject(),classValidator.IsOptional(),_("design:type",typeof R>"u"?Object:R)],P.prototype,"identity",void 0);j([classValidator.IsOptional(),classValidator.IsArray(),_("design:type",Array)],P.prototype,"members",void 0);j([classValidator.IsOptional(),classValidator.IsObject(),_("design:type",typeof Location>"u"?Object:Location)],P.prototype,"location",void 0);var R=class{static{o(this,"UpdateOrganizationIdentityDto");}displayName;description;avatarUrl;bannerUrl;socialLinks};j([classValidator.IsString(),classValidator.IsNotEmpty(),classValidator.Length(1,32),classValidator.IsOptional(),_("design:type",String)],R.prototype,"displayName",void 0);j([classValidator.IsString(),classValidator.Length(16,1024),classValidator.IsOptional(),_("design:type",String)],R.prototype,"description",void 0);j([classValidator.IsUrl({protocols:["http","https"]}),classValidator.IsOptional(),_("design:type",String)],R.prototype,"avatarUrl",void 0);j([classValidator.IsOptional(),classValidator.IsUrl({protocols:["http","https"]}),_("design:type",String)],R.prototype,"bannerUrl",void 0);j([classValidator.IsOptional(),classValidator.IsArray(),_("design:type",Array)],R.prototype,"socialLinks",void 0);exports.OrganizationEventTicketType = void 0;(function(e){e.ETicket="e-ticket",e.Other="other";})(exports.OrganizationEventTicketType||(exports.OrganizationEventTicketType={}));exports.OrganizationEventTicketCategory = void 0;(function(e){e.Entry="entry",e.Package="package",e.Meal="meal",e.Drink="drink",e.Parking="parking",e.Accommodation="accommodation",e.Camping="camping",e.Locker="locker",e.Shuttle="shuttle",e.Other="other";})(exports.OrganizationEventTicketCategory||(exports.OrganizationEventTicketCategory={}));exports.OrganizationEventStyleType = void 0;(function(e){e.Music="music",e.Dress="dress",e.Sport="sport",e.Food="food",e.Art="art";})(exports.OrganizationEventStyleType||(exports.OrganizationEventStyleType={}));exports.OrganizationEventType = void 0;(function(e){e.Clubbing="clubbing",e.Concert="concert",e.Afterwork="afterwork",e.DancingLunch="dancing_lunch",e.Diner="diner",e.Garden="garden",e.AfterBeach="after_beach",e.Festival="festival",e.Spectacle="spectacle",e.Cruise="cruise",e.OutsideAnimation="outside_animation",e.Sport="sport",e.Match="match",e.Seminar="seminar",e.Conference="conference",e.WellnessDay="wellness_day",e.Workshop="workshop",e.TradeFair="trade_fair",e.ConsumerShow="consumer_show",e.Membership="membership";})(exports.OrganizationEventType||(exports.OrganizationEventType={}));exports.OrganizationEventVisibilityType = void 0;(function(e){e.Public="public",e.Unlisted="unlisted",e.Private="private";})(exports.OrganizationEventVisibilityType||(exports.OrganizationEventVisibilityType={}));exports.OrganizationMemberStatus = void 0;(function(e){e.Pending="pending",e.Accepted="accepted",e.Rejected="rejected";})(exports.OrganizationMemberStatus||(exports.OrganizationMemberStatus={}));exports.OrganizationMemberRole = void 0;(function(e){e.Member="member",e.Manager="manager",e.Admin="admin",e.Owner="owner";})(exports.OrganizationMemberRole||(exports.OrganizationMemberRole={}));exports.OrganizationSocialType = void 0;(function(e){e.Facebook="facebook",e.Twitter="twitter",e.Instagram="instagram",e.Linkedin="linkedin",e.Youtube="youtube",e.Website="website";})(exports.OrganizationSocialType||(exports.OrganizationSocialType={}));exports.UserTokenType = void 0;(function(e){e.Authentication="authentication",e.OrganizationInvite="organization_invite",e.PasswordRecovery="password_recovery",e.EmailValidation="email_validation",e.PhoneValidation="phone_validation";})(exports.UserTokenType||(exports.UserTokenType={}));exports.UserRole = void 0;(function(e){e.User="user",e.Developer="developer",e.Admin="admin";})(exports.UserRole||(exports.UserRole={}));exports.OrderStatus = void 0;(function(e){e.Created="created",e.Cancelled="cancelled",e.Completed="completed",e.Pending="pending",e.Confirmed="confirmed",e.Declined="declined",e.Refunded="refunded",e.PartiallyRefunded="partially_refunded",e.Expired="expired";})(exports.OrderStatus||(exports.OrderStatus={}));exports.Currency = void 0;(function(e){e.EUR="EUR",e.USD="USD",e.GBP="GBP";})(exports.Currency||(exports.Currency={}));exports.Language = void 0;(function(e){e.FR="fr",e.EN="en";})(exports.Language||(exports.Language={}));function S(e,t,r,s){var i=arguments.length,n=i<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,r):s,p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,r,s);else for(var a=e.length-1;a>=0;a--)(p=e[a])&&(n=(i<3?p(n):i>3?p(t,r,n):p(t,r))||n);return i>3&&n&&Object.defineProperty(t,r,n),n}o(S,"_ts_decorate");function L(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}o(L,"_ts_metadata");var u=class{static{o(this,"CreateOrganizationEventDto");}title;slug;description;type;visibility;flyers;trailers;location;tickets;styles;startAt;endAt};S([classValidator.IsString(),classValidator.Length(1,64),L("design:type",String)],u.prototype,"title",void 0);S([classValidator.IsOptional(),classValidator.IsString(),classValidator.IsLowercase(),classValidator.Length(1,48),L("design:type",String)],u.prototype,"slug",void 0);S([classValidator.IsString(),classValidator.Length(16,2048),L("design:type",String)],u.prototype,"description",void 0);S([classValidator.IsEnum(exports.OrganizationEventType),L("design:type",typeof exports.OrganizationEventType>"u"?Object:exports.OrganizationEventType)],u.prototype,"type",void 0);S([classValidator.IsEnum(exports.OrganizationEventVisibilityType),L("design:type",typeof exports.OrganizationEventVisibilityType>"u"?Object:exports.OrganizationEventVisibilityType)],u.prototype,"visibility",void 0);S([classValidator.IsDateString(),L("design:type",typeof Date>"u"?Object:Date)],u.prototype,"startAt",void 0);S([classValidator.IsDateString(),L("design:type",typeof Date>"u"?Object:Date)],u.prototype,"endAt",void 0);var ye=class extends u{static{o(this,"UpdateOrganizationEventDto");}};function m(e,t,r,s){var i=arguments.length,n=i<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,r):s,p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,r,s);else for(var a=e.length-1;a>=0;a--)(p=e[a])&&(n=(i<3?p(n):i>3?p(t,r,n):p(t,r))||n);return i>3&&n&&Object.defineProperty(t,r,n),n}o(m,"_ts_decorate");function g(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}o(g,"_ts_metadata");var c=class{static{o(this,"CreateOrganizationEventTicketDto");}name;description;price;quantity;type;category;currency;isVisible;isFeesIncluded;startAt;endAt};m([classValidator.IsString(),classValidator.Length(1,128),g("design:type",String)],c.prototype,"name",void 0);m([classValidator.IsString(),classValidator.Length(1,1024),g("design:type",String)],c.prototype,"description",void 0);m([classValidator.IsNumber(),classValidator.Min(0),g("design:type",Number)],c.prototype,"price",void 0);m([classValidator.IsNumber(),classValidator.Min(0),g("design:type",Number)],c.prototype,"quantity",void 0);m([classValidator.IsEnum(exports.OrganizationEventTicketType),g("design:type",typeof exports.OrganizationEventTicketType>"u"?Object:exports.OrganizationEventTicketType)],c.prototype,"type",void 0);m([classValidator.IsEnum(exports.OrganizationEventTicketCategory),g("design:type",typeof exports.OrganizationEventTicketCategory>"u"?Object:exports.OrganizationEventTicketCategory)],c.prototype,"category",void 0);m([classValidator.IsEnum(exports.Currency),g("design:type",typeof exports.Currency>"u"?Object:exports.Currency)],c.prototype,"currency",void 0);m([classValidator.IsBoolean(),g("design:type",Boolean)],c.prototype,"isVisible",void 0);m([classValidator.IsBoolean(),g("design:type",Boolean)],c.prototype,"isFeesIncluded",void 0);m([classValidator.IsDateString(),classValidator.IsOptional(),g("design:type",typeof Date>"u"?Object:Date)],c.prototype,"startAt",void 0);m([classValidator.IsDateString(),classValidator.IsOptional(),g("design:type",typeof Date>"u"?Object:Date)],c.prototype,"endAt",void 0);var _e=class extends c{static{o(this,"UpdateOrganizationEventTicketDto");}};function Ae(e,t,r,s){var i=arguments.length,n=i<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,r):s,p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,r,s);else for(var a=e.length-1;a>=0;a--)(p=e[a])&&(n=(i<3?p(n):i>3?p(t,r,n):p(t,r))||n);return i>3&&n&&Object.defineProperty(t,r,n),n}o(Ae,"_ts_decorate");function Ie(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}o(Ie,"_ts_metadata");var q=class{static{o(this,"CreateOrganizationMemberDto");}user;role};Ae([classValidator.IsString(),classValidator.IsNotEmpty(),Ie("design:type",String)],q.prototype,"user",void 0);Ae([classValidator.IsEnum(exports.OrganizationMemberRole),classValidator.IsNotEmpty(),Ie("design:type",typeof exports.OrganizationMemberRole>"u"?Object:exports.OrganizationMemberRole)],q.prototype,"role",void 0);function st(e,t,r,s){var i=arguments.length,n=i<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,r):s,p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,r,s);else for(var a=e.length-1;a>=0;a--)(p=e[a])&&(n=(i<3?p(n):i>3?p(t,r,n):p(t,r))||n);return i>3&&n&&Object.defineProperty(t,r,n),n}o(st,"_ts_decorate");function nt(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}o(nt,"_ts_metadata");var Q=class{static{o(this,"UpdateOrganizationMemberDto");}role};st([classValidator.IsEnum(exports.OrganizationMemberRole),classValidator.IsNotEmpty(),nt("design:type",typeof exports.OrganizationMemberRole>"u"?Object:exports.OrganizationMemberRole)],Q.prototype,"role",void 0);var Le=class{static{o(this,"CreateUserDto");}identifier;password;identity;addresses};var De=class{static{o(this,"SignInUserDto");}identifier;password};function d(e,t,r,s){var i=arguments.length,n=i<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,r):s,p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,r,s);else for(var a=e.length-1;a>=0;a--)(p=e[a])&&(n=(i<3?p(n):i>3?p(t,r,n):p(t,r))||n);return i>3&&n&&Object.defineProperty(t,r,n),n}o(d,"_ts_decorate");function f(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}o(f,"_ts_metadata");var k=class{static{o(this,"UpdateUserDto");}identifier;identity;password};d([classValidator.IsOptional(),classValidator.IsObject(),classValidator.ValidateNested(),classTransformer.Type(()=>G),f("design:type",typeof G>"u"?Object:G)],k.prototype,"identifier",void 0);d([classValidator.IsOptional(),classValidator.IsObject(),classValidator.ValidateNested(),classTransformer.Type(()=>y),f("design:type",typeof y>"u"?Object:y)],k.prototype,"identity",void 0);d([classValidator.IsOptional(),classValidator.IsString(),classValidator.MinLength(8),classValidator.MaxLength(128),f("design:type",String)],k.prototype,"password",void 0);var G=class{static{o(this,"UpdateIdentifierDto");}email;phoneNumber;username};d([classValidator.IsOptional(),classValidator.IsString(),classValidator.IsEmail(),f("design:type",String)],G.prototype,"email",void 0);d([classValidator.IsOptional(),classValidator.IsString(),classValidator.IsPhoneNumber(),f("design:type",String)],G.prototype,"phoneNumber",void 0);d([classValidator.IsOptional(),classValidator.IsString(),classValidator.MinLength(3),f("design:type",String)],G.prototype,"username",void 0);var y=class{static{o(this,"UpdateIdentityDto");}firstName;lastName;displayName;description;avatarUrl;bannerUrl;gender;birthDate};d([classValidator.IsOptional(),classValidator.IsString(),classValidator.Length(2,32),classValidator.Matches(C,{message:"First name must be composed of letters only"}),f("design:type",String)],y.prototype,"firstName",void 0);d([classValidator.IsOptional(),classValidator.IsString(),classValidator.Length(2,32),classValidator.Matches(C,{message:"Last name must be composed of letters only"}),f("design:type",String)],y.prototype,"lastName",void 0);d([classValidator.IsOptional(),classValidator.IsString(),classValidator.Length(1,32),f("design:type",String)],y.prototype,"displayName",void 0);d([classValidator.IsOptional(),classValidator.IsString(),classValidator.Length(1,128),f("design:type",String)],y.prototype,"description",void 0);d([classValidator.IsOptional(),classValidator.IsUrl(),f("design:type",Object)],y.prototype,"avatarUrl",void 0);d([classValidator.IsOptional(),classValidator.IsUrl(),f("design:type",Object)],y.prototype,"bannerUrl",void 0);d([classValidator.IsOptional(),f("design:type",String)],y.prototype,"gender",void 0);d([classValidator.IsOptional(),classValidator.IsDateString(),f("design:type",typeof Date>"u"?Object:Date)],y.prototype,"birthDate",void 0);var b=typeof window<"u";var ut=lt__default.default.create({headers:{"Content-Type":"application/json",Accept:"application/json",...!b&&{"User-Agent":"tonightpass-api-client"}},responseType:"json",transformRequest:[function(e){return JSON.stringify(e)}],withCredentials:b}),Ge=o(async(e,t)=>ut(e,{...t}).then(s=>s).catch(s=>{throw s.data||console.error(s),s.data}),"request");var T=class extends Error{static{o(this,"TonightPassAPIError");}response;data;status;constructor(t,r){super(r.message),this.response=t,this.data=r,this.status=t.status;}},$=class{static{o(this,"Client");}options;url;constructor(t){this.options=t,this.url=(r,s)=>{let i=this.options.baseURL||ee;return pathcat.pathcat(i,r,s)};}setOptions(t){this.options=t;}async get(t,r,s){return this.requester("GET",t,void 0,r,s)}async post(t,r,s,i){return this.requester("POST",t,r,s,i)}async put(t,r,s,i){return this.requester("PUT",t,r,s,i)}async patch(t,r,s,i){return this.requester("PATCH",t,r,s,i)}async delete(t,r,s,i){return this.requester("DELETE",t,r,s,i)}async requester(t,r,s,i={},n={}){let p=this.url(r,i);if(s!==void 0&&t==="GET")throw new Error("Cannot send a GET request with a body");let a=await Ge(p,{method:t,data:s,...n}),X=a.data;if(!X.success)throw new T(a,X);return X.data}};function z(e){return e}o(z,"sdk");var ze=e=>({signIn:o(async t=>e.post("/auth/sign-in",t),"signIn"),signUp:o(async t=>e.post("/auth/sign-up",t),"signUp"),signOut:o(async()=>e.post("/auth/sign-out",null),"signOut"),refreshToken:o(async()=>e.post("/auth/refresh-token",null),"refreshToken"),oauth2:{google:{connect:o(t=>{if(b)window.location.href=e.url("/oauth2/google",t||{});else throw new Error("Google OAuth2 is only available in the browser")},"connect")},twitter:{connect:o(t=>{if(b)window.location.href=e.url("/oauth2/twitter",t||{});else throw new Error("Twitter OAuth2 is only available in the browser")},"connect")},facebook:{connect:o(t=>{if(b)window.location.href=e.url("/oauth2/facebook",t||{});else throw new Error("Facebook OAuth2 is only available in the browser")},"connect")}}});var Me=e=>({categories:{getAll:o(async t=>e.get("/careers/categories",t),"getAll")},employmentTypes:{getAll:o(async t=>e.get("/careers/employmentTypes",t),"getAll")},jobs:{getAll:o(async t=>e.get("/careers/jobs",t),"getAll"),get:o(async t=>e.get("/careers/jobs/:id",{id:t}),"get")},offices:{getAll:o(async t=>e.get("/careers/offices",t),"getAll")}});var ke=e=>({getAll:o(async()=>e.get("/health"),"getAll"),database:o(async()=>e.get("/health/database"),"database"),http:o(async()=>e.get("/health/http"),"http")});var qe=o(e=>({account:o(async t=>e.get("/organizations/:slug/billing/account",{slug:t}),"account"),link:o(t=>{if(b)window.location.href=e.url("/organizations/:slug/billing/link",{slug:t});else throw new Error("Billing link is only available in the browser")},"link"),dashboard:o(t=>{if(b)window.location.href=e.url("/organizations/:slug/billing/dashboard",{slug:t});else throw new Error("Billing dashboard is only available in the browser")},"dashboard")}),"organizationsBilling");var Fe=o(e=>({getAll:o(async()=>e.get("/organizations/events/styles"),"getAll"),get:o(async t=>e.get("/organizations/events/styles/:slug",{slug:t}),"get"),create:o(async t=>e.post("/organizations/events/styles",t),"create"),update:o(async(t,r)=>e.put("/organizations/events/styles/:slug",r,{slug:t}),"update"),delete:o(async t=>e.delete("/organizations/events/styles/:slug",null,{slug:t}),"delete")}),"organizationsEventsStyles");var $e=o(e=>({getAll:o(async(t,r)=>e.get("/organizations/:slug/events/:eventSlug/tickets",{slug:t,eventSlug:r}),"getAll"),get:o(async(t,r,s)=>e.get("/organizations/:slug/events/:eventSlug/tickets/:ticketId",{slug:t,eventSlug:r,ticketId:s}),"get"),create:o(async(t,r,s)=>e.post("/organizations/:slug/events/:eventSlug/tickets",s,{slug:t,eventSlug:r}),"create"),update:o(async(t,r,s,i)=>e.put("/organizations/:slug/events/:eventSlug/tickets/:ticketId",i,{slug:t,eventSlug:r,ticketId:s}),"update"),delete:o(async(t,r,s)=>e.delete("/organizations/:slug/events/:eventSlug/tickets/:ticketId",null,{slug:t,eventSlug:r,ticketId:s}),"delete")}),"organizationsEventsTickets");var Xe=o(e=>({getAll:o(async t=>e.get("/organizations/:slug/events",{slug:t}),"getAll"),getSuggestions:o(async t=>e.get("/organizations/events/suggestions",t),"getSuggestions"),get:o(async(t,r)=>e.get("/organizations/:organizationSlug/events/:eventSlug",{organizationSlug:t,eventSlug:r}),"get"),create:o(async(t,r)=>e.post("/organizations/:slug/events",r,{slug:t}),"create"),update:o(async(t,r,s)=>e.put("/organizations/:organizationSlug/events/:eventSlug",s,{organizationSlug:t,eventSlug:r}),"update"),delete:o(async(t,r)=>e.delete("/organizations/:organizationSlug/events/:eventSlug",null,{organizationSlug:t,eventSlug:r}),"delete"),styles:Fe(e),tickets:$e(e)}),"organizationsEvents");var Ce=o(e=>({getAll:o(async()=>e.get("/organizations/members"),"getAll"),delete:o(async t=>e.delete("/organizations/members/:id",null,{id:t}),"delete")}),"organizationsMembers");var Ve=e=>({getAll:o(async()=>e.get("/organizations"),"getAll"),get:o(async t=>e.get("/organizations/:slug",{slug:t}),"get"),create:o(async t=>e.post("/organizations",t),"create"),update:o(async(t,r)=>e.put("/organizations/:slug",r,{slug:t}),"update"),delete:o(async t=>e.delete("/organizations/:slug",null,{slug:t}),"delete"),billing:qe(e),events:Xe(e),members:Ce(e)});var We=e=>({get:o(async t=>e.get("/profiles/:username",{username:t}),"get")});var He=e=>({getAll:o(async()=>e.get("/users"),"getAll"),get:o(async t=>e.get("/users",{id:t}),"get"),me:o(async()=>e.get("/users/me"),"me"),check:o(async(t,r)=>e.get("/users/check/:identifier",{identifier:t,suggestions:r}),"check"),update:o(async(t,r)=>e.put("/users/:id",r,{id:t}),"update")});var Ze=class{static{o(this,"TonightPass");}client;auth;careers;health;organizations;profiles;users;constructor(t){this.client=new $(t),this.auth=ze(this.client),this.careers=Me(this.client),this.health=ke(this.client),this.organizations=Ve(this.client),this.profiles=We(this.client),this.users=He(this.client);}};
|
|
14
14
|
|
|
15
15
|
exports.BCRYPT_HASH = vt;
|
|
16
|
-
exports.Client =
|
|
16
|
+
exports.Client = $;
|
|
17
17
|
exports.CreateOrganizationDto = D;
|
|
18
18
|
exports.CreateOrganizationEventDto = u;
|
|
19
19
|
exports.CreateOrganizationEventTicketDto = c;
|
|
20
20
|
exports.CreateOrganizationIdentityDto = x;
|
|
21
21
|
exports.CreateOrganizationMemberDto = q;
|
|
22
22
|
exports.CreateUserDto = Le;
|
|
23
|
-
exports.DEFAULT_API_URL =
|
|
23
|
+
exports.DEFAULT_API_URL = ee;
|
|
24
24
|
exports.EMAIL_REGEX = ht;
|
|
25
25
|
exports.IMAGE_URL_REGEX = Rt;
|
|
26
|
-
exports.NAME_REGEX =
|
|
26
|
+
exports.NAME_REGEX = C;
|
|
27
27
|
exports.PASSWORD_REGEX = bt;
|
|
28
28
|
exports.PHONE_NUMBER_REGEX = wt;
|
|
29
29
|
exports.SLUG_REGEX = xt;
|
|
30
30
|
exports.SignInUserDto = De;
|
|
31
31
|
exports.TonightPass = Ze;
|
|
32
|
-
exports.TonightPassAPIError =
|
|
32
|
+
exports.TonightPassAPIError = T;
|
|
33
33
|
exports.UpdateOrganizationDto = P;
|
|
34
34
|
exports.UpdateOrganizationEventDto = ye;
|
|
35
35
|
exports.UpdateOrganizationEventTicketDto = _e;
|
|
36
36
|
exports.UpdateOrganizationIdentityDto = R;
|
|
37
|
-
exports.UpdateOrganizationMemberDto =
|
|
37
|
+
exports.UpdateOrganizationMemberDto = Q;
|
|
38
38
|
exports.UpdateUserDto = k;
|
|
39
|
-
exports.auth =
|
|
40
|
-
exports.careers =
|
|
41
|
-
exports.health =
|
|
39
|
+
exports.auth = ze;
|
|
40
|
+
exports.careers = Me;
|
|
41
|
+
exports.health = ke;
|
|
42
42
|
exports.isBrowser = b;
|
|
43
43
|
exports.organizations = Ve;
|
|
44
44
|
exports.profiles = We;
|
|
45
|
-
exports.request =
|
|
46
|
-
exports.sdk =
|
|
45
|
+
exports.request = Ge;
|
|
46
|
+
exports.sdk = z;
|
|
47
47
|
exports.users = He;
|
|
48
48
|
//# sourceMappingURL=out.js.map
|
|
49
49
|
//# sourceMappingURL=index.js.map
|