swoop-common 2.0.36 → 2.0.38

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.
@@ -19,20 +19,67 @@ export declare const FORM_BUILDER_JSON_SCHEMA: {
19
19
  fields: {
20
20
  type: string;
21
21
  items: {
22
- allOf: ({
23
- $ref: string;
24
- type?: undefined;
25
- required?: undefined;
26
- } | {
27
- type: string;
28
- required: string[];
29
- $ref?: undefined;
30
- })[];
22
+ $ref: string;
31
23
  };
32
24
  };
33
25
  };
34
26
  required: string[];
35
27
  $defs: {
28
+ topLevelFieldDefinition: {
29
+ type: string;
30
+ properties: {
31
+ fieldType: {
32
+ oneOf: {
33
+ const: string;
34
+ title: string;
35
+ }[];
36
+ };
37
+ name: {
38
+ type: string;
39
+ minLength: number;
40
+ description: string;
41
+ };
42
+ description: {
43
+ type: string;
44
+ };
45
+ required: {
46
+ type: string;
47
+ default: boolean;
48
+ };
49
+ existsFrom: {
50
+ type: string;
51
+ oneOf: {
52
+ title: string;
53
+ const: string;
54
+ }[];
55
+ };
56
+ editableIn: {
57
+ type: string;
58
+ uniqueItems: boolean;
59
+ items: {
60
+ type: string;
61
+ oneOf: {
62
+ title: string;
63
+ const: string;
64
+ }[];
65
+ };
66
+ };
67
+ };
68
+ required: string[];
69
+ dependencies: {
70
+ fieldType: {
71
+ oneOf: {
72
+ "x-type": string;
73
+ properties: {
74
+ required?: string[] | undefined;
75
+ fieldType: {
76
+ const: string;
77
+ };
78
+ };
79
+ }[];
80
+ };
81
+ };
82
+ };
36
83
  fieldDefinition: {
37
84
  type: string;
38
85
  properties: {
@@ -64,7 +111,6 @@ export declare const FORM_BUILDER_JSON_SCHEMA: {
64
111
  editableIn: {
65
112
  type: string;
66
113
  uniqueItems: boolean;
67
- minItems: number;
68
114
  items: {
69
115
  type: string;
70
116
  oneOf: {
@@ -23,19 +23,40 @@ export const FORM_BUILDER_JSON_SCHEMA = {
23
23
  },
24
24
  fields: {
25
25
  type: "array",
26
- items: {
27
- allOf: [
28
- { $ref: "#/$defs/fieldDefinition" },
29
- {
30
- type: "object",
31
- required: ["editableIn", "existsFrom"],
32
- }
33
- ]
34
- }
26
+ items: { $ref: "#/$defs/topLevelFieldDefinition" },
35
27
  },
36
28
  },
37
29
  required: ["name", "fields"],
38
30
  $defs: {
31
+ topLevelFieldDefinition: {
32
+ type: "object",
33
+ properties: Object.assign({ fieldType: {
34
+ oneOf: fieldsToConst
35
+ }, name: {
36
+ type: "string",
37
+ minLength: 1,
38
+ description: "Field name (used for both label and ID generation)",
39
+ }, description: { type: "string" }, required: { type: "boolean", default: false }, existsFrom: {
40
+ "type": "string",
41
+ "oneOf": Object.keys(Stage).filter((k) => isNaN(+k)).map(s => ({ title: s, const: Stage[s] + "" }))
42
+ }, editableIn: {
43
+ type: "array",
44
+ uniqueItems: true,
45
+ items: {
46
+ type: "string",
47
+ oneOf: Object.keys(Stage).filter((k) => isNaN(+k)).map(s => ({
48
+ title: s,
49
+ const: Stage[s] + ""
50
+ }))
51
+ }
52
+ } }, fieldsToOptionsRecord),
53
+ required: ["fieldType", "name", "existsFrom", "editableIn"],
54
+ dependencies: {
55
+ fieldType: {
56
+ oneOf: fieldsToTypeDef
57
+ },
58
+ },
59
+ },
39
60
  fieldDefinition: {
40
61
  type: "object",
41
62
  properties: Object.assign({ fieldType: {
@@ -50,7 +71,6 @@ export const FORM_BUILDER_JSON_SCHEMA = {
50
71
  }, editableIn: {
51
72
  type: "array",
52
73
  uniqueItems: true,
53
- minItems: 1,
54
74
  items: {
55
75
  type: "string",
56
76
  oneOf: Object.keys(Stage).filter((k) => isNaN(+k)).map(s => ({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "swoop-common",
3
- "version": "2.0.36",
3
+ "version": "2.0.38",
4
4
  "main": "dist/api/index.js",
5
5
  "types": "dist/api/index.d.ts",
6
6
  "exports": {