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,88 +0,0 @@
|
|
|
1
|
-
import { Type } from "class-transformer";
|
|
2
|
-
import {
|
|
3
|
-
IsArray,
|
|
4
|
-
IsDateString,
|
|
5
|
-
IsEnum,
|
|
6
|
-
IsLowercase,
|
|
7
|
-
IsObject,
|
|
8
|
-
IsOptional,
|
|
9
|
-
IsString,
|
|
10
|
-
IsUrl,
|
|
11
|
-
Length,
|
|
12
|
-
Matches,
|
|
13
|
-
ValidateNested,
|
|
14
|
-
} from "class-validator";
|
|
15
|
-
|
|
16
|
-
import { CreateOrganizationEventInput } from "./create-organization-event.dto";
|
|
17
|
-
import { UpdateOrganizationEventTicketDto } from "./tickets";
|
|
18
|
-
import { REGEX } from "../../../../constants";
|
|
19
|
-
import {
|
|
20
|
-
DeepPartial,
|
|
21
|
-
OrganizationEventType,
|
|
22
|
-
OrganizationEventVisibilityType,
|
|
23
|
-
} from "../../../types";
|
|
24
|
-
import { UpdateLocationDto } from "../../locations/update-location.dto";
|
|
25
|
-
|
|
26
|
-
export class UpdateOrganizationEventDto
|
|
27
|
-
implements DeepPartial<CreateOrganizationEventInput>
|
|
28
|
-
{
|
|
29
|
-
@IsOptional()
|
|
30
|
-
@IsString()
|
|
31
|
-
@Length(1, 64)
|
|
32
|
-
title?: string;
|
|
33
|
-
|
|
34
|
-
@IsOptional()
|
|
35
|
-
@IsString()
|
|
36
|
-
@IsLowercase()
|
|
37
|
-
@Length(3, 48)
|
|
38
|
-
@Matches(REGEX.SLUG)
|
|
39
|
-
slug?: string;
|
|
40
|
-
|
|
41
|
-
@IsOptional()
|
|
42
|
-
@IsString()
|
|
43
|
-
@Length(16, 2048)
|
|
44
|
-
description?: string;
|
|
45
|
-
|
|
46
|
-
@IsOptional()
|
|
47
|
-
@IsEnum(OrganizationEventType)
|
|
48
|
-
type?: OrganizationEventType;
|
|
49
|
-
|
|
50
|
-
@IsOptional()
|
|
51
|
-
@IsEnum(OrganizationEventVisibilityType)
|
|
52
|
-
visibility?: OrganizationEventVisibilityType;
|
|
53
|
-
|
|
54
|
-
@IsOptional()
|
|
55
|
-
@IsArray()
|
|
56
|
-
@IsUrl({}, { each: true })
|
|
57
|
-
flyers?: string[];
|
|
58
|
-
|
|
59
|
-
@IsOptional()
|
|
60
|
-
@IsArray()
|
|
61
|
-
@IsUrl({}, { each: true })
|
|
62
|
-
trailers?: string[];
|
|
63
|
-
|
|
64
|
-
@IsOptional()
|
|
65
|
-
@IsObject()
|
|
66
|
-
@ValidateNested()
|
|
67
|
-
@Type(() => UpdateLocationDto)
|
|
68
|
-
location?: UpdateLocationDto;
|
|
69
|
-
|
|
70
|
-
@IsOptional()
|
|
71
|
-
@IsArray()
|
|
72
|
-
@ValidateNested({ each: true })
|
|
73
|
-
@Type(() => UpdateOrganizationEventTicketDto)
|
|
74
|
-
tickets?: UpdateOrganizationEventTicketDto[];
|
|
75
|
-
|
|
76
|
-
@IsOptional()
|
|
77
|
-
@IsArray()
|
|
78
|
-
@IsString({ each: true })
|
|
79
|
-
styles?: string[];
|
|
80
|
-
|
|
81
|
-
@IsOptional()
|
|
82
|
-
@IsDateString()
|
|
83
|
-
startAt?: Date;
|
|
84
|
-
|
|
85
|
-
@IsOptional()
|
|
86
|
-
@IsDateString()
|
|
87
|
-
endAt?: Date;
|
|
88
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { IsEnum, IsNotEmpty, IsString } from "class-validator";
|
|
2
|
-
|
|
3
|
-
import { OrganizationMemberRole } from "../../../types";
|
|
4
|
-
|
|
5
|
-
export class CreateOrganizationMemberDto {
|
|
6
|
-
@IsString()
|
|
7
|
-
@IsNotEmpty()
|
|
8
|
-
user: string;
|
|
9
|
-
|
|
10
|
-
@IsEnum(OrganizationMemberRole)
|
|
11
|
-
@IsNotEmpty()
|
|
12
|
-
role: OrganizationMemberRole;
|
|
13
|
-
}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
IsArray,
|
|
3
|
-
IsLowercase,
|
|
4
|
-
IsNotEmpty,
|
|
5
|
-
IsObject,
|
|
6
|
-
IsOptional,
|
|
7
|
-
IsString,
|
|
8
|
-
IsUrl,
|
|
9
|
-
Length,
|
|
10
|
-
Matches,
|
|
11
|
-
} from "class-validator";
|
|
12
|
-
|
|
13
|
-
import { UpdateOrganizationEventDto } from "./events";
|
|
14
|
-
import { REGEX } from "../../../constants";
|
|
15
|
-
import { OrganizationSocialLink } from "../../types";
|
|
16
|
-
|
|
17
|
-
export class UpdateOrganizationDto {
|
|
18
|
-
@IsOptional()
|
|
19
|
-
@IsString()
|
|
20
|
-
@IsLowercase()
|
|
21
|
-
@Length(3, 48)
|
|
22
|
-
@Matches(REGEX.USERNAME)
|
|
23
|
-
slug?: string;
|
|
24
|
-
|
|
25
|
-
@IsObject()
|
|
26
|
-
@IsOptional()
|
|
27
|
-
identity?: UpdateOrganizationIdentityDto;
|
|
28
|
-
|
|
29
|
-
@IsOptional()
|
|
30
|
-
@IsArray()
|
|
31
|
-
members?: UpdateOrganizationEventDto[];
|
|
32
|
-
|
|
33
|
-
@IsOptional()
|
|
34
|
-
@IsObject()
|
|
35
|
-
location?: Location;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export class UpdateOrganizationIdentityDto {
|
|
39
|
-
@IsString()
|
|
40
|
-
@IsNotEmpty()
|
|
41
|
-
@Length(1, 32)
|
|
42
|
-
@IsOptional()
|
|
43
|
-
displayName?: string;
|
|
44
|
-
|
|
45
|
-
@IsString()
|
|
46
|
-
@Length(16, 1024)
|
|
47
|
-
@IsOptional()
|
|
48
|
-
description?: string;
|
|
49
|
-
|
|
50
|
-
@IsUrl({
|
|
51
|
-
protocols: ["http", "https"],
|
|
52
|
-
})
|
|
53
|
-
@IsOptional()
|
|
54
|
-
avatarUrl?: string;
|
|
55
|
-
|
|
56
|
-
@IsOptional()
|
|
57
|
-
@IsUrl({
|
|
58
|
-
protocols: ["http", "https"],
|
|
59
|
-
})
|
|
60
|
-
bannerUrl?: string;
|
|
61
|
-
|
|
62
|
-
@IsOptional()
|
|
63
|
-
@IsArray()
|
|
64
|
-
socialLinks?: OrganizationSocialLink[];
|
|
65
|
-
}
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import { Type } from "class-transformer";
|
|
2
|
-
import {
|
|
3
|
-
IsDateString,
|
|
4
|
-
IsEmail,
|
|
5
|
-
IsEnum,
|
|
6
|
-
IsLowercase,
|
|
7
|
-
IsOptional,
|
|
8
|
-
IsPhoneNumber,
|
|
9
|
-
IsString,
|
|
10
|
-
IsUrl,
|
|
11
|
-
Length,
|
|
12
|
-
Matches,
|
|
13
|
-
ValidateNested,
|
|
14
|
-
} from "class-validator";
|
|
15
|
-
|
|
16
|
-
import { REGEX } from "../../../constants";
|
|
17
|
-
import { UserIdentifier, UserIdentityGender } from "../../types";
|
|
18
|
-
|
|
19
|
-
export class CreateUserDto {
|
|
20
|
-
@ValidateNested()
|
|
21
|
-
@Type(() => CreateUserIdentifierDto)
|
|
22
|
-
identifier: CreateUserIdentifierDto;
|
|
23
|
-
|
|
24
|
-
@ValidateNested()
|
|
25
|
-
@Type(() => CreateUserIdentityDto)
|
|
26
|
-
identity: CreateUserIdentityDto;
|
|
27
|
-
|
|
28
|
-
@IsString()
|
|
29
|
-
@Matches(REGEX.PASSWORD, {
|
|
30
|
-
message: "Password must be secure.",
|
|
31
|
-
})
|
|
32
|
-
password: string;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
class CreateUserIdentifierDto
|
|
36
|
-
implements
|
|
37
|
-
Partial<Pick<UserIdentifier, "email" | "phoneNumber" | "username">>
|
|
38
|
-
{
|
|
39
|
-
@IsOptional()
|
|
40
|
-
@IsString()
|
|
41
|
-
@IsEmail()
|
|
42
|
-
email?: string;
|
|
43
|
-
|
|
44
|
-
@IsOptional()
|
|
45
|
-
@IsString()
|
|
46
|
-
@IsPhoneNumber()
|
|
47
|
-
phoneNumber?: string;
|
|
48
|
-
|
|
49
|
-
@IsString()
|
|
50
|
-
@IsString()
|
|
51
|
-
@IsLowercase()
|
|
52
|
-
@Length(3, 48)
|
|
53
|
-
@Matches(REGEX.USERNAME)
|
|
54
|
-
username: string;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export class CreateUserIdentityDto {
|
|
58
|
-
@IsOptional()
|
|
59
|
-
@IsString()
|
|
60
|
-
@Length(2, 32)
|
|
61
|
-
@Matches(REGEX.NAME, {
|
|
62
|
-
message: "First name must be composed of letters only",
|
|
63
|
-
})
|
|
64
|
-
firstName: string;
|
|
65
|
-
|
|
66
|
-
@IsOptional()
|
|
67
|
-
@IsString()
|
|
68
|
-
@Length(2, 32)
|
|
69
|
-
@Matches(REGEX.NAME, {
|
|
70
|
-
message: "Last name must be composed of letters only",
|
|
71
|
-
})
|
|
72
|
-
lastName: string;
|
|
73
|
-
|
|
74
|
-
@IsEnum(UserIdentityGender)
|
|
75
|
-
gender: UserIdentityGender;
|
|
76
|
-
|
|
77
|
-
@IsOptional()
|
|
78
|
-
@IsUrl({
|
|
79
|
-
protocols: ["http", "https"],
|
|
80
|
-
})
|
|
81
|
-
avatarUrl?: string;
|
|
82
|
-
|
|
83
|
-
@IsOptional()
|
|
84
|
-
@IsDateString()
|
|
85
|
-
birthDate: Date;
|
|
86
|
-
}
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import { Type } from "class-transformer";
|
|
2
|
-
import {
|
|
3
|
-
IsDateString,
|
|
4
|
-
IsEmail,
|
|
5
|
-
IsEnum,
|
|
6
|
-
IsLowercase,
|
|
7
|
-
IsObject,
|
|
8
|
-
IsOptional,
|
|
9
|
-
IsPhoneNumber,
|
|
10
|
-
IsString,
|
|
11
|
-
IsUrl,
|
|
12
|
-
Length,
|
|
13
|
-
Matches,
|
|
14
|
-
MaxLength,
|
|
15
|
-
MinLength,
|
|
16
|
-
ValidateNested,
|
|
17
|
-
} from "class-validator";
|
|
18
|
-
|
|
19
|
-
import { REGEX } from "../../../constants/regex";
|
|
20
|
-
import { UserIdentifier, UserIdentity, UserIdentityGender } from "../../types";
|
|
21
|
-
|
|
22
|
-
export class UpdateUserDto {
|
|
23
|
-
@IsOptional()
|
|
24
|
-
@IsObject()
|
|
25
|
-
@ValidateNested()
|
|
26
|
-
@Type(() => UpdateUserIdentifierDto)
|
|
27
|
-
identifier?: UpdateUserIdentifierDto;
|
|
28
|
-
|
|
29
|
-
@IsOptional()
|
|
30
|
-
@IsObject()
|
|
31
|
-
@ValidateNested()
|
|
32
|
-
@Type(() => UpdateUserIdentityDto)
|
|
33
|
-
identity?: UpdateUserIdentityDto;
|
|
34
|
-
|
|
35
|
-
@IsOptional()
|
|
36
|
-
@IsString()
|
|
37
|
-
@MinLength(8)
|
|
38
|
-
@MaxLength(128)
|
|
39
|
-
password?: string;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
class UpdateUserIdentifierDto
|
|
43
|
-
implements
|
|
44
|
-
Partial<Pick<UserIdentifier, "email" | "phoneNumber" | "username">>
|
|
45
|
-
{
|
|
46
|
-
@IsOptional()
|
|
47
|
-
@IsString()
|
|
48
|
-
@IsEmail()
|
|
49
|
-
email?: string;
|
|
50
|
-
|
|
51
|
-
@IsOptional()
|
|
52
|
-
@IsString()
|
|
53
|
-
@IsPhoneNumber()
|
|
54
|
-
phoneNumber?: string;
|
|
55
|
-
|
|
56
|
-
@IsOptional()
|
|
57
|
-
@IsString()
|
|
58
|
-
@IsLowercase()
|
|
59
|
-
@Length(3, 48)
|
|
60
|
-
@Matches(REGEX.USERNAME)
|
|
61
|
-
username?: string;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
class UpdateUserIdentityDto
|
|
65
|
-
implements
|
|
66
|
-
Partial<
|
|
67
|
-
Pick<
|
|
68
|
-
UserIdentity,
|
|
69
|
-
| "firstName"
|
|
70
|
-
| "lastName"
|
|
71
|
-
| "displayName"
|
|
72
|
-
| "description"
|
|
73
|
-
| "avatarUrl"
|
|
74
|
-
| "bannerUrl"
|
|
75
|
-
| "gender"
|
|
76
|
-
| "birthDate"
|
|
77
|
-
>
|
|
78
|
-
>
|
|
79
|
-
{
|
|
80
|
-
@IsOptional()
|
|
81
|
-
@IsString()
|
|
82
|
-
@Length(2, 32)
|
|
83
|
-
@Matches(REGEX.NAME, {
|
|
84
|
-
message: "First name must be composed of letters only",
|
|
85
|
-
})
|
|
86
|
-
firstName?: string;
|
|
87
|
-
|
|
88
|
-
@IsOptional()
|
|
89
|
-
@IsString()
|
|
90
|
-
@Length(2, 32)
|
|
91
|
-
@Matches(REGEX.NAME, {
|
|
92
|
-
message: "Last name must be composed of letters only",
|
|
93
|
-
})
|
|
94
|
-
lastName?: string;
|
|
95
|
-
|
|
96
|
-
@IsOptional()
|
|
97
|
-
@IsString()
|
|
98
|
-
@Length(1, 32)
|
|
99
|
-
displayName?: string;
|
|
100
|
-
|
|
101
|
-
@IsOptional()
|
|
102
|
-
@IsString()
|
|
103
|
-
@Length(1, 128)
|
|
104
|
-
description?: string;
|
|
105
|
-
|
|
106
|
-
@IsOptional()
|
|
107
|
-
@IsUrl()
|
|
108
|
-
avatarUrl?: string | undefined;
|
|
109
|
-
|
|
110
|
-
@IsOptional()
|
|
111
|
-
@IsUrl()
|
|
112
|
-
bannerUrl?: string | undefined;
|
|
113
|
-
|
|
114
|
-
@IsOptional()
|
|
115
|
-
@IsEnum(UserIdentityGender)
|
|
116
|
-
gender?: UserIdentityGender;
|
|
117
|
-
|
|
118
|
-
@IsOptional()
|
|
119
|
-
@IsDateString()
|
|
120
|
-
birthDate?: Date;
|
|
121
|
-
}
|
package/src/rest/endpoints.ts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { Options } from "redaxios";
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
AuthEndpoints,
|
|
5
|
-
CareerEndpoints,
|
|
6
|
-
HealthEndpoints,
|
|
7
|
-
NotificationEndpoints,
|
|
8
|
-
OrderEndpoints,
|
|
9
|
-
OrganizationEndpoints,
|
|
10
|
-
ProfileEndpoints,
|
|
11
|
-
UserEndpoints,
|
|
12
|
-
WebhookEndpoints,
|
|
13
|
-
} from "./types";
|
|
14
|
-
|
|
15
|
-
export type Endpoint<
|
|
16
|
-
M extends Options["method"],
|
|
17
|
-
Path extends string,
|
|
18
|
-
Res,
|
|
19
|
-
Body = undefined,
|
|
20
|
-
> = {
|
|
21
|
-
method: M;
|
|
22
|
-
path: Path;
|
|
23
|
-
res: Res;
|
|
24
|
-
body: Body;
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
export type Endpoints =
|
|
28
|
-
| AuthEndpoints
|
|
29
|
-
| CareerEndpoints
|
|
30
|
-
| HealthEndpoints
|
|
31
|
-
| OrderEndpoints
|
|
32
|
-
| OrganizationEndpoints
|
|
33
|
-
| ProfileEndpoints
|
|
34
|
-
| UserEndpoints
|
|
35
|
-
| WebhookEndpoints
|
|
36
|
-
| NotificationEndpoints;
|
package/src/rest/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./request";
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import axios, { Options, Response } from "redaxios";
|
|
2
|
-
|
|
3
|
-
import { isBrowser } from "../../utils";
|
|
4
|
-
import { APIResponse, ErroredAPIResponse } from "../client";
|
|
5
|
-
|
|
6
|
-
const instance = axios.create({
|
|
7
|
-
headers: {
|
|
8
|
-
"Content-Type": "application/json",
|
|
9
|
-
Accept: "application/json",
|
|
10
|
-
...(!isBrowser && { "User-Agent": "tonightpass-api-client" }),
|
|
11
|
-
},
|
|
12
|
-
responseType: "json",
|
|
13
|
-
transformRequest: [
|
|
14
|
-
function (data, headers) {
|
|
15
|
-
if (data instanceof FormData) {
|
|
16
|
-
if (
|
|
17
|
-
headers &&
|
|
18
|
-
typeof headers === "object" &&
|
|
19
|
-
"Content-Type" in headers
|
|
20
|
-
) {
|
|
21
|
-
delete headers["Content-Type"];
|
|
22
|
-
}
|
|
23
|
-
return data;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
if (headers) {
|
|
27
|
-
(
|
|
28
|
-
headers as {
|
|
29
|
-
[name: string]: string;
|
|
30
|
-
}
|
|
31
|
-
)["Content-Type"] = "application/json";
|
|
32
|
-
}
|
|
33
|
-
return JSON.stringify(data);
|
|
34
|
-
},
|
|
35
|
-
],
|
|
36
|
-
withCredentials: isBrowser,
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
export interface APIRequestOptions extends Options {}
|
|
40
|
-
|
|
41
|
-
export const request = async <T>(url: string, options?: Options) => {
|
|
42
|
-
const response = instance<APIResponse<T>>(url, { ...options })
|
|
43
|
-
.then((response) => response)
|
|
44
|
-
.catch((error: Response<ErroredAPIResponse>) => {
|
|
45
|
-
if (!error.data) {
|
|
46
|
-
console.error(error);
|
|
47
|
-
}
|
|
48
|
-
throw error.data;
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
return response;
|
|
52
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { CreateUserDto, SignInUserDto } from "../../dtos";
|
|
2
|
-
import { Endpoint } from "../../endpoints";
|
|
3
|
-
import { User } from "../users";
|
|
4
|
-
|
|
5
|
-
export type AuthEndpoints =
|
|
6
|
-
| Endpoint<"POST", "/auth/sign-up", User, CreateUserDto>
|
|
7
|
-
| Endpoint<"POST", "/auth/sign-in", User, SignInUserDto>
|
|
8
|
-
| Endpoint<"POST", "/auth/sign-out", null, null>
|
|
9
|
-
| Endpoint<"POST", "/auth/refresh-token", null, null>
|
|
10
|
-
| Endpoint<"GET", "/oauth2/google", void>
|
|
11
|
-
| Endpoint<"GET", "/oauth2/google/callback", void>
|
|
12
|
-
| Endpoint<"GET", "/oauth2/facebook", void>
|
|
13
|
-
| Endpoint<"GET", "/oauth2/facebook/callback", void>
|
|
14
|
-
| Endpoint<"GET", "/oauth2/twitter", void>
|
|
15
|
-
| Endpoint<"GET", "/oauth2/twitter/callback", void>;
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import { Endpoint } from "../../endpoints";
|
|
2
|
-
|
|
3
|
-
export type CareersOffice = {
|
|
4
|
-
id: number | null;
|
|
5
|
-
isDefault: boolean | null;
|
|
6
|
-
name: string | null;
|
|
7
|
-
city: string | null;
|
|
8
|
-
countryIso: string | null;
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export type CareersJob = {
|
|
12
|
-
id: number;
|
|
13
|
-
createdAt: string;
|
|
14
|
-
lastUpdatedAt: string;
|
|
15
|
-
externalId: null | string;
|
|
16
|
-
title: string;
|
|
17
|
-
status: "ALL" | "ONLINE" | "ARCHIVED";
|
|
18
|
-
remote: boolean;
|
|
19
|
-
office: CareersOffice;
|
|
20
|
-
workplaceType: "ONSITE" | "REMOTE" | "HYBRID";
|
|
21
|
-
remoteType?: "ANYWHERE" | "COUNTRY";
|
|
22
|
-
description?: string;
|
|
23
|
-
categoryId?: number;
|
|
24
|
-
employmentTypeId?: number;
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
export type CareersCategory = {
|
|
28
|
-
slug: string;
|
|
29
|
-
name: string;
|
|
30
|
-
subCategories?: (CareersCategory & {
|
|
31
|
-
id: number;
|
|
32
|
-
})[];
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
export type CareersEmploymentType = {
|
|
36
|
-
id: number;
|
|
37
|
-
name: string;
|
|
38
|
-
slug: string;
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
export type CareerEndpoints =
|
|
42
|
-
| Endpoint<
|
|
43
|
-
"GET",
|
|
44
|
-
"/careers/categories",
|
|
45
|
-
CareersCategory[],
|
|
46
|
-
{
|
|
47
|
-
language?: string;
|
|
48
|
-
}
|
|
49
|
-
>
|
|
50
|
-
| Endpoint<
|
|
51
|
-
"GET",
|
|
52
|
-
"/careers/employmentTypes",
|
|
53
|
-
CareersEmploymentType[],
|
|
54
|
-
{
|
|
55
|
-
language?: string;
|
|
56
|
-
}
|
|
57
|
-
>
|
|
58
|
-
| Endpoint<
|
|
59
|
-
"GET",
|
|
60
|
-
"/careers/jobs",
|
|
61
|
-
CareersJob[],
|
|
62
|
-
{
|
|
63
|
-
page?: number;
|
|
64
|
-
pageSize?: number;
|
|
65
|
-
createdAtGte: string;
|
|
66
|
-
createdAtLt?: string;
|
|
67
|
-
updatedAtGte?: string;
|
|
68
|
-
updatedAtLt?: string;
|
|
69
|
-
status?: "ALL" | "ONLINE" | "ARCHIVED";
|
|
70
|
-
content?: boolean;
|
|
71
|
-
titleLike?: string;
|
|
72
|
-
countryCode?: string;
|
|
73
|
-
externalId?: string;
|
|
74
|
-
}
|
|
75
|
-
>
|
|
76
|
-
| Endpoint<"GET", "/careers/jobs/:jobId", CareersJob, { jobId: number }>
|
|
77
|
-
| Endpoint<
|
|
78
|
-
"GET",
|
|
79
|
-
"/careers/offices",
|
|
80
|
-
CareersOffice[],
|
|
81
|
-
{
|
|
82
|
-
page?: number;
|
|
83
|
-
pageSize?: number;
|
|
84
|
-
countryCode?: string;
|
|
85
|
-
cityNameLike?: string;
|
|
86
|
-
}
|
|
87
|
-
>;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { HealthCheckResult, HealthIndicatorResult } from "@nestjs/terminus";
|
|
2
|
-
|
|
3
|
-
import { Endpoint } from "../../endpoints";
|
|
4
|
-
|
|
5
|
-
export interface Health<T extends string = string> extends HealthCheckResult {
|
|
6
|
-
info?: Record<T, HealthIndicatorResult[T]>;
|
|
7
|
-
error?: Record<T, HealthIndicatorResult[T]>;
|
|
8
|
-
details: Record<T, HealthIndicatorResult[T]>;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export type HealthEndpoints =
|
|
12
|
-
| Endpoint<"GET", "/health", Health<"database" | "app" | "api" | "database">>
|
|
13
|
-
| Endpoint<"GET", "/health/database", Health<"database">>
|
|
14
|
-
| Endpoint<"GET", "/health/api", Health<"api">>
|
|
15
|
-
| Endpoint<"GET", "/health/app", Health<"app">>;
|