tonightpass 0.0.44 → 0.0.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +10 -10
- package/CHANGELOG.md +12 -0
- package/dist/index.d.mts +80 -10
- package/dist/index.d.ts +80 -10
- package/dist/index.js +7 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -2
- package/src/rest/types/index.ts +71 -0
- package/src/rest/types/organizations/events/index.ts +29 -2
- package/src/rest/types/organizations/members/index.ts +13 -3
- package/src/sdk/organizations/events/index.ts +3 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> tonightpass@0.0.
|
|
2
|
+
> tonightpass@0.0.46 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 @@ CLI Using tsup config: /home/runner/work/tonightpass/tonightpass/packages/node/t
|
|
|
9
9
|
CLI Target: esnext
|
|
10
10
|
CJS Build start
|
|
11
11
|
ESM Build start
|
|
12
|
-
ESM dist/index.mjs 19.52 KB
|
|
13
|
-
ESM dist/index.mjs.map 49.06 KB
|
|
14
|
-
ESM ⚡️ Build success in 459ms
|
|
15
|
-
CJS dist/index.js 22.81 KB
|
|
16
|
-
CJS dist/index.js.map 49.06 KB
|
|
17
|
-
CJS ⚡️ Build success in 460ms
|
|
18
12
|
DTS Build start
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
13
|
+
CJS dist/index.js 22.90 KB
|
|
14
|
+
CJS dist/index.js.map 51.29 KB
|
|
15
|
+
CJS ⚡️ Build success in 487ms
|
|
16
|
+
ESM dist/index.mjs 19.61 KB
|
|
17
|
+
ESM dist/index.mjs.map 51.29 KB
|
|
18
|
+
ESM ⚡️ Build success in 488ms
|
|
19
|
+
DTS ⚡️ Build success in 3503ms
|
|
20
|
+
DTS dist/index.d.ts 38.95 KB
|
|
21
|
+
DTS dist/index.d.mts 38.95 KB
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# tonightpass
|
|
2
2
|
|
|
3
|
+
## 0.0.46
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`6a67f86`](https://github.com/tonightpass/tonightpass/commit/6a67f8664fd3d0ca019e88825102add5a9e43e35) Thanks [@AntoineKM](https://github.com/AntoineKM)! - Rename data property to items in ArrayResult type
|
|
8
|
+
|
|
9
|
+
## 0.0.45
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`f4b07ea`](https://github.com/tonightpass/tonightpass/commit/f4b07ea8c8c47f48eda65ec7aef06e3e7e532b4b) Thanks [@AntoineKM](https://github.com/AntoineKM)! - Add array options and event listing
|
|
14
|
+
|
|
3
15
|
## 0.0.44
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -3,6 +3,7 @@ import { ParamValue, Query } from 'pathcat';
|
|
|
3
3
|
export * from 'pathcat';
|
|
4
4
|
import * as stripe from 'stripe';
|
|
5
5
|
import stripe__default from 'stripe';
|
|
6
|
+
import { Populate } from '@mikro-orm/core';
|
|
6
7
|
import { Options, Response } from 'redaxios';
|
|
7
8
|
|
|
8
9
|
declare const DEFAULT_API_URL = "https://api.tonightpass.com";
|
|
@@ -288,7 +289,11 @@ declare enum OrganizationEventVisibilityType {
|
|
|
288
289
|
Unlisted = "unlisted",
|
|
289
290
|
Private = "private"
|
|
290
291
|
}
|
|
291
|
-
type OrganizationEventEndpoints = Endpoint<"GET", "/organizations
|
|
292
|
+
type OrganizationEventEndpoints = Endpoint<"GET", "/organizations/events", ArrayResult<OrganizationEvent>, ArrayOptions<OrganizationEvent>> | Endpoint<"GET", "/organizations/events/suggestions", ArrayResult<OrganizationEvent>, ArrayOptions<OrganizationEvent>> | Endpoint<"GET", "/organizations/events/nearby", ArrayResult<OrganizationEvent>, ArrayOptions<OrganizationEvent> & {
|
|
293
|
+
latitude: number;
|
|
294
|
+
longitude: number;
|
|
295
|
+
radius?: number;
|
|
296
|
+
}> | Endpoint<"GET", "/organizations/:slug/events", ArrayResult<OrganizationEvent>, ArrayOptions<OrganizationEvent>> | Endpoint<"GET", "/organizations/:organizationSlug/events/:eventSlug", OrganizationEvent> | Endpoint<"POST", "/organizations/:slug/events", OrganizationEvent, CreateOrganizationEventDto> | Endpoint<"PUT", "/organizations/:organizationSlug/events/:eventSlug", OrganizationEvent, UpdateOrganizationEventDto> | Endpoint<"DELETE", "/organizations/:organizationSlug/events/:eventSlug", OrganizationEvent, null> | OrganizationEventStyleEndpoints | OrganizationEventTicketEndpoints;
|
|
292
297
|
|
|
293
298
|
declare class UpdateOrganizationMemberDto {
|
|
294
299
|
role: OrganizationMemberRole;
|
|
@@ -328,7 +333,7 @@ declare enum OrganizationMemberRole {
|
|
|
328
333
|
Admin = "admin",
|
|
329
334
|
Owner = "owner"
|
|
330
335
|
}
|
|
331
|
-
type OrganizationMembersEndpoints = Endpoint<"GET", "/organizations/members", OrganizationMember
|
|
336
|
+
type OrganizationMembersEndpoints = Endpoint<"GET", "/organizations/members", ArrayResult<OrganizationMember>, ArrayOptions<OrganizationMember>> | Endpoint<"DELETE", "/organizations/members/:id", OrganizationMember[], null> | Endpoint<"GET", "/organizations/:slug/members", ArrayResult<OrganizationMember>, ArrayOptions<OrganizationMember>> | Endpoint<"POST", "/organizations/:slug/members", OrganizationMember, CreateOrganizationMemberDto> | Endpoint<"PUT", "/organizations/:organizationSlug/members/:userId", OrganizationMember, UpdateOrganizationMemberDto> | Endpoint<"DELETE", "/organizations/:organizationSlug/members/:userId", OrganizationMember[], null>;
|
|
332
337
|
|
|
333
338
|
type Organization = Base & {
|
|
334
339
|
slug: string;
|
|
@@ -449,6 +454,56 @@ declare enum Language {
|
|
|
449
454
|
FR = "fr",
|
|
450
455
|
EN = "en"
|
|
451
456
|
}
|
|
457
|
+
type ArraySortOptions = {
|
|
458
|
+
/**
|
|
459
|
+
* Field to sort
|
|
460
|
+
*/
|
|
461
|
+
field: string;
|
|
462
|
+
/**
|
|
463
|
+
* Order to sort
|
|
464
|
+
*/
|
|
465
|
+
order: "asc" | "desc";
|
|
466
|
+
};
|
|
467
|
+
type ArrayPaginationOptions = {
|
|
468
|
+
/**
|
|
469
|
+
* Page number
|
|
470
|
+
*/
|
|
471
|
+
page?: number;
|
|
472
|
+
/**
|
|
473
|
+
* Number of items per page
|
|
474
|
+
*/
|
|
475
|
+
limit?: number;
|
|
476
|
+
/**
|
|
477
|
+
* Offset to start from
|
|
478
|
+
*/
|
|
479
|
+
offset?: number;
|
|
480
|
+
};
|
|
481
|
+
type ArrayFilterOptions = {
|
|
482
|
+
/**
|
|
483
|
+
* Field to filter
|
|
484
|
+
*/
|
|
485
|
+
field: string;
|
|
486
|
+
/**
|
|
487
|
+
* Value to filter
|
|
488
|
+
*/
|
|
489
|
+
value: string;
|
|
490
|
+
/**
|
|
491
|
+
* Operator to use
|
|
492
|
+
*/
|
|
493
|
+
operator: "eq" | "ne" | "gt" | "lt" | "gte" | "lte" | "in" | "nin";
|
|
494
|
+
};
|
|
495
|
+
type ArrayOptions<T> = {
|
|
496
|
+
/**
|
|
497
|
+
* Populate relations
|
|
498
|
+
*/
|
|
499
|
+
populate?: Populate<T>;
|
|
500
|
+
};
|
|
501
|
+
type ArrayResult<T> = {
|
|
502
|
+
items: T[];
|
|
503
|
+
total: number;
|
|
504
|
+
page: number;
|
|
505
|
+
limit: number;
|
|
506
|
+
};
|
|
452
507
|
|
|
453
508
|
declare class CreateOrganizationMemberDto {
|
|
454
509
|
user: string;
|
|
@@ -659,7 +714,20 @@ declare class Client {
|
|
|
659
714
|
}> | Extract<Endpoint<"GET", "/organizations/:slug/billing/dashboard", void>, {
|
|
660
715
|
path: Path;
|
|
661
716
|
method: "GET";
|
|
662
|
-
}> | Extract<Endpoint<"GET", "/organizations
|
|
717
|
+
}> | Extract<Endpoint<"GET", "/organizations/events", ArrayResult<OrganizationEvent>, ArrayOptions<OrganizationEvent>>, {
|
|
718
|
+
path: Path;
|
|
719
|
+
method: "GET";
|
|
720
|
+
}> | Extract<Endpoint<"GET", "/organizations/events/suggestions", ArrayResult<OrganizationEvent>, ArrayOptions<OrganizationEvent>>, {
|
|
721
|
+
path: Path;
|
|
722
|
+
method: "GET";
|
|
723
|
+
}> | Extract<Endpoint<"GET", "/organizations/events/nearby", ArrayResult<OrganizationEvent>, ArrayOptions<OrganizationEvent> & {
|
|
724
|
+
latitude: number;
|
|
725
|
+
longitude: number;
|
|
726
|
+
radius?: number;
|
|
727
|
+
}>, {
|
|
728
|
+
path: Path;
|
|
729
|
+
method: "GET";
|
|
730
|
+
}> | Extract<Endpoint<"GET", "/organizations/:slug/events", ArrayResult<OrganizationEvent>, ArrayOptions<OrganizationEvent>>, {
|
|
663
731
|
path: Path;
|
|
664
732
|
method: "GET";
|
|
665
733
|
}> | Extract<Endpoint<"GET", "/organizations/:organizationSlug/events/:eventSlug", OrganizationEvent>, {
|
|
@@ -677,10 +745,10 @@ declare class Client {
|
|
|
677
745
|
}> | Extract<Endpoint<"GET", "/organizations/:slug/events/:eventSlug/tickets/:ticketId", OrganizationEventTicket>, {
|
|
678
746
|
path: Path;
|
|
679
747
|
method: "GET";
|
|
680
|
-
}> | Extract<Endpoint<"GET", "/organizations/members", OrganizationMember
|
|
748
|
+
}> | Extract<Endpoint<"GET", "/organizations/members", ArrayResult<OrganizationMember>, ArrayOptions<OrganizationMember>>, {
|
|
681
749
|
path: Path;
|
|
682
750
|
method: "GET";
|
|
683
|
-
}> | Extract<Endpoint<"GET", "/organizations/:slug/members", OrganizationMember
|
|
751
|
+
}> | Extract<Endpoint<"GET", "/organizations/:slug/members", ArrayResult<OrganizationMember>, ArrayOptions<OrganizationMember>>, {
|
|
684
752
|
path: Path;
|
|
685
753
|
method: "GET";
|
|
686
754
|
}> | Extract<ProfileEndpoints, {
|
|
@@ -852,7 +920,8 @@ declare const organizations: (client: Client) => {
|
|
|
852
920
|
dashboard: (slug: string) => void;
|
|
853
921
|
};
|
|
854
922
|
events: {
|
|
855
|
-
getAll: (slug: string) => Promise<OrganizationEvent
|
|
923
|
+
getAll: (slug: string) => Promise<ArrayResult<OrganizationEvent>>;
|
|
924
|
+
getSuggestions: (options?: ArrayOptions) => Promise<ArrayResult<OrganizationEvent>>;
|
|
856
925
|
get: (organizationSlug: string, eventSlug: string) => Promise<OrganizationEvent>;
|
|
857
926
|
create: (slug: string, data: CreateOrganizationEventDto) => Promise<OrganizationEvent>;
|
|
858
927
|
update: (organizationSlug: string, eventSlug: string, data: UpdateOrganizationEventDto) => Promise<OrganizationEvent>;
|
|
@@ -873,7 +942,7 @@ declare const organizations: (client: Client) => {
|
|
|
873
942
|
};
|
|
874
943
|
};
|
|
875
944
|
members: {
|
|
876
|
-
getAll: () => Promise<OrganizationMember
|
|
945
|
+
getAll: () => Promise<ArrayResult<OrganizationMember>>;
|
|
877
946
|
delete: (id: string) => Promise<OrganizationMember[]>;
|
|
878
947
|
};
|
|
879
948
|
};
|
|
@@ -945,7 +1014,8 @@ declare class TonightPass {
|
|
|
945
1014
|
dashboard: (slug: string) => void;
|
|
946
1015
|
};
|
|
947
1016
|
events: {
|
|
948
|
-
getAll: (slug: string) => Promise<OrganizationEvent
|
|
1017
|
+
getAll: (slug: string) => Promise<ArrayResult<OrganizationEvent>>;
|
|
1018
|
+
getSuggestions: (options?: ArrayOptions) => Promise<ArrayResult<OrganizationEvent>>;
|
|
949
1019
|
get: (organizationSlug: string, eventSlug: string) => Promise<OrganizationEvent>;
|
|
950
1020
|
create: (slug: string, data: CreateOrganizationEventDto) => Promise<OrganizationEvent>;
|
|
951
1021
|
update: (organizationSlug: string, eventSlug: string, data: UpdateOrganizationEventDto) => Promise<OrganizationEvent>;
|
|
@@ -966,7 +1036,7 @@ declare class TonightPass {
|
|
|
966
1036
|
};
|
|
967
1037
|
};
|
|
968
1038
|
members: {
|
|
969
|
-
getAll: () => Promise<OrganizationMember
|
|
1039
|
+
getAll: () => Promise<ArrayResult<OrganizationMember>>;
|
|
970
1040
|
delete: (id: string) => Promise<OrganizationMember[]>;
|
|
971
1041
|
};
|
|
972
1042
|
};
|
|
@@ -989,4 +1059,4 @@ declare class TonightPass {
|
|
|
989
1059
|
|
|
990
1060
|
declare const isBrowser: boolean;
|
|
991
1061
|
|
|
992
|
-
export { type APIRequestOptions, type APIResponse, type AuthEndpoints, BCRYPT_HASH, type Base, type CareersCategory, type CareersEmploymentType, type CareersEndpoints, type CareersJob, type CareersOffice, Client, type ClientOptions, CreateOrganizationDto, CreateOrganizationEventDto, CreateOrganizationEventTicketDto, CreateOrganizationIdentityDto, CreateOrganizationMemberDto, CreateUserDto, Currency, DEFAULT_API_URL, EMAIL_REGEX, type Endpoint, type Endpoints, type ErroredAPIResponse, type ExcludeBase, type Health, type HealthEndpoints, IMAGE_URL_REGEX, Language, type Location$1 as Location, NAME_REGEX, type Order, type OrderItem, OrderStatus, type Organization, type OrganizationBilling, type OrganizationBillingAccount, type OrganizationEndpoints, type OrganizationEvent, type OrganizationEventEndpoints, type OrganizationEventStyle, type OrganizationEventStyleEndpoints, OrganizationEventStyleType, type OrganizationEventTicket, OrganizationEventTicketCategory, type OrganizationEventTicketEndpoints, OrganizationEventTicketType, OrganizationEventType, OrganizationEventVisibilityType, type OrganizationIdentity, type OrganizationMember, OrganizationMemberRole, OrganizationMemberStatus, type OrganizationMembersEndpoints, type OrganizationSocialLink, OrganizationSocialType, PASSWORD_REGEX, PHONE_NUMBER_REGEX, type PathsFor, type Profile, type ProfileEndpoints, type ProfileMetadata, type PromisedAPIResponse, type PromoCode, SLUG_REGEX, SignInUserDto, type SuccessfulAPIResponse, TonightPass, TonightPassAPIError, UpdateOrganizationDto, UpdateOrganizationEventDto, UpdateOrganizationEventTicketDto, UpdateOrganizationIdentityDto, UpdateOrganizationMemberDto, UpdateUserDto, type User, type UserConnection, type UserConnectionClient, type UserConnectionDevice, type UserConnectionOS, type UserEndpoints, type UserIdentifier, type UserIdentity, type UserIdentityGender, type UserPreferences, UserRole, type UserToken, UserTokenType, auth, careers, health, isBrowser, organizations, profiles, request, sdk, users };
|
|
1062
|
+
export { type APIRequestOptions, type APIResponse, type ArrayFilterOptions, type ArrayOptions, type ArrayPaginationOptions, type ArrayResult, type ArraySortOptions, type AuthEndpoints, BCRYPT_HASH, type Base, type CareersCategory, type CareersEmploymentType, type CareersEndpoints, type CareersJob, type CareersOffice, Client, type ClientOptions, CreateOrganizationDto, CreateOrganizationEventDto, CreateOrganizationEventTicketDto, CreateOrganizationIdentityDto, CreateOrganizationMemberDto, CreateUserDto, Currency, DEFAULT_API_URL, EMAIL_REGEX, type Endpoint, type Endpoints, type ErroredAPIResponse, type ExcludeBase, type Health, type HealthEndpoints, IMAGE_URL_REGEX, Language, type Location$1 as Location, NAME_REGEX, type Order, type OrderItem, OrderStatus, type Organization, type OrganizationBilling, type OrganizationBillingAccount, type OrganizationEndpoints, type OrganizationEvent, type OrganizationEventEndpoints, type OrganizationEventStyle, type OrganizationEventStyleEndpoints, OrganizationEventStyleType, type OrganizationEventTicket, OrganizationEventTicketCategory, type OrganizationEventTicketEndpoints, OrganizationEventTicketType, OrganizationEventType, OrganizationEventVisibilityType, type OrganizationIdentity, type OrganizationMember, OrganizationMemberRole, OrganizationMemberStatus, type OrganizationMembersEndpoints, type OrganizationSocialLink, OrganizationSocialType, PASSWORD_REGEX, PHONE_NUMBER_REGEX, type PathsFor, type Profile, type ProfileEndpoints, type ProfileMetadata, type PromisedAPIResponse, type PromoCode, SLUG_REGEX, SignInUserDto, type SuccessfulAPIResponse, TonightPass, TonightPassAPIError, UpdateOrganizationDto, UpdateOrganizationEventDto, UpdateOrganizationEventTicketDto, UpdateOrganizationIdentityDto, UpdateOrganizationMemberDto, UpdateUserDto, type User, type UserConnection, type UserConnectionClient, type UserConnectionDevice, type UserConnectionOS, type UserEndpoints, type UserIdentifier, type UserIdentity, type UserIdentityGender, type UserPreferences, UserRole, type UserToken, UserTokenType, auth, careers, health, isBrowser, organizations, profiles, request, sdk, users };
|
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { ParamValue, Query } from 'pathcat';
|
|
|
3
3
|
export * from 'pathcat';
|
|
4
4
|
import * as stripe from 'stripe';
|
|
5
5
|
import stripe__default from 'stripe';
|
|
6
|
+
import { Populate } from '@mikro-orm/core';
|
|
6
7
|
import { Options, Response } from 'redaxios';
|
|
7
8
|
|
|
8
9
|
declare const DEFAULT_API_URL = "https://api.tonightpass.com";
|
|
@@ -288,7 +289,11 @@ declare enum OrganizationEventVisibilityType {
|
|
|
288
289
|
Unlisted = "unlisted",
|
|
289
290
|
Private = "private"
|
|
290
291
|
}
|
|
291
|
-
type OrganizationEventEndpoints = Endpoint<"GET", "/organizations
|
|
292
|
+
type OrganizationEventEndpoints = Endpoint<"GET", "/organizations/events", ArrayResult<OrganizationEvent>, ArrayOptions<OrganizationEvent>> | Endpoint<"GET", "/organizations/events/suggestions", ArrayResult<OrganizationEvent>, ArrayOptions<OrganizationEvent>> | Endpoint<"GET", "/organizations/events/nearby", ArrayResult<OrganizationEvent>, ArrayOptions<OrganizationEvent> & {
|
|
293
|
+
latitude: number;
|
|
294
|
+
longitude: number;
|
|
295
|
+
radius?: number;
|
|
296
|
+
}> | Endpoint<"GET", "/organizations/:slug/events", ArrayResult<OrganizationEvent>, ArrayOptions<OrganizationEvent>> | Endpoint<"GET", "/organizations/:organizationSlug/events/:eventSlug", OrganizationEvent> | Endpoint<"POST", "/organizations/:slug/events", OrganizationEvent, CreateOrganizationEventDto> | Endpoint<"PUT", "/organizations/:organizationSlug/events/:eventSlug", OrganizationEvent, UpdateOrganizationEventDto> | Endpoint<"DELETE", "/organizations/:organizationSlug/events/:eventSlug", OrganizationEvent, null> | OrganizationEventStyleEndpoints | OrganizationEventTicketEndpoints;
|
|
292
297
|
|
|
293
298
|
declare class UpdateOrganizationMemberDto {
|
|
294
299
|
role: OrganizationMemberRole;
|
|
@@ -328,7 +333,7 @@ declare enum OrganizationMemberRole {
|
|
|
328
333
|
Admin = "admin",
|
|
329
334
|
Owner = "owner"
|
|
330
335
|
}
|
|
331
|
-
type OrganizationMembersEndpoints = Endpoint<"GET", "/organizations/members", OrganizationMember
|
|
336
|
+
type OrganizationMembersEndpoints = Endpoint<"GET", "/organizations/members", ArrayResult<OrganizationMember>, ArrayOptions<OrganizationMember>> | Endpoint<"DELETE", "/organizations/members/:id", OrganizationMember[], null> | Endpoint<"GET", "/organizations/:slug/members", ArrayResult<OrganizationMember>, ArrayOptions<OrganizationMember>> | Endpoint<"POST", "/organizations/:slug/members", OrganizationMember, CreateOrganizationMemberDto> | Endpoint<"PUT", "/organizations/:organizationSlug/members/:userId", OrganizationMember, UpdateOrganizationMemberDto> | Endpoint<"DELETE", "/organizations/:organizationSlug/members/:userId", OrganizationMember[], null>;
|
|
332
337
|
|
|
333
338
|
type Organization = Base & {
|
|
334
339
|
slug: string;
|
|
@@ -449,6 +454,56 @@ declare enum Language {
|
|
|
449
454
|
FR = "fr",
|
|
450
455
|
EN = "en"
|
|
451
456
|
}
|
|
457
|
+
type ArraySortOptions = {
|
|
458
|
+
/**
|
|
459
|
+
* Field to sort
|
|
460
|
+
*/
|
|
461
|
+
field: string;
|
|
462
|
+
/**
|
|
463
|
+
* Order to sort
|
|
464
|
+
*/
|
|
465
|
+
order: "asc" | "desc";
|
|
466
|
+
};
|
|
467
|
+
type ArrayPaginationOptions = {
|
|
468
|
+
/**
|
|
469
|
+
* Page number
|
|
470
|
+
*/
|
|
471
|
+
page?: number;
|
|
472
|
+
/**
|
|
473
|
+
* Number of items per page
|
|
474
|
+
*/
|
|
475
|
+
limit?: number;
|
|
476
|
+
/**
|
|
477
|
+
* Offset to start from
|
|
478
|
+
*/
|
|
479
|
+
offset?: number;
|
|
480
|
+
};
|
|
481
|
+
type ArrayFilterOptions = {
|
|
482
|
+
/**
|
|
483
|
+
* Field to filter
|
|
484
|
+
*/
|
|
485
|
+
field: string;
|
|
486
|
+
/**
|
|
487
|
+
* Value to filter
|
|
488
|
+
*/
|
|
489
|
+
value: string;
|
|
490
|
+
/**
|
|
491
|
+
* Operator to use
|
|
492
|
+
*/
|
|
493
|
+
operator: "eq" | "ne" | "gt" | "lt" | "gte" | "lte" | "in" | "nin";
|
|
494
|
+
};
|
|
495
|
+
type ArrayOptions<T> = {
|
|
496
|
+
/**
|
|
497
|
+
* Populate relations
|
|
498
|
+
*/
|
|
499
|
+
populate?: Populate<T>;
|
|
500
|
+
};
|
|
501
|
+
type ArrayResult<T> = {
|
|
502
|
+
items: T[];
|
|
503
|
+
total: number;
|
|
504
|
+
page: number;
|
|
505
|
+
limit: number;
|
|
506
|
+
};
|
|
452
507
|
|
|
453
508
|
declare class CreateOrganizationMemberDto {
|
|
454
509
|
user: string;
|
|
@@ -659,7 +714,20 @@ declare class Client {
|
|
|
659
714
|
}> | Extract<Endpoint<"GET", "/organizations/:slug/billing/dashboard", void>, {
|
|
660
715
|
path: Path;
|
|
661
716
|
method: "GET";
|
|
662
|
-
}> | Extract<Endpoint<"GET", "/organizations
|
|
717
|
+
}> | Extract<Endpoint<"GET", "/organizations/events", ArrayResult<OrganizationEvent>, ArrayOptions<OrganizationEvent>>, {
|
|
718
|
+
path: Path;
|
|
719
|
+
method: "GET";
|
|
720
|
+
}> | Extract<Endpoint<"GET", "/organizations/events/suggestions", ArrayResult<OrganizationEvent>, ArrayOptions<OrganizationEvent>>, {
|
|
721
|
+
path: Path;
|
|
722
|
+
method: "GET";
|
|
723
|
+
}> | Extract<Endpoint<"GET", "/organizations/events/nearby", ArrayResult<OrganizationEvent>, ArrayOptions<OrganizationEvent> & {
|
|
724
|
+
latitude: number;
|
|
725
|
+
longitude: number;
|
|
726
|
+
radius?: number;
|
|
727
|
+
}>, {
|
|
728
|
+
path: Path;
|
|
729
|
+
method: "GET";
|
|
730
|
+
}> | Extract<Endpoint<"GET", "/organizations/:slug/events", ArrayResult<OrganizationEvent>, ArrayOptions<OrganizationEvent>>, {
|
|
663
731
|
path: Path;
|
|
664
732
|
method: "GET";
|
|
665
733
|
}> | Extract<Endpoint<"GET", "/organizations/:organizationSlug/events/:eventSlug", OrganizationEvent>, {
|
|
@@ -677,10 +745,10 @@ declare class Client {
|
|
|
677
745
|
}> | Extract<Endpoint<"GET", "/organizations/:slug/events/:eventSlug/tickets/:ticketId", OrganizationEventTicket>, {
|
|
678
746
|
path: Path;
|
|
679
747
|
method: "GET";
|
|
680
|
-
}> | Extract<Endpoint<"GET", "/organizations/members", OrganizationMember
|
|
748
|
+
}> | Extract<Endpoint<"GET", "/organizations/members", ArrayResult<OrganizationMember>, ArrayOptions<OrganizationMember>>, {
|
|
681
749
|
path: Path;
|
|
682
750
|
method: "GET";
|
|
683
|
-
}> | Extract<Endpoint<"GET", "/organizations/:slug/members", OrganizationMember
|
|
751
|
+
}> | Extract<Endpoint<"GET", "/organizations/:slug/members", ArrayResult<OrganizationMember>, ArrayOptions<OrganizationMember>>, {
|
|
684
752
|
path: Path;
|
|
685
753
|
method: "GET";
|
|
686
754
|
}> | Extract<ProfileEndpoints, {
|
|
@@ -852,7 +920,8 @@ declare const organizations: (client: Client) => {
|
|
|
852
920
|
dashboard: (slug: string) => void;
|
|
853
921
|
};
|
|
854
922
|
events: {
|
|
855
|
-
getAll: (slug: string) => Promise<OrganizationEvent
|
|
923
|
+
getAll: (slug: string) => Promise<ArrayResult<OrganizationEvent>>;
|
|
924
|
+
getSuggestions: (options?: ArrayOptions) => Promise<ArrayResult<OrganizationEvent>>;
|
|
856
925
|
get: (organizationSlug: string, eventSlug: string) => Promise<OrganizationEvent>;
|
|
857
926
|
create: (slug: string, data: CreateOrganizationEventDto) => Promise<OrganizationEvent>;
|
|
858
927
|
update: (organizationSlug: string, eventSlug: string, data: UpdateOrganizationEventDto) => Promise<OrganizationEvent>;
|
|
@@ -873,7 +942,7 @@ declare const organizations: (client: Client) => {
|
|
|
873
942
|
};
|
|
874
943
|
};
|
|
875
944
|
members: {
|
|
876
|
-
getAll: () => Promise<OrganizationMember
|
|
945
|
+
getAll: () => Promise<ArrayResult<OrganizationMember>>;
|
|
877
946
|
delete: (id: string) => Promise<OrganizationMember[]>;
|
|
878
947
|
};
|
|
879
948
|
};
|
|
@@ -945,7 +1014,8 @@ declare class TonightPass {
|
|
|
945
1014
|
dashboard: (slug: string) => void;
|
|
946
1015
|
};
|
|
947
1016
|
events: {
|
|
948
|
-
getAll: (slug: string) => Promise<OrganizationEvent
|
|
1017
|
+
getAll: (slug: string) => Promise<ArrayResult<OrganizationEvent>>;
|
|
1018
|
+
getSuggestions: (options?: ArrayOptions) => Promise<ArrayResult<OrganizationEvent>>;
|
|
949
1019
|
get: (organizationSlug: string, eventSlug: string) => Promise<OrganizationEvent>;
|
|
950
1020
|
create: (slug: string, data: CreateOrganizationEventDto) => Promise<OrganizationEvent>;
|
|
951
1021
|
update: (organizationSlug: string, eventSlug: string, data: UpdateOrganizationEventDto) => Promise<OrganizationEvent>;
|
|
@@ -966,7 +1036,7 @@ declare class TonightPass {
|
|
|
966
1036
|
};
|
|
967
1037
|
};
|
|
968
1038
|
members: {
|
|
969
|
-
getAll: () => Promise<OrganizationMember
|
|
1039
|
+
getAll: () => Promise<ArrayResult<OrganizationMember>>;
|
|
970
1040
|
delete: (id: string) => Promise<OrganizationMember[]>;
|
|
971
1041
|
};
|
|
972
1042
|
};
|
|
@@ -989,4 +1059,4 @@ declare class TonightPass {
|
|
|
989
1059
|
|
|
990
1060
|
declare const isBrowser: boolean;
|
|
991
1061
|
|
|
992
|
-
export { type APIRequestOptions, type APIResponse, type AuthEndpoints, BCRYPT_HASH, type Base, type CareersCategory, type CareersEmploymentType, type CareersEndpoints, type CareersJob, type CareersOffice, Client, type ClientOptions, CreateOrganizationDto, CreateOrganizationEventDto, CreateOrganizationEventTicketDto, CreateOrganizationIdentityDto, CreateOrganizationMemberDto, CreateUserDto, Currency, DEFAULT_API_URL, EMAIL_REGEX, type Endpoint, type Endpoints, type ErroredAPIResponse, type ExcludeBase, type Health, type HealthEndpoints, IMAGE_URL_REGEX, Language, type Location$1 as Location, NAME_REGEX, type Order, type OrderItem, OrderStatus, type Organization, type OrganizationBilling, type OrganizationBillingAccount, type OrganizationEndpoints, type OrganizationEvent, type OrganizationEventEndpoints, type OrganizationEventStyle, type OrganizationEventStyleEndpoints, OrganizationEventStyleType, type OrganizationEventTicket, OrganizationEventTicketCategory, type OrganizationEventTicketEndpoints, OrganizationEventTicketType, OrganizationEventType, OrganizationEventVisibilityType, type OrganizationIdentity, type OrganizationMember, OrganizationMemberRole, OrganizationMemberStatus, type OrganizationMembersEndpoints, type OrganizationSocialLink, OrganizationSocialType, PASSWORD_REGEX, PHONE_NUMBER_REGEX, type PathsFor, type Profile, type ProfileEndpoints, type ProfileMetadata, type PromisedAPIResponse, type PromoCode, SLUG_REGEX, SignInUserDto, type SuccessfulAPIResponse, TonightPass, TonightPassAPIError, UpdateOrganizationDto, UpdateOrganizationEventDto, UpdateOrganizationEventTicketDto, UpdateOrganizationIdentityDto, UpdateOrganizationMemberDto, UpdateUserDto, type User, type UserConnection, type UserConnectionClient, type UserConnectionDevice, type UserConnectionOS, type UserEndpoints, type UserIdentifier, type UserIdentity, type UserIdentityGender, type UserPreferences, UserRole, type UserToken, UserTokenType, auth, careers, health, isBrowser, organizations, profiles, request, sdk, users };
|
|
1062
|
+
export { type APIRequestOptions, type APIResponse, type ArrayFilterOptions, type ArrayOptions, type ArrayPaginationOptions, type ArrayResult, type ArraySortOptions, type AuthEndpoints, BCRYPT_HASH, type Base, type CareersCategory, type CareersEmploymentType, type CareersEndpoints, type CareersJob, type CareersOffice, Client, type ClientOptions, CreateOrganizationDto, CreateOrganizationEventDto, CreateOrganizationEventTicketDto, CreateOrganizationIdentityDto, CreateOrganizationMemberDto, CreateUserDto, Currency, DEFAULT_API_URL, EMAIL_REGEX, type Endpoint, type Endpoints, type ErroredAPIResponse, type ExcludeBase, type Health, type HealthEndpoints, IMAGE_URL_REGEX, Language, type Location$1 as Location, NAME_REGEX, type Order, type OrderItem, OrderStatus, type Organization, type OrganizationBilling, type OrganizationBillingAccount, type OrganizationEndpoints, type OrganizationEvent, type OrganizationEventEndpoints, type OrganizationEventStyle, type OrganizationEventStyleEndpoints, OrganizationEventStyleType, type OrganizationEventTicket, OrganizationEventTicketCategory, type OrganizationEventTicketEndpoints, OrganizationEventTicketType, OrganizationEventType, OrganizationEventVisibilityType, type OrganizationIdentity, type OrganizationMember, OrganizationMemberRole, OrganizationMemberStatus, type OrganizationMembersEndpoints, type OrganizationSocialLink, OrganizationSocialType, PASSWORD_REGEX, PHONE_NUMBER_REGEX, type PathsFor, type Profile, type ProfileEndpoints, type ProfileMetadata, type PromisedAPIResponse, type PromoCode, SLUG_REGEX, SignInUserDto, type SuccessfulAPIResponse, TonightPass, TonightPassAPIError, UpdateOrganizationDto, UpdateOrganizationEventDto, UpdateOrganizationEventTicketDto, UpdateOrganizationIdentityDto, UpdateOrganizationMemberDto, UpdateUserDto, type User, type UserConnection, type UserConnectionClient, type UserConnectionDevice, type UserConnectionOS, type UserEndpoints, type UserIdentifier, type UserIdentity, type UserIdentityGender, type UserPreferences, UserRole, type UserToken, UserTokenType, auth, careers, health, isBrowser, organizations, profiles, request, sdk, users };
|
package/dist/index.js
CHANGED
|
@@ -10,7 +10,7 @@ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
|
10
10
|
|
|
11
11
|
var lt__default = /*#__PURE__*/_interopDefault(lt);
|
|
12
12
|
|
|
13
|
-
var Ye=Object.defineProperty;var o=(e,t)=>Ye(e,"name",{value:t,configurable:!0});var ee="https://api.tonightpass.com";var ht=/^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$/,bt=/((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/,C=/(^[\p{L}\d'\\.\s\\-]*$)/u,xt=/^[a-z\d]+(?:(\.|-|_)[a-z\d]+)*$/,vt=/\$2[abxy]?\$\d{1,2}\$[A-Za-z\d\\./]{53}/,wt=/^\s*(?:\+?(\d{1,3}))?([-. (]*(\d{3})[-. )]*)?((\d{3})[-. ]*(\d{2,4})(?:[-.x ]*(\d+))?)\s*$/,Rt=/(((http:\/\/www)|(http:\/\/)|(www))[-a-zA-Z0-9@:%_\\+.~#?&//=]+)\.(jpg|jpeg|gif|png|bmp|tiff|tga|svg)/i;function v(e,t,r,n){var i=arguments.length,s=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(p=e[a])&&(s=(i<3?p(s):i>3?p(t,r,s):p(t,r))||s);return i>3&&s&&Object.defineProperty(t,r,s),s}o(v,"_ts_decorate");function w(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}o(w,"_ts_metadata");var D=class{static{o(this,"CreateOrganizationDto");}slug;identity;members;location};v([classValidator.IsOptional(),classValidator.IsString(),classValidator.IsLowercase(),classValidator.Length(1,48),w("design:type",String)],D.prototype,"slug",void 0);v([classValidator.IsObject(),w("design:type",typeof x>"u"?Object:x)],D.prototype,"identity",void 0);v([classValidator.IsArray(),w("design:type",Array)],D.prototype,"members",void 0);v([classValidator.IsOptional(),classValidator.IsObject(),w("design:type",typeof Location>"u"?Object:Location)],D.prototype,"location",void 0);var x=class{static{o(this,"CreateOrganizationIdentityDto");}displayName;description;avatarUrl;bannerUrl;socialLinks};v([classValidator.IsString(),classValidator.IsNotEmpty(),classValidator.Length(1,32),w("design:type",String)],x.prototype,"displayName",void 0);v([classValidator.IsString(),classValidator.Length(16,1024),classValidator.IsOptional(),w("design:type",String)],x.prototype,"description",void 0);v([classValidator.IsUrl({protocols:["http","https"]}),w("design:type",String)],x.prototype,"avatarUrl",void 0);v([classValidator.IsOptional(),classValidator.IsUrl({protocols:["http","https"]}),w("design:type",String)],x.prototype,"bannerUrl",void 0);v([classValidator.IsOptional(),classValidator.IsArray(),w("design:type",Array)],x.prototype,"socialLinks",void 0);function j(e,t,r,n){var i=arguments.length,s=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(p=e[a])&&(s=(i<3?p(s):i>3?p(t,r,s):p(t,r))||s);return i>3&&s&&Object.defineProperty(t,r,s),s}o(j,"_ts_decorate");function _(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}o(_,"_ts_metadata");var P=class{static{o(this,"UpdateOrganizationDto");}slug;identity;members;location};j([classValidator.IsOptional(),classValidator.IsString(),classValidator.IsLowercase(),classValidator.Length(1,48),_("design:type",String)],P.prototype,"slug",void 0);j([classValidator.IsObject(),classValidator.IsOptional(),_("design:type",typeof R>"u"?Object:R)],P.prototype,"identity",void 0);j([classValidator.IsOptional(),classValidator.IsArray(),_("design:type",Array)],P.prototype,"members",void 0);j([classValidator.IsOptional(),classValidator.IsObject(),_("design:type",typeof Location>"u"?Object:Location)],P.prototype,"location",void 0);var R=class{static{o(this,"UpdateOrganizationIdentityDto");}displayName;description;avatarUrl;bannerUrl;socialLinks};j([classValidator.IsString(),classValidator.IsNotEmpty(),classValidator.Length(1,32),classValidator.IsOptional(),_("design:type",String)],R.prototype,"displayName",void 0);j([classValidator.IsString(),classValidator.Length(16,1024),classValidator.IsOptional(),_("design:type",String)],R.prototype,"description",void 0);j([classValidator.IsUrl({protocols:["http","https"]}),classValidator.IsOptional(),_("design:type",String)],R.prototype,"avatarUrl",void 0);j([classValidator.IsOptional(),classValidator.IsUrl({protocols:["http","https"]}),_("design:type",String)],R.prototype,"bannerUrl",void 0);j([classValidator.IsOptional(),classValidator.IsArray(),_("design:type",Array)],R.prototype,"socialLinks",void 0);exports.OrganizationEventTicketType = void 0;(function(e){e.ETicket="e-ticket",e.Other="other";})(exports.OrganizationEventTicketType||(exports.OrganizationEventTicketType={}));exports.OrganizationEventTicketCategory = void 0;(function(e){e.Entry="entry",e.Package="package",e.Meal="meal",e.Drink="drink",e.Parking="parking",e.Accommodation="accommodation",e.Camping="camping",e.Locker="locker",e.Shuttle="shuttle",e.Other="other";})(exports.OrganizationEventTicketCategory||(exports.OrganizationEventTicketCategory={}));exports.OrganizationEventStyleType = void 0;(function(e){e.Music="music",e.Dress="dress",e.Sport="sport",e.Food="food",e.Art="art";})(exports.OrganizationEventStyleType||(exports.OrganizationEventStyleType={}));exports.OrganizationEventType = void 0;(function(e){e.Clubbing="clubbing",e.Concert="concert",e.Afterwork="afterwork",e.DancingLunch="dancing_lunch",e.Diner="diner",e.Garden="garden",e.AfterBeach="after_beach",e.Festival="festival",e.Spectacle="spectacle",e.Cruise="cruise",e.OutsideAnimation="outside_animation",e.Sport="sport",e.Match="match",e.Seminar="seminar",e.Conference="conference",e.WellnessDay="wellness_day",e.Workshop="workshop",e.TradeFair="trade_fair",e.ConsumerShow="consumer_show",e.Membership="membership";})(exports.OrganizationEventType||(exports.OrganizationEventType={}));exports.OrganizationEventVisibilityType = void 0;(function(e){e.Public="public",e.Unlisted="unlisted",e.Private="private";})(exports.OrganizationEventVisibilityType||(exports.OrganizationEventVisibilityType={}));exports.OrganizationMemberStatus = void 0;(function(e){e.Pending="pending",e.Accepted="accepted",e.Rejected="rejected";})(exports.OrganizationMemberStatus||(exports.OrganizationMemberStatus={}));exports.OrganizationMemberRole = void 0;(function(e){e.Member="member",e.Manager="manager",e.Admin="admin",e.Owner="owner";})(exports.OrganizationMemberRole||(exports.OrganizationMemberRole={}));exports.OrganizationSocialType = void 0;(function(e){e.Facebook="facebook",e.Twitter="twitter",e.Instagram="instagram",e.Linkedin="linkedin",e.Youtube="youtube",e.Website="website";})(exports.OrganizationSocialType||(exports.OrganizationSocialType={}));exports.UserTokenType = void 0;(function(e){e.Authentication="authentication",e.OrganizationInvite="organization_invite",e.PasswordRecovery="password_recovery",e.EmailValidation="email_validation",e.PhoneValidation="phone_validation";})(exports.UserTokenType||(exports.UserTokenType={}));exports.UserRole = void 0;(function(e){e.User="user",e.Developer="developer",e.Admin="admin";})(exports.UserRole||(exports.UserRole={}));exports.OrderStatus = void 0;(function(e){e.Created="created",e.Cancelled="cancelled",e.Completed="completed",e.Pending="pending",e.Confirmed="confirmed",e.Declined="declined",e.Refunded="refunded",e.PartiallyRefunded="partially_refunded",e.Expired="expired";})(exports.OrderStatus||(exports.OrderStatus={}));exports.Currency = void 0;(function(e){e.EUR="EUR",e.USD="USD",e.GBP="GBP";})(exports.Currency||(exports.Currency={}));exports.Language = void 0;(function(e){e.FR="fr",e.EN="en";})(exports.Language||(exports.Language={}));function S(e,t,r,n){var i=arguments.length,s=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(p=e[a])&&(s=(i<3?p(s):i>3?p(t,r,s):p(t,r))||s);return i>3&&s&&Object.defineProperty(t,r,s),s}o(S,"_ts_decorate");function L(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}o(L,"_ts_metadata");var u=class{static{o(this,"CreateOrganizationEventDto");}title;slug;description;type;visibility;flyers;trailers;location;tickets;styles;startAt;endAt};S([classValidator.IsString(),classValidator.Length(1,64),L("design:type",String)],u.prototype,"title",void 0);S([classValidator.IsOptional(),classValidator.IsString(),classValidator.IsLowercase(),classValidator.Length(1,48),L("design:type",String)],u.prototype,"slug",void 0);S([classValidator.IsString(),classValidator.Length(16,2048),L("design:type",String)],u.prototype,"description",void 0);S([classValidator.IsEnum(exports.OrganizationEventType),L("design:type",typeof exports.OrganizationEventType>"u"?Object:exports.OrganizationEventType)],u.prototype,"type",void 0);S([classValidator.IsEnum(exports.OrganizationEventVisibilityType),L("design:type",typeof exports.OrganizationEventVisibilityType>"u"?Object:exports.OrganizationEventVisibilityType)],u.prototype,"visibility",void 0);S([classValidator.IsDateString(),L("design:type",typeof Date>"u"?Object:Date)],u.prototype,"startAt",void 0);S([classValidator.IsDateString(),L("design:type",typeof Date>"u"?Object:Date)],u.prototype,"endAt",void 0);var ge=class extends u{static{o(this,"UpdateOrganizationEventDto");}};function m(e,t,r,n){var i=arguments.length,s=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(p=e[a])&&(s=(i<3?p(s):i>3?p(t,r,s):p(t,r))||s);return i>3&&s&&Object.defineProperty(t,r,s),s}o(m,"_ts_decorate");function y(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}o(y,"_ts_metadata");var c=class{static{o(this,"CreateOrganizationEventTicketDto");}name;description;price;quantity;type;category;currency;isVisible;isFeesIncluded;startAt;endAt};m([classValidator.IsString(),classValidator.Length(1,128),y("design:type",String)],c.prototype,"name",void 0);m([classValidator.IsString(),classValidator.Length(1,1024),y("design:type",String)],c.prototype,"description",void 0);m([classValidator.IsNumber(),classValidator.Min(0),y("design:type",Number)],c.prototype,"price",void 0);m([classValidator.IsNumber(),classValidator.Min(0),y("design:type",Number)],c.prototype,"quantity",void 0);m([classValidator.IsEnum(exports.OrganizationEventTicketType),y("design:type",typeof exports.OrganizationEventTicketType>"u"?Object:exports.OrganizationEventTicketType)],c.prototype,"type",void 0);m([classValidator.IsEnum(exports.OrganizationEventTicketCategory),y("design:type",typeof exports.OrganizationEventTicketCategory>"u"?Object:exports.OrganizationEventTicketCategory)],c.prototype,"category",void 0);m([classValidator.IsEnum(exports.Currency),y("design:type",typeof exports.Currency>"u"?Object:exports.Currency)],c.prototype,"currency",void 0);m([classValidator.IsBoolean(),y("design:type",Boolean)],c.prototype,"isVisible",void 0);m([classValidator.IsBoolean(),y("design:type",Boolean)],c.prototype,"isFeesIncluded",void 0);m([classValidator.IsDateString(),classValidator.IsOptional(),y("design:type",typeof Date>"u"?Object:Date)],c.prototype,"startAt",void 0);m([classValidator.IsDateString(),classValidator.IsOptional(),y("design:type",typeof Date>"u"?Object:Date)],c.prototype,"endAt",void 0);var _e=class extends c{static{o(this,"UpdateOrganizationEventTicketDto");}};function Ae(e,t,r,n){var i=arguments.length,s=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(p=e[a])&&(s=(i<3?p(s):i>3?p(t,r,s):p(t,r))||s);return i>3&&s&&Object.defineProperty(t,r,s),s}o(Ae,"_ts_decorate");function Ie(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}o(Ie,"_ts_metadata");var q=class{static{o(this,"CreateOrganizationMemberDto");}user;role};Ae([classValidator.IsString(),classValidator.IsNotEmpty(),Ie("design:type",String)],q.prototype,"user",void 0);Ae([classValidator.IsEnum(exports.OrganizationMemberRole),classValidator.IsNotEmpty(),Ie("design:type",typeof exports.OrganizationMemberRole>"u"?Object:exports.OrganizationMemberRole)],q.prototype,"role",void 0);function nt(e,t,r,n){var i=arguments.length,s=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(p=e[a])&&(s=(i<3?p(s):i>3?p(t,r,s):p(t,r))||s);return i>3&&s&&Object.defineProperty(t,r,s),s}o(nt,"_ts_decorate");function st(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}o(st,"_ts_metadata");var Q=class{static{o(this,"UpdateOrganizationMemberDto");}role};nt([classValidator.IsEnum(exports.OrganizationMemberRole),classValidator.IsNotEmpty(),st("design:type",typeof exports.OrganizationMemberRole>"u"?Object:exports.OrganizationMemberRole)],Q.prototype,"role",void 0);var Le=class{static{o(this,"CreateUserDto");}identifier;password;identity;addresses};var De=class{static{o(this,"SignInUserDto");}identifier;password};function d(e,t,r,n){var i=arguments.length,s=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(p=e[a])&&(s=(i<3?p(s):i>3?p(t,r,s):p(t,r))||s);return i>3&&s&&Object.defineProperty(t,r,s),s}o(d,"_ts_decorate");function f(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}o(f,"_ts_metadata");var z=class{static{o(this,"UpdateUserDto");}identifier;identity;password};d([classValidator.IsOptional(),classValidator.IsObject(),classValidator.ValidateNested(),classTransformer.Type(()=>G),f("design:type",typeof G>"u"?Object:G)],z.prototype,"identifier",void 0);d([classValidator.IsOptional(),classValidator.IsObject(),classValidator.ValidateNested(),classTransformer.Type(()=>g),f("design:type",typeof g>"u"?Object:g)],z.prototype,"identity",void 0);d([classValidator.IsOptional(),classValidator.IsString(),classValidator.MinLength(8),classValidator.MaxLength(128),f("design:type",String)],z.prototype,"password",void 0);var G=class{static{o(this,"UpdateIdentifierDto");}email;phoneNumber;username};d([classValidator.IsOptional(),classValidator.IsString(),classValidator.IsEmail(),f("design:type",String)],G.prototype,"email",void 0);d([classValidator.IsOptional(),classValidator.IsString(),classValidator.IsPhoneNumber(),f("design:type",String)],G.prototype,"phoneNumber",void 0);d([classValidator.IsOptional(),classValidator.IsString(),classValidator.MinLength(3),f("design:type",String)],G.prototype,"username",void 0);var g=class{static{o(this,"UpdateIdentityDto");}firstName;lastName;displayName;description;avatarUrl;bannerUrl;gender;birthDate};d([classValidator.IsOptional(),classValidator.IsString(),classValidator.Length(2,32),classValidator.Matches(C,{message:"First name must be composed of letters only"}),f("design:type",String)],g.prototype,"firstName",void 0);d([classValidator.IsOptional(),classValidator.IsString(),classValidator.Length(2,32),classValidator.Matches(C,{message:"Last name must be composed of letters only"}),f("design:type",String)],g.prototype,"lastName",void 0);d([classValidator.IsOptional(),classValidator.IsString(),classValidator.Length(1,32),f("design:type",String)],g.prototype,"displayName",void 0);d([classValidator.IsOptional(),classValidator.IsString(),classValidator.Length(1,128),f("design:type",String)],g.prototype,"description",void 0);d([classValidator.IsOptional(),classValidator.IsUrl(),f("design:type",Object)],g.prototype,"avatarUrl",void 0);d([classValidator.IsOptional(),classValidator.IsUrl(),f("design:type",Object)],g.prototype,"bannerUrl",void 0);d([classValidator.IsOptional(),f("design:type",String)],g.prototype,"gender",void 0);d([classValidator.IsOptional(),classValidator.IsDateString(),f("design:type",typeof Date>"u"?Object:Date)],g.prototype,"birthDate",void 0);var b=typeof window<"u";var ut=lt__default.default.create({headers:{"Content-Type":"application/json",Accept:"application/json",...!b&&{"User-Agent":"tonightpass-api-client"}},responseType:"json",transformRequest:[function(e){return JSON.stringify(e)}],withCredentials:b}),Ge=o(async(e,t)=>ut(e,{...t}).then(n=>n).catch(n=>{throw n.data||console.error(n),n.data}),"request");var T=class extends Error{static{o(this,"TonightPassAPIError");}response;data;status;constructor(t,r){super(r.message),this.response=t,this.data=r,this.status=t.status;}},$=class{static{o(this,"Client");}options;url;constructor(t){this.options=t,this.url=(r,n)=>{let i=this.options.baseURL||ee;return pathcat.pathcat(i,r,n)};}setOptions(t){this.options=t;}async get(t,r,n){return this.requester("GET",t,void 0,r,n)}async post(t,r,n,i){return this.requester("POST",t,r,n,i)}async put(t,r,n,i){return this.requester("PUT",t,r,n,i)}async patch(t,r,n,i){return this.requester("PATCH",t,r,n,i)}async delete(t,r,n,i){return this.requester("DELETE",t,r,n,i)}async requester(t,r,n,i={},s={}){let p=this.url(r,i);if(n!==void 0&&t==="GET")throw new Error("Cannot send a GET request with a body");let a=await Ge(p,{method:t,data:n,...s}),X=a.data;if(!X.success)throw new T(a,X);return X.data}};function M(e){return e}o(M,"sdk");var Me=e=>({signIn:o(async t=>e.post("/auth/sign-in",t),"signIn"),signUp:o(async t=>e.post("/auth/sign-up",t),"signUp"),signOut:o(async()=>e.post("/auth/sign-out",null),"signOut"),refreshToken:o(async()=>e.post("/auth/refresh-token",null),"refreshToken"),oauth2:{google:{connect:o(t=>{if(b)window.location.href=e.url("/oauth2/google",t||{});else throw new Error("Google OAuth2 is only available in the browser")},"connect")},twitter:{connect:o(t=>{if(b)window.location.href=e.url("/oauth2/twitter",t||{});else throw new Error("Twitter OAuth2 is only available in the browser")},"connect")},facebook:{connect:o(t=>{if(b)window.location.href=e.url("/oauth2/facebook",t||{});else throw new Error("Facebook OAuth2 is only available in the browser")},"connect")}}});var ke=e=>({categories:{getAll:o(async t=>e.get("/careers/categories",t),"getAll")},employmentTypes:{getAll:o(async t=>e.get("/careers/employmentTypes",t),"getAll")},jobs:{getAll:o(async t=>e.get("/careers/jobs",t),"getAll"),get:o(async t=>e.get("/careers/jobs/:id",{id:t}),"get")},offices:{getAll:o(async t=>e.get("/careers/offices",t),"getAll")}});var ze=e=>({getAll:o(async()=>e.get("/health"),"getAll"),database:o(async()=>e.get("/health/database"),"database"),http:o(async()=>e.get("/health/http"),"http")});var qe=o(e=>({account:o(async t=>e.get("/organizations/:slug/billing/account",{slug:t}),"account"),link:o(t=>{if(b)window.location.href=e.url("/organizations/:slug/billing/link",{slug:t});else throw new Error("Billing link is only available in the browser")},"link"),dashboard:o(t=>{if(b)window.location.href=e.url("/organizations/:slug/billing/dashboard",{slug:t});else throw new Error("Billing dashboard is only available in the browser")},"dashboard")}),"organizationsBilling");var Fe=o(e=>({getAll:o(async()=>e.get("/organizations/events/styles"),"getAll"),get:o(async t=>e.get("/organizations/events/styles/:slug",{slug:t}),"get"),create:o(async t=>e.post("/organizations/events/styles",t),"create"),update:o(async(t,r)=>e.put("/organizations/events/styles/:slug",r,{slug:t}),"update"),delete:o(async t=>e.delete("/organizations/events/styles/:slug",null,{slug:t}),"delete")}),"organizationsEventsStyles");var $e=o(e=>({getAll:o(async(t,r)=>e.get("/organizations/:slug/events/:eventSlug/tickets",{slug:t,eventSlug:r}),"getAll"),get:o(async(t,r,n)=>e.get("/organizations/:slug/events/:eventSlug/tickets/:ticketId",{slug:t,eventSlug:r,ticketId:n}),"get"),create:o(async(t,r,n)=>e.post("/organizations/:slug/events/:eventSlug/tickets",n,{slug:t,eventSlug:r}),"create"),update:o(async(t,r,n,i)=>e.put("/organizations/:slug/events/:eventSlug/tickets/:ticketId",i,{slug:t,eventSlug:r,ticketId:n}),"update"),delete:o(async(t,r,n)=>e.delete("/organizations/:slug/events/:eventSlug/tickets/:ticketId",null,{slug:t,eventSlug:r,ticketId:n}),"delete")}),"organizationsEventsTickets");var Xe=o(e=>({getAll:o(async t=>e.get("/organizations/:slug/events",{slug:t}),"getAll"),get:o(async(t,r)=>e.get("/organizations/:organizationSlug/events/:eventSlug",{organizationSlug:t,eventSlug:r}),"get"),create:o(async(t,r)=>e.post("/organizations/:slug/events",r,{slug:t}),"create"),update:o(async(t,r,n)=>e.put("/organizations/:organizationSlug/events/:eventSlug",n,{organizationSlug:t,eventSlug:r}),"update"),delete:o(async(t,r)=>e.delete("/organizations/:organizationSlug/events/:eventSlug",null,{organizationSlug:t,eventSlug:r}),"delete"),styles:Fe(e),tickets:$e(e)}),"organizationsEvents");var Ce=o(e=>({getAll:o(async()=>e.get("/organizations/members"),"getAll"),delete:o(async t=>e.delete("/organizations/members/:id",null,{id:t}),"delete")}),"organizationsMembers");var Ve=e=>({getAll:o(async()=>e.get("/organizations"),"getAll"),get:o(async t=>e.get("/organizations/:slug",{slug:t}),"get"),create:o(async t=>e.post("/organizations",t),"create"),update:o(async(t,r)=>e.put("/organizations/:slug",r,{slug:t}),"update"),delete:o(async t=>e.delete("/organizations/:slug",null,{slug:t}),"delete"),billing:qe(e),events:Xe(e),members:Ce(e)});var We=e=>({get:o(async t=>e.get("/profiles/:username",{username:t}),"get")});var He=e=>({getAll:o(async()=>e.get("/users"),"getAll"),get:o(async t=>e.get("/users",{id:t}),"get"),me:o(async()=>e.get("/users/me"),"me"),check:o(async(t,r)=>e.get("/users/check/:identifier",{identifier:t,suggestions:r}),"check"),update:o(async(t,r)=>e.put("/users/:id",r,{id:t}),"update")});var Ze=class{static{o(this,"TonightPass");}client;auth;careers;health;organizations;profiles;users;constructor(t){this.client=new $(t),this.auth=Me(this.client),this.careers=ke(this.client),this.health=ze(this.client),this.organizations=Ve(this.client),this.profiles=We(this.client),this.users=He(this.client);}};
|
|
13
|
+
var Ye=Object.defineProperty;var o=(e,t)=>Ye(e,"name",{value:t,configurable:!0});var ee="https://api.tonightpass.com";var ht=/^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$/,bt=/((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/,C=/(^[\p{L}\d'\\.\s\\-]*$)/u,xt=/^[a-z\d]+(?:(\.|-|_)[a-z\d]+)*$/,vt=/\$2[abxy]?\$\d{1,2}\$[A-Za-z\d\\./]{53}/,wt=/^\s*(?:\+?(\d{1,3}))?([-. (]*(\d{3})[-. )]*)?((\d{3})[-. ]*(\d{2,4})(?:[-.x ]*(\d+))?)\s*$/,Rt=/(((http:\/\/www)|(http:\/\/)|(www))[-a-zA-Z0-9@:%_\\+.~#?&//=]+)\.(jpg|jpeg|gif|png|bmp|tiff|tga|svg)/i;function v(e,t,r,s){var i=arguments.length,n=i<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,r):s,p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,r,s);else for(var a=e.length-1;a>=0;a--)(p=e[a])&&(n=(i<3?p(n):i>3?p(t,r,n):p(t,r))||n);return i>3&&n&&Object.defineProperty(t,r,n),n}o(v,"_ts_decorate");function w(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}o(w,"_ts_metadata");var D=class{static{o(this,"CreateOrganizationDto");}slug;identity;members;location};v([classValidator.IsOptional(),classValidator.IsString(),classValidator.IsLowercase(),classValidator.Length(1,48),w("design:type",String)],D.prototype,"slug",void 0);v([classValidator.IsObject(),w("design:type",typeof x>"u"?Object:x)],D.prototype,"identity",void 0);v([classValidator.IsArray(),w("design:type",Array)],D.prototype,"members",void 0);v([classValidator.IsOptional(),classValidator.IsObject(),w("design:type",typeof Location>"u"?Object:Location)],D.prototype,"location",void 0);var x=class{static{o(this,"CreateOrganizationIdentityDto");}displayName;description;avatarUrl;bannerUrl;socialLinks};v([classValidator.IsString(),classValidator.IsNotEmpty(),classValidator.Length(1,32),w("design:type",String)],x.prototype,"displayName",void 0);v([classValidator.IsString(),classValidator.Length(16,1024),classValidator.IsOptional(),w("design:type",String)],x.prototype,"description",void 0);v([classValidator.IsUrl({protocols:["http","https"]}),w("design:type",String)],x.prototype,"avatarUrl",void 0);v([classValidator.IsOptional(),classValidator.IsUrl({protocols:["http","https"]}),w("design:type",String)],x.prototype,"bannerUrl",void 0);v([classValidator.IsOptional(),classValidator.IsArray(),w("design:type",Array)],x.prototype,"socialLinks",void 0);function j(e,t,r,s){var i=arguments.length,n=i<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,r):s,p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,r,s);else for(var a=e.length-1;a>=0;a--)(p=e[a])&&(n=(i<3?p(n):i>3?p(t,r,n):p(t,r))||n);return i>3&&n&&Object.defineProperty(t,r,n),n}o(j,"_ts_decorate");function _(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}o(_,"_ts_metadata");var P=class{static{o(this,"UpdateOrganizationDto");}slug;identity;members;location};j([classValidator.IsOptional(),classValidator.IsString(),classValidator.IsLowercase(),classValidator.Length(1,48),_("design:type",String)],P.prototype,"slug",void 0);j([classValidator.IsObject(),classValidator.IsOptional(),_("design:type",typeof R>"u"?Object:R)],P.prototype,"identity",void 0);j([classValidator.IsOptional(),classValidator.IsArray(),_("design:type",Array)],P.prototype,"members",void 0);j([classValidator.IsOptional(),classValidator.IsObject(),_("design:type",typeof Location>"u"?Object:Location)],P.prototype,"location",void 0);var R=class{static{o(this,"UpdateOrganizationIdentityDto");}displayName;description;avatarUrl;bannerUrl;socialLinks};j([classValidator.IsString(),classValidator.IsNotEmpty(),classValidator.Length(1,32),classValidator.IsOptional(),_("design:type",String)],R.prototype,"displayName",void 0);j([classValidator.IsString(),classValidator.Length(16,1024),classValidator.IsOptional(),_("design:type",String)],R.prototype,"description",void 0);j([classValidator.IsUrl({protocols:["http","https"]}),classValidator.IsOptional(),_("design:type",String)],R.prototype,"avatarUrl",void 0);j([classValidator.IsOptional(),classValidator.IsUrl({protocols:["http","https"]}),_("design:type",String)],R.prototype,"bannerUrl",void 0);j([classValidator.IsOptional(),classValidator.IsArray(),_("design:type",Array)],R.prototype,"socialLinks",void 0);exports.OrganizationEventTicketType = void 0;(function(e){e.ETicket="e-ticket",e.Other="other";})(exports.OrganizationEventTicketType||(exports.OrganizationEventTicketType={}));exports.OrganizationEventTicketCategory = void 0;(function(e){e.Entry="entry",e.Package="package",e.Meal="meal",e.Drink="drink",e.Parking="parking",e.Accommodation="accommodation",e.Camping="camping",e.Locker="locker",e.Shuttle="shuttle",e.Other="other";})(exports.OrganizationEventTicketCategory||(exports.OrganizationEventTicketCategory={}));exports.OrganizationEventStyleType = void 0;(function(e){e.Music="music",e.Dress="dress",e.Sport="sport",e.Food="food",e.Art="art";})(exports.OrganizationEventStyleType||(exports.OrganizationEventStyleType={}));exports.OrganizationEventType = void 0;(function(e){e.Clubbing="clubbing",e.Concert="concert",e.Afterwork="afterwork",e.DancingLunch="dancing_lunch",e.Diner="diner",e.Garden="garden",e.AfterBeach="after_beach",e.Festival="festival",e.Spectacle="spectacle",e.Cruise="cruise",e.OutsideAnimation="outside_animation",e.Sport="sport",e.Match="match",e.Seminar="seminar",e.Conference="conference",e.WellnessDay="wellness_day",e.Workshop="workshop",e.TradeFair="trade_fair",e.ConsumerShow="consumer_show",e.Membership="membership";})(exports.OrganizationEventType||(exports.OrganizationEventType={}));exports.OrganizationEventVisibilityType = void 0;(function(e){e.Public="public",e.Unlisted="unlisted",e.Private="private";})(exports.OrganizationEventVisibilityType||(exports.OrganizationEventVisibilityType={}));exports.OrganizationMemberStatus = void 0;(function(e){e.Pending="pending",e.Accepted="accepted",e.Rejected="rejected";})(exports.OrganizationMemberStatus||(exports.OrganizationMemberStatus={}));exports.OrganizationMemberRole = void 0;(function(e){e.Member="member",e.Manager="manager",e.Admin="admin",e.Owner="owner";})(exports.OrganizationMemberRole||(exports.OrganizationMemberRole={}));exports.OrganizationSocialType = void 0;(function(e){e.Facebook="facebook",e.Twitter="twitter",e.Instagram="instagram",e.Linkedin="linkedin",e.Youtube="youtube",e.Website="website";})(exports.OrganizationSocialType||(exports.OrganizationSocialType={}));exports.UserTokenType = void 0;(function(e){e.Authentication="authentication",e.OrganizationInvite="organization_invite",e.PasswordRecovery="password_recovery",e.EmailValidation="email_validation",e.PhoneValidation="phone_validation";})(exports.UserTokenType||(exports.UserTokenType={}));exports.UserRole = void 0;(function(e){e.User="user",e.Developer="developer",e.Admin="admin";})(exports.UserRole||(exports.UserRole={}));exports.OrderStatus = void 0;(function(e){e.Created="created",e.Cancelled="cancelled",e.Completed="completed",e.Pending="pending",e.Confirmed="confirmed",e.Declined="declined",e.Refunded="refunded",e.PartiallyRefunded="partially_refunded",e.Expired="expired";})(exports.OrderStatus||(exports.OrderStatus={}));exports.Currency = void 0;(function(e){e.EUR="EUR",e.USD="USD",e.GBP="GBP";})(exports.Currency||(exports.Currency={}));exports.Language = void 0;(function(e){e.FR="fr",e.EN="en";})(exports.Language||(exports.Language={}));function S(e,t,r,s){var i=arguments.length,n=i<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,r):s,p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,r,s);else for(var a=e.length-1;a>=0;a--)(p=e[a])&&(n=(i<3?p(n):i>3?p(t,r,n):p(t,r))||n);return i>3&&n&&Object.defineProperty(t,r,n),n}o(S,"_ts_decorate");function L(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}o(L,"_ts_metadata");var u=class{static{o(this,"CreateOrganizationEventDto");}title;slug;description;type;visibility;flyers;trailers;location;tickets;styles;startAt;endAt};S([classValidator.IsString(),classValidator.Length(1,64),L("design:type",String)],u.prototype,"title",void 0);S([classValidator.IsOptional(),classValidator.IsString(),classValidator.IsLowercase(),classValidator.Length(1,48),L("design:type",String)],u.prototype,"slug",void 0);S([classValidator.IsString(),classValidator.Length(16,2048),L("design:type",String)],u.prototype,"description",void 0);S([classValidator.IsEnum(exports.OrganizationEventType),L("design:type",typeof exports.OrganizationEventType>"u"?Object:exports.OrganizationEventType)],u.prototype,"type",void 0);S([classValidator.IsEnum(exports.OrganizationEventVisibilityType),L("design:type",typeof exports.OrganizationEventVisibilityType>"u"?Object:exports.OrganizationEventVisibilityType)],u.prototype,"visibility",void 0);S([classValidator.IsDateString(),L("design:type",typeof Date>"u"?Object:Date)],u.prototype,"startAt",void 0);S([classValidator.IsDateString(),L("design:type",typeof Date>"u"?Object:Date)],u.prototype,"endAt",void 0);var ye=class extends u{static{o(this,"UpdateOrganizationEventDto");}};function m(e,t,r,s){var i=arguments.length,n=i<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,r):s,p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,r,s);else for(var a=e.length-1;a>=0;a--)(p=e[a])&&(n=(i<3?p(n):i>3?p(t,r,n):p(t,r))||n);return i>3&&n&&Object.defineProperty(t,r,n),n}o(m,"_ts_decorate");function g(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}o(g,"_ts_metadata");var c=class{static{o(this,"CreateOrganizationEventTicketDto");}name;description;price;quantity;type;category;currency;isVisible;isFeesIncluded;startAt;endAt};m([classValidator.IsString(),classValidator.Length(1,128),g("design:type",String)],c.prototype,"name",void 0);m([classValidator.IsString(),classValidator.Length(1,1024),g("design:type",String)],c.prototype,"description",void 0);m([classValidator.IsNumber(),classValidator.Min(0),g("design:type",Number)],c.prototype,"price",void 0);m([classValidator.IsNumber(),classValidator.Min(0),g("design:type",Number)],c.prototype,"quantity",void 0);m([classValidator.IsEnum(exports.OrganizationEventTicketType),g("design:type",typeof exports.OrganizationEventTicketType>"u"?Object:exports.OrganizationEventTicketType)],c.prototype,"type",void 0);m([classValidator.IsEnum(exports.OrganizationEventTicketCategory),g("design:type",typeof exports.OrganizationEventTicketCategory>"u"?Object:exports.OrganizationEventTicketCategory)],c.prototype,"category",void 0);m([classValidator.IsEnum(exports.Currency),g("design:type",typeof exports.Currency>"u"?Object:exports.Currency)],c.prototype,"currency",void 0);m([classValidator.IsBoolean(),g("design:type",Boolean)],c.prototype,"isVisible",void 0);m([classValidator.IsBoolean(),g("design:type",Boolean)],c.prototype,"isFeesIncluded",void 0);m([classValidator.IsDateString(),classValidator.IsOptional(),g("design:type",typeof Date>"u"?Object:Date)],c.prototype,"startAt",void 0);m([classValidator.IsDateString(),classValidator.IsOptional(),g("design:type",typeof Date>"u"?Object:Date)],c.prototype,"endAt",void 0);var _e=class extends c{static{o(this,"UpdateOrganizationEventTicketDto");}};function Ae(e,t,r,s){var i=arguments.length,n=i<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,r):s,p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,r,s);else for(var a=e.length-1;a>=0;a--)(p=e[a])&&(n=(i<3?p(n):i>3?p(t,r,n):p(t,r))||n);return i>3&&n&&Object.defineProperty(t,r,n),n}o(Ae,"_ts_decorate");function Ie(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}o(Ie,"_ts_metadata");var q=class{static{o(this,"CreateOrganizationMemberDto");}user;role};Ae([classValidator.IsString(),classValidator.IsNotEmpty(),Ie("design:type",String)],q.prototype,"user",void 0);Ae([classValidator.IsEnum(exports.OrganizationMemberRole),classValidator.IsNotEmpty(),Ie("design:type",typeof exports.OrganizationMemberRole>"u"?Object:exports.OrganizationMemberRole)],q.prototype,"role",void 0);function st(e,t,r,s){var i=arguments.length,n=i<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,r):s,p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,r,s);else for(var a=e.length-1;a>=0;a--)(p=e[a])&&(n=(i<3?p(n):i>3?p(t,r,n):p(t,r))||n);return i>3&&n&&Object.defineProperty(t,r,n),n}o(st,"_ts_decorate");function nt(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}o(nt,"_ts_metadata");var Q=class{static{o(this,"UpdateOrganizationMemberDto");}role};st([classValidator.IsEnum(exports.OrganizationMemberRole),classValidator.IsNotEmpty(),nt("design:type",typeof exports.OrganizationMemberRole>"u"?Object:exports.OrganizationMemberRole)],Q.prototype,"role",void 0);var Le=class{static{o(this,"CreateUserDto");}identifier;password;identity;addresses};var De=class{static{o(this,"SignInUserDto");}identifier;password};function d(e,t,r,s){var i=arguments.length,n=i<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,r):s,p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,r,s);else for(var a=e.length-1;a>=0;a--)(p=e[a])&&(n=(i<3?p(n):i>3?p(t,r,n):p(t,r))||n);return i>3&&n&&Object.defineProperty(t,r,n),n}o(d,"_ts_decorate");function f(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}o(f,"_ts_metadata");var k=class{static{o(this,"UpdateUserDto");}identifier;identity;password};d([classValidator.IsOptional(),classValidator.IsObject(),classValidator.ValidateNested(),classTransformer.Type(()=>G),f("design:type",typeof G>"u"?Object:G)],k.prototype,"identifier",void 0);d([classValidator.IsOptional(),classValidator.IsObject(),classValidator.ValidateNested(),classTransformer.Type(()=>y),f("design:type",typeof y>"u"?Object:y)],k.prototype,"identity",void 0);d([classValidator.IsOptional(),classValidator.IsString(),classValidator.MinLength(8),classValidator.MaxLength(128),f("design:type",String)],k.prototype,"password",void 0);var G=class{static{o(this,"UpdateIdentifierDto");}email;phoneNumber;username};d([classValidator.IsOptional(),classValidator.IsString(),classValidator.IsEmail(),f("design:type",String)],G.prototype,"email",void 0);d([classValidator.IsOptional(),classValidator.IsString(),classValidator.IsPhoneNumber(),f("design:type",String)],G.prototype,"phoneNumber",void 0);d([classValidator.IsOptional(),classValidator.IsString(),classValidator.MinLength(3),f("design:type",String)],G.prototype,"username",void 0);var y=class{static{o(this,"UpdateIdentityDto");}firstName;lastName;displayName;description;avatarUrl;bannerUrl;gender;birthDate};d([classValidator.IsOptional(),classValidator.IsString(),classValidator.Length(2,32),classValidator.Matches(C,{message:"First name must be composed of letters only"}),f("design:type",String)],y.prototype,"firstName",void 0);d([classValidator.IsOptional(),classValidator.IsString(),classValidator.Length(2,32),classValidator.Matches(C,{message:"Last name must be composed of letters only"}),f("design:type",String)],y.prototype,"lastName",void 0);d([classValidator.IsOptional(),classValidator.IsString(),classValidator.Length(1,32),f("design:type",String)],y.prototype,"displayName",void 0);d([classValidator.IsOptional(),classValidator.IsString(),classValidator.Length(1,128),f("design:type",String)],y.prototype,"description",void 0);d([classValidator.IsOptional(),classValidator.IsUrl(),f("design:type",Object)],y.prototype,"avatarUrl",void 0);d([classValidator.IsOptional(),classValidator.IsUrl(),f("design:type",Object)],y.prototype,"bannerUrl",void 0);d([classValidator.IsOptional(),f("design:type",String)],y.prototype,"gender",void 0);d([classValidator.IsOptional(),classValidator.IsDateString(),f("design:type",typeof Date>"u"?Object:Date)],y.prototype,"birthDate",void 0);var b=typeof window<"u";var ut=lt__default.default.create({headers:{"Content-Type":"application/json",Accept:"application/json",...!b&&{"User-Agent":"tonightpass-api-client"}},responseType:"json",transformRequest:[function(e){return JSON.stringify(e)}],withCredentials:b}),Ge=o(async(e,t)=>ut(e,{...t}).then(s=>s).catch(s=>{throw s.data||console.error(s),s.data}),"request");var T=class extends Error{static{o(this,"TonightPassAPIError");}response;data;status;constructor(t,r){super(r.message),this.response=t,this.data=r,this.status=t.status;}},$=class{static{o(this,"Client");}options;url;constructor(t){this.options=t,this.url=(r,s)=>{let i=this.options.baseURL||ee;return pathcat.pathcat(i,r,s)};}setOptions(t){this.options=t;}async get(t,r,s){return this.requester("GET",t,void 0,r,s)}async post(t,r,s,i){return this.requester("POST",t,r,s,i)}async put(t,r,s,i){return this.requester("PUT",t,r,s,i)}async patch(t,r,s,i){return this.requester("PATCH",t,r,s,i)}async delete(t,r,s,i){return this.requester("DELETE",t,r,s,i)}async requester(t,r,s,i={},n={}){let p=this.url(r,i);if(s!==void 0&&t==="GET")throw new Error("Cannot send a GET request with a body");let a=await Ge(p,{method:t,data:s,...n}),X=a.data;if(!X.success)throw new T(a,X);return X.data}};function z(e){return e}o(z,"sdk");var ze=e=>({signIn:o(async t=>e.post("/auth/sign-in",t),"signIn"),signUp:o(async t=>e.post("/auth/sign-up",t),"signUp"),signOut:o(async()=>e.post("/auth/sign-out",null),"signOut"),refreshToken:o(async()=>e.post("/auth/refresh-token",null),"refreshToken"),oauth2:{google:{connect:o(t=>{if(b)window.location.href=e.url("/oauth2/google",t||{});else throw new Error("Google OAuth2 is only available in the browser")},"connect")},twitter:{connect:o(t=>{if(b)window.location.href=e.url("/oauth2/twitter",t||{});else throw new Error("Twitter OAuth2 is only available in the browser")},"connect")},facebook:{connect:o(t=>{if(b)window.location.href=e.url("/oauth2/facebook",t||{});else throw new Error("Facebook OAuth2 is only available in the browser")},"connect")}}});var Me=e=>({categories:{getAll:o(async t=>e.get("/careers/categories",t),"getAll")},employmentTypes:{getAll:o(async t=>e.get("/careers/employmentTypes",t),"getAll")},jobs:{getAll:o(async t=>e.get("/careers/jobs",t),"getAll"),get:o(async t=>e.get("/careers/jobs/:id",{id:t}),"get")},offices:{getAll:o(async t=>e.get("/careers/offices",t),"getAll")}});var ke=e=>({getAll:o(async()=>e.get("/health"),"getAll"),database:o(async()=>e.get("/health/database"),"database"),http:o(async()=>e.get("/health/http"),"http")});var qe=o(e=>({account:o(async t=>e.get("/organizations/:slug/billing/account",{slug:t}),"account"),link:o(t=>{if(b)window.location.href=e.url("/organizations/:slug/billing/link",{slug:t});else throw new Error("Billing link is only available in the browser")},"link"),dashboard:o(t=>{if(b)window.location.href=e.url("/organizations/:slug/billing/dashboard",{slug:t});else throw new Error("Billing dashboard is only available in the browser")},"dashboard")}),"organizationsBilling");var Fe=o(e=>({getAll:o(async()=>e.get("/organizations/events/styles"),"getAll"),get:o(async t=>e.get("/organizations/events/styles/:slug",{slug:t}),"get"),create:o(async t=>e.post("/organizations/events/styles",t),"create"),update:o(async(t,r)=>e.put("/organizations/events/styles/:slug",r,{slug:t}),"update"),delete:o(async t=>e.delete("/organizations/events/styles/:slug",null,{slug:t}),"delete")}),"organizationsEventsStyles");var $e=o(e=>({getAll:o(async(t,r)=>e.get("/organizations/:slug/events/:eventSlug/tickets",{slug:t,eventSlug:r}),"getAll"),get:o(async(t,r,s)=>e.get("/organizations/:slug/events/:eventSlug/tickets/:ticketId",{slug:t,eventSlug:r,ticketId:s}),"get"),create:o(async(t,r,s)=>e.post("/organizations/:slug/events/:eventSlug/tickets",s,{slug:t,eventSlug:r}),"create"),update:o(async(t,r,s,i)=>e.put("/organizations/:slug/events/:eventSlug/tickets/:ticketId",i,{slug:t,eventSlug:r,ticketId:s}),"update"),delete:o(async(t,r,s)=>e.delete("/organizations/:slug/events/:eventSlug/tickets/:ticketId",null,{slug:t,eventSlug:r,ticketId:s}),"delete")}),"organizationsEventsTickets");var Xe=o(e=>({getAll:o(async t=>e.get("/organizations/:slug/events",{slug:t}),"getAll"),getSuggestions:o(async t=>e.get("/organizations/events/suggestions",t),"getSuggestions"),get:o(async(t,r)=>e.get("/organizations/:organizationSlug/events/:eventSlug",{organizationSlug:t,eventSlug:r}),"get"),create:o(async(t,r)=>e.post("/organizations/:slug/events",r,{slug:t}),"create"),update:o(async(t,r,s)=>e.put("/organizations/:organizationSlug/events/:eventSlug",s,{organizationSlug:t,eventSlug:r}),"update"),delete:o(async(t,r)=>e.delete("/organizations/:organizationSlug/events/:eventSlug",null,{organizationSlug:t,eventSlug:r}),"delete"),styles:Fe(e),tickets:$e(e)}),"organizationsEvents");var Ce=o(e=>({getAll:o(async()=>e.get("/organizations/members"),"getAll"),delete:o(async t=>e.delete("/organizations/members/:id",null,{id:t}),"delete")}),"organizationsMembers");var Ve=e=>({getAll:o(async()=>e.get("/organizations"),"getAll"),get:o(async t=>e.get("/organizations/:slug",{slug:t}),"get"),create:o(async t=>e.post("/organizations",t),"create"),update:o(async(t,r)=>e.put("/organizations/:slug",r,{slug:t}),"update"),delete:o(async t=>e.delete("/organizations/:slug",null,{slug:t}),"delete"),billing:qe(e),events:Xe(e),members:Ce(e)});var We=e=>({get:o(async t=>e.get("/profiles/:username",{username:t}),"get")});var He=e=>({getAll:o(async()=>e.get("/users"),"getAll"),get:o(async t=>e.get("/users",{id:t}),"get"),me:o(async()=>e.get("/users/me"),"me"),check:o(async(t,r)=>e.get("/users/check/:identifier",{identifier:t,suggestions:r}),"check"),update:o(async(t,r)=>e.put("/users/:id",r,{id:t}),"update")});var Ze=class{static{o(this,"TonightPass");}client;auth;careers;health;organizations;profiles;users;constructor(t){this.client=new $(t),this.auth=ze(this.client),this.careers=Me(this.client),this.health=ke(this.client),this.organizations=Ve(this.client),this.profiles=We(this.client),this.users=He(this.client);}};
|
|
14
14
|
|
|
15
15
|
exports.BCRYPT_HASH = vt;
|
|
16
16
|
exports.Client = $;
|
|
@@ -31,19 +31,19 @@ exports.SignInUserDto = De;
|
|
|
31
31
|
exports.TonightPass = Ze;
|
|
32
32
|
exports.TonightPassAPIError = T;
|
|
33
33
|
exports.UpdateOrganizationDto = P;
|
|
34
|
-
exports.UpdateOrganizationEventDto =
|
|
34
|
+
exports.UpdateOrganizationEventDto = ye;
|
|
35
35
|
exports.UpdateOrganizationEventTicketDto = _e;
|
|
36
36
|
exports.UpdateOrganizationIdentityDto = R;
|
|
37
37
|
exports.UpdateOrganizationMemberDto = Q;
|
|
38
|
-
exports.UpdateUserDto =
|
|
39
|
-
exports.auth =
|
|
40
|
-
exports.careers =
|
|
41
|
-
exports.health =
|
|
38
|
+
exports.UpdateUserDto = k;
|
|
39
|
+
exports.auth = ze;
|
|
40
|
+
exports.careers = Me;
|
|
41
|
+
exports.health = ke;
|
|
42
42
|
exports.isBrowser = b;
|
|
43
43
|
exports.organizations = Ve;
|
|
44
44
|
exports.profiles = We;
|
|
45
45
|
exports.request = Ge;
|
|
46
|
-
exports.sdk =
|
|
46
|
+
exports.sdk = z;
|
|
47
47
|
exports.users = He;
|
|
48
48
|
//# sourceMappingURL=out.js.map
|
|
49
49
|
//# sourceMappingURL=index.js.map
|