tonightpass 0.0.26 → 0.0.28

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.26 build /home/runner/work/tonightpass/tonightpass/packages/node
2
+ > tonightpass@0.0.28 build /home/runner/work/tonightpass/tonightpass/packages/node
3
3
  > tsup
4
4
 
5
5
  CLI Building entry: src/index.ts
@@ -9,13 +9,13 @@
9
9
  CLI Target: esnext
10
10
  CJS Build start
11
11
  ESM Build start
12
- ESM dist/index.mjs 12.87 KB
13
- ESM dist/index.mjs.map 42.87 KB
14
- ESM ⚡️ Build success in 317ms
15
- CJS dist/index.js 14.72 KB
16
- CJS dist/index.js.map 42.87 KB
17
- CJS ⚡️ Build success in 318ms
12
+ CJS dist/index.js 15.14 KB
13
+ CJS dist/index.js.map 46.17 KB
14
+ CJS ⚡️ Build success in 415ms
15
+ ESM dist/index.mjs 13.29 KB
16
+ ESM dist/index.mjs.map 46.17 KB
17
+ ESM ⚡️ Build success in 415ms
18
18
  DTS Build start
19
- DTS ⚡️ Build success in 3680ms
20
- DTS dist/index.d.ts 33.16 KB
21
- DTS dist/index.d.mts 33.16 KB
19
+ DTS ⚡️ Build success in 3796ms
20
+ DTS dist/index.d.ts 35.82 KB
21
+ DTS dist/index.d.mts 35.82 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # tonightpass
2
2
 
