tonightpass 0.0.117 → 0.0.119
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/dist/index.js.map +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +15 -2
- package/.turbo/turbo-build.log +0 -21
- package/CHANGELOG.md +0 -717
- package/src/constants/api.ts +0 -1
- package/src/constants/index.ts +0 -2
- package/src/constants/regex.ts +0 -28
- package/src/index.ts +0 -6
- package/src/rest/client.ts +0 -198
- package/src/rest/dtos/index.ts +0 -5
- package/src/rest/dtos/locations/create-location.dto.ts +0 -68
- package/src/rest/dtos/locations/index.ts +0 -2
- package/src/rest/dtos/locations/update-location.dto.ts +0 -37
- package/src/rest/dtos/organizations/create-organization.dto.ts +0 -60
- package/src/rest/dtos/organizations/events/create-organization-event.dto.ts +0 -99
- package/src/rest/dtos/organizations/events/index.ts +0 -6
- package/src/rest/dtos/organizations/events/orders/create-organization-event-order.dto.ts +0 -3
- package/src/rest/dtos/organizations/events/orders/index.ts +0 -1
- package/src/rest/dtos/organizations/events/styles/create-organization-event-style.dto.ts +0 -7
- package/src/rest/dtos/organizations/events/styles/index.ts +0 -2
- package/src/rest/dtos/organizations/events/styles/update-organization-event-style.dto.ts +0 -3
- package/src/rest/dtos/organizations/events/tickets/create-organization-event-ticket.dto.ts +0 -68
- package/src/rest/dtos/organizations/events/tickets/index.ts +0 -2
- package/src/rest/dtos/organizations/events/tickets/update-organization-event-ticket.dto.ts +0 -70
- package/src/rest/dtos/organizations/events/update-organization-event.dto.ts +0 -88
- package/src/rest/dtos/organizations/index.ts +0 -4
- package/src/rest/dtos/organizations/members/create-organization-member.dto.ts +0 -13
- package/src/rest/dtos/organizations/members/index.ts +0 -2
- package/src/rest/dtos/organizations/members/update-organization-member.dto.ts +0 -9
- package/src/rest/dtos/organizations/update-organization.dto.ts +0 -65
- package/src/rest/dtos/users/create-user.dto.ts +0 -86
- package/src/rest/dtos/users/index.ts +0 -3
- package/src/rest/dtos/users/sign-in-user.dto.ts +0 -11
- package/src/rest/dtos/users/update-user.dto.ts +0 -121
- package/src/rest/endpoints.ts +0 -36
- package/src/rest/index.ts +0 -5
- package/src/rest/request/index.ts +0 -1
- package/src/rest/request/request.ts +0 -52
- package/src/rest/types/auth/index.ts +0 -15
- package/src/rest/types/careers/index.ts +0 -87
- package/src/rest/types/health/index.ts +0 -15
- package/src/rest/types/index.ts +0 -108
- package/src/rest/types/locations/index.ts +0 -30
- package/src/rest/types/notifications/index.ts +0 -8
- package/src/rest/types/orders/index.ts +0 -14
- package/src/rest/types/organizations/events/index.ts +0 -136
- package/src/rest/types/organizations/events/orders/index.ts +0 -10
- package/src/rest/types/organizations/events/styles/index.ts +0 -47
- package/src/rest/types/organizations/events/tickets/index.ts +0 -73
- package/src/rest/types/organizations/events/views/index.ts +0 -8
- package/src/rest/types/organizations/index.ts +0 -78
- package/src/rest/types/organizations/members/index.ts +0 -72
- package/src/rest/types/profiles/index.ts +0 -82
- package/src/rest/types/users/bookings/index.ts +0 -56
- package/src/rest/types/users/index.ts +0 -116
- package/src/rest/types/users/notifications/index.ts +0 -50
- package/src/rest/types/users/tokens/index.ts +0 -19
- package/src/rest/types/webhooks/index.ts +0 -10
- package/src/sdk/auth.ts +0 -42
- package/src/sdk/builder.ts +0 -5
- package/src/sdk/careers.ts +0 -23
- package/src/sdk/health.ts +0 -8
- package/src/sdk/index.ts +0 -9
- package/src/sdk/notifications.ts +0 -6
- package/src/sdk/orders.ts +0 -13
- package/src/sdk/organizations/billing/index.ts +0 -33
- package/src/sdk/organizations/events/index.ts +0 -79
- package/src/sdk/organizations/events/orders/index.ts +0 -17
- package/src/sdk/organizations/events/styles/index.ts +0 -19
- package/src/sdk/organizations/events/tickets/index.ts +0 -64
- package/src/sdk/organizations/events/views/index.ts +0 -13
- package/src/sdk/organizations/index.ts +0 -22
- package/src/sdk/organizations/members/index.ts +0 -7
- package/src/sdk/profiles/index.ts +0 -8
- package/src/sdk/profiles/relationships/index.ts +0 -28
- package/src/sdk/users/bookings/index.ts +0 -8
- package/src/sdk/users/index.ts +0 -26
- package/src/sdk/users/notifications/index.ts +0 -7
- package/src/tonightpass.ts +0 -37
- package/src/utils/index.ts +0 -21
- package/tests/auth/index.ts +0 -26
- package/tests/careers/index.ts +0 -28
- package/tests/dtos/index.ts +0 -157
- package/tests/index.ts +0 -61
- package/tests/regex/index.ts +0 -81
- package/tests/users/index.ts +0 -38
- package/tsconfig.json +0 -18
- package/tsup.config.ts +0 -17
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ArrayOptions,
|
|
3
|
-
ArrayResult,
|
|
4
|
-
Base,
|
|
5
|
-
OrganizationEvent,
|
|
6
|
-
OrganizationEventTicket,
|
|
7
|
-
User,
|
|
8
|
-
UserToken,
|
|
9
|
-
} from "../..";
|
|
10
|
-
import { Endpoint } from "../../../endpoints";
|
|
11
|
-
import { Order } from "../../orders";
|
|
12
|
-
|
|
13
|
-
export type UserBookingTicket = Base & {
|
|
14
|
-
booking: UserBooking;
|
|
15
|
-
ticket: OrganizationEventTicket;
|
|
16
|
-
token: UserToken;
|
|
17
|
-
useCount: number;
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export type UserBooking = Base & {
|
|
21
|
-
tickets: UserBookingTicket[];
|
|
22
|
-
order: Order;
|
|
23
|
-
user: User;
|
|
24
|
-
event: OrganizationEvent;
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
export type UserBookingEndpoints =
|
|
28
|
-
| Endpoint<
|
|
29
|
-
"GET",
|
|
30
|
-
"/users/bookings",
|
|
31
|
-
ArrayResult<UserBooking>,
|
|
32
|
-
ArrayOptions<UserBooking>
|
|
33
|
-
>
|
|
34
|
-
| Endpoint<
|
|
35
|
-
"GET",
|
|
36
|
-
"/users/@me/bookings",
|
|
37
|
-
ArrayResult<UserBooking>,
|
|
38
|
-
ArrayOptions<UserBooking>
|
|
39
|
-
>
|
|
40
|
-
| Endpoint<
|
|
41
|
-
"GET",
|
|
42
|
-
"/users/:userId/bookings",
|
|
43
|
-
ArrayResult<UserBooking>,
|
|
44
|
-
ArrayOptions<UserBooking>
|
|
45
|
-
>
|
|
46
|
-
| Endpoint<"GET", "/users/bookings/:bookingId", UserBooking>
|
|
47
|
-
| Endpoint<"GET", "/users/@me/bookings/:bookingId", UserBooking>
|
|
48
|
-
| Endpoint<
|
|
49
|
-
"GET",
|
|
50
|
-
"/users/bookings/tickets/:ticketId",
|
|
51
|
-
UserBookingTicket,
|
|
52
|
-
{
|
|
53
|
-
tokenId: string;
|
|
54
|
-
tokenValue: string;
|
|
55
|
-
}
|
|
56
|
-
>;
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Base,
|
|
3
|
-
Currency,
|
|
4
|
-
Language,
|
|
5
|
-
Location,
|
|
6
|
-
UserBookingEndpoints,
|
|
7
|
-
UserProfile,
|
|
8
|
-
} from "..";
|
|
9
|
-
import { UserNotificationEndpoints } from "./notifications";
|
|
10
|
-
import { UpdateUserDto } from "../../dtos";
|
|
11
|
-
import { Endpoint } from "../../endpoints";
|
|
12
|
-
|
|
13
|
-
export * from "./bookings";
|
|
14
|
-
export * from "./notifications";
|
|
15
|
-
export * from "./tokens";
|
|
16
|
-
|
|
17
|
-
export type User = Base & {
|
|
18
|
-
identifier: UserIdentifier;
|
|
19
|
-
password: string;
|
|
20
|
-
identity: UserIdentity;
|
|
21
|
-
role: UserRole;
|
|
22
|
-
addresses: Location[];
|
|
23
|
-
preferences: UserPreferences;
|
|
24
|
-
connections: UserConnection[];
|
|
25
|
-
verified: boolean;
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
export type UserIdentifier = {
|
|
29
|
-
email?: string;
|
|
30
|
-
phoneNumber?: string;
|
|
31
|
-
username: string;
|
|
32
|
-
|
|
33
|
-
[key: string]: string | undefined;
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
export type UserIdentity = UserProfile & {
|
|
37
|
-
firstName: string;
|
|
38
|
-
lastName: string;
|
|
39
|
-
fullName: string;
|
|
40
|
-
gender: UserIdentityGender;
|
|
41
|
-
birthDate: Date;
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
export enum UserRole {
|
|
45
|
-
User = "user",
|
|
46
|
-
Developer = "developer",
|
|
47
|
-
Admin = "admin",
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export enum UserIdentityGender {
|
|
51
|
-
Male = "male",
|
|
52
|
-
Female = "female",
|
|
53
|
-
NonBinary = "non-binary",
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export type UserPreferences = {
|
|
57
|
-
language: Language;
|
|
58
|
-
currency: Currency;
|
|
59
|
-
notifications: {
|
|
60
|
-
email: {
|
|
61
|
-
newsletter: boolean;
|
|
62
|
-
message: boolean;
|
|
63
|
-
};
|
|
64
|
-
push: {
|
|
65
|
-
message: boolean;
|
|
66
|
-
};
|
|
67
|
-
};
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
export type UserConnection = {
|
|
71
|
-
ip: string;
|
|
72
|
-
os: UserConnectionOS;
|
|
73
|
-
device: UserConnectionDevice;
|
|
74
|
-
client: UserConnectionClient;
|
|
75
|
-
updatedAt: Date;
|
|
76
|
-
createdAt: Date;
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
export type UserConnectionOS = {
|
|
80
|
-
name: string;
|
|
81
|
-
version: string;
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
export type UserConnectionDevice = {
|
|
85
|
-
type: string;
|
|
86
|
-
brand: string;
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
export type UserConnectionClient = {
|
|
90
|
-
name: string;
|
|
91
|
-
version: string;
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
export enum UserFileType {
|
|
95
|
-
Avatar = "avatar",
|
|
96
|
-
Banner = "banner",
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
export type UserEndpoints =
|
|
100
|
-
| Endpoint<"GET", "/users", User[]>
|
|
101
|
-
| Endpoint<"GET", "/users/:userId", User>
|
|
102
|
-
| Endpoint<"GET", "/users/@me", User>
|
|
103
|
-
| Endpoint<
|
|
104
|
-
"GET",
|
|
105
|
-
"/users/check/:identifier",
|
|
106
|
-
{
|
|
107
|
-
exists: boolean;
|
|
108
|
-
identifier: Partial<UserIdentifier>;
|
|
109
|
-
suggestions?: string[];
|
|
110
|
-
},
|
|
111
|
-
{ identifier: boolean; suggestions?: boolean }
|
|
112
|
-
>
|
|
113
|
-
| Endpoint<"PUT", "/users/:userId", User, UpdateUserDto>
|
|
114
|
-
| Endpoint<"POST", "/users/:userId/files/:userFileType", string, FormData>
|
|
115
|
-
| UserBookingEndpoints
|
|
116
|
-
| UserNotificationEndpoints;
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { ArrayOptions, ArrayResult, Base, User } from "../..";
|
|
2
|
-
import { Endpoint } from "../../../endpoints";
|
|
3
|
-
|
|
4
|
-
export enum UserNotificationType {
|
|
5
|
-
Follow = "follow",
|
|
6
|
-
// Ideas :
|
|
7
|
-
// BookingConfirmation = "booking_confirmation",
|
|
8
|
-
// EventReminder = "event_reminder",
|
|
9
|
-
// EventReminderUpdated = "event_reminder_updated",
|
|
10
|
-
// OrganizationInvite = "organization_invite",
|
|
11
|
-
// OrganizationInviteAccepted = "organization_invite_accepted",
|
|
12
|
-
// OrganizationInviteDeclined = "organization_invite_declined",
|
|
13
|
-
// OrganizationInviteExpired = "organization_invite_expired",
|
|
14
|
-
// OrganizationInviteResent = "organization_invite_resent",
|
|
15
|
-
// OrganizationEventCreated = "organization_event_created",
|
|
16
|
-
// OrganizationEventUpdated = "organization_event_updated",
|
|
17
|
-
// OrganizationEventDeleted = "organization_event_deleted",
|
|
18
|
-
// OrganizationEventStyleUpdated = "organization_event_style_updated",
|
|
19
|
-
// OrganizationEventStyleDeleted = "organization_event_style_deleted",
|
|
20
|
-
// OrganizationEventTicketCreated = "organization_event_ticket_created",
|
|
21
|
-
// OrganizationEventTicketUpdated = "organization_event_ticket_updated",
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export type UserNotificationBase = Base & {
|
|
25
|
-
type: UserNotificationType.Follow;
|
|
26
|
-
isSeen: boolean;
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
export type UserNotificationFollow = UserNotificationBase & {
|
|
30
|
-
type: UserNotificationType.Follow;
|
|
31
|
-
follower: User;
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
export type UserNotification = UserNotificationFollow;
|
|
35
|
-
|
|
36
|
-
export type UserNotificationEndpoints =
|
|
37
|
-
| Endpoint<
|
|
38
|
-
"GET",
|
|
39
|
-
"/users/@me/notifications",
|
|
40
|
-
ArrayResult<UserNotification>,
|
|
41
|
-
ArrayOptions<UserNotification>
|
|
42
|
-
>
|
|
43
|
-
| Endpoint<
|
|
44
|
-
"GET",
|
|
45
|
-
"/users/@me/notifications/count",
|
|
46
|
-
number,
|
|
47
|
-
{
|
|
48
|
-
unseen?: boolean;
|
|
49
|
-
}
|
|
50
|
-
>;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { User } from "..";
|
|
2
|
-
import { Base } from "../..";
|
|
3
|
-
|
|
4
|
-
export type UserToken = Omit<Base, "updatedAt"> & {
|
|
5
|
-
type: UserTokenType;
|
|
6
|
-
value: string;
|
|
7
|
-
expiresAt: Date;
|
|
8
|
-
user?: User;
|
|
9
|
-
identifier?: string;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export enum UserTokenType {
|
|
13
|
-
Authentication = "authentication",
|
|
14
|
-
BookingTicket = "booking_ticket",
|
|
15
|
-
OrganizationInvite = "organization_invite",
|
|
16
|
-
PasswordRecovery = "password_recovery",
|
|
17
|
-
EmailValidation = "email_validation",
|
|
18
|
-
PhoneValidation = "phone_validation",
|
|
19
|
-
}
|
package/src/sdk/auth.ts
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { ParamValue } from "pathcat";
|
|
2
|
-
|
|
3
|
-
import { sdk } from "./builder";
|
|
4
|
-
import { CreateUserDto, SignInUserDto } from "../rest";
|
|
5
|
-
import { isBrowser } from "../utils";
|
|
6
|
-
|
|
7
|
-
export const auth = sdk((client) => ({
|
|
8
|
-
signIn: async (data: SignInUserDto) => client.post("/auth/sign-in", data),
|
|
9
|
-
signUp: async (data: CreateUserDto) => client.post("/auth/sign-up", data),
|
|
10
|
-
signOut: async () => client.post("/auth/sign-out", null),
|
|
11
|
-
refreshToken: async () => client.post("/auth/refresh-token", null),
|
|
12
|
-
|
|
13
|
-
oauth2: {
|
|
14
|
-
google: {
|
|
15
|
-
connect: (params?: Record<string, ParamValue>) => {
|
|
16
|
-
if (isBrowser) {
|
|
17
|
-
window.location.href = client.url("/oauth2/google", params || {});
|
|
18
|
-
} else {
|
|
19
|
-
throw new Error("Google OAuth2 is only available in the browser");
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
twitter: {
|
|
24
|
-
connect: (params?: Record<string, ParamValue>) => {
|
|
25
|
-
if (isBrowser) {
|
|
26
|
-
window.location.href = client.url("/oauth2/twitter", params || {});
|
|
27
|
-
} else {
|
|
28
|
-
throw new Error("Twitter OAuth2 is only available in the browser");
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
facebook: {
|
|
33
|
-
connect: (params?: Record<string, ParamValue>) => {
|
|
34
|
-
if (isBrowser) {
|
|
35
|
-
window.location.href = client.url("/oauth2/facebook", params || {});
|
|
36
|
-
} else {
|
|
37
|
-
throw new Error("Facebook OAuth2 is only available in the browser");
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
}));
|
package/src/sdk/builder.ts
DELETED
package/src/sdk/careers.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { Query } from "pathcat";
|
|
2
|
-
|
|
3
|
-
import { sdk } from "./builder";
|
|
4
|
-
|
|
5
|
-
export const careers = sdk((client) => ({
|
|
6
|
-
categories: {
|
|
7
|
-
getAll: async (query?: Query<"/careers/categories">) =>
|
|
8
|
-
client.get("/careers/categories", query),
|
|
9
|
-
},
|
|
10
|
-
employmentTypes: {
|
|
11
|
-
getAll: async (query?: Query<"/careers/employmentTypes">) =>
|
|
12
|
-
client.get("/careers/employmentTypes", query),
|
|
13
|
-
},
|
|
14
|
-
jobs: {
|
|
15
|
-
getAll: async (query?: Query<"/careers/jobs">) =>
|
|
16
|
-
client.get("/careers/jobs", query),
|
|
17
|
-
get: async (jobId: number) => client.get("/careers/jobs/:jobId", { jobId }),
|
|
18
|
-
},
|
|
19
|
-
offices: {
|
|
20
|
-
getAll: async (query?: Query<"/careers/offices">) =>
|
|
21
|
-
client.get("/careers/offices", query),
|
|
22
|
-
},
|
|
23
|
-
}));
|
package/src/sdk/health.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { sdk } from "./builder";
|
|
2
|
-
|
|
3
|
-
export const health = sdk((client) => ({
|
|
4
|
-
getAll: async () => client.get("/health"),
|
|
5
|
-
database: async () => client.get("/health/database"),
|
|
6
|
-
api: async () => client.get("/health/api"),
|
|
7
|
-
app: async () => client.get("/health/app"),
|
|
8
|
-
}));
|
package/src/sdk/index.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export * from "./auth";
|
|
2
|
-
export * from "./careers";
|
|
3
|
-
export * from "./builder";
|
|
4
|
-
export * from "./health";
|
|
5
|
-
export * from "./orders";
|
|
6
|
-
export * from "./organizations";
|
|
7
|
-
export * from "./profiles";
|
|
8
|
-
export * from "./users";
|
|
9
|
-
export * from "./notifications";
|
package/src/sdk/notifications.ts
DELETED
package/src/sdk/orders.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { sdk } from "./builder";
|
|
2
|
-
import { ArrayOptions, Order } from "../rest";
|
|
3
|
-
|
|
4
|
-
export const orders = sdk((client) => ({
|
|
5
|
-
getAll: async (options?: ArrayOptions<Order>) => {
|
|
6
|
-
return client.get("/orders", options);
|
|
7
|
-
},
|
|
8
|
-
get: async (orderId: string) => {
|
|
9
|
-
return client.get("/orders/:orderId", {
|
|
10
|
-
orderId,
|
|
11
|
-
});
|
|
12
|
-
},
|
|
13
|
-
}));
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { Client } from "../../../rest";
|
|
2
|
-
import { isBrowser } from "../../../utils";
|
|
3
|
-
|
|
4
|
-
export const organizationsBilling = (client: Client) => ({
|
|
5
|
-
account: async (organizationSlug: string) =>
|
|
6
|
-
client.get("/organizations/:organizationSlug/billing/account", {
|
|
7
|
-
organizationSlug,
|
|
8
|
-
}),
|
|
9
|
-
link: (organizationSlug: string) => {
|
|
10
|
-
if (isBrowser) {
|
|
11
|
-
window.location.href = client.url(
|
|
12
|
-
"/organizations/:organizationSlug/billing/link",
|
|
13
|
-
{
|
|
14
|
-
organizationSlug,
|
|
15
|
-
},
|
|
16
|
-
);
|
|
17
|
-
} else {
|
|
18
|
-
throw new Error("Billing link is only available in the browser");
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
dashboard: (organizationSlug: string) => {
|
|
22
|
-
if (isBrowser) {
|
|
23
|
-
window.location.href = client.url(
|
|
24
|
-
"/organizations/:organizationSlug/billing/dashboard",
|
|
25
|
-
{
|
|
26
|
-
organizationSlug,
|
|
27
|
-
},
|
|
28
|
-
);
|
|
29
|
-
} else {
|
|
30
|
-
throw new Error("Billing dashboard is only available in the browser");
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
|
-
});
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { organizationsEventsOrders } from "./orders";
|
|
2
|
-
import { organizationsEventsStyles } from "./styles";
|
|
3
|
-
import { organizationsEventsTickets } from "./tickets";
|
|
4
|
-
import { organizationsEventsViews } from "./views";
|
|
5
|
-
import {
|
|
6
|
-
ArrayOptions,
|
|
7
|
-
Client,
|
|
8
|
-
CreateOrganizationEventDto,
|
|
9
|
-
OrganizationEvent,
|
|
10
|
-
UpdateOrganizationEventDto,
|
|
11
|
-
} from "../../../rest";
|
|
12
|
-
|
|
13
|
-
export const organizationsEvents = (client: Client) => ({
|
|
14
|
-
getAll: async (
|
|
15
|
-
organizationSlug?: string,
|
|
16
|
-
options?: ArrayOptions<OrganizationEvent>,
|
|
17
|
-
) => {
|
|
18
|
-
if (organizationSlug) {
|
|
19
|
-
return client.get("/organizations/:organizationSlug/events", {
|
|
20
|
-
organizationSlug,
|
|
21
|
-
...options,
|
|
22
|
-
});
|
|
23
|
-
} else {
|
|
24
|
-
return client.get("/organizations/events", options);
|
|
25
|
-
}
|
|
26
|
-
},
|
|
27
|
-
getSuggestions: async (options?: ArrayOptions<OrganizationEvent>) =>
|
|
28
|
-
client.get("/organizations/events/suggestions", options),
|
|
29
|
-
getNearby: async (
|
|
30
|
-
options: ArrayOptions<OrganizationEvent> & {
|
|
31
|
-
latitude: number;
|
|
32
|
-
longitude: number;
|
|
33
|
-
radius?: number;
|
|
34
|
-
},
|
|
35
|
-
) => client.get("/organizations/events/nearby", options),
|
|
36
|
-
getPast: async (
|
|
37
|
-
organizationSlug: string,
|
|
38
|
-
options?: ArrayOptions<OrganizationEvent>,
|
|
39
|
-
) =>
|
|
40
|
-
client.get("/organizations/:organizationSlug/events/past", {
|
|
41
|
-
organizationSlug,
|
|
42
|
-
...options,
|
|
43
|
-
}),
|
|
44
|
-
getUpcoming: async (
|
|
45
|
-
organizationSlug: string,
|
|
46
|
-
options?: ArrayOptions<OrganizationEvent>,
|
|
47
|
-
) =>
|
|
48
|
-
client.get("/organizations/:organizationSlug/events/upcoming", {
|
|
49
|
-
organizationSlug,
|
|
50
|
-
...options,
|
|
51
|
-
}),
|
|
52
|
-
get: async (organizationSlug: string, eventSlug: string) =>
|
|
53
|
-
client.get("/organizations/:organizationSlug/events/:eventSlug", {
|
|
54
|
-
organizationSlug,
|
|
55
|
-
eventSlug,
|
|
56
|
-
}),
|
|
57
|
-
create: async (organizationSlug: string, data: CreateOrganizationEventDto) =>
|
|
58
|
-
client.post("/organizations/:organizationSlug/events", data, {
|
|
59
|
-
organizationSlug,
|
|
60
|
-
}),
|
|
61
|
-
update: async (
|
|
62
|
-
organizationSlug: string,
|
|
63
|
-
eventSlug: string,
|
|
64
|
-
data: UpdateOrganizationEventDto,
|
|
65
|
-
) =>
|
|
66
|
-
client.put("/organizations/:organizationSlug/events/:eventSlug", data, {
|
|
67
|
-
organizationSlug,
|
|
68
|
-
eventSlug,
|
|
69
|
-
}),
|
|
70
|
-
delete: async (organizationSlug: string, eventSlug: string) =>
|
|
71
|
-
client.delete("/organizations/:organizationSlug/events/:eventSlug", null, {
|
|
72
|
-
organizationSlug,
|
|
73
|
-
eventSlug,
|
|
74
|
-
}),
|
|
75
|
-
orders: organizationsEventsOrders(client),
|
|
76
|
-
styles: organizationsEventsStyles(client),
|
|
77
|
-
tickets: organizationsEventsTickets(client),
|
|
78
|
-
views: organizationsEventsViews(client),
|
|
79
|
-
});
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Client, CreateOrganizationEventOrderDto } from "../../../../rest";
|
|
2
|
-
|
|
3
|
-
export const organizationsEventsOrders = (client: Client) => ({
|
|
4
|
-
create: async (
|
|
5
|
-
organizationSlug: string,
|
|
6
|
-
eventSlug: string,
|
|
7
|
-
data: CreateOrganizationEventOrderDto,
|
|
8
|
-
) =>
|
|
9
|
-
client.post(
|
|
10
|
-
"/organizations/:organizationSlug/events/:eventSlug/orders",
|
|
11
|
-
data,
|
|
12
|
-
{
|
|
13
|
-
organizationSlug,
|
|
14
|
-
eventSlug,
|
|
15
|
-
},
|
|
16
|
-
),
|
|
17
|
-
});
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Client } from "../../../../rest";
|
|
2
|
-
import {
|
|
3
|
-
CreateOrganizationEventStyleDto,
|
|
4
|
-
UpdateOrganizationEventStyleDto,
|
|
5
|
-
} from "../../../../rest/dtos/organizations/events/styles";
|
|
6
|
-
|
|
7
|
-
export const organizationsEventsStyles = (client: Client) => ({
|
|
8
|
-
getAll: async () => client.get("/organizations/events/styles"),
|
|
9
|
-
get: async (styleSlug: string) =>
|
|
10
|
-
client.get("/organizations/events/styles/:styleSlug", { styleSlug }),
|
|
11
|
-
create: async (data: CreateOrganizationEventStyleDto) =>
|
|
12
|
-
client.post("/organizations/events/styles", data),
|
|
13
|
-
update: async (styleSlug: string, data: UpdateOrganizationEventStyleDto) =>
|
|
14
|
-
client.put("/organizations/events/styles/:styleSlug", data, { styleSlug }),
|
|
15
|
-
delete: async (styleSlug: string) =>
|
|
16
|
-
client.delete("/organizations/events/styles/:styleSlug", null, {
|
|
17
|
-
styleSlug,
|
|
18
|
-
}),
|
|
19
|
-
});
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Client,
|
|
3
|
-
CreateOrganizationEventTicketDto,
|
|
4
|
-
UpdateOrganizationEventTicketDto,
|
|
5
|
-
} from "../../../../rest";
|
|
6
|
-
|
|
7
|
-
export const organizationsEventsTickets = (client: Client) => ({
|
|
8
|
-
getAll: async (organizationSlug: string, eventSlug: string) =>
|
|
9
|
-
client.get("/organizations/:organizationSlug/events/:eventSlug/tickets", {
|
|
10
|
-
organizationSlug,
|
|
11
|
-
eventSlug,
|
|
12
|
-
}),
|
|
13
|
-
get: async (organizationSlug: string, eventSlug: string, ticketId: string) =>
|
|
14
|
-
client.get(
|
|
15
|
-
"/organizations/:organizationSlug/events/:eventSlug/tickets/:ticketId",
|
|
16
|
-
{
|
|
17
|
-
organizationSlug,
|
|
18
|
-
eventSlug,
|
|
19
|
-
ticketId,
|
|
20
|
-
},
|
|
21
|
-
),
|
|
22
|
-
create: async (
|
|
23
|
-
organizationSlug: string,
|
|
24
|
-
eventSlug: string,
|
|
25
|
-
data: CreateOrganizationEventTicketDto,
|
|
26
|
-
) =>
|
|
27
|
-
client.post(
|
|
28
|
-
"/organizations/:organizationSlug/events/:eventSlug/tickets",
|
|
29
|
-
data,
|
|
30
|
-
{
|
|
31
|
-
organizationSlug,
|
|
32
|
-
eventSlug,
|
|
33
|
-
},
|
|
34
|
-
),
|
|
35
|
-
update: async (
|
|
36
|
-
organizationSlug: string,
|
|
37
|
-
eventSlug: string,
|
|
38
|
-
ticketId: string,
|
|
39
|
-
data: UpdateOrganizationEventTicketDto,
|
|
40
|
-
) =>
|
|
41
|
-
client.put(
|
|
42
|
-
"/organizations/:organizationSlug/events/:eventSlug/tickets/:ticketId",
|
|
43
|
-
data,
|
|
44
|
-
{
|
|
45
|
-
organizationSlug,
|
|
46
|
-
eventSlug,
|
|
47
|
-
ticketId,
|
|
48
|
-
},
|
|
49
|
-
),
|
|
50
|
-
delete: async (
|
|
51
|
-
organizationSlug: string,
|
|
52
|
-
eventSlug: string,
|
|
53
|
-
ticketId: string,
|
|
54
|
-
) =>
|
|
55
|
-
client.delete(
|
|
56
|
-
"/organizations/:organizationSlug/events/:eventSlug/tickets/:ticketId",
|
|
57
|
-
null,
|
|
58
|
-
{
|
|
59
|
-
organizationSlug,
|
|
60
|
-
eventSlug,
|
|
61
|
-
ticketId,
|
|
62
|
-
},
|
|
63
|
-
),
|
|
64
|
-
});
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Client } from "../../../../rest";
|
|
2
|
-
|
|
3
|
-
export const organizationsEventsViews = (client: Client) => ({
|
|
4
|
-
record: async (organizationSlug: string, eventSlug: string) =>
|
|
5
|
-
client.post(
|
|
6
|
-
"/organizations/:organizationSlug/events/:eventSlug/views",
|
|
7
|
-
null,
|
|
8
|
-
{
|
|
9
|
-
organizationSlug,
|
|
10
|
-
eventSlug,
|
|
11
|
-
},
|
|
12
|
-
),
|
|
13
|
-
});
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { organizationsBilling } from "./billing";
|
|
2
|
-
import { organizationsEvents } from "./events";
|
|
3
|
-
import { organizationsMembers } from "./members";
|
|
4
|
-
import { CreateOrganizationDto, UpdateOrganizationDto } from "../../rest";
|
|
5
|
-
import { sdk } from "../builder";
|
|
6
|
-
|
|
7
|
-
export const organizations = sdk((client) => ({
|
|
8
|
-
getAll: async () => client.get("/organizations"),
|
|
9
|
-
get: async (organizationSlug: string) =>
|
|
10
|
-
client.get("/organizations/:organizationSlug", { organizationSlug }),
|
|
11
|
-
create: async (data: CreateOrganizationDto) =>
|
|
12
|
-
client.post("/organizations", data),
|
|
13
|
-
update: async (organizationSlug: string, data: UpdateOrganizationDto) =>
|
|
14
|
-
client.put("/organizations/:organizationSlug", data, { organizationSlug }),
|
|
15
|
-
delete: async (organizationSlug: string) =>
|
|
16
|
-
client.delete("/organizations/:organizationSlug", null, {
|
|
17
|
-
organizationSlug,
|
|
18
|
-
}),
|
|
19
|
-
billing: organizationsBilling(client),
|
|
20
|
-
events: organizationsEvents(client),
|
|
21
|
-
members: organizationsMembers(client),
|
|
22
|
-
}));
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { Client } from "../../../rest";
|
|
2
|
-
|
|
3
|
-
export const organizationsMembers = (client: Client) => ({
|
|
4
|
-
getAll: async () => client.get("/organizations/members"),
|
|
5
|
-
delete: async (memberId: string) =>
|
|
6
|
-
client.delete("/organizations/members/:memberId", null, { memberId }),
|
|
7
|
-
});
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { profilesRelationships } from "./relationships";
|
|
2
|
-
import { sdk } from "../builder";
|
|
3
|
-
|
|
4
|
-
export const profiles = sdk((client) => ({
|
|
5
|
-
get: async (username: string) =>
|
|
6
|
-
client.get("/profiles/:username", { username }),
|
|
7
|
-
relationships: profilesRelationships(client),
|
|
8
|
-
}));
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ArrayOptions,
|
|
3
|
-
OrganizationIdentity,
|
|
4
|
-
UserIdentity,
|
|
5
|
-
} from "../../../rest";
|
|
6
|
-
import { sdk } from "../../builder";
|
|
7
|
-
|
|
8
|
-
export const profilesRelationships = sdk((client) => ({
|
|
9
|
-
follow: async (username: string) =>
|
|
10
|
-
client.post("/profiles/:username/relationships/follow", null, {
|
|
11
|
-
username,
|
|
12
|
-
}),
|
|
13
|
-
unfollow: async (username: string) =>
|
|
14
|
-
client.post("/profiles/:username/relationships/unfollow", null, {
|
|
15
|
-
username,
|
|
16
|
-
}),
|
|
17
|
-
getSuggestions: async (
|
|
18
|
-
options: ArrayOptions<UserIdentity | OrganizationIdentity>,
|
|
19
|
-
) => client.get("/profiles/@me/relationships/suggestions", options),
|
|
20
|
-
getFollowers: async (
|
|
21
|
-
username: string,
|
|
22
|
-
options: ArrayOptions<UserIdentity | OrganizationIdentity>,
|
|
23
|
-
) =>
|
|
24
|
-
client.get("/profiles/:username/relationships/followers", {
|
|
25
|
-
username,
|
|
26
|
-
...options,
|
|
27
|
-
}),
|
|
28
|
-
}));
|