tonightpass 0.0.26 → 0.0.27

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.27 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
+ ESM dist/index.mjs 13.26 KB
13
+ ESM dist/index.mjs.map 46.09 KB
14
+ ESM ⚡️ Build success in 388ms
15
+ CJS dist/index.js 15.12 KB
16
+ CJS dist/index.js.map 46.09 KB
17
+ CJS ⚡️ Build success in 389ms
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 3816ms
20
+ DTS dist/index.d.ts 35.77 KB
21
+ DTS dist/index.d.mts 35.77 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # tonightpass
2
2
 
3
+ ## 0.0.27
4
+
5
+ ### Patch Changes
6
+
7
+ - [#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
8
+
3
9
  ## 0.0.26
4
10
 
5
11
  ### 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;
@@ -634,6 +645,12 @@ declare class Client {
634
645
  }> | Extract<Endpoint<"GET", "/organizations/:organizationSlug/events/:eventSlug", Event>, {
635
646
  path: Path;
636
647
  method: "GET";
648
+ }> | Extract<Endpoint<"GET", "/organizations/events/styles", OrganizationEventStyle[]>, {
649
+ path: Path;
650
+ method: "GET";
651
+ }> | Extract<Endpoint<"GET", "/organizations/events/styles/:slug", OrganizationEventStyle>, {
652
+ path: Path;
653
+ method: "GET";
637
654
  }> | Extract<Endpoint<"GET", "/organizations/:slug/events/:eventSlug/tickets", OrganizationEventTicket[]>, {
638
655
  path: Path;
639
656
  method: "GET";
@@ -694,6 +711,9 @@ declare class Client {
694
711
  }> | Extract<Endpoint<"POST", "/organizations/:organizationSlug/events", Event, CreateOrganizationEventDto>, {
695
712
  path: Path;
696
713
  method: "POST";
714
+ }> | Extract<Endpoint<"POST", "/organizations/events/styles", OrganizationEventStyle, CreateOrganizationEventStyleDto>, {
715
+ path: Path;
716
+ method: "POST";
697
717
  }> | Extract<Endpoint<"POST", "/organizations/:slug/events/:eventSlug/tickets", OrganizationEventTicket, CreateOrganizationEventTicketDto>, {
698
718
  path: Path;
699
719
  method: "POST";
@@ -712,6 +732,9 @@ declare class Client {
712
732
  }> | Extract<Endpoint<"PUT", "/organizations/:organizationSlug/events/:eventSlug", Event, UpdateOrganizationEventDto>, {
713
733
  path: Path;
714
734
  method: "PUT";
735
+ }> | Extract<Endpoint<"PUT", "/organizations/events/styles/:slug", OrganizationEventStyle, UpdateOrganizationEventStyleDto>, {
736
+ path: Path;
737
+ method: "PUT";
715
738
  }> | Extract<Endpoint<"PUT", "/organizations/:slug/events/:eventSlug/tickets/:ticketId", OrganizationEventTicket, UpdateOrganizationEventTicketDto>, {
716
739
  path: Path;
717
740
  method: "PUT";
@@ -739,6 +762,9 @@ declare class Client {
739
762
  }> | Extract<Endpoint<"DELETE", "/organizations/:organizationSlug/events/:eventSlug", Event, null>, {
740
763
  path: Path;
741
764
  method: "DELETE";
765
+ }> | Extract<Endpoint<"DELETE", "/organizations/events/styles/:slug", OrganizationEventStyle[], null>, {
766
+ path: Path;
767
+ method: "DELETE";
742
768
  }> | Extract<Endpoint<"DELETE", "/organizations/:slug/events/:eventSlug/tickets/:ticketId", OrganizationEventTicket[], null>, {
743
769
  path: Path;
744
770
  method: "DELETE";
@@ -797,17 +823,25 @@ declare const organizations: (client: Client) => {
797
823
  create: (data: CreateOrganizationDto) => Promise<Organization>;
798
824
  update: (slug: string, data: UpdateOrganizationDto) => Promise<Organization>;
799
825
  delete: (slug: string) => Promise<Organization>;
800
- members: {
801
- getAll: () => Promise<OrganizationMember[]>;
802
- delete: (id: string) => Promise<OrganizationMember[]>;
826
+ billing: (client: Client) => {
827
+ account: (slug: string) => Promise<stripe.Stripe.Account>;
828
+ link: (slug: string) => void;
829
+ dashboard: (slug: string) => void;
803
830
  };
804
- events: {
831
+ events: (client: Client) => {
805
832
  getAll: (organizationSlug: string) => Promise<Event[]>;
806
833
  get: (organizationSlug: string, eventSlug: string) => Promise<Event>;
807
834
  create: (organizationSlug: string, data: CreateOrganizationEventDto) => Promise<Event>;
808
- update: (organizationSlug: string, eventSlug: string, data: CreateOrganizationEventDto) => Promise<Event>;
835
+ update: (organizationSlug: string, eventSlug: string, data: UpdateOrganizationEventDto) => Promise<Event>;
809
836
  delete: (organizationSlug: string, eventSlug: string) => Promise<Event>;
810
- tickets: {
837
+ styles: (client: Client) => {
838
+ getAll: () => Promise<OrganizationEventStyle[]>;
839
+ get: (slug: string) => Promise<OrganizationEventStyle>;
840
+ create: (data: CreateOrganizationEventStyleDto) => Promise<OrganizationEventStyle>;
841
+ update: (slug: string, data: UpdateOrganizationEventStyleDto) => Promise<OrganizationEventStyle>;
842
+ delete: (slug: string) => Promise<OrganizationEventStyle[]>;
843
+ };
844
+ tickets: (client: Client) => {
811
845
  getAll: (slug: string, eventSlug: string) => Promise<OrganizationEventTicket[]>;
812
846
  get: (slug: string, eventSlug: string, ticketId: string) => Promise<OrganizationEventTicket>;
813
847
  create: (slug: string, eventSlug: string, data: CreateOrganizationEventTicketDto) => Promise<OrganizationEventTicket>;
@@ -815,10 +849,9 @@ declare const organizations: (client: Client) => {
815
849
  delete: (slug: string, eventSlug: string, ticketId: string) => Promise<OrganizationEventTicket[]>;
816
850
  };
817
851
  };
818
- billing: {
819
- account: (slug: string) => Promise<stripe.Stripe.Account>;
820
- link: (slug: string) => void;
821
- dashboard: (slug: string) => void;
852
+ members: (client: Client) => {
853
+ getAll: () => Promise<OrganizationMember[]>;
854
+ delete: (id: string) => Promise<OrganizationMember[]>;
822
855
  };
823
856
  };
824
857
 
@@ -880,17 +913,25 @@ declare class TonightPass {
880
913
  create: (data: CreateOrganizationDto) => Promise<Organization>;
881
914
  update: (slug: string, data: UpdateOrganizationDto) => Promise<Organization>;
882
915
  delete: (slug: string) => Promise<Organization>;
883
- members: {
884
- getAll: () => Promise<OrganizationMember[]>;
885
- delete: (id: string) => Promise<OrganizationMember[]>;
916
+ billing: (client: Client) => {
917
+ account: (slug: string) => Promise<stripe.Stripe.Account>;
918
+ link: (slug: string) => void;
919
+ dashboard: (slug: string) => void;
886
920
  };
887
- events: {
921
+ events: (client: Client) => {
888
922
  getAll: (organizationSlug: string) => Promise<Event[]>;
889
923
  get: (organizationSlug: string, eventSlug: string) => Promise<Event>;
890
924
  create: (organizationSlug: string, data: CreateOrganizationEventDto) => Promise<Event>;
891
- update: (organizationSlug: string, eventSlug: string, data: CreateOrganizationEventDto) => Promise<Event>;
925
+ update: (organizationSlug: string, eventSlug: string, data: UpdateOrganizationEventDto) => Promise<Event>;
892
926
  delete: (organizationSlug: string, eventSlug: string) => Promise<Event>;
893
- tickets: {
927
+ styles: (client: Client) => {
928
+ getAll: () => Promise<OrganizationEventStyle[]>;
929
+ get: (slug: string) => Promise<OrganizationEventStyle>;
930
+ create: (data: CreateOrganizationEventStyleDto) => Promise<OrganizationEventStyle>;
931
+ update: (slug: string, data: UpdateOrganizationEventStyleDto) => Promise<OrganizationEventStyle>;
932
+ delete: (slug: string) => Promise<OrganizationEventStyle[]>;
933
+ };
934
+ tickets: (client: Client) => {
894
935
  getAll: (slug: string, eventSlug: string) => Promise<OrganizationEventTicket[]>;
895
936
  get: (slug: string, eventSlug: string, ticketId: string) => Promise<OrganizationEventTicket>;
896
937
  create: (slug: string, eventSlug: string, data: CreateOrganizationEventTicketDto) => Promise<OrganizationEventTicket>;
@@ -898,10 +939,9 @@ declare class TonightPass {
898
939
  delete: (slug: string, eventSlug: string, ticketId: string) => Promise<OrganizationEventTicket[]>;
899
940
  };
900
941
  };
901
- billing: {
902
- account: (slug: string) => Promise<stripe.Stripe.Account>;
903
- link: (slug: string) => void;
904
- dashboard: (slug: string) => void;
942
+ members: (client: Client) => {
943
+ getAll: () => Promise<OrganizationMember[]>;
944
+ delete: (id: string) => Promise<OrganizationMember[]>;
905
945
  };
906
946
  };
907
947
  readonly profiles: {
@@ -923,4 +963,4 @@ declare class TonightPass {
923
963
 
924
964
  declare const isBrowser: boolean;
925
965
 
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 };
966
+ 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;
@@ -634,6 +645,12 @@ declare class Client {
634
645
  }> | Extract<Endpoint<"GET", "/organizations/:organizationSlug/events/:eventSlug", Event>, {
635
646
  path: Path;
636
647
  method: "GET";
648
+ }> | Extract<Endpoint<"GET", "/organizations/events/styles", OrganizationEventStyle[]>, {
649
+ path: Path;
650
+ method: "GET";
651
+ }> | Extract<Endpoint<"GET", "/organizations/events/styles/:slug", OrganizationEventStyle>, {
652
+ path: Path;
653
+ method: "GET";
637
654
  }> | Extract<Endpoint<"GET", "/organizations/:slug/events/:eventSlug/tickets", OrganizationEventTicket[]>, {
638
655
  path: Path;
639
656
  method: "GET";
@@ -694,6 +711,9 @@ declare class Client {
694
711
  }> | Extract<Endpoint<"POST", "/organizations/:organizationSlug/events", Event, CreateOrganizationEventDto>, {
695
712
  path: Path;
696
713
  method: "POST";
714
+ }> | Extract<Endpoint<"POST", "/organizations/events/styles", OrganizationEventStyle, CreateOrganizationEventStyleDto>, {
715
+ path: Path;
716
+ method: "POST";
697
717
  }> | Extract<Endpoint<"POST", "/organizations/:slug/events/:eventSlug/tickets", OrganizationEventTicket, CreateOrganizationEventTicketDto>, {
698
718
  path: Path;
699
719
  method: "POST";
@@ -712,6 +732,9 @@ declare class Client {
712
732
  }> | Extract<Endpoint<"PUT", "/organizations/:organizationSlug/events/:eventSlug", Event, UpdateOrganizationEventDto>, {
713
733
  path: Path;
714
734
  method: "PUT";
735
+ }> | Extract<Endpoint<"PUT", "/organizations/events/styles/:slug", OrganizationEventStyle, UpdateOrganizationEventStyleDto>, {
736
+ path: Path;
737
+ method: "PUT";
715
738
  }> | Extract<Endpoint<"PUT", "/organizations/:slug/events/:eventSlug/tickets/:ticketId", OrganizationEventTicket, UpdateOrganizationEventTicketDto>, {
716
739
  path: Path;
717
740
  method: "PUT";
@@ -739,6 +762,9 @@ declare class Client {
739
762
  }> | Extract<Endpoint<"DELETE", "/organizations/:organizationSlug/events/:eventSlug", Event, null>, {
740
763
  path: Path;
741
764
  method: "DELETE";
765
+ }> | Extract<Endpoint<"DELETE", "/organizations/events/styles/:slug", OrganizationEventStyle[], null>, {
766
+ path: Path;
767
+ method: "DELETE";
742
768
  }> | Extract<Endpoint<"DELETE", "/organizations/:slug/events/:eventSlug/tickets/:ticketId", OrganizationEventTicket[], null>, {
743
769
  path: Path;
744
770
  method: "DELETE";
@@ -797,17 +823,25 @@ declare const organizations: (client: Client) => {
797
823
  create: (data: CreateOrganizationDto) => Promise<Organization>;
798
824
  update: (slug: string, data: UpdateOrganizationDto) => Promise<Organization>;
799
825
  delete: (slug: string) => Promise<Organization>;
800
- members: {
801
- getAll: () => Promise<OrganizationMember[]>;
802
- delete: (id: string) => Promise<OrganizationMember[]>;
826
+ billing: (client: Client) => {
827
+ account: (slug: string) => Promise<stripe.Stripe.Account>;
828
+ link: (slug: string) => void;
829
+ dashboard: (slug: string) => void;
803
830
  };
804
- events: {
831
+ events: (client: Client) => {
805
832
  getAll: (organizationSlug: string) => Promise<Event[]>;
806
833
  get: (organizationSlug: string, eventSlug: string) => Promise<Event>;
807
834
  create: (organizationSlug: string, data: CreateOrganizationEventDto) => Promise<Event>;
808
- update: (organizationSlug: string, eventSlug: string, data: CreateOrganizationEventDto) => Promise<Event>;
835
+ update: (organizationSlug: string, eventSlug: string, data: UpdateOrganizationEventDto) => Promise<Event>;
809
836
  delete: (organizationSlug: string, eventSlug: string) => Promise<Event>;
810
- tickets: {
837
+ styles: (client: Client) => {
838
+ getAll: () => Promise<OrganizationEventStyle[]>;
839
+ get: (slug: string) => Promise<OrganizationEventStyle>;
840
+ create: (data: CreateOrganizationEventStyleDto) => Promise<OrganizationEventStyle>;
841
+ update: (slug: string, data: UpdateOrganizationEventStyleDto) => Promise<OrganizationEventStyle>;
842
+ delete: (slug: string) => Promise<OrganizationEventStyle[]>;
843
+ };
844
+ tickets: (client: Client) => {
811
845
  getAll: (slug: string, eventSlug: string) => Promise<OrganizationEventTicket[]>;
812
846
  get: (slug: string, eventSlug: string, ticketId: string) => Promise<OrganizationEventTicket>;
813
847
  create: (slug: string, eventSlug: string, data: CreateOrganizationEventTicketDto) => Promise<OrganizationEventTicket>;
@@ -815,10 +849,9 @@ declare const organizations: (client: Client) => {
815
849
  delete: (slug: string, eventSlug: string, ticketId: string) => Promise<OrganizationEventTicket[]>;
816
850
  };
817
851
  };
818
- billing: {
819
- account: (slug: string) => Promise<stripe.Stripe.Account>;
820
- link: (slug: string) => void;
821
- dashboard: (slug: string) => void;
852
+ members: (client: Client) => {
853
+ getAll: () => Promise<OrganizationMember[]>;
854
+ delete: (id: string) => Promise<OrganizationMember[]>;
822
855
  };
823
856
  };
824
857
 
@@ -880,17 +913,25 @@ declare class TonightPass {
880
913
  create: (data: CreateOrganizationDto) => Promise<Organization>;
881
914
  update: (slug: string, data: UpdateOrganizationDto) => Promise<Organization>;
882
915
  delete: (slug: string) => Promise<Organization>;
883
- members: {
884
- getAll: () => Promise<OrganizationMember[]>;
885
- delete: (id: string) => Promise<OrganizationMember[]>;
916
+ billing: (client: Client) => {
917
+ account: (slug: string) => Promise<stripe.Stripe.Account>;
918
+ link: (slug: string) => void;
919
+ dashboard: (slug: string) => void;
886
920
  };
887
- events: {
921
+ events: (client: Client) => {
888
922
  getAll: (organizationSlug: string) => Promise<Event[]>;
889
923
  get: (organizationSlug: string, eventSlug: string) => Promise<Event>;
890
924
  create: (organizationSlug: string, data: CreateOrganizationEventDto) => Promise<Event>;
891
- update: (organizationSlug: string, eventSlug: string, data: CreateOrganizationEventDto) => Promise<Event>;
925
+ update: (organizationSlug: string, eventSlug: string, data: UpdateOrganizationEventDto) => Promise<Event>;
892
926
  delete: (organizationSlug: string, eventSlug: string) => Promise<Event>;
893
- tickets: {
927
+ styles: (client: Client) => {
928
+ getAll: () => Promise<OrganizationEventStyle[]>;
929
+ get: (slug: string) => Promise<OrganizationEventStyle>;
930
+ create: (data: CreateOrganizationEventStyleDto) => Promise<OrganizationEventStyle>;
931
+ update: (slug: string, data: UpdateOrganizationEventStyleDto) => Promise<OrganizationEventStyle>;
932
+ delete: (slug: string) => Promise<OrganizationEventStyle[]>;
933
+ };
934
+ tickets: (client: Client) => {
894
935
  getAll: (slug: string, eventSlug: string) => Promise<OrganizationEventTicket[]>;
895
936
  get: (slug: string, eventSlug: string, ticketId: string) => Promise<OrganizationEventTicket>;
896
937
  create: (slug: string, eventSlug: string, data: CreateOrganizationEventTicketDto) => Promise<OrganizationEventTicket>;
@@ -898,10 +939,9 @@ declare class TonightPass {
898
939
  delete: (slug: string, eventSlug: string, ticketId: string) => Promise<OrganizationEventTicket[]>;
899
940
  };
900
941
  };
901
- billing: {
902
- account: (slug: string) => Promise<stripe.Stripe.Account>;
903
- link: (slug: string) => void;
904
- dashboard: (slug: string) => void;
942
+ members: (client: Client) => {
943
+ getAll: () => Promise<OrganizationMember[]>;
944
+ delete: (id: string) => Promise<OrganizationMember[]>;
905
945
  };
906
946
  };
907
947
  readonly profiles: {
@@ -923,4 +963,4 @@ declare class TonightPass {
923
963
 
924
964
  declare const isBrowser: boolean;
925
965
 
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 };
966
+ 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");}slug;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