@laboratoria/sdk-js 2.0.0-alpha.4 → 2.1.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 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',
@@ -162,11 +162,11 @@ const extended = {
162
162
  inputProps: [
163
163
  'cohort',
164
164
  'user',
165
- 'status',
166
- 'workStatus',
167
- 'educationStatus',
168
- 'phone',
169
- 'countryOfResidence',
165
+ // 'status',
166
+ // 'workStatus',
167
+ // 'educationStatus',
168
+ // 'phone',
169
+ // 'countryOfResidence',
170
170
  ],
171
171
  },
172
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 createBuildURL = collectionName => (id, q) => {
102
- return `/${collectionName}${id ? `/${encodeURIComponent(id)}` : ''}${qToQs(q)}`;
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-alpha.4",
3
+ "version": "2.1.0",
4
4
  "description": "Laboratoria JavaScript (browser) SDK",
5
5
  "scripts": {
6
6
  "test": "jest --verbose --coverage",
@@ -9,25 +9,25 @@
9
9
  "license": "MIT",
10
10
  "dependencies": {
11
11
  "blueimp-md5": "^2.19.0",
12
- "firebase": "^9.8.2"
12
+ "firebase": "^9.8.3"
13
13
  },
14
14
  "devDependencies": {
15
- "@babel/core": "^7.18.2",
15
+ "@babel/core": "^7.18.5",
16
16
  "@babel/plugin-transform-modules-commonjs": "^7.18.2",
17
- "babel-jest": "^28.1.0",
18
- "jest": "^28.1.0",
19
- "jest-environment-jsdom": "^28.1.0",
17
+ "babel-jest": "^28.1.1",
18
+ "jest": "^28.1.1",
19
+ "jest-environment-jsdom": "^28.1.1",
20
20
  "webpack": "^5.73.0",
21
- "webpack-cli": "^4.9.2"
21
+ "webpack-cli": "^4.10.0"
22
22
  },
23
23
  "jest": {
24
24
  "testEnvironment": "jsdom",
25
25
  "coverageThreshold": {
26
26
  "global": {
27
- "statements": 96.9,
27
+ "statements": 97,
28
28
  "branches": 94,
29
- "functions": 98,
30
- "lines": 96.7
29
+ "functions": 100,
30
+ "lines": 97
31
31
  }
32
32
  }
33
33
  }
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": {
@@ -197,25 +141,11 @@
197
141
  "$ref": "#/definitions/Application"
198
142
  }
199
143
  },
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
- ]
144
+ "messages": {
145
+ "type": "array",
146
+ "items": {
147
+ "$ref": "#/definitions/Message"
148
+ }
219
149
  }
220
150
  }
221
151
  },
@@ -572,83 +502,11 @@
572
502
  "null"
573
503
  ]
574
504
  },
575
- "status": {
576
- "type": [
577
- "string",
578
- "null"
579
- ],
580
- "enum": [
581
- "started",
582
- "exercisesCompleted",
583
- "projectCompleted",
584
- "interviewScheduled",
585
- "interviewed",
586
- "admitted",
587
- "rejected"
588
- ]
589
- },
590
- "workStatus": {
591
- "type": [
592
- "string",
593
- "null"
594
- ],
595
- "enum": [
596
- "student",
597
- "intern",
598
- "unemployed",
599
- "fulltime",
600
- "partime",
601
- "freelance",
602
- "selfemployed"
603
- ]
604
- },
605
- "educationStatus": {
606
- "type": [
607
- "string",
608
- "null"
609
- ],
610
- "enum": [
611
- "ISCED_0",
612
- "ISCED_1",
613
- "ISCED_2",
614
- "ISCED_3",
615
- "ISCED_4",
616
- "ISCED_5",
617
- "ISCED_6",
618
- "ISCED_7",
619
- "ISCED_8"
620
- ]
621
- },
622
- "phone": {
623
- "type": [
624
- "string",
625
- "null"
626
- ]
627
- },
628
505
  "user": {
629
506
  "$ref": "#/definitions/User"
630
507
  },
631
508
  "cohort": {
632
509
  "$ref": "#/definitions/Cohort"
633
- },
634
- "countryOfResidence": {
635
- "anyOf": [
636
- {
637
- "$ref": "#/definitions/Country"
638
- },
639
- {
640
- "type": "null"
641
- }
642
- ]
643
- },
644
- "income": {
645
- "type": "integer"
646
- },
647
- "personalReason": {
648
- "type": "string"
649
- },
650
- "returningApplicant": {
651
- "type": "boolean"
652
510
  }
653
511
  }
654
512
  },
@@ -781,6 +639,110 @@
781
639
  "$ref": "#/definitions/Cohort"
782
640
  }
783
641
  }
642
+ },
643
+ "Message": {
644
+ "type": "object",
645
+ "properties": {
646
+ "id": {
647
+ "type": "integer"
648
+ },
649
+ "createdAt": {
650
+ "type": "string",
651
+ "format": "date-time"
652
+ },
653
+ "updatedAt": {
654
+ "type": "string",
655
+ "format": "date-time"
656
+ },
657
+ "createdBy": {
658
+ "type": [
659
+ "string",
660
+ "null"
661
+ ]
662
+ },
663
+ "key": {
664
+ "type": "string"
665
+ },
666
+ "from": {
667
+ "type": "string"
668
+ },
669
+ "to": {
670
+ "type": "string"
671
+ },
672
+ "transport": {
673
+ "type": "string",
674
+ "enum": [
675
+ "mandrill"
676
+ ]
677
+ },
678
+ "status": {
679
+ "type": "string",
680
+ "default": "PENDING",
681
+ "enum": [
682
+ "PENDING",
683
+ "QUEUED",
684
+ "ERROR",
685
+ "SENT"
686
+ ]
687
+ },
688
+ "data": {
689
+ "type": [
690
+ "number",
691
+ "string",
692
+ "boolean",
693
+ "object",
694
+ "array",
695
+ "null"
696
+ ]
697
+ },
698
+ "taskInfo": {
699
+ "type": [
700
+ "number",
701
+ "string",
702
+ "boolean",
703
+ "object",
704
+ "array",
705
+ "null"
706
+ ]
707
+ },
708
+ "logs": {
709
+ "type": "array",
710
+ "items": {
711
+ "$ref": "#/definitions/MessageLog"
712
+ }
713
+ },
714
+ "user": {
715
+ "anyOf": [
716
+ {
717
+ "$ref": "#/definitions/User"
718
+ },
719
+ {
720
+ "type": "null"
721
+ }
722
+ ]
723
+ }
724
+ }
725
+ },
726
+ "MessageLog": {
727
+ "type": "object",
728
+ "properties": {
729
+ "id": {
730
+ "type": "integer"
731
+ },
732
+ "createdAt": {
733
+ "type": "string",
734
+ "format": "date-time"
735
+ },
736
+ "statusText": {
737
+ "type": [
738
+ "string",
739
+ "null"
740
+ ]
741
+ },
742
+ "message": {
743
+ "$ref": "#/definitions/Message"
744
+ }
745
+ }
784
746
  }
785
747
  },
786
748
  "type": "object",
@@ -820,6 +782,12 @@
820
782
  },
821
783
  "gig": {
822
784
  "$ref": "#/definitions/Gig"
785
+ },
786
+ "message": {
787
+ "$ref": "#/definitions/Message"
788
+ },
789
+ "messageLog": {
790
+ "$ref": "#/definitions/MessageLog"
823
791
  }
824
792
  }
825
793
  }
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
  }