@docupace/ihub-config 1.1.23 → 1.1.24-admin.1

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.
@@ -1 +1 @@
1
- {"version":3,"file":"graphql.js","sourceRoot":"","sources":["../../src/types/graphql.ts"],"names":[],"mappings":"AA4CA,MAAM,CAAN,IAAY,mBAIX;AAJD,WAAY,mBAAmB;IAC7B,4CAAqB,CAAA;IACrB,wCAAiB,CAAA;IACjB,yDAAkC,CAAA;AACpC,CAAC,EAJW,mBAAmB,KAAnB,mBAAmB,QAI9B;AA0dD,MAAM,CAAN,IAAY,cAGX;AAHD,WAAY,cAAc;IACxB,iCAAe,CAAA;IACf,6BAAW,CAAA;AACb,CAAC,EAHW,cAAc,KAAd,cAAc,QAGzB;AAkVD,MAAM,CAAN,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,wBAAW,CAAA;IACX,0BAAa,CAAA;AACf,CAAC,EAHW,SAAS,KAAT,SAAS,QAGpB;AA2ZD,MAAM,CAAN,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC5B,qCAAe,CAAA;IACf,yCAAmB,CAAA;AACrB,CAAC,EAHW,kBAAkB,KAAlB,kBAAkB,QAG7B;AAwBD,MAAM,CAAN,IAAY,mBAGX;AAHD,WAAY,mBAAmB;IAC7B,oCAAa,CAAA;IACb,sCAAe,CAAA;AACjB,CAAC,EAHW,mBAAmB,KAAnB,mBAAmB,QAG9B"}
1
+ {"version":3,"file":"graphql.js","sourceRoot":"","sources":["../../src/types/graphql.ts"],"names":[],"mappings":"AA4CA,MAAM,CAAN,IAAY,mBAIX;AAJD,WAAY,mBAAmB;IAC7B,4CAAqB,CAAA;IACrB,wCAAiB,CAAA;IACjB,yDAAkC,CAAA;AACpC,CAAC,EAJW,mBAAmB,KAAnB,mBAAmB,QAI9B;AAseD,MAAM,CAAN,IAAY,cAGX;AAHD,WAAY,cAAc;IACxB,iCAAe,CAAA;IACf,6BAAW,CAAA;AACb,CAAC,EAHW,cAAc,KAAd,cAAc,QAGzB;AAkVD,MAAM,CAAN,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,wBAAW,CAAA;IACX,0BAAa,CAAA;AACf,CAAC,EAHW,SAAS,KAAT,SAAS,QAGpB;AA2ZD,MAAM,CAAN,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC5B,qCAAe,CAAA;IACf,yCAAmB,CAAA;AACrB,CAAC,EAHW,kBAAkB,KAAlB,kBAAkB,QAG7B;AAwBD,MAAM,CAAN,IAAY,mBAGX;AAHD,WAAY,mBAAmB;IAC7B,oCAAa,CAAA;IACb,sCAAe,CAAA;AACjB,CAAC,EAHW,mBAAmB,KAAnB,mBAAmB,QAG9B"}
@@ -103,6 +103,36 @@ type ControlGroup implements IRowElement & IElement {
103
103
  fields: [Fields!]!
104
104
  }
105
105
 
