@dev-crew-berlin/enter-js-utils 0.17.0 → 0.18.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.
@@ -11,10 +11,10 @@ export declare class FieldGroups {
11
11
  getLabelForField(fieldKey: string, language: string): string;
12
12
  }
13
13
  export declare const fieldGroup: import("fefe").Validator<import("fefe").ObjectResult<{
14
- title: import("fefe").Validator<string | Dictionary<string>, import("fefe").FefeError> & {
14
+ title: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError> & {
15
15
  optional: true;
16
16
  };
17
- class: import("fefe").Validator<string, import("fefe").FefeError> & {
17
+ class: import("fefe").Validator<string | null, import("fefe").FefeError> & {
18
18
  optional: true;
19
19
  };
20
20
  questions: import("fefe").Validator<(import("fefe").ObjectResult<{
@@ -112,19 +112,19 @@ export declare const fieldGroup: import("fefe").Validator<import("fefe").ObjectR
112
112
  class: import("fefe").Validator<string | null, import("fefe").FefeError>;
113
113
  type: import("fefe").Validator<"dropdown", import("fefe").LeafError>;
114
114
  }>)[], import("fefe").FefeError>;
115
- info: import("fefe").Validator<string | Dictionary<string>, import("fefe").FefeError> & {
115
+ info: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError> & {
116
116
  optional: true;
117
117
  };
118
- if: import("fefe").Validator<string, import("fefe").FefeError> & {
118
+ if: import("fefe").Validator<string | null, import("fefe").FefeError> & {
119
119
  optional: true;
120
120
  };
121
121
  isMetaGroup: import("fefe").Validator<boolean, import("fefe").LeafError>;
122
122
  }>, import("fefe").FefeError>;
123
123
  declare const rawFieldGroupList: import("fefe").Validator<import("fefe").ObjectResult<{
124
- title: import("fefe").Validator<string | Dictionary<string>, import("fefe").FefeError> & {
124
+ title: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError> & {
125
125
  optional: true;
126
126
  };
127
- class: import("fefe").Validator<string, import("fefe").FefeError> & {
127
+ class: import("fefe").Validator<string | null, import("fefe").FefeError> & {
128
128
  optional: true;
129
129
  };
130
130
  questions: import("fefe").Validator<(import("fefe").ObjectResult<{
@@ -222,19 +222,19 @@ declare const rawFieldGroupList: import("fefe").Validator<import("fefe").ObjectR
222
222
  class: import("fefe").Validator<string | null, import("fefe").FefeError>;
223
223
  type: import("fefe").Validator<"dropdown", import("fefe").LeafError>;
224
224
  }>)[], import("fefe").FefeError>;
225
- info: import("fefe").Validator<string | Dictionary<string>, import("fefe").FefeError> & {
225
+ info: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError> & {
226
226
  optional: true;
227
227
  };
228
- if: import("fefe").Validator<string, import("fefe").FefeError> & {
228
+ if: import("fefe").Validator<string | null, import("fefe").FefeError> & {
229
229
  optional: true;
230
230
  };
231
231
  isMetaGroup: import("fefe").Validator<boolean, import("fefe").LeafError>;
232
232
  }>[], import("fefe").FefeError>;
233
233
  export declare const parseFieldGroup: import("../lib").APIValidator<import("fefe").ObjectResult<{
234
- title: import("fefe").Validator<string | Dictionary<string>, import("fefe").FefeError> & {
234
+ title: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError> & {
235
235
  optional: true;
236
236
  };
237
- class: import("fefe").Validator<string, import("fefe").FefeError> & {
237
+ class: import("fefe").Validator<string | null, import("fefe").FefeError> & {
238
238
  optional: true;
239
239
  };
240
240
  questions: import("fefe").Validator<(import("fefe").ObjectResult<{
@@ -332,19 +332,19 @@ export declare const parseFieldGroup: import("../lib").APIValidator<import("fefe
332
332
  class: import("fefe").Validator<string | null, import("fefe").FefeError>;
333
333
  type: import("fefe").Validator<"dropdown", import("fefe").LeafError>;
334
334
  }>)[], import("fefe").FefeError>;
335
- info: import("fefe").Validator<string | Dictionary<string>, import("fefe").FefeError> & {
335
+ info: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError> & {
336
336
  optional: true;
337
337
  };
338
- if: import("fefe").Validator<string, import("fefe").FefeError> & {
338
+ if: import("fefe").Validator<string | null, import("fefe").FefeError> & {
339
339
  optional: true;
340
340
  };
341
341
  isMetaGroup: import("fefe").Validator<boolean, import("fefe").LeafError>;
342
342
  }>>;
343
343
  export declare const parseRawFieldGroupList: import("../lib").APIValidator<import("fefe").ObjectResult<{
344
- title: import("fefe").Validator<string | Dictionary<string>, import("fefe").FefeError> & {
344
+ title: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError> & {
345
345
  optional: true;
346
346
  };
347
- class: import("fefe").Validator<string, import("fefe").FefeError> & {
347
+ class: import("fefe").Validator<string | null, import("fefe").FefeError> & {
348
348
  optional: true;
349
349
  };
350
350
  questions: import("fefe").Validator<(import("fefe").ObjectResult<{
@@ -442,10 +442,10 @@ export declare const parseRawFieldGroupList: import("../lib").APIValidator<impor
442
442
  class: import("fefe").Validator<string | null, import("fefe").FefeError>;
443
443
  type: import("fefe").Validator<"dropdown", import("fefe").LeafError>;
444
444
  }>)[], import("fefe").FefeError>;
445
- info: import("fefe").Validator<string | Dictionary<string>, import("fefe").FefeError> & {
445
+ info: import("fefe").Validator<string | Dictionary<string> | null, import("fefe").FefeError> & {
446
446
  optional: true;
447
447
  };
448
- if: import("fefe").Validator<string, import("fefe").FefeError> & {
448
+ if: import("fefe").Validator<string | null, import("fefe").FefeError> & {
449
449
  optional: true;
450
450
  };
451
451
  isMetaGroup: import("fefe").Validator<boolean, import("fefe").LeafError>;
@@ -1,7 +1,7 @@
1
1
  import { array, object, string, optional, union, boolean } from 'fefe';
2
2
  import { apiValidator, success } from '../lib';
3
3
  import { field } from './field';
4
- import { dictionary } from './_helpers';
4
+ import { dictionary, maybe } from './_helpers';
5
5
  export class FieldGroups {
6
6
  constructor(rawFieldGroupList) {
7
7
  this.groups = rawFieldGroupList;
@@ -28,11 +28,11 @@ export class FieldGroups {
28
28
 
29
29
  }
30
30
  export const fieldGroup = object({
31
- title: optional(union(string(), dictionary(string()))),
32
- class: optional(string()),
31
+ title: optional(maybe(union(string(), dictionary(string())))),
32
+ class: optional(maybe(string())),
33
33
  questions: array(field),
34
- info: optional(union(string(), dictionary(string()))),
35
- if: optional(string()),
34
+ info: optional(maybe(union(string(), dictionary(string())))),
35
+ if: optional(maybe(string())),
36
36
  isMetaGroup: boolean()
37
37
  }, {
38
38
  allowExcessProperties: true
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dev-crew-berlin/enter-js-utils",
3
- "version": "0.17.0",
3
+ "version": "0.18.0",
4
4
  "description": "utils such as vaildation and other helpers to work with data from the enter app",
5
5
  "files": [
6
6
  "dist",