tonightpass 0.0.25 → 0.0.26
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 +6 -0
- package/dist/index.d.mts +200 -104
- package/dist/index.d.ts +200 -104
- package/dist/index.js +30 -26
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/rest/dtos/organizations/events/create-organization-event.dto.ts +15 -0
- package/src/rest/dtos/organizations/events/index.ts +3 -0
- package/src/rest/dtos/organizations/events/tickets/create-organization-event-ticket.dto.ts +20 -0
- package/src/rest/dtos/organizations/events/tickets/index.ts +2 -0
- package/src/rest/dtos/organizations/events/tickets/update-organization-event-ticket.dto.ts +3 -0
- package/src/rest/dtos/organizations/events/update-organization-event.dto.ts +3 -0
- package/src/rest/dtos/organizations/index.ts +1 -0
- package/src/rest/types/index.ts +0 -1
- package/src/rest/types/order/index.ts +3 -3
- package/src/rest/types/organizations/events/index.ts +91 -0
- package/src/rest/types/organizations/events/tickets/index.ts +71 -0
- package/src/rest/types/organizations/index.ts +14 -58
- package/src/rest/types/organizations/members/index.ts +52 -0
- package/src/sdk/organizations.ts +90 -1
- package/src/rest/types/event/index.ts +0 -60
- package/src/rest/types/event/ticket/index.ts +0 -36
package/dist/index.d.ts
CHANGED
|
@@ -42,7 +42,7 @@ type User = {
|
|
|
42
42
|
password: string;
|
|
43
43
|
identity: UserIdentity;
|
|
44
44
|
role: UserRole;
|
|
45
|
-
addresses: Location[];
|
|
45
|
+
addresses: Location$1[];
|
|
46
46
|
preferences: UserPreferences;
|
|
47
47
|
connections: UserConnection[];
|
|
48
48
|
verified: boolean;
|
|
@@ -178,15 +178,28 @@ type CareersEndpoints = Endpoint<"GET", "/careers/categories", CareersCategory[]
|
|
|
178
178
|
cityNameLike?: string;
|
|
179
179
|
}>;
|
|
180
180
|
|
|
181
|
-
type
|
|
181
|
+
type Health<Key extends string> = {
|
|
182
|
+
status: string;
|
|
183
|
+
details: {
|
|
184
|
+
[key in Key]: {
|
|
185
|
+
status: string;
|
|
186
|
+
details: {
|
|
187
|
+
status: string;
|
|
188
|
+
};
|
|
189
|
+
};
|
|
190
|
+
};
|
|
191
|
+
};
|
|
192
|
+
type HealthEndpoints = Endpoint<"GET", "/health", [Health<"app">, Health<"database">]> | Endpoint<"GET", "/health/database", Health<"database">> | Endpoint<"GET", "/health/http", Health<"app">>;
|
|
193
|
+
|
|
194
|
+
type OrganizationEventTicket = {
|
|
182
195
|
id: string;
|
|
183
196
|
name: string;
|
|
184
197
|
description?: string;
|
|
185
198
|
price: number;
|
|
186
199
|
displayPrice: number;
|
|
187
200
|
quantity: number;
|
|
188
|
-
type:
|
|
189
|
-
category:
|
|
201
|
+
type: OrganizationEventTicketType;
|
|
202
|
+
category: OrganizationEventTicketCategory;
|
|
190
203
|
currency: Currency;
|
|
191
204
|
vatRate: number;
|
|
192
205
|
externalId?: string;
|
|
@@ -197,8 +210,8 @@ type EventTicket = {
|
|
|
197
210
|
updatedAt: Date;
|
|
198
211
|
createdAt: Date;
|
|
199
212
|
};
|
|
200
|
-
type
|
|
201
|
-
declare enum
|
|
213
|
+
type OrganizationEventTicketType = "e-ticket" | "other";
|
|
214
|
+
declare enum OrganizationEventTicketCategory {
|
|
202
215
|
Entry = "entry",
|
|
203
216
|
Package = "package",
|
|
204
217
|
Meal = "meal",
|
|
@@ -210,88 +223,26 @@ declare enum EventTicketCategory {
|
|
|
210
223
|
Shuttle = "shuttle",
|
|
211
224
|
Other = "other"
|
|
212
225
|
}
|
|
226
|
+
type OrganizationEventTicketEndpoints = Endpoint<"GET", "/organizations/:slug/events/:eventSlug/tickets", OrganizationEventTicket[]> | Endpoint<"GET", "/organizations/:slug/events/:eventSlug/tickets/:ticketId", OrganizationEventTicket> | Endpoint<"POST", "/organizations/:slug/events/:eventSlug/tickets", OrganizationEventTicket, CreateOrganizationEventTicketDto> | Endpoint<"PUT", "/organizations/:slug/events/:eventSlug/tickets/:ticketId", OrganizationEventTicket, UpdateOrganizationEventTicketDto> | Endpoint<"DELETE", "/organizations/:slug/events/:eventSlug/tickets/:ticketId", OrganizationEventTicket[], null>;
|
|
213
227
|
|
|
214
|
-
|
|
215
|
-
role: OrganizationMemberRole;
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
type Organization = {
|
|
219
|
-
id: string;
|
|
220
|
-
slug: string;
|
|
221
|
-
identity: OrganizationIdentity;
|
|
222
|
-
members: OrganizationMember[];
|
|
223
|
-
location?: Location;
|
|
224
|
-
events: Event[];
|
|
225
|
-
savedTickets: EventTicket[];
|
|
226
|
-
verified: boolean;
|
|
227
|
-
billing: OrganizationBilling;
|
|
228
|
-
updatedAt: Date;
|
|
229
|
-
createdAt: Date;
|
|
230
|
-
};
|
|
231
|
-
type OrganizationBilling = {
|
|
232
|
-
account: string;
|
|
233
|
-
};
|
|
234
|
-
type OrganizationBillingAccount = stripe__default.Account;
|
|
235
|
-
type OrganizationIdentity = Profile & {
|
|
236
|
-
socialLinks: OrganizationSocialLink[];
|
|
237
|
-
metadata: ProfileMetadata & {
|
|
238
|
-
eventsCount: number;
|
|
239
|
-
viewsCount: number;
|
|
240
|
-
membersCount: number;
|
|
241
|
-
};
|
|
242
|
-
};
|
|
243
|
-
type OrganizationSocialLink = {
|
|
244
|
-
type: OrganizationSocialType;
|
|
245
|
-
url: string;
|
|
246
|
-
};
|
|
247
|
-
declare enum OrganizationSocialType {
|
|
248
|
-
Facebook = "facebook",
|
|
249
|
-
Twitter = "twitter",
|
|
250
|
-
Instagram = "instagram",
|
|
251
|
-
Linkedin = "linkedin",
|
|
252
|
-
Youtube = "youtube",
|
|
253
|
-
Website = "website"
|
|
254
|
-
}
|
|
255
|
-
type OrganizationMember = {
|
|
256
|
-
organization: Organization;
|
|
257
|
-
role: OrganizationMemberRole;
|
|
258
|
-
status: OrganizationMemberStatus;
|
|
259
|
-
updatedAt: Date;
|
|
260
|
-
createdAt: Date;
|
|
261
|
-
user?: User;
|
|
262
|
-
token?: UserToken;
|
|
263
|
-
};
|
|
264
|
-
declare enum OrganizationMemberStatus {
|
|
265
|
-
Pending = "pending",
|
|
266
|
-
Accepted = "accepted",
|
|
267
|
-
Rejected = "rejected"
|
|
268
|
-
}
|
|
269
|
-
declare enum OrganizationMemberRole {
|
|
270
|
-
Member = "member",
|
|
271
|
-
Manager = "manager",
|
|
272
|
-
Admin = "admin",
|
|
273
|
-
Owner = "owner"
|
|
274
|
-
}
|
|
275
|
-
type OrganizationEndpoints = Endpoint<"GET", "/organizations", Organization[]> | Endpoint<"GET", "/organizations/:slug", Organization> | Endpoint<"POST", "/organizations", Organization, CreateOrganizationDto> | Endpoint<"PUT", "/organizations/:slug", Organization, UpdateOrganizationDto> | Endpoint<"DELETE", "/organizations/:slug", boolean, null> | Endpoint<"GET", "/organizations/members", OrganizationMember[]> | Endpoint<"DELETE", "/organizations/members/:id", OrganizationMember[], null> | Endpoint<"GET", "/organizations/:slug/members", OrganizationMember[]> | Endpoint<"POST", "/organizations/:slug/members", OrganizationMember, OrganizationMemberDto> | Endpoint<"PUT", "/organizations/:organizationSlug/members/:userId", OrganizationMember, UpdateOrganizationMemberDto> | Endpoint<"DELETE", "/organizations/:organizationSlug/members/:userId", OrganizationMember[], null> | Endpoint<"GET", "/organizations/:slug/billing/account", OrganizationBillingAccount> | Endpoint<"GET", "/organizations/:slug/billing/link", void> | Endpoint<"GET", "/organizations/:slug/billing/dashboard", void>;
|
|
276
|
-
|
|
277
|
-
type Event = {
|
|
228
|
+
type OrganizationEvent = {
|
|
278
229
|
title: string;
|
|
279
230
|
description: string;
|
|
280
231
|
slug: string;
|
|
281
232
|
organization: Organization;
|
|
282
|
-
type:
|
|
233
|
+
type: OrganizationEventType;
|
|
283
234
|
public: boolean;
|
|
284
235
|
flyers: string[];
|
|
285
236
|
trailers: string[];
|
|
286
|
-
location: Location;
|
|
287
|
-
tickets:
|
|
288
|
-
styles:
|
|
237
|
+
location: Location$1;
|
|
238
|
+
tickets: OrganizationEventTicket[];
|
|
239
|
+
styles: OrganizationEventStyle[];
|
|
289
240
|
startAt: Date;
|
|
290
241
|
endAt: Date;
|
|
291
242
|
updatedAt: Date;
|
|
292
243
|
createdAt: Date;
|
|
293
244
|
};
|
|
294
|
-
declare enum
|
|
245
|
+
declare enum OrganizationEventType {
|
|
295
246
|
Clubbing = "clubbing",
|
|
296
247
|
Concert = "concert",
|
|
297
248
|
Afterwork = "afterwork",
|
|
@@ -313,31 +264,23 @@ declare enum EventType {
|
|
|
313
264
|
ConsumerShow = "consumer_show",
|
|
314
265
|
Membership = "membership"
|
|
315
266
|
}
|
|
316
|
-
type
|
|
317
|
-
type:
|
|
267
|
+
type OrganizationEventStyle = {
|
|
268
|
+
type: OrganizationEventStyleType;
|
|
318
269
|
emoji: string;
|
|
319
270
|
name: string;
|
|
320
271
|
};
|
|
321
|
-
declare enum
|
|
272
|
+
declare enum OrganizationEventStyleType {
|
|
322
273
|
Music = "music",
|
|
323
274
|
Dress = "dress",
|
|
324
275
|
Sport = "sport",
|
|
325
276
|
Food = "food",
|
|
326
277
|
Art = "art"
|
|
327
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;
|
|
328
280
|
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
[key in Key]: {
|
|
333
|
-
status: string;
|
|
334
|
-
details: {
|
|
335
|
-
status: string;
|
|
336
|
-
};
|
|
337
|
-
};
|
|
338
|
-
};
|
|
339
|
-
};
|
|
340
|
-
type HealthEndpoints = Endpoint<"GET", "/health", [Health<"app">, Health<"database">]> | Endpoint<"GET", "/health/database", Health<"database">> | Endpoint<"GET", "/health/http", Health<"app">>;
|
|
281
|
+
declare class UpdateOrganizationMemberDto {
|
|
282
|
+
role: OrganizationMemberRole;
|
|
283
|
+
}
|
|
341
284
|
|
|
342
285
|
type UserToken = {
|
|
343
286
|
id: string;
|
|
@@ -356,6 +299,67 @@ declare enum UserTokenType {
|
|
|
356
299
|
PhoneValidation = "phone_validation"
|
|
357
300
|
}
|
|
358
301
|
|
|
302
|
+
type OrganizationMember = {
|
|
303
|
+
organization: Organization;
|
|
304
|
+
role: OrganizationMemberRole;
|
|
305
|
+
status: OrganizationMemberStatus;
|
|
306
|
+
updatedAt: Date;
|
|
307
|
+
createdAt: Date;
|
|
308
|
+
user?: User;
|
|
309
|
+
token?: UserToken;
|
|
310
|
+
};
|
|
311
|
+
declare enum OrganizationMemberStatus {
|
|
312
|
+
Pending = "pending",
|
|
313
|
+
Accepted = "accepted",
|
|
314
|
+
Rejected = "rejected"
|
|
315
|
+
}
|
|
316
|
+
declare enum OrganizationMemberRole {
|
|
317
|
+
Member = "member",
|
|
318
|
+
Manager = "manager",
|
|
319
|
+
Admin = "admin",
|
|
320
|
+
Owner = "owner"
|
|
321
|
+
}
|
|
322
|
+
type OrganizationMembersEndpoints = Endpoint<"GET", "/organizations/members", OrganizationMember[]> | Endpoint<"DELETE", "/organizations/members/:id", OrganizationMember[], null> | Endpoint<"GET", "/organizations/:slug/members", OrganizationMember[]> | Endpoint<"POST", "/organizations/:slug/members", OrganizationMember, OrganizationMemberDto> | Endpoint<"PUT", "/organizations/:organizationSlug/members/:userId", OrganizationMember, UpdateOrganizationMemberDto> | Endpoint<"DELETE", "/organizations/:organizationSlug/members/:userId", OrganizationMember[], null>;
|
|
323
|
+
|
|
324
|
+
type Organization = {
|
|
325
|
+
id: string;
|
|
326
|
+
slug: string;
|
|
327
|
+
identity: OrganizationIdentity;
|
|
328
|
+
members: OrganizationMember[];
|
|
329
|
+
location?: Location$1;
|
|
330
|
+
events: OrganizationEvent[];
|
|
331
|
+
savedTickets: OrganizationEventTicket[];
|
|
332
|
+
verified: boolean;
|
|
333
|
+
billing: OrganizationBilling;
|
|
334
|
+
updatedAt: Date;
|
|
335
|
+
createdAt: Date;
|
|
336
|
+
};
|
|
337
|
+
type OrganizationBilling = {
|
|
338
|
+
account: string;
|
|
339
|
+
};
|
|
340
|
+
type OrganizationBillingAccount = stripe__default.Account;
|
|
341
|
+
type OrganizationIdentity = Profile & {
|
|
342
|
+
socialLinks: OrganizationSocialLink[];
|
|
343
|
+
metadata: ProfileMetadata & {
|
|
344
|
+
eventsCount: number;
|
|
345
|
+
viewsCount: number;
|
|
346
|
+
membersCount: number;
|
|
347
|
+
};
|
|
348
|
+
};
|
|
349
|
+
type OrganizationSocialLink = {
|
|
350
|
+
type: OrganizationSocialType;
|
|
351
|
+
url: string;
|
|
352
|
+
};
|
|
353
|
+
declare enum OrganizationSocialType {
|
|
354
|
+
Facebook = "facebook",
|
|
355
|
+
Twitter = "twitter",
|
|
356
|
+
Instagram = "instagram",
|
|
357
|
+
Linkedin = "linkedin",
|
|
358
|
+
Youtube = "youtube",
|
|
359
|
+
Website = "website"
|
|
360
|
+
}
|
|
361
|
+
type OrganizationEndpoints = Endpoint<"GET", "/organizations", Organization[]> | Endpoint<"GET", "/organizations/:slug", Organization> | Endpoint<"POST", "/organizations", Organization, CreateOrganizationDto> | Endpoint<"PUT", "/organizations/:slug", Organization, UpdateOrganizationDto> | Endpoint<"DELETE", "/organizations/:slug", Organization, null> | Endpoint<"GET", "/organizations/:slug/billing/account", OrganizationBillingAccount> | Endpoint<"GET", "/organizations/:slug/billing/link", void> | Endpoint<"GET", "/organizations/:slug/billing/dashboard", void> | OrganizationEventEndpoints | OrganizationMembersEndpoints;
|
|
362
|
+
|
|
359
363
|
declare enum OrderStatus {
|
|
360
364
|
Created = "created",
|
|
361
365
|
Cancelled = "cancelled",
|
|
@@ -369,7 +373,7 @@ declare enum OrderStatus {
|
|
|
369
373
|
}
|
|
370
374
|
type OrderItem = {
|
|
371
375
|
id: string;
|
|
372
|
-
ticket:
|
|
376
|
+
ticket: OrganizationEventTicket;
|
|
373
377
|
isUsed: boolean;
|
|
374
378
|
updatedAt: Date;
|
|
375
379
|
createdAt: Date;
|
|
@@ -379,7 +383,7 @@ type Order = {
|
|
|
379
383
|
owner: User;
|
|
380
384
|
members: User[];
|
|
381
385
|
status: OrderStatus;
|
|
382
|
-
event:
|
|
386
|
+
event: OrganizationEvent;
|
|
383
387
|
items: OrderItem[];
|
|
384
388
|
promoCode?: PromoCode;
|
|
385
389
|
total: number;
|
|
@@ -413,7 +417,7 @@ interface ProfileMetadata {
|
|
|
413
417
|
}
|
|
414
418
|
type ProfileEndpoints = Endpoint<"GET", "/profiles/:username", UserIdentity | OrganizationIdentity>;
|
|
415
419
|
|
|
416
|
-
type Location = {
|
|
420
|
+
type Location$1 = {
|
|
417
421
|
name?: string;
|
|
418
422
|
address: string;
|
|
419
423
|
zipCode: string;
|
|
@@ -438,7 +442,7 @@ declare class CreateOrganizationDto {
|
|
|
438
442
|
slug?: string;
|
|
439
443
|
identity: CreateOrganizationIdentityDto;
|
|
440
444
|
members: OrganizationMemberDto[];
|
|
441
|
-
location?: Location;
|
|
445
|
+
location?: Location$1;
|
|
442
446
|
}
|
|
443
447
|
declare class CreateOrganizationIdentityDto {
|
|
444
448
|
displayName: string;
|
|
@@ -455,11 +459,45 @@ declare class OrganizationMemberDto {
|
|
|
455
459
|
declare class UpdateOrganizationDto extends CreateOrganizationDto {
|
|
456
460
|
}
|
|
457
461
|
|
|
462
|
+
declare class CreateOrganizationEventTicketDto {
|
|
463
|
+
id: string;
|
|
464
|
+
name: string;
|
|
465
|
+
description?: string;
|
|
466
|
+
price: number;
|
|
467
|
+
quantity: number;
|
|
468
|
+
type: OrganizationEventTicketType;
|
|
469
|
+
category: OrganizationEventTicketCategory;
|
|
470
|
+
currency: Currency;
|
|
471
|
+
isVisible: boolean;
|
|
472
|
+
isFeesIncluded: boolean;
|
|
473
|
+
startAt: Date;
|
|
474
|
+
endAt: Date;
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
declare class UpdateOrganizationEventTicketDto extends CreateOrganizationEventTicketDto {
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
declare class CreateOrganizationEventDto {
|
|
481
|
+
slug: string;
|
|
482
|
+
type: OrganizationEventType;
|
|
483
|
+
public: boolean;
|
|
484
|
+
flyers: string[];
|
|
485
|
+
trailers: string[];
|
|
486
|
+
location: Location;
|
|
487
|
+
tickets: CreateOrganizationEventTicketDto[];
|
|
488
|
+
styles: OrganizationEventStyle[];
|
|
489
|
+
startAt: Date;
|
|
490
|
+
endAt: Date;
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
declare class UpdateOrganizationEventDto extends CreateOrganizationEventDto {
|
|
494
|
+
}
|
|
495
|
+
|
|
458
496
|
declare class CreateUserDto {
|
|
459
497
|
identifier: UserIdentifier;
|
|
460
498
|
password: string;
|
|
461
499
|
identity: CreateUserIdentituDto;
|
|
462
|
-
addresses: Location[];
|
|
500
|
+
addresses: Location$1[];
|
|
463
501
|
}
|
|
464
502
|
declare class CreateUserIdentituDto {
|
|
465
503
|
firstName: string;
|
|
@@ -581,19 +619,31 @@ declare class Client {
|
|
|
581
619
|
}> | Extract<Endpoint<"GET", "/organizations/:slug", Organization>, {
|
|
582
620
|
path: Path;
|
|
583
621
|
method: "GET";
|
|
584
|
-
}> | Extract<Endpoint<"GET", "/organizations/
|
|
622
|
+
}> | Extract<Endpoint<"GET", "/organizations/:slug/billing/account", stripe.Stripe.Account>, {
|
|
585
623
|
path: Path;
|
|
586
624
|
method: "GET";
|
|
587
|
-
}> | Extract<Endpoint<"GET", "/organizations/:slug/
|
|
625
|
+
}> | Extract<Endpoint<"GET", "/organizations/:slug/billing/link", void>, {
|
|
588
626
|
path: Path;
|
|
589
627
|
method: "GET";
|
|
590
|
-
}> | Extract<Endpoint<"GET", "/organizations/:slug/billing/
|
|
628
|
+
}> | Extract<Endpoint<"GET", "/organizations/:slug/billing/dashboard", void>, {
|
|
591
629
|
path: Path;
|
|
592
630
|
method: "GET";
|
|
593
|
-
}> | Extract<Endpoint<"GET", "/organizations/:
|
|
631
|
+
}> | Extract<Endpoint<"GET", "/organizations/:organizationSlug/events", Event[]>, {
|
|
594
632
|
path: Path;
|
|
595
633
|
method: "GET";
|
|
596
|
-
}> | Extract<Endpoint<"GET", "/organizations/:
|
|
634
|
+
}> | Extract<Endpoint<"GET", "/organizations/:organizationSlug/events/:eventSlug", Event>, {
|
|
635
|
+
path: Path;
|
|
636
|
+
method: "GET";
|
|
637
|
+
}> | Extract<Endpoint<"GET", "/organizations/:slug/events/:eventSlug/tickets", OrganizationEventTicket[]>, {
|
|
638
|
+
path: Path;
|
|
639
|
+
method: "GET";
|
|
640
|
+
}> | Extract<Endpoint<"GET", "/organizations/:slug/events/:eventSlug/tickets/:ticketId", OrganizationEventTicket>, {
|
|
641
|
+
path: Path;
|
|
642
|
+
method: "GET";
|
|
643
|
+
}> | Extract<Endpoint<"GET", "/organizations/members", OrganizationMember[]>, {
|
|
644
|
+
path: Path;
|
|
645
|
+
method: "GET";
|
|
646
|
+
}> | Extract<Endpoint<"GET", "/organizations/:slug/members", OrganizationMember[]>, {
|
|
597
647
|
path: Path;
|
|
598
648
|
method: "GET";
|
|
599
649
|
}> | Extract<ProfileEndpoints, {
|
|
@@ -641,6 +691,12 @@ declare class Client {
|
|
|
641
691
|
}> | Extract<Endpoint<"POST", "/organizations", Organization, CreateOrganizationDto>, {
|
|
642
692
|
path: Path;
|
|
643
693
|
method: "POST";
|
|
694
|
+
}> | Extract<Endpoint<"POST", "/organizations/:organizationSlug/events", Event, CreateOrganizationEventDto>, {
|
|
695
|
+
path: Path;
|
|
696
|
+
method: "POST";
|
|
697
|
+
}> | Extract<Endpoint<"POST", "/organizations/:slug/events/:eventSlug/tickets", OrganizationEventTicket, CreateOrganizationEventTicketDto>, {
|
|
698
|
+
path: Path;
|
|
699
|
+
method: "POST";
|
|
644
700
|
}> | Extract<Endpoint<"POST", "/organizations/:slug/members", OrganizationMember, OrganizationMemberDto>, {
|
|
645
701
|
path: Path;
|
|
646
702
|
method: "POST";
|
|
@@ -653,6 +709,12 @@ declare class Client {
|
|
|
653
709
|
}>["body"], query?: Query<Path>, options?: APIRequestOptions): Promise<(Extract<Endpoint<"PUT", "/organizations/:slug", Organization, UpdateOrganizationDto>, {
|
|
654
710
|
path: Path;
|
|
655
711
|
method: "PUT";
|
|
712
|
+
}> | Extract<Endpoint<"PUT", "/organizations/:organizationSlug/events/:eventSlug", Event, UpdateOrganizationEventDto>, {
|
|
713
|
+
path: Path;
|
|
714
|
+
method: "PUT";
|
|
715
|
+
}> | Extract<Endpoint<"PUT", "/organizations/:slug/events/:eventSlug/tickets/:ticketId", OrganizationEventTicket, UpdateOrganizationEventTicketDto>, {
|
|
716
|
+
path: Path;
|
|
717
|
+
method: "PUT";
|
|
656
718
|
}> | Extract<Endpoint<"PUT", "/organizations/:organizationSlug/members/:userId", OrganizationMember, UpdateOrganizationMemberDto>, {
|
|
657
719
|
path: Path;
|
|
658
720
|
method: "PUT";
|
|
@@ -671,7 +733,13 @@ declare class Client {
|
|
|
671
733
|
}>["path"]>(path: Path, body: Extract<Endpoints, {
|
|
672
734
|
path: Path;
|
|
673
735
|
method: "DELETE";
|
|
674
|
-
}>["body"], query?: Query<Path>, options?: APIRequestOptions): Promise<(Extract<Endpoint<"DELETE", "/organizations/:slug",
|
|
736
|
+
}>["body"], query?: Query<Path>, options?: APIRequestOptions): Promise<(Extract<Endpoint<"DELETE", "/organizations/:slug", Organization, null>, {
|
|
737
|
+
path: Path;
|
|
738
|
+
method: "DELETE";
|
|
739
|
+
}> | Extract<Endpoint<"DELETE", "/organizations/:organizationSlug/events/:eventSlug", Event, null>, {
|
|
740
|
+
path: Path;
|
|
741
|
+
method: "DELETE";
|
|
742
|
+
}> | Extract<Endpoint<"DELETE", "/organizations/:slug/events/:eventSlug/tickets/:ticketId", OrganizationEventTicket[], null>, {
|
|
675
743
|
path: Path;
|
|
676
744
|
method: "DELETE";
|
|
677
745
|
}> | Extract<Endpoint<"DELETE", "/organizations/members/:id", OrganizationMember[], null>, {
|
|
@@ -728,11 +796,25 @@ declare const organizations: (client: Client) => {
|
|
|
728
796
|
get: (slug: string) => Promise<Organization>;
|
|
729
797
|
create: (data: CreateOrganizationDto) => Promise<Organization>;
|
|
730
798
|
update: (slug: string, data: UpdateOrganizationDto) => Promise<Organization>;
|
|
731
|
-
delete: (slug: string) => Promise<
|
|
799
|
+
delete: (slug: string) => Promise<Organization>;
|
|
732
800
|
members: {
|
|
733
801
|
getAll: () => Promise<OrganizationMember[]>;
|
|
734
802
|
delete: (id: string) => Promise<OrganizationMember[]>;
|
|
735
803
|
};
|
|
804
|
+
events: {
|
|
805
|
+
getAll: (organizationSlug: string) => Promise<Event[]>;
|
|
806
|
+
get: (organizationSlug: string, eventSlug: string) => Promise<Event>;
|
|
807
|
+
create: (organizationSlug: string, data: CreateOrganizationEventDto) => Promise<Event>;
|
|
808
|
+
update: (organizationSlug: string, eventSlug: string, data: CreateOrganizationEventDto) => Promise<Event>;
|
|
809
|
+
delete: (organizationSlug: string, eventSlug: string) => Promise<Event>;
|
|
810
|
+
tickets: {
|
|
811
|
+
getAll: (slug: string, eventSlug: string) => Promise<OrganizationEventTicket[]>;
|
|
812
|
+
get: (slug: string, eventSlug: string, ticketId: string) => Promise<OrganizationEventTicket>;
|
|
813
|
+
create: (slug: string, eventSlug: string, data: CreateOrganizationEventTicketDto) => Promise<OrganizationEventTicket>;
|
|
814
|
+
update: (slug: string, eventSlug: string, ticketId: string, data: UpdateOrganizationEventTicketDto) => Promise<OrganizationEventTicket>;
|
|
815
|
+
delete: (slug: string, eventSlug: string, ticketId: string) => Promise<OrganizationEventTicket[]>;
|
|
816
|
+
};
|
|
817
|
+
};
|
|
736
818
|
billing: {
|
|
737
819
|
account: (slug: string) => Promise<stripe.Stripe.Account>;
|
|
738
820
|
link: (slug: string) => void;
|
|
@@ -797,11 +879,25 @@ declare class TonightPass {
|
|
|
797
879
|
get: (slug: string) => Promise<Organization>;
|
|
798
880
|
create: (data: CreateOrganizationDto) => Promise<Organization>;
|
|
799
881
|
update: (slug: string, data: UpdateOrganizationDto) => Promise<Organization>;
|
|
800
|
-
delete: (slug: string) => Promise<
|
|
882
|
+
delete: (slug: string) => Promise<Organization>;
|
|
801
883
|
members: {
|
|
802
884
|
getAll: () => Promise<OrganizationMember[]>;
|
|
803
885
|
delete: (id: string) => Promise<OrganizationMember[]>;
|
|
804
886
|
};
|
|
887
|
+
events: {
|
|
888
|
+
getAll: (organizationSlug: string) => Promise<Event[]>;
|
|
889
|
+
get: (organizationSlug: string, eventSlug: string) => Promise<Event>;
|
|
890
|
+
create: (organizationSlug: string, data: CreateOrganizationEventDto) => Promise<Event>;
|
|
891
|
+
update: (organizationSlug: string, eventSlug: string, data: CreateOrganizationEventDto) => Promise<Event>;
|
|
892
|
+
delete: (organizationSlug: string, eventSlug: string) => Promise<Event>;
|
|
893
|
+
tickets: {
|
|
894
|
+
getAll: (slug: string, eventSlug: string) => Promise<OrganizationEventTicket[]>;
|
|
895
|
+
get: (slug: string, eventSlug: string, ticketId: string) => Promise<OrganizationEventTicket>;
|
|
896
|
+
create: (slug: string, eventSlug: string, data: CreateOrganizationEventTicketDto) => Promise<OrganizationEventTicket>;
|
|
897
|
+
update: (slug: string, eventSlug: string, ticketId: string, data: UpdateOrganizationEventTicketDto) => Promise<OrganizationEventTicket>;
|
|
898
|
+
delete: (slug: string, eventSlug: string, ticketId: string) => Promise<OrganizationEventTicket[]>;
|
|
899
|
+
};
|
|
900
|
+
};
|
|
805
901
|
billing: {
|
|
806
902
|
account: (slug: string) => Promise<stripe.Stripe.Account>;
|
|
807
903
|
link: (slug: string) => void;
|
|
@@ -827,4 +923,4 @@ declare class TonightPass {
|
|
|
827
923
|
|
|
828
924
|
declare const isBrowser: boolean;
|
|
829
925
|
|
|
830
|
-
export { type APIRequestOptions, type APIResponse, type AuthEndpoints, BCRYPT_HASH, type CareersCategory, type CareersEmploymentType, type CareersEndpoints, type CareersJob, type CareersOffice, Client, type ClientOptions, CreateOrganizationDto, CreateOrganizationIdentityDto, CreateUserDto, Currency, DEFAULT_API_URL, EMAIL_REGEX, type Endpoint, type Endpoints, type ErroredAPIResponse, type
|
|
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 };
|
package/dist/index.js
CHANGED
|
@@ -3,41 +3,45 @@
|
|
|
3
3
|
require('reflect-metadata');
|
|
4
4
|
var classValidator = require('class-validator');
|
|
5
5
|
var classTransformer = require('class-transformer');
|
|
6
|
-
var
|
|
6
|
+
var we = require('redaxios');
|
|
7
7
|
var pathcat = require('pathcat');
|
|
8
8
|
|
|
9
9
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var we__default = /*#__PURE__*/_interopDefault(we);
|
|
12
12
|
|
|
13
|
-
var ce=Object.defineProperty;var s=(e,t)=>ce(e,"name",{value:t,configurable:!0});var S="https://api.tonightpass.com";var Ae=/^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$/,_e=/((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/,N=/(^[\p{L}\d'\\.\s\\-]*$)/u,Re=/^[a-z\d]+(?:(\.|-|_)[a-z\d]+)*$/,ve=/\$2[abxy]?\$\d{1,2}\$[A-Za-z\d\\./]{53}/,je=/^\s*(?:\+?(\d{1,3}))?([-. (]*(\d{3})[-. )]*)?((\d{3})[-. ]*(\d{2,4})(?:[-.x ]*(\d+))?)\s*$/,Ue=/(((http:\/\/www)|(http:\/\/)|(www))[-a-zA-Z0-9@:%_\\+.~#?&//=]+)\.(jpg|jpeg|gif|png|bmp|tiff|tga|svg)/i;exports.EventTicketCategory = 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.EventTicketCategory||(exports.EventTicketCategory={}));exports.EventType = 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.EventType||(exports.EventType={}));exports.EventStyleType = void 0;(function(e){e.Music="music",e.Dress="dress",e.Sport="sport",e.Food="food",e.Art="art";})(exports.EventStyleType||(exports.EventStyleType={}));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.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.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,c;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--)(c=e[u])&&(i=(n<3?c(i):n>3?c(t,o,i):c(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 R=class{static{s(this,"OrganizationMemberDto");}user;role};l([classValidator.IsString(),classValidator.IsNotEmpty(),f("design:type",String)],R.prototype,"user",void 0);l([classValidator.IsEnum(exports.OrganizationMemberRole),classValidator.IsNotEmpty(),f("design:type",typeof exports.OrganizationMemberRole>"u"?Object:exports.OrganizationMemberRole)],R.prototype,"role",void 0);var V=class extends y{static{s(this,"UpdateOrganizationDto");}};var Z=class{static{s(this,"CreateUserDto");}identifier;password;identity;addresses};var Y=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,c;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--)(c=e[u])&&(i=(n<3?c(i):n>3?c(t,o,i):c(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 _=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)],_.prototype,"identifier",void 0);a([classValidator.IsOptional(),classValidator.IsObject(),classValidator.ValidateNested(),classTransformer.Type(()=>m),p("design:type",typeof m>"u"?Object:m)],_.prototype,"identity",void 0);a([classValidator.IsOptional(),classValidator.IsString(),classValidator.MinLength(6),classValidator.MaxLength(130),p("design:type",String)],_.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(N,{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(N,{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 ye=he__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}),oe=s(async(e,t)=>ye(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;}},L=class{static{s(this,"Client");}options;url;constructor(t){this.options=t,this.url=(o,r)=>{let n=this.options.baseURL||S;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 c=this.url(o,n);if(r!==void 0&&t==="GET")throw new Error("Cannot send a GET request with a body");let u=await oe(c,{method:t,data:r,...i}),D=u.data;if(!D.success)throw new G(u,D);return D.data}};function A(e){return e}s(A,"sdk");var re=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 se=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 ne=e=>({getAll:async()=>e.get("/health"),database:async()=>e.get("/health/database"),http:async()=>e.get("/health/http")});var ie=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})},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 ae=e=>({get:async t=>e.get("/profiles/:username",{username:t})});var pe=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 de=class{static{s(this,"TonightPass");}client;auth;careers;health;organizations;profiles;users;constructor(t){this.client=new L(t),this.auth=re(this.client),this.careers=se(this.client),this.health=ne(this.client),this.organizations=ie(this.client),this.profiles=ae(this.client),this.users=pe(this.client);}};
|
|
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);}};
|
|
14
14
|
|
|
15
|
-
exports.BCRYPT_HASH =
|
|
16
|
-
exports.Client =
|
|
15
|
+
exports.BCRYPT_HASH = Le;
|
|
16
|
+
exports.Client = k;
|
|
17
17
|
exports.CreateOrganizationDto = y;
|
|
18
|
+
exports.CreateOrganizationEventDto = I;
|
|
19
|
+
exports.CreateOrganizationEventTicketDto = L;
|
|
18
20
|
exports.CreateOrganizationIdentityDto = g;
|
|
19
|
-
exports.CreateUserDto =
|
|
20
|
-
exports.DEFAULT_API_URL =
|
|
21
|
-
exports.EMAIL_REGEX =
|
|
22
|
-
exports.IMAGE_URL_REGEX =
|
|
23
|
-
exports.NAME_REGEX =
|
|
24
|
-
exports.OrganizationMemberDto =
|
|
25
|
-
exports.PASSWORD_REGEX =
|
|
26
|
-
exports.PHONE_NUMBER_REGEX =
|
|
27
|
-
exports.SLUG_REGEX =
|
|
28
|
-
exports.SignInUserDto =
|
|
29
|
-
exports.TonightPass =
|
|
21
|
+
exports.CreateUserDto = O;
|
|
22
|
+
exports.DEFAULT_API_URL = q;
|
|
23
|
+
exports.EMAIL_REGEX = Se;
|
|
24
|
+
exports.IMAGE_URL_REGEX = ke;
|
|
25
|
+
exports.NAME_REGEX = D;
|
|
26
|
+
exports.OrganizationMemberDto = _;
|
|
27
|
+
exports.PASSWORD_REGEX = je;
|
|
28
|
+
exports.PHONE_NUMBER_REGEX = Ue;
|
|
29
|
+
exports.SLUG_REGEX = Ie;
|
|
30
|
+
exports.SignInUserDto = T;
|
|
31
|
+
exports.TonightPass = me;
|
|
30
32
|
exports.TonightPassAPIError = G;
|
|
31
|
-
exports.UpdateOrganizationDto =
|
|
32
|
-
exports.
|
|
33
|
-
exports.
|
|
34
|
-
exports.
|
|
35
|
-
exports.
|
|
33
|
+
exports.UpdateOrganizationDto = K;
|
|
34
|
+
exports.UpdateOrganizationEventDto = Q;
|
|
35
|
+
exports.UpdateOrganizationEventTicketDto = z;
|
|
36
|
+
exports.UpdateUserDto = A;
|
|
37
|
+
exports.auth = ae;
|
|
38
|
+
exports.careers = pe;
|
|
39
|
+
exports.health = ce;
|
|
36
40
|
exports.isBrowser = h;
|
|
37
|
-
exports.organizations =
|
|
38
|
-
exports.profiles =
|
|
39
|
-
exports.request =
|
|
40
|
-
exports.sdk =
|
|
41
|
-
exports.users =
|
|
41
|
+
exports.organizations = de;
|
|
42
|
+
exports.profiles = le;
|
|
43
|
+
exports.request = ie;
|
|
44
|
+
exports.sdk = v;
|
|
45
|
+
exports.users = fe;
|
|
42
46
|
//# sourceMappingURL=out.js.map
|
|
43
47
|
//# sourceMappingURL=index.js.map
|