@vectoriahq/quac 0.23.0 → 0.24.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.
@@ -1,5 +1,5 @@
1
1
  import type { LayerLocks, PrintLayoutTemplate, FieldAttachment, FieldEditRule, LayerFormLayout, LayerScaleRange, ProjectMeasurement } from '../model/QgsProject.ts';
2
- import type { StacAsset, StacCatalog, StacCollection, StacExtent, StacLink, StacProvider, TableColumn, TableColumnValue, TableColumnValueRelation } from '../model/Stac.ts';
2
+ import type { StacAsset, StacCatalog, StacCollection, StacExtent, StacLink, StacProvider, TableColumn, TableColumnRuleLeftOut, TableColumnValue, TableColumnValueRelation } from '../model/Stac.ts';
3
3
  /**
4
4
  * Source-agnostic intermediate model + the single STAC generator that
5
5
  * consumes it.
@@ -91,6 +91,8 @@ export declare const QUAC_PRINT_LAYOUTS_FIELD = "quac:print_layouts";
91
91
  export declare const QUAC_BRAND_COLOR_FIELD = "quac:brand_color";
92
92
  /** The key a top-level Catalog lists the source's layers left out of it under, each with its id, title and reason. */
93
93
  export declare const QUAC_LEFT_OUT_FIELD = "quac:left_out";
94
+ /** The top-level Catalog's field listing the logo variables that write no `icon` link, and why. */
95
+ export declare const QUAC_LOGO_LEFT_OUT_FIELD = "quac:logo_left_out";
94
96
  /** The key an `icon` link takes for the theme its image is for: `dark` for the logo shown in a dark theme. */
95
97
  export declare const QUAC_THEME_FIELD = "quac:theme";
96
98
  /**
@@ -363,6 +365,25 @@ export interface LeftOutLayer {
363
365
  * not know, is not read. Empty where the Catalog lists none.
364
366
  */
365
367
  export declare function readCatalogueLeftOut(catalog: StacCatalog): LeftOutLayer[];
368
+ /**
369
+ * Why a logo variable writes no `icon` link, as `quac:logo_left_out` gives it:
370
+ * its value does not end in a logo's file type (`not_an_image`), is an
371
+ * absolute path, a drive, a home folder or an address (`not_relative`), or
372
+ * leaves the project's folder (`outside_folder`); its file could not be read
373
+ * (`not_read`); or it is the dark logo, and no logo is linked (`no_logo`).
374
+ */
375
+ export type LogoLeftOutReason = 'not_an_image' | 'not_relative' | 'outside_folder' | 'not_read' | 'no_logo';
376
+ /** A logo variable `quac:logo_left_out` names, by the variable's name, never its value, and why it writes no link. */
377
+ export interface LogoLeftOut {
378
+ variable: 'quac_logo' | 'quac_logo_dark';
379
+ reason: LogoLeftOutReason;
380
+ }
381
+ /**
382
+ * The logo variables a top-level Catalog lists in `quac:logo_left_out`, in its
383
+ * order. An entry naming another variable, or a reason this package does not
384
+ * know, is not read. Empty where the Catalog lists none.
385
+ */
386
+ export declare function readCatalogueLogoLeftOut(catalog: StacCatalog): LogoLeftOut[];
366
387
  export declare function readCatalogueInitialView(catalog: StacCatalog): NormalizedBbox | null;
367
388
  /**
368
389
  * Reads shared source declarations back off a Collection.
@@ -380,6 +401,27 @@ export declare function readCollectionDisplayField(collection: StacCollection):
380
401
  * of any other shape, or a `table:columns` that is not a list, yields nothing.
381
402
  */
382
403
  export declare function declaredColumns(collection: StacCollection): Generator<[string, Record<string, unknown>]>;
404
+ /** The column field naming the QGIS Server services that hide a field. */
405
+ export declare const QUAC_QGIS_SERVER_HIDDEN_FIELD = "quac:qgis_server_hidden";
406
+ /** The column field listing a field's rules the catalogue leaves out. */
407
+ export declare const QUAC_RULES_LEFT_OUT_FIELD = "quac:rules_left_out";
408
+ /**
409
+ * The fields a Collection's columns hide from QGIS Server's WMS and from its
410
+ * WFS (`quac:qgis_server_hidden`), each in declared order. An application
411
+ * that serves the layer's features itself leaves these fields' values out of
412
+ * the same services. A service this package does not know is not read.
413
+ */
414
+ export declare function readCollectionServerHiddenFields(collection: StacCollection): {
415
+ wms: string[];
416
+ wfs: string[];
417
+ };
418
+ /**
419
+ * Each field's rules the catalogue leaves out (`quac:rules_left_out`), keyed
420
+ * by field name, in the column's order. An entry whose `rule` this package
421
+ * does not know is not read; a `text` that is not a string and a `strength`
422
+ * other than `enforced` or `warn` are left off. A field with none is absent.
423
+ */
424
+ export declare function readCollectionFieldRulesLeftOut(collection: StacCollection): Record<string, TableColumnRuleLeftOut[]>;
383
425
  /** Each field's alias, its column's `title`. A column with a blank or no `title` is absent. */
384
426
  export declare function readCollectionFieldAliases(collection: StacCollection): Record<string, string>;
385
427
  /** Each field's comment, its column's `description`, trimmed. A column with a blank or no `description` is absent. */
@@ -101,6 +101,8 @@ export const QUAC_PRINT_LAYOUTS_FIELD = 'quac:print_layouts';
101
101
  export const QUAC_BRAND_COLOR_FIELD = 'quac:brand_color';
102
102
  /** The key a top-level Catalog lists the source's layers left out of it under, each with its id, title and reason. */
103
103
  export const QUAC_LEFT_OUT_FIELD = 'quac:left_out';
104
+ /** The top-level Catalog's field listing the logo variables that write no `icon` link, and why. */
105
+ export const QUAC_LOGO_LEFT_OUT_FIELD = 'quac:logo_left_out';
104
106
  /** The key an `icon` link takes for the theme its image is for: `dark` for the logo shown in a dark theme. */
105
107
  export const QUAC_THEME_FIELD = 'quac:theme';
