@laboratoria/sdk-js 4.0.0-alpha.3 → 4.0.0-beta.1

Sign up to get free protection for your applications and to get access to all the features.
package/lib/model.js CHANGED
@@ -14,7 +14,7 @@ const createValidator = (schema) => {
14
14
  return;
15
15
  }
16
16
 
17
- return { id: 'required-validation-error' };
17
+ return { id: 'value-missing-validation-error' };
18
18
  }
19
19
 
20
20
  if (propSchema.enum) {
@@ -48,7 +48,7 @@ const createValidator = (schema) => {
48
48
  case 'string':
49
49
  default:
50
50
  if (propSchema.isRequired && !value) {
51
- return { id: 'required-validation-error' };
51
+ return { id: 'value-missing-validation-error' };
52
52
  }
53
53
  break;
54
54
  }
@@ -242,20 +242,17 @@ export const createModel = (
242
242
  const relations = Object.keys(properties || {}).reduce(
243
243
  (memo, key) => (
244
244
  properties[key].isRef && properties[key].isScalar && properties[key].isRequired
245
- // isRequiredOneToOneRelation(parsedSchema, key)
246
245
  ? Object.assign(memo, {
247
246
  all: memo.all.concat(key),
248
247
  oneToOne: memo.oneToOne.concat(key),
249
248
  requiredOneToOne: memo.requiredOneToOne.concat(key),
250
249
  })
251
- // : isOptionalOneToOneRelation(parsedSchema, key)
252
250
  : properties[key].isRef && properties[key].isScalar
253
251
  ? Object.assign(memo, {
254
252
  all: memo.all.concat(key),
255
253
  oneToOne: memo.oneToOne.concat(key),
256
254
  optionalOneToOne: memo.optionalOneToOne.concat(key),
257
255
  })
258
- // : isOneToManyRelation(parsedSchema, key)
259
256
  : properties[key].isRef
260
257
  ? Object.assign(memo, {
261
258
  all: memo.all.concat(key),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@laboratoria/sdk-js",
3
- "version": "4.0.0-alpha.3",
3
+ "version": "4.0.0-beta.1",
4
4
  "description": "Laboratoria JavaScript (browser) SDK",
5
5
  "license": "MIT",
6
6
  "scripts": {
@@ -14,7 +14,7 @@
14
14
  "firebase": "^9.17.1"
15
15
  },
16
16
  "devDependencies": {
17
- "@babel/core": "^7.20.12",
17
+ "@babel/core": "^7.21.0",
18
18
  "@babel/plugin-transform-modules-commonjs": "^7.20.11",
19
19
  "babel-jest": "^29.4.3",
20
20
  "jest": "^29.4.3",