@stndrds/schema 1.0.0-alpha.230 → 1.0.0-alpha.232

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.
Files changed (59) hide show
  1. package/dist/{attributes-DZIol94T.d.ts → attributes-B4847Nul.d.ts} +14 -2
  2. package/dist/{attributes-C6pCxr5P.d.mts → attributes-BpMes5H_.d.mts} +14 -2
  3. package/dist/{chunk-MUGKKCY3.js → chunk-6SPNZSXS.js} +11 -3
  4. package/dist/{chunk-6CTUPVHH.mjs → chunk-FRWPIJDK.mjs} +10 -2
  5. package/dist/chunk-Q44QKLN4.mjs +43 -0
  6. package/dist/chunk-SI34M4IC.js +45 -0
  7. package/dist/{helpers-B3EPtA8t.d.ts → helpers-DsJff5r-.d.ts} +2 -2
  8. package/dist/{helpers-Ca3PIt9O.d.mts → helpers-ow7sORSi.d.mts} +2 -2
  9. package/dist/index.d.mts +153 -14
  10. package/dist/index.d.ts +153 -14
  11. package/dist/index.js +203 -95
  12. package/dist/index.mjs +129 -29
  13. package/dist/{types-CBV2_ikK.d.ts → types-C8nztuFF.d.ts} +1 -1
  14. package/dist/{types-DjGoodOL.d.mts → types-CyxVuV_d.d.mts} +1 -1
  15. package/dist/validation/all.d.mts +3 -3
  16. package/dist/validation/all.d.ts +3 -3
  17. package/dist/validation/all.js +9 -9
  18. package/dist/validation/all.mjs +2 -2
  19. package/dist/validation/complex/currency.d.mts +2 -2
  20. package/dist/validation/complex/currency.d.ts +2 -2
  21. package/dist/validation/complex/file.d.mts +2 -2
  22. package/dist/validation/complex/file.d.ts +2 -2
  23. package/dist/validation/complex/location.d.mts +2 -2
  24. package/dist/validation/complex/location.d.ts +2 -2
  25. package/dist/validation/complex/phone.d.mts +2 -2
  26. package/dist/validation/complex/phone.d.ts +2 -2
  27. package/dist/validation/complex/relation.d.mts +2 -2
  28. package/dist/validation/complex/relation.d.ts +2 -2
  29. package/dist/validation/complex/richtext.d.mts +2 -2
  30. package/dist/validation/complex/richtext.d.ts +2 -2
  31. package/dist/validation/complex/select.d.mts +2 -2
  32. package/dist/validation/complex/select.d.ts +2 -2
  33. package/dist/validation/complex/user.d.mts +2 -2
  34. package/dist/validation/complex/user.d.ts +2 -2
  35. package/dist/validation/computed/formula.d.mts +2 -2
  36. package/dist/validation/computed/formula.d.ts +2 -2
  37. package/dist/validation/computed/rollup.d.mts +2 -2
  38. package/dist/validation/computed/rollup.d.ts +2 -2
  39. package/dist/validation/config/index.d.mts +1 -1
  40. package/dist/validation/config/index.d.ts +1 -1
  41. package/dist/validation/core/index.d.mts +3 -3
  42. package/dist/validation/core/index.d.ts +3 -3
  43. package/dist/validation/object/index.d.mts +3 -3
  44. package/dist/validation/object/index.d.ts +3 -3
  45. package/dist/validation/object/index.js +15 -15
  46. package/dist/validation/object/index.mjs +2 -2
  47. package/dist/validation/primitives/checkbox.d.mts +2 -2
  48. package/dist/validation/primitives/checkbox.d.ts +2 -2
  49. package/dist/validation/primitives/date.d.mts +16 -3
  50. package/dist/validation/primitives/date.d.ts +16 -3
  51. package/dist/validation/primitives/date.js +2 -2
  52. package/dist/validation/primitives/date.mjs +1 -1
  53. package/dist/validation/primitives/number.d.mts +2 -2
  54. package/dist/validation/primitives/number.d.ts +2 -2
  55. package/dist/validation/primitives/text.d.mts +2 -2
  56. package/dist/validation/primitives/text.d.ts +2 -2
  57. package/package.json +2 -2
  58. package/dist/chunk-6I2R22CX.mjs +0 -8
  59. package/dist/chunk-O44XVGHE.js +0 -10
package/dist/index.js CHANGED
@@ -3,9 +3,9 @@
3
3
  var chunkFRCDMQER_js = require('./chunk-FRCDMQER.js');
4
4
  require('./chunk-PGERPYDR.js');
5
5
  var chunkNSM2JPC3_js = require('./chunk-NSM2JPC3.js');
6
- var chunkMUGKKCY3_js = require('./chunk-MUGKKCY3.js');
6
+ var chunk6SPNZSXS_js = require('./chunk-6SPNZSXS.js');
7
7
  require('./chunk-5WATIVCA.js');
8
- require('./chunk-O44XVGHE.js');
8
+ require('./chunk-SI34M4IC.js');
9
9
  require('./chunk-YIP5FJ5H.js');
10
10
  require('./chunk-SGSGREPG.js');
11
11
  require('./chunk-EW5XR2X3.js');