106
108
  /**
@@ -444,6 +446,25 @@ export function readCatalogueLeftOut(catalog) {
444
446
  : [];
445
447
  });
446
448
  }
449
+ const LOGO_LEFT_OUT_REASONS = new Set(['not_an_image', 'not_relative', 'outside_folder', 'not_read', 'no_logo']);
450
+ /**
451
+ * The logo variables a top-level Catalog lists in `quac:logo_left_out`, in its
452
+ * order. An entry naming another variable, or a reason this package does not
453
+ * know, is not read. Empty where the Catalog lists none.
454
+ */
455
+ export function readCatalogueLogoLeftOut(catalog) {
456
+ const value = catalog[QUAC_LOGO_LEFT_OUT_FIELD];
457
+ if (!Array.isArray(value))
458
+ return [];
459
+ return value.flatMap((entry) => {
460
+ if (!entry || typeof entry !== 'object')
461
+ return [];
462
+ const { variable, reason } = entry;
463
+ return (variable === 'quac_logo' || variable === 'quac_logo_dark') && typeof reason === 'string' && LOGO_LEFT_OUT_REASONS.has(reason)
464
+ ? [{ variable, reason: reason }]
465
+ : [];
466
+ });
467
+ }
447
468
  export function readCatalogueInitialView(catalog) {
448
469
  const value = catalog[INITIAL_VIEW_FIELD];
449
470
  if (!Array.isArray(value) || value.length !== 4)
@@ -486,6 +507,59 @@ export function* declaredColumns(collection) {
486
507
  yield [name, candidate];
487
508
  }
488
509
  }
510
+ /** The column field naming the QGIS Server services that hide a field. */
511
+ export const QUAC_QGIS_SERVER_HIDDEN_FIELD = 'quac:qgis_server_hidden';
512
+ /** The column field listing a field's rules the catalogue leaves out. */
513
+ export const QUAC_RULES_LEFT_OUT_FIELD = 'quac:rules_left_out';
514
+ /**
515
+ * The fields a Collection's columns hide from QGIS Server's WMS and from its
516
+ * WFS (`quac:qgis_server_hidden`), each in declared order. An application
517
+ * that serves the layer's features itself leaves these fields' values out of
518
+ * the same services. A service this package does not know is not read.
519
+ */
520
+ export function readCollectionServerHiddenFields(collection) {
521
+ const hidden = { wms: [], wfs: [] };
522
+ for (const [name, column] of declaredColumns(collection)) {
523
+ const services = column[QUAC_QGIS_SERVER_HIDDEN_FIELD];
524
+ if (!Array.isArray(services))
525
+ continue;
526
+ if (services.includes('wms'))
527
+ hidden.wms.push(name);
528
+ if (services.includes('wfs'))
529
+ hidden.wfs.push(name);
530
+ }
531
+ return hidden;
532
+ }
533
+ const RULE_LEFT_OUT_KINDS = new Set(['widget', 'default', 'constraint', 'value_relation']);
534
+ /**
535
+ * Each field's rules the catalogue leaves out (`quac:rules_left_out`), keyed
536
+ * by field name, in the column's order. An entry whose `rule` this package
537
+ * does not know is not read; a `text` that is not a string and a `strength`
538
+ * other than `enforced` or `warn` are left off. A field with none is absent.
539
+ */
540
+ export function readCollectionFieldRulesLeftOut(collection) {
541
+ const result = nameRecord();
542
+ for (const [name, column] of declaredColumns(collection)) {
543
+ const value = column[QUAC_RULES_LEFT_OUT_FIELD];
544
+ if (!Array.isArray(value))
545
+ continue;
546
+ const rules = value.flatMap((entry) => {
547
+ const candidate = readObject(entry);
548
+ const rule = candidate?.rule;
549
+ if (typeof rule !== 'string' || !RULE_LEFT_OUT_KINDS.has(rule))
550
+ return [];
551
+ const { text, strength } = candidate;
552
+ return [{
553
+ rule: rule,
554
+ ...(typeof text === 'string' && text !== '' ? { text } : {}),
555
+ ...(strength === 'enforced' || strength === 'warn' ? { strength } : {})
556
+ }];
557
+ });
558
+ if (rules.length > 0)
559
+ result[name] = rules;
560
+ }
561
+ return result;
562
+ }
489
563
  /** Each field's alias, its column's `title`. A column with a blank or no `title` is absent. */
