tonightpass 0.0.47 → 0.0.49
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 +16 -0
- package/dist/index.d.mts +146 -88
- package/dist/index.d.ts +146 -88
- package/dist/index.js +32 -33
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/constants/regex.ts +23 -20
- package/src/rest/dtos/organizations/create-organization.dto.ts +1 -1
- package/src/rest/dtos/organizations/events/carts/create-organization-event-cart.dto.ts +8 -0
- package/src/rest/dtos/organizations/events/carts/index.ts +2 -0
- package/src/rest/dtos/organizations/events/carts/update-organization-event-cart.dto.ts +3 -0
- package/src/rest/dtos/organizations/events/index.ts +4 -1
- package/src/rest/dtos/users/update-user.dto.ts +3 -3
- package/src/rest/types/careers/index.ts +1 -1
- package/src/rest/types/index.ts +2 -3
- package/src/rest/types/organizations/events/carts/index.ts +42 -0
- package/src/rest/types/organizations/events/index.ts +4 -2
- package/src/rest/types/organizations/events/styles/index.ts +4 -4
- package/src/rest/types/organizations/events/tickets/index.ts +5 -5
- package/src/rest/types/organizations/index.ts +11 -6
- package/src/rest/types/organizations/members/index.ts +8 -3
- package/src/rest/types/users/index.ts +2 -2
- package/src/sdk/careers.ts +1 -1
- package/src/sdk/organizations/billing/index.ts +14 -9
- package/src/sdk/organizations/events/carts/index.ts +50 -0
- package/src/sdk/organizations/events/index.ts +27 -8
- package/src/sdk/organizations/events/styles/index.ts +9 -7
- package/src/sdk/organizations/events/tickets/index.ts +31 -20
- package/src/sdk/organizations/index.ts +8 -5
- package/src/sdk/organizations/members/index.ts +2 -2
- package/src/sdk/users.ts +2 -2
- package/tests/index.ts +2 -1
- package/tests/regex/index.ts +76 -0
- /package/src/rest/dtos/organizations/events/{events → styles}/create-organization-event-style.dto.ts +0 -0
- /package/src/rest/dtos/organizations/events/{events → styles}/index.ts +0 -0
- /package/src/rest/dtos/organizations/events/{events → styles}/update-organization-event-style.dto.ts +0 -0
package/src/rest/types/index.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { Populate } from "@mikro-orm/core";
|
|
2
|
-
|
|
3
1
|
export * from "./auth";
|
|
4
2
|
export * from "./careers";
|
|
5
3
|
export * from "./health";
|
|
@@ -91,11 +89,12 @@ export type ArrayFilterOptions = {
|
|
|
91
89
|
| "nin"; // Not in
|
|
92
90
|
};
|
|
93
91
|
|
|
92
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
94
93
|
export type ArrayOptions<T> = {
|
|
95
94
|
/**
|
|
96
95
|
* Populate relations
|
|
97
96
|
*/
|
|
98
|
-
populate?:
|
|
97
|
+
populate?: string[];
|
|
99
98
|
/**
|
|
100
99
|
* Select only specific fields to display
|
|
101
100
|
*/
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { OrganizationEvent, OrganizationEventTicket } from "..";
|
|
2
|
+
import { ArrayOptions, ArrayResult } from "../../..";
|
|
3
|
+
import {
|
|
4
|
+
CreateOrganizationEventCartDto,
|
|
5
|
+
UpdateOrganizationEventCartDto,
|
|
6
|
+
} from "../../../../dtos";
|
|
7
|
+
import { Endpoint } from "../../../../endpoints";
|
|
8
|
+
|
|
9
|
+
export type OrganizationEventCart = {
|
|
10
|
+
organizationEvent: OrganizationEvent;
|
|
11
|
+
tickets: OrganizationEventCartTicket[];
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export type OrganizationEventCartTicket = {
|
|
15
|
+
ticket: OrganizationEventTicket;
|
|
16
|
+
quantity: number;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export type OrganizationEventCartEndpoints =
|
|
20
|
+
| Endpoint<
|
|
21
|
+
"GET",
|
|
22
|
+
"/organizations/:organizationSlug/events/:eventSlug/carts",
|
|
23
|
+
ArrayResult<OrganizationEventCart>,
|
|
24
|
+
ArrayOptions<OrganizationEventCart>
|
|
25
|
+
>
|
|
26
|
+
| Endpoint<
|
|
27
|
+
"GET",
|
|
28
|
+
"/organizations/:organizationSlug/events/:eventSlug/carts/:cartId",
|
|
29
|
+
OrganizationEventCart
|
|
30
|
+
>
|
|
31
|
+
| Endpoint<
|
|
32
|
+
"POST",
|
|
33
|
+
"/organizations/:organizationSlug/events/:eventSlug/carts",
|
|
34
|
+
OrganizationEventCart,
|
|
35
|
+
CreateOrganizationEventCartDto
|
|
36
|
+
>
|
|
37
|
+
| Endpoint<
|
|
38
|
+
"PUT",
|
|
39
|
+
"/organizations/:organizationSlug/events/:eventSlug/carts/:cartId",
|
|
40
|
+
OrganizationEventCart,
|
|
41
|
+
UpdateOrganizationEventCartDto
|
|
42
|
+
>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { OrganizationEventCartEndpoints } from "./carts";
|
|
1
2
|
import {
|
|
2
3
|
OrganizationEventStyle,
|
|
3
4
|
OrganizationEventStyleEndpoints,
|
|
@@ -87,7 +88,7 @@ export type OrganizationEventEndpoints =
|
|
|
87
88
|
>
|
|
88
89
|
| Endpoint<
|
|
89
90
|
"GET",
|
|
90
|
-
"/organizations/:
|
|
91
|
+
"/organizations/:organizationSlug/events",
|
|
91
92
|
ArrayResult<OrganizationEvent>,
|
|
92
93
|
ArrayOptions<OrganizationEvent>
|
|
93
94
|
>
|
|
@@ -98,7 +99,7 @@ export type OrganizationEventEndpoints =
|
|
|
98
99
|
>
|
|
99
100
|
| Endpoint<
|
|
100
101
|
"POST",
|
|
101
|
-
"/organizations/:
|
|
102
|
+
"/organizations/:organizationSlug/events",
|
|
102
103
|
OrganizationEvent,
|
|
103
104
|
CreateOrganizationEventDto
|
|
104
105
|
>
|
|
@@ -114,5 +115,6 @@ export type OrganizationEventEndpoints =
|
|
|
114
115
|
OrganizationEvent,
|
|
115
116
|
null
|
|
116
117
|
>
|
|
118
|
+
| OrganizationEventCartEndpoints
|
|
117
119
|
| OrganizationEventStyleEndpoints
|
|
118
120
|
| OrganizationEventTicketEndpoints;
|
|
@@ -2,7 +2,7 @@ import { Base } from "../../..";
|
|
|
2
2
|
import {
|
|
3
3
|
CreateOrganizationEventStyleDto,
|
|
4
4
|
UpdateOrganizationEventStyleDto,
|
|
5
|
-
} from "../../../../dtos/organizations/events/
|
|
5
|
+
} from "../../../../dtos/organizations/events/styles";
|
|
6
6
|
import { Endpoint } from "../../../../endpoints";
|
|
7
7
|
|
|
8
8
|
export type OrganizationEventStyle = Base & {
|
|
@@ -24,7 +24,7 @@ export type OrganizationEventStyleEndpoints =
|
|
|
24
24
|
| Endpoint<"GET", "/organizations/events/styles", OrganizationEventStyle[]>
|
|
25
25
|
| Endpoint<
|
|
26
26
|
"GET",
|
|
27
|
-
"/organizations/events/styles/:
|
|
27
|
+
"/organizations/events/styles/:styleSlug",
|
|
28
28
|
OrganizationEventStyle
|
|
29
29
|
>
|
|
30
30
|
| Endpoint<
|
|
@@ -35,13 +35,13 @@ export type OrganizationEventStyleEndpoints =
|
|
|
35
35
|
>
|
|
36
36
|
| Endpoint<
|
|
37
37
|
"PUT",
|
|
38
|
-
"/organizations/events/styles/:
|
|
38
|
+
"/organizations/events/styles/:styleSlug",
|
|
39
39
|
OrganizationEventStyle,
|
|
40
40
|
UpdateOrganizationEventStyleDto
|
|
41
41
|
>
|
|
42
42
|
| Endpoint<
|
|
43
43
|
"DELETE",
|
|
44
|
-
"/organizations/events/styles/:
|
|
44
|
+
"/organizations/events/styles/:styleSlug",
|
|
45
45
|
OrganizationEventStyle[],
|
|
46
46
|
null
|
|
47
47
|
>;
|
|
@@ -43,29 +43,29 @@ export enum OrganizationEventTicketCategory {
|
|
|
43
43
|
export type OrganizationEventTicketEndpoints =
|
|
44
44
|
| Endpoint<
|
|
45
45
|
"GET",
|
|
46
|
-
"/organizations/:
|
|
46
|
+
"/organizations/:organizationSlug/events/:eventSlug/tickets",
|
|
47
47
|
OrganizationEventTicket[]
|
|
48
48
|
>
|
|
49
49
|
| Endpoint<
|
|
50
50
|
"GET",
|
|
51
|
-
"/organizations/:
|
|
51
|
+
"/organizations/:organizationSlug/events/:eventSlug/tickets/:ticketId",
|
|
52
52
|
OrganizationEventTicket
|
|
53
53
|
>
|
|
54
54
|
| Endpoint<
|
|
55
55
|
"POST",
|
|
56
|
-
"/organizations/:
|
|
56
|
+
"/organizations/:organizationSlug/events/:eventSlug/tickets",
|
|
57
57
|
OrganizationEventTicket,
|
|
58
58
|
CreateOrganizationEventTicketDto
|
|
59
59
|
>
|
|
60
60
|
| Endpoint<
|
|
61
61
|
"PUT",
|
|
62
|
-
"/organizations/:
|
|
62
|
+
"/organizations/:organizationSlug/events/:eventSlug/tickets/:ticketId",
|
|
63
63
|
OrganizationEventTicket,
|
|
64
64
|
UpdateOrganizationEventTicketDto
|
|
65
65
|
>
|
|
66
66
|
| Endpoint<
|
|
67
67
|
"DELETE",
|
|
68
|
-
"/organizations/:
|
|
68
|
+
"/organizations/:organizationSlug/events/:eventSlug/tickets/:ticketId",
|
|
69
69
|
OrganizationEventTicket[],
|
|
70
70
|
null
|
|
71
71
|
>;
|
|
@@ -53,16 +53,21 @@ export enum OrganizationSocialType {
|
|
|
53
53
|
|
|
54
54
|
export type OrganizationEndpoints =
|
|
55
55
|
| Endpoint<"GET", "/organizations", Organization[]>
|
|
56
|
-
| Endpoint<"GET", "/organizations/:
|
|
56
|
+
| Endpoint<"GET", "/organizations/:organizationSlug", Organization>
|
|
57
57
|
| Endpoint<"POST", "/organizations", Organization, CreateOrganizationDto>
|
|
58
|
-
| Endpoint<
|
|
59
|
-
|
|
58
|
+
| Endpoint<
|
|
59
|
+
"PUT",
|
|
60
|
+
"/organizations/:organizationSlug",
|
|
61
|
+
Organization,
|
|
62
|
+
UpdateOrganizationDto
|
|
63
|
+
>
|
|
64
|
+
| Endpoint<"DELETE", "/organizations/:organizationSlug", Organization, null>
|
|
60
65
|
| Endpoint<
|
|
61
66
|
"GET",
|
|
62
|
-
"/organizations/:
|
|
67
|
+
"/organizations/:organizationSlug/billing/account",
|
|
63
68
|
OrganizationBillingAccount
|
|
64
69
|
>
|
|
65
|
-
| Endpoint<"GET", "/organizations/:
|
|
66
|
-
| Endpoint<"GET", "/organizations/:
|
|
70
|
+
| Endpoint<"GET", "/organizations/:organizationSlug/billing/link", void>
|
|
71
|
+
| Endpoint<"GET", "/organizations/:organizationSlug/billing/dashboard", void>
|
|
67
72
|
| OrganizationEventEndpoints
|
|
68
73
|
| OrganizationMembersEndpoints;
|
|
@@ -34,16 +34,21 @@ export type OrganizationMembersEndpoints =
|
|
|
34
34
|
ArrayResult<OrganizationMember>,
|
|
35
35
|
ArrayOptions<OrganizationMember>
|
|
36
36
|
>
|
|
37
|
-
| Endpoint<
|
|
37
|
+
| Endpoint<
|
|
38
|
+
"DELETE",
|
|
39
|
+
"/organizations/members/:memberId",
|
|
40
|
+
OrganizationMember[],
|
|
41
|
+
null
|
|
42
|
+
>
|
|
38
43
|
| Endpoint<
|
|
39
44
|
"GET",
|
|
40
|
-
"/organizations/:
|
|
45
|
+
"/organizations/:organizationSlug/members",
|
|
41
46
|
ArrayResult<OrganizationMember>,
|
|
42
47
|
ArrayOptions<OrganizationMember>
|
|
43
48
|
>
|
|
44
49
|
| Endpoint<
|
|
45
50
|
"POST",
|
|
46
|
-
"/organizations/:
|
|
51
|
+
"/organizations/:organizationSlug/members",
|
|
47
52
|
OrganizationMember,
|
|
48
53
|
CreateOrganizationMemberDto
|
|
49
54
|
>
|
|
@@ -97,7 +97,7 @@ export type UserConnectionClient = {
|
|
|
97
97
|
|
|
98
98
|
export type UserEndpoints =
|
|
99
99
|
| Endpoint<"GET", "/users", User[]>
|
|
100
|
-
| Endpoint<"GET", "/users/:
|
|
100
|
+
| Endpoint<"GET", "/users/:userId", User, { id: string }>
|
|
101
101
|
| Endpoint<"GET", "/users/me", User>
|
|
102
102
|
| Endpoint<
|
|
103
103
|
"GET",
|
|
@@ -109,4 +109,4 @@ export type UserEndpoints =
|
|
|
109
109
|
},
|
|
110
110
|
{ identifier: boolean; suggestions?: boolean }
|
|
111
111
|
>
|
|
112
|
-
| Endpoint<"PUT", "/users/:
|
|
112
|
+
| Endpoint<"PUT", "/users/:userId", User, UpdateUserDto>;
|
package/src/sdk/careers.ts
CHANGED
|
@@ -14,7 +14,7 @@ export const careers = sdk((client) => ({
|
|
|
14
14
|
jobs: {
|
|
15
15
|
getAll: async (query?: Query<"/careers/jobs">) =>
|
|
16
16
|
client.get("/careers/jobs", query),
|
|
17
|
-
get: async (
|
|
17
|
+
get: async (jobId: number) => client.get("/careers/jobs/:jobId", { jobId }),
|
|
18
18
|
},
|
|
19
19
|
offices: {
|
|
20
20
|
getAll: async (query?: Query<"/careers/offices">) =>
|
|
@@ -2,23 +2,28 @@ import { Client } from "../../../rest";
|
|
|
2
2
|
import { isBrowser } from "../../../utils";
|
|
3
3
|
|
|
4
4
|
export const organizationsBilling = (client: Client) => ({
|
|
5
|
-
account: async (
|
|
6
|
-
client.get("/organizations/:
|
|
7
|
-
|
|
5
|
+
account: async (organizationSlug: string) =>
|
|
6
|
+
client.get("/organizations/:organizationSlug/billing/account", {
|
|
7
|
+
organizationSlug,
|
|
8
|
+
}),
|
|
9
|
+
link: (organizationSlug: string) => {
|
|
8
10
|
if (isBrowser) {
|
|
9
|
-
window.location.href = client.url(
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
window.location.href = client.url(
|
|
12
|
+
"/organizations/:organizationSlug/billing/link",
|
|
13
|
+
{
|
|
14
|
+
organizationSlug,
|
|
15
|
+
},
|
|
16
|
+
);
|
|
12
17
|
} else {
|
|
13
18
|
throw new Error("Billing link is only available in the browser");
|
|
14
19
|
}
|
|
15
20
|
},
|
|
16
|
-
dashboard: (
|
|
21
|
+
dashboard: (organizationSlug: string) => {
|
|
17
22
|
if (isBrowser) {
|
|
18
23
|
window.location.href = client.url(
|
|
19
|
-
"/organizations/:
|
|
24
|
+
"/organizations/:organizationSlug/billing/dashboard",
|
|
20
25
|
{
|
|
21
|
-
|
|
26
|
+
organizationSlug,
|
|
22
27
|
},
|
|
23
28
|
);
|
|
24
29
|
} else {
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Client,
|
|
3
|
+
CreateOrganizationEventCartDto,
|
|
4
|
+
UpdateOrganizationEventCartDto,
|
|
5
|
+
} from "../../../../rest";
|
|
6
|
+
|
|
7
|
+
export const organizationsEventCarts = (client: Client) => ({
|
|
8
|
+
getAll: async (organizationSlug: string, eventSlug: string) =>
|
|
9
|
+
client.get("/organizations/:organizationSlug/events/:eventSlug/carts", {
|
|
10
|
+
organizationSlug,
|
|
11
|
+
eventSlug,
|
|
12
|
+
}),
|
|
13
|
+
get: async (organizationSlug: string, eventSlug: string, cartId: string) =>
|
|
14
|
+
client.get(
|
|
15
|
+
"/organizations/:organizationSlug/events/:eventSlug/carts/:cartId",
|
|
16
|
+
{
|
|
17
|
+
organizationSlug,
|
|
18
|
+
eventSlug,
|
|
19
|
+
cartId,
|
|
20
|
+
},
|
|
21
|
+
),
|
|
22
|
+
create: async (
|
|
23
|
+
organizationSlug: string,
|
|
24
|
+
eventSlug: string,
|
|
25
|
+
data: CreateOrganizationEventCartDto,
|
|
26
|
+
) =>
|
|
27
|
+
client.post(
|
|
28
|
+
"/organizations/:organizationSlug/events/:eventSlug/carts",
|
|
29
|
+
data,
|
|
30
|
+
{
|
|
31
|
+
organizationSlug,
|
|
32
|
+
eventSlug,
|
|
33
|
+
},
|
|
34
|
+
),
|
|
35
|
+
update: async (
|
|
36
|
+
organizationSlug: string,
|
|
37
|
+
eventSlug: string,
|
|
38
|
+
cartId: string,
|
|
39
|
+
data: UpdateOrganizationEventCartDto,
|
|
40
|
+
) =>
|
|
41
|
+
client.put(
|
|
42
|
+
"/organizations/:organizationSlug/events/:eventSlug/carts/:cartId",
|
|
43
|
+
data,
|
|
44
|
+
{
|
|
45
|
+
organizationSlug,
|
|
46
|
+
eventSlug,
|
|
47
|
+
cartId,
|
|
48
|
+
},
|
|
49
|
+
),
|
|
50
|
+
});
|
|
@@ -1,27 +1,45 @@
|
|
|
1
|
+
import { organizationsEventCarts } from "./carts";
|
|
1
2
|
import { organizationsEventsStyles } from "./styles";
|
|
2
3
|
import { organizationsEventsTickets } from "./tickets";
|
|
3
4
|
import {
|
|
4
5
|
ArrayOptions,
|
|
5
6
|
Client,
|
|
6
7
|
CreateOrganizationEventDto,
|
|
8
|
+
OrganizationEvent,
|
|
7
9
|
UpdateOrganizationEventDto,
|
|
8
10
|
} from "../../../rest";
|
|
9
11
|
|
|
10
12
|
export const organizationsEvents = (client: Client) => ({
|
|
11
|
-
getAll: async (
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
getAll: async (
|
|
14
|
+
organizationSlug?: string,
|
|
15
|
+
options?: ArrayOptions<OrganizationEvent>,
|
|
16
|
+
) => {
|
|
17
|
+
if (organizationSlug) {
|
|
18
|
+
return client.get("/organizations/:organizationSlug/events", {
|
|
19
|
+
organizationSlug,
|
|
20
|
+
...options,
|
|
21
|
+
});
|
|
22
|
+
} else {
|
|
23
|
+
return client.get("/organizations/events", options);
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
getSuggestions: async (options?: ArrayOptions<OrganizationEvent>) =>
|
|
16
27
|
client.get("/organizations/events/suggestions", options),
|
|
28
|
+
getNearby: async (
|
|
29
|
+
options: ArrayOptions<OrganizationEvent> & {
|
|
30
|
+
latitude: number;
|
|
31
|
+
longitude: number;
|
|
32
|
+
radius?: number;
|
|
33
|
+
},
|
|
34
|
+
) => client.get("/organizations/events/nearby", options),
|
|
17
35
|
get: async (organizationSlug: string, eventSlug: string) =>
|
|
18
36
|
client.get("/organizations/:organizationSlug/events/:eventSlug", {
|
|
19
37
|
organizationSlug,
|
|
20
38
|
eventSlug,
|
|
21
39
|
}),
|
|
22
|
-
create: async (
|
|
23
|
-
client.post("/organizations/:
|
|
24
|
-
|
|
40
|
+
create: async (organizationSlug: string, data: CreateOrganizationEventDto) =>
|
|
41
|
+
client.post("/organizations/:organizationSlug/events", data, {
|
|
42
|
+
organizationSlug,
|
|
25
43
|
}),
|
|
26
44
|
update: async (
|
|
27
45
|
organizationSlug: string,
|
|
@@ -37,6 +55,7 @@ export const organizationsEvents = (client: Client) => ({
|
|
|
37
55
|
organizationSlug,
|
|
38
56
|
eventSlug,
|
|
39
57
|
}),
|
|
58
|
+
carts: organizationsEventCarts(client),
|
|
40
59
|
styles: organizationsEventsStyles(client),
|
|
41
60
|
tickets: organizationsEventsTickets(client),
|
|
42
61
|
});
|
|
@@ -2,16 +2,18 @@ import { Client } from "../../../../rest";
|
|
|
2
2
|
import {
|
|
3
3
|
CreateOrganizationEventStyleDto,
|
|
4
4
|
UpdateOrganizationEventStyleDto,
|
|
5
|
-
} from "../../../../rest/dtos/organizations/events/
|
|
5
|
+
} from "../../../../rest/dtos/organizations/events/styles";
|
|
6
6
|
|
|
7
7
|
export const organizationsEventsStyles = (client: Client) => ({
|
|
8
8
|
getAll: async () => client.get("/organizations/events/styles"),
|
|
9
|
-
get: async (
|
|
10
|
-
client.get("/organizations/events/styles/:
|
|
9
|
+
get: async (styleSlug: string) =>
|
|
10
|
+
client.get("/organizations/events/styles/:styleSlug", { styleSlug }),
|
|
11
11
|
create: async (data: CreateOrganizationEventStyleDto) =>
|
|
12
12
|
client.post("/organizations/events/styles", data),
|
|
13
|
-
update: async (
|
|
14
|
-
client.put("/organizations/events/styles/:
|
|
15
|
-
delete: async (
|
|
16
|
-
client.delete("/organizations/events/styles/:
|
|
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
|
+
}),
|
|
17
19
|
});
|
|
@@ -5,47 +5,58 @@ import {
|
|
|
5
5
|
} from "../../../../rest";
|
|
6
6
|
|
|
7
7
|
export const organizationsEventsTickets = (client: Client) => ({
|
|
8
|
-
getAll: async (
|
|
9
|
-
client.get("/organizations/:
|
|
10
|
-
|
|
8
|
+
getAll: async (organizationSlug: string, eventSlug: string) =>
|
|
9
|
+
client.get("/organizations/:organizationSlug/events/:eventSlug/tickets", {
|
|
10
|
+
organizationSlug,
|
|
11
11
|
eventSlug,
|
|
12
12
|
}),
|
|
13
|
-
get: async (
|
|
14
|
-
client.get(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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
|
+
),
|
|
19
22
|
create: async (
|
|
20
|
-
|
|
23
|
+
organizationSlug: string,
|
|
21
24
|
eventSlug: string,
|
|
22
25
|
data: CreateOrganizationEventTicketDto,
|
|
23
26
|
) =>
|
|
24
|
-
client.post(
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
27
|
+
client.post(
|
|
28
|
+
"/organizations/:organizationSlug/events/:eventSlug/tickets",
|
|
29
|
+
data,
|
|
30
|
+
{
|
|
31
|
+
organizationSlug,
|
|
32
|
+
eventSlug,
|
|
33
|
+
},
|
|
34
|
+
),
|
|
28
35
|
update: async (
|
|
29
|
-
|
|
36
|
+
organizationSlug: string,
|
|
30
37
|
eventSlug: string,
|
|
31
38
|
ticketId: string,
|
|
32
39
|
data: UpdateOrganizationEventTicketDto,
|
|
33
40
|
) =>
|
|
34
41
|
client.put(
|
|
35
|
-
"/organizations/:
|
|
42
|
+
"/organizations/:organizationSlug/events/:eventSlug/tickets/:ticketId",
|
|
36
43
|
data,
|
|
37
44
|
{
|
|
38
|
-
|
|
45
|
+
organizationSlug,
|
|
39
46
|
eventSlug,
|
|
40
47
|
ticketId,
|
|
41
48
|
},
|
|
42
49
|
),
|
|
43
|
-
delete: async (
|
|
50
|
+
delete: async (
|
|
51
|
+
organizationSlug: string,
|
|
52
|
+
eventSlug: string,
|
|
53
|
+
ticketId: string,
|
|
54
|
+
) =>
|
|
44
55
|
client.delete(
|
|
45
|
-
"/organizations/:
|
|
56
|
+
"/organizations/:organizationSlug/events/:eventSlug/tickets/:ticketId",
|
|
46
57
|
null,
|
|
47
58
|
{
|
|
48
|
-
|
|
59
|
+
organizationSlug,
|
|
49
60
|
eventSlug,
|
|
50
61
|
ticketId,
|
|
51
62
|
},
|
|
@@ -6,13 +6,16 @@ import { sdk } from "../builder";
|
|
|
6
6
|
|
|
7
7
|
export const organizations = sdk((client) => ({
|
|
8
8
|
getAll: async () => client.get("/organizations"),
|
|
9
|
-
get: async (
|
|
9
|
+
get: async (organizationSlug: string) =>
|
|
10
|
+
client.get("/organizations/:organizationSlug", { organizationSlug }),
|
|
10
11
|
create: async (data: CreateOrganizationDto) =>
|
|
11
12
|
client.post("/organizations", data),
|
|
12
|
-
update: async (
|
|
13
|
-
client.put("/organizations/:
|
|
14
|
-
delete: async (
|
|
15
|
-
client.delete("/organizations/:
|
|
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
|
+
}),
|
|
16
19
|
billing: organizationsBilling(client),
|
|
17
20
|
events: organizationsEvents(client),
|
|
18
21
|
members: organizationsMembers(client),
|
|
@@ -2,6 +2,6 @@ import { Client } from "../../../rest";
|
|
|
2
2
|
|
|
3
3
|
export const organizationsMembers = (client: Client) => ({
|
|
4
4
|
getAll: async () => client.get("/organizations/members"),
|
|
5
|
-
delete: async (
|
|
6
|
-
client.delete("/organizations/members/:
|
|
5
|
+
delete: async (memberId: string) =>
|
|
6
|
+
client.delete("/organizations/members/:memberId", null, { memberId }),
|
|
7
7
|
});
|
package/src/sdk/users.ts
CHANGED
|
@@ -7,6 +7,6 @@ export const users = sdk((client) => ({
|
|
|
7
7
|
me: async () => client.get("/users/me"),
|
|
8
8
|
check: async (identifier: string, suggestions?: boolean) =>
|
|
9
9
|
client.get("/users/check/:identifier", { identifier, suggestions }),
|
|
10
|
-
update: async (
|
|
11
|
-
client.put("/users/:
|
|
10
|
+
update: async (userId: string, data: UpdateUserDto) =>
|
|
11
|
+
client.put("/users/:userId", data, { userId }),
|
|
12
12
|
}));
|
package/tests/index.ts
CHANGED
|
@@ -5,10 +5,11 @@ import test from "node:test";
|
|
|
5
5
|
|
|
6
6
|
import { authTests } from "./auth";
|
|
7
7
|
import { careersTests } from "./careers";
|
|
8
|
+
import { regexTests } from "./regex";
|
|
8
9
|
import { usersTests } from "./users";
|
|
9
10
|
import { TonightPass } from "../src/tonightpass";
|
|
10
11
|
|
|
11
|
-
const sdkTests = [authTests, careersTests, usersTests];
|
|
12
|
+
const sdkTests = [authTests, careersTests, regexTests, usersTests];
|
|
12
13
|
|
|
13
14
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
14
15
|
// @ts-expect-error
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import assert from "assert";
|
|
2
|
+
import test from "node:test";
|
|
3
|
+
|
|
4
|
+
import { REGEX } from "../../src";
|
|
5
|
+
|
|
6
|
+
export function regexTests() {
|
|
7
|
+
test("EMAIL regex", () => {
|
|
8
|
+
assert.ok(REGEX.EMAIL.test("example@example.com"));
|
|
9
|
+
assert.ok(!REGEX.EMAIL.test("example@.com"));
|
|
10
|
+
assert.ok(!REGEX.EMAIL.test("example@com"));
|
|
11
|
+
assert.ok(REGEX.EMAIL.test("user.name+tag+sorting@example.com"));
|
|
12
|
+
assert.ok(!REGEX.EMAIL.test("user name@example.com"));
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
test("NAME regex", () => {
|
|
16
|
+
assert.ok(REGEX.NAME.test("John Doe"));
|
|
17
|
+
assert.ok(REGEX.NAME.test("JohnDoe123"));
|
|
18
|
+
assert.ok(!REGEX.NAME.test("John_Doe"));
|
|
19
|
+
assert.ok(!REGEX.NAME.test("John-Doe"));
|
|
20
|
+
assert.ok(!REGEX.NAME.test("JohnDoe!"));
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
test("SLUG regex", () => {
|
|
24
|
+
assert.ok(REGEX.SLUG.test("slug_123"));
|
|
25
|
+
assert.ok(REGEX.SLUG.test("slug.123"));
|
|
26
|
+
assert.ok(!REGEX.SLUG.test("slug-123"));
|
|
27
|
+
assert.ok(!REGEX.SLUG.test("Slug123"));
|
|
28
|
+
assert.ok(!REGEX.SLUG.test("slug#123"));
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
test("PHONE regex", () => {
|
|
32
|
+
assert.ok(REGEX.PHONE.test("+1234567890"));
|
|
33
|
+
assert.ok(REGEX.PHONE.test("+12 345 678 9012"));
|
|
34
|
+
assert.ok(!REGEX.PHONE.test("1234567890"));
|
|
35
|
+
assert.ok(!REGEX.PHONE.test("+1 (234) 567-890"));
|
|
36
|
+
assert.ok(!REGEX.PHONE.test("+12 3456 7890 12 3456"));
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
test("PASSWORD regex", () => {
|
|
40
|
+
assert.ok(REGEX.PASSWORD.test("Password1"));
|
|
41
|
+
assert.ok(REGEX.PASSWORD.test("P@ssword"));
|
|
42
|
+
assert.ok(!REGEX.PASSWORD.test("password1"));
|
|
43
|
+
assert.ok(!REGEX.PASSWORD.test("PASSWORD1"));
|
|
44
|
+
assert.ok(!REGEX.PASSWORD.test("Password"));
|
|
45
|
+
assert.ok(!REGEX.PASSWORD.test("P1"));
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
test("PASSWORD_MIN_LENGTH regex", () => {
|
|
49
|
+
assert.ok(REGEX.PASSWORD_MIN_LENGTH.test("Password1"));
|
|
50
|
+
assert.ok(!REGEX.PASSWORD_MIN_LENGTH.test("Pass1"));
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
test("PASSWORD_UPPERCASE regex", () => {
|
|
54
|
+
assert.ok(REGEX.PASSWORD_UPPERCASE.test("Password"));
|
|
55
|
+
assert.ok(!REGEX.PASSWORD_UPPERCASE.test("password"));
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
test("PASSWORD_LOWERCASE regex", () => {
|
|
59
|
+
assert.ok(REGEX.PASSWORD_LOWERCASE.test("Password"));
|
|
60
|
+
assert.ok(!REGEX.PASSWORD_LOWERCASE.test("PASSWORD"));
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
test("PASSWORD_NUMBER_SPECIAL regex", () => {
|
|
64
|
+
assert.ok(REGEX.PASSWORD_NUMBER_SPECIAL.test("Password1"));
|
|
65
|
+
assert.ok(REGEX.PASSWORD_NUMBER_SPECIAL.test("P@ssword"));
|
|
66
|
+
assert.ok(!REGEX.PASSWORD_NUMBER_SPECIAL.test("Password"));
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
test("IMAGE_URL regex", () => {
|
|
70
|
+
assert.ok(REGEX.IMAGE_URL.test("http://example.com/image.jpg"));
|
|
71
|
+
assert.ok(REGEX.IMAGE_URL.test("https://www.example.com/image.jpeg"));
|
|
72
|
+
assert.ok(!REGEX.IMAGE_URL.test("www.example.com/image.png"));
|
|
73
|
+
assert.ok(!REGEX.IMAGE_URL.test("example.com/image"));
|
|
74
|
+
assert.ok(!REGEX.IMAGE_URL.test("https://example.com/image.txt"));
|
|
75
|
+
});
|
|
76
|
+
}
|
/package/src/rest/dtos/organizations/events/{events → styles}/create-organization-event-style.dto.ts
RENAMED
|
File without changes
|
|
File without changes
|
/package/src/rest/dtos/organizations/events/{events → styles}/update-organization-event-style.dto.ts
RENAMED
|
File without changes
|