@laboratoria/sdk-js 2.0.0-alpha.0 → 2.0.0-alpha.3

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/index.js CHANGED
@@ -4,6 +4,7 @@ import {
4
4
  onAuthStateChanged,
5
5
  signInWithEmailAndPassword,
6
6
  signOut,
7
+ sendPasswordResetEmail,
7
8
  } from 'firebase/auth';
8
9
  import { createAPI as createCoreAPI } from './lib/core';
9
10
  import { createAPI as createCurriculumAPI } from './lib/curriculum';
@@ -52,6 +53,7 @@ export const createApp = ({
52
53
  password,
53
54
  ),
54
55
  signOut: () => signOut(firebaseAuth),
56
+ sendPasswordResetEmail: email => sendPasswordResetEmail(firebaseAuth, email),
55
57
  };
56
58
 
57
59
  return {
package/lib/client.js CHANGED
@@ -14,8 +14,9 @@ export const createClient = (baseUrl, authUser) => async (url, opts = {}) => {
14
14
  const body = await resp.json();
15
15
 
16
16
  if (resp.status > 202) {
17
- throw Object.assign(new Error(`HTTP Error ${resp.status}`), {
17
+ throw Object.assign(new Error(body?.message || `HTTP Error ${resp.status}`), {
18
18
  status: resp.status,
19
+ code: body?.code,
19
20
  body,
20
21
  });
21
22
  }
package/lib/core.js CHANGED
@@ -71,7 +71,9 @@ const extended = {
71
71
  'name',
72
72
  'start',
73
73
  'end',
74
- 'legacySlug',
74
+ 'vacancies',
75
+ 'placementStart',
76
+ 'placementDuration',
75
77
  ],
76
78
  searchProps: ['name'],
77
79
  getOptionLabel: ({ id, name, stage }) => (
@@ -80,7 +82,7 @@ const extended = {
80
82
  properties: {},
81
83
  parse: (props) => {
82
84
  const now = Date.now();
83
- // TODO: Handle case where start and/or end have not been selected in query
85
+ // TODO: Handle case where start and/or end have not been selected in query
84
86
  const status = (
85
87
  props.start > now
86
88
  ? 'upcoming'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@laboratoria/sdk-js",
3
- "version": "2.0.0-alpha.0",
3
+ "version": "2.0.0-alpha.3",
4
4
  "description": "Laboratoria JavaScript (browser) SDK",
5
5
  "scripts": {
6
6
  "test": "jest --verbose --coverage",
@@ -30,4 +30,4 @@
30
30
  }
31
31
  }
32
32
  }
33
- }
33
+ }
package/schemas/core.json CHANGED
@@ -120,7 +120,7 @@
120
120
  ],
121
121
  "enum": [
122
122
  "student",
123
- "internship",
123
+ "intern",
124
124
  "unemployed",
125
125
  "fulltime",
126
126
  "partime",
@@ -365,6 +365,10 @@
365
365
  "null"
366
366
  ]
367
367
  },
368
+ "publicAdmission": {
369
+ "type": "boolean",
370
+ "default": false
371
+ },
368
372
  "program": {
369
373
  "$ref": "#/definitions/Program"
370
374
  },
@@ -562,7 +566,10 @@
562
566
  ]
563
567
  },
564
568
  "status": {
565
- "type": "string",
569
+ "type": [
570
+ "string",
571
+ "null"
572
+ ],
566
573
  "enum": [
567
574
  "started",
568
575
  "exercisesCompleted",
@@ -580,7 +587,7 @@
580
587
  ],
581
588
  "enum": [
582
589
  "student",
583
- "internship",
590
+ "intern",
584
591
  "unemployed",
585
592
  "fulltime",
586
593
  "partime",