tonightpass 0.0.74 → 0.0.76

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.
@@ -1,5 +1,5 @@
1
1
 
2
- > tonightpass@0.0.74 build /home/runner/work/tonightpass/tonightpass/packages/node
2
+ > tonightpass@0.0.76 build /home/runner/work/tonightpass/tonightpass/packages/node
3
3
  > tsup
4
4
 
5
5
  CLI Building entry: src/index.ts
@@ -10,12 +10,12 @@
10
10
  CJS Build start
11
11
  ESM Build start
12
12
  DTS Build start
13
- CJS dist/index.js 26.90 KB
14
- CJS dist/index.js.map 84.32 KB
15
- CJS ⚡️ Build success in 647ms
16
- ESM dist/index.mjs 22.96 KB
17
- ESM dist/index.mjs.map 84.13 KB
18
- ESM ⚡️ Build success in 648ms
19
- DTS ⚡️ Build success in 3825ms
20
- DTS dist/index.d.ts 43.25 KB
21
- DTS dist/index.d.mts 43.25 KB
13
+ CJS dist/index.js 26.91 KB
14
+ CJS dist/index.js.map 84.45 KB
15
+ CJS ⚡️ Build success in 519ms
16
+ ESM dist/index.mjs 22.97 KB
17
+ ESM dist/index.mjs.map 84.26 KB
18
+ ESM ⚡️ Build success in 520ms
19
+ DTS ⚡️ Build success in 3725ms
20
+ DTS dist/index.d.ts 43.78 KB
21
+ DTS dist/index.d.mts 43.78 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # tonightpass
2
2
 
