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
package/src/constants/api.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const DEFAULT_API_URL = "https://api.tonightpass.com";
|
package/src/constants/index.ts
DELETED
package/src/constants/regex.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
export const REGEX = {
|
|
2
|
-
// matches a valid email address
|
|
3
|
-
EMAIL: /^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,}$/i,
|
|
4
|
-
// matches a name with only letters, numbers, spaces
|
|
5
|
-
NAME: /^[a-zA-Z0-9 ]+$/,
|
|
6
|
-
// matches a slug with only lowercase letters, numbers, dots and underscores
|
|
7
|
-
SLUG: /^[a-z0-9_.]+$/,
|
|
8
|
-
// matches a username with lowercase letters, numbers, underscores, and dots
|
|
9
|
-
// - must be 3 to 48 characters long
|
|
10
|
-
// - cannot have consecutive dots
|
|
11
|
-
// - cannot start or end with a dot
|
|
12
|
-
USERNAME: /^(?!\.)(?!.*\.\.)(?!.*\.$)[a-z0-9_.]{3,48}$/,
|
|
13
|
-
// matches an international phone number
|
|
14
|
-
PHONE: /^\+(?:[0-9] ?){6,14}[0-9]$/,
|
|
15
|
-
// matches a password with at least 8 characters, one uppercase letter, one lowercase letter and one number or special character
|
|
16
|
-
PASSWORD: /^(?=.*[A-Z])(?=.*[a-z])(?=.*[\d\W]).{8,}$/,
|
|
17
|
-
// matches a password with at least 8 characters
|
|
18
|
-
PASSWORD_MIN_LENGTH: /^.{8,}$/,
|
|
19
|
-
// matches a password with one uppercase letter
|
|
20
|
-
PASSWORD_UPPERCASE: /^(?=.*[A-Z])/,
|
|
21
|
-
// matches a password with one lowercase letter
|
|
22
|
-
PASSWORD_LOWERCASE: /^(?=.*[a-z])/,
|
|
23
|
-
// matches a password with one number or special character
|
|
24
|
-
PASSWORD_NUMBER_SPECIAL: /^(?=.*[\d\W])/,
|
|
25
|
-
// matches an image url
|
|
26
|
-
IMAGE_URL:
|
|
27
|
-
/^(https:\/\/|http:\/\/)(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-z]{2,6}([-a-zA-Z0-9@:%_\+.~#?&//=]*)\.(jpg|jpeg|gif|png|bmp|tiff|tga|svg)$/i,
|
|
28
|
-
};
|
package/src/index.ts
DELETED
package/src/rest/client.ts
DELETED
|
@@ -1,198 +0,0 @@
|
|
|
1
|
-
import { pathcat } from "pathcat";
|
|
2
|
-
import { Options, Response as RedaxiosResponse } from "redaxios";
|
|
3
|
-
|
|
4
|
-
import { ParamValue, Query } from "..";
|
|
5
|
-
import { Endpoints } from "./endpoints";
|
|
6
|
-
import { APIRequestOptions, request } from "./request";
|
|
7
|
-
import { DEFAULT_API_URL } from "../constants";
|
|
8
|
-
|
|
9
|
-
export type SuccessfulAPIResponse<T> = {
|
|
10
|
-
success: true;
|
|
11
|
-
data: T;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
export type ErroredAPIResponse = {
|
|
15
|
-
success: false;
|
|
16
|
-
message: string;
|
|
17
|
-
errors?: {
|
|
18
|
-
[key: string]: string;
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export type APIResponse<T> = SuccessfulAPIResponse<T> | ErroredAPIResponse;
|
|
23
|
-
|
|
24
|
-
export type PromisedAPIResponse<T> = Promise<APIResponse<T>>;
|
|
25
|
-
|
|
26
|
-
export type PathsFor<M extends Options["method"]> = Extract<
|
|
27
|
-
Endpoints,
|
|
28
|
-
{ method: M }
|
|
29
|
-
>["path"];
|
|
30
|
-
|
|
31
|
-
export type ResponseFor<
|
|
32
|
-
M extends Options["method"],
|
|
33
|
-
P extends PathsFor<M>,
|
|
34
|
-
> = Extract<Endpoints, { method: M; path: P }>["res"];
|
|
35
|
-
|
|
36
|
-
export type Response<
|
|
37
|
-
M extends Options["method"],
|
|
38
|
-
P extends PathsFor<M>,
|
|
39
|
-
> = APIResponse<Extract<Endpoints, { method: M; path: P }>["res"]>;
|
|
40
|
-
|
|
41
|
-
export type PromisedResponse<
|
|
42
|
-
M extends Options["method"],
|
|
43
|
-
P extends PathsFor<M>,
|
|
44
|
-
> = PromisedAPIResponse<Extract<Endpoints, { method: M; path: P }>["res"]>;
|
|
45
|
-
|
|
46
|
-
export type Body<M extends Options["method"], P extends PathsFor<M>> = Extract<
|
|
47
|
-
Endpoints,
|
|
48
|
-
{ method: M; path: P }
|
|
49
|
-
>["body"];
|
|
50
|
-
|
|
51
|
-
export type StringifiedQueryValue = string | string[];
|
|
52
|
-
|
|
53
|
-
export type StringifiedQuery<T> = {
|
|
54
|
-
[K in keyof T]: StringifiedQueryValue;
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
export type QueryParams<
|
|
58
|
-
M extends Options["method"],
|
|
59
|
-
P extends PathsFor<M>,
|
|
60
|
-
> = StringifiedQuery<Extract<Endpoints, { method: M; path: P }>["body"]>;
|
|
61
|
-
|
|
62
|
-
export class TonightPassAPIError<T> extends Error {
|
|
63
|
-
public readonly status: number;
|
|
64
|
-
|
|
65
|
-
constructor(
|
|
66
|
-
public readonly response: RedaxiosResponse<APIResponse<T>>,
|
|
67
|
-
public readonly data: ErroredAPIResponse,
|
|
68
|
-
) {
|
|
69
|
-
super(data.message);
|
|
70
|
-
|
|
71
|
-
this.status = response.status;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
export interface ClientOptions {
|
|
76
|
-
readonly baseURL: string;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
export class Client {
|
|
80
|
-
private options;
|
|
81
|
-
public readonly url;
|
|
82
|
-
|
|
83
|
-
constructor(options: ClientOptions) {
|
|
84
|
-
this.options = options;
|
|
85
|
-
this.url = (path: string, params: Record<string, ParamValue>) => {
|
|
86
|
-
const baseURL = this.options.baseURL || DEFAULT_API_URL;
|
|
87
|
-
return pathcat(baseURL, path, params);
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
setOptions(options: ClientOptions) {
|
|
92
|
-
this.options = options;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
async get<Path extends PathsFor<"GET">>(
|
|
96
|
-
path: Path,
|
|
97
|
-
query?: Query<Path>,
|
|
98
|
-
options?: APIRequestOptions,
|
|
99
|
-
) {
|
|
100
|
-
return this.requester<ResponseFor<"GET", Path>>(
|
|
101
|
-
"GET",
|
|
102
|
-
path,
|
|
103
|
-
undefined,
|
|
104
|
-
query,
|
|
105
|
-
options,
|
|
106
|
-
);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
async post<Path extends PathsFor<"POST">>(
|
|
110
|
-
path: Path,
|
|
111
|
-
body: Body<"POST", Path>,
|
|
112
|
-
query?: Query<Path>,
|
|
113
|
-
options?: APIRequestOptions,
|
|
114
|
-
) {
|
|
115
|
-
return this.requester<ResponseFor<"POST", Path>>(
|
|
116
|
-
"POST",
|
|
117
|
-
path,
|
|
118
|
-
body,
|
|
119
|
-
query,
|
|
120
|
-
options,
|
|
121
|
-
);
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
async put<Path extends PathsFor<"PUT">>(
|
|
125
|
-
path: Path,
|
|
126
|
-
body: Body<"PUT", Path>,
|
|
127
|
-
query?: Query<Path>,
|
|
128
|
-
options?: APIRequestOptions,
|
|
129
|
-
) {
|
|
130
|
-
return this.requester<ResponseFor<"PUT", Path>>(
|
|
131
|
-
"PUT",
|
|
132
|
-
path,
|
|
133
|
-
body,
|
|
134
|
-
query,
|
|
135
|
-
options,
|
|
136
|
-
);
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
async patch<Path extends PathsFor<"PATCH">>(
|
|
140
|
-
path: Path,
|
|
141
|
-
body: Body<"PATCH", Path>,
|
|
142
|
-
query?: Query<Path>,
|
|
143
|
-
options?: APIRequestOptions,
|
|
144
|
-
) {
|
|
145
|
-
return this.requester<ResponseFor<"PATCH", Path>>(
|
|
146
|
-
"PATCH",
|
|
147
|
-
path,
|
|
148
|
-
body,
|
|
149
|
-
query,
|
|
150
|
-
options,
|
|
151
|
-
);
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
async delete<Path extends PathsFor<"DELETE">>(
|
|
155
|
-
path: Path,
|
|
156
|
-
body: Body<"DELETE", Path>,
|
|
157
|
-
query?: Query<Path>,
|
|
158
|
-
options?: APIRequestOptions,
|
|
159
|
-
) {
|
|
160
|
-
return this.requester<ResponseFor<"DELETE", Path>>(
|
|
161
|
-
"DELETE",
|
|
162
|
-
path,
|
|
163
|
-
body,
|
|
164
|
-
query,
|
|
165
|
-
options,
|
|
166
|
-
);
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
private async requester<T>(
|
|
170
|
-
method: Options["method"],
|
|
171
|
-
path: string,
|
|
172
|
-
body: unknown,
|
|
173
|
-
query: Query<string> = {},
|
|
174
|
-
options: APIRequestOptions = {},
|
|
175
|
-
) {
|
|
176
|
-
const url = this.url(path, query);
|
|
177
|
-
|
|
178
|
-
if (body !== undefined) {
|
|
179
|
-
if (method === "GET") {
|
|
180
|
-
throw new Error("Cannot send a GET request with a body");
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
const response: RedaxiosResponse<APIResponse<T>> = await request<T>(url, {
|
|
185
|
-
method,
|
|
186
|
-
data: body,
|
|
187
|
-
...options,
|
|
188
|
-
});
|
|
189
|
-
|
|
190
|
-
const result = response.data;
|
|
191
|
-
|
|
192
|
-
if (!result.success) {
|
|
193
|
-
throw new TonightPassAPIError<T>(response, result);
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
return result.data;
|
|
197
|
-
}
|
|
198
|
-
}
|
package/src/rest/dtos/index.ts
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { Type } from "class-transformer";
|
|
2
|
-
import {
|
|
3
|
-
IsArray,
|
|
4
|
-
IsNotEmpty,
|
|
5
|
-
IsNumber,
|
|
6
|
-
IsOptional,
|
|
7
|
-
IsString,
|
|
8
|
-
Length,
|
|
9
|
-
ValidateNested,
|
|
10
|
-
} from "class-validator";
|
|
11
|
-
|
|
12
|
-
import { GeoPoint, Location } from "../../types";
|
|
13
|
-
|
|
14
|
-
export class GeoPointDto implements GeoPoint {
|
|
15
|
-
@IsString()
|
|
16
|
-
@IsNotEmpty()
|
|
17
|
-
type: "Point";
|
|
18
|
-
|
|
19
|
-
@IsArray()
|
|
20
|
-
@IsNotEmpty()
|
|
21
|
-
@Length(2, 2)
|
|
22
|
-
@IsNumber({}, { each: true })
|
|
23
|
-
coordinates: [number, number];
|
|
24
|
-
|
|
25
|
-
constructor() {
|
|
26
|
-
this.type = "Point";
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
@ValidateNested()
|
|
30
|
-
public validate(): boolean {
|
|
31
|
-
const [longitude, latitude] = this.coordinates;
|
|
32
|
-
return (
|
|
33
|
-
latitude >= -90 && latitude <= 90 && longitude >= -180 && longitude <= 180
|
|
34
|
-
);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export class CreateLocationDto implements Location {
|
|
39
|
-
@IsOptional()
|
|
40
|
-
@IsString()
|
|
41
|
-
@Length(1, 128)
|
|
42
|
-
name?: string;
|
|
43
|
-
|
|
44
|
-
@IsString()
|
|
45
|
-
@IsNotEmpty()
|
|
46
|
-
@Length(1, 256)
|
|
47
|
-
address: string;
|
|
48
|
-
|
|
49
|
-
@IsString()
|
|
50
|
-
@IsNotEmpty()
|
|
51
|
-
@Length(1, 32)
|
|
52
|
-
zipCode: string;
|
|
53
|
-
|
|
54
|
-
@IsString()
|
|
55
|
-
@IsNotEmpty()
|
|
56
|
-
@Length(1, 128)
|
|
57
|
-
city: string;
|
|
58
|
-
|
|
59
|
-
@IsString()
|
|
60
|
-
@IsNotEmpty()
|
|
61
|
-
@Length(1, 128)
|
|
62
|
-
country: string;
|
|
63
|
-
|
|
64
|
-
@ValidateNested()
|
|
65
|
-
@Type(() => GeoPointDto)
|
|
66
|
-
@IsNotEmpty()
|
|
67
|
-
geometry: GeoPointDto;
|
|
68
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { Type } from "class-transformer";
|
|
2
|
-
import { IsOptional, IsString, Length, ValidateNested } from "class-validator";
|
|
3
|
-
|
|
4
|
-
import { GeoPointDto } from "./create-location.dto";
|
|
5
|
-
import { Location } from "../../types";
|
|
6
|
-
|
|
7
|
-
export class UpdateLocationDto implements Partial<Location> {
|
|
8
|
-
@IsOptional()
|
|
9
|
-
@IsString()
|
|
10
|
-
@Length(1, 128)
|
|
11
|
-
name?: string;
|
|
12
|
-
|
|
13
|
-
@IsOptional()
|
|
14
|
-
@IsString()
|
|
15
|
-
@Length(1, 256)
|
|
16
|
-
address?: string;
|
|
17
|
-
|
|
18
|
-
@IsOptional()
|
|
19
|
-
@IsString()
|
|
20
|
-
@Length(1, 32)
|
|
21
|
-
zipCode?: string;
|
|
22
|
-
|
|
23
|
-
@IsOptional()
|
|
24
|
-
@IsString()
|
|
25
|
-
@Length(1, 128)
|
|
26
|
-
city?: string;
|
|
27
|
-
|
|
28
|
-
@IsOptional()
|
|
29
|
-
@IsString()
|
|
30
|
-
@Length(1, 128)
|
|
31
|
-
country?: string;
|
|
32
|
-
|
|
33
|
-
@IsOptional()
|
|
34
|
-
@ValidateNested()
|
|
35
|
-
@Type(() => GeoPointDto)
|
|
36
|
-
geometry?: GeoPointDto;
|
|
37
|
-
}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
IsArray,
|
|
3
|
-
IsLowercase,
|
|
4
|
-
IsNotEmpty,
|
|
5
|
-
IsObject,
|
|
6
|
-
IsOptional,
|
|
7
|
-
IsString,
|
|
8
|
-
IsUrl,
|
|
9
|
-
Length,
|
|
10
|
-
} from "class-validator";
|
|
11
|
-
|
|
12
|
-
import { CreateOrganizationMemberDto } from "./members/create-organization-member.dto";
|
|
13
|
-
import { type Location, type OrganizationSocialLink } from "../../types";
|
|
14
|
-
|
|
15
|
-
export class CreateOrganizationDto {
|
|
16
|
-
@IsOptional()
|
|
17
|
-
@IsString()
|
|
18
|
-
@IsLowercase()
|
|
19
|
-
@Length(1, 48)
|
|
20
|
-
organizationSlug?: string;
|
|
21
|
-
|
|
22
|
-
@IsObject()
|
|
23
|
-
identity: CreateOrganizationIdentityDto;
|
|
24
|
-
|
|
25
|
-
@IsArray()
|
|
26
|
-
members: CreateOrganizationMemberDto[];
|
|
27
|
-
|
|
28
|
-
@IsOptional()
|
|
29
|
-
@IsObject()
|
|
30
|
-
location?: Location;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export class CreateOrganizationIdentityDto {
|
|
34
|
-
@IsString()
|
|
35
|
-
@IsNotEmpty()
|
|
36
|
-
@Length(1, 32)
|
|
37
|
-
displayName: string;
|
|
38
|
-
|
|
39
|
-
@IsString()
|
|
40
|
-
@Length(16, 1024)
|
|
41
|
-
@IsOptional()
|
|
42
|
-
description?: string;
|
|
43
|
-
|
|
44
|
-
@IsUrl({
|
|
45
|
-
protocols: ["http", "https"],
|
|
46
|
-
host_whitelist: ["cdn.tonightpass.com", "cdn.staging.tonightpass.com"],
|
|
47
|
-
})
|
|
48
|
-
avatarUrl?: string;
|
|
49
|
-
|
|
50
|
-
@IsOptional()
|
|
51
|
-
@IsUrl({
|
|
52
|
-
protocols: ["http", "https"],
|
|
53
|
-
host_whitelist: ["cdn.tonightpass.com", "cdn.staging.tonightpass.com"],
|
|
54
|
-
})
|
|
55
|
-
bannerUrl?: string;
|
|
56
|
-
|
|
57
|
-
@IsOptional()
|
|
58
|
-
@IsArray()
|
|
59
|
-
socialLinks?: OrganizationSocialLink[];
|
|
60
|
-
}
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import { Type } from "class-transformer";
|
|
2
|
-
import {
|
|
3
|
-
IsArray,
|
|
4
|
-
IsDateString,
|
|
5
|
-
IsEnum,
|
|
6
|
-
IsLowercase,
|
|
7
|
-
IsNotEmpty,
|
|
8
|
-
IsObject,
|
|
9
|
-
IsOptional,
|
|
10
|
-
IsString,
|
|
11
|
-
IsUrl,
|
|
12
|
-
Length,
|
|
13
|
-
Matches,
|
|
14
|
-
ValidateNested,
|
|
15
|
-
} from "class-validator";
|
|
16
|
-
|
|
17
|
-
import {
|
|
18
|
-
CreateOrganizationEventTicketDto,
|
|
19
|
-
CreateOrganizationEventTicketInput,
|
|
20
|
-
} from "./tickets";
|
|
21
|
-
import { REGEX } from "../../../../constants";
|
|
22
|
-
import {
|
|
23
|
-
OrganizationEventType,
|
|
24
|
-
OrganizationEventVisibilityType,
|
|
25
|
-
OrganizationEvent,
|
|
26
|
-
ExcludeBase,
|
|
27
|
-
} from "../../../types";
|
|
28
|
-
import { CreateLocationDto } from "../../locations/create-location.dto";
|
|
29
|
-
|
|
30
|
-
export type CreateOrganizationEventInput = Omit<
|
|
31
|
-
ExcludeBase<OrganizationEvent>,
|
|
32
|
-
"slug" | "styles" | "tickets" | "organization" | "viewsCount"
|
|
33
|
-
> & {
|
|
34
|
-
slug?: string;
|
|
35
|
-
styles: string[];
|
|
36
|
-
tickets: CreateOrganizationEventTicketInput[];
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
export class CreateOrganizationEventDto
|
|
40
|
-
implements CreateOrganizationEventInput
|
|
41
|
-
{
|
|
42
|
-
@IsString()
|
|
43
|
-
@IsNotEmpty()
|
|
44
|
-
@Length(1, 64)
|
|
45
|
-
title: string;
|
|
46
|
-
|
|
47
|
-
@IsOptional()
|
|
48
|
-
@IsString()
|
|
49
|
-
@IsLowercase()
|
|
50
|
-
@Length(3, 48)
|
|
51
|
-
@Matches(REGEX.SLUG)
|
|
52
|
-
slug?: string;
|
|
53
|
-
|
|
54
|
-
@IsString()
|
|
55
|
-
@IsNotEmpty()
|
|
56
|
-
@Length(16, 2048)
|
|
57
|
-
description: string;
|
|
58
|
-
|
|
59
|
-
@IsEnum(OrganizationEventType)
|
|
60
|
-
@IsNotEmpty()
|
|
61
|
-
type: OrganizationEventType;
|
|
62
|
-
|
|
63
|
-
@IsEnum(OrganizationEventVisibilityType)
|
|
64
|
-
@IsNotEmpty()
|
|
65
|
-
visibility: OrganizationEventVisibilityType;
|
|
66
|
-
|
|
67
|
-
@IsArray()
|
|
68
|
-
@IsUrl({}, { each: true })
|
|
69
|
-
flyers: string[];
|
|
70
|
-
|
|
71
|
-
@IsArray()
|
|
72
|
-
@IsUrl({}, { each: true })
|
|
73
|
-
trailers: string[];
|
|
74
|
-
|
|
75
|
-
@IsObject()
|
|
76
|
-
@ValidateNested()
|
|
77
|
-
@Type(() => CreateLocationDto)
|
|
78
|
-
@IsNotEmpty()
|
|
79
|
-
location: CreateLocationDto;
|
|
80
|
-
|
|
81
|
-
@IsArray()
|
|
82
|
-
@ValidateNested({ each: true })
|
|
83
|
-
@Type(() => CreateOrganizationEventTicketDto)
|
|
84
|
-
@IsNotEmpty()
|
|
85
|
-
tickets: CreateOrganizationEventTicketDto[];
|
|
86
|
-
|
|
87
|
-
@IsArray()
|
|
88
|
-
@IsString({ each: true })
|
|
89
|
-
@IsNotEmpty()
|
|
90
|
-
styles: string[]; // Array of style IDs
|
|
91
|
-
|
|
92
|
-
@IsDateString()
|
|
93
|
-
@IsNotEmpty()
|
|
94
|
-
startAt: Date;
|
|
95
|
-
|
|
96
|
-
@IsDateString()
|
|
97
|
-
@IsNotEmpty()
|
|
98
|
-
endAt: Date;
|
|
99
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./create-organization-event-order.dto";
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
IsBoolean,
|
|
3
|
-
IsDateString,
|
|
4
|
-
IsEnum,
|
|
5
|
-
IsNumber,
|
|
6
|
-
IsOptional,
|
|
7
|
-
IsString,
|
|
8
|
-
Length,
|
|
9
|
-
Min,
|
|
10
|
-
} from "class-validator";
|
|
11
|
-
|
|
12
|
-
import {
|
|
13
|
-
Currency,
|
|
14
|
-
OrganizationEventTicketCategory,
|
|
15
|
-
OrganizationEventTicketType,
|
|
16
|
-
OrganizationEventTicket,
|
|
17
|
-
ExcludeBase,
|
|
18
|
-
} from "../../../../types";
|
|
19
|
-
|
|
20
|
-
export type CreateOrganizationEventTicketInput = Omit<
|
|
21
|
-
ExcludeBase<OrganizationEventTicket>,
|
|
22
|
-
"price" | "product" | "event" | "fee"
|
|
23
|
-
> & {
|
|
24
|
-
price: number;
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
export class CreateOrganizationEventTicketDto
|
|
28
|
-
implements CreateOrganizationEventTicketInput
|
|
29
|
-
{
|
|
30
|
-
@IsString()
|
|
31
|
-
@Length(1, 128)
|
|
32
|
-
name: string;
|
|
33
|
-
|
|
34
|
-
@IsString()
|
|
35
|
-
@Length(1, 1024)
|
|
36
|
-
description?: string;
|
|
37
|
-
|
|
38
|
-
@IsNumber()
|
|
39
|
-
@Min(0)
|
|
40
|
-
price: number;
|
|
41
|
-
|
|
42
|
-
@IsNumber()
|
|
43
|
-
@Min(0)
|
|
44
|
-
quantity: number;
|
|
45
|
-
|
|
46
|
-
@IsEnum(OrganizationEventTicketType)
|
|
47
|
-
type: OrganizationEventTicketType;
|
|
48
|
-
|
|
49
|
-
@IsEnum(OrganizationEventTicketCategory)
|
|
50
|
-
category: OrganizationEventTicketCategory;
|
|
51
|
-
|
|
52
|
-
@IsEnum(Currency)
|
|
53
|
-
currency: Currency;
|
|
54
|
-
|
|
55
|
-
@IsBoolean()
|
|
56
|
-
isVisible: boolean;
|
|
57
|
-
|
|
58
|
-
@IsBoolean()
|
|
59
|
-
isFeesIncluded: boolean;
|
|
60
|
-
|
|
61
|
-
@IsDateString()
|
|
62
|
-
@IsOptional()
|
|
63
|
-
startAt?: Date;
|
|
64
|
-
|
|
65
|
-
@IsDateString()
|
|
66
|
-
@IsOptional()
|
|
67
|
-
endAt?: Date;
|
|
68
|
-
}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
IsBoolean,
|
|
3
|
-
IsDateString,
|
|
4
|
-
IsEnum,
|
|
5
|
-
IsNumber,
|
|
6
|
-
IsOptional,
|
|
7
|
-
IsString,
|
|
8
|
-
Length,
|
|
9
|
-
Min,
|
|
10
|
-
} from "class-validator";
|
|
11
|
-
|
|
12
|
-
import { CreateOrganizationEventTicketInput } from "./create-organization-event-ticket.dto";
|
|
13
|
-
import {
|
|
14
|
-
Currency,
|
|
15
|
-
DeepPartial,
|
|
16
|
-
OrganizationEventTicketCategory,
|
|
17
|
-
OrganizationEventTicketType,
|
|
18
|
-
} from "../../../../types";
|
|
19
|
-
|
|
20
|
-
export class UpdateOrganizationEventTicketDto
|
|
21
|
-
implements DeepPartial<CreateOrganizationEventTicketInput>
|
|
22
|
-
{
|
|
23
|
-
@IsString()
|
|
24
|
-
@Length(1, 128)
|
|
25
|
-
@IsOptional()
|
|
26
|
-
name?: string;
|
|
27
|
-
|
|
28
|
-
@IsString()
|
|
29
|
-
@Length(1, 1024)
|
|
30
|
-
@IsOptional()
|
|
31
|
-
description?: string;
|
|
32
|
-
|
|
33
|
-
@IsNumber()
|
|
34
|
-
@Min(0)
|
|
35
|
-
@IsOptional()
|
|
36
|
-
price?: number;
|
|
37
|
-
|
|
38
|
-
@IsNumber()
|
|
39
|
-
@Min(0)
|
|
40
|
-
@IsOptional()
|
|
41
|
-
quantity?: number;
|
|
42
|
-
|
|
43
|
-
@IsEnum(OrganizationEventTicketType)
|
|
44
|
-
@IsOptional()
|
|
45
|
-
type?: OrganizationEventTicketType;
|
|
46
|
-
|
|
47
|
-
@IsEnum(OrganizationEventTicketCategory)
|
|
48
|
-
@IsOptional()
|
|
49
|
-
category?: OrganizationEventTicketCategory;
|
|
50
|
-
|
|
51
|
-
@IsEnum(Currency)
|
|
52
|
-
@IsOptional()
|
|
53
|
-
currency?: Currency;
|
|
54
|
-
|
|
55
|
-
@IsBoolean()
|
|
56
|
-
@IsOptional()
|
|
57
|
-
isVisible?: boolean;
|
|
58
|
-
|
|
59
|
-
@IsBoolean()
|
|
60
|
-
@IsOptional()
|
|
61
|
-
isFeesIncluded?: boolean;
|
|
62
|
-
|
|
63
|
-
@IsDateString()
|
|
64
|
-
@IsOptional()
|
|
65
|
-
startAt?: Date;
|
|
66
|
-
|
|
67
|
-
@IsDateString()
|
|
68
|
-
@IsOptional()
|
|
69
|
-
endAt?: Date;
|
|
70
|
-
}
|