@@ -524,6 +524,9 @@ function isFormSlotFieldRef(f) {
524
524
  function isFormFreeFieldRef(f) {
525
525
  return f.type === "free";
526
526
  }
527
+ function getSlotFieldTargets(field) {
528
+ return field.additionalSlotIds?.length ? [field.slotId, ...field.additionalSlotIds] : [field.slotId];
529
+ }
527
530
 
528
531
  // src/types/forms/rows.ts
529
532
  function isFormFieldsRow(row) {
@@ -806,6 +809,28 @@ function parseQualifiedAttribute(name) {
806
809
  function buildQualifiedAttribute(root, property) {
807
810
  return `${root}${QUALIFIED_SEPARATOR}${property}`;
808
811
  }
812
+
813
+ // src/lib/date-value.ts
814
+ function isDateRangeValue(value) {
815
+ return typeof value === "object" && value !== null && typeof value.start === "string";
816
+ }
817
+ function normalizeDateValue(value, attr) {
818
+ if (value == null || value === "") return null;
819
+ if (isDateRangeValue(value)) {
820
+ return attr.endDate ? { start: value.start, end: value.end ?? null } : value.start;
821
+ }
822
+ if (typeof value === "string") {
823
+ return attr.endDate ? { start: value, end: null } : value;
824
+ }
825
+ return null;
826
+ }
827
+ function dateValueStart(value) {
828
+ if (typeof value === "string" && value !== "") return value;
829
+ if (isDateRangeValue(value) && value.start !== "") return value.start;
830
+ return null;
831
+ }
832
+
833
+ // src/format.ts
809
834
  var EMPTY_VALUE_PLACEHOLDER = "\u2014";
810
835
  function formatText(value) {
811
836
  return String(value);
@@ -848,6 +873,10 @@ function formatCurrency(value, _attribute) {
848
873
  return `${formattedValue} ${currency2.code}`;
849
874
  }
850
875
  function formatDate(value) {
876
+ if (isDateRangeValue(value)) {
877
+ const start = formatDate(value.start);
878
+ return value.end ? `${start} \u2192 ${formatDate(value.end)}` : start;
879
+ }
851
880
  if (value instanceof Date) {
852
881
  return value.toISOString().split("T")[0];
853
882
  }
@@ -1108,6 +1137,46 @@ function extractAttributeNames(template) {
1108
1137
  return names;
1109
1138
  }
1110
1139
 
1140
+ // src/lib/relation-label.ts
1141
+ var PROPS_TOKEN_RE = /\{\{\s*props\./;
1142
+ function applyRelationProps(label, props, propertyDefs) {
1143
+ if (!PROPS_TOKEN_RE.test(label)) return label;
1144
+ const formattedProps = {};
1145
+ const defMap = new Map(propertyDefs?.map((d) => [d.name, d]));
1146
+ if (props) {
1147
+ for (const [key, value] of Object.entries(props)) {
1148
+ if (value == null) continue;
1149
+ const def = defMap.get(key);
1150
+ if (def) {
1151
+ const formatted = formatAttributeValue(value, def);
1152
+ formattedProps[key] = formatted === EMPTY_VALUE_PLACEHOLDER ? "" : formatted;
1153
+ } else {
1154
+ formattedProps[key] = value;
1155
+ }
1156
+ }
1157
+ }
1158
+ const result = renderLabelExpression(label, { props: formattedProps }, "");
1159
+ return result.replace(/\(\s*\)/g, "").replace(/\[\s*\]/g, "").replace(/\s*[-—|:]\s*$/g, "").replace(/\s{2,}/g, " ").trim();
1160
+ }
1161
+ function extractValueRefs(value) {
1162
+ if (value === null || value === void 0 || value === "") return [];
1163
+ if (typeof value === "string") return [{ id: value }];
1164
+ if (Array.isArray(value)) return value.flatMap((item) => extractValueRefs(item));
1165
+ if (typeof value === "object" && "id" in value) {
1166
+ const obj = value;
1167
+ if (typeof obj.id === "string") return [{ id: obj.id, props: obj.props }];
1168
+ }
1169
+ return [];
1170
+ }
1171
+
1172
+ // src/lib/user-display.ts
1173
+ function getUserDisplayName(user2) {
1174
+ if (user2.firstName || user2.lastName) {
1175
+ return [user2.firstName, user2.lastName].filter(Boolean).join(" ");
1176
+ }
1177
+ return user2.email?.split("@")[0] ?? "";
1178
+ }
1179
+
1111
1180
  // src/constants/attribute-columns.ts
1112
1181
  var DB_COLUMN_FIELDS = /* @__PURE__ */ new Set([
1113
1182
  "id",
@@ -1208,7 +1277,10 @@ var DEFAULT_ROLE_PERMISSIONS = {
1208
1277
  system: [
1209
1278
  { target: "people", actions: ["read"] },
1210
1279
  { target: "workspace", actions: ["read"] },
1211
- { target: "connectors", actions: MEMBER_CONNECTOR_ACTIONS }
1280
+ { target: "connectors", actions: MEMBER_CONNECTOR_ACTIONS },
1281
+ // Everyday file usage; delete stays with owner/custom roles. Boot-time
1282
+ // additive merge back-fills existing tenants when this list grows.
1283
+ { target: "files", actions: ["read", "create", "update"] }
1212
1284
  ],
1213
1285
  object: [{ target: "*", actions: ALL_ACTIONS2 }]
1214
1286
  },
@@ -1346,7 +1418,7 @@ var BaseAttributeBuilder = class {
1346
1418
  * @see https://standardschema.dev/
1347
1419
  */
1348
1420
  get "~standard"() {
1349
- const zodSchema = chunkMUGKKCY3_js.createAttributeValidator(this.build());
1421
+ const zodSchema = chunk6SPNZSXS_js.createAttributeValidator(this.build());
1350
1422
  return createStandardSchemaProps(zodSchema);
1351
1423
  }
1352
1424
  constructor(type, name, label) {
@@ -1605,6 +1677,20 @@ var DateAttributeBuilder = class extends BaseAttributeBuilder {
1605
1677
  this.attr.maxDate = value;
1606
1678
  return this;
1607
1679
  }
1680
+ /** Values become { start, end } ranges; flips the inferred value type. */
1681
+ endDate() {
1682
+ this.attr.endDate = true;
1683
+ return this.asPhantomState();
1684
+ }
1685
+ /** Values carry a time component (stored as full ISO UTC datetimes). */
1686
+ includeTime() {
1687
+ this.attr.includeTime = true;
1688
+ return this;
1689
+ }
1690
+ timeFormat(value) {
1691
+ this.attr.timeFormat = value;
1692
+ return this;
1693
+ }
1608
1694
  required() {
1609
1695
  this.setRequired(true);
1610
1696
  return this.asRequiredState();
@@ -2119,9 +2205,9 @@ var RollupAttributeBuilder = class extends BaseAttributeBuilder {
2119
2205
  if (fn === "original" && targetType !== void 0 && targetType !== "select" && targetType !== "status" && targetType !== "multiselect") {
2120
2206
  const relation2 = this.attr.relationAttribute ?? "relation";
2121
2207
  const target = this.attr.targetAttribute ?? "field";
2122
- throw new chunkMUGKKCY3_js.SchemaError(
2208
+ throw new chunk6SPNZSXS_js.SchemaError(
2123
2209
  `Rollup "${this.attr.name}": .using("original") only supports a "select", "status", or "multiselect" target, but .targetType("${targetType}") was given. To surface a plain ${targetType} value from a related record, use a formula instead \u2014 e.g. formula({ name: "${this.attr.name}", label: "\u2026" }).expression("${relation2}.${target}").`,
2124
- chunkMUGKKCY3_js.SchemaErrorCode.VALIDATION_FAILED
2210
+ chunk6SPNZSXS_js.SchemaErrorCode.VALIDATION_FAILED
2125
2211
  );
2126
2212
  }
2127
2213
  return super.build();
@@ -2188,22 +2274,27 @@ var DocumentAttributeBuilder = class extends BaseAttributeBuilder {
2188
2274
  function document(config) {
2189
2275
  return new DocumentAttributeBuilder(config.name, config.label);
2190
2276
  }
2277
+ function buildSlotFieldRef(slotIdOrIds, attribute, options) {
2278
+ const ids = Array.isArray(slotIdOrIds) ? slotIdOrIds : [slotIdOrIds];
2279
+ const [slotId, ...additional] = ids;
2280
+ return {
2281
+ type: "slot",
2282
+ slotId,
2283
+ additionalSlotIds: additional.length > 0 ? additional : void 0,
2284
+ attribute,
2285
+ label: options?.label,
2286
+ required: options?.required,
2287
+ tooltip: options?.tooltip
2288
+ };
2289
+ }
2191
2290
  var FormRowBuilder = class {
2192
2291
  constructor(stepBuilder, rowId, order) {
2193
2292
  this._finalized = false;
2194
2293
  this.stepBuilder = stepBuilder;
2195
2294
  this.rowData = { id: rowId, order, type: "fields", fields: [] };
2196
2295
  }
2197
- field(slotId, attribute, options) {
2198
- const ref = {
2199
- type: "slot",
2200
- slotId,
2201
- attribute,
2202
- label: options?.label,
2203
- required: options?.required,
2204
- tooltip: options?.tooltip
2205
- };
2206
- this.rowData.fields.push(ref);
2296
+ field(slotIdOrIds, attribute, options) {
2297
+ this.rowData.fields.push(buildSlotFieldRef(slotIdOrIds, attribute, options));
2207
2298
  return this;
2208
2299
  }
2209
2300
  freeField(builder, options) {
@@ -2250,17 +2341,10 @@ var FormStepBuilder = class {
2250
2341
  this.stepData.description = text2;
2251
2342
  return this;
2252
2343
  }
2253
- field(slotId, attribute, options) {
2344
+ field(slotIdOrIds, attribute, options) {
2254
2345
  this.rowOrder++;
2255
2346
  const rowId = `row-${this.stepData.id}-${this.rowOrder}`;
2256
- const ref = {
2257
- type: "slot",
2258
- slotId,
2259
- attribute,
2260
- label: options?.label,
2261
- required: options?.required,
2262
- tooltip: options?.tooltip
2263
- };
2347
+ const ref = buildSlotFieldRef(slotIdOrIds, attribute, options);
2264
2348
  const row = { id: rowId, order: this.rowOrder, type: "fields", fields: [ref] };
2265
2349
  this.stepData.rows.push(row);
2266
2350
  return this;
@@ -2415,17 +2499,26 @@ var FormBuilder = class {
2415
2499
  }
2416
2500
  }
2417
2501
  validateSlotReferences() {
2418
- const slotIds = new Set(this.data.slots.map((s) => s.id));
2502
+ const objectBySlot = new Map(this.data.slots.map((s) => [s.id, s.objectName]));
2419
2503
  for (const step of this.data.steps) {
2420
2504
  for (const row of step.rows) {
2421
- if (isFormFieldsRow(row)) {
2422
- for (const field of row.fields) {
2423
- if (field.type === "slot" && !slotIds.has(field.slotId)) {
2505
+ if (!isFormFieldsRow(row)) continue;
2506
+ for (const field of row.fields) {
2507
+ if (field.type !== "slot") continue;
2508
+ const targets = getSlotFieldTargets(field);
2509
+ for (const slotId of targets) {
2510
+ if (!objectBySlot.has(slotId)) {
2424
2511
  throw new Error(
2425
- `[FormBuilder] Step "${step.id}" references unknown slot "${field.slotId}". Declare it with .slot("${field.slotId}", ...) first.`
2512
+ `[FormBuilder] Step "${step.id}" references unknown slot "${slotId}". Declare it with .slot("${slotId}", ...) first.`
2426
2513
  );
2427
2514
  }
2428
2515
  }
2516
+ const objects = new Set(targets.map((id) => objectBySlot.get(id)));
2517
+ if (objects.size > 1) {
2518
+ throw new Error(
2519
+ `[FormBuilder] Step "${step.id}" field on attribute "${field.attribute}" targets slots of different objects (${[...objects].join(", ")}). A multi-slot field must target slots of the same object.`
2520
+ );
2521
+ }
2429
2522
  }
2430
2523
  }
2431
2524
  }
@@ -2617,7 +2710,7 @@ var ObjectBuilder = class {
2617
2710
  * @see https://standardschema.dev/
2618
2711
  */
2619
2712
  get "~standard"() {
2620
- const zodSchema = chunkMUGKKCY3_js.createObjectValidator(this.build());
2713
+ const zodSchema = chunk6SPNZSXS_js.createObjectValidator(this.build());
2621
2714
  return createStandardSchemaProps(zodSchema);
2622
2715
  }
2623
2716
  /**
@@ -2831,26 +2924,26 @@ var ObjectBuilder = class {
2831
2924
  throw new Error("[ObjectBuilder] Missing required field: label");
2832
2925
  }
2833
2926
  if (!this._labelExpression) {
2834
- throw new chunkMUGKKCY3_js.SchemaError(
2927
+ throw new chunk6SPNZSXS_js.SchemaError(
2835
2928
  `Object "${this.obj.name}" must have a labelExpression. The labelExpression defines how records are displayed in lists and relations (e.g. "{{ name }}").`,
2836
- chunkMUGKKCY3_js.SchemaErrorCode.VALIDATION_FAILED
2929
+ chunk6SPNZSXS_js.SchemaErrorCode.VALIDATION_FAILED
2837
2930
  );
2838
2931
  }
2839
2932
  const labelResult = labelExpressionSchema.safeParse(this._labelExpression);
2840
2933
  if (!labelResult.success) {
2841
2934
  const errorMsg = labelResult.error.issues[0]?.message ?? "Invalid labelExpression";
2842
- throw new chunkMUGKKCY3_js.SchemaError(
2935
+ throw new chunk6SPNZSXS_js.SchemaError(
2843
2936
  `Invalid labelExpression for "${this.obj.name}": ${errorMsg}`,
2844
- chunkMUGKKCY3_js.SchemaErrorCode.VALIDATION_FAILED
2937
+ chunk6SPNZSXS_js.SchemaErrorCode.VALIDATION_FAILED
2845
2938
  );
2846
2939
  }
2847
2940
  if (this._embeddingExpression !== void 0) {
2848
2941
  const embeddingResult = labelExpressionSchema.safeParse(this._embeddingExpression);
2849
2942
  if (!embeddingResult.success) {
2850
2943
  const errorMsg = embeddingResult.error.issues[0]?.message ?? "Invalid embeddingExpression";
2851
- throw new chunkMUGKKCY3_js.SchemaError(
2944
+ throw new chunk6SPNZSXS_js.SchemaError(
2852
2945
  `Invalid embeddingExpression for "${this.obj.name}": ${errorMsg}`,
2853
- chunkMUGKKCY3_js.SchemaErrorCode.VALIDATION_FAILED
2946
+ chunk6SPNZSXS_js.SchemaErrorCode.VALIDATION_FAILED
2854
2947
  );
2855
2948
  }
2856
2949
  }
@@ -2891,7 +2984,7 @@ var ObjectBuilder = class {
2891
2984
  objectNameSchema.parse(name);
2892
2985
  } catch (error) {
2893
2986
  if (error instanceof z3__default.default.ZodError) {
2894
- throw new chunkMUGKKCY3_js.SchemaError(error.issues[0].message, chunkMUGKKCY3_js.SchemaErrorCode.INVALID_OBJECT_NAME);
2987
+ throw new chunk6SPNZSXS_js.SchemaError(error.issues[0].message, chunk6SPNZSXS_js.SchemaErrorCode.INVALID_OBJECT_NAME);
2895
2988
  }
2896
2989
  throw error;
2897
2990
  }
@@ -2902,7 +2995,7 @@ function object(config) {
2902
2995
  }
2903
2996
  function validatePresetStructure(presetId, nodes, depth) {
2904
2997
  const fail = (message, detail) => {
2905
- throw new chunkMUGKKCY3_js.ValidationError(message, [
2998
+ throw new chunk6SPNZSXS_js.ValidationError(message, [
2906
2999
  { path: ["documentLayout", "presets", presetId], message: detail }
2907
3000
  ]);
2908
3001
  };
@@ -6901,7 +6994,7 @@ function assertOperatorForType(operator, type, context) {
6901
6994
  if (!ops?.includes(operator)) {
6902
6995
  const validList = ops?.length ? ops.join(", ") : "(no operators registered for this type)";
6903
6996
  const summary = `Operator "${operator}" is not valid for ${context} type "${type}". Valid operators: ${validList}.`;
6904
- throw new chunkMUGKKCY3_js.ValidationError(summary, [
6997
+ throw new chunk6SPNZSXS_js.ValidationError(summary, [
6905
6998
  {
6906
6999
  path: ["operator"],
6907
7000
  message: summary
@@ -6917,7 +7010,7 @@ function assertRelativeDateValue(rule) {
6917
7010
  const valid = typeof v === "object" && v !== null && typeof v.amount === "number" && Number.isFinite(v.amount) && v.amount > 0 && typeof v.unit === "string" && RELATIVE_DATE_UNITS.has(v.unit) && typeof v.direction === "string" && RELATIVE_DATE_DIRECTIONS.has(v.direction);
6918
7011
  if (!valid) {
6919
7012
  const m = `Operator "is_within" requires a relative-date value { amount: positive number, unit: days|weeks|months|years, direction: past|future }`;
6920
- throw new chunkMUGKKCY3_js.ValidationError(m, [{ path: ["value"], message: m }]);
7013
+ throw new chunk6SPNZSXS_js.ValidationError(m, [{ path: ["value"], message: m }]);
6921
7014
  }
6922
7015
  }
6923
7016
  function assertDynamicValueForAttribute(rule, attrType) {
@@ -6925,34 +7018,34 @@ function assertDynamicValueForAttribute(rule, attrType) {
6925
7018
  const v = rule.value;
6926
7019
  if (v.dynamic === "actor" && attrType !== "user") {
6927
7020
  const m = `actor token (@me) is only valid on user attributes, not "${attrType}"`;
6928
- throw new chunkMUGKKCY3_js.ValidationError(m, [{ path: ["value"], message: m }]);
7021
+ throw new chunk6SPNZSXS_js.ValidationError(m, [{ path: ["value"], message: m }]);
6929
7022
  }
6930
7023
  if (v.dynamic === "date" && attrType !== "date") {
6931
7024
  const m = `date token (@today/@now) is only valid on date attributes, not "${attrType}"`;
6932
- throw new chunkMUGKKCY3_js.ValidationError(m, [{ path: ["value"], message: m }]);
7025
+ throw new chunk6SPNZSXS_js.ValidationError(m, [{ path: ["value"], message: m }]);
6933
7026
  }
6934
7027
  }
6935
7028
  function validateQualifiedRule(rule, context) {
6936
7029
  const rootAttr = context.attributes.find((a) => a.name === rule.attribute);
6937
7030
  const systemOps = SYSTEM_FILTER_OPERATORS[rule.attribute];
6938
7031
  if (!(rootAttr || systemOps)) {
6939
- throw new chunkMUGKKCY3_js.ValidationError(`Unknown attribute: ${rule.attribute}`, [
7032
+ throw new chunk6SPNZSXS_js.ValidationError(`Unknown attribute: ${rule.attribute}`, [
6940
7033
  { path: ["attribute"], message: `Unknown attribute: ${rule.attribute}` }
6941
7034
  ]);
6942
7035
  }
6943
7036
  if (rule.quantifier !== void 0 && !rule.property) {
6944
7037
  const m = `quantifier is only valid on qualified edge rules (set "property")`;
6945
- throw new chunkMUGKKCY3_js.ValidationError(m, [{ path: ["quantifier"], message: m }]);
7038
+ throw new chunk6SPNZSXS_js.ValidationError(m, [{ path: ["quantifier"], message: m }]);
6946
7039
  }
6947
7040
  if (!rootAttr) {
6948
7041
  if (rule.property) {
6949
- throw new chunkMUGKKCY3_js.ValidationError(`Cannot qualify system attribute "${rule.attribute}"`, [
7042
+ throw new chunk6SPNZSXS_js.ValidationError(`Cannot qualify system attribute "${rule.attribute}"`, [
6950
7043
  { path: ["property"], message: `"${rule.attribute}" is a system column, not a reference` }
6951
7044
  ]);
6952
7045
  }
6953
7046
  if (!systemOps.includes(rule.operator)) {
6954
7047
  const summary = `Operator "${rule.operator}" is not valid for system attribute "${rule.attribute}". Valid operators: ${systemOps.join(", ")}.`;
6955
- throw new chunkMUGKKCY3_js.ValidationError(summary, [{ path: ["operator"], message: summary }]);
7048
+ throw new chunk6SPNZSXS_js.ValidationError(summary, [{ path: ["operator"], message: summary }]);
6956
7049
  }
6957
7050
  assertRelativeDateValue(rule);
6958
7051
  return;
@@ -6963,25 +7056,25 @@ function validateQualifiedRule(rule, context) {
6963
7056
  if (!ops.includes(rule.operator)) {
6964
7057
  const validList = ops.length ? ops.join(", ") : "(not filterable)";
6965
7058
  const summary = `Operator "${rule.operator}" is not valid for attribute "${rootAttr.name}". Valid operators: ${validList}.`;
6966
- throw new chunkMUGKKCY3_js.ValidationError(summary, [{ path: ["operator"], message: summary }]);
7059
+ throw new chunk6SPNZSXS_js.ValidationError(summary, [{ path: ["operator"], message: summary }]);
6967
7060
  }
6968
7061
  assertRelativeDateValue(rule);
6969
7062
  return;
6970
7063
  }
6971
7064
  if (!REFERENCE_TYPES.has(rootAttr.type)) {
6972
- throw new chunkMUGKKCY3_js.ValidationError(`Cannot qualify ${rootAttr.type} attribute "${rule.attribute}"`, [
7065
+ throw new chunk6SPNZSXS_js.ValidationError(`Cannot qualify ${rootAttr.type} attribute "${rule.attribute}"`, [
6973
7066
  { path: ["property"], message: `Attribute "${rule.attribute}" is not a reference type` }
6974
7067
  ]);
6975
7068
  }
6976
7069
  const propSchema = rootAttr.properties;
6977
7070
  if (!propSchema) {
6978
- throw new chunkMUGKKCY3_js.ValidationError(`Attribute "${rule.attribute}" has no qualifyWith schema`, [
7071
+ throw new chunk6SPNZSXS_js.ValidationError(`Attribute "${rule.attribute}" has no qualifyWith schema`, [
6979
7072
  { path: ["property"], message: `"${rule.attribute}" has no qualifyWith` }
6980
7073
  ]);
6981
7074
  }
6982
7075
  const propDef = propSchema.definitions.find((p) => p.name === rule.property);
6983
7076
  if (!propDef) {
6984
- throw new chunkMUGKKCY3_js.ValidationError(
7077
+ throw new chunk6SPNZSXS_js.ValidationError(
6985
7078
  `Property "${rule.property}" not defined on "${rule.attribute}".qualifyWith()`,
6986
7079
  [{ path: ["property"], message: `Unknown property: ${rule.property}` }]
6987
7080
  );
@@ -6990,6 +7083,13 @@ function validateQualifiedRule(rule, context) {
6990
7083
  assertRelativeDateValue(rule);
6991
7084
  }
6992
7085
 
7086
+ // src/connectors/types.ts
7087
+ var CONNECTOR_CALLBACK_PARAM = {
7088
+ status: "connector_status",
7089
+ error: "connector_error",
7090
+ provider: "connector_provider"
7091
+ };
7092
+
6993
7093
  Object.defineProperty(exports, "asTenantId", {
6994
7094
  enumerable: true,
6995
7095
  get: function () { return chunkFRCDMQER_js.asTenantId; }
@@ -7024,179 +7124,179 @@ Object.defineProperty(exports, "parseComputedFormula", {
7024
7124
  });
7025
7125
  Object.defineProperty(exports, "AccessDeniedError", {
7026
7126
  enumerable: true,
7027
- get: function () { return chunkMUGKKCY3_js.AccessDeniedError; }
7127
+ get: function () { return chunk6SPNZSXS_js.AccessDeniedError; }
7028
7128
  });
7029
7129
  Object.defineProperty(exports, "AttributeInUseError", {
7030
7130
  enumerable: true,
7031
- get: function () { return chunkMUGKKCY3_js.AttributeInUseError; }
7131
+ get: function () { return chunk6SPNZSXS_js.AttributeInUseError; }
7032
7132
  });
7033
7133
  Object.defineProperty(exports, "AttributeNotFoundError", {
7034
7134
  enumerable: true,
7035
- get: function () { return chunkMUGKKCY3_js.AttributeNotFoundError; }
7135
+ get: function () { return chunk6SPNZSXS_js.AttributeNotFoundError; }
7036
7136
  });
7037
7137
  Object.defineProperty(exports, "ChangeTypeNotSupportedError", {
7038
7138
  enumerable: true,
7039
- get: function () { return chunkMUGKKCY3_js.ChangeTypeNotSupportedError; }
7139
+ get: function () { return chunk6SPNZSXS_js.ChangeTypeNotSupportedError; }
7040
7140
  });
7041
7141
  Object.defineProperty(exports, "ConcurrentModificationError", {
7042
7142
  enumerable: true,
7043
- get: function () { return chunkMUGKKCY3_js.ConcurrentModificationError; }
7143
+ get: function () { return chunk6SPNZSXS_js.ConcurrentModificationError; }
7044
7144
  });
7045
7145
  Object.defineProperty(exports, "DestructiveSyncNotAllowedError", {
7046
7146
  enumerable: true,
7047
- get: function () { return chunkMUGKKCY3_js.DestructiveSyncNotAllowedError; }
7147
+ get: function () { return chunk6SPNZSXS_js.DestructiveSyncNotAllowedError; }
7048
7148
  });
7049
7149
  Object.defineProperty(exports, "DuplicateError", {
7050
7150
  enumerable: true,
7051
- get: function () { return chunkMUGKKCY3_js.DuplicateError; }
7151
+ get: function () { return chunk6SPNZSXS_js.DuplicateError; }
7052
7152
  });
7053
7153
  Object.defineProperty(exports, "ForbiddenError", {
7054
7154
  enumerable: true,
7055
- get: function () { return chunkMUGKKCY3_js.ForbiddenError; }
7155
+ get: function () { return chunk6SPNZSXS_js.ForbiddenError; }
7056
7156
  });
7057
7157
  Object.defineProperty(exports, "MemoryNotFoundError", {
7058
7158
  enumerable: true,
7059
- get: function () { return chunkMUGKKCY3_js.MemoryNotFoundError; }
7159
+ get: function () { return chunk6SPNZSXS_js.MemoryNotFoundError; }
7060
7160
  });
7061
7161
  Object.defineProperty(exports, "MigrationTimeoutError", {
7062
7162
  enumerable: true,
7063
- get: function () { return chunkMUGKKCY3_js.MigrationTimeoutError; }
7163
+ get: function () { return chunk6SPNZSXS_js.MigrationTimeoutError; }
7064
7164
  });
7065
7165
  Object.defineProperty(exports, "NotFoundError", {
7066
7166
  enumerable: true,
7067
- get: function () { return chunkMUGKKCY3_js.NotFoundError; }
7167
+ get: function () { return chunk6SPNZSXS_js.NotFoundError; }
7068
7168
  });
7069
7169
  Object.defineProperty(exports, "NotImplementedError", {
7070
7170
  enumerable: true,
7071
- get: function () { return chunkMUGKKCY3_js.NotImplementedError; }
7171
+ get: function () { return chunk6SPNZSXS_js.NotImplementedError; }
7072
7172
  });
7073
7173
  Object.defineProperty(exports, "ObjectNotFoundError", {
7074
7174
  enumerable: true,
7075
- get: function () { return chunkMUGKKCY3_js.ObjectNotFoundError; }
7175
+ get: function () { return chunk6SPNZSXS_js.ObjectNotFoundError; }
7076
7176
  });
7077
7177
  Object.defineProperty(exports, "ObjectReferencedError", {
7078
7178
  enumerable: true,
7079
- get: function () { return chunkMUGKKCY3_js.ObjectReferencedError; }
7179
+ get: function () { return chunk6SPNZSXS_js.ObjectReferencedError; }
7080
7180
  });
7081
7181
  Object.defineProperty(exports, "OrphanSystemAttributeError", {
7082
7182
  enumerable: true,
7083
- get: function () { return chunkMUGKKCY3_js.OrphanSystemAttributeError; }
7183
+ get: function () { return chunk6SPNZSXS_js.OrphanSystemAttributeError; }
7084
7184
  });
7085
7185
  Object.defineProperty(exports, "ProtectedResourceError", {
7086
7186
  enumerable: true,
7087
- get: function () { return chunkMUGKKCY3_js.ProtectedResourceError; }
7187
+ get: function () { return chunk6SPNZSXS_js.ProtectedResourceError; }
7088
7188
  });
7089
7189
  Object.defineProperty(exports, "ProtectedRoleError", {
7090
7190
  enumerable: true,
7091
- get: function () { return chunkMUGKKCY3_js.ProtectedRoleError; }
7191
+ get: function () { return chunk6SPNZSXS_js.ProtectedRoleError; }
7092
7192
  });
7093
7193
  Object.defineProperty(exports, "RecordNotFoundError", {
7094
7194
  enumerable: true,
7095
- get: function () { return chunkMUGKKCY3_js.RecordNotFoundError; }
7195
+ get: function () { return chunk6SPNZSXS_js.RecordNotFoundError; }
7096
7196
  });
7097
7197
  Object.defineProperty(exports, "RecordReferencedError", {
7098
7198
  enumerable: true,
7099
- get: function () { return chunkMUGKKCY3_js.RecordReferencedError; }
7199
+ get: function () { return chunk6SPNZSXS_js.RecordReferencedError; }
7100
7200
  });
7101
7201
  Object.defineProperty(exports, "RepositoryError", {
7102
7202
  enumerable: true,
7103
- get: function () { return chunkMUGKKCY3_js.RepositoryError; }
7203
+ get: function () { return chunk6SPNZSXS_js.RepositoryError; }
7104
7204
  });
7105
7205
  Object.defineProperty(exports, "RoleNotFoundError", {
7106
7206
  enumerable: true,
7107
- get: function () { return chunkMUGKKCY3_js.RoleNotFoundError; }
7207
+ get: function () { return chunk6SPNZSXS_js.RoleNotFoundError; }
7108
7208
  });
7109
7209
  Object.defineProperty(exports, "SchemaError", {
7110
7210
  enumerable: true,
7111
- get: function () { return chunkMUGKKCY3_js.SchemaError; }
7211
+ get: function () { return chunk6SPNZSXS_js.SchemaError; }
7112
7212
  });
7113
7213
  Object.defineProperty(exports, "SchemaErrorCode", {
7114
7214
  enumerable: true,
7115
- get: function () { return chunkMUGKKCY3_js.SchemaErrorCode; }
7215
+ get: function () { return chunk6SPNZSXS_js.SchemaErrorCode; }
7116
7216
  });
7117
7217
  Object.defineProperty(exports, "SearchBackendError", {
7118
7218
  enumerable: true,
7119
- get: function () { return chunkMUGKKCY3_js.SearchBackendError; }
7219
+ get: function () { return chunk6SPNZSXS_js.SearchBackendError; }
7120
7220
  });
7121
7221
  Object.defineProperty(exports, "StorageError", {
7122
7222
  enumerable: true,
7123
- get: function () { return chunkMUGKKCY3_js.StorageError; }
7223
+ get: function () { return chunk6SPNZSXS_js.StorageError; }
7124
7224
  });
7125
7225
  Object.defineProperty(exports, "SyncCascadeError", {
7126
7226
  enumerable: true,
7127
- get: function () { return chunkMUGKKCY3_js.SyncCascadeError; }
7227
+ get: function () { return chunk6SPNZSXS_js.SyncCascadeError; }
7128
7228
  });
7129
7229
  Object.defineProperty(exports, "SyncConflictError", {
7130
7230
  enumerable: true,
7131
- get: function () { return chunkMUGKKCY3_js.SyncConflictError; }
7231
+ get: function () { return chunk6SPNZSXS_js.SyncConflictError; }
7132
7232
  });
7133
7233
  Object.defineProperty(exports, "SyncError", {
7134
7234
  enumerable: true,
7135
- get: function () { return chunkMUGKKCY3_js.SyncError; }
7235
+ get: function () { return chunk6SPNZSXS_js.SyncError; }
7136
7236
  });
7137
7237
  Object.defineProperty(exports, "SystemEntityImmutableError", {
7138
7238
  enumerable: true,
7139
- get: function () { return chunkMUGKKCY3_js.SystemEntityImmutableError; }
7239
+ get: function () { return chunk6SPNZSXS_js.SystemEntityImmutableError; }
7140
7240
  });
7141
7241
  Object.defineProperty(exports, "ValidationError", {
7142
7242
  enumerable: true,
7143
- get: function () { return chunkMUGKKCY3_js.ValidationError; }
7243
+ get: function () { return chunk6SPNZSXS_js.ValidationError; }
7144
7244
  });
7145
7245
  Object.defineProperty(exports, "computeRecordStatus", {
7146
7246
  enumerable: true,
7147
- get: function () { return chunkMUGKKCY3_js.computeRecordStatus; }
7247
+ get: function () { return chunk6SPNZSXS_js.computeRecordStatus; }
7148
7248
  });
7149
7249
  Object.defineProperty(exports, "createFormAttributeValidator", {
7150
7250
  enumerable: true,
7151
- get: function () { return chunkMUGKKCY3_js.createFormAttributeValidator; }
7251
+ get: function () { return chunk6SPNZSXS_js.createFormAttributeValidator; }
7152
7252
  });
7153
7253
  Object.defineProperty(exports, "isAttributeInUseError", {
7154
7254
  enumerable: true,
7155
- get: function () { return chunkMUGKKCY3_js.isAttributeInUseError; }
7255
+ get: function () { return chunk6SPNZSXS_js.isAttributeInUseError; }
7156
7256
  });
7157
7257
  Object.defineProperty(exports, "isNotFoundError", {
7158
7258
  enumerable: true,
7159
- get: function () { return chunkMUGKKCY3_js.isNotFoundError; }
7259
+ get: function () { return chunk6SPNZSXS_js.isNotFoundError; }
7160
7260
  });
7161
7261
  Object.defineProperty(exports, "isObjectReferencedError", {
7162
7262
  enumerable: true,
7163
- get: function () { return chunkMUGKKCY3_js.isObjectReferencedError; }
7263
+ get: function () { return chunk6SPNZSXS_js.isObjectReferencedError; }
7164
7264
  });
7165
7265
  Object.defineProperty(exports, "isProtectedResourceError", {
7166
7266
  enumerable: true,
7167
- get: function () { return chunkMUGKKCY3_js.isProtectedResourceError; }
7267
+ get: function () { return chunk6SPNZSXS_js.isProtectedResourceError; }
7168
7268
  });
7169
7269
  Object.defineProperty(exports, "isRecordReferencedError", {
7170
7270
  enumerable: true,
7171
- get: function () { return chunkMUGKKCY3_js.isRecordReferencedError; }
7271
+ get: function () { return chunk6SPNZSXS_js.isRecordReferencedError; }
7172
7272
  });
7173
7273
  Object.defineProperty(exports, "isSchemaError", {
7174
7274
  enumerable: true,
7175
- get: function () { return chunkMUGKKCY3_js.isSchemaError; }
7275
+ get: function () { return chunk6SPNZSXS_js.isSchemaError; }
7176
7276
  });
7177
7277
  Object.defineProperty(exports, "isValidationError", {
7178
7278
  enumerable: true,
7179
- get: function () { return chunkMUGKKCY3_js.isValidationError; }
7279
+ get: function () { return chunk6SPNZSXS_js.isValidationError; }
7180
7280
  });
7181
7281
  Object.defineProperty(exports, "rejectUnknownAttributesOrThrow", {
7182
7282
  enumerable: true,
7183
- get: function () { return chunkMUGKKCY3_js.rejectUnknownAttributesOrThrow; }
7283
+ get: function () { return chunk6SPNZSXS_js.rejectUnknownAttributesOrThrow; }
7184
7284
  });
7185
7285
  Object.defineProperty(exports, "validateDraft", {
7186
7286
  enumerable: true,
7187
- get: function () { return chunkMUGKKCY3_js.validateDraft; }
7287
+ get: function () { return chunk6SPNZSXS_js.validateDraft; }
7188
7288
  });
7189
7289
  Object.defineProperty(exports, "validateDraftOrThrow", {
7190
7290
  enumerable: true,
7191
- get: function () { return chunkMUGKKCY3_js.validateDraftOrThrow; }
7291
+ get: function () { return chunk6SPNZSXS_js.validateDraftOrThrow; }
7192
7292
  });
7193
7293
  Object.defineProperty(exports, "validateObject", {
7194
7294
  enumerable: true,
7195
- get: function () { return chunkMUGKKCY3_js.validateObject; }
7295
+ get: function () { return chunk6SPNZSXS_js.validateObject; }
7196
7296
  });
7197
7297
  Object.defineProperty(exports, "validateObjectOrThrow", {
7198
7298
  enumerable: true,
7199
- get: function () { return chunkMUGKKCY3_js.validateObjectOrThrow; }
7299
+ get: function () { return chunk6SPNZSXS_js.validateObjectOrThrow; }
7200
7300
  });
7201
7301
  Object.defineProperty(exports, "DEFAULT_VALIDATION_MESSAGES", {
7202
7302
  enumerable: true,
@@ -7218,6 +7318,7 @@ exports.BEHAVIOR_PROPERTIES = BEHAVIOR_PROPERTIES;
7218
7318
  exports.COMPUTED_FUNCTIONS = COMPUTED_FUNCTIONS;
7219
7319
  exports.COMPUTED_FUNCTION_METADATA = COMPUTED_FUNCTION_METADATA;
7220
7320
  exports.COMPUTED_FUNCTION_NAMES = COMPUTED_FUNCTION_NAMES;
7321
+ exports.CONNECTOR_CALLBACK_PARAM = CONNECTOR_CALLBACK_PARAM;
7221
7322
  exports.ComputedFormulaCompileError = ComputedFormulaCompileError;
7222
7323
  exports.CustomTabConfig = CustomTabConfig;
7223
7324
  exports.DB_COLUMN_FIELDS = DB_COLUMN_FIELDS;
@@ -7285,6 +7386,7 @@ exports.USER_STATUSES = USER_STATUSES;
7285
7386
  exports.accessLevelToActions = accessLevelToActions;
7286
7387
  exports.actionsToAccessLevel = actionsToAccessLevel;
7287
7388
  exports.applyPipes = applyPipes;
7389
+ exports.applyRelationProps = applyRelationProps;
7288
7390
  exports.assertAcyclicComputedDependencies = assertAcyclicComputedDependencies;
7289
7391
  exports.assertLiveStreamCursor = assertLiveStreamCursor;
7290
7392
  exports.booleanFlag = booleanFlag;
@@ -7300,6 +7402,7 @@ exports.createStandardSchemaProps = createStandardSchemaProps;
7300
7402
  exports.currency = currency;
7301
7403
  exports.currentActor = currentActor;
7302
7404
  exports.date = date;
7405
+ exports.dateValueStart = dateValueStart;
7303
7406
  exports.detailView = detailView;
7304
7407
  exports.document = document;
7305
7408
  exports.evaluateComputedAst = evaluateComputedAst;
@@ -7307,6 +7410,7 @@ exports.evaluateComputedFormula = evaluateComputedFormula;
7307
7410
  exports.evaluateComputedFormulaWithResult = evaluateComputedFormulaWithResult;
7308
7411
  exports.evaluateFilterState = evaluateFilterState;
7309
7412
  exports.extractAttributeNames = extractAttributeNames;
7413
+ exports.extractValueRefs = extractValueRefs;
7310
7414
  exports.file = file;
7311
7415
  exports.flagRegistry = flagRegistry;
7312
7416
  exports.form = form;
@@ -7324,8 +7428,10 @@ exports.getErrorMessage = getErrorMessage;
7324
7428
  exports.getLiveProtocolPayloadChannel = getLiveProtocolPayloadChannel;
7325
7429
  exports.getOperatorPolarity = getOperatorPolarity;
7326
7430
  exports.getRollupFilterOperators = getRollupFilterOperators2;
7431
+ exports.getSlotFieldTargets = getSlotFieldTargets;
7327
7432
  exports.getSystemAttributeI18nKey = getSystemAttributeI18nKey;
7328
7433
  exports.getSystemAttributeList = getSystemAttributeList;
7434
+ exports.getUserDisplayName = getUserDisplayName;
7329
7435
  exports.group = group;
7330
7436
  exports.hasOptions = hasOptions;
7331
7437
  exports.inferInverseCardinality = inferInverseCardinality;
@@ -7337,6 +7443,7 @@ exports.isAttributeSearchable = isAttributeSearchable;
7337
7443
  exports.isAttributeSortable = isAttributeSortable2;
7338
7444
  exports.isBilateralRelation = isBilateralRelation;
7339
7445
  exports.isComputedFunctionName = isComputedFunctionName;
7446
+ exports.isDateRangeValue = isDateRangeValue;
7340
7447
  exports.isDefaultRole = isDefaultRole;
7341
7448
  exports.isDetailView = isDetailView;
7342
7449
  exports.isDocumentAttribute = isDocumentAttribute;
@@ -7373,6 +7480,7 @@ exports.location = location;
7373
7480
  exports.matchesMime = matchesMime;
7374
7481
  exports.multiselect = multiselect;
7375
7482
  exports.normaliseDocumentSlots = normaliseDocumentSlots;
7483
+ exports.normalizeDateValue = normalizeDateValue;
7376
7484
  exports.normalizeForEdgeRpc = normalizeForEdgeRpc;
7377
7485
  exports.now = now;
7378
7486
  exports.number = number;