3
+ ## 0.0.76
4
+
5
+ ### Patch Changes
6
+
7
+ - [`46ce556`](https://github.com/tonightpass/tonightpass/commit/46ce5567a37b62e3f4d9501fcdda07a99e329067) Thanks [@AntoineKM](https://github.com/AntoineKM)! - Add user booking types
8
+
9
+ ## 0.0.75
10
+
11
+ ### Patch Changes
12
+
13
+ - [`4606121`](https://github.com/tonightpass/tonightpass/commit/46061214a2877c105ca9a2f6f1f2a2a6bd222df8) Thanks [@AntoineKM](https://github.com/AntoineKM)! - Add swr config to api hook
14
+
3
15
  ## 0.0.74
4
16
 
5
17
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -42,6 +42,18 @@ type Endpoint<M extends Options["method"], Path extends string, Res, Body = unde
42
42
  };
43
43
  type Endpoints = AuthEndpoints | CareersEndpoints | HealthEndpoints | OrderEndpoints | OrganizationEndpoints | ProfileEndpoints | UserEndpoints | WebhookEndpoints | NotificationsEndpoints;
44
44
 
45
+ type Order = Base & {
46
+ invoice: Stripe__default.Invoice;
47
+ user: User;
48
+ };
49
+ type OrderEndpoints = Endpoint<"GET", "/orders", ArrayResult<Order>, ArrayOptions<Order>> | Endpoint<"GET", "/orders/:orderId", Order>;
50
+
51
+ type UserBooking = Base & {
52
+ ticket: OrganizationEventTicket;
53
+ order: Order;
54
+ };
55
+ type UserBookingEndpoints = Endpoint<"GET", "/users/bookings", ArrayResult<UserBooking>, ArrayOptions<UserBooking>> | Endpoint<"GET", "/users/bookings/:bookingId", UserBooking>;
56
+
45
57
  type User = Base & {
46
58
  identifier: UserIdentifier;
47
59
  password: string;
@@ -108,16 +120,14 @@ type UserConnectionClient = {
108
120
  name: string;
109
121
  version: string;
110
122
  };
111
- type UserEndpoints = Endpoint<"GET", "/users", User[]> | Endpoint<"GET", "/users/:userId", User, {
112
- id: string;
113
- }> | Endpoint<"GET", "/users/me", User> | Endpoint<"GET", "/users/check/:identifier", {
123
+ type UserEndpoints = Endpoint<"GET", "/users", User[]> | Endpoint<"GET", "/users/:userId", User> | Endpoint<"GET", "/users/me", User> | Endpoint<"GET", "/users/check/:identifier", {
114
124
  exists: boolean;
115
125
  identifier: Partial<UserIdentifier>;
116
126
  suggestions?: string[];
117
127
  }, {
118
128
  identifier: boolean;
119
129
  suggestions?: boolean;
120
- }> | Endpoint<"PUT", "/users/:userId", User, UpdateUserDto>;
130
+ }> | Endpoint<"PUT", "/users/:userId", User, UpdateUserDto> | UserBookingEndpoints;
121
131
 
122
132
  type AuthEndpoints = Endpoint<"POST", "/auth/sign-up", User, CreateUserDto> | Endpoint<"POST", "/auth/sign-in", User, SignInUserDto> | Endpoint<"POST", "/auth/sign-out", null, null> | Endpoint<"POST", "/auth/refresh-token", null, null> | Endpoint<"GET", "/oauth2/google", void> | Endpoint<"GET", "/oauth2/google/callback", void> | Endpoint<"GET", "/oauth2/facebook", void> | Endpoint<"GET", "/oauth2/facebook/callback", void> | Endpoint<"GET", "/oauth2/twitter", void> | Endpoint<"GET", "/oauth2/twitter/callback", void>;
123
133
 
@@ -193,12 +203,6 @@ type Health<Key extends string> = {
193
203
  };
194
204
  type HealthEndpoints = Endpoint<"GET", "/health", [Health<"app">, Health<"database">]> | Endpoint<"GET", "/health/database", Health<"database">> | Endpoint<"GET", "/health/http", Health<"app">>;
195
205
 
196
- type Order = Base & {
197
- invoice: Stripe__default.Invoice;
198
- user: User;
199
- };
200
- type OrderEndpoints = Endpoint<"GET", "/orders", ArrayResult<Order>, ArrayOptions<Order>> | Endpoint<"GET", "/orders/:orderId", Order>;
201
-
202
206
  type OrganizationEventOrderEndpoints = Endpoint<"POST", "/organizations/:organizationSlug/events/:eventSlug/orders", Order, CreateOrganizationEventOrderDto>;
203
207
 
204
208
  declare class CreateOrganizationEventStyleDto {
@@ -771,9 +775,7 @@ declare class Client {
771
775
  }> | Extract<Endpoint<"GET", "/users", User[]>, {
772
776
  path: Path;
773
777
  method: "GET";
774
- }> | Extract<Endpoint<"GET", "/users/:userId", User, {
775
- id: string;
776
- }>, {
778
+ }> | Extract<Endpoint<"GET", "/users/:userId", User>, {
777
779
  path: Path;
778
780
  method: "GET";
779
781
  }> | Extract<Endpoint<"GET", "/users/me", User>, {
@@ -789,6 +791,12 @@ declare class Client {
789
791
  }>, {
790
792
  path: Path;
791
793
  method: "GET";
794
+ }> | Extract<Endpoint<"GET", "/users/bookings", ArrayResult<UserBooking>, ArrayOptions<T>>, {
795
+ path: Path;
796
+ method: "GET";
797
+ }> | Extract<Endpoint<"GET", "/users/bookings/:bookingId", UserBooking>, {
798
+ path: Path;
799
+ method: "GET";
792
800
  }>)["res"]>;
793
801
  post<Path extends Extract<Endpoints, {
794
802
  method: "POST";
@@ -999,7 +1007,7 @@ declare const profiles: (client: Client) => {
999
1007
 
1000
1008
  declare const users: (client: Client) => {
1001
1009
  getAll: () => Promise<User[]>;
1002
- get: (id: string) => Promise<User[]>;
1010
+ get: (userId: string) => Promise<User>;
1003
1011
  me: () => Promise<User>;
1004
1012
  check: (identifier: string, suggestions?: boolean) => Promise<{
1005
1013
  exists: boolean;
@@ -1111,7 +1119,7 @@ declare class TonightPass {
1111
1119
  };
1112
1120
  readonly users: {
1113
1121
  getAll: () => Promise<User[]>;
1114
- get: (id: string) => Promise<User[]>;
1122
+ get: (userId: string) => Promise<User>;
1115
1123
  me: () => Promise<User>;
1116
1124
  check: (identifier: string, suggestions?: boolean) => Promise<{
1117
1125
  exists: boolean;
@@ -1128,4 +1136,4 @@ declare class TonightPass {
1128
1136
 
1129
1137
  declare const isBrowser: boolean;
1130
1138
 
1131
- export { type APIRequestOptions, type APIResponse, type ArrayFilterOptions, type ArrayOptions, type ArrayPaginationOptions, type ArrayResult, type ArraySortOptions, type AuthEndpoints, type Base, type BaseProfile, type BaseProfileMetadata, type CareersCategory, type CareersEmploymentType, type CareersEndpoints, type CareersJob, type CareersOffice, Client, type ClientOptions, CreateOrganizationDto, CreateOrganizationEventDto, CreateOrganizationEventOrderDto, CreateOrganizationEventStyleDto, CreateOrganizationEventTicketDto, CreateOrganizationIdentityDto, CreateOrganizationMemberDto, CreateUserDto, CreateUserIdentityDto, Currency, DEFAULT_API_URL, type Endpoint, type Endpoints, type ErroredAPIResponse, type ExcludeBase, type Health, type HealthEndpoints, Language, type Location$1 as Location, type NotificationsEndpoints, type Order, type OrderEndpoints, type Organization, type OrganizationBilling, type OrganizationBillingAccount, type OrganizationEndpoints, type OrganizationEvent, type OrganizationEventEndpoints, type OrganizationEventOrderEndpoints, type OrganizationEventStyle, type OrganizationEventStyleEndpoints, OrganizationEventStyleType, type OrganizationEventTicket, OrganizationEventTicketCategory, type OrganizationEventTicketEndpoints, OrganizationEventTicketType, OrganizationEventType, OrganizationEventVisibilityType, type OrganizationIdentity, type OrganizationMember, OrganizationMemberRole, OrganizationMemberStatus, type OrganizationMembersEndpoints, type OrganizationProfile, type OrganizationProfileMetadata, type OrganizationSocialLink, OrganizationSocialType, type PathsFor, type Profile, type ProfileEndpoints, type ProfileMetadata, ProfileType, type PromisedAPIResponse, REGEX, SignInUserDto, type SuccessfulAPIResponse, TonightPass, TonightPassAPIError, UpdateOrganizationDto, UpdateOrganizationEventDto, UpdateOrganizationEventStyleDto, UpdateOrganizationEventTicketDto, UpdateOrganizationIdentityDto, UpdateOrganizationMemberDto, UpdateUserDto, type User, type UserConnection, type UserConnectionClient, type UserConnectionDevice, type UserConnectionOS, type UserEndpoints, type UserIdentifier, type UserIdentity, UserIdentityGender, type UserPreferences, type UserProfile, type UserProfileMetadata, UserRole, type UserToken, UserTokenType, type WebhookEndpoints, auth, careers, health, isBrowser, notifications, orders, organizations, profiles, request, sdk, users };
1139
+ export { type APIRequestOptions, type APIResponse, type ArrayFilterOptions, type ArrayOptions, type ArrayPaginationOptions, type ArrayResult, type ArraySortOptions, type AuthEndpoints, type Base, type BaseProfile, type BaseProfileMetadata, type CareersCategory, type CareersEmploymentType, type CareersEndpoints, type CareersJob, type CareersOffice, Client, type ClientOptions, CreateOrganizationDto, CreateOrganizationEventDto, CreateOrganizationEventOrderDto, CreateOrganizationEventStyleDto, CreateOrganizationEventTicketDto, CreateOrganizationIdentityDto, CreateOrganizationMemberDto, CreateUserDto, CreateUserIdentityDto, Currency, DEFAULT_API_URL, type Endpoint, type Endpoints, type ErroredAPIResponse, type ExcludeBase, type Health, type HealthEndpoints, Language, type Location$1 as Location, type NotificationsEndpoints, type Order, type OrderEndpoints, type Organization, type OrganizationBilling, type OrganizationBillingAccount, type OrganizationEndpoints, type OrganizationEvent, type OrganizationEventEndpoints, type OrganizationEventOrderEndpoints, type OrganizationEventStyle, type OrganizationEventStyleEndpoints, OrganizationEventStyleType, type OrganizationEventTicket, OrganizationEventTicketCategory, type OrganizationEventTicketEndpoints, OrganizationEventTicketType, OrganizationEventType, OrganizationEventVisibilityType, type OrganizationIdentity, type OrganizationMember, OrganizationMemberRole, OrganizationMemberStatus, type OrganizationMembersEndpoints, type OrganizationProfile, type OrganizationProfileMetadata, type OrganizationSocialLink, OrganizationSocialType, type PathsFor, type Profile, type ProfileEndpoints, type ProfileMetadata, ProfileType, type PromisedAPIResponse, REGEX, SignInUserDto, type SuccessfulAPIResponse, TonightPass, TonightPassAPIError, UpdateOrganizationDto, UpdateOrganizationEventDto, UpdateOrganizationEventStyleDto, UpdateOrganizationEventTicketDto, UpdateOrganizationIdentityDto, UpdateOrganizationMemberDto, UpdateUserDto, type User, type UserBooking, type UserBookingEndpoints, type UserConnection, type UserConnectionClient, type UserConnectionDevice, type UserConnectionOS, type UserEndpoints, type UserIdentifier, type UserIdentity, UserIdentityGender, type UserPreferences, type UserProfile, type UserProfileMetadata, UserRole, type UserToken, UserTokenType, type WebhookEndpoints, auth, careers, health, isBrowser, notifications, orders, organizations, profiles, request, sdk, users };
package/dist/index.d.ts CHANGED
@@ -42,6 +42,18 @@ type Endpoint<M extends Options["method"], Path extends string, Res, Body = unde
42
42
  };
43
43
  type Endpoints = AuthEndpoints | CareersEndpoints | HealthEndpoints | OrderEndpoints | OrganizationEndpoints | ProfileEndpoints | UserEndpoints | WebhookEndpoints | NotificationsEndpoints;
44
44
 
45
+ type Order = Base & {
46
+ invoice: Stripe__default.Invoice;
47
+ user: User;
48
+ };
49
+ type OrderEndpoints = Endpoint<"GET", "/orders", ArrayResult<Order>, ArrayOptions<Order>> | Endpoint<"GET", "/orders/:orderId", Order>;
50
+
51
+ type UserBooking = Base & {
52
+ ticket: OrganizationEventTicket;
53
+ order: Order;
54
+ };
55
+ type UserBookingEndpoints = Endpoint<"GET", "/users/bookings", ArrayResult<UserBooking>, ArrayOptions<UserBooking>> | Endpoint<"GET", "/users/bookings/:bookingId", UserBooking>;
56
+
45
57
  type User = Base & {
46
58
  identifier: UserIdentifier;
47
59
  password: string;
@@ -108,16 +120,14 @@ type UserConnectionClient = {
108
120
  name: string;
109
121
  version: string;
110
122
  };
111
- type UserEndpoints = Endpoint<"GET", "/users", User[]> | Endpoint<"GET", "/users/:userId", User, {
112
- id: string;
113
- }> | Endpoint<"GET", "/users/me", User> | Endpoint<"GET", "/users/check/:identifier", {
123
+ type UserEndpoints = Endpoint<"GET", "/users", User[]> | Endpoint<"GET", "/users/:userId", User> | Endpoint<"GET", "/users/me", User> | Endpoint<"GET", "/users/check/:identifier", {
114
124
  exists: boolean;
115
125
  identifier: Partial<UserIdentifier>;
116
126
  suggestions?: string[];
117
127
  }, {
118
128
  identifier: boolean;
119
129
  suggestions?: boolean;
120
- }> | Endpoint<"PUT", "/users/:userId", User, UpdateUserDto>;
130
+ }> | Endpoint<"PUT", "/users/:userId", User, UpdateUserDto> | UserBookingEndpoints;
121
131
 
122
132
  type AuthEndpoints = Endpoint<"POST", "/auth/sign-up", User, CreateUserDto> | Endpoint<"POST", "/auth/sign-in", User, SignInUserDto> | Endpoint<"POST", "/auth/sign-out", null, null> | Endpoint<"POST", "/auth/refresh-token", null, null> | Endpoint<"GET", "/oauth2/google", void> | Endpoint<"GET", "/oauth2/google/callback", void> | Endpoint<"GET", "/oauth2/facebook", void> | Endpoint<"GET", "/oauth2/facebook/callback", void> | Endpoint<"GET", "/oauth2/twitter", void> | Endpoint<"GET", "/oauth2/twitter/callback", void>;
123
133
 
@@ -193,12 +203,6 @@ type Health<Key extends string> = {
193
203
  };
194
204
  type HealthEndpoints = Endpoint<"GET", "/health", [Health<"app">, Health<"database">]> | Endpoint<"GET", "/health/database", Health<"database">> | Endpoint<"GET", "/health/http", Health<"app">>;
195
205
 
196
- type Order = Base & {
197
- invoice: Stripe__default.Invoice;
198
- user: User;
199
- };
200
- type OrderEndpoints = Endpoint<"GET", "/orders", ArrayResult<Order>, ArrayOptions<Order>> | Endpoint<"GET", "/orders/:orderId", Order>;
201
-
202
206
  type OrganizationEventOrderEndpoints = Endpoint<"POST", "/organizations/:organizationSlug/events/:eventSlug/orders", Order, CreateOrganizationEventOrderDto>;
203
207
 
204
208
  declare class CreateOrganizationEventStyleDto {
@@ -771,9 +775,7 @@ declare class Client {
771
775
  }> | Extract<Endpoint<"GET", "/users", User[]>, {
772
776
  path: Path;
773
777
  method: "GET";
774
- }> | Extract<Endpoint<"GET", "/users/:userId", User, {
775
- id: string;
776
- }>, {
778
+ }> | Extract<Endpoint<"GET", "/users/:userId", User>, {
777
779
  path: Path;
778
780
  method: "GET";
779
781
  }> | Extract<Endpoint<"GET", "/users/me", User>, {
@@ -789,6 +791,12 @@ declare class Client {
789
791
  }>, {
790
792
  path: Path;
791
793
  method: "GET";
794
+ }> | Extract<Endpoint<"GET", "/users/bookings", ArrayResult<UserBooking>, ArrayOptions<T>>, {
795
+ path: Path;
796
+ method: "GET";
797
+ }> | Extract<Endpoint<"GET", "/users/bookings/:bookingId", UserBooking>, {
798
+ path: Path;
799
+ method: "GET";
792
800
  }>)["res"]>;
793
801
  post<Path extends Extract<Endpoints, {
794
802
  method: "POST";
@@ -999,7 +1007,7 @@ declare const profiles: (client: Client) => {
999
1007
 
1000
1008
  declare const users: (client: Client) => {
1001
1009
  getAll: () => Promise<User[]>;
1002
- get: (id: string) => Promise<User[]>;
1010
+ get: (userId: string) => Promise<User>;
1003
1011
  me: () => Promise<User>;
1004
1012
  check: (identifier: string, suggestions?: boolean) => Promise<{
1005
1013
  exists: boolean;
@@ -1111,7 +1119,7 @@ declare class TonightPass {
1111
1119
  };
1112
1120
  readonly users: {
1113
1121
  getAll: () => Promise<User[]>;
1114
- get: (id: string) => Promise<User[]>;
1122
+ get: (userId: string) => Promise<User>;
1115
1123
  me: () => Promise<User>;
1116
1124
  check: (identifier: string, suggestions?: boolean) => Promise<{
1117
1125
  exists: boolean;
@@ -1128,4 +1136,4 @@ declare class TonightPass {
1128
1136
 
1129
1137
  declare const isBrowser: boolean;
1130
1138
 
1131
- export { type APIRequestOptions, type APIResponse, type ArrayFilterOptions, type ArrayOptions, type ArrayPaginationOptions, type ArrayResult, type ArraySortOptions, type AuthEndpoints, type Base, type BaseProfile, type BaseProfileMetadata, type CareersCategory, type CareersEmploymentType, type CareersEndpoints, type CareersJob, type CareersOffice, Client, type ClientOptions, CreateOrganizationDto, CreateOrganizationEventDto, CreateOrganizationEventOrderDto, CreateOrganizationEventStyleDto, CreateOrganizationEventTicketDto, CreateOrganizationIdentityDto, CreateOrganizationMemberDto, CreateUserDto, CreateUserIdentityDto, Currency, DEFAULT_API_URL, type Endpoint, type Endpoints, type ErroredAPIResponse, type ExcludeBase, type Health, type HealthEndpoints, Language, type Location$1 as Location, type NotificationsEndpoints, type Order, type OrderEndpoints, type Organization, type OrganizationBilling, type OrganizationBillingAccount, type OrganizationEndpoints, type OrganizationEvent, type OrganizationEventEndpoints, type OrganizationEventOrderEndpoints, type OrganizationEventStyle, type OrganizationEventStyleEndpoints, OrganizationEventStyleType, type OrganizationEventTicket, OrganizationEventTicketCategory, type OrganizationEventTicketEndpoints, OrganizationEventTicketType, OrganizationEventType, OrganizationEventVisibilityType, type OrganizationIdentity, type OrganizationMember, OrganizationMemberRole, OrganizationMemberStatus, type OrganizationMembersEndpoints, type OrganizationProfile, type OrganizationProfileMetadata, type OrganizationSocialLink, OrganizationSocialType, type PathsFor, type Profile, type ProfileEndpoints, type ProfileMetadata, ProfileType, type PromisedAPIResponse, REGEX, SignInUserDto, type SuccessfulAPIResponse, TonightPass, TonightPassAPIError, UpdateOrganizationDto, UpdateOrganizationEventDto, UpdateOrganizationEventStyleDto, UpdateOrganizationEventTicketDto, UpdateOrganizationIdentityDto, UpdateOrganizationMemberDto, UpdateUserDto, type User, type UserConnection, type UserConnectionClient, type UserConnectionDevice, type UserConnectionOS, type UserEndpoints, type UserIdentifier, type UserIdentity, UserIdentityGender, type UserPreferences, type UserProfile, type UserProfileMetadata, UserRole, type UserToken, UserTokenType, type WebhookEndpoints, auth, careers, health, isBrowser, notifications, orders, organizations, profiles, request, sdk, users };
1139
+ export { type APIRequestOptions, type APIResponse, type ArrayFilterOptions, type ArrayOptions, type ArrayPaginationOptions, type ArrayResult, type ArraySortOptions, type AuthEndpoints, type Base, type BaseProfile, type BaseProfileMetadata, type CareersCategory, type CareersEmploymentType, type CareersEndpoints, type CareersJob, type CareersOffice, Client, type ClientOptions, CreateOrganizationDto, CreateOrganizationEventDto, CreateOrganizationEventOrderDto, CreateOrganizationEventStyleDto, CreateOrganizationEventTicketDto, CreateOrganizationIdentityDto, CreateOrganizationMemberDto, CreateUserDto, CreateUserIdentityDto, Currency, DEFAULT_API_URL, type Endpoint, type Endpoints, type ErroredAPIResponse, type ExcludeBase, type Health, type HealthEndpoints, Language, type Location$1 as Location, type NotificationsEndpoints, type Order, type OrderEndpoints, type Organization, type OrganizationBilling, type OrganizationBillingAccount, type OrganizationEndpoints, type OrganizationEvent, type OrganizationEventEndpoints, type OrganizationEventOrderEndpoints, type OrganizationEventStyle, type OrganizationEventStyleEndpoints, OrganizationEventStyleType, type OrganizationEventTicket, OrganizationEventTicketCategory, type OrganizationEventTicketEndpoints, OrganizationEventTicketType, OrganizationEventType, OrganizationEventVisibilityType, type OrganizationIdentity, type OrganizationMember, OrganizationMemberRole, OrganizationMemberStatus, type OrganizationMembersEndpoints, type OrganizationProfile, type OrganizationProfileMetadata, type OrganizationSocialLink, OrganizationSocialType, type PathsFor, type Profile, type ProfileEndpoints, type ProfileMetadata, ProfileType, type PromisedAPIResponse, REGEX, SignInUserDto, type SuccessfulAPIResponse, TonightPass, TonightPassAPIError, UpdateOrganizationDto, UpdateOrganizationEventDto, UpdateOrganizationEventStyleDto, UpdateOrganizationEventTicketDto, UpdateOrganizationIdentityDto, UpdateOrganizationMemberDto, UpdateUserDto, type User, type UserBooking, type UserBookingEndpoints, type UserConnection, type UserConnectionClient, type UserConnectionDevice, type UserConnectionOS, type UserEndpoints, type UserIdentifier, type UserIdentity, UserIdentityGender, type UserPreferences, type UserProfile, type UserProfileMetadata, UserRole, type UserToken, UserTokenType, type WebhookEndpoints, auth, careers, health, isBrowser, notifications, orders, organizations, profiles, request, sdk, users };
package/dist/index.js CHANGED
@@ -10,17 +10,17 @@ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
10
10
 
11
11
  var Gt__default = /*#__PURE__*/_interopDefault(Gt);
12
12
 
13
- var ct=Object.defineProperty;var o=(e,t)=>ct(e,"name",{value:t,configurable:!0});var de="https://api.tonightpass.com";var m={EMAIL:/^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,}$/i,NAME:/^[a-zA-Z0-9 ]+$/,SLUG:/^[a-z0-9_.]+$/,USERNAME:/^(?!\.)(?!.*\.\.)(?!.*\.$)[a-z0-9_.]{3,48}$/,PHONE:/^\+(?:[0-9] ?){6,14}[0-9]$/,PASSWORD:/^(?=.*[A-Z])(?=.*[a-z])(?=.*[\d\W]).{8,}$/,PASSWORD_MIN_LENGTH:/^.{8,}$/,PASSWORD_UPPERCASE:/^(?=.*[A-Z])/,PASSWORD_LOWERCASE:/^(?=.*[a-z])/,PASSWORD_NUMBER_SPECIAL:/^(?=.*[\d\W])/,IMAGE_URL:/^(https:\/\/|http:\/\/)(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-z]{2,6}([-a-zA-Z0-9@:%_\+.~#?&//=]*)\.(jpg|jpeg|gif|png|bmp|tiff|tga|svg)$/i};function w(e,t,r,s){var i=arguments.length,n=i<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,r):s,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,r,s);else for(var p=e.length-1;p>=0;p--)(a=e[p])&&(n=(i<3?a(n):i>3?a(t,r,n):a(t,r))||n);return i>3&&n&&Object.defineProperty(t,r,n),n}o(w,"_ts_decorate");function R(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}o(R,"_ts_metadata");var M=class{static{o(this,"CreateOrganizationDto");}organizationSlug;identity;members;location};w([classValidator.IsOptional(),classValidator.IsString(),classValidator.IsLowercase(),classValidator.Length(1,48),R("design:type",String)],M.prototype,"organizationSlug",void 0);w([classValidator.IsObject(),R("design:type",typeof S>"u"?Object:S)],M.prototype,"identity",void 0);w([classValidator.IsArray(),R("design:type",Array)],M.prototype,"members",void 0);w([classValidator.IsOptional(),classValidator.IsObject(),R("design:type",typeof Location>"u"?Object:Location)],M.prototype,"location",void 0);var S=class{static{o(this,"CreateOrganizationIdentityDto");}displayName;description;avatarUrl;bannerUrl;socialLinks};w([classValidator.IsString(),classValidator.IsNotEmpty(),classValidator.Length(1,32),R("design:type",String)],S.prototype,"displayName",void 0);w([classValidator.IsString(),classValidator.Length(16,1024),classValidator.IsOptional(),R("design:type",String)],S.prototype,"description",void 0);w([classValidator.IsUrl({protocols:["http","https"]}),R("design:type",String)],S.prototype,"avatarUrl",void 0);w([classValidator.IsOptional(),classValidator.IsUrl({protocols:["http","https"]}),R("design:type",String)],S.prototype,"bannerUrl",void 0);w([classValidator.IsOptional(),classValidator.IsArray(),R("design:type",Array)],S.prototype,"socialLinks",void 0);function A(e,t,r,s){var i=arguments.length,n=i<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,r):s,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,r,s);else for(var p=e.length-1;p>=0;p--)(a=e[p])&&(n=(i<3?a(n):i>3?a(t,r,n):a(t,r))||n);return i>3&&n&&Object.defineProperty(t,r,n),n}o(A,"_ts_decorate");function I(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}o(I,"_ts_metadata");var B=class{static{o(this,"UpdateOrganizationDto");}slug;identity;members;location};A([classValidator.IsOptional(),classValidator.IsString(),classValidator.IsLowercase(),classValidator.Length(3,48),classValidator.Matches(m.USERNAME),I("design:type",String)],B.prototype,"slug",void 0);A([classValidator.IsObject(),classValidator.IsOptional(),I("design:type",typeof j>"u"?Object:j)],B.prototype,"identity",void 0);A([classValidator.IsOptional(),classValidator.IsArray(),I("design:type",Array)],B.prototype,"members",void 0);A([classValidator.IsOptional(),classValidator.IsObject(),I("design:type",typeof Location>"u"?Object:Location)],B.prototype,"location",void 0);var j=class{static{o(this,"UpdateOrganizationIdentityDto");}displayName;description;avatarUrl;bannerUrl;socialLinks};A([classValidator.IsString(),classValidator.IsNotEmpty(),classValidator.Length(1,32),classValidator.IsOptional(),I("design:type",String)],j.prototype,"displayName",void 0);A([classValidator.IsString(),classValidator.Length(16,1024),classValidator.IsOptional(),I("design:type",String)],j.prototype,"description",void 0);A([classValidator.IsUrl({protocols:["http","https"]}),classValidator.IsOptional(),I("design:type",String)],j.prototype,"avatarUrl",void 0);A([classValidator.IsOptional(),classValidator.IsUrl({protocols:["http","https"]}),I("design:type",String)],j.prototype,"bannerUrl",void 0);A([classValidator.IsOptional(),classValidator.IsArray(),I("design:type",Array)],j.prototype,"socialLinks",void 0);var ve=class{static{o(this,"CreateOrganizationEventOrderDto");}cart};var C=class{static{o(this,"CreateOrganizationEventStyleDto");}type;emoji;name};var xe=class extends C{static{o(this,"UpdateOrganizationEventStyleDto");}};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.UserIdentityGender = void 0;(function(e){e.Male="male",e.Female="female",e.NonBinary="non-binary";})(exports.UserIdentityGender||(exports.UserIdentityGender={}));exports.ProfileType = void 0;(function(e){e.User="user",e.Organization="organization";})(exports.ProfileType||(exports.ProfileType={}));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 u(e,t,r,s){var i=arguments.length,n=i<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,r):s,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,r,s);else for(var p=e.length-1;p>=0;p--)(a=e[p])&&(n=(i<3?a(n):i>3?a(t,r,n):a(t,r))||n);return i>3&&n&&Object.defineProperty(t,r,n),n}o(u,"_ts_decorate");function g(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}o(g,"_ts_metadata");var f=class{static{o(this,"CreateOrganizationEventTicketDto");}name;description;price;quantity;type;category;currency;isVisible;isFeesIncluded;startAt;endAt};u([classValidator.IsString(),classValidator.Length(1,128),g("design:type",String)],f.prototype,"name",void 0);u([classValidator.IsString(),classValidator.Length(1,1024),g("design:type",String)],f.prototype,"description",void 0);u([classValidator.IsNumber(),classValidator.Min(0),g("design:type",Number)],f.prototype,"price",void 0);u([classValidator.IsNumber(),classValidator.Min(0),g("design:type",Number)],f.prototype,"quantity",void 0);u([classValidator.IsEnum(exports.OrganizationEventTicketType),g("design:type",typeof exports.OrganizationEventTicketType>"u"?Object:exports.OrganizationEventTicketType)],f.prototype,"type",void 0);u([classValidator.IsEnum(exports.OrganizationEventTicketCategory),g("design:type",typeof exports.OrganizationEventTicketCategory>"u"?Object:exports.OrganizationEventTicketCategory)],f.prototype,"category",void 0);u([classValidator.IsEnum(exports.Currency),g("design:type",typeof exports.Currency>"u"?Object:exports.Currency)],f.prototype,"currency",void 0);u([classValidator.IsBoolean(),g("design:type",Boolean)],f.prototype,"isVisible",void 0);u([classValidator.IsBoolean(),g("design:type",Boolean)],f.prototype,"isFeesIncluded",void 0);u([classValidator.IsDateString(),classValidator.IsOptional(),g("design:type",typeof Date>"u"?Object:Date)],f.prototype,"startAt",void 0);u([classValidator.IsDateString(),classValidator.IsOptional(),g("design:type",typeof Date>"u"?Object:Date)],f.prototype,"endAt",void 0);var Oe=class extends f{static{o(this,"UpdateOrganizationEventTicketDto");}};function U(e,t,r,s){var i=arguments.length,n=i<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,r):s,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,r,s);else for(var p=e.length-1;p>=0;p--)(a=e[p])&&(n=(i<3?a(n):i>3?a(t,r,n):a(t,r))||n);return i>3&&n&&Object.defineProperty(t,r,n),n}o(U,"_ts_decorate");function z(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}o(z,"_ts_metadata");var y=class{static{o(this,"CreateOrganizationEventDto");}title;slug;description;type;visibility;flyers;trailers;location;tickets;styles;startAt;endAt};U([classValidator.IsString(),classValidator.Length(1,64),z("design:type",String)],y.prototype,"title",void 0);U([classValidator.IsOptional(),classValidator.IsString(),classValidator.IsLowercase(),classValidator.Length(3,48),classValidator.Matches(m.SLUG),z("design:type",String)],y.prototype,"slug",void 0);U([classValidator.IsString(),classValidator.Length(16,2048),z("design:type",String)],y.prototype,"description",void 0);U([classValidator.IsEnum(exports.OrganizationEventType),z("design:type",typeof exports.OrganizationEventType>"u"?Object:exports.OrganizationEventType)],y.prototype,"type",void 0);U([classValidator.IsEnum(exports.OrganizationEventVisibilityType),z("design:type",typeof exports.OrganizationEventVisibilityType>"u"?Object:exports.OrganizationEventVisibilityType)],y.prototype,"visibility",void 0);U([classValidator.IsDateString(),z("design:type",typeof Date>"u"?Object:Date)],y.prototype,"startAt",void 0);U([classValidator.IsDateString(),z("design:type",typeof Date>"u"?Object:Date)],y.prototype,"endAt",void 0);var Ge=class extends y{static{o(this,"UpdateOrganizationEventDto");}};function Fe(e,t,r,s){var i=arguments.length,n=i<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,r):s,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,r,s);else for(var p=e.length-1;p>=0;p--)(a=e[p])&&(n=(i<3?a(n):i>3?a(t,r,n):a(t,r))||n);return i>3&&n&&Object.defineProperty(t,r,n),n}o(Fe,"_ts_decorate");function ke(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}o(ke,"_ts_metadata");var J=class{static{o(this,"CreateOrganizationMemberDto");}user;role};Fe([classValidator.IsString(),classValidator.IsNotEmpty(),ke("design:type",String)],J.prototype,"user",void 0);Fe([classValidator.IsEnum(exports.OrganizationMemberRole),classValidator.IsNotEmpty(),ke("design:type",typeof exports.OrganizationMemberRole>"u"?Object:exports.OrganizationMemberRole)],J.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,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,r,s);else for(var p=e.length-1;p>=0;p--)(a=e[p])&&(n=(i<3?a(n):i>3?a(t,r,n):a(t,r))||n);return i>3&&n&&Object.defineProperty(t,r,n),n}o(St,"_ts_decorate");function wt(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}o(wt,"_ts_metadata");var ie=class{static{o(this,"UpdateOrganizationMemberDto");}role};St([classValidator.IsEnum(exports.OrganizationMemberRole),classValidator.IsNotEmpty(),wt("design:type",typeof exports.OrganizationMemberRole>"u"?Object:exports.OrganizationMemberRole)],ie.prototype,"role",void 0);function N(e,t,r,s){var i=arguments.length,n=i<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,r):s,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,r,s);else for(var p=e.length-1;p>=0;p--)(a=e[p])&&(n=(i<3?a(n):i>3?a(t,r,n):a(t,r))||n);return i>3&&n&&Object.defineProperty(t,r,n),n}o(N,"_ts_decorate");function E(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}o(E,"_ts_metadata");var ae=class{static{o(this,"CreateUserDto");}identifier;identity;password};N([classValidator.IsString(),classValidator.Matches(m.PASSWORD,{message:"Password must be secure."}),E("design:type",String)],ae.prototype,"password",void 0);var fe=class{static{o(this,"CreateUserIdentifierDto");}email;phoneNumber;username};N([classValidator.IsOptional(),classValidator.IsString(),classValidator.IsEmail(),E("design:type",String)],fe.prototype,"email",void 0);N([classValidator.IsOptional(),classValidator.IsString(),classValidator.IsPhoneNumber(),E("design:type",String)],fe.prototype,"phoneNumber",void 0);N([classValidator.IsString(),classValidator.IsString(),classValidator.IsLowercase(),classValidator.Length(3,48),classValidator.Matches(m.USERNAME),E("design:type",String)],fe.prototype,"username",void 0);var O=class{static{o(this,"CreateUserIdentityDto");}firstName;lastName;gender;avatarUrl;birthDate};N([classValidator.IsOptional(),classValidator.IsString(),classValidator.Length(2,32),classValidator.Matches(m.NAME,{message:"First name must be composed of letters only"}),E("design:type",String)],O.prototype,"firstName",void 0);N([classValidator.IsOptional(),classValidator.IsString(),classValidator.Length(2,32),classValidator.Matches(m.NAME,{message:"Last name must be composed of letters only"}),E("design:type",String)],O.prototype,"lastName",void 0);N([classValidator.IsEnum(exports.UserIdentityGender),E("design:type",typeof exports.UserIdentityGender>"u"?Object:exports.UserIdentityGender)],O.prototype,"gender",void 0);N([classValidator.IsOptional(),classValidator.IsUrl({protocols:["http","https"]}),E("design:type",String)],O.prototype,"avatarUrl",void 0);N([classValidator.IsOptional(),classValidator.IsDateString(),E("design:type",typeof Date>"u"?Object:Date)],O.prototype,"birthDate",void 0);var We=class{static{o(this,"SignInUserDto");}identifier;password};function c(e,t,r,s){var i=arguments.length,n=i<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,r):s,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,r,s);else for(var p=e.length-1;p>=0;p--)(a=e[p])&&(n=(i<3?a(n):i>3?a(t,r,n):a(t,r))||n);return i>3&&n&&Object.defineProperty(t,r,n),n}o(c,"_ts_decorate");function l(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}o(l,"_ts_metadata");var Z=class{static{o(this,"UpdateUserDto");}identifier;identity;password};c([classValidator.IsOptional(),classValidator.IsObject(),classValidator.ValidateNested(),classTransformer.Type(()=>V),l("design:type",typeof V>"u"?Object:V)],Z.prototype,"identifier",void 0);c([classValidator.IsOptional(),classValidator.IsObject(),classValidator.ValidateNested(),classTransformer.Type(()=>h),l("design:type",typeof h>"u"?Object:h)],Z.prototype,"identity",void 0);c([classValidator.IsOptional(),classValidator.IsString(),classValidator.MinLength(8),classValidator.MaxLength(128),l("design:type",String)],Z.prototype,"password",void 0);var V=class{static{o(this,"UpdateUserIdentifierDto");}email;phoneNumber;username};c([classValidator.IsOptional(),classValidator.IsString(),classValidator.IsEmail(),l("design:type",String)],V.prototype,"email",void 0);c([classValidator.IsOptional(),classValidator.IsString(),classValidator.IsPhoneNumber(),l("design:type",String)],V.prototype,"phoneNumber",void 0);c([classValidator.IsOptional(),classValidator.IsString(),classValidator.IsLowercase(),classValidator.Length(3,48),classValidator.Matches(m.USERNAME),l("design:type",String)],V.prototype,"username",void 0);var h=class{static{o(this,"UpdateUserIdentityDto");}firstName;lastName;displayName;description;avatarUrl;bannerUrl;gender;birthDate};c([classValidator.IsOptional(),classValidator.IsString(),classValidator.Length(2,32),classValidator.Matches(m.NAME,{message:"First name must be composed of letters only"}),l("design:type",String)],h.prototype,"firstName",void 0);c([classValidator.IsOptional(),classValidator.IsString(),classValidator.Length(2,32),classValidator.Matches(m.NAME,{message:"Last name must be composed of letters only"}),l("design:type",String)],h.prototype,"lastName",void 0);c([classValidator.IsOptional(),classValidator.IsString(),classValidator.Length(1,32),l("design:type",String)],h.prototype,"displayName",void 0);c([classValidator.IsOptional(),classValidator.IsString(),classValidator.Length(1,128),l("design:type",String)],h.prototype,"description",void 0);c([classValidator.IsOptional(),classValidator.IsUrl(),l("design:type",Object)],h.prototype,"avatarUrl",void 0);c([classValidator.IsOptional(),classValidator.IsUrl(),l("design:type",Object)],h.prototype,"bannerUrl",void 0);c([classValidator.IsOptional(),classValidator.IsEnum(exports.UserIdentityGender),l("design:type",typeof exports.UserIdentityGender>"u"?Object:exports.UserIdentityGender)],h.prototype,"gender",void 0);c([classValidator.IsOptional(),classValidator.IsDateString(),l("design:type",typeof Date>"u"?Object:Date)],h.prototype,"birthDate",void 0);var x=typeof window<"u";var Ft=Gt__default.default.create({headers:{"Content-Type":"application/json",Accept:"application/json",...!x&&{"User-Agent":"tonightpass-api-client"}},responseType:"json",transformRequest:[function(e){return JSON.stringify(e)}],withCredentials:x}),He=o(async(e,t)=>Ft(e,{...t}).then(s=>s).catch(s=>{throw s.data||console.error(s),s.data}),"request");var le=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;}},K=class{static{o(this,"Client");}options;url;constructor(t){this.options=t,this.url=(r,s)=>{let i=this.options.baseURL||de;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 a=this.url(r,i);if(s!==void 0&&t==="GET")throw new Error("Cannot send a GET request with a body");let p=await He(a,{method:t,data:s,...n}),Q=p.data;if(!Q.success)throw new le(p,Q);return Q.data}};function L(e){return e}o(L,"sdk");var Ce=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(x)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(x)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(x)window.location.href=e.url("/oauth2/facebook",t||{});else throw new Error("Facebook OAuth2 is only available in the browser")},"connect")}}});var Je=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/:jobId",{jobId:t}),"get")},offices:{getAll:o(async t=>e.get("/careers/offices",t),"getAll")}});var Ye=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 Ke=e=>({getAll:o(async t=>e.get("/orders",t),"getAll"),get:o(async t=>e.get("/orders/:orderId",{orderId:t}),"get")});var Qe=o(e=>({account:o(async t=>e.get("/organizations/:organizationSlug/billing/account",{organizationSlug:t}),"account"),link:o(t=>{if(x)window.location.href=e.url("/organizations/:organizationSlug/billing/link",{organizationSlug:t});else throw new Error("Billing link is only available in the browser")},"link"),dashboard:o(t=>{if(x)window.location.href=e.url("/organizations/:organizationSlug/billing/dashboard",{organizationSlug:t});else throw new Error("Billing dashboard is only available in the browser")},"dashboard")}),"organizationsBilling");var Te=o(e=>({create:o(async(t,r,s)=>e.post("/organizations/:organizationSlug/events/:eventSlug/orders",s,{organizationSlug:t,eventSlug:r}),"create")}),"organizationsEventsOrders");var et=o(e=>({getAll:o(async()=>e.get("/organizations/events/styles"),"getAll"),get:o(async t=>e.get("/organizations/events/styles/:styleSlug",{styleSlug:t}),"get"),create:o(async t=>e.post("/organizations/events/styles",t),"create"),update:o(async(t,r)=>e.put("/organizations/events/styles/:styleSlug",r,{styleSlug:t}),"update"),delete:o(async t=>e.delete("/organizations/events/styles/:styleSlug",null,{styleSlug:t}),"delete")}),"organizationsEventsStyles");var tt=o(e=>({getAll:o(async(t,r)=>e.get("/organizations/:organizationSlug/events/:eventSlug/tickets",{organizationSlug:t,eventSlug:r}),"getAll"),get:o(async(t,r,s)=>e.get("/organizations/:organizationSlug/events/:eventSlug/tickets/:ticketId",{organizationSlug:t,eventSlug:r,ticketId:s}),"get"),create:o(async(t,r,s)=>e.post("/organizations/:organizationSlug/events/:eventSlug/tickets",s,{organizationSlug:t,eventSlug:r}),"create"),update:o(async(t,r,s,i)=>e.put("/organizations/:organizationSlug/events/:eventSlug/tickets/:ticketId",i,{organizationSlug:t,eventSlug:r,ticketId:s}),"update"),delete:o(async(t,r,s)=>e.delete("/organizations/:organizationSlug/events/:eventSlug/tickets/:ticketId",null,{organizationSlug:t,eventSlug:r,ticketId:s}),"delete")}),"organizationsEventsTickets");var ot=o(e=>({getAll:o(async(t,r)=>t?e.get("/organizations/:organizationSlug/events",{organizationSlug:t,...r}):e.get("/organizations/events",r),"getAll"),getSuggestions:o(async t=>e.get("/organizations/events/suggestions",t),"getSuggestions"),getNearby:o(async t=>e.get("/organizations/events/nearby",t),"getNearby"),get:o(async(t,r)=>e.get("/organizations/:organizationSlug/events/:eventSlug",{organizationSlug:t,eventSlug:r}),"get"),create:o(async(t,r)=>e.post("/organizations/:organizationSlug/events",r,{organizationSlug: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"),orders:Te(e),styles:et(e),tickets:tt(e)}),"organizationsEvents");var rt=o(e=>({getAll:o(async()=>e.get("/organizations/members"),"getAll"),delete:o(async t=>e.delete("/organizations/members/:memberId",null,{memberId:t}),"delete")}),"organizationsMembers");var nt=e=>({getAll:o(async()=>e.get("/organizations"),"getAll"),get:o(async t=>e.get("/organizations/:organizationSlug",{organizationSlug:t}),"get"),create:o(async t=>e.post("/organizations",t),"create"),update:o(async(t,r)=>e.put("/organizations/:organizationSlug",r,{organizationSlug:t}),"update"),delete:o(async t=>e.delete("/organizations/:organizationSlug",null,{organizationSlug:t}),"delete"),billing:Qe(e),events:ot(e),members:rt(e)});var st=e=>({follow:o(async t=>e.post("/profiles/:username/relationships/follow",null,{username:t}),"follow"),unfollow:o(async t=>e.post("/profiles/:username/relationships/unfollow",null,{username:t}),"unfollow")});var it=e=>({get:o(async t=>e.get("/profiles/:username",{username:t}),"get"),relationships:st(e)});var at=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/:userId",r,{userId:t}),"update")});var pt=e=>({registerToBeta:o(async t=>e.post("/notifications/subscribe/beta",{email:t}),"registerToBeta")});var ft=class{static{o(this,"TonightPass");}client;auth;careers;health;orders;organizations;profiles;users;notifications;constructor(t){this.client=new K(t),this.auth=Ce(this.client),this.careers=Je(this.client),this.health=Ye(this.client),this.orders=Ke(this.client),this.organizations=nt(this.client),this.profiles=it(this.client),this.users=at(this.client),this.notifications=pt(this.client);}};
13
+ var ct=Object.defineProperty;var o=(e,t)=>ct(e,"name",{value:t,configurable:!0});var de="https://api.tonightpass.com";var m={EMAIL:/^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,}$/i,NAME:/^[a-zA-Z0-9 ]+$/,SLUG:/^[a-z0-9_.]+$/,USERNAME:/^(?!\.)(?!.*\.\.)(?!.*\.$)[a-z0-9_.]{3,48}$/,PHONE:/^\+(?:[0-9] ?){6,14}[0-9]$/,PASSWORD:/^(?=.*[A-Z])(?=.*[a-z])(?=.*[\d\W]).{8,}$/,PASSWORD_MIN_LENGTH:/^.{8,}$/,PASSWORD_UPPERCASE:/^(?=.*[A-Z])/,PASSWORD_LOWERCASE:/^(?=.*[a-z])/,PASSWORD_NUMBER_SPECIAL:/^(?=.*[\d\W])/,IMAGE_URL:/^(https:\/\/|http:\/\/)(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-z]{2,6}([-a-zA-Z0-9@:%_\+.~#?&//=]*)\.(jpg|jpeg|gif|png|bmp|tiff|tga|svg)$/i};function w(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(w,"_ts_decorate");function R(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}o(R,"_ts_metadata");var M=class{static{o(this,"CreateOrganizationDto");}organizationSlug;identity;members;location};w([classValidator.IsOptional(),classValidator.IsString(),classValidator.IsLowercase(),classValidator.Length(1,48),R("design:type",String)],M.prototype,"organizationSlug",void 0);w([classValidator.IsObject(),R("design:type",typeof S>"u"?Object:S)],M.prototype,"identity",void 0);w([classValidator.IsArray(),R("design:type",Array)],M.prototype,"members",void 0);w([classValidator.IsOptional(),classValidator.IsObject(),R("design:type",typeof Location>"u"?Object:Location)],M.prototype,"location",void 0);var S=class{static{o(this,"CreateOrganizationIdentityDto");}displayName;description;avatarUrl;bannerUrl;socialLinks};w([classValidator.IsString(),classValidator.IsNotEmpty(),classValidator.Length(1,32),R("design:type",String)],S.prototype,"displayName",void 0);w([classValidator.IsString(),classValidator.Length(16,1024),classValidator.IsOptional(),R("design:type",String)],S.prototype,"description",void 0);w([classValidator.IsUrl({protocols:["http","https"]}),R("design:type",String)],S.prototype,"avatarUrl",void 0);w([classValidator.IsOptional(),classValidator.IsUrl({protocols:["http","https"]}),R("design:type",String)],S.prototype,"bannerUrl",void 0);w([classValidator.IsOptional(),classValidator.IsArray(),R("design:type",Array)],S.prototype,"socialLinks",void 0);function A(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(A,"_ts_decorate");function I(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}o(I,"_ts_metadata");var B=class{static{o(this,"UpdateOrganizationDto");}slug;identity;members;location};A([classValidator.IsOptional(),classValidator.IsString(),classValidator.IsLowercase(),classValidator.Length(3,48),classValidator.Matches(m.USERNAME),I("design:type",String)],B.prototype,"slug",void 0);A([classValidator.IsObject(),classValidator.IsOptional(),I("design:type",typeof j>"u"?Object:j)],B.prototype,"identity",void 0);A([classValidator.IsOptional(),classValidator.IsArray(),I("design:type",Array)],B.prototype,"members",void 0);A([classValidator.IsOptional(),classValidator.IsObject(),I("design:type",typeof Location>"u"?Object:Location)],B.prototype,"location",void 0);var j=class{static{o(this,"UpdateOrganizationIdentityDto");}displayName;description;avatarUrl;bannerUrl;socialLinks};A([classValidator.IsString(),classValidator.IsNotEmpty(),classValidator.Length(1,32),classValidator.IsOptional(),I("design:type",String)],j.prototype,"displayName",void 0);A([classValidator.IsString(),classValidator.Length(16,1024),classValidator.IsOptional(),I("design:type",String)],j.prototype,"description",void 0);A([classValidator.IsUrl({protocols:["http","https"]}),classValidator.IsOptional(),I("design:type",String)],j.prototype,"avatarUrl",void 0);A([classValidator.IsOptional(),classValidator.IsUrl({protocols:["http","https"]}),I("design:type",String)],j.prototype,"bannerUrl",void 0);A([classValidator.IsOptional(),classValidator.IsArray(),I("design:type",Array)],j.prototype,"socialLinks",void 0);var xe=class{static{o(this,"CreateOrganizationEventOrderDto");}cart};var C=class{static{o(this,"CreateOrganizationEventStyleDto");}type;emoji;name};var ve=class extends C{static{o(this,"UpdateOrganizationEventStyleDto");}};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.UserIdentityGender = void 0;(function(e){e.Male="male",e.Female="female",e.NonBinary="non-binary";})(exports.UserIdentityGender||(exports.UserIdentityGender={}));exports.ProfileType = void 0;(function(e){e.User="user",e.Organization="organization";})(exports.ProfileType||(exports.ProfileType={}));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 u(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(u,"_ts_decorate");function g(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}o(g,"_ts_metadata");var f=class{static{o(this,"CreateOrganizationEventTicketDto");}name;description;price;quantity;type;category;currency;isVisible;isFeesIncluded;startAt;endAt};u([classValidator.IsString(),classValidator.Length(1,128),g("design:type",String)],f.prototype,"name",void 0);u([classValidator.IsString(),classValidator.Length(1,1024),g("design:type",String)],f.prototype,"description",void 0);u([classValidator.IsNumber(),classValidator.Min(0),g("design:type",Number)],f.prototype,"price",void 0);u([classValidator.IsNumber(),classValidator.Min(0),g("design:type",Number)],f.prototype,"quantity",void 0);u([classValidator.IsEnum(exports.OrganizationEventTicketType),g("design:type",typeof exports.OrganizationEventTicketType>"u"?Object:exports.OrganizationEventTicketType)],f.prototype,"type",void 0);u([classValidator.IsEnum(exports.OrganizationEventTicketCategory),g("design:type",typeof exports.OrganizationEventTicketCategory>"u"?Object:exports.OrganizationEventTicketCategory)],f.prototype,"category",void 0);u([classValidator.IsEnum(exports.Currency),g("design:type",typeof exports.Currency>"u"?Object:exports.Currency)],f.prototype,"currency",void 0);u([classValidator.IsBoolean(),g("design:type",Boolean)],f.prototype,"isVisible",void 0);u([classValidator.IsBoolean(),g("design:type",Boolean)],f.prototype,"isFeesIncluded",void 0);u([classValidator.IsDateString(),classValidator.IsOptional(),g("design:type",typeof Date>"u"?Object:Date)],f.prototype,"startAt",void 0);u([classValidator.IsDateString(),classValidator.IsOptional(),g("design:type",typeof Date>"u"?Object:Date)],f.prototype,"endAt",void 0);var Oe=class extends f{static{o(this,"UpdateOrganizationEventTicketDto");}};function U(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(U,"_ts_decorate");function z(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}o(z,"_ts_metadata");var y=class{static{o(this,"CreateOrganizationEventDto");}title;slug;description;type;visibility;flyers;trailers;location;tickets;styles;startAt;endAt};U([classValidator.IsString(),classValidator.Length(1,64),z("design:type",String)],y.prototype,"title",void 0);U([classValidator.IsOptional(),classValidator.IsString(),classValidator.IsLowercase(),classValidator.Length(3,48),classValidator.Matches(m.SLUG),z("design:type",String)],y.prototype,"slug",void 0);U([classValidator.IsString(),classValidator.Length(16,2048),z("design:type",String)],y.prototype,"description",void 0);U([classValidator.IsEnum(exports.OrganizationEventType),z("design:type",typeof exports.OrganizationEventType>"u"?Object:exports.OrganizationEventType)],y.prototype,"type",void 0);U([classValidator.IsEnum(exports.OrganizationEventVisibilityType),z("design:type",typeof exports.OrganizationEventVisibilityType>"u"?Object:exports.OrganizationEventVisibilityType)],y.prototype,"visibility",void 0);U([classValidator.IsDateString(),z("design:type",typeof Date>"u"?Object:Date)],y.prototype,"startAt",void 0);U([classValidator.IsDateString(),z("design:type",typeof Date>"u"?Object:Date)],y.prototype,"endAt",void 0);var Ge=class extends y{static{o(this,"UpdateOrganizationEventDto");}};function Fe(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(Fe,"_ts_decorate");function ke(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}o(ke,"_ts_metadata");var J=class{static{o(this,"CreateOrganizationMemberDto");}user;role};Fe([classValidator.IsString(),classValidator.IsNotEmpty(),ke("design:type",String)],J.prototype,"user",void 0);Fe([classValidator.IsEnum(exports.OrganizationMemberRole),classValidator.IsNotEmpty(),ke("design:type",typeof exports.OrganizationMemberRole>"u"?Object:exports.OrganizationMemberRole)],J.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 wt(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}o(wt,"_ts_metadata");var ie=class{static{o(this,"UpdateOrganizationMemberDto");}role};St([classValidator.IsEnum(exports.OrganizationMemberRole),classValidator.IsNotEmpty(),wt("design:type",typeof exports.OrganizationMemberRole>"u"?Object:exports.OrganizationMemberRole)],ie.prototype,"role",void 0);function N(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(N,"_ts_decorate");function E(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}o(E,"_ts_metadata");var pe=class{static{o(this,"CreateUserDto");}identifier;identity;password};N([classValidator.IsString(),classValidator.Matches(m.PASSWORD,{message:"Password must be secure."}),E("design:type",String)],pe.prototype,"password",void 0);var fe=class{static{o(this,"CreateUserIdentifierDto");}email;phoneNumber;username};N([classValidator.IsOptional(),classValidator.IsString(),classValidator.IsEmail(),E("design:type",String)],fe.prototype,"email",void 0);N([classValidator.IsOptional(),classValidator.IsString(),classValidator.IsPhoneNumber(),E("design:type",String)],fe.prototype,"phoneNumber",void 0);N([classValidator.IsString(),classValidator.IsString(),classValidator.IsLowercase(),classValidator.Length(3,48),classValidator.Matches(m.USERNAME),E("design:type",String)],fe.prototype,"username",void 0);var O=class{static{o(this,"CreateUserIdentityDto");}firstName;lastName;gender;avatarUrl;birthDate};N([classValidator.IsOptional(),classValidator.IsString(),classValidator.Length(2,32),classValidator.Matches(m.NAME,{message:"First name must be composed of letters only"}),E("design:type",String)],O.prototype,"firstName",void 0);N([classValidator.IsOptional(),classValidator.IsString(),classValidator.Length(2,32),classValidator.Matches(m.NAME,{message:"Last name must be composed of letters only"}),E("design:type",String)],O.prototype,"lastName",void 0);N([classValidator.IsEnum(exports.UserIdentityGender),E("design:type",typeof exports.UserIdentityGender>"u"?Object:exports.UserIdentityGender)],O.prototype,"gender",void 0);N([classValidator.IsOptional(),classValidator.IsUrl({protocols:["http","https"]}),E("design:type",String)],O.prototype,"avatarUrl",void 0);N([classValidator.IsOptional(),classValidator.IsDateString(),E("design:type",typeof Date>"u"?Object:Date)],O.prototype,"birthDate",void 0);var We=class{static{o(this,"SignInUserDto");}identifier;password};function c(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(c,"_ts_decorate");function l(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}o(l,"_ts_metadata");var Z=class{static{o(this,"UpdateUserDto");}identifier;identity;password};c([classValidator.IsOptional(),classValidator.IsObject(),classValidator.ValidateNested(),classTransformer.Type(()=>V),l("design:type",typeof V>"u"?Object:V)],Z.prototype,"identifier",void 0);c([classValidator.IsOptional(),classValidator.IsObject(),classValidator.ValidateNested(),classTransformer.Type(()=>h),l("design:type",typeof h>"u"?Object:h)],Z.prototype,"identity",void 0);c([classValidator.IsOptional(),classValidator.IsString(),classValidator.MinLength(8),classValidator.MaxLength(128),l("design:type",String)],Z.prototype,"password",void 0);var V=class{static{o(this,"UpdateUserIdentifierDto");}email;phoneNumber;username};c([classValidator.IsOptional(),classValidator.IsString(),classValidator.IsEmail(),l("design:type",String)],V.prototype,"email",void 0);c([classValidator.IsOptional(),classValidator.IsString(),classValidator.IsPhoneNumber(),l("design:type",String)],V.prototype,"phoneNumber",void 0);c([classValidator.IsOptional(),classValidator.IsString(),classValidator.IsLowercase(),classValidator.Length(3,48),classValidator.Matches(m.USERNAME),l("design:type",String)],V.prototype,"username",void 0);var h=class{static{o(this,"UpdateUserIdentityDto");}firstName;lastName;displayName;description;avatarUrl;bannerUrl;gender;birthDate};c([classValidator.IsOptional(),classValidator.IsString(),classValidator.Length(2,32),classValidator.Matches(m.NAME,{message:"First name must be composed of letters only"}),l("design:type",String)],h.prototype,"firstName",void 0);c([classValidator.IsOptional(),classValidator.IsString(),classValidator.Length(2,32),classValidator.Matches(m.NAME,{message:"Last name must be composed of letters only"}),l("design:type",String)],h.prototype,"lastName",void 0);c([classValidator.IsOptional(),classValidator.IsString(),classValidator.Length(1,32),l("design:type",String)],h.prototype,"displayName",void 0);c([classValidator.IsOptional(),classValidator.IsString(),classValidator.Length(1,128),l("design:type",String)],h.prototype,"description",void 0);c([classValidator.IsOptional(),classValidator.IsUrl(),l("design:type",Object)],h.prototype,"avatarUrl",void 0);c([classValidator.IsOptional(),classValidator.IsUrl(),l("design:type",Object)],h.prototype,"bannerUrl",void 0);c([classValidator.IsOptional(),classValidator.IsEnum(exports.UserIdentityGender),l("design:type",typeof exports.UserIdentityGender>"u"?Object:exports.UserIdentityGender)],h.prototype,"gender",void 0);c([classValidator.IsOptional(),classValidator.IsDateString(),l("design:type",typeof Date>"u"?Object:Date)],h.prototype,"birthDate",void 0);var v=typeof window<"u";var Ft=Gt__default.default.create({headers:{"Content-Type":"application/json",Accept:"application/json",...!v&&{"User-Agent":"tonightpass-api-client"}},responseType:"json",transformRequest:[function(e){return JSON.stringify(e)}],withCredentials:v}),He=o(async(e,t)=>Ft(e,{...t}).then(s=>s).catch(s=>{throw s.data||console.error(s),s.data}),"request");var le=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;}},K=class{static{o(this,"Client");}options;url;constructor(t){this.options=t,this.url=(r,s)=>{let i=this.options.baseURL||de;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 He(p,{method:t,data:s,...n}),Q=a.data;if(!Q.success)throw new le(a,Q);return Q.data}};function L(e){return e}o(L,"sdk");var Ce=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(v)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(v)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(v)window.location.href=e.url("/oauth2/facebook",t||{});else throw new Error("Facebook OAuth2 is only available in the browser")},"connect")}}});var Je=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/:jobId",{jobId:t}),"get")},offices:{getAll:o(async t=>e.get("/careers/offices",t),"getAll")}});var Ye=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 Ke=e=>({getAll:o(async t=>e.get("/orders",t),"getAll"),get:o(async t=>e.get("/orders/:orderId",{orderId:t}),"get")});var Qe=o(e=>({account:o(async t=>e.get("/organizations/:organizationSlug/billing/account",{organizationSlug:t}),"account"),link:o(t=>{if(v)window.location.href=e.url("/organizations/:organizationSlug/billing/link",{organizationSlug:t});else throw new Error("Billing link is only available in the browser")},"link"),dashboard:o(t=>{if(v)window.location.href=e.url("/organizations/:organizationSlug/billing/dashboard",{organizationSlug:t});else throw new Error("Billing dashboard is only available in the browser")},"dashboard")}),"organizationsBilling");var Te=o(e=>({create:o(async(t,r,s)=>e.post("/organizations/:organizationSlug/events/:eventSlug/orders",s,{organizationSlug:t,eventSlug:r}),"create")}),"organizationsEventsOrders");var et=o(e=>({getAll:o(async()=>e.get("/organizations/events/styles"),"getAll"),get:o(async t=>e.get("/organizations/events/styles/:styleSlug",{styleSlug:t}),"get"),create:o(async t=>e.post("/organizations/events/styles",t),"create"),update:o(async(t,r)=>e.put("/organizations/events/styles/:styleSlug",r,{styleSlug:t}),"update"),delete:o(async t=>e.delete("/organizations/events/styles/:styleSlug",null,{styleSlug:t}),"delete")}),"organizationsEventsStyles");var tt=o(e=>({getAll:o(async(t,r)=>e.get("/organizations/:organizationSlug/events/:eventSlug/tickets",{organizationSlug:t,eventSlug:r}),"getAll"),get:o(async(t,r,s)=>e.get("/organizations/:organizationSlug/events/:eventSlug/tickets/:ticketId",{organizationSlug:t,eventSlug:r,ticketId:s}),"get"),create:o(async(t,r,s)=>e.post("/organizations/:organizationSlug/events/:eventSlug/tickets",s,{organizationSlug:t,eventSlug:r}),"create"),update:o(async(t,r,s,i)=>e.put("/organizations/:organizationSlug/events/:eventSlug/tickets/:ticketId",i,{organizationSlug:t,eventSlug:r,ticketId:s}),"update"),delete:o(async(t,r,s)=>e.delete("/organizations/:organizationSlug/events/:eventSlug/tickets/:ticketId",null,{organizationSlug:t,eventSlug:r,ticketId:s}),"delete")}),"organizationsEventsTickets");var ot=o(e=>({getAll:o(async(t,r)=>t?e.get("/organizations/:organizationSlug/events",{organizationSlug:t,...r}):e.get("/organizations/events",r),"getAll"),getSuggestions:o(async t=>e.get("/organizations/events/suggestions",t),"getSuggestions"),getNearby:o(async t=>e.get("/organizations/events/nearby",t),"getNearby"),get:o(async(t,r)=>e.get("/organizations/:organizationSlug/events/:eventSlug",{organizationSlug:t,eventSlug:r}),"get"),create:o(async(t,r)=>e.post("/organizations/:organizationSlug/events",r,{organizationSlug: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"),orders:Te(e),styles:et(e),tickets:tt(e)}),"organizationsEvents");var rt=o(e=>({getAll:o(async()=>e.get("/organizations/members"),"getAll"),delete:o(async t=>e.delete("/organizations/members/:memberId",null,{memberId:t}),"delete")}),"organizationsMembers");var nt=e=>({getAll:o(async()=>e.get("/organizations"),"getAll"),get:o(async t=>e.get("/organizations/:organizationSlug",{organizationSlug:t}),"get"),create:o(async t=>e.post("/organizations",t),"create"),update:o(async(t,r)=>e.put("/organizations/:organizationSlug",r,{organizationSlug:t}),"update"),delete:o(async t=>e.delete("/organizations/:organizationSlug",null,{organizationSlug:t}),"delete"),billing:Qe(e),events:ot(e),members:rt(e)});var st=e=>({follow:o(async t=>e.post("/profiles/:username/relationships/follow",null,{username:t}),"follow"),unfollow:o(async t=>e.post("/profiles/:username/relationships/unfollow",null,{username:t}),"unfollow")});var it=e=>({get:o(async t=>e.get("/profiles/:username",{username:t}),"get"),relationships:st(e)});var pt=e=>({getAll:o(async()=>e.get("/users"),"getAll"),get:o(async t=>e.get("/users/:userId",{userId: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/:userId",r,{userId:t}),"update")});var at=e=>({registerToBeta:o(async t=>e.post("/notifications/subscribe/beta",{email:t}),"registerToBeta")});var ft=class{static{o(this,"TonightPass");}client;auth;careers;health;orders;organizations;profiles;users;notifications;constructor(t){this.client=new K(t),this.auth=Ce(this.client),this.careers=Je(this.client),this.health=Ye(this.client),this.orders=Ke(this.client),this.organizations=nt(this.client),this.profiles=it(this.client),this.users=pt(this.client),this.notifications=at(this.client);}};
14
14
 
15
15
  exports.Client = K;
16
16
  exports.CreateOrganizationDto = M;
17
17
  exports.CreateOrganizationEventDto = y;
18
- exports.CreateOrganizationEventOrderDto = ve;
18
+ exports.CreateOrganizationEventOrderDto = xe;
19
19
  exports.CreateOrganizationEventStyleDto = C;
20
20
  exports.CreateOrganizationEventTicketDto = f;
21
21
  exports.CreateOrganizationIdentityDto = S;
22
22
  exports.CreateOrganizationMemberDto = J;
23
- exports.CreateUserDto = ae;
23
+ exports.CreateUserDto = pe;
24
24
  exports.CreateUserIdentityDto = O;
25
25
  exports.DEFAULT_API_URL = de;
26
26
  exports.REGEX = m;
@@ -29,7 +29,7 @@ exports.TonightPass = ft;
29
29
  exports.TonightPassAPIError = le;
30
30
  exports.UpdateOrganizationDto = B;
31
31
  exports.UpdateOrganizationEventDto = Ge;
32
- exports.UpdateOrganizationEventStyleDto = xe;
32
+ exports.UpdateOrganizationEventStyleDto = ve;
33
33
  exports.UpdateOrganizationEventTicketDto = Oe;
34
34
  exports.UpdateOrganizationIdentityDto = j;
35
35
  exports.UpdateOrganizationMemberDto = ie;
@@ -37,13 +37,13 @@ exports.UpdateUserDto = Z;
37
37
  exports.auth = Ce;
38
38
  exports.careers = Je;
39
39
  exports.health = Ye;
40
- exports.isBrowser = x;
41
- exports.notifications = pt;
40
+ exports.isBrowser = v;
41
+ exports.notifications = at;
42
42
  exports.orders = Ke;
43
43
  exports.organizations = nt;
44
44
  exports.profiles = it;
45
45
  exports.request = He;
46
46
  exports.sdk = L;
47
- exports.users = at;
47
+ exports.users = pt;
48
48
  //# sourceMappingURL=index.js.map
49
49
  //# sourceMappingURL=index.js.map