106
+ # Renders the currently-linked records of a multi-valued reference attribute
107
+ # (`path`) as a table (`columns`, reusing Table's Column config), with a quick
108
+ # typeahead (`search`, reusing Table's SimpleSearch/QuerySelectOptions config)
109
+ # to find and add records of `dataType`, and a delete affordance per row.
110
+ # `rowMenuItems` (reusing Table's MenuItem config) adds further per-row actions,
111
+ # e.g. an `action: "details"` item with a `url` to navigate to that record's own
112
+ # details page.
113
+ type ReferenceTable implements IField & IRowElement & IElement {
114
+ cols: Int
115
+ defaultValue: String
116
+ disabledCondition: String
117
+ excludeFromQueryInput: Boolean
118
+ hidden: Boolean
119
+ label: String
120
+ name: String!
121
+ path: String!
122
+ readonly: Boolean
123
+ required: Boolean
124
+ requiredCondition: String
125
+ skipQuery: Boolean
126
+ visibilityCondition: String
127
+ dataType: String!
128
+ columns: [Column!]!
129
+ search: SimpleSearch
130
+ addLabel: String
131
+ confirmDelete: Boolean
132
+ maxRows: Int
133
+ rowMenuItems: [MenuItem!]
134
+ }
135
+
106
136
  type PhoneField implements IField & IRowElement & IElement {
107
137
  cols: Int
108
138
  defaultValue: String
@@ -25,6 +25,12 @@ type MenuItem implements IMenuItem {
25
25
  visibilityCondition: String
26
26
  disabledCondition: String
27
27
  config: JSON
28
+ """
29
+ Child menu items. When present, this item acts as a collapsible group
30
+ header rather than a navigable leaf (consumers should treat a MenuItem
31
+ with `items` and no `url` as a group).
32
+ """
33
+ items: [MenuItem!]
28
34
  }
29
35
 
30
36
  type ActionButton implements IMenuItem {
@@ -250,8 +250,15 @@ type Viewer {
250
250
  }
251
251
 
252
252
  type Breadcrumb {
253
- label: String!
253
+ label: String
254
254
  path: String
255
255
  isLabelExpression: Boolean
256
256
  isPathExpression: Boolean
257
+ """
258
+ Dot-notation paths (e.g. "name", "folder.title") to try, in order, against
259
+ the already-fetched page record to compute the breadcrumb label. Used only
260
+ when `isLabelExpression` is not set. If none of the paths resolve to a
261
+ non-empty value, the client falls back to the record's `id`.
262
+ """
263
+ valuePaths: [String!]
257
264
  }
@@ -1,6 +1,14 @@
1
1
 
2
2
  type PageQuery {
3
- getPageConfig(path: String, context: JSON): Page
3
+ """
4
+ impersonateRoleId / impersonateGeneral: preview this page's config as
5
+ someone else would see it — either a specific role (impersonateRoleId)
6
+ or the site default with no role/personal override at all
7
+ (impersonateGeneral) — restricted to admins by the host's identity
8
+ resolution (see docupace-graphql-server's resolveCurrentIdentity), which
9
+ throws for a non-admin caller.
10
+ """
11
+ getPageConfig(path: String, context: JSON, impersonateRoleId: ID, impersonateGeneral: Boolean): Page
4
12
  getAIConfig(path: String, context: JSON): JSON
5
13
  }
6
14
 
@@ -15,7 +15,7 @@ type RuleGroup {
15
15
  validationRules: [ValidationRule!]
16
16
  }
17
17
 
18
- union ValidationRule = ArrayTotalRule
18
+ union ValidationRule = ArrayTotalRule | ArrayCountRule
19
19
 
20
20
  type ArrayTotalRule {
21
21
  name: String
@@ -37,6 +37,18 @@ type ArrayTotalRule {
37
37
  emptyIsValid: Boolean
38
38
  }
39
39
 
40
+ """Validates that the combined count of entries across multiple collections does not exceed a maximum."""
41
+ type ArrayCountRule {
42
+ name: String
43
+ message: String!
44
+
45
+ """Paths to the collections whose combined count should be validated."""
46
+ paths: [String!]!
47
+
48
+ """Maximum combined number of entries across all specified paths."""
49
+ maxCount: Int!
50
+ }
51
+
40
52
  interface IFieldRule {
41
53
  defaultValue: String
42
54
  messageLabel: String
@@ -9,6 +9,7 @@ type SelectOptionsFilter {
9
9
  type QuerySelectOptions implements ISelectOptions {
10
10
  type: String
11
11
  labelProp: String # defaults to "name" in ui
12
+ labelExpression: String # JS expression evaluated against each option (e.g. "`${option.name} (${option.internalId})`"); takes precedence over labelProp when set
12
13
  valueProp: String # defaults to "id" in ui
13
14
  queryName: String!
14
15
  variableDefinitions: JSON
@@ -34,6 +34,19 @@ interface ITable {
34
34
  expandable: Expandable
35
35
  totals: [TotalsItem!]
36
36
  config: JSON
37
+ configPath: String
38
+ configurableAttributes: [ConfigurableAttribute!]
39
+ """Admin-defined columns not present in this table's own base `columns`, available to add via the Configure Columns dialog. Site/tenant-scoped catalog — see `$.predefinedColumns` under `configurableAttributes`."""
40
+ predefinedColumns: [Column!]
41
+ """Admin-defined filter criteria not present in this table's own base `filter.criteria`, available to add via the Configure Filters dialog. Site/tenant-scoped catalog — see `$.predefinedFilters` under `configurableAttributes`."""
42
+ predefinedFilters: [TableCriteria!]
43
+ }
44
+
45
+ """One overridable sub-element of a config object identified by `configPath` — see the parent's own `configPath` field for how the two combine (`${configPath}#${configSubPath}`)."""
46
+ type ConfigurableAttribute {
47
+ name: String! # e.g. "columns", "filter" — matches the field name on the parent type
48
+ configPath: String! # copy of the parent object's own configPath, for convenience
49
+ configSubPath: String! # JSONPath relative to the parent object, e.g. "$.columns"
37
50
  }
38
51
 
39
52
  type TotalsItem {
@@ -91,6 +104,8 @@ enum TablePinnedPosition {
91
104
 
92
105
  type Toolbar {
93
106
  columns: ToolbarColumns
107
+ configureColumns: ToolbarColumns
108
+ configureFilters: ToolbarColumns
94
109
  }
95
110
 
96
111
  type ToolbarColumns {
@@ -157,6 +172,11 @@ type TableCriteria {
157
172
  selectOptions: ISelectOptions
158
173
  min: Float
159
174
  max: Float
175
+ visible: Boolean
176
+ """Set when this criterion was added by `$ref`-referencing a predefined/base criterion (e.g. `"#$.predefinedFilters[?(@.name=='status')]"`) rather than being copied inline — see the config-path override merge in `config-service.ts`. Clients that re-save this criterion unchanged should keep sending the same `$ref` (as this value) rather than flattening it into a full copy."""
177
+ ref: String
178
+ """True when this criterion would still be present (by name) without the current scope's own override — i.e. from a broader layer (a role/site override, or the table's own base template `filter.criteria`). Drives hide-vs-delete in the Configure Filters editor: "remove" must hide (`visible: false`) an inherited criterion, since deleting it from the override would just have it reappear from the broader layer on the next read; a non-inherited criterion (only ever added by this scope's own override) can be deleted outright. Computed fresh on every read in `config-service.ts`'s `applyConfigPathOverride`, never persisted."""
179
+ inherited: Boolean
160
180
  }
161
181
 
162
182
  enum TableFilterVariant {
@@ -170,12 +190,18 @@ type Column {
170
190
  visible: Boolean
171
191
  paths: [String!]
172
192
  expression: String
193
+ """Which predefined formatter (if any) generated `expression` — e.g. `"commaList"`, `"custom"` — see `EXPRESSION_FORMATTERS`/`CUSTOM_FORMATTER_ID` in docupace-ui-main's `expressionGeneration.ts`. Absent for the raw/no-formatting default, which stores neither this nor `expression` at all. Without this field, a column's `expression` round-trips but the formatter that produced it doesn't, so the Configure Columns editor can't tell "built from a known formatter" apart from "hand-authored custom script" on reload and always falls back to showing the latter."""
194
+ formatterName: String
173
195
  component: String
174
196
  sortable: Boolean
175
197
  flex: Float
176
198
  pinned: TablePinnedPosition
177
199
  config: JSON
178
200
  filter: ColumnFilter
201
+ """Set when this column was added by `$ref`-referencing a predefined/base column (e.g. `"#$.predefinedColumns[?(@.name=='email')]"`) rather than being copied inline — see the config-path override merge in `config-service.ts`. Clients that re-save this column unchanged should keep sending the same `$ref` (as this value) rather than flattening it into a full copy."""
202
+ ref: String
203
+ """True when this column would still be present (by name) without the current scope's own override — i.e. from a broader layer (a role/site override, or the table's own base template `columns`). Drives hide-vs-delete in the Configure Columns editor — see `TableCriteria.inherited`'s doc comment for the full reasoning, identical here."""
204
+ inherited: Boolean
179
205
  }
180
206
 
181
207
  type ColumnFilter {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docupace/ihub-config",
3
- "version": "1.1.23",
3
+ "version": "1.1.24-admin.1",
4
4
  "description": "Reusable config GraphQL extension and standalone server",
5
5
  "main": "./dist/index.js",
6
6
  "type": "module",
@@ -13,12 +13,13 @@
13
13
  "license": "ISC",
14
14
  "dependencies": {
15
15
  "@docupace/ihub-cache": "1.0.1",
16
- "@docupace/ihub-core": "0.0.114-alpha.1",
16
+ "@docupace/ihub-core": "2.0.3-admin.2",
17
17
  "axios": "^1.13.5",
18
18
  "cross-env": "^7.0.3",
19
19
  "dotenv": "^16.4.1",
20
- "graphql": "^16.8.1",
20
+ "graphql": "^16.14.0",
21
21
  "js-yaml": "^4.1.0",
22
+ "jsonpath": "^1.1.1",
22
23
  "lodash": "^4.17.21",
23
24
  "pino": "^10.3.1",
24
25
  "rimraf": "^6.1.3",
@@ -30,6 +31,7 @@
30
31
  "@graphql-codegen/typescript-resolvers": "4.0.6",
31
32
  "@types/jest": "^30.0.0",
32
33
  "@types/js-yaml": "^4.0.9",
34
+ "@types/jsonpath": "^0.2.4",
33
35
  "@types/lodash": "^4.17.7",
34
36
  "@types/node": "^20.10.6",
35
37
  "@typescript-eslint/eslint-plugin": "^7.10.0",