@laboratoria/sdk-js 2.0.0-alpha.1 → 2.0.0-alpha.4

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
@@ -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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@laboratoria/sdk-js",
3
- "version": "2.0.0-alpha.1",
3
+ "version": "2.0.0-alpha.4",
4
4
  "description": "Laboratoria JavaScript (browser) SDK",
5
5
  "scripts": {
6
6
  "test": "jest --verbose --coverage",
@@ -9,14 +9,15 @@
9
9
  "license": "MIT",
10
10
  "dependencies": {
11
11
  "blueimp-md5": "^2.19.0",
12
- "firebase": "^9.6.10"
12
+ "firebase": "^9.8.2"
13
13
  },
14
14
  "devDependencies": {
15
- "@babel/core": "^7.17.8",
16
- "@babel/plugin-transform-modules-commonjs": "^7.17.7",
17
- "babel-jest": "^27.5.1",
18
- "jest": "^27.5.1",
19
- "webpack": "^5.70.0",
15
+ "@babel/core": "^7.18.2",
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",
20
+ "webpack": "^5.73.0",
20
21
  "webpack-cli": "^4.9.2"
21
22
  },
22
23
  "jest": {
package/schemas/core.json CHANGED
@@ -335,6 +335,17 @@
335
335
  "null"
336
336
  ]
337
337
  },
338
+ "lang": {
339
+ "type": [
340
+ "string",
341
+ "null"
342
+ ],
343
+ "enum": [
344
+ "en",
345
+ "es",
346
+ "pt"
347
+ ]
348
+ },
338
349
  "name": {
339
350
  "type": "string"
340
351
  },
@@ -562,7 +573,10 @@
562
573
  ]
563
574
  },
564
575
  "status": {
565
- "type": "string",
576
+ "type": [
577
+ "string",
578
+ "null"
579
+ ],
566
580
  "enum": [
567
581
  "started",
568
582
  "exercisesCompleted",
@@ -626,6 +640,15 @@
626
640
  "type": "null"
627
641
  }
628
642
  ]
643
+ },
644
+ "income": {
645
+ "type": "integer"
646
+ },
647
+ "personalReason": {
648
+ "type": "string"
649
+ },
650
+ "returningApplicant": {
651
+ "type": "boolean"
629
652
  }
630
653
  }
631
654
  },