3
+ ## 0.0.28
4
+
5
+ ### Patch Changes
6
+
7
+ - [`2b069df`](https://github.com/tonightpass/tonightpass/commit/2b069df59fcd5a51e4acf4ebd71826e878da7b31) Thanks [@AntoineKM](https://github.com/AntoineKM)! - Fix create organization event dtos
8
+
9
+ ## 0.0.27
10
+
11
+ ### Patch Changes
12
+
13
+ - [#281](https://github.com/tonightpass/tonightpass/pull/281) [`d3ef400`](https://github.com/tonightpass/tonightpass/commit/d3ef400d824daf8f4506a753a8b3b1abb80df068) Thanks [@AntoineKM](https://github.com/AntoineKM)! - Add organization event style types, dtos, endpoints and sdk
14
+
3
15
  ## 0.0.26
4
16
 
5
17
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -191,6 +191,30 @@ type Health<Key extends string> = {
191
191
  };
192
192
  type HealthEndpoints = Endpoint<"GET", "/health", [Health<"app">, Health<"database">]> | Endpoint<"GET", "/health/database", Health<"database">> | Endpoint<"GET", "/health/http", Health<"app">>;
193
193
 
194
+ declare class CreateOrganizationEventStyleDto {
195
+ type: OrganizationEventStyleType;
196
+ emoji: string;
197
+ name: string;
198
+ }
199
+
200
+ declare class UpdateOrganizationEventStyleDto extends CreateOrganizationEventStyleDto {
201
+ }
202
+
203
+ type OrganizationEventStyle = {
204
+ type: OrganizationEventStyleType;
205
+ emoji: string;
206
+ name: string;
207
+ slug: string;
208
+ };
209
+ declare enum OrganizationEventStyleType {
210
+ Music = "music",
211
+ Dress = "dress",
212
+ Sport = "sport",
213
+ Food = "food",
214
+ Art = "art"
215
+ }
216
+ type OrganizationEventStyleEndpoints = Endpoint<"GET", "/organizations/events/styles", OrganizationEventStyle[]> | Endpoint<"GET", "/organizations/events/styles/:slug", OrganizationEventStyle> | Endpoint<"POST", "/organizations/events/styles", OrganizationEventStyle, CreateOrganizationEventStyleDto> | Endpoint<"PUT", "/organizations/events/styles/:slug", OrganizationEventStyle, UpdateOrganizationEventStyleDto> | Endpoint<"DELETE", "/organizations/events/styles/:slug", OrganizationEventStyle[], null>;
217
+
194
218
  type OrganizationEventTicket = {
195
219
  id: string;
196
220
  name: string;
@@ -264,19 +288,7 @@ declare enum OrganizationEventType {
264
288
  ConsumerShow = "consumer_show",
265
289
  Membership = "membership"
266
290
  }
267
- type OrganizationEventStyle = {
268
- type: OrganizationEventStyleType;
269
- emoji: string;
270
- name: string;
271
- };
272
- declare enum OrganizationEventStyleType {
273
- Music = "music",
274
- Dress = "dress",
275
- Sport = "sport",
276
- Food = "food",
277
- Art = "art"
278
- }
279
- type OrganizationEventEndpoints = Endpoint<"GET", "/organizations/:organizationSlug/events", Event[]> | Endpoint<"GET", "/organizations/:organizationSlug/events/:eventSlug", Event> | Endpoint<"POST", "/organizations/:organizationSlug/events", Event, CreateOrganizationEventDto> | Endpoint<"PUT", "/organizations/:organizationSlug/events/:eventSlug", Event, UpdateOrganizationEventDto> | Endpoint<"DELETE", "/organizations/:organizationSlug/events/:eventSlug", Event, null> | OrganizationEventTicketEndpoints;
291
+ type OrganizationEventEndpoints = Endpoint<"GET", "/organizations/:organizationSlug/events", Event[]> | Endpoint<"GET", "/organizations/:organizationSlug/events/:eventSlug", Event> | Endpoint<"POST", "/organizations/:organizationSlug/events", Event, CreateOrganizationEventDto> | Endpoint<"PUT", "/organizations/:organizationSlug/events/:eventSlug", Event, UpdateOrganizationEventDto> | Endpoint<"DELETE", "/organizations/:organizationSlug/events/:eventSlug", Event, null> | OrganizationEventStyleEndpoints | OrganizationEventTicketEndpoints;
280
292
 
281
293
  declare class UpdateOrganizationMemberDto {
282
294
  role: OrganizationMemberRole;
@@ -460,7 +472,6 @@ declare class UpdateOrganizationDto extends CreateOrganizationDto {
460
472
  }
461
473
 
462
474
  declare class CreateOrganizationEventTicketDto {
463
- id: string;
464
475
  name: string;
465
476
  description?: string;
466
477
  price: number;
@@ -478,7 +489,9 @@ declare class UpdateOrganizationEventTicketDto extends CreateOrganizationEventTi
478
489
  }
479
490
 
480
491
  declare class CreateOrganizationEventDto {
481
- slug: string;
492
+ title: string;
493
+ description: string;
494
+ organization: string;
482
495
  type: OrganizationEventType;
483
496
  public: boolean;
484
497
  flyers: string[];
@@ -634,6 +647,12 @@ declare class Client {
634
647
  }> | Extract<Endpoint<"GET", "/organizations/:organizationSlug/events/:eventSlug", Event>, {
635
648
  path: Path;
636
649
  method: "GET";
650
+ }> | Extract<Endpoint<"GET", "/organizations/events/styles", OrganizationEventStyle[]>, {
651
+ path: Path;
652
+ method: "GET";
653
+ }> | Extract<Endpoint<"GET", "/organizations/events/styles/:slug", OrganizationEventStyle>, {
654
+ path: Path;
655
+ method: "GET";
637
656
  }> | Extract<Endpoint<"GET", "/organizations/:slug/events/:eventSlug/tickets", OrganizationEventTicket[]>, {
638
657
  path: Path;
639
658
  method: "GET";
@@ -694,6 +713,9 @@ declare class Client {
694
713
  }> | Extract<Endpoint<"POST", "/organizations/:organizationSlug/events", Event, CreateOrganizationEventDto>, {
695
714
  path: Path;
696
715
  method: "POST";
716
+ }> | Extract<Endpoint<"POST", "/organizations/events/styles", OrganizationEventStyle, CreateOrganizationEventStyleDto>, {
717
+ path: Path;
718
+ method: "POST";
697
719
  }> | Extract<Endpoint<"POST", "/organizations/:slug/events/:eventSlug/tickets", OrganizationEventTicket, CreateOrganizationEventTicketDto>, {
698
720
  path: Path;
699
721
  method: "POST";
@@ -712,6 +734,9 @@ declare class Client {
712
734
  }> | Extract<Endpoint<"PUT", "/organizations/:organizationSlug/events/:eventSlug", Event, UpdateOrganizationEventDto>, {
713
735
  path: Path;
714
736
  method: "PUT";
737
+ }> | Extract<Endpoint<"PUT", "/organizations/events/styles/:slug", OrganizationEventStyle, UpdateOrganizationEventStyleDto>, {
738
+ path: Path;
739
+ method: "PUT";
715
740
  }> | Extract<Endpoint<"PUT", "/organizations/:slug/events/:eventSlug/tickets/:ticketId", OrganizationEventTicket, UpdateOrganizationEventTicketDto>, {
716
741
  path: Path;
717
742
  method: "PUT";
@@ -739,6 +764,9 @@ declare class Client {
739
764
  }> | Extract<Endpoint<"DELETE", "/organizations/:organizationSlug/events/:eventSlug", Event, null>, {
740
765
  path: Path;
741
766
  method: "DELETE";
767
+ }> | Extract<Endpoint<"DELETE", "/organizations/events/styles/:slug", OrganizationEventStyle[], null>, {
768
+ path: Path;
769
+ method: "DELETE";
742
770
  }> | Extract<Endpoint<"DELETE", "/organizations/:slug/events/:eventSlug/tickets/:ticketId", OrganizationEventTicket[], null>, {
743
771
  path: Path;
744
772
  method: "DELETE";
@@ -797,17 +825,25 @@ declare const organizations: (client: Client) => {
797
825
  create: (data: CreateOrganizationDto) => Promise<Organization>;
798
826
  update: (slug: string, data: UpdateOrganizationDto) => Promise<Organization>;
799
827
  delete: (slug: string) => Promise<Organization>;
800
- members: {
801
- getAll: () => Promise<OrganizationMember[]>;
802
- delete: (id: string) => Promise<OrganizationMember[]>;
828
+ billing: (client: Client) => {
829
+ account: (slug: string) => Promise<stripe.Stripe.Account>;
830
+ link: (slug: string) => void;
831
+ dashboard: (slug: string) => void;
803
832
  };
804
- events: {
833
+ events: (client: Client) => {
805
834
  getAll: (organizationSlug: string) => Promise<Event[]>;
806
835
  get: (organizationSlug: string, eventSlug: string) => Promise<Event>;
807
836
  create: (organizationSlug: string, data: CreateOrganizationEventDto) => Promise<Event>;
808
- update: (organizationSlug: string, eventSlug: string, data: CreateOrganizationEventDto) => Promise<Event>;
837
+ update: (organizationSlug: string, eventSlug: string, data: UpdateOrganizationEventDto) => Promise<Event>;
809
838
  delete: (organizationSlug: string, eventSlug: string) => Promise<Event>;
810
- tickets: {
839
+ styles: (client: Client) => {
840
+ getAll: () => Promise<OrganizationEventStyle[]>;
841
+ get: (slug: string) => Promise<OrganizationEventStyle>;
842
+ create: (data: CreateOrganizationEventStyleDto) => Promise<OrganizationEventStyle>;
843
+ update: (slug: string, data: UpdateOrganizationEventStyleDto) => Promise<OrganizationEventStyle>;
844
+ delete: (slug: string) => Promise<OrganizationEventStyle[]>;
845
+ };
846
+ tickets: (client: Client) => {
811
847
  getAll: (slug: string, eventSlug: string) => Promise<OrganizationEventTicket[]>;
812
848
  get: (slug: string, eventSlug: string, ticketId: string) => Promise<OrganizationEventTicket>;
813
849
  create: (slug: string, eventSlug: string, data: CreateOrganizationEventTicketDto) => Promise<OrganizationEventTicket>;
@@ -815,10 +851,9 @@ declare const organizations: (client: Client) => {
815
851
  delete: (slug: string, eventSlug: string, ticketId: string) => Promise<OrganizationEventTicket[]>;
816
852
  };
817
853
  };
818
- billing: {
819
- account: (slug: string) => Promise<stripe.Stripe.Account>;
820
- link: (slug: string) => void;
821
- dashboard: (slug: string) => void;
854
+ members: (client: Client) => {
855
+ getAll: () => Promise<OrganizationMember[]>;
856
+ delete: (id: string) => Promise<OrganizationMember[]>;
822
857
  };
823
858
  };
824
859
 
@@ -880,17 +915,25 @@ declare class TonightPass {
880
915
  create: (data: CreateOrganizationDto) => Promise<Organization>;
881
916
  update: (slug: string, data: UpdateOrganizationDto) => Promise<Organization>;
882
917
  delete: (slug: string) => Promise<Organization>;
883
- members: {
884
- getAll: () => Promise<OrganizationMember[]>;
885
- delete: (id: string) => Promise<OrganizationMember[]>;
918
+ billing: (client: Client) => {
919
+ account: (slug: string) => Promise<stripe.Stripe.Account>;
920
+ link: (slug: string) => void;
921
+ dashboard: (slug: string) => void;
886
922
  };
887
- events: {
923
+ events: (client: Client) => {
888
924
  getAll: (organizationSlug: string) => Promise<Event[]>;
889
925
  get: (organizationSlug: string, eventSlug: string) => Promise<Event>;
890
926
  create: (organizationSlug: string, data: CreateOrganizationEventDto) => Promise<Event>;
891
- update: (organizationSlug: string, eventSlug: string, data: CreateOrganizationEventDto) => Promise<Event>;
927
+ update: (organizationSlug: string, eventSlug: string, data: UpdateOrganizationEventDto) => Promise<Event>;
892
928
  delete: (organizationSlug: string, eventSlug: string) => Promise<Event>;
893
- tickets: {
929
+ styles: (client: Client) => {
930
+ getAll: () => Promise<OrganizationEventStyle[]>;
931
+ get: (slug: string) => Promise<OrganizationEventStyle>;
932
+ create: (data: CreateOrganizationEventStyleDto) => Promise<OrganizationEventStyle>;
933
+ update: (slug: string, data: UpdateOrganizationEventStyleDto) => Promise<OrganizationEventStyle>;
934
+ delete: (slug: string) => Promise<OrganizationEventStyle[]>;
935
+ };
936
+ tickets: (client: Client) => {
894
937
  getAll: (slug: string, eventSlug: string) => Promise<OrganizationEventTicket[]>;
895
938
  get: (slug: string, eventSlug: string, ticketId: string) => Promise<OrganizationEventTicket>;
896
939
  create: (slug: string, eventSlug: string, data: CreateOrganizationEventTicketDto) => Promise<OrganizationEventTicket>;
@@ -898,10 +941,9 @@ declare class TonightPass {
898
941
  delete: (slug: string, eventSlug: string, ticketId: string) => Promise<OrganizationEventTicket[]>;
899
942
  };
900
943
  };
901
- billing: {
902
- account: (slug: string) => Promise<stripe.Stripe.Account>;
903
- link: (slug: string) => void;
904
- dashboard: (slug: string) => void;
944
+ members: (client: Client) => {
945
+ getAll: () => Promise<OrganizationMember[]>;
946
+ delete: (id: string) => Promise<OrganizationMember[]>;
905
947
  };
906
948
  };
907
949
  readonly profiles: {
@@ -923,4 +965,4 @@ declare class TonightPass {
923
965
 
924
966
  declare const isBrowser: boolean;
925
967
 
926
- export { type APIRequestOptions, type APIResponse, type AuthEndpoints, BCRYPT_HASH, type CareersCategory, type CareersEmploymentType, type CareersEndpoints, type CareersJob, type CareersOffice, Client, type ClientOptions, CreateOrganizationDto, CreateOrganizationEventDto, CreateOrganizationEventTicketDto, CreateOrganizationIdentityDto, CreateUserDto, Currency, DEFAULT_API_URL, EMAIL_REGEX, type Endpoint, type Endpoints, type ErroredAPIResponse, 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, OrganizationEventStyleType, type OrganizationEventTicket, OrganizationEventTicketCategory, type OrganizationEventTicketEndpoints, type OrganizationEventTicketType, OrganizationEventType, type OrganizationIdentity, type OrganizationMember, OrganizationMemberDto, 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, 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 };
968
+ export { type APIRequestOptions, type APIResponse, type AuthEndpoints, BCRYPT_HASH, type CareersCategory, type CareersEmploymentType, type CareersEndpoints, type CareersJob, type CareersOffice, Client, type ClientOptions, CreateOrganizationDto, CreateOrganizationEventDto, CreateOrganizationEventTicketDto, CreateOrganizationIdentityDto, CreateUserDto, Currency, DEFAULT_API_URL, EMAIL_REGEX, type Endpoint, type Endpoints, type ErroredAPIResponse, 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, type OrganizationEventTicketType, OrganizationEventType, type OrganizationIdentity, type OrganizationMember, OrganizationMemberDto, 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, 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.d.ts CHANGED
@@ -191,6 +191,30 @@ type Health<Key extends string> = {
191
191
  };
192
192
  type HealthEndpoints = Endpoint<"GET", "/health", [Health<"app">, Health<"database">]> | Endpoint<"GET", "/health/database", Health<"database">> | Endpoint<"GET", "/health/http", Health<"app">>;
193
193
 
194
+ declare class CreateOrganizationEventStyleDto {
195
+ type: OrganizationEventStyleType;
196
+ emoji: string;
197
+ name: string;
198
+ }
199
+
200
+ declare class UpdateOrganizationEventStyleDto extends CreateOrganizationEventStyleDto {
201
+ }
202
+
203
+ type OrganizationEventStyle = {
204
+ type: OrganizationEventStyleType;
205
+ emoji: string;
206
+ name: string;
207
+ slug: string;
208
+ };
209
+ declare enum OrganizationEventStyleType {
210
+ Music = "music",
211
+ Dress = "dress",
212
+ Sport = "sport",
213
+ Food = "food",
214
+ Art = "art"
215
+ }
216
+ type OrganizationEventStyleEndpoints = Endpoint<"GET", "/organizations/events/styles", OrganizationEventStyle[]> | Endpoint<"GET", "/organizations/events/styles/:slug", OrganizationEventStyle> | Endpoint<"POST", "/organizations/events/styles", OrganizationEventStyle, CreateOrganizationEventStyleDto> | Endpoint<"PUT", "/organizations/events/styles/:slug", OrganizationEventStyle, UpdateOrganizationEventStyleDto> | Endpoint<"DELETE", "/organizations/events/styles/:slug", OrganizationEventStyle[], null>;
217
+
194
218
  type OrganizationEventTicket = {
195
219
  id: string;
196
220
  name: string;
@@ -264,19 +288,7 @@ declare enum OrganizationEventType {
264
288
  ConsumerShow = "consumer_show",
265
289
  Membership = "membership"
266
290
  }
267
- type OrganizationEventStyle = {
268
- type: OrganizationEventStyleType;
269
- emoji: string;
270
- name: string;
271
- };
272
- declare enum OrganizationEventStyleType {
273
- Music = "music",
274
- Dress = "dress",
275
- Sport = "sport",
276
- Food = "food",
277
- Art = "art"
278
- }
279
- type OrganizationEventEndpoints = Endpoint<"GET", "/organizations/:organizationSlug/events", Event[]> | Endpoint<"GET", "/organizations/:organizationSlug/events/:eventSlug", Event> | Endpoint<"POST", "/organizations/:organizationSlug/events", Event, CreateOrganizationEventDto> | Endpoint<"PUT", "/organizations/:organizationSlug/events/:eventSlug", Event, UpdateOrganizationEventDto> | Endpoint<"DELETE", "/organizations/:organizationSlug/events/:eventSlug", Event, null> | OrganizationEventTicketEndpoints;
291
+ type OrganizationEventEndpoints = Endpoint<"GET", "/organizations/:organizationSlug/events", Event[]> | Endpoint<"GET", "/organizations/:organizationSlug/events/:eventSlug", Event> | Endpoint<"POST", "/organizations/:organizationSlug/events", Event, CreateOrganizationEventDto> | Endpoint<"PUT", "/organizations/:organizationSlug/events/:eventSlug", Event, UpdateOrganizationEventDto> | Endpoint<"DELETE", "/organizations/:organizationSlug/events/:eventSlug", Event, null> | OrganizationEventStyleEndpoints | OrganizationEventTicketEndpoints;
280
292
 
281
293
  declare class UpdateOrganizationMemberDto {
282
294
  role: OrganizationMemberRole;
@@ -460,7 +472,6 @@ declare class UpdateOrganizationDto extends CreateOrganizationDto {
460
472
  }
461
473
 
462
474
  declare class CreateOrganizationEventTicketDto {
463
- id: string;
464
475
  name: string;
465
476
  description?: string;
466
477
  price: number;
@@ -478,7 +489,9 @@ declare class UpdateOrganizationEventTicketDto extends CreateOrganizationEventTi
478
489
  }
479
490
 
480
491
  declare class CreateOrganizationEventDto {
481
- slug: string;
492
+ title: string;
493
+ description: string;
494
+ organization: string;
482
495
  type: OrganizationEventType;
483
496
  public: boolean;
484
497
  flyers: string[];
@@ -634,6 +647,12 @@ declare class Client {
634
647
  }> | Extract<Endpoint<"GET", "/organizations/:organizationSlug/events/:eventSlug", Event>, {
635
648
  path: Path;
636
649
  method: "GET";
650
+ }> | Extract<Endpoint<"GET", "/organizations/events/styles", OrganizationEventStyle[]>, {
651
+ path: Path;
652
+ method: "GET";
653
+ }> | Extract<Endpoint<"GET", "/organizations/events/styles/:slug", OrganizationEventStyle>, {
654
+ path: Path;
655
+ method: "GET";
637
656
  }> | Extract<Endpoint<"GET", "/organizations/:slug/events/:eventSlug/tickets", OrganizationEventTicket[]>, {
638
657
  path: Path;
639
658
  method: "GET";
@@ -694,6 +713,9 @@ declare class Client {
694
713
  }> | Extract<Endpoint<"POST", "/organizations/:organizationSlug/events", Event, CreateOrganizationEventDto>, {
695
714
  path: Path;
696
715
  method: "POST";
716
+ }> | Extract<Endpoint<"POST", "/organizations/events/styles", OrganizationEventStyle, CreateOrganizationEventStyleDto>, {
717
+ path: Path;
718
+ method: "POST";
697
719
  }> | Extract<Endpoint<"POST", "/organizations/:slug/events/:eventSlug/tickets", OrganizationEventTicket, CreateOrganizationEventTicketDto>, {
698
720
  path: Path;
699
721
  method: "POST";
@@ -712,6 +734,9 @@ declare class Client {
712
734
  }> | Extract<Endpoint<"PUT", "/organizations/:organizationSlug/events/:eventSlug", Event, UpdateOrganizationEventDto>, {
713
735
  path: Path;
714
736
  method: "PUT";
737
+ }> | Extract<Endpoint<"PUT", "/organizations/events/styles/:slug", OrganizationEventStyle, UpdateOrganizationEventStyleDto>, {
738
+ path: Path;
739
+ method: "PUT";
715
740
  }> | Extract<Endpoint<"PUT", "/organizations/:slug/events/:eventSlug/tickets/:ticketId", OrganizationEventTicket, UpdateOrganizationEventTicketDto>, {
716
741
  path: Path;
717
742
  method: "PUT";
@@ -739,6 +764,9 @@ declare class Client {
739
764
  }> | Extract<Endpoint<"DELETE", "/organizations/:organizationSlug/events/:eventSlug", Event, null>, {
740
765
  path: Path;
741
766
  method: "DELETE";
767
+ }> | Extract<Endpoint<"DELETE", "/organizations/events/styles/:slug", OrganizationEventStyle[], null>, {
768
+ path: Path;
769
+ method: "DELETE";
742
770
  }> | Extract<Endpoint<"DELETE", "/organizations/:slug/events/:eventSlug/tickets/:ticketId", OrganizationEventTicket[], null>, {
743
771
  path: Path;
744
772
  method: "DELETE";
@@ -797,17 +825,25 @@ declare const organizations: (client: Client) => {
797
825
  create: (data: CreateOrganizationDto) => Promise<Organization>;
798
826
  update: (slug: string, data: UpdateOrganizationDto) => Promise<Organization>;
799
827
  delete: (slug: string) => Promise<Organization>;
800
- members: {
801
- getAll: () => Promise<OrganizationMember[]>;
802
- delete: (id: string) => Promise<OrganizationMember[]>;
828
+ billing: (client: Client) => {
829
+ account: (slug: string) => Promise<stripe.Stripe.Account>;
830
+ link: (slug: string) => void;
831
+ dashboard: (slug: string) => void;
803
832
  };
804
- events: {
833
+ events: (client: Client) => {
805
834
  getAll: (organizationSlug: string) => Promise<Event[]>;
806
835
  get: (organizationSlug: string, eventSlug: string) => Promise<Event>;
807
836
  create: (organizationSlug: string, data: CreateOrganizationEventDto) => Promise<Event>;
808
- update: (organizationSlug: string, eventSlug: string, data: CreateOrganizationEventDto) => Promise<Event>;
837
+ update: (organizationSlug: string, eventSlug: string, data: UpdateOrganizationEventDto) => Promise<Event>;
809
838
  delete: (organizationSlug: string, eventSlug: string) => Promise<Event>;
810
- tickets: {
839
+ styles: (client: Client) => {
840
+ getAll: () => Promise<OrganizationEventStyle[]>;
841
+ get: (slug: string) => Promise<OrganizationEventStyle>;
842
+ create: (data: CreateOrganizationEventStyleDto) => Promise<OrganizationEventStyle>;
843
+ update: (slug: string, data: UpdateOrganizationEventStyleDto) => Promise<OrganizationEventStyle>;
844
+ delete: (slug: string) => Promise<OrganizationEventStyle[]>;
845
+ };
846
+ tickets: (client: Client) => {
811
847
  getAll: (slug: string, eventSlug: string) => Promise<OrganizationEventTicket[]>;
812
848
  get: (slug: string, eventSlug: string, ticketId: string) => Promise<OrganizationEventTicket>;
813
849
  create: (slug: string, eventSlug: string, data: CreateOrganizationEventTicketDto) => Promise<OrganizationEventTicket>;
@@ -815,10 +851,9 @@ declare const organizations: (client: Client) => {
815
851
  delete: (slug: string, eventSlug: string, ticketId: string) => Promise<OrganizationEventTicket[]>;
816
852
  };
817
853
  };
818
- billing: {
819
- account: (slug: string) => Promise<stripe.Stripe.Account>;
820
- link: (slug: string) => void;
821
- dashboard: (slug: string) => void;
854
+ members: (client: Client) => {
855
+ getAll: () => Promise<OrganizationMember[]>;
856
+ delete: (id: string) => Promise<OrganizationMember[]>;
822
857
  };
823
858
  };
824
859
 
@@ -880,17 +915,25 @@ declare class TonightPass {
880
915
  create: (data: CreateOrganizationDto) => Promise<Organization>;
881
916
  update: (slug: string, data: UpdateOrganizationDto) => Promise<Organization>;
882
917
  delete: (slug: string) => Promise<Organization>;
883
- members: {
884
- getAll: () => Promise<OrganizationMember[]>;
885
- delete: (id: string) => Promise<OrganizationMember[]>;
918
+ billing: (client: Client) => {
919
+ account: (slug: string) => Promise<stripe.Stripe.Account>;
920
+ link: (slug: string) => void;
921
+ dashboard: (slug: string) => void;
886
922
  };
887
- events: {
923
+ events: (client: Client) => {
888
924
  getAll: (organizationSlug: string) => Promise<Event[]>;
889
925
  get: (organizationSlug: string, eventSlug: string) => Promise<Event>;
890
926
  create: (organizationSlug: string, data: CreateOrganizationEventDto) => Promise<Event>;
891
- update: (organizationSlug: string, eventSlug: string, data: CreateOrganizationEventDto) => Promise<Event>;
927
+ update: (organizationSlug: string, eventSlug: string, data: UpdateOrganizationEventDto) => Promise<Event>;
892
928
  delete: (organizationSlug: string, eventSlug: string) => Promise<Event>;
893
- tickets: {
929
+ styles: (client: Client) => {
930
+ getAll: () => Promise<OrganizationEventStyle[]>;
931
+ get: (slug: string) => Promise<OrganizationEventStyle>;
932
+ create: (data: CreateOrganizationEventStyleDto) => Promise<OrganizationEventStyle>;
933
+ update: (slug: string, data: UpdateOrganizationEventStyleDto) => Promise<OrganizationEventStyle>;
934
+ delete: (slug: string) => Promise<OrganizationEventStyle[]>;
935
+ };
936
+ tickets: (client: Client) => {
894
937
  getAll: (slug: string, eventSlug: string) => Promise<OrganizationEventTicket[]>;
895
938
  get: (slug: string, eventSlug: string, ticketId: string) => Promise<OrganizationEventTicket>;
896
939
  create: (slug: string, eventSlug: string, data: CreateOrganizationEventTicketDto) => Promise<OrganizationEventTicket>;
@@ -898,10 +941,9 @@ declare class TonightPass {
898
941
  delete: (slug: string, eventSlug: string, ticketId: string) => Promise<OrganizationEventTicket[]>;
899
942
  };
900
943
  };
901
- billing: {
902
- account: (slug: string) => Promise<stripe.Stripe.Account>;
903
- link: (slug: string) => void;
904
- dashboard: (slug: string) => void;
944
+ members: (client: Client) => {
945
+ getAll: () => Promise<OrganizationMember[]>;
946
+ delete: (id: string) => Promise<OrganizationMember[]>;
905
947
  };
906
948
  };
907
949
  readonly profiles: {
@@ -923,4 +965,4 @@ declare class TonightPass {
923
965
 
924
966
  declare const isBrowser: boolean;
925
967
 
926
- export { type APIRequestOptions, type APIResponse, type AuthEndpoints, BCRYPT_HASH, type CareersCategory, type CareersEmploymentType, type CareersEndpoints, type CareersJob, type CareersOffice, Client, type ClientOptions, CreateOrganizationDto, CreateOrganizationEventDto, CreateOrganizationEventTicketDto, CreateOrganizationIdentityDto, CreateUserDto, Currency, DEFAULT_API_URL, EMAIL_REGEX, type Endpoint, type Endpoints, type ErroredAPIResponse, 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, OrganizationEventStyleType, type OrganizationEventTicket, OrganizationEventTicketCategory, type OrganizationEventTicketEndpoints, type OrganizationEventTicketType, OrganizationEventType, type OrganizationIdentity, type OrganizationMember, OrganizationMemberDto, 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, 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 };
968
+ export { type APIRequestOptions, type APIResponse, type AuthEndpoints, BCRYPT_HASH, type CareersCategory, type CareersEmploymentType, type CareersEndpoints, type CareersJob, type CareersOffice, Client, type ClientOptions, CreateOrganizationDto, CreateOrganizationEventDto, CreateOrganizationEventTicketDto, CreateOrganizationIdentityDto, CreateUserDto, Currency, DEFAULT_API_URL, EMAIL_REGEX, type Endpoint, type Endpoints, type ErroredAPIResponse, 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, type OrganizationEventTicketType, OrganizationEventType, type OrganizationIdentity, type OrganizationMember, OrganizationMemberDto, 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, 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,45 +3,45 @@
3
3
  require('reflect-metadata');
4
4
  var classValidator = require('class-validator');
5
5
  var classTransformer = require('class-transformer');
6
- var we = require('redaxios');
6
+ var Se = 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 we__default = /*#__PURE__*/_interopDefault(we);
11
+ var Se__default = /*#__PURE__*/_interopDefault(Se);
12
12
 
13
- var ue=Object.defineProperty;var s=(e,t)=>ue(e,"name",{value:t,configurable:!0});var q="https://api.tonightpass.com";var Se=/^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$/,je=/((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/,D=/(^[\p{L}\d'\\.\s\\-]*$)/u,Ie=/^[a-z\d]+(?:(\.|-|_)[a-z\d]+)*$/,Le=/\$2[abxy]?\$\d{1,2}\$[A-Za-z\d\\./]{53}/,Ue=/^\s*(?:\+?(\d{1,3}))?([-. (]*(\d{3})[-. )]*)?((\d{3})[-. ]*(\d{2,4})(?:[-.x ]*(\d+))?)\s*$/,ke=/(((http:\/\/www)|(http:\/\/)|(www))[-a-zA-Z0-9@:%_\\+.~#?&//=]+)\.(jpg|jpeg|gif|png|bmp|tiff|tga|svg)/i;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.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.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.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 l(e,t,o,r){var n=arguments.length,i=n<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,o):r,d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,o,r);else for(var u=e.length-1;u>=0;u--)(d=e[u])&&(i=(n<3?d(i):n>3?d(t,o,i):d(t,o))||i);return n>3&&i&&Object.defineProperty(t,o,i),i}s(l,"_ts_decorate");function f(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}s(f,"_ts_metadata");var y=class{static{s(this,"CreateOrganizationDto");}slug;identity;members;location};l([classValidator.IsOptional(),classValidator.IsString(),classValidator.Length(1,128),f("design:type",String)],y.prototype,"slug",void 0);l([classValidator.IsObject(),f("design:type",typeof g>"u"?Object:g)],y.prototype,"identity",void 0);l([classValidator.IsArray(),f("design:type",Array)],y.prototype,"members",void 0);l([classValidator.IsOptional(),classValidator.IsObject(),f("design:type",typeof Location>"u"?Object:Location)],y.prototype,"location",void 0);var g=class{static{s(this,"CreateOrganizationIdentityDto");}displayName;description;avatarUrl;bannerUrl;socialLinks};l([classValidator.IsString(),classValidator.IsNotEmpty(),classValidator.Length(1,32),f("design:type",String)],g.prototype,"displayName",void 0);l([classValidator.IsString(),classValidator.IsNotEmpty(),classValidator.Length(16,1024),f("design:type",String)],g.prototype,"description",void 0);l([classValidator.IsUrl({protocols:["http","https"]}),f("design:type",String)],g.prototype,"avatarUrl",void 0);l([classValidator.IsOptional(),classValidator.IsUrl({protocols:["http","https"]}),f("design:type",String)],g.prototype,"bannerUrl",void 0);l([classValidator.IsOptional(),classValidator.IsArray(),f("design:type",Array)],g.prototype,"socialLinks",void 0);var _=class{static{s(this,"OrganizationMemberDto");}user;role};l([classValidator.IsString(),classValidator.IsNotEmpty(),f("design:type",String)],_.prototype,"user",void 0);l([classValidator.IsEnum(exports.OrganizationMemberRole),classValidator.IsNotEmpty(),f("design:type",typeof exports.OrganizationMemberRole>"u"?Object:exports.OrganizationMemberRole)],_.prototype,"role",void 0);var K=class extends y{static{s(this,"UpdateOrganizationDto");}};var I=class{static{s(this,"CreateOrganizationEventDto");}slug;type;public;flyers;trailers;location;tickets;styles;startAt;endAt};var Q=class extends I{static{s(this,"UpdateOrganizationEventDto");}};var L=class{static{s(this,"CreateOrganizationEventTicketDto");}id;name;description;price;quantity;type;category;currency;isVisible;isFeesIncluded;startAt;endAt};var z=class extends L{static{s(this,"UpdateOrganizationEventTicketDto");}};var O=class{static{s(this,"CreateUserDto");}identifier;password;identity;addresses};var T=class{static{s(this,"SignInUserDto");}identifier;password};function a(e,t,o,r){var n=arguments.length,i=n<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,o):r,d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,o,r);else for(var u=e.length-1;u>=0;u--)(d=e[u])&&(i=(n<3?d(i):n>3?d(t,o,i):d(t,o))||i);return n>3&&i&&Object.defineProperty(t,o,i),i}s(a,"_ts_decorate");function p(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}s(p,"_ts_metadata");var A=class{static{s(this,"UpdateUserDto");}identifier;identity;password};a([classValidator.IsOptional(),classValidator.IsObject(),classValidator.ValidateNested(),classTransformer.Type(()=>w),p("design:type",typeof w>"u"?Object:w)],A.prototype,"identifier",void 0);a([classValidator.IsOptional(),classValidator.IsObject(),classValidator.ValidateNested(),classTransformer.Type(()=>m),p("design:type",typeof m>"u"?Object:m)],A.prototype,"identity",void 0);a([classValidator.IsOptional(),classValidator.IsString(),classValidator.MinLength(6),classValidator.MaxLength(130),p("design:type",String)],A.prototype,"password",void 0);var w=class{static{s(this,"UpdateIdentifierDto");}email;phoneNumber;username};a([classValidator.IsOptional(),classValidator.IsString(),classValidator.IsEmail(),p("design:type",String)],w.prototype,"email",void 0);a([classValidator.IsOptional(),classValidator.IsString(),classValidator.IsPhoneNumber(),p("design:type",String)],w.prototype,"phoneNumber",void 0);a([classValidator.IsOptional(),classValidator.IsString(),classValidator.MinLength(3),p("design:type",String)],w.prototype,"username",void 0);var m=class{static{s(this,"UpdateIdentityDto");}firstName;lastName;displayName;description;avatarUrl;bannerUrl;gender;birthDate};a([classValidator.IsOptional(),classValidator.IsString(),classValidator.Length(2,50),classValidator.Matches(D,{message:"First name must be composed of letters only"}),p("design:type",String)],m.prototype,"firstName",void 0);a([classValidator.IsOptional(),classValidator.IsString(),classValidator.Length(2,50),classValidator.Matches(D,{message:"Last name must be composed of letters only"}),p("design:type",String)],m.prototype,"lastName",void 0);a([classValidator.IsOptional(),classValidator.IsString(),classValidator.Length(1,32),p("design:type",String)],m.prototype,"displayName",void 0);a([classValidator.IsOptional(),classValidator.IsString(),classValidator.Length(15,500),p("design:type",String)],m.prototype,"description",void 0);a([classValidator.IsOptional(),classValidator.IsUrl(),p("design:type",Object)],m.prototype,"avatarUrl",void 0);a([classValidator.IsOptional(),classValidator.IsUrl(),p("design:type",Object)],m.prototype,"bannerUrl",void 0);a([classValidator.IsOptional(),p("design:type",String)],m.prototype,"gender",void 0);a([classValidator.IsOptional(),classValidator.IsDateString(),p("design:type",typeof Date>"u"?Object:Date)],m.prototype,"birthDate",void 0);var h=typeof window<"u";var ve=we__default.default.create({headers:{"Content-Type":"application/json",Accept:"application/json",...!h&&{"User-Agent":"tonightpass-api-client"}},responseType:"json",transformRequest:[function(e){return JSON.stringify(e)}],withCredentials:h}),ie=s(async(e,t)=>ve(e,{...t}).then(r=>r).catch(r=>{throw r.data}),"request");var G=class extends Error{static{s(this,"TonightPassAPIError");}response;data;status;constructor(t,o){super(o.message),this.response=t,this.data=o,this.status=t.status;}},k=class{static{s(this,"Client");}options;url;constructor(t){this.options=t,this.url=(o,r)=>{let n=this.options.baseURL||q;return pathcat.pathcat(n,o,r)};}setOptions(t){this.options=t;}async get(t,o,r){return this.requester("GET",t,void 0,o,r)}async post(t,o,r,n){return this.requester("POST",t,o,r,n)}async put(t,o,r,n){return this.requester("PUT",t,o,r,n)}async patch(t,o,r,n){return this.requester("PATCH",t,o,r,n)}async delete(t,o,r,n){return this.requester("DELETE",t,o,r,n)}async requester(t,o,r,n={},i={}){let d=this.url(o,n);if(r!==void 0&&t==="GET")throw new Error("Cannot send a GET request with a body");let u=await ie(d,{method:t,data:r,...i}),N=u.data;if(!N.success)throw new G(u,N);return N.data}};function v(e){return e}s(v,"sdk");var ae=e=>({signIn:async t=>e.post("/auth/sign-in",t),signUp:async t=>e.post("/auth/sign-up",t),signOut:async()=>e.post("/auth/sign-out",null),refreshToken:async()=>e.post("/auth/refresh-token",null),oauth2:{google:{connect:t=>{if(h)window.location.href=e.url("/oauth2/google",t||{});else throw new Error("Google OAuth2 is only available in the browser")}},twitter:{connect:t=>{if(h)window.location.href=e.url("/oauth2/twitter",t||{});else throw new Error("Twitter OAuth2 is only available in the browser")}}}});var pe=e=>({categories:{getAll:async t=>e.get("/careers/categories",t)},employmentTypes:{getAll:async t=>e.get("/careers/employmentTypes",t)},jobs:{getAll:async t=>e.get("/careers/jobs",t),get:async t=>e.get("/careers/jobs/:id",{id:t})},offices:{getAll:async t=>e.get("/careers/offices",t)}});var ce=e=>({getAll:async()=>e.get("/health"),database:async()=>e.get("/health/database"),http:async()=>e.get("/health/http")});var de=e=>({getAll:async()=>e.get("/organizations"),get:async t=>e.get("/organizations/:slug",{slug:t}),create:async t=>e.post("/organizations",t),update:async(t,o)=>e.put("/organizations/:slug",o,{slug:t}),delete:async t=>e.delete("/organizations/:slug",null,{slug:t}),members:{getAll:async()=>e.get("/organizations/members"),delete:async t=>e.delete("/organizations/members/:id",null,{id:t})},events:{getAll:async t=>e.get("/organizations/:organizationSlug/events",{organizationSlug:t}),get:async(t,o)=>e.get("/organizations/:organizationSlug/events/:eventSlug",{organizationSlug:t,eventSlug:o}),create:async(t,o)=>e.post("/organizations/:organizationSlug/events",o,{organizationSlug:t}),update:async(t,o,r)=>e.put("/organizations/:organizationSlug/events/:eventSlug",r,{organizationSlug:t,eventSlug:o}),delete:async(t,o)=>e.delete("/organizations/:organizationSlug/events/:eventSlug",null,{organizationSlug:t,eventSlug:o}),tickets:{getAll:async(t,o)=>e.get("/organizations/:slug/events/:eventSlug/tickets",{slug:t,eventSlug:o}),get:async(t,o,r)=>e.get("/organizations/:slug/events/:eventSlug/tickets/:ticketId",{slug:t,eventSlug:o,ticketId:r}),create:async(t,o,r)=>e.post("/organizations/:slug/events/:eventSlug/tickets",r,{slug:t,eventSlug:o}),update:async(t,o,r,n)=>e.put("/organizations/:slug/events/:eventSlug/tickets/:ticketId",n,{slug:t,eventSlug:o,ticketId:r}),delete:async(t,o,r)=>e.delete("/organizations/:slug/events/:eventSlug/tickets/:ticketId",null,{slug:t,eventSlug:o,ticketId:r})}},billing:{account:async t=>e.get("/organizations/:slug/billing/account",{slug:t}),link:t=>{if(h)window.location.href=e.url("/organizations/:slug/billing/link",{slug:t});else throw new Error("Billing link is only available in the browser")},dashboard:t=>{if(h)window.location.href=e.url("/organizations/:slug/billing/dashboard",{slug:t});else throw new Error("Billing dashboard is only available in the browser")}}});var le=e=>({get:async t=>e.get("/profiles/:username",{username:t})});var fe=e=>({getAll:async()=>e.get("/users"),get:async t=>e.get("/users",{id:t}),me:async()=>e.get("/users/me"),check:async(t,o)=>e.get("/users/check/:identifier",{identifier:t,suggestions:o}),update:async(t,o)=>e.put("/users/:id",o,{id:t})});var me=class{static{s(this,"TonightPass");}client;auth;careers;health;organizations;profiles;users;constructor(t){this.client=new k(t),this.auth=ae(this.client),this.careers=pe(this.client),this.health=ce(this.client),this.organizations=de(this.client),this.profiles=le(this.client),this.users=fe(this.client);}};
13
+ var be=Object.defineProperty;var s=(e,t)=>be(e,"name",{value:t,configurable:!0});var G="https://api.tonightpass.com";var Ue=/^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$/,Ne=/((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/,D=/(^[\p{L}\d'\\.\s\\-]*$)/u,De=/^[a-z\d]+(?:(\.|-|_)[a-z\d]+)*$/,Pe=/\$2[abxy]?\$\d{1,2}\$[A-Za-z\d\\./]{53}/,Ee=/^\s*(?:\+?(\d{1,3}))?([-. (]*(\d{3})[-. )]*)?((\d{3})[-. ]*(\d{2,4})(?:[-.x ]*(\d+))?)\s*$/,Ge=/(((http:\/\/www)|(http:\/\/)|(www))[-a-zA-Z0-9@:%_\\+.~#?&//=]+)\.(jpg|jpeg|gif|png|bmp|tiff|tga|svg)/i;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.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 d(e,t,o,r){var n=arguments.length,i=n<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,o):r,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,o,r);else for(var g=e.length-1;g>=0;g--)(l=e[g])&&(i=(n<3?l(i):n>3?l(t,o,i):l(t,o))||i);return n>3&&i&&Object.defineProperty(t,o,i),i}s(d,"_ts_decorate");function f(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}s(f,"_ts_metadata");var x=class{static{s(this,"CreateOrganizationDto");}slug;identity;members;location};d([classValidator.IsOptional(),classValidator.IsString(),classValidator.Length(1,128),f("design:type",String)],x.prototype,"slug",void 0);d([classValidator.IsObject(),f("design:type",typeof h>"u"?Object:h)],x.prototype,"identity",void 0);d([classValidator.IsArray(),f("design:type",Array)],x.prototype,"members",void 0);d([classValidator.IsOptional(),classValidator.IsObject(),f("design:type",typeof Location>"u"?Object:Location)],x.prototype,"location",void 0);var h=class{static{s(this,"CreateOrganizationIdentityDto");}displayName;description;avatarUrl;bannerUrl;socialLinks};d([classValidator.IsString(),classValidator.IsNotEmpty(),classValidator.Length(1,32),f("design:type",String)],h.prototype,"displayName",void 0);d([classValidator.IsString(),classValidator.IsNotEmpty(),classValidator.Length(16,1024),f("design:type",String)],h.prototype,"description",void 0);d([classValidator.IsUrl({protocols:["http","https"]}),f("design:type",String)],h.prototype,"avatarUrl",void 0);d([classValidator.IsOptional(),classValidator.IsUrl({protocols:["http","https"]}),f("design:type",String)],h.prototype,"bannerUrl",void 0);d([classValidator.IsOptional(),classValidator.IsArray(),f("design:type",Array)],h.prototype,"socialLinks",void 0);var _=class{static{s(this,"OrganizationMemberDto");}user;role};d([classValidator.IsString(),classValidator.IsNotEmpty(),f("design:type",String)],_.prototype,"user",void 0);d([classValidator.IsEnum(exports.OrganizationMemberRole),classValidator.IsNotEmpty(),f("design:type",typeof exports.OrganizationMemberRole>"u"?Object:exports.OrganizationMemberRole)],_.prototype,"role",void 0);var J=class extends x{static{s(this,"UpdateOrganizationDto");}};var j=class{static{s(this,"CreateOrganizationEventDto");}title;description;organization;type;public;flyers;trailers;location;tickets;styles;startAt;endAt};var K=class extends j{static{s(this,"UpdateOrganizationEventDto");}};var I=class{static{s(this,"CreateOrganizationEventTicketDto");}name;description;price;quantity;type;category;currency;isVisible;isFeesIncluded;startAt;endAt};var Q=class extends I{static{s(this,"UpdateOrganizationEventTicketDto");}};var O=class{static{s(this,"CreateUserDto");}identifier;password;identity;addresses};var T=class{static{s(this,"SignInUserDto");}identifier;password};function a(e,t,o,r){var n=arguments.length,i=n<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,o):r,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,o,r);else for(var g=e.length-1;g>=0;g--)(l=e[g])&&(i=(n<3?l(i):n>3?l(t,o,i):l(t,o))||i);return n>3&&i&&Object.defineProperty(t,o,i),i}s(a,"_ts_decorate");function p(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}s(p,"_ts_metadata");var A=class{static{s(this,"UpdateUserDto");}identifier;identity;password};a([classValidator.IsOptional(),classValidator.IsObject(),classValidator.ValidateNested(),classTransformer.Type(()=>v),p("design:type",typeof v>"u"?Object:v)],A.prototype,"identifier",void 0);a([classValidator.IsOptional(),classValidator.IsObject(),classValidator.ValidateNested(),classTransformer.Type(()=>m),p("design:type",typeof m>"u"?Object:m)],A.prototype,"identity",void 0);a([classValidator.IsOptional(),classValidator.IsString(),classValidator.MinLength(6),classValidator.MaxLength(130),p("design:type",String)],A.prototype,"password",void 0);var v=class{static{s(this,"UpdateIdentifierDto");}email;phoneNumber;username};a([classValidator.IsOptional(),classValidator.IsString(),classValidator.IsEmail(),p("design:type",String)],v.prototype,"email",void 0);a([classValidator.IsOptional(),classValidator.IsString(),classValidator.IsPhoneNumber(),p("design:type",String)],v.prototype,"phoneNumber",void 0);a([classValidator.IsOptional(),classValidator.IsString(),classValidator.MinLength(3),p("design:type",String)],v.prototype,"username",void 0);var m=class{static{s(this,"UpdateIdentityDto");}firstName;lastName;displayName;description;avatarUrl;bannerUrl;gender;birthDate};a([classValidator.IsOptional(),classValidator.IsString(),classValidator.Length(2,50),classValidator.Matches(D,{message:"First name must be composed of letters only"}),p("design:type",String)],m.prototype,"firstName",void 0);a([classValidator.IsOptional(),classValidator.IsString(),classValidator.Length(2,50),classValidator.Matches(D,{message:"Last name must be composed of letters only"}),p("design:type",String)],m.prototype,"lastName",void 0);a([classValidator.IsOptional(),classValidator.IsString(),classValidator.Length(1,32),p("design:type",String)],m.prototype,"displayName",void 0);a([classValidator.IsOptional(),classValidator.IsString(),classValidator.Length(15,500),p("design:type",String)],m.prototype,"description",void 0);a([classValidator.IsOptional(),classValidator.IsUrl(),p("design:type",Object)],m.prototype,"avatarUrl",void 0);a([classValidator.IsOptional(),classValidator.IsUrl(),p("design:type",Object)],m.prototype,"bannerUrl",void 0);a([classValidator.IsOptional(),p("design:type",String)],m.prototype,"gender",void 0);a([classValidator.IsOptional(),classValidator.IsDateString(),p("design:type",typeof Date>"u"?Object:Date)],m.prototype,"birthDate",void 0);var y=typeof window<"u";var ke=Se__default.default.create({headers:{"Content-Type":"application/json",Accept:"application/json",...!y&&{"User-Agent":"tonightpass-api-client"}},responseType:"json",transformRequest:[function(e){return JSON.stringify(e)}],withCredentials:y}),ie=s(async(e,t)=>ke(e,{...t}).then(r=>r).catch(r=>{throw r.data}),"request");var E=class extends Error{static{s(this,"TonightPassAPIError");}response;data;status;constructor(t,o){super(o.message),this.response=t,this.data=o,this.status=t.status;}},U=class{static{s(this,"Client");}options;url;constructor(t){this.options=t,this.url=(o,r)=>{let n=this.options.baseURL||G;return pathcat.pathcat(n,o,r)};}setOptions(t){this.options=t;}async get(t,o,r){return this.requester("GET",t,void 0,o,r)}async post(t,o,r,n){return this.requester("POST",t,o,r,n)}async put(t,o,r,n){return this.requester("PUT",t,o,r,n)}async patch(t,o,r,n){return this.requester("PATCH",t,o,r,n)}async delete(t,o,r,n){return this.requester("DELETE",t,o,r,n)}async requester(t,o,r,n={},i={}){let l=this.url(o,n);if(r!==void 0&&t==="GET")throw new Error("Cannot send a GET request with a body");let g=await ie(l,{method:t,data:r,...i}),N=g.data;if(!N.success)throw new E(g,N);return N.data}};function u(e){return e}s(u,"sdk");var ae=e=>({signIn:async t=>e.post("/auth/sign-in",t),signUp:async t=>e.post("/auth/sign-up",t),signOut:async()=>e.post("/auth/sign-out",null),refreshToken:async()=>e.post("/auth/refresh-token",null),oauth2:{google:{connect:t=>{if(y)window.location.href=e.url("/oauth2/google",t||{});else throw new Error("Google OAuth2 is only available in the browser")}},twitter:{connect:t=>{if(y)window.location.href=e.url("/oauth2/twitter",t||{});else throw new Error("Twitter OAuth2 is only available in the browser")}}}});var pe=e=>({categories:{getAll:async t=>e.get("/careers/categories",t)},employmentTypes:{getAll:async t=>e.get("/careers/employmentTypes",t)},jobs:{getAll:async t=>e.get("/careers/jobs",t),get:async t=>e.get("/careers/jobs/:id",{id:t})},offices:{getAll:async t=>e.get("/careers/offices",t)}});var ce=e=>({getAll:async()=>e.get("/health"),database:async()=>e.get("/health/database"),http:async()=>e.get("/health/http")});var le=e=>({account:async t=>e.get("/organizations/:slug/billing/account",{slug:t}),link:t=>{if(y)window.location.href=e.url("/organizations/:slug/billing/link",{slug:t});else throw new Error("Billing link is only available in the browser")},dashboard:t=>{if(y)window.location.href=e.url("/organizations/:slug/billing/dashboard",{slug:t});else throw new Error("Billing dashboard is only available in the browser")}});var de=e=>({getAll:async()=>e.get("/organizations/events/styles"),get:async t=>e.get("/organizations/events/styles/:slug",{slug:t}),create:async t=>e.post("/organizations/events/styles",t),update:async(t,o)=>e.put("/organizations/events/styles/:slug",o,{slug:t}),delete:async t=>e.delete("/organizations/events/styles/:slug",null,{slug:t})});var fe=e=>({getAll:async(t,o)=>e.get("/organizations/:slug/events/:eventSlug/tickets",{slug:t,eventSlug:o}),get:async(t,o,r)=>e.get("/organizations/:slug/events/:eventSlug/tickets/:ticketId",{slug:t,eventSlug:o,ticketId:r}),create:async(t,o,r)=>e.post("/organizations/:slug/events/:eventSlug/tickets",r,{slug:t,eventSlug:o}),update:async(t,o,r,n)=>e.put("/organizations/:slug/events/:eventSlug/tickets/:ticketId",n,{slug:t,eventSlug:o,ticketId:r}),delete:async(t,o,r)=>e.delete("/organizations/:slug/events/:eventSlug/tickets/:ticketId",null,{slug:t,eventSlug:o,ticketId:r})});var me=e=>({getAll:async t=>e.get("/organizations/:organizationSlug/events",{organizationSlug:t}),get:async(t,o)=>e.get("/organizations/:organizationSlug/events/:eventSlug",{organizationSlug:t,eventSlug:o}),create:async(t,o)=>e.post("/organizations/:organizationSlug/events",o,{organizationSlug:t}),update:async(t,o,r)=>e.put("/organizations/:organizationSlug/events/:eventSlug",r,{organizationSlug:t,eventSlug:o}),delete:async(t,o)=>e.delete("/organizations/:organizationSlug/events/:eventSlug",null,{organizationSlug:t,eventSlug:o}),styles:de,tickets:fe});var ue=e=>({getAll:async()=>e.get("/organizations/members"),delete:async t=>e.delete("/organizations/members/:id",null,{id:t})});var ge=e=>({getAll:async()=>e.get("/organizations"),get:async t=>e.get("/organizations/:slug",{slug:t}),create:async t=>e.post("/organizations",t),update:async(t,o)=>e.put("/organizations/:slug",o,{slug:t}),delete:async t=>e.delete("/organizations/:slug",null,{slug:t}),billing:le,events:me,members:ue});var he=e=>({get:async t=>e.get("/profiles/:username",{username:t})});var ye=e=>({getAll:async()=>e.get("/users"),get:async t=>e.get("/users",{id:t}),me:async()=>e.get("/users/me"),check:async(t,o)=>e.get("/users/check/:identifier",{identifier:t,suggestions:o}),update:async(t,o)=>e.put("/users/:id",o,{id:t})});var xe=class{static{s(this,"TonightPass");}client;auth;careers;health;organizations;profiles;users;constructor(t){this.client=new U(t),this.auth=ae(this.client),this.careers=pe(this.client),this.health=ce(this.client),this.organizations=ge(this.client),this.profiles=he(this.client),this.users=ye(this.client);}};
14
14
 
15
- exports.BCRYPT_HASH = Le;
16
- exports.Client = k;
17
- exports.CreateOrganizationDto = y;
18
- exports.CreateOrganizationEventDto = I;
19
- exports.CreateOrganizationEventTicketDto = L;
20
- exports.CreateOrganizationIdentityDto = g;
15
+ exports.BCRYPT_HASH = Pe;
16
+ exports.Client = U;
17
+ exports.CreateOrganizationDto = x;
18
+ exports.CreateOrganizationEventDto = j;
19
+ exports.CreateOrganizationEventTicketDto = I;
20
+ exports.CreateOrganizationIdentityDto = h;
21
21
  exports.CreateUserDto = O;
22
- exports.DEFAULT_API_URL = q;
23
- exports.EMAIL_REGEX = Se;
24
- exports.IMAGE_URL_REGEX = ke;
22
+ exports.DEFAULT_API_URL = G;
23
+ exports.EMAIL_REGEX = Ue;
24
+ exports.IMAGE_URL_REGEX = Ge;
25
25
  exports.NAME_REGEX = D;
26
26
  exports.OrganizationMemberDto = _;
27
- exports.PASSWORD_REGEX = je;
28
- exports.PHONE_NUMBER_REGEX = Ue;
29
- exports.SLUG_REGEX = Ie;
27
+ exports.PASSWORD_REGEX = Ne;
28
+ exports.PHONE_NUMBER_REGEX = Ee;
29
+ exports.SLUG_REGEX = De;
30
30
  exports.SignInUserDto = T;
31
- exports.TonightPass = me;
32
- exports.TonightPassAPIError = G;
33
- exports.UpdateOrganizationDto = K;
34
- exports.UpdateOrganizationEventDto = Q;
35
- exports.UpdateOrganizationEventTicketDto = z;
31
+ exports.TonightPass = xe;
32
+ exports.TonightPassAPIError = E;
33
+ exports.UpdateOrganizationDto = J;
34
+ exports.UpdateOrganizationEventDto = K;
35
+ exports.UpdateOrganizationEventTicketDto = Q;
36
36
  exports.UpdateUserDto = A;
37
37
  exports.auth = ae;
38
38
  exports.careers = pe;
39
39
  exports.health = ce;
40
- exports.isBrowser = h;
41
- exports.organizations = de;
42
- exports.profiles = le;
40
+ exports.isBrowser = y;
41
+ exports.organizations = ge;
42
+ exports.profiles = he;
43
43
  exports.request = ie;
44
- exports.sdk = v;
45
- exports.users = fe;
44
+ exports.sdk = u;
45
+ exports.users = ye;
46
46
  //# sourceMappingURL=out.js.map
47
47
  //# sourceMappingURL=index.js.map