490
564
  export function readCollectionFieldAliases(collection) {
491
565
  const aliases = nameRecord();
@@ -24,7 +24,8 @@ import type { StacCatalog, StacCollection } from '../model/Stac.ts';
24
24
  * the CRS `chooseWmsCrs` picks from `serverWmsCrsList`. No
25
25
  * file path, style asset, `via` link or detail of the layer's own data source
26
26
  * is written, nor an Attachment widget's default folder, nor the logo's
27
- * `icon` links, which name files beside the project.
27
+ * `icon` links, which name files beside the project, nor so
28
+ * `quac:logo_left_out`.
28
29
  * - A field the project hides from WMS or from WFS is left out of
29
30
  * `table:columns`, and every mention of it is dropped: from the form order,
30
31
  * the preset filters, the display field, a relation's join, and any
@@ -115,7 +116,10 @@ export interface HiddenFieldContext {
115
116
  * A lock whose expression uses one becomes `true`, and a field editable only
116
117
  * while such an expression holds becomes read-only, so that hiding a field
117
118
  * never unlocks an edit. A relation or Value Relation to a layer that is not
118
- * served is dropped, and one to a served layer names it by its served id. For
119
+ * served is dropped, and one to a served layer names it by its served id. A
120
+ * column's default, constraint expression or Value Relation dropped so is
121
+ * added to its `quac:rules_left_out`, and a rule already there loses an
122
+ * expression that names a hidden field. For
119
123
  * an application that serves a project's layers itself, as
120
124
  * `generateServerStacCatalogue` does for QGIS Server.
121
125
  */
@@ -1,4 +1,4 @@
1
- import { buildStacExtent, unionBboxes, withDataType, withFieldSize } from "./normalizedProject.js";
1
+ import { buildStacExtent, QUAC_LOGO_LEFT_OUT_FIELD, unionBboxes, withDataType, withFieldSize } from "./normalizedProject.js";
2
2
  import { serverLayerTree, wmsPublishedLayerIds } from "./serverLayerTree.js";
3
3
  import { generateStacCatalogue, QUAC_CATEGORISED_FIELD } from "./stacCatalogue.js";
4
4
  import { wfsGetFeatureAsset } from "./wfsStacCatalogue.js";
@@ -31,7 +31,8 @@ import { chooseWmsCrs, WEB_MAP_LINKS_EXTENSION, WMS_REQUEST_PARAMETERS } from ".
31
31
  * the CRS `chooseWmsCrs` picks from `serverWmsCrsList`. No
32
32
  * file path, style asset, `via` link or detail of the layer's own data source
33
33
  * is written, nor an Attachment widget's default folder, nor the logo's
34
- * `icon` links, which name files beside the project.
34
+ * `icon` links, which name files beside the project, nor so
35
+ * `quac:logo_left_out`.
35
36
  * - A field the project hides from WMS or from WFS is left out of
36
37
  * `table:columns`, and every mention of it is dropped: from the form order,
37
38
  * the preset filters, the display field, a relation's join, and any
@@ -91,6 +92,7 @@ export function generateServerStacCatalogue(project, options) {
91
92
  delete served.collections;
92
93
  delete served.catalogs;
93
94
  delete served.stac_extensions;
95
+ delete served[QUAC_LOGO_LEFT_OUT_FIELD];
94
96
  if (collections.length > 0)
95
97
  served.collections = collections;
96
98
  if (catalogs.length > 0)
@@ -224,7 +226,10 @@ function serveCollection(source, context) {
224
226
  * A lock whose expression uses one becomes `true`, and a field editable only
225
227
  * while such an expression holds becomes read-only, so that hiding a field
226
228
  * never unlocks an edit. A relation or Value Relation to a layer that is not
227
- * served is dropped, and one to a served layer names it by its served id. For
229
+ * served is dropped, and one to a served layer names it by its served id. A
230
+ * column's default, constraint expression or Value Relation dropped so is
231
+ * added to its `quac:rules_left_out`, and a rule already there loses an
232
+ * expression that names a hidden field. For
228
233
  * an application that serves a project's layers itself, as
229
234
  * `generateServerStacCatalogue` does for QGIS Server.
230
235
  */
@@ -385,17 +390,31 @@ function serveColumn(source, hidden, context) {
385
390
  delete served.default_root;
386
391
  column['quac:attachment'] = served;
387
392
  }
393
+ // A rule left out already keeps its kind, but not an expression that names a hidden field.
394
+ const leftOut = Array.isArray(column['quac:rules_left_out'])
395
+ ? column['quac:rules_left_out'].map((rule) => {
396
+ if (rule.rule === 'widget' || !mentionsAny(rule.text, hidden))
397
+ return rule;
398
+ const kept = { ...rule };
399
+ delete kept.text;
400
+ return kept;
401
+ })
402
+ : [];
388
403
  const fieldDefault = column['quac:default'];
389
- if (fieldDefault?.kind === 'expression' && mentionsAny(fieldDefault.expression, hidden))
404
+ if (fieldDefault?.kind === 'expression' && mentionsAny(fieldDefault.expression, hidden)) {
390
405
  delete column['quac:default'];
406
+ leftOut.push({ rule: 'default' });
407
+ }
391
408
  const constraints = column['quac:constraints'];
392
- if (constraints && mentionsAny(constraints.expression?.expression, hidden)) {
409
+ const constraintExpression = constraints?.expression;
410
+ if (constraints && mentionsAny(constraintExpression?.expression, hidden)) {
393
411
  const rest = { ...constraints };
394
412
  delete rest.expression;
395
413
  if (Object.keys(rest).length > 0)
396
414
  column['quac:constraints'] = rest;
397
415
  else
398
416
  delete column['quac:constraints'];
417
+ leftOut.push({ rule: 'constraint', ...(constraintExpression?.strength ? { strength: constraintExpression.strength } : {}) });
399
418
  }
400
419
  const relation = column['quac:value_relation'];
401
420
  if (relation) {
@@ -404,10 +423,14 @@ function serveColumn(source, hidden, context) {
404
423
  const usesHidden = [relation.key, relation.value, relation.order_field].some((field) => field !== undefined && lookupHidden.has(field))
405
424
  || mentionsAny(relation.filter, lookupHidden)
406
425
  || mentionsAny(relation.filter, hidden);
407
- if (!lookupId || usesHidden)
426
+ if (!lookupId || usesHidden) {
408
427
  delete column['quac:value_relation'];
428
+ leftOut.push({ rule: 'value_relation' });
429
+ }
409
430
  else
410
431
  column['quac:value_relation'] = { ...relation, collection: lookupId };
411
432
  }
433
+ if (leftOut.length > 0)
434
+ column['quac:rules_left_out'] = leftOut;
412
435
  return column;
413
436
  }
@@ -1,5 +1,5 @@
1
1
  import { arcgisQueryAsset } from "./arcgisStacCatalogue.js";
2
- import { QUAC_BRAND_COLOR_FIELD, QUAC_THEME_FIELD, QUAC_MEASUREMENT_FIELD, QUAC_PRINT_LAYOUTS_FIELD, slugify, generateStacFromNormalized, unionBboxes, withSelfLink } from "./normalizedProject.js";
2
+ import { QUAC_BRAND_COLOR_FIELD, QUAC_THEME_FIELD, QUAC_MEASUREMENT_FIELD, QUAC_LOGO_LEFT_OUT_FIELD, QUAC_PRINT_LAYOUTS_FIELD, slugify, generateStacFromNormalized, unionBboxes, withSelfLink } from "./normalizedProject.js";
3
3
  import { wfsGetFeatureAsset } from "./wfsStacCatalogue.js";
4
4
  import { delimitedTextField, QUAC_DELIMITED_TEXT } from "../model/delimitedText.js";
5
5
  import { featureFilterField, QUAC_FEATURE_FILTER } from "../model/featureFilter.js";
@@ -178,6 +178,7 @@ function qgsProjectToNormalized(project, companions, projectPath, projectFileNam
178
178
  // Where the map *opens* is a different fact, and is only true of a project
179
179
  // whose author saved a canvas position, so it goes in its own field below
180
180
  // and is absent from a project that declares none.
181
+ const logos = projectLogos(project.variables ?? {});
181
182
  return {
182
183
  id: slugify(project.title || 'qgs-project') || 'qgs-project',
183
184
  title: project.title,
@@ -190,13 +191,13 @@ function qgsProjectToNormalized(project, companions, projectPath, projectFileNam
190
191
  activeCollectionId: project.initialActiveLayerId && layersById.has(project.initialActiveLayerId)
191
192
  ? collectionIdOf(project.initialActiveLayerId)
192
193
  : null,
193
- vendorFields: projectVendorFields(project),
194
- links: projectLogoLinks(project.variables ?? {}),
194
+ vendorFields: projectVendorFields(project, logos.leftOut),
195
+ links: logos.links,
195
196
  nodes
196
197
  };
197
198
  }
198
- /** The top-level Catalog's fields the project sets: its print layouts and its Brand colour. */
199
- function projectVendorFields(project) {
199
+ /** The top-level Catalog's fields the project sets: its print layouts, its Brand colour and the logos it leaves out. */
200
+ function projectVendorFields(project, logosLeftOut) {
200
201
  const fields = {};
201
202
  if (project.printLayouts && project.printLayouts.length > 0) {
202
203
  fields[QUAC_PRINT_LAYOUTS_FIELD] = project.printLayouts.map(({ name, template }) => ({ name, template }));
@@ -204,6 +205,8 @@ function projectVendorFields(project) {
204
205
  const brandColor = brandColorOf(project.brandColour);
205
206
  if (brandColor)
206
207
  fields[QUAC_BRAND_COLOR_FIELD] = brandColor;
208
+ if (logosLeftOut.length > 0)
209
+ fields[QUAC_LOGO_LEFT_OUT_FIELD] = logosLeftOut;
207
210
  return Object.keys(fields).length > 0 ? fields : undefined;
208
211
  }
209
212
  /** The project variables naming the map's logo, and the logo shown in a dark theme. */
@@ -224,19 +227,50 @@ const LOGO_MEDIA_TYPES = {
224
227
  * project, which the link gives as a data asset's href gives its file. A
225
228
  * value that is not such a path, such as an absolute path or an address,
226
229
  * leaves the folder, or does not end in a logo's extension, writes nothing,
227
- * and a dark logo is written only beside a logo.
230
+ * and a dark logo is written only beside a logo. Each variable set that
231
+ * writes no link is in `leftOut`, with why, as `quac:logo_left_out` lists it.
228
232
  */
229
- function projectLogoLinks(variables) {
233
+ function projectLogos(variables) {
234
+ const links = [];
235
+ const leftOut = [];
230
236
  const light = logoLink(variables[LOGO_VARIABLE]);
231
- if (!light)
232
- return [];
237
+ if (typeof light === 'string')
238
+ leftOut.push({ variable: LOGO_VARIABLE, reason: light });
239
+ else if (light)
240
+ links.push(light);
233
241
  const dark = logoLink(variables[LOGO_DARK_VARIABLE]);
234
- return dark ? [light, { ...dark, title: 'Logo for a dark theme', [QUAC_THEME_FIELD]: 'dark' }] : [light];
242
+ if (typeof dark === 'string')
243
+ leftOut.push({ variable: LOGO_DARK_VARIABLE, reason: dark });
244
+ else if (dark && links.length === 0)
245
+ leftOut.push({ variable: LOGO_DARK_VARIABLE, reason: 'no_logo' });
246
+ else if (dark)
247
+ links.push({ ...dark, title: 'Logo for a dark theme', [QUAC_THEME_FIELD]: 'dark' });
248
+ return { links, leftOut };
235
249
  }
250
+ /** A logo variable's link, why it writes none, or null where the variable is unset or blank. */
236
251
  function logoLink(value) {
237
- const path = projectRelativeFile(value ?? '');
252
+ const text = (value ?? '').trim();
253
+ if (!text)
254
+ return null;
255
+ if (!isProjectRelativeFolder(text))
256
+ return 'not_relative';
257
+ if (leavesFolder(text))
258
+ return 'outside_folder';
259
+ const path = projectRelativeFile(text);
238
260
  const mediaType = path ? LOGO_MEDIA_TYPES[path.slice(path.lastIndexOf('.') + 1).toLowerCase()] : undefined;
239
- return path && mediaType ? { rel: 'icon', href: `./${encodeAssetPath(path)}`, type: mediaType, title: 'Logo' } : null;
261
+ return path && mediaType ? { rel: 'icon', href: `./${encodeAssetPath(path)}`, type: mediaType, title: 'Logo' } : 'not_an_image';
262
+ }
263
+ /** Whether a relative path's `..` names climb above the folder it starts in. */
264
+ function leavesFolder(text) {
265
+ let depth = 0;
266
+ for (const name of text.split(/[\\/]/)) {
267
+ if (name === '' || name === '.')
268
+ continue;
269
+ depth += name === '..' ? -1 : 1;
270
+ if (depth < 0)
271
+ return true;
272
+ }
273
+ return false;
240
274
  }
241
275
  /**
242
276
  * A path relative to the project and inside its folder, with `/` between its
@@ -505,7 +539,7 @@ function qgsLayerToNormalized(layer, context, geometryFilter = geometryFilterOf(
505
539
  geometryType: layer.geometryType,
506
540
  wkbTypes: layer.wkbType ? [layer.wkbType] : [],
507
541
  qgisServerNames: qgisServerNamesOf(layer, context),
508
- tableColumns: deriveTableColumns(geojson, layer.fieldNames, layer.fieldAliases, layer.fieldValueMaps, layer.fieldAttachments, layer.fieldEditRules, valueRelations, layer.formLayout ?? null, layer.fieldIcons, layer.fieldControls, layer.fieldComments),
542
+ tableColumns: deriveTableColumns(geojson, layer.fieldNames, layer.fieldAliases, layer.fieldValueMaps, layer.fieldAttachments, layer.fieldEditRules, valueRelations, layer.formLayout ?? null, layer.fieldIcons, layer.fieldControls, layer.fieldComments, layer.serverHiddenFields, fieldRulesLeftOutOf(layer, valueRelations)),
509
543
  formOrder: layer.formLayout?.fields.map((field) => field.name),
510
544
  assets: buildLayerAssets(layer, context, geometryFilter, styleParts),
511
545
  keywords: metadata.keywords.length > 0 ? metadata.keywords : undefined,
@@ -912,7 +946,7 @@ function unionExtent(layers, layerWgs84Extents) {
912
946
  * exist": this means a hidden WFS layer's schema is fully visible to the
913
947
  * dev panel and to STAC clients before any data is fetched.
914
948
  */
915
- function deriveTableColumns(geojson, fieldNames, fieldAliases, fieldValueMaps = nameRecord(), fieldAttachments = nameRecord(), fieldEditRules = nameRecord(), fieldValueRelations = nameRecord(), formLayout = null, fieldIcons = nameRecord(), fieldControls = nameRecord(), fieldComments = nameRecord()) {
949
+ function deriveTableColumns(geojson, fieldNames, fieldAliases, fieldValueMaps = nameRecord(), fieldAttachments = nameRecord(), fieldEditRules = nameRecord(), fieldValueRelations = nameRecord(), formLayout = null, fieldIcons = nameRecord(), fieldControls = nameRecord(), fieldComments = nameRecord(), serverHiddenFields = undefined, fieldRulesLeftOut = nameRecord()) {
916
950
  const observedTypes = new Map();
917
951
  const orderedFieldNames = [];
918
952
  const seen = new Set();
@@ -1021,9 +1055,44 @@ function deriveTableColumns(geojson, fieldNames, fieldAliases, fieldValueMaps =
1021
1055
  if (placed?.editableWhen)
1022
1056
  column['quac:editable_when'] = placed.editableWhen;
1023
1057
  }
1058
+ const hiddenFrom = [];
1059
+ if (serverHiddenFields?.wms.includes(name))
1060
+ hiddenFrom.push('wms');
1061
+ if (serverHiddenFields?.wfs.includes(name))
1062
+ hiddenFrom.push('wfs');
1063
+ if (hiddenFrom.length > 0)
1064
+ column['quac:qgis_server_hidden'] = hiddenFrom;
1065
+ const leftOut = fieldRulesLeftOut[name];
1066
+ if (leftOut?.length)
1067
+ column['quac:rules_left_out'] = leftOut.map(ruleLeftOutToJson);
1024
1068
  return column;
1025
1069
  });
1026
1070
  }
1071
+ /**
1072
+ * A layer's field rules its Collection leaves out: those its parsing left out
1073
+ * (`fieldRulesLeftOut`), then each Value Relation whose lookup layer is not
1074
+ * in the catalogue, which `quac:value_relation` therefore does not name. The
1075
+ * lookup is not named either: it may be a layer the project leaves out of WMS.
1076
+ */
1077
+ function fieldRulesLeftOutOf(layer, valueRelations) {
1078
+ const leftOut = nameRecord();
1079
+ for (const [field, rules] of Object.entries(layer.fieldRulesLeftOut ?? {}))
1080
+ leftOut[field] = [...rules];
1081
+ for (const field of Object.keys(layer.fieldValueRelations)) {
1082
+ if (valueRelations?.[field])
1083
+ continue;
1084
+ (leftOut[field] ??= []).push({ rule: 'value_relation', text: null });
1085
+ }
1086
+ return leftOut;
1087
+ }
1088
+ /** A left-out field rule as `quac:rules_left_out` stores it: a blank text is left off. */
1089
+ function ruleLeftOutToJson(rule) {
1090
+ return {
1091
+ rule: rule.rule,
1092
+ ...(rule.text ? { text: rule.text } : {}),
1093
+ ...(rule.strength ? { strength: rule.strength } : {})
1094
+ };
1095
+ }
1027
1096
  /** A field's constraint expression as `quac:constraints` stores it: a description the source left blank is left off. */
1028
1097
  function constraintExpressionToJson(constraint) {
1029
1098
  return {
@@ -24,9 +24,15 @@ export type NewFeatureProblem = 'unknown-field' | 'not-fillable' | 'required' |
24
24
  * - `unique`: an enforced Unique constraint, which needs the layer's other features;
25
25
  * - `date-format`: it stores dates in a format of its own;
26
26
  * - `attachment`: it holds a file's path, and the file is not part of the feature;
27
- * - `type`: its type is one this does not know.
27
+ * - `type`: its type is one this does not know;
28
+ * - `widget`: the catalogue leaves out its edit widget (`quac:rules_left_out`),
29
+ * which may restrict its values;
30
+ * - `left-out`: the catalogue leaves out a rule of a kind this does not know.
31
+ *
32
+ * A constraint expression or Value Relation the catalogue leaves out is
33
+ * `constraint-expression` or `value-relation`, as one it carries is.
28
34
  */
29
- export type UncheckedFieldRule = 'constraint-expression' | 'visible-when' | 'editable-when' | 'value-relation' | 'unique' | 'date-format' | 'attachment' | 'type';
35
+ export type UncheckedFieldRule = 'constraint-expression' | 'visible-when' | 'editable-when' | 'value-relation' | 'unique' | 'date-format' | 'attachment' | 'type' | 'widget' | 'left-out';
30
36
  export interface NewFeatureCheck {
31
37
  /** The fields refused, in the layer's field order, then the fields the layer does not have. */
32
38
  problems: {
@@ -53,10 +59,11 @@ type Properties = Readonly<Record<string, unknown>>;
53
59
  * Checkbox spelling, and its range. A rule that needs more than the Collection
54
60
  * to check is listed in `unchecked`, not passed.
55
61
  *
56
- * It checks only what the Collection carries. A catalogue generated from a
57
- * QGIS project leaves out a setting it cannot read, such as a constraint
58
- * expression `readQgisExpression` cannot read, and lists it in the project's
59
- * `notes`, which a caller reads as well.
62
+ * It checks only what the Collection carries. A rule the catalogue leaves
63
+ * out, such as a constraint expression `readQgisExpression` cannot read, is
64
+ * listed in the column's `quac:rules_left_out`, and so in `unchecked`, apart
65
+ * from a default value, which this does not fill: a caller that fills
66
+ * defaults reads `quac:rules_left_out` itself.
60
67
  *
61
68
  * A Collection that declares no fields refuses every value. A warning
62
69
  * (`warn`) constraint refuses nothing, as QGIS saves past it. Values are
@@ -8,10 +8,11 @@ import { declaredColumns, readCollectionFieldEditRules, readCollectionFieldTypes
8
8
  * Checkbox spelling, and its range. A rule that needs more than the Collection
9
9
  * to check is listed in `unchecked`, not passed.
10
10
  *
11
- * It checks only what the Collection carries. A catalogue generated from a
12
- * QGIS project leaves out a setting it cannot read, such as a constraint
13
- * expression `readQgisExpression` cannot read, and lists it in the project's
14
- * `notes`, which a caller reads as well.
11
+ * It checks only what the Collection carries. A rule the catalogue leaves
12
+ * out, such as a constraint expression `readQgisExpression` cannot read, is
13
+ * listed in the column's `quac:rules_left_out`, and so in `unchecked`, apart
14
+ * from a default value, which this does not fill: a caller that fills
15
+ * defaults reads `quac:rules_left_out` itself.
15
16
  *
16
17
  * A Collection that declares no fields refuses every value. A warning
17
18
  * (`warn`) constraint refuses nothing, as QGIS saves past it. Values are
@@ -106,6 +107,30 @@ export function newQgisUuid(format) {
106
107
  const KNOWN_TYPES = new Set(['string', 'int', 'long', 'double', 'boolean', 'date', 'time', 'timestamp']);
107
108
  const DATE_TYPES = new Set(['date', 'time', 'timestamp']);
108
109
  function uncheckedRules(column, type, unique, dateFormat) {
110
+ const found = new Set();
111
+ for (const rule of uncheckedColumnRules(column, type, unique, dateFormat))
112
+ found.add(rule);
113
+ for (const rule of leftOutRules(column))
114
+ found.add(rule);
115
+ return Array.from(found);
116
+ }
117
+ /** The unchecked rules a column's `quac:rules_left_out` gives: every entry but a default and a constraint that only warns. */
118
+ function leftOutRules(column) {
119
+ const value = column['quac:rules_left_out'];
120
+ if (!Array.isArray(value))
121
+ return [];
122
+ return value.flatMap((entry) => {
123
+ const { rule, strength } = entry && typeof entry === 'object' ? entry : {};
124
+ switch (rule) {
125
+ case 'default': return [];
126
+ case 'constraint': return strength === 'warn' ? [] : ['constraint-expression'];
127
+ case 'value_relation': return ['value-relation'];
128
+ case 'widget': return ['widget'];
129
+ default: return ['left-out'];
130
+ }
131
+ });
132
+ }
133
+ function uncheckedColumnRules(column, type, unique, dateFormat) {
109
134
  const found = [];
110
135
  const constraints = column['quac:constraints'];
111
136
  const expression = constraints && typeof constraints === 'object' ? constraints.expression : undefined;
package/dist/index.d.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  * `@vectoriahq/quac`.
4
4
  */
5
5
  export type { QgsProject, ProjectMetadata, MapExtent, BoundingBox, LayerEntry, EditLock, LayerLocks, LockedEdit, ProjectMeasurement, LayerStyle, LayerResourceMetadata, LayerScaleRange, LayerContact, LayerAttribution, FieldAttachment, FieldCheckbox, FieldConstraintExpression, FieldDefaultExpression, FieldDefaultValue, FieldEditRule, FormLayoutField, LayerFormLayout, FieldFixedValue, FieldRange, FieldUuidFormat, FieldValueMapEntry, DataSource, FileDataSource, WfsDataSource, WmsDataSource, UnsupportedDataSource, LayerTreeNode, LayerGroup, LayerTreeLeaf, QgsRelation, QgsRelationFieldPair, ProjectNote, ProjectNoteReason } from './model/QgsProject.ts';
6
- export type { StacCatalog, StacCollection, StacItem, StacAsset, StacExtent, StacLink, StacObject, StacProvider, TableColumn, TableColumnType, TableColumnValue, TableColumnValueRelation, TableColumnAttachment, TableColumnCheckbox, TableColumnRange } from './model/Stac.ts';
6
+ export type { StacCatalog, StacCollection, StacItem, StacAsset, StacExtent, StacLink, StacObject, StacProvider, TableColumn, TableColumnType, TableColumnValue, TableColumnValueRelation, TableColumnRuleLeftOut, TableColumnServerService, TableColumnAttachment, TableColumnCheckbox, TableColumnRange } from './model/Stac.ts';
7
7
  export { STAC_VERSION } from './model/Stac.ts';
8
8
  export { isIconLibraryAddress, resolveFieldIconAddress } from './model/fieldIconAddress.ts';
9
9
  export { collectCollectionStyles, getDefaultStyle, styleAssetKey, GL_STYLE_MEDIA_TYPE } from './model/stacStyles.ts';
@@ -37,8 +37,8 @@ export { FILE_EXTENSION, FILE_SIZE_FIELD, TABLE_ROW_COUNT_FIELD, readCollectionR
37
37
  export { PMTILES_MEDIA_TYPE, VISUAL_ROLE, readCollectionPmtiles } from './model/stacPmtiles.ts';
38
38
  export type { StacPmtilesSource } from './model/stacPmtiles.ts';
39
39
  export type { StacCompanionData } from './generate/stacCatalogue.ts';
40
- export { QUAC_ACTIVE_COLLECTION_FIELD, QUAC_FILTERS_FIELD, QUAC_FORM_ORDER_FIELD, QUAC_LOCKS_FIELD, QUAC_MUTUALLY_EXCLUSIVE_FIELD, QUAC_PRIVATE_FIELD, readCatalogueActiveCollection, readCatalogueInitialView, readCataloguePrintLayouts, readCatalogueBrandColor, readCatalogueLogos, readCatalogueLeftOut, readCollectionDisplayField, readCollectionEditable, readCollectionFieldAliases, readCollectionFieldComments, readCollectionFieldAttachments, readCollectionFieldEditRules, readCollectionFieldNames, readCollectionFieldTypes, readCollectionFieldValueRelations, readCollectionFieldValues, readCollectionFormLayout, readCollectionGeometryType, readCollectionGeometryTypes, readCollectionIdentifiable, readCollectionMeasurement, readCollectionOpacity, readCollectionIcon, readCollectionAddedMessage, readCollectionMapTip, readCollectionLegendImage, readCollectionFilters, readCollectionLocks, readCollectionPrivate, readCollectionRelatedTo, readCollectionScaleRange, readCollectionVisibility, statedOpacity } from './generate/normalizedProject.ts';
41
- export type { CatalogueLogo, LeftOutLayer, LeftOutReason, CollectionFilter, CollectionFormLayout, CollectionRelation, CollectionRelationField } from './generate/normalizedProject.ts';
40
+ export { QUAC_ACTIVE_COLLECTION_FIELD, QUAC_FILTERS_FIELD, QUAC_FORM_ORDER_FIELD, QUAC_LOCKS_FIELD, QUAC_MUTUALLY_EXCLUSIVE_FIELD, QUAC_PRIVATE_FIELD, readCatalogueActiveCollection, readCatalogueInitialView, readCataloguePrintLayouts, readCatalogueBrandColor, readCatalogueLogos, readCatalogueLeftOut, readCatalogueLogoLeftOut, QUAC_LOGO_LEFT_OUT_FIELD, readCollectionDisplayField, readCollectionEditable, readCollectionFieldAliases, readCollectionFieldComments, readCollectionFieldAttachments, readCollectionFieldEditRules, readCollectionFieldNames, readCollectionFieldRulesLeftOut, readCollectionServerHiddenFields, QUAC_QGIS_SERVER_HIDDEN_FIELD, QUAC_RULES_LEFT_OUT_FIELD, readCollectionFieldTypes, readCollectionFieldValueRelations, readCollectionFieldValues, readCollectionFormLayout, readCollectionGeometryType, readCollectionGeometryTypes, readCollectionIdentifiable, readCollectionMeasurement, readCollectionOpacity, readCollectionIcon, readCollectionAddedMessage, readCollectionMapTip, readCollectionLegendImage, readCollectionFilters, readCollectionLocks, readCollectionPrivate, readCollectionRelatedTo, readCollectionScaleRange, readCollectionVisibility, statedOpacity } from './generate/normalizedProject.ts';
41
+ export type { CatalogueLogo, LeftOutLayer, LeftOutReason, LogoLeftOut, LogoLeftOutReason, CollectionFilter, CollectionFormLayout, CollectionRelation, CollectionRelationField } from './generate/normalizedProject.ts';
42
42
  export { generateStacCatalogueFromWfsCapabilities } from './generate/wfsStacCatalogue.ts';
43
43
  export type { WfsStacCatalogueOptions } from './generate/wfsStacCatalogue.ts';
44
44
  export { generateStacCatalogueFromFolder } from './generate/folderStacCatalogue.ts';
package/dist/index.js CHANGED
@@ -24,7 +24,7 @@ export { DATA_ROLE, findAssetByRole, readDataAsset } from "./model/stacAssetRole
24
24
  export { THUMBNAIL_ROLE, readCollectionAttribution, readCollectionDeprecation, readCollectionSelfHref, readCollectionThumbnail } from "./model/stacCollectionNotes.js";
25
25
  export { FILE_EXTENSION, FILE_SIZE_FIELD, TABLE_ROW_COUNT_FIELD, readCollectionRowCount, readDataAssetFileSize } from "./model/stacSizeAndCount.js";
26
26
  export { PMTILES_MEDIA_TYPE, VISUAL_ROLE, readCollectionPmtiles } from "./model/stacPmtiles.js";
27
- export { QUAC_ACTIVE_COLLECTION_FIELD, QUAC_FILTERS_FIELD, QUAC_FORM_ORDER_FIELD, QUAC_LOCKS_FIELD, QUAC_MUTUALLY_EXCLUSIVE_FIELD, QUAC_PRIVATE_FIELD, readCatalogueActiveCollection, readCatalogueInitialView, readCataloguePrintLayouts, readCatalogueBrandColor, readCatalogueLogos, readCatalogueLeftOut, readCollectionDisplayField, readCollectionEditable, readCollectionFieldAliases, readCollectionFieldComments, readCollectionFieldAttachments, readCollectionFieldEditRules, readCollectionFieldNames, readCollectionFieldTypes, readCollectionFieldValueRelations, readCollectionFieldValues, readCollectionFormLayout, readCollectionGeometryType, readCollectionGeometryTypes, readCollectionIdentifiable, readCollectionMeasurement, readCollectionOpacity, readCollectionIcon, readCollectionAddedMessage, readCollectionMapTip, readCollectionLegendImage, readCollectionFilters, readCollectionLocks, readCollectionPrivate, readCollectionRelatedTo, readCollectionScaleRange, readCollectionVisibility, statedOpacity } from "./generate/normalizedProject.js";
27
+ export { QUAC_ACTIVE_COLLECTION_FIELD, QUAC_FILTERS_FIELD, QUAC_FORM_ORDER_FIELD, QUAC_LOCKS_FIELD, QUAC_MUTUALLY_EXCLUSIVE_FIELD, QUAC_PRIVATE_FIELD, readCatalogueActiveCollection, readCatalogueInitialView, readCataloguePrintLayouts, readCatalogueBrandColor, readCatalogueLogos, readCatalogueLeftOut, readCatalogueLogoLeftOut, QUAC_LOGO_LEFT_OUT_FIELD, readCollectionDisplayField, readCollectionEditable, readCollectionFieldAliases, readCollectionFieldComments, readCollectionFieldAttachments, readCollectionFieldEditRules, readCollectionFieldNames, readCollectionFieldRulesLeftOut, readCollectionServerHiddenFields, QUAC_QGIS_SERVER_HIDDEN_FIELD, QUAC_RULES_LEFT_OUT_FIELD, readCollectionFieldTypes, readCollectionFieldValueRelations, readCollectionFieldValues, readCollectionFormLayout, readCollectionGeometryType, readCollectionGeometryTypes, readCollectionIdentifiable, readCollectionMeasurement, readCollectionOpacity, readCollectionIcon, readCollectionAddedMessage, readCollectionMapTip, readCollectionLegendImage, readCollectionFilters, readCollectionLocks, readCollectionPrivate, readCollectionRelatedTo, readCollectionScaleRange, readCollectionVisibility, statedOpacity } from "./generate/normalizedProject.js";
28
28
  export { generateStacCatalogueFromWfsCapabilities } from "./generate/wfsStacCatalogue.js";
29
29
  export { generateStacCatalogueFromFolder } from "./generate/folderStacCatalogue.js";
30
30
  export { generateCollectionForDroppedFile, generateCollectionForLinkedFile } from "./generate/fileLayerCollection.js";
@@ -248,6 +248,14 @@ export interface LayerEntry {
248
248
  * layer hides none.
249
249
  */
250
250
  serverHiddenFields?: ServerHiddenFields;
251
+ /**
252
+ * The rules each field has that the layer's Collection does not carry,
253
+ * keyed by field name, in the order they are read: an edit widget that is
254
+ * not read, a default value expression or a constraint expression
255
+ * `readQgisExpression` cannot read. Each is also a `ProjectNote`. Absent
256
+ * where the layer leaves none out.
257
+ */
258
+ fieldRulesLeftOut?: Record<string, FieldRuleLeftOut[]>;
251
259
  /**
252
260
  * All named styles defined for the layer. QGIS allows multiple symbology
253
261
  * styles per layer (e.g. "Asset Owner" + "Priority") with one currently
@@ -808,6 +816,19 @@ export interface LayerTreeLeaf {
808
816
  checked: boolean;
809
817
  }
810
818
  /** The fields of a layer QGIS Server hides, by the service that hides them. */
819
+ /**
820
+ * A rule of a field that its Collection does not carry, as
821
+ * `quac:rules_left_out` writes it: `rule` says which, `text` is the widget's
822
+ * type, the expression, or the lookup layer's name, and `strength` is a
823
+ * constraint expression's.
824
+ */
825
+ export interface FieldRuleLeftOut {
826
+ rule: FieldRuleLeftOutKind;
827
+ text: string | null;
828
+ strength?: 'enforced' | 'warn';
829
+ }
830
+ /** The kinds of field rule a Collection leaves out (`quac:rules_left_out`). */
831
+ export type FieldRuleLeftOutKind = 'widget' | 'default' | 'constraint' | 'value_relation';
811
832
  export interface ServerHiddenFields {
812
833
  wms: string[];
813
834
  wfs: string[];
@@ -200,6 +200,27 @@ export interface TableColumn {
200
200
  'quac:control'?: 'buttons' | 'dropdown';
201
201
  /** Written only as `true`: the source's form puts the column's name above its value. */
202
202
  'quac:label_on_top'?: true;
203
+ /**
204
+ * The QGIS Server services that leave the column's values out, `wms` before
205
+ * `wfs`. Written only where the source hides the column from one.
206
+ */
207
+ 'quac:qgis_server_hidden'?: TableColumnServerService[];
208
+ /** The column's rules the catalogue leaves out, in the order the source was read. */
209
+ 'quac:rules_left_out'?: TableColumnRuleLeftOut[];
210
+ }
211
+ /** A QGIS Server service that can hide a column (`quac:qgis_server_hidden`). */
212
+ export type TableColumnServerService = 'wms' | 'wfs';
213
+ /**
214
+ * A rule of a column the catalogue leaves out: an edit `widget` it does not
215
+ * read, a `default` or `constraint` expression it cannot read, or a
216
+ * `value_relation` whose lookup is not in the catalogue. `text` is the
217
+ * widget's type, the expression or the lookup layer's name, and `strength` a
218
+ * constraint's.
219
+ */
220
+ export interface TableColumnRuleLeftOut {
221
+ rule: 'widget' | 'default' | 'constraint' | 'value_relation';
222
+ text?: string;
223
+ strength?: 'enforced' | 'warn';
203
224
  }
204
225
  /**
205
226
  * A column whose choices come from another Collection's records: `key` is the
@@ -72,7 +72,13 @@ function parseMapLayer(maplayer, notes, photoSettings) {
72
72
  if (!id)
73
73
  return null;
74
74
  const layerNotes = [];
75
- const note = (reason, field, text) => layerNotes.push({ layerId: id, layerName: name, field, reason, text });
75
+ const fieldRulesLeftOut = nameRecord();
76
+ const note = (reason, field, text, strength) => {
77
+ layerNotes.push({ layerId: id, layerName: name, field, reason, text });
78
+ if (field !== null && (reason === 'widget' || reason === 'default' || reason === 'constraint')) {
79
+ (fieldRulesLeftOut[field] ??= []).push({ rule: reason, text, ...(strength ? { strength } : {}) });
80
+ }
81
+ };
76
82
  const type = maplayer.getAttribute('type') ?? '';
77
83
  const geometryType = maplayer.getAttribute('geometry') || null;
78
84
  const wkbType = maplayer.getAttribute('wkbType') || null;
@@ -133,6 +139,8 @@ function parseMapLayer(maplayer, notes, photoSettings) {
133
139
  locks: parseQfieldSyncLocks(maplayer),
134
140
  rawXml: new XMLSerializer().serializeToString(maplayer)
135
141
  };
142
+ if (Object.keys(fieldRulesLeftOut).length > 0)
143
+ layer.fieldRulesLeftOut = fieldRulesLeftOut;
136
144
  // Added once the layer is read whole, so a layer that fails part way leaves one `layer` note.
137
145
  notes.push(...layerNotes);
138
146
  return layer;
@@ -617,7 +625,7 @@ function parseFieldEditRules(maplayer, note) {
617
625
  ruleFor(name).constraintExpression = expression;
618
626
  }
619
627
  else
620
- note('constraint', name, written.expression);
628
+ note('constraint', name, written.expression, strength);
621
629
  }
622
630
  }
623
631
  // A Range with Allow NULL off, or a Date/Time with it off, is a required
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vectoriahq/quac",
3
- "version": "0.23.0",
3
+ "version": "0.24.0",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "description": "Writes and reads QUAC, which adds map layer settings to STAC catalogues.",
@@ -113,6 +113,21 @@
113
113
  "additionalProperties": false
114
114
  }
115
115
  },
116
+ "quac:logo_left_out": {
117
+ "description": "On the top-level Catalog: the logo variables the source sets that write no icon link, the logo's first, each by the variable's name, never its value, with why it writes none. Written from a QGIS project's quac_logo and quac_logo_dark variables.",
118
+ "type": "array",
119
+ "minItems": 1,
120
+ "maxItems": 2,
121
+ "items": {
122
+ "type": "object",
123
+ "required": ["variable", "reason"],
124
+ "properties": {
125
+ "variable": { "enum": ["quac_logo", "quac_logo_dark"] },
126
+ "reason": { "enum": ["not_an_image", "not_relative", "outside_folder", "not_read", "no_logo"] }
127
+ },
128
+ "additionalProperties": false
129
+ }
130
+ },
116
131
  "quac:visibility_checked": {
117
132
  "description": "On a group: whether the group opens switched on. In a catalogue of basemaps, true marks the basemap that is shown first, and false keeps a group hidden.",
118
133
  "type": "boolean"
@@ -683,6 +698,36 @@
683
698
  "description": "The form puts the field's name above its value, across the form's width. Written from QGIS's Label on top in the Attributes Form.",
684
699
  "const": true
685
700
  },
701
+ "quac:qgis_server_hidden": {
702
+ "description": "The QGIS Server services that leave the field's values out: wms for GetFeatureInfo and GetProjectSettings, wfs for DescribeFeatureType and GetFeature, in that order. Written from the WMS and WFS boxes of QGIS's QGIS Server settings in the Attributes Form.",
703
+ "type": "array",
704
+ "minItems": 1,
705
+ "maxItems": 2,
706
+ "uniqueItems": true,
707
+ "items": { "enum": ["wms", "wfs"] }
708
+ },
709
+ "quac:rules_left_out": {
710
+ "description": "The field's rules the catalogue leaves out, in the order the source was read: an edit widget it does not read, a default or constraint expression it cannot read, or a Value Relation whose lookup layer is not in the catalogue.",
711
+ "type": "array",
712
+ "minItems": 1,
713
+ "items": {
714
+ "type": "object",
715
+ "required": ["rule"],
716
+ "properties": {
717
+ "rule": { "enum": ["widget", "default", "constraint", "value_relation"] },
718
+ "text": {
719
+ "description": "The widget's type, or the expression, as the source wrote it.",
720
+ "type": "string",
721
+ "minLength": 1
722
+ },
723
+ "strength": {
724
+ "description": "A constraint expression's strength: enforced refuses a value it fails, warn saves it with a warning.",
725
+ "enum": ["enforced", "warn"]
726
+ }
727
+ },
728
+ "additionalProperties": false
729
+ }
730
+ },
686
731
  "quac:values": {
687
732
  "description": "The values the field takes, each with the label a form shows for it, in the source's order. Written from a QGIS Value Map widget or an ArcGIS coded-value domain.",
688
733
  "type": "array",