@laboratoria/sdk-js 3.0.0-alpha.0 → 3.0.0-beta.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
@@ -1,5 +1,6 @@
1
1
  import md5 from 'blueimp-md5';
2
2
  import { createModels, extendSchemaDefinitions } from './model';
3
+ import { createClient } from './client.js';
3
4
  import schema from '../schemas/core.json';
4
5
 
5
6
  const extended = {
@@ -167,25 +168,26 @@ const extended = {
167
168
  Application: {
168
169
  inputProps: [
169
170
  'user',
170
- 'dateOfBirth',
171
171
  'cohort',
172
+ 'dateOfBirth',
172
173
  'country',
173
- 'city',
174
+ 'locality',
174
175
  'nationality',
176
+ 'isAllowedToWork',
175
177
  'householdSize',
176
178
  'children',
179
+ 'householdIncome',
177
180
  'educationLevel',
178
181
  'educationSubject',
179
182
  'isStudying',
180
183
  'isDegreeFromListedInstitutions',
181
- 'hasWorked',
184
+ 'workStatus',
185
+ 'isLookingForWork',
186
+ 'monthsLookingForWork',
182
187
  'workRole',
183
188
  'freelance',
184
189
  'workFormal',
185
- 'hadBenefits',
186
190
  'workIncome',
187
- 'householdIncome',
188
- 'isAllowedToWork',
189
191
  // 'isReturningApplicant',
190
192
  // 'legacyAdmissionCohortSlug',
191
193
  ],
@@ -207,7 +209,15 @@ const extended = {
207
209
  },
208
210
  };
209
211
 
210
- export const createAPI = (url, state) => createModels(url, state, {
211
- ...schema,
212
- definitions: extendSchemaDefinitions(schema, extended),
212
+ export const createAPI = (url, state) => ({
213
+ ...createModels(url, state, {
214
+ ...schema,
215
+ definitions: extendSchemaDefinitions(schema, extended),
216
+ }),
217
+ gcpLog: {
218
+ getEntries: async (q) => {
219
+ const req = createClient(url, state.authUser);
220
+ return await req(`/gcp-logs?q=${JSON.stringify(q)}`);
221
+ },
222
+ },
213
223
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@laboratoria/sdk-js",
3
- "version": "3.0.0-alpha.0",
3
+ "version": "3.0.0-beta.0",
4
4
  "description": "Laboratoria JavaScript (browser) SDK",
5
5
  "license": "MIT",
6
6
  "scripts": {
@@ -11,16 +11,16 @@
11
11
  },
12
12
  "dependencies": {
13
13
  "blueimp-md5": "^2.19.0",
14
- "firebase": "^9.14.0"
14
+ "firebase": "^9.15.0"
15
15
  },
16
16
  "devDependencies": {
17
- "@babel/core": "^7.20.2",
17
+ "@babel/core": "^7.20.5",
18
18
  "@babel/plugin-transform-modules-commonjs": "^7.19.6",
19
19
  "babel-jest": "^29.3.1",
20
20
  "jest": "^29.3.1",
21
21
  "jest-environment-jsdom": "^29.3.1",
22
22
  "webpack": "^5.75.0",
23
- "webpack-cli": "^4.10.0"
23
+ "webpack-cli": "^5.0.1"
24
24
  },
25
25
  "jest": {
26
26
  "testEnvironment": "jsdom",
package/schemas/core.json CHANGED
@@ -669,12 +669,19 @@
669
669
  "type": "string",
670
670
  "format": "date-time"
671
671
  },
672
- "city": {
673
- "type": "string"
674
- },
675
672
  "isAllowedToWork": {
676
673
  "type": "boolean"
677
674
  },
675
+ "locality": {
676
+ "type": [
677
+ "number",
678
+ "string",
679
+ "boolean",
680
+ "object",
681
+ "array",
682
+ "null"
683
+ ]
684
+ },
678
685
  "householdSize": {
679
686
  "type": "integer"
680
687
  },
@@ -685,7 +692,28 @@
685
692
  "type": "integer"
686
693
  },
687
694
  "educationSubject": {
688
- "type": "string"
695
+ "type": [
696
+ "string",
697
+ "null"
698
+ ],
699
+ "enum": [
700
+ "design_and_media",
701
+ "software_engineering",
702
+ "engineering",
703
+ "management_and_business",
704
+ "languages",
705
+ "science",
706
+ "health",
707
+ "social_sciences",
708
+ "arts",
709
+ "comms_and_advertising",
710
+ "education",
711
+ "cooking",
712
+ "tourism",
713
+ "economics_and_accounting",
714
+ "law",
715
+ "other"
716
+ ]
689
717
  },
690
718
  "isStudying": {
691
719
  "type": "boolean"
@@ -693,28 +721,55 @@
693
721
  "isDegreeFromListedInstitutions": {
694
722
  "type": "boolean"
695
723
  },
696
- "hasWorked": {
697
- "type": "boolean"
724
+ "workStatus": {
725
+ "type": "string",
726
+ "enum": [
727
+ "never",
728
+ "not_now",
729
+ "yes"
730
+ ]
698
731
  },
699
- "workRole": {
732
+ "isLookingForWork": {
700
733
  "type": [
701
- "string",
734
+ "boolean",
702
735
  "null"
703
736
  ]
704
737
  },
705
- "freelance": {
738
+ "monthsLookingForWork": {
706
739
  "type": [
707
- "boolean",
740
+ "integer",
708
741
  "null"
709
742
  ]
710
743
  },
711
- "workFormal": {
744
+ "workRole": {
745
+ "type": [
746
+ "string",
747
+ "null"
748
+ ],
749
+ "enum": [
750
+ "waitress",
751
+ "promoter",
752
+ "manager",
753
+ "cashier",
754
+ "intern",
755
+ "operative",
756
+ "call_center",
757
+ "receptionist",
758
+ "sales_agent",
759
+ "assistant",
760
+ "professional",
761
+ "technical",
762
+ "consultant",
763
+ "other"
764
+ ]
765
+ },
766
+ "freelance": {
712
767
  "type": [
713
768
  "boolean",
714
769
  "null"
715
770
  ]
716
771
  },
717
- "hadBenefits": {
772
+ "workFormal": {
718
773
  "type": [
719
774
  "boolean",
720
775
  "null"