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.
@@ -1,6 +1,5 @@
1
1
  export * from "./auth";
2
2
  export * from "./careers";
3
- export * from "./event";
4
3
  export * from "./health";
5
4
  export * from "./organizations";
6
5
  export * from "./token";
@@ -1,5 +1,5 @@
1
1
  import { Currency } from "..";
2
- import { Event, EventTicket } from "../event";
2
+ import { OrganizationEvent, OrganizationEventTicket } from "../organizations";
3
3
  import { User } from "../users";
4
4
 
5
5
  export enum OrderStatus {
@@ -16,7 +16,7 @@ export enum OrderStatus {
16
16
 
17
17
  export type OrderItem = {
18
18
  id: string;
19
- ticket: EventTicket;
19
+ ticket: OrganizationEventTicket;
20
20
  isUsed: boolean;
21
21
  updatedAt: Date;
22
22
  createdAt: Date;
@@ -27,7 +27,7 @@ export type Order = {
27
27
  owner: User;
28
28
  members: User[];
29
29
  status: OrderStatus;
30
- event: Event;
30
+ event: OrganizationEvent;
31
31
  items: OrderItem[];
32
32
  promoCode?: PromoCode;
33
33
  total: number;
@@ -0,0 +1,91 @@
1
+ import {
2
+ OrganizationEventTicket,
3
+ Organization,
4
+ OrganizationEventTicketEndpoints,
5
+ } from "..";
6
+ import { Location } from "../..";
7
+ import {
8
+ CreateOrganizationEventDto,
9
+ UpdateOrganizationEventDto,
10
+ } from "../../../dtos";
11
+ import { Endpoint } from "../../../endpoints";
12
+
13
+ export * from "./tickets";
14
+
15
+ export type OrganizationEvent = {
16
+ title: string;
17
+ description: string;
18
+ slug: string;
19
+ organization: Organization;
20
+ type: OrganizationEventType;
21
+ public: boolean;
22
+ flyers: string[];
23
+ trailers: string[];
24
+ location: Location;
25
+ tickets: OrganizationEventTicket[];
26
+ styles: OrganizationEventStyle[];
27
+ startAt: Date;
28
+ endAt: Date;
29
+ updatedAt: Date;
30
+ createdAt: Date;
31
+ };
32
+
33
+ export enum OrganizationEventType {
34
+ Clubbing = "clubbing",
35
+ Concert = "concert",
36
+ Afterwork = "afterwork",
37
+ DancingLunch = "dancing_lunch",
38
+ Diner = "diner",
39
+ Garden = "garden",
40
+ AfterBeach = "after_beach",
41
+ Festival = "festival",
42
+ Spectacle = "spectacle",
43
+ Cruise = "cruise",
44
+ OutsideAnimation = "outside_animation",
45
+ Sport = "sport",
46
+ Match = "match",
47
+ Seminar = "seminar",
48
+ Conference = "conference",
49
+ WellnessDay = "wellness_day",
50
+ Workshop = "workshop",
51
+ TradeFair = "trade_fair",
52
+ ConsumerShow = "consumer_show",
53
+ Membership = "membership",
54
+ }
55
+
56
+ export type OrganizationEventStyle = {
57
+ type: OrganizationEventStyleType;
58
+ emoji: string;
59
+ name: string;
60
+ };
61
+
62
+ export enum OrganizationEventStyleType {
63
+ Music = "music",
64
+ Dress = "dress",
65
+ Sport = "sport",
66
+ Food = "food",
67
+ Art = "art",
68
+ }
69
+
70
+ export type OrganizationEventEndpoints =
71
+ | Endpoint<"GET", "/organizations/:organizationSlug/events", Event[]>
72
+ | Endpoint<"GET", "/organizations/:organizationSlug/events/:eventSlug", Event>
73
+ | Endpoint<
74
+ "POST",
75
+ "/organizations/:organizationSlug/events",
76
+ Event,
77
+ CreateOrganizationEventDto
78
+ >
79
+ | Endpoint<
80
+ "PUT",
81
+ "/organizations/:organizationSlug/events/:eventSlug",
82
+ Event,
83
+ UpdateOrganizationEventDto
84
+ >
85
+ | Endpoint<
86
+ "DELETE",
87
+ "/organizations/:organizationSlug/events/:eventSlug",
88
+ Event,
89
+ null
90
+ >
91
+ | OrganizationEventTicketEndpoints;
@@ -0,0 +1,71 @@
1
+ import { Currency } from "../../..";
2
+ import {
3
+ CreateOrganizationEventTicketDto,
4
+ UpdateOrganizationEventTicketDto,
5
+ } from "../../../../dtos";
6
+ import { Endpoint } from "../../../../endpoints";
7
+
8
+ export type OrganizationEventTicket = {
9
+ id: string;
10
+ name: string;
11
+ description?: string;
12
+ price: number;
13
+ displayPrice: number;
14
+ quantity: number;
15
+ type: OrganizationEventTicketType;
16
+ category: OrganizationEventTicketCategory;
17
+ currency: Currency;
18
+ vatRate: number;
19
+ externalId?: string;
20
+ isVisible: boolean;
21
+ isFeesIncluded: boolean;
22
+ startAt: Date;
23
+ endAt: Date;
24
+ updatedAt: Date;
25
+ createdAt: Date;
26
+ };
27
+
28
+ export type OrganizationEventTicketType = "e-ticket" | "other";
29
+
30
+ export enum OrganizationEventTicketCategory {
31
+ Entry = "entry",
32
+ Package = "package",
33
+ Meal = "meal",
34
+ Drink = "drink",
35
+ Parking = "parking",
36
+ Accommodation = "accommodation",
37
+ Camping = "camping",
38
+ Locker = "locker",
39
+ Shuttle = "shuttle",
40
+ Other = "other",
41
+ }
42
+
43
+ export type OrganizationEventTicketEndpoints =
44
+ | Endpoint<
45
+ "GET",
46
+ "/organizations/:slug/events/:eventSlug/tickets",
47
+ OrganizationEventTicket[]
48
+ >
49
+ | Endpoint<
50
+ "GET",
51
+ "/organizations/:slug/events/:eventSlug/tickets/:ticketId",
52
+ OrganizationEventTicket
53
+ >
54
+ | Endpoint<
55
+ "POST",
56
+ "/organizations/:slug/events/:eventSlug/tickets",
57
+ OrganizationEventTicket,
58
+ CreateOrganizationEventTicketDto
59
+ >
60
+ | Endpoint<
61
+ "PUT",
62
+ "/organizations/:slug/events/:eventSlug/tickets/:ticketId",
63
+ OrganizationEventTicket,
64
+ UpdateOrganizationEventTicketDto
65
+ >
66
+ | Endpoint<
67
+ "DELETE",
68
+ "/organizations/:slug/events/:eventSlug/tickets/:ticketId",
69
+ OrganizationEventTicket[],
70
+ null
71
+ >;
@@ -1,16 +1,14 @@
1
1
  import type Stripe from "stripe";
2
2
 
3
- import { Location, Profile, ProfileMetadata, UserToken } from "..";
4
- import {
5
- CreateOrganizationDto,
6
- OrganizationMemberDto,
7
- UpdateOrganizationDto,
8
- } from "../../dtos";
9
- import { UpdateOrganizationMemberDto } from "../../dtos/organizations/members/update-organization-member.dto";
3
+ import { OrganizationEvent, OrganizationEventEndpoints } from "./events";
4
+ import { OrganizationEventTicket } from "./events/tickets";
5
+ import { OrganizationMember, OrganizationMembersEndpoints } from "./members";
6
+ import { Location, Profile, ProfileMetadata } from "..";
7
+ import { CreateOrganizationDto, UpdateOrganizationDto } from "../../dtos";
10
8
  import { Endpoint } from "../../endpoints";
11
- import { Event } from "../event";
12
- import { EventTicket } from "../event/ticket";
13
- import { User } from "../users";
9
+
10
+ export * from "./events";
11
+ export * from "./members";
14
12
 
15
13
  export type Organization = {
16
14
  id: string;
@@ -18,8 +16,8 @@ export type Organization = {
18
16
  identity: OrganizationIdentity;
19
17
  members: OrganizationMember[];
20
18
  location?: Location;
21
- events: Event[];
22
- savedTickets: EventTicket[];
19
+ events: OrganizationEvent[];
20
+ savedTickets: OrganizationEventTicket[];
23
21
  verified: boolean;
24
22
  billing: OrganizationBilling;
25
23
  updatedAt: Date;
@@ -56,60 +54,18 @@ export enum OrganizationSocialType {
56
54
  Website = "website",
57
55
  }
58
56
 
59
- export type OrganizationMember = {
60
- organization: Organization;
61
- role: OrganizationMemberRole;
62
- status: OrganizationMemberStatus;
63
- updatedAt: Date;
64
- createdAt: Date;
65
- user?: User;
66
- token?: UserToken;
67
- };
68
-
69
- export enum OrganizationMemberStatus {
70
- Pending = "pending",
71
- Accepted = "accepted",
72
- Rejected = "rejected",
73
- }
74
-
75
- export enum OrganizationMemberRole {
76
- Member = "member",
77
- Manager = "manager",
78
- Admin = "admin",
79
- Owner = "owner",
80
- }
81
-
82
57
  export type OrganizationEndpoints =
83
58
  | Endpoint<"GET", "/organizations", Organization[]>
84
59
  | Endpoint<"GET", "/organizations/:slug", Organization>
85
60
  | Endpoint<"POST", "/organizations", Organization, CreateOrganizationDto>
86
61
  | Endpoint<"PUT", "/organizations/:slug", Organization, UpdateOrganizationDto>
87
- | Endpoint<"DELETE", "/organizations/:slug", boolean, null>
88
- | Endpoint<"GET", "/organizations/members", OrganizationMember[]>
89
- | Endpoint<"DELETE", "/organizations/members/:id", OrganizationMember[], null>
90
- | Endpoint<"GET", "/organizations/:slug/members", OrganizationMember[]>
91
- | Endpoint<
92
- "POST",
93
- "/organizations/:slug/members",
94
- OrganizationMember,
95
- OrganizationMemberDto
96
- >
97
- | Endpoint<
98
- "PUT",
99
- "/organizations/:organizationSlug/members/:userId",
100
- OrganizationMember,
101
- UpdateOrganizationMemberDto
102
- >
103
- | Endpoint<
104
- "DELETE",
105
- "/organizations/:organizationSlug/members/:userId",
106
- OrganizationMember[],
107
- null
108
- >
62
+ | Endpoint<"DELETE", "/organizations/:slug", Organization, null>
109
63
  | Endpoint<
110
64
  "GET",
111
65
  "/organizations/:slug/billing/account",
112
66
  OrganizationBillingAccount
113
67
  >
114
68
  | Endpoint<"GET", "/organizations/:slug/billing/link", void>
115
- | Endpoint<"GET", "/organizations/:slug/billing/dashboard", void>;
69
+ | Endpoint<"GET", "/organizations/:slug/billing/dashboard", void>
70
+ | OrganizationEventEndpoints
71
+ | OrganizationMembersEndpoints;
@@ -0,0 +1,52 @@
1
+ import { Organization } from "..";
2
+ import { OrganizationMemberDto } from "../../../dtos";
3
+ import { UpdateOrganizationMemberDto } from "../../../dtos/organizations/members/update-organization-member.dto";
4
+ import { Endpoint } from "../../../endpoints";
5
+ import { UserToken } from "../../token";
6
+ import { User } from "../../users";
7
+
8
+ export type OrganizationMember = {
9
+ organization: Organization;
10
+ role: OrganizationMemberRole;
11
+ status: OrganizationMemberStatus;
12
+ updatedAt: Date;
13
+ createdAt: Date;
14
+ user?: User;
15
+ token?: UserToken;
16
+ };
17
+
18
+ export enum OrganizationMemberStatus {
19
+ Pending = "pending",
20
+ Accepted = "accepted",
21
+ Rejected = "rejected",
22
+ }
23
+
24
+ export enum OrganizationMemberRole {
25
+ Member = "member",
26
+ Manager = "manager",
27
+ Admin = "admin",
28
+ Owner = "owner",
29
+ }
30
+
31
+ export type OrganizationMembersEndpoints =
32
+ | Endpoint<"GET", "/organizations/members", OrganizationMember[]>
33
+ | Endpoint<"DELETE", "/organizations/members/:id", OrganizationMember[], null>
34
+ | Endpoint<"GET", "/organizations/:slug/members", OrganizationMember[]>
35
+ | Endpoint<
36
+ "POST",
37
+ "/organizations/:slug/members",
38
+ OrganizationMember,
39
+ OrganizationMemberDto
40
+ >
41
+ | Endpoint<
42
+ "PUT",
43
+ "/organizations/:organizationSlug/members/:userId",
44
+ OrganizationMember,
45
+ UpdateOrganizationMemberDto
46
+ >
47
+ | Endpoint<
48
+ "DELETE",
49
+ "/organizations/:organizationSlug/members/:userId",
50
+ OrganizationMember[],
51
+ null
52
+ >;
@@ -1,5 +1,11 @@
1
1
  import { sdk } from "./builder";
2
- import { CreateOrganizationDto, UpdateOrganizationDto } from "../rest";
2
+ import {
3
+ CreateOrganizationDto,
4
+ CreateOrganizationEventDto,
5
+ CreateOrganizationEventTicketDto,
6
+ UpdateOrganizationDto,
7
+ UpdateOrganizationEventTicketDto,
8
+ } from "../rest";
3
9
  import { isBrowser } from "../utils";
4
10
 
5
11
  export const organizations = sdk((client) => ({
@@ -16,6 +22,89 @@ export const organizations = sdk((client) => ({
16
22
  delete: async (id: string) =>
17
23
  client.delete("/organizations/members/:id", null, { id }),
18
24
  },
25
+ events: {
26
+ getAll: async (organizationSlug: string) =>
27
+ client.get("/organizations/:organizationSlug/events", {
28
+ organizationSlug,
29
+ }),
30
+ get: async (organizationSlug: string, eventSlug: string) =>
31
+ client.get("/organizations/:organizationSlug/events/:eventSlug", {
32
+ organizationSlug,
33
+ eventSlug,
34
+ }),
35
+ create: async (
36
+ organizationSlug: string,
37
+ data: CreateOrganizationEventDto,
38
+ ) =>
39
+ client.post("/organizations/:organizationSlug/events", data, {
40
+ organizationSlug,
41
+ }),
42
+ update: async (
43
+ organizationSlug: string,
44
+ eventSlug: string,
45
+ data: CreateOrganizationEventDto,
46
+ ) =>
47
+ client.put("/organizations/:organizationSlug/events/:eventSlug", data, {
48
+ organizationSlug,
49
+ eventSlug,
50
+ }),
51
+ delete: async (organizationSlug: string, eventSlug: string) =>
52
+ client.delete(
53
+ "/organizations/:organizationSlug/events/:eventSlug",
54
+ null,
55
+ {
56
+ organizationSlug,
57
+ eventSlug,
58
+ },
59
+ ),
60
+ tickets: {
61
+ getAll: async (slug: string, eventSlug: string) =>
62
+ client.get("/organizations/:slug/events/:eventSlug/tickets", {
63
+ slug,
64
+ eventSlug,
65
+ }),
66
+ get: async (slug: string, eventSlug: string, ticketId: string) =>
67
+ client.get("/organizations/:slug/events/:eventSlug/tickets/:ticketId", {
68
+ slug,
69
+ eventSlug,
70
+ ticketId,
71
+ }),
72
+ create: async (
73
+ slug: string,
74
+ eventSlug: string,
75
+ data: CreateOrganizationEventTicketDto,
76
+ ) =>
77
+ client.post("/organizations/:slug/events/:eventSlug/tickets", data, {
78
+ slug,
79
+ eventSlug,
80
+ }),
81
+ update: async (
82
+ slug: string,
83
+ eventSlug: string,
84
+ ticketId: string,
85
+ data: UpdateOrganizationEventTicketDto,
86
+ ) =>
87
+ client.put(
88
+ "/organizations/:slug/events/:eventSlug/tickets/:ticketId",
89
+ data,
90
+ {
91
+ slug,
92
+ eventSlug,
93
+ ticketId,
94
+ },
95
+ ),
96
+ delete: async (slug: string, eventSlug: string, ticketId: string) =>
97
+ client.delete(
98
+ "/organizations/:slug/events/:eventSlug/tickets/:ticketId",
99
+ null,
100
+ {
101
+ slug,
102
+ eventSlug,
103
+ ticketId,
104
+ },
105
+ ),
106
+ },
107
+ },
19
108
  billing: {
20
109
  account: async (slug: string) =>
21
110
  client.get("/organizations/:slug/billing/account", { slug }),
@@ -1,60 +0,0 @@
1
- import { EventTicket } from "./ticket";
2
- import { Location } from "..";
3
- import { Organization } from "../organizations";
4
-
5
- export * from "./ticket";
6
-
7
- export type Event = {
8
- title: string;
9
- description: string;
10
- slug: string;
11
- organization: Organization;
12
- type: EventType;
13
- public: boolean;
14
- flyers: string[];
15
- trailers: string[];
16
- location: Location;
17
- tickets: EventTicket[];
18
- styles: EventStyle[];
19
- startAt: Date;
20
- endAt: Date;
21
- updatedAt: Date;
22
- createdAt: Date;
23
- };
24
-
25
- export enum EventType {
26
- Clubbing = "clubbing",
27
- Concert = "concert",
28
- Afterwork = "afterwork",
29
- DancingLunch = "dancing_lunch",
30
- Diner = "diner",
31
- Garden = "garden",
32
- AfterBeach = "after_beach",
33
- Festival = "festival",
34
- Spectacle = "spectacle",
35
- Cruise = "cruise",
36
- OutsideAnimation = "outside_animation",
37
- Sport = "sport",
38
- Match = "match",
39
- Seminar = "seminar",
40
- Conference = "conference",
41
- WellnessDay = "wellness_day",
42
- Workshop = "workshop",
43
- TradeFair = "trade_fair",
44
- ConsumerShow = "consumer_show",
45
- Membership = "membership",
46
- }
47
-
48
- export type EventStyle = {
49
- type: EventStyleType;
50
- emoji: string;
51
- name: string;
52
- };
53
-
54
- export enum EventStyleType {
55
- Music = "music",
56
- Dress = "dress",
57
- Sport = "sport",
58
- Food = "food",
59
- Art = "art",
60
- }
@@ -1,36 +0,0 @@
1
- import { Currency } from "../..";
2
-
3
- export type EventTicket = {
4
- id: string;
5
- name: string;
6
- description?: string;
7
- price: number;
8
- displayPrice: number;
9
- quantity: number;
10
- type: EventTicketType;
11
- category: EventTicketCategory;
12
- currency: Currency;
13
- vatRate: number;
14
- externalId?: string;
15
- isVisible: boolean;
16
- isFeesIncluded: boolean;
17
- startAt: Date;
18
- endAt: Date;
19
- updatedAt: Date;
20
- createdAt: Date;
21
- };
22
-
23
- export type EventTicketType = "e-ticket" | "other";
24
-
25
- export enum EventTicketCategory {
26
- Entry = "entry",
27
- Package = "package",
28
- Meal = "meal",
29
- Drink = "drink",
30
- Parking = "parking",
31
- Accommodation = "accommodation",
32
- Camping = "camping",
33
- Locker = "locker",
34
- Shuttle = "shuttle",
35
- Other = "other",
36
- }