@laboratoria/sdk-js 2.0.0-alpha.3 → 2.0.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/lib/core.js +12 -6
- package/lib/model.js +15 -2
- package/package.json +13 -12
- package/schemas/core.json +11 -143
- package/schemas/jobs.json +193 -12
package/lib/core.js
CHANGED
@@ -19,11 +19,11 @@ const extended = {
|
|
19
19
|
'github',
|
20
20
|
'linkedin',
|
21
21
|
'bio',
|
22
|
-
'countryOfResidence',
|
23
|
-
'countryOfOrigin',
|
24
|
-
'workStatus',
|
25
|
-
'educationStatus',
|
26
|
-
'phone',
|
22
|
+
// 'countryOfResidence',
|
23
|
+
// 'countryOfOrigin',
|
24
|
+
// 'workStatus',
|
25
|
+
// 'educationStatus',
|
26
|
+
// 'phone',
|
27
27
|
'role',
|
28
28
|
'signupCohort',
|
29
29
|
'disabled',
|
@@ -160,7 +160,13 @@ const extended = {
|
|
160
160
|
},
|
161
161
|
Application: {
|
162
162
|
inputProps: [
|
163
|
-
|
163
|
+
'cohort',
|
164
|
+
'user',
|
165
|
+
// 'status',
|
166
|
+
// 'workStatus',
|
167
|
+
// 'educationStatus',
|
168
|
+
// 'phone',
|
169
|
+
// 'countryOfResidence',
|
164
170
|
],
|
165
171
|
},
|
166
172
|
};
|
package/lib/model.js
CHANGED
@@ -98,8 +98,21 @@ const createValidator = (schema) => {
|
|
98
98
|
const qToQs = (q = {}) => Object.keys(q).length ? `?q=${JSON.stringify(q)}` : '';
|
99
99
|
|
100
100
|
|
101
|
-
const
|
102
|
-
|
101
|
+
const toKebabCase = (str) => [...str].reduce(
|
102
|
+
(memo, char) => (
|
103
|
+
char === char.toUpperCase()
|
104
|
+
? `${memo}-${char.toLowerCase()}`
|
105
|
+
: `${memo}${char}`
|
106
|
+
),
|
107
|
+
'',
|
108
|
+
);
|
109
|
+
|
110
|
+
|
111
|
+
const createBuildURL = (collectionName) => {
|
112
|
+
const base = toKebabCase(collectionName);
|
113
|
+
return (id, q) => {
|
114
|
+
return `/${base}${id ? `/${encodeURIComponent(id)}` : ''}${qToQs(q)}`;
|
115
|
+
};
|
103
116
|
};
|
104
117
|
|
105
118
|
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@laboratoria/sdk-js",
|
3
|
-
"version": "2.0.0
|
3
|
+
"version": "2.0.0",
|
4
4
|
"description": "Laboratoria JavaScript (browser) SDK",
|
5
5
|
"scripts": {
|
6
6
|
"test": "jest --verbose --coverage",
|
@@ -9,25 +9,26 @@
|
|
9
9
|
"license": "MIT",
|
10
10
|
"dependencies": {
|
11
11
|
"blueimp-md5": "^2.19.0",
|
12
|
-
"firebase": "^9.
|
12
|
+
"firebase": "^9.8.3"
|
13
13
|
},
|
14
14
|
"devDependencies": {
|
15
|
-
"@babel/core": "^7.
|
16
|
-
"@babel/plugin-transform-modules-commonjs": "^7.
|
17
|
-
"babel-jest": "^
|
18
|
-
"jest": "^
|
19
|
-
"
|
20
|
-
"webpack
|
15
|
+
"@babel/core": "^7.18.5",
|
16
|
+
"@babel/plugin-transform-modules-commonjs": "^7.18.2",
|
17
|
+
"babel-jest": "^28.1.1",
|
18
|
+
"jest": "^28.1.1",
|
19
|
+
"jest-environment-jsdom": "^28.1.1",
|
20
|
+
"webpack": "^5.73.0",
|
21
|
+
"webpack-cli": "^4.10.0"
|
21
22
|
},
|
22
23
|
"jest": {
|
23
24
|
"testEnvironment": "jsdom",
|
24
25
|
"coverageThreshold": {
|
25
26
|
"global": {
|
26
|
-
"statements":
|
27
|
+
"statements": 97,
|
27
28
|
"branches": 94,
|
28
|
-
"functions":
|
29
|
-
"lines":
|
29
|
+
"functions": 100,
|
30
|
+
"lines": 97
|
30
31
|
}
|
31
32
|
}
|
32
33
|
}
|
33
|
-
}
|
34
|
+
}
|
package/schemas/core.json
CHANGED
@@ -15,24 +15,6 @@
|
|
15
15
|
"items": {
|
16
16
|
"$ref": "#/definitions/Contract"
|
17
17
|
}
|
18
|
-
},
|
19
|
-
"usersResidence": {
|
20
|
-
"type": "array",
|
21
|
-
"items": {
|
22
|
-
"$ref": "#/definitions/User"
|
23
|
-
}
|
24
|
-
},
|
25
|
-
"usersOrigin": {
|
26
|
-
"type": "array",
|
27
|
-
"items": {
|
28
|
-
"$ref": "#/definitions/User"
|
29
|
-
}
|
30
|
-
},
|
31
|
-
"applications": {
|
32
|
-
"type": "array",
|
33
|
-
"items": {
|
34
|
-
"$ref": "#/definitions/Application"
|
35
|
-
}
|
36
18
|
}
|
37
19
|
}
|
38
20
|
},
|
@@ -113,44 +95,6 @@
|
|
113
95
|
"type": "boolean",
|
114
96
|
"default": false
|
115
97
|
},
|
116
|
-
"workStatus": {
|
117
|
-
"type": [
|
118
|
-
"string",
|
119
|
-
"null"
|
120
|
-
],
|
121
|
-
"enum": [
|
122
|
-
"student",
|
123
|
-
"intern",
|
124
|
-
"unemployed",
|
125
|
-
"fulltime",
|
126
|
-
"partime",
|
127
|
-
"freelance",
|
128
|
-
"selfemployed"
|
129
|
-
]
|
130
|
-
},
|
131
|
-
"educationStatus": {
|
132
|
-
"type": [
|
133
|
-
"string",
|
134
|
-
"null"
|
135
|
-
],
|
136
|
-
"enum": [
|
137
|
-
"ISCED_0",
|
138
|
-
"ISCED_1",
|
139
|
-
"ISCED_2",
|
140
|
-
"ISCED_3",
|
141
|
-
"ISCED_4",
|
142
|
-
"ISCED_5",
|
143
|
-
"ISCED_6",
|
144
|
-
"ISCED_7",
|
145
|
-
"ISCED_8"
|
146
|
-
]
|
147
|
-
},
|
148
|
-
"phone": {
|
149
|
-
"type": [
|
150
|
-
"string",
|
151
|
-
"null"
|
152
|
-
]
|
153
|
-
},
|
154
98
|
"students": {
|
155
99
|
"type": "array",
|
156
100
|
"items": {
|
@@ -196,26 +140,6 @@
|
|
196
140
|
"items": {
|
197
141
|
"$ref": "#/definitions/Application"
|
198
142
|
}
|
199
|
-
},
|
200
|
-
"countryOfResidence": {
|
201
|
-
"anyOf": [
|
202
|
-
{
|
203
|
-
"$ref": "#/definitions/Country"
|
204
|
-
},
|
205
|
-
{
|
206
|
-
"type": "null"
|
207
|
-
}
|
208
|
-
]
|
209
|
-
},
|
210
|
-
"countryOfOrigin": {
|
211
|
-
"anyOf": [
|
212
|
-
{
|
213
|
-
"$ref": "#/definitions/Country"
|
214
|
-
},
|
215
|
-
{
|
216
|
-
"type": "null"
|
217
|
-
}
|
218
|
-
]
|
219
143
|
}
|
220
144
|
}
|
221
145
|
},
|
@@ -335,6 +259,17 @@
|
|
335
259
|
"null"
|
336
260
|
]
|
337
261
|
},
|
262
|
+
"lang": {
|
263
|
+
"type": [
|
264
|
+
"string",
|
265
|
+
"null"
|
266
|
+
],
|
267
|
+
"enum": [
|
268
|
+
"en",
|
269
|
+
"es",
|
270
|
+
"pt"
|
271
|
+
]
|
272
|
+
},
|
338
273
|
"name": {
|
339
274
|
"type": "string"
|
340
275
|
},
|
@@ -365,10 +300,6 @@
|
|
365
300
|
"null"
|
366
301
|
]
|
367
302
|
},
|
368
|
-
"publicAdmission": {
|
369
|
-
"type": "boolean",
|
370
|
-
"default": false
|
371
|
-
},
|
372
303
|
"program": {
|
373
304
|
"$ref": "#/definitions/Program"
|
374
305
|
},
|
@@ -565,74 +496,11 @@
|
|
565
496
|
"null"
|
566
497
|
]
|
567
498
|
},
|
568
|
-
"status": {
|
569
|
-
"type": [
|
570
|
-
"string",
|
571
|
-
"null"
|
572
|
-
],
|
573
|
-
"enum": [
|
574
|
-
"started",
|
575
|
-
"exercisesCompleted",
|
576
|
-
"projectCompleted",
|
577
|
-
"interviewScheduled",
|
578
|
-
"interviewed",
|
579
|
-
"admitted",
|
580
|
-
"rejected"
|
581
|
-
]
|
582
|
-
},
|
583
|
-
"workStatus": {
|
584
|
-
"type": [
|
585
|
-
"string",
|
586
|
-
"null"
|
587
|
-
],
|
588
|
-
"enum": [
|
589
|
-
"student",
|
590
|
-
"intern",
|
591
|
-
"unemployed",
|
592
|
-
"fulltime",
|
593
|
-
"partime",
|
594
|
-
"freelance",
|
595
|
-
"selfemployed"
|
596
|
-
]
|
597
|
-
},
|
598
|
-
"educationStatus": {
|
599
|
-
"type": [
|
600
|
-
"string",
|
601
|
-
"null"
|
602
|
-
],
|
603
|
-
"enum": [
|
604
|
-
"ISCED_0",
|
605
|
-
"ISCED_1",
|
606
|
-
"ISCED_2",
|
607
|
-
"ISCED_3",
|
608
|
-
"ISCED_4",
|
609
|
-
"ISCED_5",
|
610
|
-
"ISCED_6",
|
611
|
-
"ISCED_7",
|
612
|
-
"ISCED_8"
|
613
|
-
]
|
614
|
-
},
|
615
|
-
"phone": {
|
616
|
-
"type": [
|
617
|
-
"string",
|
618
|
-
"null"
|
619
|
-
]
|
620
|
-
},
|
621
499
|
"user": {
|
622
500
|
"$ref": "#/definitions/User"
|
623
501
|
},
|
624
502
|
"cohort": {
|
625
503
|
"$ref": "#/definitions/Cohort"
|
626
|
-
},
|
627
|
-
"countryOfResidence": {
|
628
|
-
"anyOf": [
|
629
|
-
{
|
630
|
-
"$ref": "#/definitions/Country"
|
631
|
-
},
|
632
|
-
{
|
633
|
-
"type": "null"
|
634
|
-
}
|
635
|
-
]
|
636
504
|
}
|
637
505
|
}
|
638
506
|
},
|
package/schemas/jobs.json
CHANGED
@@ -24,6 +24,73 @@
|
|
24
24
|
}
|
25
25
|
}
|
26
26
|
},
|
27
|
+
"Industry": {
|
28
|
+
"type": "object",
|
29
|
+
"properties": {
|
30
|
+
"id": {
|
31
|
+
"type": "integer"
|
32
|
+
},
|
33
|
+
"createdAt": {
|
34
|
+
"type": "string",
|
35
|
+
"format": "date-time"
|
36
|
+
},
|
37
|
+
"updatedAt": {
|
38
|
+
"type": "string",
|
39
|
+
"format": "date-time"
|
40
|
+
},
|
41
|
+
"createdBy": {
|
42
|
+
"type": [
|
43
|
+
"string",
|
44
|
+
"null"
|
45
|
+
]
|
46
|
+
},
|
47
|
+
"name": {
|
48
|
+
"type": "string"
|
49
|
+
},
|
50
|
+
"companies": {
|
51
|
+
"type": "array",
|
52
|
+
"items": {
|
53
|
+
"$ref": "#/definitions/Company"
|
54
|
+
}
|
55
|
+
}
|
56
|
+
}
|
57
|
+
},
|
58
|
+
"CompanyCategoryRel": {
|
59
|
+
"type": "object",
|
60
|
+
"properties": {
|
61
|
+
"id": {
|
62
|
+
"type": "integer"
|
63
|
+
},
|
64
|
+
"createdAt": {
|
65
|
+
"type": "string",
|
66
|
+
"format": "date-time"
|
67
|
+
},
|
68
|
+
"updatedAt": {
|
69
|
+
"type": "string",
|
70
|
+
"format": "date-time"
|
71
|
+
},
|
72
|
+
"createdBy": {
|
73
|
+
"type": [
|
74
|
+
"string",
|
75
|
+
"null"
|
76
|
+
]
|
77
|
+
},
|
78
|
+
"category": {
|
79
|
+
"type": "string",
|
80
|
+
"enum": [
|
81
|
+
"Tech_Consultancy",
|
82
|
+
"Digital_Transformation",
|
83
|
+
"Agency",
|
84
|
+
"Startups",
|
85
|
+
"High_tech",
|
86
|
+
"Traditional_Consulting"
|
87
|
+
]
|
88
|
+
},
|
89
|
+
"company": {
|
90
|
+
"$ref": "#/definitions/Company"
|
91
|
+
}
|
92
|
+
}
|
93
|
+
},
|
27
94
|
"Company": {
|
28
95
|
"type": "object",
|
29
96
|
"properties": {
|
@@ -53,9 +120,29 @@
|
|
53
120
|
"sourceId": {
|
54
121
|
"type": "string"
|
55
122
|
},
|
123
|
+
"size": {
|
124
|
+
"type": [
|
125
|
+
"string",
|
126
|
+
"null"
|
127
|
+
],
|
128
|
+
"enum": [
|
129
|
+
"A_2_10",
|
130
|
+
"B_11_50",
|
131
|
+
"C_51_200",
|
132
|
+
"D_201_500",
|
133
|
+
"E_501_1000",
|
134
|
+
"F_1001_5000",
|
135
|
+
"G_5001_10000",
|
136
|
+
"H_10001_plus"
|
137
|
+
]
|
138
|
+
},
|
56
139
|
"data": {
|
57
140
|
"type": [
|
141
|
+
"number",
|
142
|
+
"string",
|
143
|
+
"boolean",
|
58
144
|
"object",
|
145
|
+
"array",
|
59
146
|
"null"
|
60
147
|
]
|
61
148
|
},
|
@@ -83,12 +170,6 @@
|
|
83
170
|
"null"
|
84
171
|
]
|
85
172
|
},
|
86
|
-
"jobs": {
|
87
|
-
"type": "array",
|
88
|
-
"items": {
|
89
|
-
"$ref": "#/definitions/Job"
|
90
|
-
}
|
91
|
-
},
|
92
173
|
"country": {
|
93
174
|
"anyOf": [
|
94
175
|
{
|
@@ -98,6 +179,28 @@
|
|
98
179
|
"type": "null"
|
99
180
|
}
|
100
181
|
]
|
182
|
+
},
|
183
|
+
"industry": {
|
184
|
+
"anyOf": [
|
185
|
+
{
|
186
|
+
"$ref": "#/definitions/Industry"
|
187
|
+
},
|
188
|
+
{
|
189
|
+
"type": "null"
|
190
|
+
}
|
191
|
+
]
|
192
|
+
},
|
193
|
+
"jobs": {
|
194
|
+
"type": "array",
|
195
|
+
"items": {
|
196
|
+
"$ref": "#/definitions/Job"
|
197
|
+
}
|
198
|
+
},
|
199
|
+
"categories": {
|
200
|
+
"type": "array",
|
201
|
+
"items": {
|
202
|
+
"$ref": "#/definitions/CompanyCategoryRel"
|
203
|
+
}
|
101
204
|
}
|
102
205
|
}
|
103
206
|
},
|
@@ -151,7 +254,11 @@
|
|
151
254
|
},
|
152
255
|
"data": {
|
153
256
|
"type": [
|
257
|
+
"number",
|
258
|
+
"string",
|
259
|
+
"boolean",
|
154
260
|
"object",
|
261
|
+
"array",
|
155
262
|
"null"
|
156
263
|
]
|
157
264
|
},
|
@@ -161,12 +268,24 @@
|
|
161
268
|
"null"
|
162
269
|
]
|
163
270
|
},
|
271
|
+
"descriptionHTML": {
|
272
|
+
"type": [
|
273
|
+
"string",
|
274
|
+
"null"
|
275
|
+
]
|
276
|
+
},
|
164
277
|
"functions": {
|
165
278
|
"type": [
|
166
279
|
"string",
|
167
280
|
"null"
|
168
281
|
]
|
169
282
|
},
|
283
|
+
"functionsHTML": {
|
284
|
+
"type": [
|
285
|
+
"string",
|
286
|
+
"null"
|
287
|
+
]
|
288
|
+
},
|
170
289
|
"seniority": {
|
171
290
|
"type": [
|
172
291
|
"string",
|
@@ -211,12 +330,6 @@
|
|
211
330
|
"company": {
|
212
331
|
"$ref": "#/definitions/Company"
|
213
332
|
},
|
214
|
-
"validityReviews": {
|
215
|
-
"type": "array",
|
216
|
-
"items": {
|
217
|
-
"$ref": "#/definitions/JobValidityReview"
|
218
|
-
}
|
219
|
-
},
|
220
333
|
"country": {
|
221
334
|
"anyOf": [
|
222
335
|
{
|
@@ -226,6 +339,18 @@
|
|
226
339
|
"type": "null"
|
227
340
|
}
|
228
341
|
]
|
342
|
+
},
|
343
|
+
"validityReviews": {
|
344
|
+
"type": "array",
|
345
|
+
"items": {
|
346
|
+
"$ref": "#/definitions/JobValidityReview"
|
347
|
+
}
|
348
|
+
},
|
349
|
+
"applications": {
|
350
|
+
"type": "array",
|
351
|
+
"items": {
|
352
|
+
"$ref": "#/definitions/JobApplication"
|
353
|
+
}
|
229
354
|
}
|
230
355
|
}
|
231
356
|
},
|
@@ -288,6 +413,53 @@
|
|
288
413
|
"$ref": "#/definitions/Job"
|
289
414
|
}
|
290
415
|
}
|
416
|
+
},
|
417
|
+
"JobApplication": {
|
418
|
+
"type": "object",
|
419
|
+
"properties": {
|
420
|
+
"id": {
|
421
|
+
"type": "integer"
|
422
|
+
},
|
423
|
+
"createdAt": {
|
424
|
+
"type": "string",
|
425
|
+
"format": "date-time"
|
426
|
+
},
|
427
|
+
"updatedAt": {
|
428
|
+
"type": "string",
|
429
|
+
"format": "date-time"
|
430
|
+
},
|
431
|
+
"createdBy": {
|
432
|
+
"type": [
|
433
|
+
"string",
|
434
|
+
"null"
|
435
|
+
]
|
436
|
+
},
|
437
|
+
"uid": {
|
438
|
+
"type": "string"
|
439
|
+
},
|
440
|
+
"status": {
|
441
|
+
"type": "string",
|
442
|
+
"default": "pending",
|
443
|
+
"enum": [
|
444
|
+
"pending",
|
445
|
+
"applied",
|
446
|
+
"interview",
|
447
|
+
"challenge",
|
448
|
+
"followup",
|
449
|
+
"hired",
|
450
|
+
"not_hired"
|
451
|
+
]
|
452
|
+
},
|
453
|
+
"recommendedBy": {
|
454
|
+
"type": [
|
455
|
+
"string",
|
456
|
+
"null"
|
457
|
+
]
|
458
|
+
},
|
459
|
+
"job": {
|
460
|
+
"$ref": "#/definitions/Job"
|
461
|
+
}
|
462
|
+
}
|
291
463
|
}
|
292
464
|
},
|
293
465
|
"type": "object",
|
@@ -295,6 +467,12 @@
|
|
295
467
|
"country": {
|
296
468
|
"$ref": "#/definitions/Country"
|
297
469
|
},
|
470
|
+
"industry": {
|
471
|
+
"$ref": "#/definitions/Industry"
|
472
|
+
},
|
473
|
+
"companyCategoryRel": {
|
474
|
+
"$ref": "#/definitions/CompanyCategoryRel"
|
475
|
+
},
|
298
476
|
"company": {
|
299
477
|
"$ref": "#/definitions/Company"
|
300
478
|
},
|
@@ -303,6 +481,9 @@
|
|
303
481
|
},
|
304
482
|
"jobValidityReview": {
|
305
483
|
"$ref": "#/definitions/JobValidityReview"
|
484
|
+
},
|
485
|
+
"jobApplication": {
|
486
|
+
"$ref": "#/definitions/JobApplication"
|
306
487
|
}
|
307
488
|
}
|
308
489
|
}
|