@docupace/ihub-config 1.1.22 → 1.1.23
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/dist/model/graphs/config/fields.graphql +23 -8
- package/dist/model/graphs/config/rules.graphql +2 -2
- package/dist/types/graphql.d.ts +24 -24
- package/dist/types/graphql.d.ts.map +1 -1
- package/model/graphs/config/fields.graphql +23 -8
- package/model/graphs/config/rules.graphql +2 -2
- package/package.json +17 -19
|
@@ -32,6 +32,8 @@ interface IDateRangeField {
|
|
|
32
32
|
excludeFromQueryInput: Boolean
|
|
33
33
|
visibilityCondition: String
|
|
34
34
|
disabledCondition: String
|
|
35
|
+
validation: GenericFieldValidation
|
|
36
|
+
|
|
35
37
|
}
|
|
36
38
|
|
|
37
39
|
type InputField implements IField & IRowElement & IElement {
|
|
@@ -116,7 +118,7 @@ type PhoneField implements IField & IRowElement & IElement {
|
|
|
116
118
|
excludeFromQueryInput: Boolean
|
|
117
119
|
visibilityCondition: String
|
|
118
120
|
disabledCondition: String
|
|
119
|
-
validation:
|
|
121
|
+
validation: GenericFieldValidation
|
|
120
122
|
}
|
|
121
123
|
|
|
122
124
|
type DateField implements IField & IRowElement & IElement {
|
|
@@ -135,7 +137,7 @@ type DateField implements IField & IRowElement & IElement {
|
|
|
135
137
|
disabledCondition: String
|
|
136
138
|
minDate: String # e.q. "now" or "2025-03-20"
|
|
137
139
|
maxDate: String # e.q. "now" or "2025-03-20"
|
|
138
|
-
validation:
|
|
140
|
+
validation: GenericFieldValidation
|
|
139
141
|
}
|
|
140
142
|
|
|
141
143
|
type DateRangeField implements IDateRangeField & IRowElement & IElement {
|
|
@@ -154,6 +156,7 @@ type DateRangeField implements IDateRangeField & IRowElement & IElement {
|
|
|
154
156
|
excludeFromQueryInput: Boolean
|
|
155
157
|
visibilityCondition: String
|
|
156
158
|
disabledCondition: String
|
|
159
|
+
validation: GenericFieldValidation
|
|
157
160
|
}
|
|
158
161
|
|
|
159
162
|
type SelectField implements IField & IRowElement & IElement {
|
|
@@ -178,7 +181,7 @@ type SelectField implements IField & IRowElement & IElement {
|
|
|
178
181
|
excludeId: Boolean
|
|
179
182
|
helperText: String
|
|
180
183
|
autoSelectSingleOption: Boolean
|
|
181
|
-
validation:
|
|
184
|
+
validation: GenericFieldValidation
|
|
182
185
|
}
|
|
183
186
|
|
|
184
187
|
type ToggleField implements IField & IRowElement & IElement {
|
|
@@ -200,7 +203,7 @@ type ToggleField implements IField & IRowElement & IElement {
|
|
|
200
203
|
visibilityCondition: String
|
|
201
204
|
disabledCondition: String
|
|
202
205
|
linkedFields: [String!]
|
|
203
|
-
validation:
|
|
206
|
+
validation: GenericFieldValidation
|
|
204
207
|
}
|
|
205
208
|
|
|
206
209
|
type BooleanField implements IField & IRowElement & IElement {
|
|
@@ -218,7 +221,7 @@ type BooleanField implements IField & IRowElement & IElement {
|
|
|
218
221
|
visibilityCondition: String
|
|
219
222
|
disabledCondition: String
|
|
220
223
|
linkedFields: [String!]
|
|
221
|
-
validation:
|
|
224
|
+
validation: GenericFieldValidation
|
|
222
225
|
}
|
|
223
226
|
|
|
224
227
|
type ChipSelectWithInputField implements IField & IRowElement & IElement {
|
|
@@ -262,7 +265,7 @@ type CustomField implements IField & IRowElement & IElement {
|
|
|
262
265
|
excludeFromQueryInput: Boolean
|
|
263
266
|
visibilityCondition: String
|
|
264
267
|
disabledCondition: String
|
|
265
|
-
validation:
|
|
268
|
+
validation: GenericFieldValidation
|
|
266
269
|
}
|
|
267
270
|
|
|
268
271
|
type StatusChipField implements IField & IRowElement & IElement {
|
|
@@ -271,7 +274,7 @@ type StatusChipField implements IField & IRowElement & IElement {
|
|
|
271
274
|
label: String
|
|
272
275
|
name: String!
|
|
273
276
|
path: String!
|
|
274
|
-
validation:
|
|
277
|
+
validation: GenericFieldValidation
|
|
275
278
|
}
|
|
276
279
|
|
|
277
280
|
type CheckboxGroupValue {
|
|
@@ -299,9 +302,19 @@ enum FieldValueType {
|
|
|
299
302
|
Float
|
|
300
303
|
}
|
|
301
304
|
|
|
302
|
-
type
|
|
305
|
+
type GenericFieldValidation {
|
|
306
|
+
custom : CustomFieldValidation
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
type CustomFieldValidation {
|
|
303
310
|
expression: String
|
|
304
311
|
message: String
|
|
312
|
+
"""
|
|
313
|
+
Paths of other fields this expression reads. When one of these fields changes, this
|
|
314
|
+
field's validation is re-triggered so its error state stays in sync without requiring
|
|
315
|
+
the user to re-touch this field directly.
|
|
316
|
+
"""
|
|
317
|
+
dependentPaths: [String!]
|
|
305
318
|
}
|
|
306
319
|
|
|
307
320
|
type StringValidationRule {
|
|
@@ -333,11 +346,13 @@ type InputValidation {
|
|
|
333
346
|
format: [FormatValidationRule!]
|
|
334
347
|
min: FloatValidationRule
|
|
335
348
|
max: FloatValidationRule
|
|
349
|
+
custom: CustomFieldValidation
|
|
336
350
|
}
|
|
337
351
|
|
|
338
352
|
type ChipSelectValidation {
|
|
339
353
|
compatibleWith: CompatibleWithRule
|
|
340
354
|
uniqueInList: UniqueInListRule
|
|
355
|
+
custom : CustomFieldValidation
|
|
341
356
|
}
|
|
342
357
|
|
|
343
358
|
type CompatibleWithRule {
|
|
@@ -56,7 +56,7 @@ type ListFieldRule implements IFieldRule {
|
|
|
56
56
|
requiredCondition: String
|
|
57
57
|
availabilityCondition: String # maps to visibilityCondition on UI
|
|
58
58
|
validationRules: [ListFieldValidationRule!]
|
|
59
|
-
validation:
|
|
59
|
+
validation: GenericFieldValidation
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
type ListFieldValidationRule {
|
|
@@ -100,5 +100,5 @@ type DateFieldRule implements IFieldRule {
|
|
|
100
100
|
availabilityCondition: String # maps to visibilityCondition on UI
|
|
101
101
|
minDate: String # e.q. "now" or "2025-03-20"
|
|
102
102
|
maxDate: String # e.q. "now" or "2025-03-20"
|
|
103
|
-
validation:
|
|
103
|
+
validation: GenericFieldValidation
|
|
104
104
|
}
|
package/package.json
CHANGED
|
@@ -1,25 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docupace/ihub-config",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.23",
|
|
4
4
|
"description": "Reusable config GraphQL extension and standalone server",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"type": "module",
|
|
7
|
-
"scripts": {
|
|
8
|
-
"test": "jest",
|
|
9
|
-
"test:coverage": "jest --coverage",
|
|
10
|
-
"start:dev": "cross-env NODE_ENV=development tsx watch --clear-screen --no-cache src/server.ts --log-level debug | pino-pretty",
|
|
11
|
-
"start": "node dist/server.js",
|
|
12
|
-
"build:code": "tsc -p tsconfig.json",
|
|
13
|
-
"build:assets": "cpx \"model/**/*.yaml\" ./dist/model && cpx \"model/**/*.graphql\" ./dist/model",
|
|
14
|
-
"build": "rimraf dist && pnpm lint && pnpm build:code && pnpm build:assets",
|
|
15
|
-
"watch": "tsc -p tsconfig.json --watch",
|
|
16
|
-
"start:build": "rimraf dist && pnpm build:esm && pnpm build:assets && node dist/server.js",
|
|
17
|
-
"codegen": "graphql-codegen --config codegen.ts",
|
|
18
|
-
"lint": "eslint \"src/**/*.{js,jsx,ts,tsx}\" \"tests/**/*.{js,jsx,ts,tsx}\"",
|
|
19
|
-
"lint:fix": "eslint --fix \"src/**/*.{js,jsx,ts,tsx}\" \"tests/**/*.{js,jsx,ts,tsx}\"",
|
|
20
|
-
"prepublishOnly": "pnpm build && pnpm test",
|
|
21
|
-
"sonar": "bash sonar.sh"
|
|
22
|
-
},
|
|
23
7
|
"keywords": [
|
|
24
8
|
"graphql",
|
|
25
9
|
"config",
|
|
@@ -67,7 +51,6 @@
|
|
|
67
51
|
"tsx": "^4.11.2",
|
|
68
52
|
"typescript": "^5.3.3"
|
|
69
53
|
},
|
|
70
|
-
"packageManager": "pnpm@10.30.3",
|
|
71
54
|
"types": "dist/index.d.ts",
|
|
72
55
|
"files": [
|
|
73
56
|
"dist",
|
|
@@ -77,5 +60,20 @@
|
|
|
77
60
|
],
|
|
78
61
|
"imports": {
|
|
79
62
|
"#module-format": "./dist/lib/module-format.esm.js"
|
|
63
|
+
},
|
|
64
|
+
"scripts": {
|
|
65
|
+
"test": "jest",
|
|
66
|
+
"test:coverage": "jest --coverage",
|
|
67
|
+
"start:dev": "cross-env NODE_ENV=development tsx watch --clear-screen --no-cache src/server.ts --log-level debug | pino-pretty",
|
|
68
|
+
"start": "node dist/server.js",
|
|
69
|
+
"build:code": "tsc -p tsconfig.json",
|
|
70
|
+
"build:assets": "cpx \"model/**/*.yaml\" ./dist/model && cpx \"model/**/*.graphql\" ./dist/model",
|
|
71
|
+
"build": "rimraf dist && pnpm lint && pnpm build:code && pnpm build:assets",
|
|
72
|
+
"watch": "tsc -p tsconfig.json --watch",
|
|
73
|
+
"start:build": "rimraf dist && pnpm build:esm && pnpm build:assets && node dist/server.js",
|
|
74
|
+
"codegen": "graphql-codegen --config codegen.ts",
|
|
75
|
+
"lint": "eslint \"src/**/*.{js,jsx,ts,tsx}\" \"tests/**/*.{js,jsx,ts,tsx}\"",
|
|
76
|
+
"lint:fix": "eslint --fix \"src/**/*.{js,jsx,ts,tsx}\" \"tests/**/*.{js,jsx,ts,tsx}\"",
|
|
77
|
+
"sonar": "bash sonar.sh"
|
|
80
78
|
}
|
|
81
|
-
}
|
|
79
|
+
}
|