5htp 0.3.8 → 0.4.0
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/package.json +1 -1
- package/src/compiler/common/babel/routes/routes.ts +13 -2
- package/src/compiler/common/index.ts +3 -1
- package/src/compiler/common/plugins/indexage/icones-svg/index.ts +3 -3
- package/src/compiler/index.ts +34 -12
- package/skeleton/Dockerfile +0 -20
- package/skeleton/docker-compose.yml +0 -37
- package/skeleton/identity.yaml +0 -21
- package/skeleton/package.json +0 -48
- package/skeleton/src/client/assets/identity/logo.svg +0 -14
- package/skeleton/src/client/assets/identity/logoAndText.svg +0 -10
- package/skeleton/src/client/assets/identity/logoAndTextBlack.svg +0 -11
- package/skeleton/src/client/assets/illustration/landing/banner.webp +0 -0
- package/skeleton/src/client/assets/illustration/landing/candidate/employers.webp +0 -0
- package/skeleton/src/client/assets/illustration/landing/candidate/hero.webp +0 -0
- package/skeleton/src/client/assets/illustration/landing/candidate/mentors.webp +0 -0
- package/skeleton/src/client/assets/illustration/landing/headhunter/hero.webp +0 -0
- package/skeleton/src/client/assets/illustration/landing/hero.jpeg +0 -0
- package/skeleton/src/client/assets/illustration/landing/hero.webp +0 -0
- package/skeleton/src/client/assets/illustration/landing/hero.xcf +0 -0
- package/skeleton/src/client/assets/illustration/landing/recruiter/onboarding.webp +0 -0
- package/skeleton/src/client/assets/illustration/landing/team/andre.png +0 -0
- package/skeleton/src/client/assets/illustration/landing/team/emma.png +0 -0
- package/skeleton/src/client/assets/illustration/landing/team/fei.png +0 -0
- package/skeleton/src/client/assets/illustration/landing/team/gaetan.png +0 -0
- package/skeleton/src/client/assets/illustration/landing/team/jordan.png +0 -0
- package/skeleton/src/client/assets/illustration/landing/team/lery.png +0 -0
- package/skeleton/src/client/assets/illustration/landing/team/mehdi.png +0 -0
- package/skeleton/src/client/assets/illustration/landing/team/omkar.png +0 -0
- package/skeleton/src/client/assets/illustration/landing/team/thibaut.png +0 -0
- package/skeleton/src/client/assets/illustration/launch.jpg +0 -0
- package/skeleton/src/client/assets/img/background/header-blur.png +0 -0
- package/skeleton/src/client/assets/img/partners/citron.svg +0 -987
- package/skeleton/src/client/assets/logos/google-play-store.svg +0 -1
- package/skeleton/src/client/assets/logos/googleauth.svg +0 -9
- package/skeleton/src/client/assets/patterns/dots.png +0 -0
- package/skeleton/src/client/assets/patterns/interlaced.png +0 -0
- package/skeleton/src/client/assets/theme.less +0 -231
- package/skeleton/src/client/assets/vars.less +0 -54
- package/skeleton/src/client/context.ts +0 -23
- package/skeleton/src/client/index.ts +0 -59
- package/skeleton/src/client/pages/_messages/400.tsx +0 -45
- package/skeleton/src/client/pages/_messages/401.tsx +0 -39
- package/skeleton/src/client/pages/_messages/403.tsx +0 -43
- package/skeleton/src/client/pages/_messages/404.tsx +0 -42
- package/skeleton/src/client/pages/_messages/500.tsx +0 -42
- package/skeleton/src/client/pages/platform/Header.less +0 -12
- package/skeleton/src/client/pages/platform/Header.tsx +0 -119
- package/skeleton/src/client/pages/platform/_layout/index.less +0 -118
- package/skeleton/src/client/pages/platform/_layout/index.tsx +0 -131
- package/skeleton/src/client/pages/platform/_layout/mobile.less +0 -114
- package/skeleton/src/client/pages/platform/_page.tsx +0 -54
- package/skeleton/src/client/pages/platform/headhunters/index.tsx +0 -88
- package/skeleton/src/client/pages/platform/index.tsx +0 -58
- package/skeleton/src/client/pages/platform/missions/index.tsx +0 -149
- package/skeleton/src/client/pages/preload.json +0 -3
- package/skeleton/src/client/services/metrics/index.ts +0 -59
- package/skeleton/src/client/tsconfig.json +0 -31
- package/skeleton/src/common/config/router.ts +0 -16
- package/skeleton/src/common/forms/company/bookCall.ts +0 -25
- package/skeleton/src/common/forms/company/importJob.ts +0 -26
- package/skeleton/src/common/forms/company/signup.ts +0 -31
- package/skeleton/src/common/forms/headhunter/feedback.ts +0 -31
- package/skeleton/src/common/forms/headhunter/mission/cancel.ts +0 -26
- package/skeleton/src/common/forms/headhunter/mission/candidate/availability.ts +0 -31
- package/skeleton/src/common/forms/headhunter/mission/candidate/education.ts +0 -19
- package/skeleton/src/common/forms/headhunter/mission/candidate/identity.ts +0 -31
- package/skeleton/src/common/forms/headhunter/mission/candidate/others.ts +0 -19
- package/skeleton/src/common/forms/headhunter/mission/candidate/skills.ts +0 -21
- package/skeleton/src/common/forms/headhunter/mission/reject.ts +0 -23
- package/skeleton/src/common/forms/headhunter/mission/search.ts +0 -78
- package/skeleton/src/common/forms/headhunter/signup.ts +0 -34
- package/skeleton/src/common/libs/headhunter/candidate/index.ts +0 -155
- package/skeleton/src/common/libs/headhunter/mission/index.ts +0 -30
- package/skeleton/src/common/libs/hub/index.ts +0 -41
- package/skeleton/src/common/tsconfig.json +0 -10
- package/skeleton/src/server/config/communication.ts +0 -48
- package/skeleton/src/server/config/crosspath.ts +0 -9
- package/skeleton/src/server/config/data.ts +0 -34
- package/skeleton/src/server/config/database.ts +0 -26
- package/skeleton/src/server/config/internal.ts +0 -21
- package/skeleton/src/server/config/user.ts +0 -90
- package/skeleton/src/server/index.ts +0 -111
- package/skeleton/src/server/libs/utils/slug.ts +0 -11
- package/skeleton/src/server/routes/global.ts +0 -33
- package/skeleton/src/server/routes/headhunters.ts +0 -24
- package/skeleton/src/server/routes/missions.ts +0 -50
- package/skeleton/src/server/services/Headhunter/index.ts +0 -127
- package/skeleton/src/server/services/Headhunter/service.json +0 -6
- package/skeleton/src/server/services/Mission/index.ts +0 -174
- package/skeleton/src/server/services/Mission/service.json +0 -6
- package/skeleton/src/server/services/email/sendgrid/index.ts +0 -97
- package/skeleton/src/server/services/email/sendgrid/service.json +0 -6
- package/skeleton/src/server/services/slack/index.ts +0 -105
- package/skeleton/src/server/services/slack/service.json +0 -6
- package/skeleton/src/server/services/users/index.ts +0 -133
- package/skeleton/src/server/services/users/service.json +0 -6
- package/skeleton/src/server/tsconfig.json +0 -32
- package/skeleton/var/typings/routes.d.ts +0 -541
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
export const statuses: {
|
|
3
|
-
[statusName: string]: {
|
|
4
|
-
progress: number,
|
|
5
|
-
color: string,
|
|
6
|
-
hint: string,
|
|
7
|
-
failed?: boolean
|
|
8
|
-
}
|
|
9
|
-
} = {
|
|
10
|
-
|
|
11
|
-
// STEP 1
|
|
12
|
-
'Sourced': {
|
|
13
|
-
progress: 10,
|
|
14
|
-
color: '#afe9b5',
|
|
15
|
-
hint: "The candidate you submitted is waiting to be verified by the client."
|
|
16
|
-
},
|
|
17
|
-
'Being Screened': {
|
|
18
|
-
progress: 20,
|
|
19
|
-
color: '#afe9b5',
|
|
20
|
-
hint: "The candidate you submitted is waiting to be verified by the client."
|
|
21
|
-
},
|
|
22
|
-
'Rejected by CP': {
|
|
23
|
-
progress: 20,
|
|
24
|
-
color: '#df6232',
|
|
25
|
-
hint: "The candidate has been rejected by the client.",
|
|
26
|
-
failed: true
|
|
27
|
-
},
|
|
28
|
-
'Sent to Client': {
|
|
29
|
-
progress: 30,
|
|
30
|
-
color: '#afe9b5',
|
|
31
|
-
hint: "We sent the candidate to the client, and we're waiting for his feedbacks."
|
|
32
|
-
},
|
|
33
|
-
|
|
34
|
-
// STEP 2
|
|
35
|
-
'Candidate Not Reachable': {
|
|
36
|
-
progress: 40,
|
|
37
|
-
color: '#b10f41',
|
|
38
|
-
hint: "We contacted the candidate, and he said not being interested by the offer.",
|
|
39
|
-
failed: true
|
|
40
|
-
},
|
|
41
|
-
'Candidate not interested': {
|
|
42
|
-
progress: 40,
|
|
43
|
-
color: '#b10f41',
|
|
44
|
-
hint: "We contacted the candidate, and he said not being interested by the offer.",
|
|
45
|
-
failed: true
|
|
46
|
-
},
|
|
47
|
-
'Already In Client Pipeline': {
|
|
48
|
-
progress: 40,
|
|
49
|
-
color: '#df6232',
|
|
50
|
-
hint: "The candidate has already been interviewed by the client.",
|
|
51
|
-
failed: true
|
|
52
|
-
},
|
|
53
|
-
'Waiting list': {
|
|
54
|
-
progress: 40,
|
|
55
|
-
color: '#fbc541',
|
|
56
|
-
hint: "The client is okay to onboard the candidate, but he prefer to wait if we find a better profile.",
|
|
57
|
-
},
|
|
58
|
-
|
|
59
|
-
// STEP 3: Interview
|
|
60
|
-
'Interview Process - 1st Round': {
|
|
61
|
-
progress: 50,
|
|
62
|
-
color: '#fbc541',
|
|
63
|
-
hint: "The candidate is currently being interviewed by the client."
|
|
64
|
-
},
|
|
65
|
-
'Interview Process - 2nd Round': {
|
|
66
|
-
progress: 50,
|
|
67
|
-
color: '#fbc541',
|
|
68
|
-
hint: "The candidate is currently being interviewed by the client."
|
|
69
|
-
},
|
|
70
|
-
'Interview Process - 3rd Round': {
|
|
71
|
-
progress: 50,
|
|
72
|
-
color: '#fbc541',
|
|
73
|
-
hint: "The candidate is currently being interviewed by the client."
|
|
74
|
-
},
|
|
75
|
-
'Interview Process - 4th Round': {
|
|
76
|
-
progress: 50,
|
|
77
|
-
color: '#fbc541',
|
|
78
|
-
hint: "The candidate is currently being interviewed by the client."
|
|
79
|
-
},
|
|
80
|
-
'Interview Process - 5th Round': {
|
|
81
|
-
progress: 50,
|
|
82
|
-
color: '#fbc541',
|
|
83
|
-
hint: "The candidate is currently being interviewed by the client."
|
|
84
|
-
},
|
|
85
|
-
|
|
86
|
-
// STEP 4: Feedback from Interview
|
|
87
|
-
'Rejected by client': {
|
|
88
|
-
progress: 60,
|
|
89
|
-
color: '#b10f41',
|
|
90
|
-
hint: "The candidate has been rejected by the client.",
|
|
91
|
-
failed: true
|
|
92
|
-
},
|
|
93
|
-
'Mission closed by client': {
|
|
94
|
-
progress: 60,
|
|
95
|
-
color: '#b10f41',
|
|
96
|
-
hint: '',
|
|
97
|
-
failed: true
|
|
98
|
-
},
|
|
99
|
-
'Offer sent': {
|
|
100
|
-
progress: 70,
|
|
101
|
-
color: '#fbc541',
|
|
102
|
-
hint: "The client accepted the candidate and just sent an offer to him. We're waiting for an answer from the candidate.",
|
|
103
|
-
},
|
|
104
|
-
'Signed': {
|
|
105
|
-
progress: 80,
|
|
106
|
-
color: '#b10f41',
|
|
107
|
-
hint: ''
|
|
108
|
-
},
|
|
109
|
-
'Trial Not Passed': {
|
|
110
|
-
progress: 90,
|
|
111
|
-
color: '#b10f41',
|
|
112
|
-
hint: '',
|
|
113
|
-
failed: true
|
|
114
|
-
},
|
|
115
|
-
'Trial Passed': {
|
|
116
|
-
progress: 100,
|
|
117
|
-
color: '#006400',
|
|
118
|
-
hint: ''
|
|
119
|
-
},
|
|
120
|
-
|
|
121
|
-
// Deprecated
|
|
122
|
-
'To Be Screened by CV Validator': {
|
|
123
|
-
progress: 10,
|
|
124
|
-
color: '#afe9b5',
|
|
125
|
-
hint: "The candidate you submitted is waiting to be verified by the client."
|
|
126
|
-
},
|
|
127
|
-
'Screened by CP': {
|
|
128
|
-
progress: 20,
|
|
129
|
-
color: '#afe9b5',
|
|
130
|
-
hint: "The candidate has just been double-checked by our internal team, and is about to be sent to the client."
|
|
131
|
-
},
|
|
132
|
-
'Interview Process': {
|
|
133
|
-
progress: 40,
|
|
134
|
-
color: '#fbc541',
|
|
135
|
-
hint: "The candidate is currently being interviewed by the client."
|
|
136
|
-
},
|
|
137
|
-
'Rejected by client 2nd round': {
|
|
138
|
-
progress: 60,
|
|
139
|
-
color: '#b10f41',
|
|
140
|
-
hint: "The candidate has been rejected by the client after the 2nd round of interview.",
|
|
141
|
-
failed: true
|
|
142
|
-
},
|
|
143
|
-
'Rejected by client 3rd round': {
|
|
144
|
-
progress: 65,
|
|
145
|
-
color: '#b10f41',
|
|
146
|
-
hint: "The candidate has been rejected by the client after the 2nd round of interview.",
|
|
147
|
-
failed: true
|
|
148
|
-
},
|
|
149
|
-
'Rejected by client 4th round': {
|
|
150
|
-
progress: 70,
|
|
151
|
-
color: '#b10f41',
|
|
152
|
-
hint: "The candidate has been rejected by the client after the 2nd round of interview.",
|
|
153
|
-
failed: true
|
|
154
|
-
},
|
|
155
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import abr from 'number-abbreviate';
|
|
2
|
-
|
|
3
|
-
const range = ( min?: number, max?: number, unit?: string ) => {
|
|
4
|
-
unit = unit || '';
|
|
5
|
-
if (min === undefined && max === undefined)
|
|
6
|
-
return 'Not precised';
|
|
7
|
-
else if (min === max)
|
|
8
|
-
return abr(max) as number + ' ' + ' ' + unit;
|
|
9
|
-
else if (min !== undefined && max !== undefined)
|
|
10
|
-
return abr(min) + ' - ' + abr(max) + ' ' + unit;
|
|
11
|
-
else if (min !== undefined)
|
|
12
|
-
return 'Starting from ' + abr(min) + ' ' + unit;
|
|
13
|
-
else if (max !== undefined)
|
|
14
|
-
return 'Up to ' + abr(max) + ' ' + unit;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export const rejectionReasons = [
|
|
18
|
-
"No time",
|
|
19
|
-
"Not my specialty",
|
|
20
|
-
"I don't want to work for this client",
|
|
21
|
-
"It's already my client",
|
|
22
|
-
"Fee not interesting enough",
|
|
23
|
-
"I don't have candidates for this position for the moment",
|
|
24
|
-
"Other",
|
|
25
|
-
].map(v => ({
|
|
26
|
-
label: v,
|
|
27
|
-
value: v
|
|
28
|
-
}))
|
|
29
|
-
|
|
30
|
-
export default { range }
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
// ! Pleaseensure those values are always sync with the one in database enums / set
|
|
3
|
-
export const Genders = [{
|
|
4
|
-
label: 'Male',
|
|
5
|
-
value: 'Male',
|
|
6
|
-
}, {
|
|
7
|
-
label: 'Female',
|
|
8
|
-
value: 'Female',
|
|
9
|
-
}, {
|
|
10
|
-
label: 'Non-Binary',
|
|
11
|
-
value: 'Non-Binary',
|
|
12
|
-
}, {
|
|
13
|
-
label: 'Transgender',
|
|
14
|
-
value: 'Transgender',
|
|
15
|
-
}, {
|
|
16
|
-
label: 'Other',
|
|
17
|
-
value: 'Other',
|
|
18
|
-
}]
|
|
19
|
-
|
|
20
|
-
export const Currencies = [{
|
|
21
|
-
label: 'Dollar (USD)',
|
|
22
|
-
value: '$'
|
|
23
|
-
}, {
|
|
24
|
-
|
|
25
|
-
label: 'Euro (EUR)',
|
|
26
|
-
value: '€'
|
|
27
|
-
}, {
|
|
28
|
-
label: 'Pounds (GBP)',
|
|
29
|
-
value: '£'
|
|
30
|
-
}]
|
|
31
|
-
|
|
32
|
-
export const MobilityModes = [{
|
|
33
|
-
label: 'On-site',
|
|
34
|
-
value: 'On-site',
|
|
35
|
-
},{
|
|
36
|
-
label: 'Hybrid',
|
|
37
|
-
value: 'Hybrid',
|
|
38
|
-
},{
|
|
39
|
-
label: 'Full Remote',
|
|
40
|
-
value: 'Full Remote',
|
|
41
|
-
}]
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { Environment, Services } from '@app';
|
|
2
|
-
|
|
3
|
-
Services.setup('Core/Email', {
|
|
4
|
-
debug: false,
|
|
5
|
-
simulateWhenLocal: true,
|
|
6
|
-
default: {
|
|
7
|
-
transporter: 'sendgrid',
|
|
8
|
-
from: {
|
|
9
|
-
// Users should have the ability to answers to emails
|
|
10
|
-
name: 'Gaëtan from CrossPath',
|
|
11
|
-
email: 'gaetan@becrosspath.com'
|
|
12
|
-
},
|
|
13
|
-
},
|
|
14
|
-
bugReport: {
|
|
15
|
-
from: {
|
|
16
|
-
name: 'CrossPath Robot',
|
|
17
|
-
email: 'system@becrosspath.com'
|
|
18
|
-
},
|
|
19
|
-
to: {
|
|
20
|
-
name: 'CrossPath Engineering Team',
|
|
21
|
-
email: 'engineering@becrosspath.com'
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
Services.setup('CrossPath/Email/Sendgrid', {
|
|
27
|
-
api: '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'
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
Services.setup('CrossPath/Slack', {
|
|
31
|
-
token: 'xoxb-4679987012741-4734346927492-M7VSHqd8uHg4KYHlEByaIRLL',
|
|
32
|
-
channels: {
|
|
33
|
-
'default': 'C04L5C6LLBW',
|
|
34
|
-
'engineering-alerts': 'C04L5C6LLBW',
|
|
35
|
-
'product': 'C04L2TGR5J6',
|
|
36
|
-
'headhunters': 'C04L2TNC6F4',
|
|
37
|
-
'customer-success': Environment.name === 'local'
|
|
38
|
-
? 'C04L5C6LLBW'// Engineering alerts
|
|
39
|
-
: 'C04L2TNC6F4',
|
|
40
|
-
'sales': Environment.name === 'local'
|
|
41
|
-
? 'C04L5C6LLBW' // Engineering alerts
|
|
42
|
-
: 'C04L2TVJ0LS'
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
Services.setup('Core/Fetch', {
|
|
47
|
-
disk: 'default'
|
|
48
|
-
})
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { Services, Environment } from '@app';
|
|
2
|
-
|
|
3
|
-
Services.setup('Core/Disks', {
|
|
4
|
-
debug: true,
|
|
5
|
-
default: Environment.name === 'local'
|
|
6
|
-
? 'local'
|
|
7
|
-
: 's3'
|
|
8
|
-
})
|
|
9
|
-
|
|
10
|
-
Services.setup('Core/Disks/S3', {
|
|
11
|
-
debug: true,
|
|
12
|
-
|
|
13
|
-
accessKeyId: 'AKIAXEP3ITBHFW6BF2WM',
|
|
14
|
-
secretAccessKey: 'rZe9HMQLlCxbDGhp/qtg1YQYrTEt+fjOMU3jHpli',
|
|
15
|
-
region: 'eu-west-2',
|
|
16
|
-
|
|
17
|
-
rootDir: '.',
|
|
18
|
-
buckets: {
|
|
19
|
-
data: 'crosspath-platform'
|
|
20
|
-
},
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
Services.setup('Core/Disks/Local', {
|
|
24
|
-
debug: true,
|
|
25
|
-
rootDir: '.',
|
|
26
|
-
buckets: {
|
|
27
|
-
data: 'data'
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
/*Services.setup('Core/Cache', {
|
|
32
|
-
debug: true,
|
|
33
|
-
disk: 'default'
|
|
34
|
-
})*/
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { Environment, Services } from '@app';
|
|
2
|
-
|
|
3
|
-
Services.setup('Core/Database/SQL', {
|
|
4
|
-
debug: true,
|
|
5
|
-
|
|
6
|
-
// MySQL server should be configured to 3x connectionLimit
|
|
7
|
-
// (1 production server + 1 deployment testing + TablePlus)
|
|
8
|
-
connectionsLimit: 30,
|
|
9
|
-
connections: Environment.profile === 'dev'
|
|
10
|
-
? [{
|
|
11
|
-
name: 'local',
|
|
12
|
-
databases: ['crosspath'],
|
|
13
|
-
host: '127.0.0.1',
|
|
14
|
-
port: 3306,
|
|
15
|
-
login: 'gaetan',
|
|
16
|
-
password: "$mdp=MySQL!159753",
|
|
17
|
-
}]
|
|
18
|
-
: [{
|
|
19
|
-
name: 'aws',
|
|
20
|
-
databases: ['crosspath'],
|
|
21
|
-
host: 'crosspathdb.czmbpbfhocbe.eu-west-2.rds.amazonaws.com',
|
|
22
|
-
port: 8888,
|
|
23
|
-
login: 'admin', // TODO: create limited user on AWS
|
|
24
|
-
password: "oyx82StLt2qKfF",
|
|
25
|
-
}]
|
|
26
|
-
})
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Services } from '@app';
|
|
2
|
-
|
|
3
|
-
Services.setup('Core/Console', {
|
|
4
|
-
debug: false,
|
|
5
|
-
bufferLimit: 10000,
|
|
6
|
-
dev: {
|
|
7
|
-
level: 'log'
|
|
8
|
-
},
|
|
9
|
-
prod: {
|
|
10
|
-
level: 'log'
|
|
11
|
-
}
|
|
12
|
-
})
|
|
13
|
-
|
|
14
|
-
Services.setup('Core/Cron', {});
|
|
15
|
-
|
|
16
|
-
Services.setup('Core/Encryption/AES', {
|
|
17
|
-
iv: '2smIsdJTIZX56htS',
|
|
18
|
-
keys: {
|
|
19
|
-
activationToken: 's5v8y/B?D(G+KbPeShVmYq3t6w9z$C&F'
|
|
20
|
-
}
|
|
21
|
-
});
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import { Services, Environment } from '@app';
|
|
2
|
-
|
|
3
|
-
import { domains } from '@/common/config/router';
|
|
4
|
-
|
|
5
|
-
Services.setup('CrossPath/Users', {
|
|
6
|
-
|
|
7
|
-
debug: true,
|
|
8
|
-
logoutUrl: '/',
|
|
9
|
-
|
|
10
|
-
jwt: {
|
|
11
|
-
// 2048 bits
|
|
12
|
-
key: "A?D(G+KbPeShVmYq3t6w9y$B&E)H@McQfTjWnZr4u7x!A%C*F-JaNdRgUkXp2s5v8y/B?E(G+KbPeShVmYq3t6w9z$C&F)J@McQfTjWnZr4u7x!A%D*G-KaPdRgUkXp2s5v8y/B?E(H+MbQeThVmYq3t6w9z$C&F)J@NcRfUjXnZr4u7x!A%D*G-KaPdSgVkYp3s5v8y/B?E(H+MbQeThWmZq4t7w9z$C&F)J@NcRfUjXn2r5u8x/A%D*G-KaPdS",
|
|
13
|
-
expiration: "7 days",
|
|
14
|
-
}
|
|
15
|
-
})
|
|
16
|
-
|
|
17
|
-
Services.setup('Core/Router', {
|
|
18
|
-
|
|
19
|
-
debug: false,
|
|
20
|
-
|
|
21
|
-
disk: 'default',
|
|
22
|
-
|
|
23
|
-
domains: Environment.name === 'local' ? {
|
|
24
|
-
...domains.local,
|
|
25
|
-
current: domains.local.csm,
|
|
26
|
-
} : {
|
|
27
|
-
...domains.prod,
|
|
28
|
-
current: domains.prod.csm,
|
|
29
|
-
},
|
|
30
|
-
|
|
31
|
-
http: {
|
|
32
|
-
// Access
|
|
33
|
-
domain: 'csm.becrosspath.com',
|
|
34
|
-
port: 3014,
|
|
35
|
-
ssl: true,
|
|
36
|
-
|
|
37
|
-
// Limitations
|
|
38
|
-
upload: {
|
|
39
|
-
maxSize: '10mb'
|
|
40
|
-
},
|
|
41
|
-
csp: {
|
|
42
|
-
scripts: [
|
|
43
|
-
// Whitelist external js scripts
|
|
44
|
-
"https://www.googletagmanager.com/gtag/js",
|
|
45
|
-
"https://cdn.jsdelivr.net",
|
|
46
|
-
"https://static.hotjar.com",
|
|
47
|
-
"https://script.hotjar.com",
|
|
48
|
-
"https://js.stripe.com/v3/pricing-table.js",
|
|
49
|
-
"https://snap.licdn.com",
|
|
50
|
-
]
|
|
51
|
-
},
|
|
52
|
-
cors: {
|
|
53
|
-
origin: [
|
|
54
|
-
// Landing Page
|
|
55
|
-
'http://localhost:3011',
|
|
56
|
-
'https://becrosspath.com',
|
|
57
|
-
'https://www.becrosspath.com',
|
|
58
|
-
]
|
|
59
|
-
}
|
|
60
|
-
},
|
|
61
|
-
|
|
62
|
-
// Protections against bots
|
|
63
|
-
// TODO: distinct service
|
|
64
|
-
/*security: {
|
|
65
|
-
// https://www.google.com/recaptcha/admin/site/346699952
|
|
66
|
-
recaptcha: {
|
|
67
|
-
pub: '6LewOKoUAAAAAKmaDqpcNaQz31z_AJarSs0sQvft',
|
|
68
|
-
prv: '6LewOKoUAAAAAOAj80m9vOJuP9YcR7PnYQ3E-y4o'
|
|
69
|
-
},
|
|
70
|
-
iphub: "Mzk3MzpLWE84eHhXQ0ZvUlNQODh0M3J0OXpDTGE2WGx5Szl6OA=="
|
|
71
|
-
},*/
|
|
72
|
-
|
|
73
|
-
// WARN: The data returned by this function should be safe to be epxosed to the frontend
|
|
74
|
-
// TODO: remove and replace by
|
|
75
|
-
context: (request, app) => ({
|
|
76
|
-
|
|
77
|
-
user: app.Users.forSSR(request)
|
|
78
|
-
|
|
79
|
-
})
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
Services.setup('Core/Users/Router', {});
|
|
83
|
-
|
|
84
|
-
Services.setup('Core/Schema/Router', {
|
|
85
|
-
debug: false
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
Services.setup('Core/Socket', {
|
|
89
|
-
port: 3011,
|
|
90
|
-
});
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
/*----------------------------------
|
|
2
|
-
- DEPS
|
|
3
|
-
----------------------------------*/
|
|
4
|
-
import { Application } from '@server/app';
|
|
5
|
-
import type { ServerBug } from '@common/errors';
|
|
6
|
-
|
|
7
|
-
/*----------------------------------
|
|
8
|
-
- APPLICATION
|
|
9
|
-
----------------------------------*/
|
|
10
|
-
export default class CrossPathCSM extends Application {
|
|
11
|
-
|
|
12
|
-
/*----------------------------------
|
|
13
|
-
- CORE ERVICES
|
|
14
|
-
----------------------------------*/
|
|
15
|
-
|
|
16
|
-
public Users = this.use('CrossPath/Users');
|
|
17
|
-
|
|
18
|
-
public Disks = this.use('Core/Disks', {
|
|
19
|
-
s3: this.use('Core/Disks/S3'),
|
|
20
|
-
local: this.use('Core/Disks/Local')
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
public Router = this.use('Core/Router', {
|
|
24
|
-
// Router services
|
|
25
|
-
auth: this.use('Core/Users/Router', {
|
|
26
|
-
users: this.Users
|
|
27
|
-
}),
|
|
28
|
-
schema: this.use('Core/Schema/Router')
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
public SQL = this.use('Core/Database/SQL');
|
|
32
|
-
|
|
33
|
-
public Email = this.use('Core/Email', {
|
|
34
|
-
sendgrid: this.use('CrossPath/Email/Sendgrid')
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
public Fetch = this.use('Core/Fetch', {
|
|
38
|
-
disks: this.Disks,
|
|
39
|
-
router: this.Router
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
public Cron = this.use('Core/Cron');
|
|
43
|
-
|
|
44
|
-
public AES = this.use('Core/Encryption/AES');
|
|
45
|
-
|
|
46
|
-
public Slack = this.use('CrossPath/Slack');
|
|
47
|
-
|
|
48
|
-
/*----------------------------------
|
|
49
|
-
- BUSINESS SERVICES
|
|
50
|
-
----------------------------------*/
|
|
51
|
-
|
|
52
|
-
public Mission = this.use('CrossPath/Mission');
|
|
53
|
-
|
|
54
|
-
public Headhunter = this.use('CrossPath/Headhunter');
|
|
55
|
-
|
|
56
|
-
/*----------------------------------
|
|
57
|
-
- LIFECYCLE
|
|
58
|
-
----------------------------------*/
|
|
59
|
-
|
|
60
|
-
public async launch() {
|
|
61
|
-
|
|
62
|
-
console.log("Launching CrossPath CSM Server");
|
|
63
|
-
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
public async ready() {
|
|
67
|
-
|
|
68
|
-
console.log("CrossPath CSM Server is ready");
|
|
69
|
-
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
public async reportBug( report: ServerBug ) {
|
|
73
|
-
|
|
74
|
-
if (this.env.name === 'local')
|
|
75
|
-
return console.warn(`Cancel bug report since we're in local.`);
|
|
76
|
-
|
|
77
|
-
this.Email.started && this.Email.send({
|
|
78
|
-
from: this.Email.config.bugReport.from,
|
|
79
|
-
to: this.Email.config.bugReport.to,
|
|
80
|
-
subject: "Bug on CSM server: " + (report.error.message),
|
|
81
|
-
html: `
|
|
82
|
-
<a href="${this.Router.http.publicUrl}/admin/activity/requests/${report.channelId}">
|
|
83
|
-
View Request details & console
|
|
84
|
-
</a>
|
|
85
|
-
<br/>
|
|
86
|
-
Channel Type: ${report.channelType}
|
|
87
|
-
Channel ID: ${report.channelId}
|
|
88
|
-
User: ${report.user}
|
|
89
|
-
IP: ${report.ip}
|
|
90
|
-
<br/>
|
|
91
|
-
${report.logs}
|
|
92
|
-
`
|
|
93
|
-
})
|
|
94
|
-
|
|
95
|
-
this.Slack.started && this.Slack.sendInChannel('engineering-alerts', `
|
|
96
|
-
*A bug occured on CSM server:* ${report.error.message}
|
|
97
|
-
Channel Type: ${report.channelType}
|
|
98
|
-
Channel ID: ${report.channelId}
|
|
99
|
-
User: ${report.user}
|
|
100
|
-
IP: ${report.ip}
|
|
101
|
-
Stacktrace:
|
|
102
|
-
${report.error.stack}
|
|
103
|
-
`);
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
public async shutdown() {
|
|
107
|
-
|
|
108
|
-
console.log("CrossPath CSM Server will shutdown");
|
|
109
|
-
|
|
110
|
-
}
|
|
111
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import slugify from 'slugify';
|
|
3
|
-
|
|
4
|
-
export const genSlug = (label: string) => slugify( label,{
|
|
5
|
-
replacement: '-', // replace spaces with replacement character, defaults to `-`
|
|
6
|
-
remove: undefined, // remove characters that match regex, defaults to `undefined`
|
|
7
|
-
lower: true, // convert to lower case, defaults to `false`
|
|
8
|
-
strict: false, // strip special characters except replacement, defaults to `false`
|
|
9
|
-
locale: 'vi', // language code of the locale to use
|
|
10
|
-
trim: true // trim leading and trailing replacement chars, defaults to `true`
|
|
11
|
-
});
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/*----------------------------------
|
|
2
|
-
- DEPENDANCES
|
|
3
|
-
----------------------------------*/
|
|
4
|
-
|
|
5
|
-
// Npm
|
|
6
|
-
|
|
7
|
-
// Core
|
|
8
|
-
import { Router, Users } from '@app';
|
|
9
|
-
|
|
10
|
-
/*----------------------------------
|
|
11
|
-
- TYPES
|
|
12
|
-
----------------------------------*/
|
|
13
|
-
|
|
14
|
-
/*----------------------------------
|
|
15
|
-
- SIGNUP
|
|
16
|
-
----------------------------------*/
|
|
17
|
-
|
|
18
|
-
Router.get('/health', { priority: 11 }, async ({ auth, request, response}) => {
|
|
19
|
-
return "ok";
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
Router.get('/login', { priority: 11 }, async ({ schema, request, response }) => {
|
|
23
|
-
|
|
24
|
-
const { email, password } = schema.validate({
|
|
25
|
-
email: schema.email(),
|
|
26
|
-
password: schema.string(),
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
await Users.login(email, password, request);
|
|
30
|
-
|
|
31
|
-
return response.redirect('/');
|
|
32
|
-
|
|
33
|
-
});
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/*----------------------------------
|
|
2
|
-
- DEPENDANCES
|
|
3
|
-
----------------------------------*/
|
|
4
|
-
|
|
5
|
-
// Npm
|
|
6
|
-
|
|
7
|
-
// Core
|
|
8
|
-
import { Router, Users, Headhunter } from '@app';
|
|
9
|
-
|
|
10
|
-
/*----------------------------------
|
|
11
|
-
- TYPES
|
|
12
|
-
----------------------------------*/
|
|
13
|
-
|
|
14
|
-
/*----------------------------------
|
|
15
|
-
- SIGNUP
|
|
16
|
-
----------------------------------*/
|
|
17
|
-
|
|
18
|
-
Router.get('/headhunters', async ({ schema, auth }) => {
|
|
19
|
-
|
|
20
|
-
const user = await auth.check('USER');
|
|
21
|
-
|
|
22
|
-
return await Headhunter.List();
|
|
23
|
-
|
|
24
|
-
});
|