@memberjunction/react-runtime 5.31.0 → 5.33.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.
@@ -19090,7 +19090,7 @@ function reportUnhandledError(err) {
19090
19090
 
19091
19091
  /***/ },
19092
19092
 
19093
- /***/ 925
19093
+ /***/ 310
19094
19094
  (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
19095
19095
 
19096
19096
  "use strict";
@@ -19593,53 +19593,2011 @@ function UpdateCurrentConsoleProgress(message, current, total) {
19593
19593
  // show the message, current count of total count, and % complete formated as 0.0%
19594
19594
  UpdateCurrentConsoleLine("".concat(message, " ").concat(current, " of ").concat(total, " (").concat((current / total * 100).toFixed(1), "%)"), color);
19595
19595
  }
19596
+ ;// ../../SQLDialect/dist/sqlDialect.js
19597
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
19598
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
19599
+ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
19600
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
19601
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
19602
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
19603
+ /**
19604
+ * Abstract base class for SQL dialect implementations.
19605
+ *
19606
+ * Encapsulates ALL database-specific SQL syntax patterns into a single,
19607
+ * testable abstraction. This is a pure string/logic layer with zero
19608
+ * database driver dependencies.
19609
+ */
19610
+ var SQLDialect = /*#__PURE__*/function () {
19611
+ function SQLDialect() {
19612
+ _classCallCheck(this, SQLDialect);
19613
+ }
19614
+ return _createClass(SQLDialect, [{
19615
+ key: "QuoteStringLiteral",
19616
+ value:
19617
+ /**
19618
+ * Quotes a value as a SQL string literal. Both SQL Server and PostgreSQL
19619
+ * use single quotes with `''` doubling to escape internal apostrophes —
19620
+ * this is concrete in the base class so callers don't reinvent the
19621
+ * `value.replace(/'/g, "''")` pattern. Subclasses may override if a
19622
+ * future dialect needs a different escape rule.
19623
+ */
19624
+ function QuoteStringLiteral(value) {
19625
+ return "'".concat(value.replace(/'/g, "''"), "'");
19626
+ }
19627
+ /**
19628
+ * Wraps an expression in the dialect's lowercase function — used for
19629
+ * case-insensitive comparison when authoring filters that must work on
19630
+ * both SS (default case-insensitive collation) and PG (case-sensitive).
19631
+ *
19632
+ * Both SQL Server and PostgreSQL implement `LOWER()` per the ANSI SQL
19633
+ * standard, so the default returns `LOWER(${expr})`. A subclass would
19634
+ * override only for an exotic dialect (e.g. one that exposes `lc()` or
19635
+ * needs a CAST first).
19636
+ *
19637
+ * Use this instead of hardcoding `LOWER(...)` in callers — keeps the
19638
+ * dialect-aware SQL surface in one place per the SQLDialect contract.
19639
+ */
19640
+ }, {
19641
+ key: "LowerCase",
19642
+ value: function LowerCase(expr) {
19643
+ return "LOWER(".concat(expr, ")");
19644
+ }
19645
+ /**
19646
+ * Returns the dialect's literal representation of NULL as it would
19647
+ * appear in generated SQL (e.g. as the result of a default-value
19648
+ * formatter). Both SQL Server and PostgreSQL use the bare keyword
19649
+ * `NULL`, but a future dialect could differ — codegen comparisons
19650
+ * should route through this rather than hard-coding the string.
19651
+ */
19652
+ }, {
19653
+ key: "NullLiteral",
19654
+ get: function get() {
19655
+ return 'NULL';
19656
+ }
19657
+ /**
19658
+ * Returns true if `value` is the dialect's representation of a NULL
19659
+ * literal in generated SQL. Comparison is case-insensitive after
19660
+ * trimming whitespace. Subclasses may override if a dialect uses a
19661
+ * non-keyword form (none currently do).
19662
+ */
19663
+ }, {
19664
+ key: "IsNullLiteral",
19665
+ value: function IsNullLiteral(value) {
19666
+ if (value == null) return false;
19667
+ return value.trim().toUpperCase() === this.NullLiteral.toUpperCase();
19668
+ }
19669
+ /**
19670
+ * Returns a CAST to a bounded-width string type. Used when the result
19671
+ * needs to be comparable against an indexed column (SQL Server cannot
19672
+ * compare/index `NVARCHAR(MAX)`) or against a fixed-width text column
19673
+ * such as MJ's `RecordID` (NVARCHAR(450) on SQL Server).
19674
+ *
19675
+ * Implemented by composing `ResolveAbstractType({ type: 'string', maxLength })`,
19676
+ * which dialects already supply — SQL Server emits `NVARCHAR(N)` and
19677
+ * PostgreSQL emits `VARCHAR(N)`. Defaults to MJ's standard 450-char
19678
+ * width to match the cap on indexable string columns in SQL Server.
19679
+ */
19680
+ }, {
19681
+ key: "CastToBoundedString",
19682
+ value: function CastToBoundedString(expr) {
19683
+ var maxLength = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 450;
19684
+ var sqlType = this.ResolveAbstractType({
19685
+ type: 'string',
19686
+ maxLength: maxLength
19687
+ });
19688
+ return "CAST(".concat(expr, " AS ").concat(sqlType, ")");
19689
+ }
19690
+ /**
19691
+ * Returns the empty-GUID sentinel literal
19692
+ * (`00000000-0000-0000-0000-000000000000`) formatted for use in a
19693
+ * CASE-comparison expression. The base class returns the literal as a
19694
+ * plain quoted string — SQL Server's implicit conversion accepts that
19695
+ * directly. Dialects with strict typing (PostgreSQL) override to add
19696
+ * the explicit cast their grammar requires.
19697
+ */
19698
+ }, {
19699
+ key: "EmptyUUIDLiteral",
19700
+ value: function EmptyUUIDLiteral() {
19701
+ return "'00000000-0000-0000-0000-000000000000'";
19702
+ }
19703
+ /**
19704
+ * Convenience: maps a SQL Server type to this dialect's equivalent.
19705
+ */
19706
+ }, {
19707
+ key: "MapDataType",
19708
+ value: function MapDataType(sqlServerType, length, precision, scale) {
19709
+ return this.TypeMap.MapType(sqlServerType, length, precision, scale);
19710
+ }
19711
+ /**
19712
+ * Convenience: maps a SQL Server type to a full type string.
19713
+ */
19714
+ }, {
19715
+ key: "MapDataTypeToString",
19716
+ value: function MapDataTypeToString(sqlServerType, length, precision, scale) {
19717
+ return this.TypeMap.MapTypeToString(sqlServerType, length, precision, scale);
19718
+ }
19719
+ /**
19720
+ * Cap a column type if it cannot be used in a UNIQUE/index constraint.
19721
+ * SQL Server: NVARCHAR(MAX) → NVARCHAR(450) (MAX columns cannot be indexed).
19722
+ * PostgreSQL: no-op (TEXT can be indexed).
19723
+ * Override in platform-specific dialects.
19724
+ */
19725
+ }, {
19726
+ key: "CapIndexableType",
19727
+ value: function CapIndexableType(rawSqlType) {
19728
+ return rawSqlType;
19729
+ }
19730
+ }]);
19731
+ }();
19732
+ ;// ../../SQLDialect/dist/sqlServerDialect.js
19733
+ var _SQLServerDialect;
19734
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
19735
+ function _possibleConstructorReturn(t, e) { if (e && ("object" == sqlServerDialect_typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
19736
+ function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
19737
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
19738
+ function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
19739
+ function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
19740
+ function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
19741
+ function sqlServerDialect_typeof(o) { "@babel/helpers - typeof"; return sqlServerDialect_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, sqlServerDialect_typeof(o); }
19742
+ function sqlServerDialect_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
19743
+ function sqlServerDialect_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, sqlServerDialect_toPropertyKey(o.key), o); } }
19744
+ function sqlServerDialect_createClass(e, r, t) { return r && sqlServerDialect_defineProperties(e.prototype, r), t && sqlServerDialect_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
19745
+ function sqlServerDialect_toPropertyKey(t) { var i = sqlServerDialect_toPrimitive(t, "string"); return "symbol" == sqlServerDialect_typeof(i) ? i : i + ""; }
19746
+ function sqlServerDialect_toPrimitive(t, r) { if ("object" != sqlServerDialect_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != sqlServerDialect_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
19747
+
19748
+ /**
19749
+ * SQL Server-specific data type mapping.
19750
+ * Maps SQL Server types to themselves (identity mapping) since
19751
+ * SQL Server is the canonical source type in MemberJunction.
19752
+ */
19753
+ var SQLServerDataTypeMap = /*#__PURE__*/function () {
19754
+ function SQLServerDataTypeMap() {
19755
+ sqlServerDialect_classCallCheck(this, SQLServerDataTypeMap);
19756
+ }
19757
+ return sqlServerDialect_createClass(SQLServerDataTypeMap, [{
19758
+ key: "MapType",
19759
+ value: function MapType(sourceType, sourceLength, sourcePrecision, sourceScale) {
19760
+ var normalized = sourceType.toUpperCase().trim();
19761
+ switch (normalized) {
19762
+ case 'UNIQUEIDENTIFIER':
19763
+ return {
19764
+ typeName: 'UNIQUEIDENTIFIER',
19765
+ supportsLength: false,
19766
+ supportsPrecisionScale: false
19767
+ };
19768
+ case 'NVARCHAR':
19769
+ return this.buildNVarcharType(sourceLength);
19770
+ case 'VARCHAR':
19771
+ return this.buildVarcharType(sourceLength);
19772
+ case 'NCHAR':
19773
+ case 'CHAR':
19774
+ return {
19775
+ typeName: normalized,
19776
+ supportsLength: true,
19777
+ supportsPrecisionScale: false,
19778
+ defaultLength: sourceLength !== null && sourceLength !== void 0 ? sourceLength : 1
19779
+ };
19780
+ case 'INT':
19781
+ case 'INTEGER':
19782
+ return {
19783
+ typeName: 'INT',
19784
+ supportsLength: false,
19785
+ supportsPrecisionScale: false
19786
+ };
19787
+ case 'BIGINT':
19788
+ return {
19789
+ typeName: 'BIGINT',
19790
+ supportsLength: false,
19791
+ supportsPrecisionScale: false
19792
+ };
19793
+ case 'SMALLINT':
19794
+ return {
19795
+ typeName: 'SMALLINT',
19796
+ supportsLength: false,
19797
+ supportsPrecisionScale: false
19798
+ };
19799
+ case 'TINYINT':
19800
+ return {
19801
+ typeName: 'TINYINT',
19802
+ supportsLength: false,
19803
+ supportsPrecisionScale: false
19804
+ };
19805
+ case 'BIT':
19806
+ return {
19807
+ typeName: 'BIT',
19808
+ supportsLength: false,
19809
+ supportsPrecisionScale: false
19810
+ };
19811
+ case 'DECIMAL':
19812
+ case 'NUMERIC':
19813
+ return {
19814
+ typeName: normalized,
19815
+ supportsLength: false,
19816
+ supportsPrecisionScale: true
19817
+ };
19818
+ case 'FLOAT':
19819
+ return {
19820
+ typeName: 'FLOAT',
19821
+ supportsLength: false,
19822
+ supportsPrecisionScale: false
19823
+ };
19824
+ case 'REAL':
19825
+ return {
19826
+ typeName: 'REAL',
19827
+ supportsLength: false,
19828
+ supportsPrecisionScale: false
19829
+ };
19830
+ case 'MONEY':
19831
+ return {
19832
+ typeName: 'MONEY',
19833
+ supportsLength: false,
19834
+ supportsPrecisionScale: false
19835
+ };
19836
+ case 'SMALLMONEY':
19837
+ return {
19838
+ typeName: 'SMALLMONEY',
19839
+ supportsLength: false,
19840
+ supportsPrecisionScale: false
19841
+ };
19842
+ case 'DATE':
19843
+ return {
19844
+ typeName: 'DATE',
19845
+ supportsLength: false,
19846
+ supportsPrecisionScale: false
19847
+ };
19848
+ case 'DATETIME':
19849
+ return {
19850
+ typeName: 'DATETIME',
19851
+ supportsLength: false,
19852
+ supportsPrecisionScale: false
19853
+ };
19854
+ case 'DATETIME2':
19855
+ return {
19856
+ typeName: 'DATETIME2',
19857
+ supportsLength: false,
19858
+ supportsPrecisionScale: false
19859
+ };
19860
+ case 'DATETIMEOFFSET':
19861
+ return {
19862
+ typeName: 'DATETIMEOFFSET',
19863
+ supportsLength: false,
19864
+ supportsPrecisionScale: false
19865
+ };
19866
+ case 'SMALLDATETIME':
19867
+ return {
19868
+ typeName: 'SMALLDATETIME',
19869
+ supportsLength: false,
19870
+ supportsPrecisionScale: false
19871
+ };
19872
+ case 'TIME':
19873
+ return {
19874
+ typeName: 'TIME',
19875
+ supportsLength: false,
19876
+ supportsPrecisionScale: false
19877
+ };
19878
+ case 'TEXT':
19879
+ case 'NTEXT':
19880
+ return {
19881
+ typeName: normalized,
19882
+ supportsLength: false,
19883
+ supportsPrecisionScale: false
19884
+ };
19885
+ case 'IMAGE':
19886
+ return {
19887
+ typeName: 'IMAGE',
19888
+ supportsLength: false,
19889
+ supportsPrecisionScale: false
19890
+ };
19891
+ case 'VARBINARY':
19892
+ return {
19893
+ typeName: 'VARBINARY',
19894
+ supportsLength: true,
19895
+ supportsPrecisionScale: false,
19896
+ defaultLength: sourceLength
19897
+ };
19898
+ case 'BINARY':
19899
+ return {
19900
+ typeName: 'BINARY',
19901
+ supportsLength: true,
19902
+ supportsPrecisionScale: false,
19903
+ defaultLength: sourceLength !== null && sourceLength !== void 0 ? sourceLength : 1
19904
+ };
19905
+ case 'XML':
19906
+ return {
19907
+ typeName: 'XML',
19908
+ supportsLength: false,
19909
+ supportsPrecisionScale: false
19910
+ };
19911
+ default:
19912
+ return {
19913
+ typeName: normalized,
19914
+ supportsLength: false,
19915
+ supportsPrecisionScale: false
19916
+ };
19917
+ }
19918
+ }
19919
+ }, {
19920
+ key: "MapTypeToString",
19921
+ value: function MapTypeToString(sourceType, sourceLength, sourcePrecision, sourceScale) {
19922
+ var mapped = this.MapType(sourceType, sourceLength, sourcePrecision, sourceScale);
19923
+ return formatTypeString(mapped, sourceLength, sourcePrecision, sourceScale);
19924
+ }
19925
+ }, {
19926
+ key: "buildNVarcharType",
19927
+ value: function buildNVarcharType(length) {
19928
+ if (length === -1 || length === undefined) {
19929
+ return {
19930
+ typeName: 'NVARCHAR(MAX)',
19931
+ supportsLength: false,
19932
+ supportsPrecisionScale: false
19933
+ };
19934
+ }
19935
+ return {
19936
+ typeName: 'NVARCHAR',
19937
+ supportsLength: true,
19938
+ supportsPrecisionScale: false,
19939
+ defaultLength: length
19940
+ };
19941
+ }
19942
+ }, {
19943
+ key: "buildVarcharType",
19944
+ value: function buildVarcharType(length) {
19945
+ if (length === -1 || length === undefined) {
19946
+ return {
19947
+ typeName: 'VARCHAR(MAX)',
19948
+ supportsLength: false,
19949
+ supportsPrecisionScale: false
19950
+ };
19951
+ }
19952
+ return {
19953
+ typeName: 'VARCHAR',
19954
+ supportsLength: true,
19955
+ supportsPrecisionScale: false,
19956
+ defaultLength: length
19957
+ };
19958
+ }
19959
+ }]);
19960
+ }();
19961
+ /**
19962
+ * Helper to format a MappedType into a full SQL type string.
19963
+ */
19964
+ function formatTypeString(mapped, length, precision, scale) {
19965
+ if (mapped.supportsPrecisionScale && precision != null) {
19966
+ return scale != null ? "".concat(mapped.typeName, "(").concat(precision, ",").concat(scale, ")") : "".concat(mapped.typeName, "(").concat(precision, ")");
19967
+ }
19968
+ if (mapped.supportsLength) {
19969
+ var len = length !== null && length !== void 0 ? length : mapped.defaultLength;
19970
+ if (len != null) {
19971
+ return len === -1 ? "".concat(mapped.typeName, "(MAX)") : "".concat(mapped.typeName, "(").concat(len, ")");
19972
+ }
19973
+ }
19974
+ return mapped.typeName;
19975
+ }
19976
+ /**
19977
+ * SQL Server dialect implementation.
19978
+ * Uses [bracket] quoting, TOP for pagination, BIT for booleans, T-SQL functions.
19979
+ */
19980
+ var SQLServerDialect = /*#__PURE__*/function (_SQLDialect) {
19981
+ function SQLServerDialect() {
19982
+ sqlServerDialect_classCallCheck(this, SQLServerDialect);
19983
+ return _callSuper(this, SQLServerDialect, arguments);
19984
+ }
19985
+ _inherits(SQLServerDialect, _SQLDialect);
19986
+ return sqlServerDialect_createClass(SQLServerDialect, [{
19987
+ key: "PlatformKey",
19988
+ get: function get() {
19989
+ return 'sqlserver';
19990
+ }
19991
+ }, {
19992
+ key: "ParserDialect",
19993
+ get: function get() {
19994
+ return 'TransactSQL';
19995
+ }
19996
+ // ─── Identifier Quoting ──────────────────────────────────────────
19997
+ }, {
19998
+ key: "QuoteIdentifier",
19999
+ value: function QuoteIdentifier(name) {
20000
+ return "[".concat(name, "]");
20001
+ }
20002
+ }, {
20003
+ key: "QuoteSchema",
20004
+ value: function QuoteSchema(schema, object) {
20005
+ return "[".concat(schema, "].[").concat(object, "]");
20006
+ }
20007
+ /**
20008
+ * SQL Server identifiers are case-insensitive by default, so a bare
20009
+ * alias preserves the requested casing when echoed in result-set
20010
+ * column metadata. Bracketed quoting would also work but is unnecessary.
20011
+ */
20012
+ }, {
20013
+ key: "QuoteColumnAlias",
20014
+ value: function QuoteColumnAlias(aliasName) {
20015
+ return aliasName;
20016
+ }
20017
+ // ─── Pagination ──────────────────────────────────────────────────
20018
+ }, {
20019
+ key: "LimitClause",
20020
+ value: function LimitClause(limit, offset) {
20021
+ if (offset != null) {
20022
+ return {
20023
+ prefix: '',
20024
+ suffix: "OFFSET ".concat(offset, " ROWS FETCH NEXT ").concat(limit, " ROWS ONLY")
20025
+ };
20026
+ }
20027
+ return {
20028
+ prefix: "TOP ".concat(limit),
20029
+ suffix: ''
20030
+ };
20031
+ }
20032
+ // ─── Literals & Expressions ──────────────────────────────────────
20033
+ }, {
20034
+ key: "BooleanLiteral",
20035
+ value: function BooleanLiteral(value) {
20036
+ return value ? '1' : '0';
20037
+ }
20038
+ }, {
20039
+ key: "BooleanParameterType",
20040
+ value: function BooleanParameterType() {
20041
+ return 'bit';
20042
+ }
20043
+ }, {
20044
+ key: "ParameterRef",
20045
+ value: function ParameterRef(name) {
20046
+ return "@".concat(name);
20047
+ }
20048
+ }, {
20049
+ key: "ParameterDefault",
20050
+ value: function ParameterDefault(value) {
20051
+ return " = ".concat(value);
20052
+ }
20053
+ /**
20054
+ * SQL Server has both `ISNULL` (T-SQL native, two-arg only) and `COALESCE`
20055
+ * (ANSI, n-ary). For two-argument null-coalescing we emit the native
20056
+ * `ISNULL` form so generated SPs match the conventional T-SQL idiom and
20057
+ * the data-type-of-first-argument semantics callers may already rely on.
20058
+ */
20059
+ }, {
20060
+ key: "IsNull",
20061
+ value: function IsNull(expr, fallback) {
20062
+ return "ISNULL(".concat(expr, ", ").concat(fallback, ")");
20063
+ }
20064
+ /**
20065
+ * SQL Server supports `COALESCE` as an ANSI-standard alternative to its
20066
+ * native `ISNULL`. The two differ subtly in return-type inference and
20067
+ * argument arity (`COALESCE` is n-ary; `ISNULL` is two-arg only). Use
20068
+ * this helper when codegen needs the n-ary form or when caller intent
20069
+ * is ANSI-portable rather than T-SQL-native.
20070
+ */
20071
+ }, {
20072
+ key: "Coalesce",
20073
+ value: function Coalesce(expr, fallback) {
20074
+ return "COALESCE(".concat(expr, ", ").concat(fallback, ")");
20075
+ }
20076
+ }, {
20077
+ key: "CurrentTimestampUTC",
20078
+ value: function CurrentTimestampUTC() {
20079
+ return 'GETUTCDATE()';
20080
+ }
20081
+ // ─── Type-Name Sets ──────────────────────────────────────────────
20082
+ // SQL Server's column-type names as they appear in `sys.columns.name`
20083
+ // / `EntityField.Type` for entities backed by a SQL Server schema.
20084
+ }, {
20085
+ key: "BooleanTypeNames",
20086
+ get: function get() {
20087
+ return SQLServerDialect._BooleanTypeNames;
20088
+ }
20089
+ }, {
20090
+ key: "StringTypeNames",
20091
+ get: function get() {
20092
+ return SQLServerDialect._StringTypeNames;
20093
+ }
20094
+ }, {
20095
+ key: "DateTypeNames",
20096
+ get: function get() {
20097
+ return SQLServerDialect._DateTypeNames;
20098
+ }
20099
+ }, {
20100
+ key: "IntegerTypeNames",
20101
+ get: function get() {
20102
+ return SQLServerDialect._IntegerTypeNames;
20103
+ }
20104
+ }, {
20105
+ key: "FloatTypeNames",
20106
+ get: function get() {
20107
+ return SQLServerDialect._FloatTypeNames;
20108
+ }
20109
+ }, {
20110
+ key: "UuidTypeNames",
20111
+ get: function get() {
20112
+ return SQLServerDialect._UuidTypeNames;
20113
+ }
20114
+ }, {
20115
+ key: "BinaryTypeNames",
20116
+ get: function get() {
20117
+ return SQLServerDialect._BinaryTypeNames;
20118
+ }
20119
+ }, {
20120
+ key: "JsonTypeNames",
20121
+ get: function get() {
20122
+ return SQLServerDialect._JsonTypeNames;
20123
+ }
20124
+ }, {
20125
+ key: "CurrencyTypeNames",
20126
+ get: function get() {
20127
+ return SQLServerDialect._CurrencyTypeNames;
20128
+ }
20129
+ }, {
20130
+ key: "IntervalTypeNames",
20131
+ get: function get() {
20132
+ return SQLServerDialect._IntervalTypeNames;
20133
+ }
20134
+ }, {
20135
+ key: "NetworkTypeNames",
20136
+ get: function get() {
20137
+ return SQLServerDialect._NetworkTypeNames;
20138
+ }
20139
+ }, {
20140
+ key: "NewUUID",
20141
+ value: function NewUUID() {
20142
+ return 'NEWID()';
20143
+ }
20144
+ }, {
20145
+ key: "CastToText",
20146
+ value: function CastToText(expr) {
20147
+ return "CAST(".concat(expr, " AS NVARCHAR(MAX))");
20148
+ }
20149
+ /**
20150
+ * SQL Server-specific Flyway escape. Interleaves a `CAST(N'' AS NVARCHAR(MAX))`
20151
+ * between the split halves so the running T-SQL concat chain inherits
20152
+ * NVARCHAR(MAX) precedence. Without the cast, `N'a' + N'b'` produces
20153
+ * NVARCHAR(a+b) capped at NVARCHAR(4000) and silently truncates anything
20154
+ * past 4,000 characters.
20155
+ */
20156
+ }, {
20157
+ key: "EscapeFlywayStringInterpolation",
20158
+ value: function EscapeFlywayStringInterpolation(sql) {
20159
+ return sql.replaceAll(/\$\{/g, "$$'+CAST(N'' AS NVARCHAR(MAX))+N'{");
20160
+ }
20161
+ }, {
20162
+ key: "CastToUUID",
20163
+ value: function CastToUUID(expr) {
20164
+ return "CAST(".concat(expr, " AS UNIQUEIDENTIFIER)");
20165
+ }
20166
+ // ─── INSERT/UPDATE Return Patterns ───────────────────────────────
20167
+ }, {
20168
+ key: "ReturnInsertedClause",
20169
+ value: function ReturnInsertedClause(columns) {
20170
+ if (columns && columns.length > 0) {
20171
+ var cols = columns.map(function (c) {
20172
+ return "INSERTED.[".concat(c, "]");
20173
+ }).join(', ');
20174
+ return "OUTPUT ".concat(cols);
20175
+ }
20176
+ return 'OUTPUT INSERTED.*';
20177
+ }
20178
+ }, {
20179
+ key: "AutoIncrementPKExpression",
20180
+ value: function AutoIncrementPKExpression() {
20181
+ return 'IDENTITY(1,1)';
20182
+ }
20183
+ }, {
20184
+ key: "UUIDPKDefault",
20185
+ value: function UUIDPKDefault() {
20186
+ return 'NEWSEQUENTIALID()';
20187
+ }
20188
+ }, {
20189
+ key: "ScopeIdentityExpression",
20190
+ value: function ScopeIdentityExpression() {
20191
+ return 'SCOPE_IDENTITY()';
20192
+ }
20193
+ }, {
20194
+ key: "RowCountExpression",
20195
+ value: function RowCountExpression() {
20196
+ return '@@ROWCOUNT';
20197
+ }
20198
+ // ─── Batch & DDL Control ─────────────────────────────────────────
20199
+ }, {
20200
+ key: "BatchSeparator",
20201
+ value: function BatchSeparator() {
20202
+ return 'GO';
20203
+ }
20204
+ }, {
20205
+ key: "ExistenceCheckSQL",
20206
+ value: function ExistenceCheckSQL(objectType, schema, name) {
20207
+ var normalizedType = objectType.toUpperCase();
20208
+ switch (normalizedType) {
20209
+ case 'TABLE':
20210
+ return "IF OBJECT_ID('[".concat(schema, "].[").concat(name, "]', 'U') IS NOT NULL");
20211
+ case 'VIEW':
20212
+ return "IF OBJECT_ID('[".concat(schema, "].[").concat(name, "]', 'V') IS NOT NULL");
20213
+ case 'PROCEDURE':
20214
+ return "IF OBJECT_ID('[".concat(schema, "].[").concat(name, "]', 'P') IS NOT NULL");
20215
+ case 'FUNCTION':
20216
+ return "IF OBJECT_ID('[".concat(schema, "].[").concat(name, "]', 'FN') IS NOT NULL");
20217
+ case 'TRIGGER':
20218
+ return "IF OBJECT_ID('[".concat(schema, "].[").concat(name, "]', 'TR') IS NOT NULL");
20219
+ default:
20220
+ return "IF OBJECT_ID('[".concat(schema, "].[").concat(name, "]') IS NOT NULL");
20221
+ }
20222
+ }
20223
+ }, {
20224
+ key: "CreateOrReplaceSupported",
20225
+ value: function CreateOrReplaceSupported(_objectType) {
20226
+ return false; // SQL Server does not support CREATE OR REPLACE
20227
+ }
20228
+ // ─── Full-Text Search ────────────────────────────────────────────
20229
+ }, {
20230
+ key: "FullTextSearchPredicate",
20231
+ value: function FullTextSearchPredicate(column, searchTerm) {
20232
+ return "CONTAINS(".concat(this.QuoteIdentifier(column), ", ").concat(searchTerm, ")");
20233
+ }
20234
+ }, {
20235
+ key: "FullTextIndexDDL",
20236
+ value: function FullTextIndexDDL(table, columns, catalog) {
20237
+ var _this = this;
20238
+ var catName = catalog !== null && catalog !== void 0 ? catalog : 'MJ_FTS';
20239
+ var cols = columns.map(function (c) {
20240
+ return _this.QuoteIdentifier(c);
20241
+ }).join(', ');
20242
+ var lines = [];
20243
+ lines.push("IF NOT EXISTS (SELECT 1 FROM sys.fulltext_catalogs WHERE name = '".concat(catName, "')"));
20244
+ lines.push(" CREATE FULLTEXT CATALOG [".concat(catName, "];"));
20245
+ lines.push('');
20246
+ lines.push("CREATE FULLTEXT INDEX ON ".concat(table, "(").concat(cols, ")"));
20247
+ lines.push(" KEY INDEX PK_".concat(table.replace(/[\[\].]/g, ''), " ON [").concat(catName, "];"));
20248
+ return lines.join('\n');
20249
+ }
20250
+ // ─── CTE / Recursion ─────────────────────────────────────────────
20251
+ }, {
20252
+ key: "RecursiveCTESyntax",
20253
+ value: function RecursiveCTESyntax() {
20254
+ return 'WITH';
20255
+ }
20256
+ }, {
20257
+ key: "AllowsOrderByInCTE",
20258
+ get: function get() {
20259
+ return false;
20260
+ }
20261
+ }, {
20262
+ key: "DefaultPagingOrderBy",
20263
+ get: function get() {
20264
+ return '(SELECT NULL)';
20265
+ }
20266
+ // ─── Data Types ──────────────────────────────────────────────────
20267
+ }, {
20268
+ key: "TypeMap",
20269
+ get: function get() {
20270
+ return new SQLServerDataTypeMap();
20271
+ }
20272
+ // ─── Parameters ──────────────────────────────────────────────────
20273
+ }, {
20274
+ key: "ParameterPlaceholder",
20275
+ value: function ParameterPlaceholder(index) {
20276
+ return "@p".concat(index);
20277
+ }
20278
+ }, {
20279
+ key: "ConcatOperator",
20280
+ value: function ConcatOperator() {
20281
+ return '+';
20282
+ }
20283
+ // ─── String Functions ────────────────────────────────────────────
20284
+ }, {
20285
+ key: "StringSplitFunction",
20286
+ value: function StringSplitFunction(value, delimiter) {
20287
+ return "STRING_SPLIT(".concat(value, ", ").concat(delimiter, ")");
20288
+ }
20289
+ }, {
20290
+ key: "JsonExtract",
20291
+ value: function JsonExtract(column, path) {
20292
+ return "JSON_VALUE(".concat(column, ", '").concat(path, "')");
20293
+ }
20294
+ // ─── Procedure / Function Calls ──────────────────────────────────
20295
+ }, {
20296
+ key: "ProcedureCallSyntax",
20297
+ value: function ProcedureCallSyntax(schema, name, params) {
20298
+ var paramList = params.join(', ');
20299
+ return "EXEC [".concat(schema, "].[").concat(name, "] ").concat(paramList);
20300
+ }
20301
+ // ─── DDL Generation (Schema/Table) ──────────────────────────────
20302
+ }, {
20303
+ key: "CreateSchemaDDL",
20304
+ value: function CreateSchemaDDL(schemaName) {
20305
+ return "IF NOT EXISTS (SELECT 1 FROM sys.schemas WHERE name = '".concat(schemaName, "')\n EXEC('CREATE SCHEMA [").concat(schemaName, "]');\nGO");
20306
+ }
20307
+ /** SQL Server cannot index NVARCHAR(MAX) columns — cap to NVARCHAR(450). */
20308
+ }, {
20309
+ key: "CapIndexableType",
20310
+ value: function CapIndexableType(rawSqlType) {
20311
+ return rawSqlType.toUpperCase() === 'NVARCHAR(MAX)' ? 'NVARCHAR(450)' : rawSqlType;
20312
+ }
20313
+ // ─── DDL Generation (Conditional/Procedural) ────────────────────
20314
+ }, {
20315
+ key: "DateAddExpression",
20316
+ value: function DateAddExpression(unit, amount, baseExpr) {
20317
+ return "DATEADD(".concat(unit, ", ").concat(amount, ", ").concat(baseExpr, ")");
20318
+ }
20319
+ }, {
20320
+ key: "CreateTableIfNotExistsDDL",
20321
+ value: function CreateTableIfNotExistsDDL(schema, tableName, columnsDDL) {
20322
+ var quotedTable = this.QuoteSchema(schema, tableName);
20323
+ return ["IF NOT EXISTS (SELECT * FROM sys.tables t JOIN sys.schemas s ON t.schema_id = s.schema_id WHERE s.name='".concat(schema, "' AND t.name='").concat(tableName, "')"), "BEGIN", " CREATE TABLE ".concat(quotedTable, " ("), columnsDDL, " );", "END;"].join('\n');
20324
+ }
20325
+ }, {
20326
+ key: "ConditionalBlock",
20327
+ value: function ConditionalBlock(condition, thenSQL, elseSQL) {
20328
+ var lines = ["IF ".concat(condition), "BEGIN", " ".concat(thenSQL), "END"];
20329
+ if (elseSQL) {
20330
+ lines.push("ELSE");
20331
+ lines.push("BEGIN");
20332
+ lines.push(" ".concat(elseSQL));
20333
+ lines.push("END");
20334
+ }
20335
+ return lines.join('\n');
20336
+ }
20337
+ }, {
20338
+ key: "RaiseSignalSQL",
20339
+ value: function RaiseSignalSQL(message) {
20340
+ return "RAISERROR('".concat(message, "', 16, 1)");
20341
+ }
20342
+ // ─── DDL Generation (Schema/Table continued) ────────────────────
20343
+ }, {
20344
+ key: "AddColumnClause",
20345
+ value: function AddColumnClause(col) {
20346
+ var nullable = col.nullable ? 'NULL' : 'NOT NULL';
20347
+ var defaultExpr = col.defaultValue != null ? " DEFAULT ".concat(col.defaultValue) : '';
20348
+ return "ADD [".concat(col.name, "] ").concat(col.sqlType, " ").concat(nullable).concat(defaultExpr);
20349
+ }
20350
+ }, {
20351
+ key: "AlterColumnDDL",
20352
+ value: function AlterColumnDDL(quotedTable, options) {
20353
+ var nullable = options.newNullable ? 'NULL' : 'NOT NULL';
20354
+ return "ALTER TABLE ".concat(quotedTable, "\n ALTER COLUMN [").concat(options.columnName, "] ").concat(options.newType, " ").concat(nullable, ";");
20355
+ }
20356
+ }, {
20357
+ key: "CommentOnColumn",
20358
+ value: function CommentOnColumn(schema, table, column, comment) {
20359
+ var escaped = comment.replace(/'/g, "''");
20360
+ return ["EXEC sp_addextendedproperty", " @name = N'MS_Description',", " @value = N'".concat(escaped, "',"), " @level0type = N'SCHEMA', @level0name = '".concat(schema, "',"), " @level1type = N'TABLE', @level1name = '".concat(table, "',"), " @level2type = N'COLUMN', @level2name = '".concat(column, "';")].join('\n');
20361
+ }
20362
+ }, {
20363
+ key: "FallbackType",
20364
+ value: function FallbackType() {
20365
+ return 'NVARCHAR(MAX)';
20366
+ }
20367
+ // ─── DDL Generation (Triggers/Indexes) ──────────────────────────
20368
+ }, {
20369
+ key: "TriggerDDL",
20370
+ value: function TriggerDDL(options) {
20371
+ var events = options.events.join(', ');
20372
+ var lines = [];
20373
+ lines.push("CREATE TRIGGER [".concat(options.schema, "].[").concat(options.triggerName, "]"));
20374
+ lines.push("ON [".concat(options.schema, "].[").concat(options.tableName, "]"));
20375
+ lines.push("".concat(options.timing, " ").concat(events));
20376
+ lines.push('AS');
20377
+ lines.push('BEGIN');
20378
+ lines.push(' SET NOCOUNT ON;');
20379
+ lines.push(" ".concat(options.body));
20380
+ lines.push('END');
20381
+ return lines.join('\n');
20382
+ }
20383
+ }, {
20384
+ key: "IndexDDL",
20385
+ value: function IndexDDL(options) {
20386
+ var unique = options.unique ? 'UNIQUE ' : '';
20387
+ var cols = options.columns.map(function (c) {
20388
+ return "[".concat(c, "]");
20389
+ }).join(', ');
20390
+ var ddl = "CREATE ".concat(unique, "INDEX [").concat(options.indexName, "] ON [").concat(options.schema, "].[").concat(options.tableName, "](").concat(cols, ")");
20391
+ if (options.includeColumns && options.includeColumns.length > 0) {
20392
+ var inc = options.includeColumns.map(function (c) {
20393
+ return "[".concat(c, "]");
20394
+ }).join(', ');
20395
+ ddl += " INCLUDE (".concat(inc, ")");
20396
+ }
20397
+ return ddl;
20398
+ }
20399
+ // ─── Permissions ─────────────────────────────────────────────────
20400
+ }, {
20401
+ key: "GrantPermission",
20402
+ value: function GrantPermission(permission, _objectType, schema, object, role) {
20403
+ return "GRANT ".concat(permission, " ON [").concat(schema, "].[").concat(object, "] TO [").concat(role, "]");
20404
+ }
20405
+ }, {
20406
+ key: "CommentOnObject",
20407
+ value: function CommentOnObject(objectType, schema, name, comment) {
20408
+ var escapedComment = comment.replace(/'/g, "''");
20409
+ var level1Type = this.objectTypeToLevel1Type(objectType);
20410
+ return ["EXEC sp_addextendedproperty", " @name = N'MS_Description',", " @value = N'".concat(escapedComment, "',"), " @level0type = N'SCHEMA', @level0name = N'".concat(schema, "',"), " @level1type = N'".concat(level1Type, "', @level1name = N'").concat(name, "'")].join('\n');
20411
+ }
20412
+ // ─── Schema Introspection ────────────────────────────────────────
20413
+ }, {
20414
+ key: "SchemaIntrospectionQueries",
20415
+ value: function SchemaIntrospectionQueries() {
20416
+ return {
20417
+ listTables: "\n SELECT s.name AS schema_name, t.name AS table_name\n FROM sys.tables t\n INNER JOIN sys.schemas s ON t.schema_id = s.schema_id\n WHERE s.name = @schema\n ORDER BY t.name",
20418
+ listColumns: "\n SELECT c.name AS column_name, ty.name AS data_type,\n c.max_length, c.precision, c.scale, c.is_nullable,\n c.is_identity, dc.definition AS default_value\n FROM sys.columns c\n INNER JOIN sys.types ty ON c.user_type_id = ty.user_type_id\n LEFT JOIN sys.default_constraints dc ON c.default_object_id = dc.object_id\n WHERE c.object_id = OBJECT_ID(@table)\n ORDER BY c.column_id",
20419
+ listConstraints: "\n SELECT tc.CONSTRAINT_NAME, tc.CONSTRAINT_TYPE, kcu.COLUMN_NAME\n FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS tc\n INNER JOIN INFORMATION_SCHEMA.KEY_COLUMN_USAGE kcu\n ON tc.CONSTRAINT_NAME = kcu.CONSTRAINT_NAME\n WHERE tc.TABLE_SCHEMA = @schema AND tc.TABLE_NAME = @table\n ORDER BY tc.CONSTRAINT_TYPE, kcu.ORDINAL_POSITION",
20420
+ listForeignKeys: "\n SELECT fk.name AS fk_name,\n OBJECT_SCHEMA_NAME(fk.parent_object_id) AS source_schema,\n OBJECT_NAME(fk.parent_object_id) AS source_table,\n COL_NAME(fkc.parent_object_id, fkc.parent_column_id) AS source_column,\n OBJECT_SCHEMA_NAME(fk.referenced_object_id) AS target_schema,\n OBJECT_NAME(fk.referenced_object_id) AS target_table,\n COL_NAME(fkc.referenced_object_id, fkc.referenced_column_id) AS target_column\n FROM sys.foreign_keys fk\n INNER JOIN sys.foreign_key_columns fkc ON fk.object_id = fkc.constraint_object_id\n WHERE OBJECT_SCHEMA_NAME(fk.parent_object_id) = @schema\n ORDER BY fk.name",
20421
+ listIndexes: "\n SELECT i.name AS index_name, i.is_unique, i.type_desc,\n COL_NAME(ic.object_id, ic.column_id) AS column_name,\n ic.is_included_column\n FROM sys.indexes i\n INNER JOIN sys.index_columns ic ON i.object_id = ic.object_id AND i.index_id = ic.index_id\n WHERE i.object_id = OBJECT_ID(@table) AND i.name IS NOT NULL\n ORDER BY i.name, ic.key_ordinal",
20422
+ objectExists: "SELECT OBJECT_ID(@objectName) AS object_id"
20423
+ };
20424
+ }
20425
+ // ─── IIF ─────────────────────────────────────────────────────────
20426
+ }, {
20427
+ key: "IIF",
20428
+ value: function IIF(condition, trueVal, falseVal) {
20429
+ return "IIF(".concat(condition, ", ").concat(trueVal, ", ").concat(falseVal, ")");
20430
+ }
20431
+ // ─── Abstract Type Resolution ─────────────────────────────────────
20432
+ }, {
20433
+ key: "ResolveAbstractType",
20434
+ value: function ResolveAbstractType(options) {
20435
+ var _options$precision, _options$scale;
20436
+ switch (options.type) {
20437
+ case 'string':
20438
+ return this.resolveStringType(options.maxLength);
20439
+ case 'text':
20440
+ return 'NVARCHAR(MAX)';
20441
+ case 'integer':
20442
+ return 'INT';
20443
+ case 'bigint':
20444
+ return 'BIGINT';
20445
+ case 'decimal':
20446
+ return "DECIMAL(".concat((_options$precision = options.precision) !== null && _options$precision !== void 0 ? _options$precision : 18, ",").concat((_options$scale = options.scale) !== null && _options$scale !== void 0 ? _options$scale : 2, ")");
20447
+ case 'boolean':
20448
+ return 'BIT';
20449
+ case 'datetime':
20450
+ return 'DATETIMEOFFSET';
20451
+ case 'date':
20452
+ return 'DATE';
20453
+ case 'uuid':
20454
+ return 'UNIQUEIDENTIFIER';
20455
+ case 'json':
20456
+ return 'NVARCHAR(MAX)';
20457
+ case 'float':
20458
+ return 'FLOAT';
20459
+ case 'time':
20460
+ return 'TIME';
20461
+ default:
20462
+ return this.FallbackType();
20463
+ }
20464
+ }
20465
+ }, {
20466
+ key: "resolveStringType",
20467
+ value: function resolveStringType(maxLength) {
20468
+ if (maxLength != null && maxLength > 0) {
20469
+ if (maxLength > 4000) return 'NVARCHAR(MAX)';
20470
+ return "NVARCHAR(".concat(maxLength, ")");
20471
+ }
20472
+ return 'NVARCHAR(255)';
20473
+ }
20474
+ // ─── Private Helpers ─────────────────────────────────────────────
20475
+ }, {
20476
+ key: "objectTypeToLevel1Type",
20477
+ value: function objectTypeToLevel1Type(objectType) {
20478
+ switch (objectType.toUpperCase()) {
20479
+ case 'TABLE':
20480
+ return 'TABLE';
20481
+ case 'VIEW':
20482
+ return 'VIEW';
20483
+ case 'PROCEDURE':
20484
+ return 'PROCEDURE';
20485
+ case 'FUNCTION':
20486
+ return 'FUNCTION';
20487
+ default:
20488
+ return objectType.toUpperCase();
20489
+ }
20490
+ }
20491
+ }]);
20492
+ }(SQLDialect);
20493
+ _SQLServerDialect = SQLServerDialect;
20494
+ _SQLServerDialect._BooleanTypeNames = ['bit'];
20495
+ _SQLServerDialect._StringTypeNames = ['text', 'ntext', 'varchar', 'nvarchar', 'char', 'nchar'];
20496
+ _SQLServerDialect._DateTypeNames = ['date', 'time', 'datetime', 'datetime2', 'datetimeoffset', 'smalldatetime'];
20497
+ _SQLServerDialect._IntegerTypeNames = ['int', 'integer', 'bigint', 'smallint', 'tinyint', 'rowversion', 'timestamp'];
20498
+ _SQLServerDialect._FloatTypeNames = ['decimal', 'numeric', 'float', 'real'];
20499
+ _SQLServerDialect._UuidTypeNames = ['uniqueidentifier'];
20500
+ _SQLServerDialect._BinaryTypeNames = ['binary', 'varbinary', 'image'];
20501
+ _SQLServerDialect._JsonTypeNames = ['xml'];
20502
+ _SQLServerDialect._CurrencyTypeNames = ['money', 'smallmoney'];
20503
+ _SQLServerDialect._IntervalTypeNames = [];
20504
+ _SQLServerDialect._NetworkTypeNames = [];
20505
+ ;// ../../SQLDialect/dist/postgresqlDialect.js
20506
+ var _PostgreSQLDialect;
20507
+ function postgresqlDialect_callSuper(t, o, e) { return o = postgresqlDialect_getPrototypeOf(o), postgresqlDialect_possibleConstructorReturn(t, postgresqlDialect_isNativeReflectConstruct() ? Reflect.construct(o, e || [], postgresqlDialect_getPrototypeOf(t).constructor) : o.apply(t, e)); }
20508
+ function postgresqlDialect_possibleConstructorReturn(t, e) { if (e && ("object" == postgresqlDialect_typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return postgresqlDialect_assertThisInitialized(t); }
20509
+ function postgresqlDialect_assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
20510
+ function postgresqlDialect_isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (postgresqlDialect_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
20511
+ function _superPropGet(t, o, e, r) { var p = _get(postgresqlDialect_getPrototypeOf(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; }
20512
+ function _get() { return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { var p = _superPropBase(e, t); if (p) { var n = Object.getOwnPropertyDescriptor(p, t); return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; } }, _get.apply(null, arguments); }
20513
+ function _superPropBase(t, o) { for (; !{}.hasOwnProperty.call(t, o) && null !== (t = postgresqlDialect_getPrototypeOf(t));); return t; }
20514
+ function postgresqlDialect_getPrototypeOf(t) { return postgresqlDialect_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, postgresqlDialect_getPrototypeOf(t); }
20515
+ function postgresqlDialect_inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && postgresqlDialect_setPrototypeOf(t, e); }
20516
+ function postgresqlDialect_setPrototypeOf(t, e) { return postgresqlDialect_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, postgresqlDialect_setPrototypeOf(t, e); }
20517
+ function postgresqlDialect_typeof(o) { "@babel/helpers - typeof"; return postgresqlDialect_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, postgresqlDialect_typeof(o); }
20518
+ function postgresqlDialect_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
20519
+ function postgresqlDialect_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, postgresqlDialect_toPropertyKey(o.key), o); } }
20520
+ function postgresqlDialect_createClass(e, r, t) { return r && postgresqlDialect_defineProperties(e.prototype, r), t && postgresqlDialect_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
20521
+ function postgresqlDialect_toPropertyKey(t) { var i = postgresqlDialect_toPrimitive(t, "string"); return "symbol" == postgresqlDialect_typeof(i) ? i : i + ""; }
20522
+ function postgresqlDialect_toPrimitive(t, r) { if ("object" != postgresqlDialect_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != postgresqlDialect_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
20523
+
20524
+ /**
20525
+ * PostgreSQL data type mapping.
20526
+ * Maps SQL Server types to their PostgreSQL equivalents.
20527
+ */
20528
+ var PostgreSQLDataTypeMap = /*#__PURE__*/function () {
20529
+ function PostgreSQLDataTypeMap() {
20530
+ postgresqlDialect_classCallCheck(this, PostgreSQLDataTypeMap);
20531
+ }
20532
+ return postgresqlDialect_createClass(PostgreSQLDataTypeMap, [{
20533
+ key: "MapType",
20534
+ value: function MapType(sourceType, sourceLength, sourcePrecision, sourceScale) {
20535
+ var normalized = sourceType.toUpperCase().trim();
20536
+ switch (normalized) {
20537
+ case 'UNIQUEIDENTIFIER':
20538
+ return {
20539
+ typeName: 'UUID',
20540
+ supportsLength: false,
20541
+ supportsPrecisionScale: false
20542
+ };
20543
+ case 'NVARCHAR':
20544
+ return this.mapNVarchar(sourceLength);
20545
+ case 'VARCHAR':
20546
+ return this.mapVarchar(sourceLength);
20547
+ case 'NCHAR':
20548
+ case 'CHAR':
20549
+ return {
20550
+ typeName: 'CHAR',
20551
+ supportsLength: true,
20552
+ supportsPrecisionScale: false,
20553
+ defaultLength: sourceLength !== null && sourceLength !== void 0 ? sourceLength : 1
20554
+ };
20555
+ case 'INT':
20556
+ case 'INTEGER':
20557
+ return {
20558
+ typeName: 'INTEGER',
20559
+ supportsLength: false,
20560
+ supportsPrecisionScale: false
20561
+ };
20562
+ case 'BIGINT':
20563
+ return {
20564
+ typeName: 'BIGINT',
20565
+ supportsLength: false,
20566
+ supportsPrecisionScale: false
20567
+ };
20568
+ case 'SMALLINT':
20569
+ return {
20570
+ typeName: 'SMALLINT',
20571
+ supportsLength: false,
20572
+ supportsPrecisionScale: false
20573
+ };
20574
+ case 'TINYINT':
20575
+ return {
20576
+ typeName: 'SMALLINT',
20577
+ supportsLength: false,
20578
+ supportsPrecisionScale: false
20579
+ };
20580
+ case 'BIT':
20581
+ return {
20582
+ typeName: 'BOOLEAN',
20583
+ supportsLength: false,
20584
+ supportsPrecisionScale: false
20585
+ };
20586
+ case 'DECIMAL':
20587
+ case 'NUMERIC':
20588
+ return {
20589
+ typeName: 'NUMERIC',
20590
+ supportsLength: false,
20591
+ supportsPrecisionScale: true
20592
+ };
20593
+ case 'FLOAT':
20594
+ return this.mapFloat(sourcePrecision);
20595
+ case 'REAL':
20596
+ return {
20597
+ typeName: 'REAL',
20598
+ supportsLength: false,
20599
+ supportsPrecisionScale: false
20600
+ };
20601
+ case 'MONEY':
20602
+ return {
20603
+ typeName: 'NUMERIC(19,4)',
20604
+ supportsLength: false,
20605
+ supportsPrecisionScale: false
20606
+ };
20607
+ case 'SMALLMONEY':
20608
+ return {
20609
+ typeName: 'NUMERIC(10,4)',
20610
+ supportsLength: false,
20611
+ supportsPrecisionScale: false
20612
+ };
20613
+ case 'DATE':
20614
+ return {
20615
+ typeName: 'DATE',
20616
+ supportsLength: false,
20617
+ supportsPrecisionScale: false
20618
+ };
20619
+ case 'DATETIME':
20620
+ case 'DATETIME2':
20621
+ return {
20622
+ typeName: 'TIMESTAMP',
20623
+ supportsLength: false,
20624
+ supportsPrecisionScale: false
20625
+ };
20626
+ case 'DATETIMEOFFSET':
20627
+ return {
20628
+ typeName: 'TIMESTAMPTZ',
20629
+ supportsLength: false,
20630
+ supportsPrecisionScale: false
20631
+ };
20632
+ case 'SMALLDATETIME':
20633
+ return {
20634
+ typeName: 'TIMESTAMP(0)',
20635
+ supportsLength: false,
20636
+ supportsPrecisionScale: false
20637
+ };
20638
+ case 'TIME':
20639
+ return {
20640
+ typeName: 'TIME',
20641
+ supportsLength: false,
20642
+ supportsPrecisionScale: false
20643
+ };
20644
+ case 'TEXT':
20645
+ case 'NTEXT':
20646
+ return {
20647
+ typeName: 'TEXT',
20648
+ supportsLength: false,
20649
+ supportsPrecisionScale: false
20650
+ };
20651
+ case 'IMAGE':
20652
+ return {
20653
+ typeName: 'BYTEA',
20654
+ supportsLength: false,
20655
+ supportsPrecisionScale: false
20656
+ };
20657
+ case 'VARBINARY':
20658
+ return {
20659
+ typeName: 'BYTEA',
20660
+ supportsLength: false,
20661
+ supportsPrecisionScale: false
20662
+ };
20663
+ case 'BINARY':
20664
+ return {
20665
+ typeName: 'BYTEA',
20666
+ supportsLength: false,
20667
+ supportsPrecisionScale: false
20668
+ };
20669
+ case 'XML':
20670
+ return {
20671
+ typeName: 'XML',
20672
+ supportsLength: false,
20673
+ supportsPrecisionScale: false
20674
+ };
20675
+ // PostgreSQL native types (pass through)
20676
+ case 'UUID':
20677
+ return {
20678
+ typeName: 'UUID',
20679
+ supportsLength: false,
20680
+ supportsPrecisionScale: false
20681
+ };
20682
+ case 'BOOLEAN':
20683
+ return {
20684
+ typeName: 'BOOLEAN',
20685
+ supportsLength: false,
20686
+ supportsPrecisionScale: false
20687
+ };
20688
+ case 'TIMESTAMPTZ':
20689
+ return {
20690
+ typeName: 'TIMESTAMPTZ',
20691
+ supportsLength: false,
20692
+ supportsPrecisionScale: false
20693
+ };
20694
+ case 'TIMESTAMP':
20695
+ return {
20696
+ typeName: 'TIMESTAMP',
20697
+ supportsLength: false,
20698
+ supportsPrecisionScale: false
20699
+ };
20700
+ case 'BYTEA':
20701
+ return {
20702
+ typeName: 'BYTEA',
20703
+ supportsLength: false,
20704
+ supportsPrecisionScale: false
20705
+ };
20706
+ case 'JSONB':
20707
+ return {
20708
+ typeName: 'JSONB',
20709
+ supportsLength: false,
20710
+ supportsPrecisionScale: false
20711
+ };
20712
+ case 'JSON':
20713
+ return {
20714
+ typeName: 'JSON',
20715
+ supportsLength: false,
20716
+ supportsPrecisionScale: false
20717
+ };
20718
+ case 'SERIAL':
20719
+ return {
20720
+ typeName: 'SERIAL',
20721
+ supportsLength: false,
20722
+ supportsPrecisionScale: false
20723
+ };
20724
+ case 'BIGSERIAL':
20725
+ return {
20726
+ typeName: 'BIGSERIAL',
20727
+ supportsLength: false,
20728
+ supportsPrecisionScale: false
20729
+ };
20730
+ case 'DOUBLE PRECISION':
20731
+ return {
20732
+ typeName: 'DOUBLE PRECISION',
20733
+ supportsLength: false,
20734
+ supportsPrecisionScale: false
20735
+ };
20736
+ default:
20737
+ return {
20738
+ typeName: normalized,
20739
+ supportsLength: false,
20740
+ supportsPrecisionScale: false
20741
+ };
20742
+ }
20743
+ }
20744
+ }, {
20745
+ key: "MapTypeToString",
20746
+ value: function MapTypeToString(sourceType, sourceLength, sourcePrecision, sourceScale) {
20747
+ var mapped = this.MapType(sourceType, sourceLength, sourcePrecision, sourceScale);
20748
+ return postgresqlDialect_formatTypeString(mapped, sourceLength, sourcePrecision, sourceScale);
20749
+ }
20750
+ }, {
20751
+ key: "mapNVarchar",
20752
+ value: function mapNVarchar(length) {
20753
+ if (length === -1 || length === undefined) {
20754
+ return {
20755
+ typeName: 'TEXT',
20756
+ supportsLength: false,
20757
+ supportsPrecisionScale: false
20758
+ };
20759
+ }
20760
+ return {
20761
+ typeName: 'VARCHAR',
20762
+ supportsLength: true,
20763
+ supportsPrecisionScale: false,
20764
+ defaultLength: length
20765
+ };
20766
+ }
20767
+ }, {
20768
+ key: "mapVarchar",
20769
+ value: function mapVarchar(length) {
20770
+ if (length === -1 || length === undefined) {
20771
+ return {
20772
+ typeName: 'TEXT',
20773
+ supportsLength: false,
20774
+ supportsPrecisionScale: false
20775
+ };
20776
+ }
20777
+ return {
20778
+ typeName: 'VARCHAR',
20779
+ supportsLength: true,
20780
+ supportsPrecisionScale: false,
20781
+ defaultLength: length
20782
+ };
20783
+ }
20784
+ }, {
20785
+ key: "mapFloat",
20786
+ value: function mapFloat(precision) {
20787
+ // SQL Server FLOAT(1-24) = REAL, FLOAT(25-53) = DOUBLE PRECISION
20788
+ if (precision != null && precision <= 24) {
20789
+ return {
20790
+ typeName: 'REAL',
20791
+ supportsLength: false,
20792
+ supportsPrecisionScale: false
20793
+ };
20794
+ }
20795
+ return {
20796
+ typeName: 'DOUBLE PRECISION',
20797
+ supportsLength: false,
20798
+ supportsPrecisionScale: false
20799
+ };
20800
+ }
20801
+ }]);
20802
+ }();
20803
+ /**
20804
+ * Helper to format a MappedType into a full SQL type string.
20805
+ */
20806
+ function postgresqlDialect_formatTypeString(mapped, length, precision, scale) {
20807
+ if (mapped.supportsPrecisionScale && precision != null) {
20808
+ return scale != null ? "".concat(mapped.typeName, "(").concat(precision, ",").concat(scale, ")") : "".concat(mapped.typeName, "(").concat(precision, ")");
20809
+ }
20810
+ if (mapped.supportsLength) {
20811
+ var len = length !== null && length !== void 0 ? length : mapped.defaultLength;
20812
+ if (len != null) {
20813
+ return len === -1 ? 'TEXT' : "".concat(mapped.typeName, "(").concat(len, ")");
20814
+ }
20815
+ }
20816
+ return mapped.typeName;
20817
+ }
20818
+ /**
20819
+ * PostgreSQL dialect implementation.
20820
+ * Uses "double-quote" identifiers, LIMIT/OFFSET pagination, native BOOLEAN, PL/pgSQL functions.
20821
+ */
20822
+ var PostgreSQLDialect = /*#__PURE__*/function (_SQLDialect) {
20823
+ function PostgreSQLDialect() {
20824
+ postgresqlDialect_classCallCheck(this, PostgreSQLDialect);
20825
+ return postgresqlDialect_callSuper(this, PostgreSQLDialect, arguments);
20826
+ }
20827
+ postgresqlDialect_inherits(PostgreSQLDialect, _SQLDialect);
20828
+ return postgresqlDialect_createClass(PostgreSQLDialect, [{
20829
+ key: "PlatformKey",
20830
+ get: function get() {
20831
+ return 'postgresql';
20832
+ }
20833
+ }, {
20834
+ key: "ParserDialect",
20835
+ get: function get() {
20836
+ return 'PostgresQL';
20837
+ }
20838
+ // ─── Identifier Quoting ──────────────────────────────────────────
20839
+ }, {
20840
+ key: "QuoteIdentifier",
20841
+ value: function QuoteIdentifier(name) {
20842
+ return "\"".concat(name, "\"");
20843
+ }
20844
+ }, {
20845
+ key: "QuoteSchema",
20846
+ value: function QuoteSchema(schema, object) {
20847
+ return "".concat(schema, ".\"").concat(object, "\"");
20848
+ }
20849
+ /**
20850
+ * PostgreSQL folds unquoted identifiers to lowercase, which would turn
20851
+ * `AS EntityName` into the result column `entityname`. Quoting the
20852
+ * alias preserves the requested casing for callers that key off the
20853
+ * column name (e.g. when consuming results into a TypeScript object
20854
+ * with a PascalCase property).
20855
+ */
20856
+ }, {
20857
+ key: "QuoteColumnAlias",
20858
+ value: function QuoteColumnAlias(aliasName) {
20859
+ return "\"".concat(aliasName, "\"");
20860
+ }
20861
+ // ─── Pagination ──────────────────────────────────────────────────
20862
+ }, {
20863
+ key: "LimitClause",
20864
+ value: function LimitClause(limit, offset) {
20865
+ var parts = ["LIMIT ".concat(limit)];
20866
+ if (offset != null) {
20867
+ parts.push("OFFSET ".concat(offset));
20868
+ }
20869
+ return {
20870
+ prefix: '',
20871
+ suffix: parts.join(' ')
20872
+ };
20873
+ }
20874
+ // ─── Literals & Expressions ──────────────────────────────────────
20875
+ }, {
20876
+ key: "BooleanLiteral",
20877
+ value: function BooleanLiteral(value) {
20878
+ return value ? 'true' : 'false';
20879
+ }
20880
+ }, {
20881
+ key: "BooleanParameterType",
20882
+ value: function BooleanParameterType() {
20883
+ return 'boolean';
20884
+ }
20885
+ /**
20886
+ * PostgreSQL has no `ISNULL` keyword; the standard is `COALESCE` (which
20887
+ * SQL Server also supports). PG generated SPs/functions emit COALESCE
20888
+ * everywhere a null-coalescing wrap is needed.
20889
+ */
20890
+ }, {
20891
+ key: "IsNull",
20892
+ value: function IsNull(expr, fallback) {
20893
+ return "COALESCE(".concat(expr, ", ").concat(fallback, ")");
20894
+ }
20895
+ /**
20896
+ * PostgreSQL's n-ary null-coalescing is also `COALESCE`. Same form as
20897
+ * the two-arg `IsNull` since PG has no `ISNULL` to differentiate from.
20898
+ */
20899
+ }, {
20900
+ key: "Coalesce",
20901
+ value: function Coalesce(expr, fallback) {
20902
+ return "COALESCE(".concat(expr, ", ").concat(fallback, ")");
20903
+ }
20904
+ /**
20905
+ * PostgreSQL function parameters use a `p_<flat lowercase>` convention
20906
+ * (no `@`-prefix syntax in PG). This matches the baseline-ported SP names
20907
+ * (which lowercased SQL Server's PascalCase parameter names without
20908
+ * separators — e.g. `@CompanyID` → `p_companyid`) and the runtime
20909
+ * PostgreSQLDataProvider, which calls procs with `p_${field.Name.toLowerCase()}`.
20910
+ *
20911
+ * Earlier this used a snake_case transform (`p_company_id`), which
20912
+ * produced functions the runtime could never invoke. Underscores already
20913
+ * in the input (e.g. the `_Clear` companion suffix) are preserved.
20914
+ */
20915
+ }, {
20916
+ key: "ParameterRef",
20917
+ value: function ParameterRef(name) {
20918
+ return "p_".concat(name.toLowerCase());
20919
+ }
20920
+ /**
20921
+ * PostgreSQL functions use the `DEFAULT <value>` clause for parameter defaults.
20922
+ */
20923
+ }, {
20924
+ key: "ParameterDefault",
20925
+ value: function ParameterDefault(value) {
20926
+ return " DEFAULT ".concat(value);
20927
+ }
20928
+ }, {
20929
+ key: "CurrentTimestampUTC",
20930
+ value: function CurrentTimestampUTC() {
20931
+ return "(NOW() AT TIME ZONE 'UTC')";
20932
+ }
20933
+ // ─── Type-Name Sets ──────────────────────────────────────────────
20934
+ // PostgreSQL's column-type names as they appear in `pg_catalog` /
20935
+ // `information_schema` / `EntityField.Type` for entities backed by PG.
20936
+ // Includes both the formal name (`character varying`) and the internal
20937
+ // / short alias (`varchar`, `bpchar`) since both surface depending on
20938
+ // the metadata source.
20939
+ }, {
20940
+ key: "BooleanTypeNames",
20941
+ get: function get() {
20942
+ return PostgreSQLDialect._BooleanTypeNames;
20943
+ }
20944
+ }, {
20945
+ key: "StringTypeNames",
20946
+ get: function get() {
20947
+ return PostgreSQLDialect._StringTypeNames;
20948
+ }
20949
+ }, {
20950
+ key: "DateTypeNames",
20951
+ get: function get() {
20952
+ return PostgreSQLDialect._DateTypeNames;
20953
+ }
20954
+ }, {
20955
+ key: "IntegerTypeNames",
20956
+ get: function get() {
20957
+ return PostgreSQLDialect._IntegerTypeNames;
20958
+ }
20959
+ }, {
20960
+ key: "FloatTypeNames",
20961
+ get: function get() {
20962
+ return PostgreSQLDialect._FloatTypeNames;
20963
+ }
20964
+ }, {
20965
+ key: "UuidTypeNames",
20966
+ get: function get() {
20967
+ return PostgreSQLDialect._UuidTypeNames;
20968
+ }
20969
+ }, {
20970
+ key: "BinaryTypeNames",
20971
+ get: function get() {
20972
+ return PostgreSQLDialect._BinaryTypeNames;
20973
+ }
20974
+ }, {
20975
+ key: "JsonTypeNames",
20976
+ get: function get() {
20977
+ return PostgreSQLDialect._JsonTypeNames;
20978
+ }
20979
+ }, {
20980
+ key: "CurrencyTypeNames",
20981
+ get: function get() {
20982
+ return PostgreSQLDialect._CurrencyTypeNames;
20983
+ }
20984
+ }, {
20985
+ key: "IntervalTypeNames",
20986
+ get: function get() {
20987
+ return PostgreSQLDialect._IntervalTypeNames;
20988
+ }
20989
+ }, {
20990
+ key: "NetworkTypeNames",
20991
+ get: function get() {
20992
+ return PostgreSQLDialect._NetworkTypeNames;
20993
+ }
20994
+ }, {
20995
+ key: "NewUUID",
20996
+ value: function NewUUID() {
20997
+ return 'gen_random_uuid()';
20998
+ }
20999
+ }, {
21000
+ key: "CastToText",
21001
+ value: function CastToText(expr) {
21002
+ return "CAST(".concat(expr, " AS TEXT)");
21003
+ }
21004
+ /**
21005
+ * PostgreSQL-specific Flyway escape. PostgreSQL string concatenation uses
21006
+ * `||` (not `+`), and TEXT has no length cap — so a simple split with `||`
21007
+ * suffices and no cast-to-MAX dance is needed (unlike SQL Server, which
21008
+ * silently truncates `NVARCHAR(N) + NVARCHAR(M)` past 4,000 chars).
21009
+ * PostgreSQL string literals don't take an `N` prefix either; everything
21010
+ * is already Unicode.
21011
+ */
21012
+ }, {
21013
+ key: "EscapeFlywayStringInterpolation",
21014
+ value: function EscapeFlywayStringInterpolation(sql) {
21015
+ return sql.replaceAll(/\$\{/g, "$$'||'{");
21016
+ }
21017
+ }, {
21018
+ key: "CastToUUID",
21019
+ value: function CastToUUID(expr) {
21020
+ return "CAST(".concat(expr, " AS UUID)");
21021
+ }
21022
+ /**
21023
+ * PostgreSQL strict typing requires an explicit `::UUID` cast when
21024
+ * comparing the empty-GUID sentinel against a UUID-typed column.
21025
+ * Without it, PG raises "operator does not exist: uuid = text".
21026
+ */
21027
+ }, {
21028
+ key: "EmptyUUIDLiteral",
21029
+ value: function EmptyUUIDLiteral() {
21030
+ return "".concat(_superPropGet(PostgreSQLDialect, "EmptyUUIDLiteral", this, 3)([]), "::UUID");
21031
+ }
21032
+ // ─── INSERT/UPDATE Return Patterns ───────────────────────────────
21033
+ }, {
21034
+ key: "ReturnInsertedClause",
21035
+ value: function ReturnInsertedClause(columns) {
21036
+ if (columns && columns.length > 0) {
21037
+ var cols = columns.map(function (c) {
21038
+ return "\"".concat(c, "\"");
21039
+ }).join(', ');
21040
+ return "RETURNING ".concat(cols);
21041
+ }
21042
+ return 'RETURNING *';
21043
+ }
21044
+ }, {
21045
+ key: "AutoIncrementPKExpression",
21046
+ value: function AutoIncrementPKExpression() {
21047
+ return 'GENERATED ALWAYS AS IDENTITY';
21048
+ }
21049
+ }, {
21050
+ key: "UUIDPKDefault",
21051
+ value: function UUIDPKDefault() {
21052
+ return 'gen_random_uuid()';
21053
+ }
21054
+ }, {
21055
+ key: "ScopeIdentityExpression",
21056
+ value: function ScopeIdentityExpression() {
21057
+ return 'lastval()';
21058
+ }
21059
+ }, {
21060
+ key: "RowCountExpression",
21061
+ value: function RowCountExpression() {
21062
+ // In PL/pgSQL, use GET DIAGNOSTICS row_count = ROW_COUNT
21063
+ return 'ROW_COUNT';
21064
+ }
21065
+ // ─── Batch & DDL Control ─────────────────────────────────────────
21066
+ }, {
21067
+ key: "BatchSeparator",
21068
+ value: function BatchSeparator() {
21069
+ return ''; // PostgreSQL does not need batch separators
21070
+ }
21071
+ }, {
21072
+ key: "ExistenceCheckSQL",
21073
+ value: function ExistenceCheckSQL(objectType, schema, name) {
21074
+ var normalizedType = objectType.toUpperCase();
21075
+ switch (normalizedType) {
21076
+ case 'TABLE':
21077
+ return "SELECT EXISTS (SELECT 1 FROM pg_catalog.pg_tables WHERE schemaname = '".concat(schema, "' AND tablename = '").concat(name, "')");
21078
+ case 'VIEW':
21079
+ return "SELECT EXISTS (SELECT 1 FROM pg_catalog.pg_views WHERE schemaname = '".concat(schema, "' AND viewname = '").concat(name, "')");
21080
+ case 'FUNCTION':
21081
+ return "SELECT EXISTS (SELECT 1 FROM pg_catalog.pg_proc p JOIN pg_catalog.pg_namespace n ON p.pronamespace = n.oid WHERE n.nspname = '".concat(schema, "' AND p.proname = '").concat(name, "')");
21082
+ case 'PROCEDURE':
21083
+ return "SELECT EXISTS (SELECT 1 FROM pg_catalog.pg_proc p JOIN pg_catalog.pg_namespace n ON p.pronamespace = n.oid WHERE n.nspname = '".concat(schema, "' AND p.proname = '").concat(name, "' AND p.prokind = 'p')");
21084
+ case 'TRIGGER':
21085
+ return "SELECT EXISTS (SELECT 1 FROM pg_catalog.pg_trigger WHERE tgname = '".concat(name, "')");
21086
+ default:
21087
+ return "SELECT EXISTS (SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON c.relnamespace = n.oid WHERE n.nspname = '".concat(schema, "' AND c.relname = '").concat(name, "')");
21088
+ }
21089
+ }
21090
+ }, {
21091
+ key: "CreateOrReplaceSupported",
21092
+ value: function CreateOrReplaceSupported(objectType) {
21093
+ var normalized = objectType.toUpperCase();
21094
+ return normalized === 'FUNCTION' || normalized === 'VIEW' || normalized === 'PROCEDURE';
21095
+ }
21096
+ // ─── Full-Text Search ────────────────────────────────────────────
21097
+ }, {
21098
+ key: "FullTextSearchPredicate",
21099
+ value: function FullTextSearchPredicate(column, searchTerm) {
21100
+ return "".concat(column, " @@ plainto_tsquery('english', ").concat(searchTerm, ")");
21101
+ }
21102
+ }, {
21103
+ key: "FullTextIndexDDL",
21104
+ value: function FullTextIndexDDL(table, columns, _catalog) {
21105
+ var colList = columns.map(function (c) {
21106
+ return "\"".concat(c, "\"");
21107
+ }).join(', ');
21108
+ var cleanTable = table.replace(/"/g, '');
21109
+ var triggerCols = columns.map(function (c) {
21110
+ return "\"".concat(c, "\"");
21111
+ }).join(', ');
21112
+ var lines = [];
21113
+ // Add tsvector column
21114
+ lines.push("ALTER TABLE ".concat(table, " ADD COLUMN IF NOT EXISTS __mj_fts_vector TSVECTOR;"));
21115
+ lines.push('');
21116
+ // Create GIN index on the tsvector column
21117
+ lines.push("CREATE INDEX IF NOT EXISTS idx_fts_".concat(cleanTable.replace(/\./g, '_'), " ON ").concat(table, " USING GIN(__mj_fts_vector);"));
21118
+ lines.push('');
21119
+ // Create update trigger
21120
+ lines.push("CREATE OR REPLACE FUNCTION ".concat(this.extractSchema(table), ".fn_trg_fts_").concat(this.extractName(table), "()"));
21121
+ lines.push('RETURNS TRIGGER AS $$');
21122
+ lines.push('BEGIN');
21123
+ lines.push(" NEW.__mj_fts_vector := to_tsvector('english', ".concat(columns.map(function (c) {
21124
+ return "COALESCE(NEW.\"".concat(c, "\", '')");
21125
+ }).join(" || ' ' || "), ");"));
21126
+ lines.push(' RETURN NEW;');
21127
+ lines.push('END;');
21128
+ lines.push('$$ LANGUAGE plpgsql;');
21129
+ lines.push('');
21130
+ lines.push("DROP TRIGGER IF EXISTS trg_fts_".concat(this.extractName(table), " ON ").concat(table, ";"));
21131
+ lines.push("CREATE TRIGGER trg_fts_".concat(this.extractName(table)));
21132
+ lines.push(" BEFORE INSERT OR UPDATE ON ".concat(table));
21133
+ lines.push(" FOR EACH ROW EXECUTE FUNCTION ".concat(this.extractSchema(table), ".fn_trg_fts_").concat(this.extractName(table), "();"));
21134
+ return lines.join('\n');
21135
+ }
21136
+ // ─── CTE / Recursion ─────────────────────────────────────────────
21137
+ }, {
21138
+ key: "RecursiveCTESyntax",
21139
+ value: function RecursiveCTESyntax() {
21140
+ return 'WITH RECURSIVE';
21141
+ }
21142
+ }, {
21143
+ key: "AllowsOrderByInCTE",
21144
+ get: function get() {
21145
+ return true;
21146
+ }
21147
+ }, {
21148
+ key: "DefaultPagingOrderBy",
21149
+ get: function get() {
21150
+ return '1';
21151
+ }
21152
+ // ─── Data Types ──────────────────────────────────────────────────
21153
+ }, {
21154
+ key: "TypeMap",
21155
+ get: function get() {
21156
+ return new PostgreSQLDataTypeMap();
21157
+ }
21158
+ // ─── Parameters ──────────────────────────────────────────────────
21159
+ }, {
21160
+ key: "ParameterPlaceholder",
21161
+ value: function ParameterPlaceholder(index) {
21162
+ return "$".concat(index + 1); // PostgreSQL uses 1-based indexing
21163
+ }
21164
+ }, {
21165
+ key: "ConcatOperator",
21166
+ value: function ConcatOperator() {
21167
+ return '||';
21168
+ }
21169
+ // ─── String Functions ────────────────────────────────────────────
21170
+ }, {
21171
+ key: "StringSplitFunction",
21172
+ value: function StringSplitFunction(value, delimiter) {
21173
+ return "unnest(string_to_array(".concat(value, ", ").concat(delimiter, "))");
21174
+ }
21175
+ }, {
21176
+ key: "JsonExtract",
21177
+ value: function JsonExtract(column, path) {
21178
+ // PostgreSQL JSONB operator for text extraction
21179
+ return "".concat(column, "->>'").concat(path, "'");
21180
+ }
21181
+ // ─── Procedure / Function Calls ──────────────────────────────────
21182
+ }, {
21183
+ key: "ProcedureCallSyntax",
21184
+ value: function ProcedureCallSyntax(schema, name, params) {
21185
+ var paramList = params.join(', ');
21186
+ return "SELECT * FROM ".concat(schema, ".\"").concat(name, "\"(").concat(paramList, ")");
21187
+ }
21188
+ // ─── DDL Generation (Schema/Table) ──────────────────────────────
21189
+ }, {
21190
+ key: "CreateSchemaDDL",
21191
+ value: function CreateSchemaDDL(schemaName) {
21192
+ return "CREATE SCHEMA IF NOT EXISTS \"".concat(schemaName, "\";");
21193
+ }
21194
+ // ─── DDL Generation (Conditional/Procedural) ────────────────────
21195
+ }, {
21196
+ key: "DateAddExpression",
21197
+ value: function DateAddExpression(unit, amount, baseExpr) {
21198
+ var pgUnit = unit.toLowerCase() + 's'; // MINUTE -> minutes, HOUR -> hours, DAY -> days
21199
+ return "".concat(baseExpr, " + INTERVAL '").concat(amount, " ").concat(pgUnit, "'");
21200
+ }
21201
+ }, {
21202
+ key: "CreateTableIfNotExistsDDL",
21203
+ value: function CreateTableIfNotExistsDDL(schema, tableName, columnsDDL) {
21204
+ var quotedTable = this.QuoteSchema(schema, tableName);
21205
+ return ["CREATE TABLE IF NOT EXISTS ".concat(quotedTable, " ("), columnsDDL, ");"].join('\n');
21206
+ }
21207
+ }, {
21208
+ key: "ConditionalBlock",
21209
+ value: function ConditionalBlock(condition, thenSQL, elseSQL) {
21210
+ var lines = ["DO $$", "BEGIN", " IF ".concat(condition, " THEN"), " ".concat(thenSQL, ";")];
21211
+ if (elseSQL) {
21212
+ lines.push(" ELSE");
21213
+ lines.push(" ".concat(elseSQL, ";"));
21214
+ }
21215
+ lines.push(" END IF;");
21216
+ lines.push("END $$;");
21217
+ return lines.join('\n');
21218
+ }
21219
+ }, {
21220
+ key: "RaiseSignalSQL",
21221
+ value: function RaiseSignalSQL(message) {
21222
+ return "RAISE NOTICE '".concat(message, "'");
21223
+ }
21224
+ // ─── DDL Generation (Schema/Table continued) ────────────────────
21225
+ }, {
21226
+ key: "AddColumnClause",
21227
+ value: function AddColumnClause(col) {
21228
+ var nullable = col.nullable ? 'NULL' : 'NOT NULL';
21229
+ var defaultExpr = col.defaultValue != null ? " DEFAULT ".concat(col.defaultValue) : '';
21230
+ return "ADD COLUMN \"".concat(col.name, "\" ").concat(col.sqlType, " ").concat(nullable).concat(defaultExpr);
21231
+ }
21232
+ }, {
21233
+ key: "AlterColumnDDL",
21234
+ value: function AlterColumnDDL(quotedTable, options) {
21235
+ return "ALTER TABLE ".concat(quotedTable, "\n") + " ALTER COLUMN \"".concat(options.columnName, "\" TYPE ").concat(options.newType, ",\n") + " ALTER COLUMN \"".concat(options.columnName, "\" ").concat(options.newNullable ? 'DROP NOT NULL' : 'SET NOT NULL', ";");
21236
+ }
21237
+ }, {
21238
+ key: "CommentOnColumn",
21239
+ value: function CommentOnColumn(schema, table, column, comment) {
21240
+ var escaped = comment.replace(/'/g, "''");
21241
+ return "COMMENT ON COLUMN \"".concat(schema, "\".\"").concat(table, "\".\"").concat(column, "\" IS '").concat(escaped, "';");
21242
+ }
21243
+ }, {
21244
+ key: "FallbackType",
21245
+ value: function FallbackType() {
21246
+ return 'TEXT';
21247
+ }
21248
+ // ─── DDL Generation (Triggers/Indexes) ──────────────────────────
21249
+ }, {
21250
+ key: "TriggerDDL",
21251
+ value: function TriggerDDL(options) {
21252
+ var _options$forEach, _options$functionName;
21253
+ var events = options.events.join(' OR ');
21254
+ var forEach = (_options$forEach = options.forEach) !== null && _options$forEach !== void 0 ? _options$forEach : 'ROW';
21255
+ var funcName = (_options$functionName = options.functionName) !== null && _options$functionName !== void 0 ? _options$functionName : "fn_".concat(options.triggerName);
21256
+ var lines = [];
21257
+ // PostgreSQL triggers require a companion function
21258
+ lines.push("CREATE OR REPLACE FUNCTION ".concat(options.schema, ".\"").concat(funcName, "\"()"));
21259
+ lines.push('RETURNS TRIGGER AS $$');
21260
+ lines.push('BEGIN');
21261
+ lines.push(" ".concat(options.body));
21262
+ lines.push('END;');
21263
+ lines.push('$$ LANGUAGE plpgsql;');
21264
+ lines.push('');
21265
+ lines.push("DROP TRIGGER IF EXISTS \"".concat(options.triggerName, "\" ON ").concat(options.schema, ".\"").concat(options.tableName, "\";"));
21266
+ lines.push("CREATE TRIGGER \"".concat(options.triggerName, "\""));
21267
+ lines.push(" ".concat(options.timing, " ").concat(events, " ON ").concat(options.schema, ".\"").concat(options.tableName, "\""));
21268
+ lines.push(" FOR EACH ".concat(forEach));
21269
+ lines.push(" EXECUTE FUNCTION ".concat(options.schema, ".\"").concat(funcName, "\"();"));
21270
+ return lines.join('\n');
21271
+ }
21272
+ }, {
21273
+ key: "IndexDDL",
21274
+ value: function IndexDDL(options) {
21275
+ var unique = options.unique ? 'UNIQUE ' : '';
21276
+ var method = options.method ? " USING ".concat(options.method) : '';
21277
+ var cols = options.columns.map(function (c) {
21278
+ return "\"".concat(c, "\"");
21279
+ }).join(', ');
21280
+ var ddl = "CREATE ".concat(unique, "INDEX IF NOT EXISTS \"").concat(options.indexName, "\" ON ").concat(options.schema, ".\"").concat(options.tableName, "\"").concat(method, "(").concat(cols, ")");
21281
+ if (options.where) {
21282
+ ddl += " WHERE ".concat(options.where);
21283
+ }
21284
+ return ddl;
21285
+ }
21286
+ // ─── Permissions ─────────────────────────────────────────────────
21287
+ }, {
21288
+ key: "GrantPermission",
21289
+ value: function GrantPermission(permission, _objectType, schema, object, role) {
21290
+ return "GRANT ".concat(permission, " ON ").concat(schema, ".\"").concat(object, "\" TO \"").concat(role, "\"");
21291
+ }
21292
+ }, {
21293
+ key: "CommentOnObject",
21294
+ value: function CommentOnObject(objectType, schema, name, comment) {
21295
+ var escapedComment = comment.replace(/'/g, "''");
21296
+ var normalizedType = objectType.toUpperCase();
21297
+ return "COMMENT ON ".concat(normalizedType, " ").concat(schema, ".\"").concat(name, "\" IS '").concat(escapedComment, "'");
21298
+ }
21299
+ // ─── Schema Introspection ────────────────────────────────────────
21300
+ }, {
21301
+ key: "SchemaIntrospectionQueries",
21302
+ value: function SchemaIntrospectionQueries() {
21303
+ return {
21304
+ listTables: "\n SELECT schemaname AS schema_name, tablename AS table_name\n FROM pg_catalog.pg_tables\n WHERE schemaname = $1\n ORDER BY tablename",
21305
+ listColumns: "\n SELECT c.column_name, c.data_type, c.character_maximum_length AS max_length,\n c.numeric_precision AS precision, c.numeric_scale AS scale,\n c.is_nullable, c.column_default AS default_value,\n CASE WHEN c.column_default LIKE '%nextval%' THEN true ELSE false END AS is_identity\n FROM information_schema.columns c\n WHERE c.table_schema = $1 AND c.table_name = $2\n ORDER BY c.ordinal_position",
21306
+ listConstraints: "\n SELECT tc.constraint_name, tc.constraint_type, kcu.column_name\n FROM information_schema.table_constraints tc\n JOIN information_schema.key_column_usage kcu\n ON tc.constraint_name = kcu.constraint_name AND tc.table_schema = kcu.table_schema\n WHERE tc.table_schema = $1 AND tc.table_name = $2\n ORDER BY tc.constraint_type, kcu.ordinal_position",
21307
+ listForeignKeys: "\n SELECT\n tc.constraint_name AS fk_name,\n tc.table_schema AS source_schema,\n tc.table_name AS source_table,\n kcu.column_name AS source_column,\n ccu.table_schema AS target_schema,\n ccu.table_name AS target_table,\n ccu.column_name AS target_column\n FROM information_schema.table_constraints tc\n JOIN information_schema.key_column_usage kcu\n ON tc.constraint_name = kcu.constraint_name AND tc.table_schema = kcu.table_schema\n JOIN information_schema.constraint_column_usage ccu\n ON tc.constraint_name = ccu.constraint_name AND tc.table_schema = ccu.table_schema\n WHERE tc.constraint_type = 'FOREIGN KEY' AND tc.table_schema = $1\n ORDER BY tc.constraint_name",
21308
+ listIndexes: "\n SELECT\n i.relname AS index_name,\n ix.indisunique AS is_unique,\n am.amname AS type_desc,\n a.attname AS column_name,\n false AS is_included_column\n FROM pg_catalog.pg_index ix\n JOIN pg_catalog.pg_class t ON t.oid = ix.indrelid\n JOIN pg_catalog.pg_class i ON i.oid = ix.indexrelid\n JOIN pg_catalog.pg_namespace n ON n.oid = t.relnamespace\n JOIN pg_catalog.pg_am am ON am.oid = i.relam\n JOIN pg_catalog.pg_attribute a ON a.attrelid = t.oid AND a.attnum = ANY(ix.indkey)\n WHERE n.nspname = $1 AND t.relname = $2\n ORDER BY i.relname",
21309
+ objectExists: "\n SELECT EXISTS (\n SELECT 1 FROM pg_catalog.pg_class c\n JOIN pg_catalog.pg_namespace n ON c.relnamespace = n.oid\n WHERE n.nspname = $1 AND c.relname = $2\n ) AS exists"
21310
+ };
21311
+ }
21312
+ // ─── IIF ─────────────────────────────────────────────────────────
21313
+ }, {
21314
+ key: "IIF",
21315
+ value: function IIF(condition, trueVal, falseVal) {
21316
+ return "CASE WHEN ".concat(condition, " THEN ").concat(trueVal, " ELSE ").concat(falseVal, " END");
21317
+ }
21318
+ // ─── Abstract Type Resolution ─────────────────────────────────────
21319
+ }, {
21320
+ key: "ResolveAbstractType",
21321
+ value: function ResolveAbstractType(options) {
21322
+ var _options$precision, _options$scale;
21323
+ switch (options.type) {
21324
+ case 'string':
21325
+ return this.resolveStringType(options.maxLength);
21326
+ case 'text':
21327
+ return 'TEXT';
21328
+ case 'integer':
21329
+ return 'INTEGER';
21330
+ case 'bigint':
21331
+ return 'BIGINT';
21332
+ case 'decimal':
21333
+ return "NUMERIC(".concat((_options$precision = options.precision) !== null && _options$precision !== void 0 ? _options$precision : 18, ",").concat((_options$scale = options.scale) !== null && _options$scale !== void 0 ? _options$scale : 2, ")");
21334
+ case 'boolean':
21335
+ return 'BOOLEAN';
21336
+ case 'datetime':
21337
+ return 'TIMESTAMPTZ';
21338
+ case 'date':
21339
+ return 'DATE';
21340
+ case 'uuid':
21341
+ return 'UUID';
21342
+ case 'json':
21343
+ return 'JSONB';
21344
+ case 'float':
21345
+ return 'DOUBLE PRECISION';
21346
+ case 'time':
21347
+ return 'TIME';
21348
+ default:
21349
+ return this.FallbackType();
21350
+ }
21351
+ }
21352
+ }, {
21353
+ key: "resolveStringType",
21354
+ value: function resolveStringType(maxLength) {
21355
+ if (maxLength != null && maxLength > 0) {
21356
+ return "VARCHAR(".concat(maxLength, ")");
21357
+ }
21358
+ return 'VARCHAR(255)';
21359
+ }
21360
+ // ─── Private Helpers ─────────────────────────────────────────────
21361
+ }, {
21362
+ key: "extractSchema",
21363
+ value: function extractSchema(qualifiedName) {
21364
+ var dotIndex = qualifiedName.indexOf('.');
21365
+ if (dotIndex === -1) return 'public';
21366
+ return qualifiedName.substring(0, dotIndex).replace(/"/g, '');
21367
+ }
21368
+ }, {
21369
+ key: "extractName",
21370
+ value: function extractName(qualifiedName) {
21371
+ var dotIndex = qualifiedName.indexOf('.');
21372
+ if (dotIndex === -1) return qualifiedName.replace(/"/g, '');
21373
+ return qualifiedName.substring(dotIndex + 1).replace(/"/g, '');
21374
+ }
21375
+ }]);
21376
+ }(SQLDialect);
21377
+ _PostgreSQLDialect = PostgreSQLDialect;
21378
+ _PostgreSQLDialect._BooleanTypeNames = ['bool', 'boolean'];
21379
+ _PostgreSQLDialect._StringTypeNames = ['text', 'varchar', 'char', 'character', 'character varying', 'bpchar', 'citext', 'name'];
21380
+ _PostgreSQLDialect._DateTypeNames = ['date', 'time', 'time without time zone', 'time with time zone', 'timestamp', 'timestamptz', 'timestamp with time zone', 'timestamp without time zone'];
21381
+ _PostgreSQLDialect._IntegerTypeNames = ['int', 'int2', 'int4', 'int8', 'integer', 'bigint', 'smallint', 'serial', 'bigserial', 'smallserial', 'oid'];
21382
+ _PostgreSQLDialect._FloatTypeNames = ['decimal', 'numeric', 'real', 'double precision', 'float4', 'float8'];
21383
+ _PostgreSQLDialect._UuidTypeNames = ['uuid'];
21384
+ _PostgreSQLDialect._BinaryTypeNames = ['bytea'];
21385
+ _PostgreSQLDialect._JsonTypeNames = ['json', 'jsonb', 'xml'];
21386
+ _PostgreSQLDialect._CurrencyTypeNames = ['money'];
21387
+ _PostgreSQLDialect._IntervalTypeNames = ['interval'];
21388
+ _PostgreSQLDialect._NetworkTypeNames = ['inet', 'cidr', 'macaddr', 'macaddr8'];
21389
+ ;// ../../SQLDialect/dist/dialectFactory.js
21390
+
21391
+
21392
+ /**
21393
+ * Registry of dialect factories keyed by platform.
21394
+ * Add new platforms here when implementing support for MySQL, Oracle, etc.
21395
+ */
21396
+ var DIALECT_MAP = {
21397
+ sqlserver: function sqlserver() {
21398
+ return new SQLServerDialect();
21399
+ },
21400
+ postgresql: function postgresql() {
21401
+ return new PostgreSQLDialect();
21402
+ }
21403
+ };
21404
+ /**
21405
+ * Resolves a {@link DatabasePlatform} string to its concrete {@link SQLDialect} instance.
21406
+ *
21407
+ * This is the single factory for dialect resolution — all consumers should
21408
+ * call this instead of maintaining their own switch/map.
21409
+ *
21410
+ * @param platform - The database platform key (e.g., 'sqlserver', 'postgresql')
21411
+ * @returns The concrete SQLDialect instance for the platform
21412
+ * @throws Error if the platform is not registered
21413
+ */
21414
+ function GetDialect(platform) {
21415
+ var factory = DIALECT_MAP[platform];
21416
+ if (!factory) {
21417
+ throw new Error("No SQLDialect registered for \"".concat(platform, "\". ") + "Supported platforms: ".concat(Object.keys(DIALECT_MAP).join(', ')));
21418
+ }
21419
+ return factory();
21420
+ }
21421
+ ;// ../../SQLDialect/dist/typeClassification.js
21422
+ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = typeClassification_unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
21423
+ function typeClassification_unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return typeClassification_arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? typeClassification_arrayLikeToArray(r, a) : void 0; } }
21424
+ function typeClassification_arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
21425
+ /**
21426
+ * Cross-dialect SQL type-classification predicates.
21427
+ *
21428
+ * Single source of truth for "is this SQL type name a string / boolean / date
21429
+ * / etc." across the MJ stack. Built by unioning each registered SQLDialect's
21430
+ * type-name getters (see `SQLDialect.BooleanTypeNames`, `StringTypeNames`,
21431
+ * etc.), so adding a new dialect requires zero changes here — just register
21432
+ * its dialect class with the same getters and the predicates pick it up.
21433
+ *
21434
+ * Usage:
21435
+ * ```typescript
21436
+ * import { IsBooleanSQLType, IsStringSQLType } from '@memberjunction/sql-dialect';
21437
+ *
21438
+ * if (IsStringSQLType(field.Type)) {
21439
+ * // safe to LOWER() and string-compare
21440
+ * }
21441
+ * ```
21442
+ *
21443
+ * Why this exists: prior call sites hand-coded long switch/case lists of SQL
21444
+ * type names in 5+ files (graphql_server_codegen.ts, MJCore util.ts,
21445
+ * MetadataSync sync-engine.ts, PushService.ts, …). Each list was subtly
21446
+ * different — some included `bpchar`, some forgot `character varying`, some
21447
+ * had `citext` only after a PG bug — and adding a new column type required
21448
+ * grepping every list. Now there is one place per category, owned by the
21449
+ * dialect that defines the type.
21450
+ */
21451
+
21452
+
21453
+ var SS = new SQLServerDialect();
21454
+ var PG = new PostgreSQLDialect();
21455
+ /**
21456
+ * Registered dialects whose type-name getters are unioned into the
21457
+ * classification predicates below. Order is irrelevant — predicates are
21458
+ * `Set.has()` lookups.
21459
+ */
21460
+ var DIALECTS = [SS, PG];
21461
+ /**
21462
+ * Build a Set from one accessor across every registered dialect, normalizing
21463
+ * each name to lowercase + trimmed so call sites can pass raw `EntityField.Type`
21464
+ * strings without pre-normalizing.
21465
+ */
21466
+ function unionLowercase(getter) {
21467
+ var out = new Set();
21468
+ for (var _i = 0, _DIALECTS = DIALECTS; _i < _DIALECTS.length; _i++) {
21469
+ var dialect = _DIALECTS[_i];
21470
+ var _iterator = _createForOfIteratorHelper(getter(dialect)),
21471
+ _step;
21472
+ try {
21473
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
21474
+ var name = _step.value;
21475
+ out.add(name.trim().toLowerCase());
21476
+ }
21477
+ } catch (err) {
21478
+ _iterator.e(err);
21479
+ } finally {
21480
+ _iterator.f();
21481
+ }
21482
+ }
21483
+ return out;
21484
+ }
21485
+ var BOOLEAN_TYPE_SET = unionLowercase(function (d) {
21486
+ return d.BooleanTypeNames;
21487
+ });
21488
+ var STRING_TYPE_SET = unionLowercase(function (d) {
21489
+ return d.StringTypeNames;
21490
+ });
21491
+ var DATE_TYPE_SET = unionLowercase(function (d) {
21492
+ return d.DateTypeNames;
21493
+ });
21494
+ var INTEGER_TYPE_SET = unionLowercase(function (d) {
21495
+ return d.IntegerTypeNames;
21496
+ });
21497
+ var FLOAT_TYPE_SET = unionLowercase(function (d) {
21498
+ return d.FloatTypeNames;
21499
+ });
21500
+ var UUID_TYPE_SET = unionLowercase(function (d) {
21501
+ return d.UuidTypeNames;
21502
+ });
21503
+ var BINARY_TYPE_SET = unionLowercase(function (d) {
21504
+ return d.BinaryTypeNames;
21505
+ });
21506
+ var JSON_TYPE_SET = unionLowercase(function (d) {
21507
+ return d.JsonTypeNames;
21508
+ });
21509
+ var CURRENCY_TYPE_SET = unionLowercase(function (d) {
21510
+ return d.CurrencyTypeNames;
21511
+ });
21512
+ var INTERVAL_TYPE_SET = unionLowercase(function (d) {
21513
+ return d.IntervalTypeNames;
21514
+ });
21515
+ var NETWORK_TYPE_SET = unionLowercase(function (d) {
21516
+ return d.NetworkTypeNames;
21517
+ });
21518
+ function normalize(typeName) {
21519
+ return (typeName !== null && typeName !== void 0 ? typeName : '').trim().toLowerCase();
21520
+ }
21521
+ /** True if `typeName` is a boolean type in any registered dialect (`bit`, `boolean`, `bool`). */
21522
+ function IsBooleanSQLType(typeName) {
21523
+ return BOOLEAN_TYPE_SET.has(normalize(typeName));
21524
+ }
21525
+ /** True if `typeName` is a variable / fixed-length character / text type. Excludes `uuid`. */
21526
+ function IsStringSQLType(typeName) {
21527
+ return STRING_TYPE_SET.has(normalize(typeName));
21528
+ }
21529
+ /** True if `typeName` is a date / time / timestamp type. */
21530
+ function IsDateSQLType(typeName) {
21531
+ return DATE_TYPE_SET.has(normalize(typeName));
21532
+ }
21533
+ /** True if `typeName` is an integer type (any width, including auto-increment / rowversion). */
21534
+ function IsIntegerSQLType(typeName) {
21535
+ return INTEGER_TYPE_SET.has(normalize(typeName));
21536
+ }
21537
+ /** True if `typeName` is a floating-point or fixed-precision decimal type. */
21538
+ function IsFloatSQLType(typeName) {
21539
+ return FLOAT_TYPE_SET.has(normalize(typeName));
21540
+ }
21541
+ /** True if `typeName` is a UUID type (`uniqueidentifier`, `uuid`). */
21542
+ function IsUuidSQLType(typeName) {
21543
+ return UUID_TYPE_SET.has(normalize(typeName));
21544
+ }
21545
+ /** True if `typeName` is a binary blob type (`varbinary`, `image`, `bytea`). */
21546
+ function IsBinarySQLType(typeName) {
21547
+ return BINARY_TYPE_SET.has(normalize(typeName));
21548
+ }
21549
+ /** True if `typeName` is a JSON / XML structured-document type. */
21550
+ function IsJsonSQLType(typeName) {
21551
+ return JSON_TYPE_SET.has(normalize(typeName));
21552
+ }
21553
+ /** True if `typeName` is a fixed-precision currency type (`money`, `smallmoney`). */
21554
+ function IsCurrencySQLType(typeName) {
21555
+ return CURRENCY_TYPE_SET.has(normalize(typeName));
21556
+ }
21557
+ /** True if `typeName` is an interval / duration type (`interval` — PG only currently). */
21558
+ function IsIntervalSQLType(typeName) {
21559
+ return INTERVAL_TYPE_SET.has(normalize(typeName));
21560
+ }
21561
+ /** True if `typeName` is a network address type (`inet`, `cidr`, …). */
21562
+ function IsNetworkSQLType(typeName) {
21563
+ return NETWORK_TYPE_SET.has(normalize(typeName));
21564
+ }
21565
+ /**
21566
+ * Convenience aggregate: any "numeric" type — integer, float, or currency.
21567
+ * Use when the call site doesn't care about the precision/scale distinction.
21568
+ */
21569
+ function IsNumericSQLType(typeName) {
21570
+ var n = normalize(typeName);
21571
+ return INTEGER_TYPE_SET.has(n) || FLOAT_TYPE_SET.has(n) || CURRENCY_TYPE_SET.has(n);
21572
+ }
21573
+ ;// ../../SQLDialect/dist/index.js
21574
+
21575
+
21576
+
21577
+
21578
+
19596
21579
  ;// ../../MJCore/dist/generic/util.js
19597
21580
  function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i.return) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
19598
21581
  function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); }
19599
- function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = util_unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
21582
+ function util_createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = util_unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
19600
21583
  function util_unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return util_arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? util_arrayLikeToArray(r, a) : void 0; } }
19601
21584
  function util_arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
19602
21585
  function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
19603
21586
  function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
19604
21587
 
21588
+
19605
21589
  /**
19606
- * Returns the TypeScript type that corresponds to the SQL type passed in
21590
+ * Returns the TypeScript type that corresponds to the SQL type passed in.
21591
+ *
21592
+ * Classification is delegated to `@memberjunction/sql-dialect` so adding a new
21593
+ * dialect or column type is a one-stop change in the dialect class — never a
21594
+ * grep-and-edit through every util / codegen / sync site.
19607
21595
  */
19608
21596
  function TypeScriptTypeFromSQLType(sqlType) {
19609
- switch (sqlType.trim().toLowerCase()) {
19610
- case 'text':
19611
- case 'char':
19612
- case 'character': // PG returns this for CHAR(N)
19613
- case 'character varying': // PG returns this for VARCHAR(N)
19614
- case 'varchar':
19615
- case 'ntext':
19616
- case 'nchar':
19617
- case 'nvarchar':
19618
- case 'citext': // PostgreSQL case-insensitive text
19619
- case 'uniqueidentifier': //treat this as a string
19620
- case 'uuid': // PostgreSQL UUID type
19621
- case 'bytea':
19622
- // PostgreSQL binary data, treat as string (base64)
19623
- return 'string';
19624
- case 'datetime':
19625
- case 'datetime2':
19626
- case 'datetimeoffset':
19627
- case 'date':
19628
- case 'time':
19629
- case 'timestamp': // PostgreSQL timestamp
19630
- case 'timestamptz': // PostgreSQL timestamp with time zone
19631
- case 'timestamp with time zone': // PostgreSQL full type name
19632
- case 'timestamp without time zone':
19633
- // PostgreSQL full type name
19634
- return 'Date';
19635
- case 'bit':
19636
- case 'bool': // PostgreSQL boolean type (internal name)
19637
- case 'boolean':
19638
- // PostgreSQL boolean type (full name)
19639
- return 'boolean';
19640
- default:
19641
- return 'number';
19642
- }
21597
+ if (IsStringSQLType(sqlType) || IsUuidSQLType(sqlType) || IsBinarySQLType(sqlType)) return 'string';
21598
+ if (IsDateSQLType(sqlType)) return 'Date';
21599
+ if (IsBooleanSQLType(sqlType)) return 'boolean';
21600
+ return 'number';
19643
21601
  }
19644
21602
  function TypeScriptTypeFromSQLTypeWithNullableOption(sqlType, addNullableOption) {
19645
21603
  var retVal = TypeScriptTypeFromSQLType(sqlType);
@@ -19681,73 +21639,46 @@ function FormatValueInternal(sqlType, value) {
19681
21639
  if (value === null || value === undefined) {
19682
21640
  return value;
19683
21641
  }
19684
- switch (sqlType.trim().toLowerCase()) {
19685
- case 'money':
19686
- case 'numeric':
19687
- // PostgreSQL equivalent of money when used for currency
19688
- if (isNaN(value)) return value;else return new Intl.NumberFormat(undefined, {
19689
- style: 'currency',
19690
- currency: currency,
19691
- minimumFractionDigits: decimals,
19692
- maximumFractionDigits: decimals
19693
- }).format(value);
19694
- case 'date':
19695
- case 'time':
19696
- case 'datetime':
19697
- case 'datetime2':
19698
- case 'datetimeoffset':
19699
- case 'timestamp': // PostgreSQL timestamp without time zone
19700
- case 'timestamptz': // PostgreSQL timestamp with time zone
19701
- case 'timestamp with time zone': // PostgreSQL full type name
19702
- case 'timestamp without time zone': // PostgreSQL full type name
19703
- case 'interval':
19704
- // PostgreSQL interval type — format as string
19705
- var date = new Date(value);
19706
- return new Intl.DateTimeFormat().format(date);
19707
- case 'decimal':
19708
- case 'real':
19709
- case 'float':
19710
- case 'double precision':
19711
- // PostgreSQL double precision
19712
- return new Intl.NumberFormat(undefined, {
19713
- minimumFractionDigits: decimals,
19714
- maximumFractionDigits: decimals
19715
- }).format(value);
19716
- case 'int':
19717
- case 'integer': // PostgreSQL integer
19718
- case 'bigint': // PostgreSQL / SQL Server large integer
19719
- case 'smallint': // PostgreSQL / SQL Server small integer
19720
- case 'serial': // PostgreSQL auto-increment integer
19721
- case 'bigserial':
19722
- // PostgreSQL auto-increment big integer
19723
- return new Intl.NumberFormat(undefined, {
19724
- minimumFractionDigits: 0,
19725
- maximumFractionDigits: 0
19726
- }).format(value);
19727
- case 'percent':
19728
- return new Intl.NumberFormat(undefined, {
19729
- style: 'percent',
19730
- minimumFractionDigits: decimals,
19731
- maximumFractionDigits: decimals
19732
- }).format(value);
19733
- case 'boolean': // PostgreSQL boolean
19734
- case 'bool': // PostgreSQL boolean short form
19735
- case 'bit':
19736
- // SQL Server boolean
19737
- return value ? 'true' : 'false';
19738
- case 'uuid': // PostgreSQL UUID
19739
- case 'uniqueidentifier': // SQL Server UUID
19740
- case 'text': // PostgreSQL unlimited text
19741
- case 'json': // PostgreSQL JSON
19742
- case 'jsonb': // PostgreSQL binary JSON
19743
- case 'bytea': // PostgreSQL binary data
19744
- case 'inet': // PostgreSQL network address
19745
- case 'cidr':
19746
- // PostgreSQL network address range
19747
- return String(value);
19748
- default:
19749
- return value;
21642
+ // Special-case the synthetic 'percent' type — not a real SQL type, just a
21643
+ // formatting hint callers pass in via FormatValue().
21644
+ if (sqlType.trim().toLowerCase() === 'percent') {
21645
+ return new Intl.NumberFormat(undefined, {
21646
+ style: 'percent',
21647
+ minimumFractionDigits: decimals,
21648
+ maximumFractionDigits: decimals
21649
+ }).format(value);
21650
+ }
21651
+ if (IsCurrencySQLType(sqlType)) {
21652
+ if (isNaN(value)) return value;
21653
+ return new Intl.NumberFormat(undefined, {
21654
+ style: 'currency',
21655
+ currency: currency,
21656
+ minimumFractionDigits: decimals,
21657
+ maximumFractionDigits: decimals
21658
+ }).format(value);
21659
+ }
21660
+ if (IsDateSQLType(sqlType) || IsIntervalSQLType(sqlType)) {
21661
+ return new Intl.DateTimeFormat().format(new Date(value));
21662
+ }
21663
+ if (IsFloatSQLType(sqlType)) {
21664
+ return new Intl.NumberFormat(undefined, {
21665
+ minimumFractionDigits: decimals,
21666
+ maximumFractionDigits: decimals
21667
+ }).format(value);
21668
+ }
21669
+ if (IsIntegerSQLType(sqlType)) {
21670
+ return new Intl.NumberFormat(undefined, {
21671
+ minimumFractionDigits: 0,
21672
+ maximumFractionDigits: 0
21673
+ }).format(value);
21674
+ }
21675
+ if (IsBooleanSQLType(sqlType)) {
21676
+ return value ? 'true' : 'false';
21677
+ }
21678
+ if (IsUuidSQLType(sqlType) || IsStringSQLType(sqlType) || IsJsonSQLType(sqlType) || IsBinarySQLType(sqlType) || IsNetworkSQLType(sqlType)) {
21679
+ return String(value);
19750
21680
  }
21681
+ return value;
19751
21682
  }
19752
21683
  /**
19753
21684
  * Returns a string that contains the full SQL type including length, precision and scale if applicable
@@ -19897,7 +21828,7 @@ function _RunMaybeSerial() {
19897
21828
  break;
19898
21829
  }
19899
21830
  results = [];
19900
- _iterator = _createForOfIteratorHelper(factories);
21831
+ _iterator = util_createForOfIteratorHelper(factories);
19901
21832
  _context.p = 2;
19902
21833
  _iterator.s();
19903
21834
  case 3:
@@ -20160,12 +22091,12 @@ function _TransformSimpleObjectToEntityObject() {
20160
22091
  return _TransformSimpleObjectToEntityObject.apply(this, arguments);
20161
22092
  }
20162
22093
  ;// ../../MJCore/dist/generic/baseInfo.js
20163
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
20164
- function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
20165
- function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
20166
- function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
20167
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
20168
- function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
22094
+ function baseInfo_typeof(o) { "@babel/helpers - typeof"; return baseInfo_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, baseInfo_typeof(o); }
22095
+ function baseInfo_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
22096
+ function baseInfo_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, baseInfo_toPropertyKey(o.key), o); } }
22097
+ function baseInfo_createClass(e, r, t) { return r && baseInfo_defineProperties(e.prototype, r), t && baseInfo_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
22098
+ function baseInfo_toPropertyKey(t) { var i = baseInfo_toPrimitive(t, "string"); return "symbol" == baseInfo_typeof(i) ? i : i + ""; }
22099
+ function baseInfo_toPrimitive(t, r) { if ("object" != baseInfo_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != baseInfo_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
20169
22100
 
20170
22101
  /**
20171
22102
  * Base class for all MemberJunction metadata info classes.
@@ -20179,7 +22110,7 @@ var BaseInfo = /*#__PURE__*/function () {
20179
22110
  */
20180
22111
  function BaseInfo() {
20181
22112
  var initData = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
20182
- _classCallCheck(this, BaseInfo);
22113
+ baseInfo_classCallCheck(this, BaseInfo);
20183
22114
  /**
20184
22115
  * Primary Key
20185
22116
  */
@@ -20202,7 +22133,7 @@ var BaseInfo = /*#__PURE__*/function () {
20202
22133
  *
20203
22134
  * Subclasses may override to emit a filtered subset or custom shape (see EntityFieldValueInfo).
20204
22135
  */
20205
- return _createClass(BaseInfo, [{
22136
+ return baseInfo_createClass(BaseInfo, [{
20206
22137
  key: "copyInitData",
20207
22138
  value:
20208
22139
  /**
@@ -20301,13 +22232,13 @@ function securityInfo_defineProperties(e, r) { for (var t = 0; t < r.length; t++
20301
22232
  function securityInfo_createClass(e, r, t) { return r && securityInfo_defineProperties(e.prototype, r), t && securityInfo_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
20302
22233
  function securityInfo_toPropertyKey(t) { var i = securityInfo_toPrimitive(t, "string"); return "symbol" == securityInfo_typeof(i) ? i : i + ""; }
20303
22234
  function securityInfo_toPrimitive(t, r) { if ("object" != securityInfo_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != securityInfo_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
20304
- function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
20305
- function _possibleConstructorReturn(t, e) { if (e && ("object" == securityInfo_typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
20306
- function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
20307
- function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
20308
- function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
20309
- function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
20310
- function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
22235
+ function securityInfo_callSuper(t, o, e) { return o = securityInfo_getPrototypeOf(o), securityInfo_possibleConstructorReturn(t, securityInfo_isNativeReflectConstruct() ? Reflect.construct(o, e || [], securityInfo_getPrototypeOf(t).constructor) : o.apply(t, e)); }
22236
+ function securityInfo_possibleConstructorReturn(t, e) { if (e && ("object" == securityInfo_typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return securityInfo_assertThisInitialized(t); }
22237
+ function securityInfo_assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
22238
+ function securityInfo_isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (securityInfo_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
22239
+ function securityInfo_getPrototypeOf(t) { return securityInfo_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, securityInfo_getPrototypeOf(t); }
22240
+ function securityInfo_inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && securityInfo_setPrototypeOf(t, e); }
22241
+ function securityInfo_setPrototypeOf(t, e) { return securityInfo_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, securityInfo_setPrototypeOf(t, e); }
20311
22242
 
20312
22243
 
20313
22244
  // NOTE: Circular import with metadata.ts is intentional and safe.
@@ -20336,7 +22267,7 @@ var UserInfo = /*#__PURE__*/function (_BaseInfo) {
20336
22267
  var md = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
20337
22268
  var initData = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
20338
22269
  securityInfo_classCallCheck(this, UserInfo);
20339
- _this = _callSuper(this, UserInfo);
22270
+ _this = securityInfo_callSuper(this, UserInfo);
20340
22271
  /**
20341
22272
  * Unique identifier for the user
20342
22273
  */
@@ -20426,7 +22357,7 @@ var UserInfo = /*#__PURE__*/function (_BaseInfo) {
20426
22357
  }
20427
22358
  return _this;
20428
22359
  }
20429
- _inherits(UserInfo, _BaseInfo);
22360
+ securityInfo_inherits(UserInfo, _BaseInfo);
20430
22361
  return securityInfo_createClass(UserInfo, [{
20431
22362
  key: "TenantContext",
20432
22363
  get:
@@ -20463,7 +22394,7 @@ var UserRoleInfo = /*#__PURE__*/function (_BaseInfo2) {
20463
22394
  function UserRoleInfo(initData) {
20464
22395
  var _this2;
20465
22396
  securityInfo_classCallCheck(this, UserRoleInfo);
20466
- _this2 = _callSuper(this, UserRoleInfo);
22397
+ _this2 = securityInfo_callSuper(this, UserRoleInfo);
20467
22398
  /**
20468
22399
  * Foreign key reference to the Users table
20469
22400
  */
@@ -20492,7 +22423,7 @@ var UserRoleInfo = /*#__PURE__*/function (_BaseInfo2) {
20492
22423
  _this2.copyInitData(initData);
20493
22424
  return _this2;
20494
22425
  }
20495
- _inherits(UserRoleInfo, _BaseInfo2);
22426
+ securityInfo_inherits(UserRoleInfo, _BaseInfo2);
20496
22427
  return securityInfo_createClass(UserRoleInfo);
20497
22428
  }(BaseInfo);
20498
22429
  /**
@@ -20503,7 +22434,7 @@ var RoleInfo = /*#__PURE__*/function (_BaseInfo3) {
20503
22434
  function RoleInfo(initData) {
20504
22435
  var _this3;
20505
22436
  securityInfo_classCallCheck(this, RoleInfo);
20506
- _this3 = _callSuper(this, RoleInfo);
22437
+ _this3 = securityInfo_callSuper(this, RoleInfo);
20507
22438
  /**
20508
22439
  * Unique identifier for the role
20509
22440
  */
@@ -20535,7 +22466,7 @@ var RoleInfo = /*#__PURE__*/function (_BaseInfo3) {
20535
22466
  _this3.copyInitData(initData);
20536
22467
  return _this3;
20537
22468
  }
20538
- _inherits(RoleInfo, _BaseInfo3);
22469
+ securityInfo_inherits(RoleInfo, _BaseInfo3);
20539
22470
  return securityInfo_createClass(RoleInfo);
20540
22471
  }(BaseInfo);
20541
22472
  /**
@@ -20545,7 +22476,7 @@ var RowLevelSecurityFilterInfo = /*#__PURE__*/function (_BaseInfo4) {
20545
22476
  function RowLevelSecurityFilterInfo(initData) {
20546
22477
  var _this4;
20547
22478
  securityInfo_classCallCheck(this, RowLevelSecurityFilterInfo);
20548
- _this4 = _callSuper(this, RowLevelSecurityFilterInfo);
22479
+ _this4 = securityInfo_callSuper(this, RowLevelSecurityFilterInfo);
20549
22480
  /**
20550
22481
  * Unique identifier for the row level security filter
20551
22482
  */
@@ -20582,7 +22513,7 @@ var RowLevelSecurityFilterInfo = /*#__PURE__*/function (_BaseInfo4) {
20582
22513
  /**
20583
22514
  * Lazily parses and caches the PlatformVariants JSON.
20584
22515
  */
20585
- _inherits(RowLevelSecurityFilterInfo, _BaseInfo4);
22516
+ securityInfo_inherits(RowLevelSecurityFilterInfo, _BaseInfo4);
20586
22517
  return securityInfo_createClass(RowLevelSecurityFilterInfo, [{
20587
22518
  key: "ParsedVariants",
20588
22519
  get: function get() {
@@ -20647,7 +22578,7 @@ var AuthorizationInfo = /*#__PURE__*/function (_BaseInfo5) {
20647
22578
  var initData = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
20648
22579
  var _md = arguments.length > 1 ? arguments[1] : undefined;
20649
22580
  securityInfo_classCallCheck(this, AuthorizationInfo);
20650
- _this5 = _callSuper(this, AuthorizationInfo);
22581
+ _this5 = securityInfo_callSuper(this, AuthorizationInfo);
20651
22582
  /**
20652
22583
  * Unique identifier for the authorization
20653
22584
  */
@@ -20693,7 +22624,7 @@ var AuthorizationInfo = /*#__PURE__*/function (_BaseInfo5) {
20693
22624
  * @param {UserInfo} user - The user to check for execution rights.
20694
22625
  * @returns {boolean} True if the user has a matching Allow role and no matching Deny role; false otherwise.
20695
22626
  */
20696
- _inherits(AuthorizationInfo, _BaseInfo5);
22627
+ securityInfo_inherits(AuthorizationInfo, _BaseInfo5);
20697
22628
  return securityInfo_createClass(AuthorizationInfo, [{
20698
22629
  key: "Roles",
20699
22630
  get:
@@ -20803,7 +22734,7 @@ var AuthorizationRoleInfo = /*#__PURE__*/function (_BaseInfo6) {
20803
22734
  function AuthorizationRoleInfo(initData) {
20804
22735
  var _this8;
20805
22736
  securityInfo_classCallCheck(this, AuthorizationRoleInfo);
20806
- _this8 = _callSuper(this, AuthorizationRoleInfo);
22737
+ _this8 = securityInfo_callSuper(this, AuthorizationRoleInfo);
20807
22738
  /**
20808
22739
  * Unique identifier for the authorization-role mapping
20809
22740
  */
@@ -20832,7 +22763,7 @@ var AuthorizationRoleInfo = /*#__PURE__*/function (_BaseInfo6) {
20832
22763
  _this8.copyInitData(initData);
20833
22764
  return _this8;
20834
22765
  }
20835
- _inherits(AuthorizationRoleInfo, _BaseInfo6);
22766
+ securityInfo_inherits(AuthorizationRoleInfo, _BaseInfo6);
20836
22767
  return securityInfo_createClass(AuthorizationRoleInfo, [{
20837
22768
  key: "RoleInfo",
20838
22769
  get: function get() {
@@ -20857,7 +22788,7 @@ var AuditLogTypeInfo = /*#__PURE__*/function (_BaseInfo7) {
20857
22788
  function AuditLogTypeInfo(initData) {
20858
22789
  var _this9;
20859
22790
  securityInfo_classCallCheck(this, AuditLogTypeInfo);
20860
- _this9 = _callSuper(this, AuditLogTypeInfo);
22791
+ _this9 = securityInfo_callSuper(this, AuditLogTypeInfo);
20861
22792
  /**
20862
22793
  * Unique identifier for the audit log type
20863
22794
  */
@@ -20889,7 +22820,7 @@ var AuditLogTypeInfo = /*#__PURE__*/function (_BaseInfo7) {
20889
22820
  _this9.copyInitData(initData);
20890
22821
  return _this9;
20891
22822
  }
20892
- _inherits(AuditLogTypeInfo, _BaseInfo7);
22823
+ securityInfo_inherits(AuditLogTypeInfo, _BaseInfo7);
20893
22824
  return securityInfo_createClass(AuditLogTypeInfo);
20894
22825
  }(BaseInfo);
20895
22826
  ;// ../../MJCore/dist/generic/compositeKey.js
@@ -23339,6 +25270,13 @@ var EntityFieldInfo = /*#__PURE__*/function (_BaseInfo7) {
23339
25270
  _this7.IncludeInUserSearchAPI = null;
23340
25271
  _this7.FullTextSearchEnabled = false;
23341
25272
  _this7.UserSearchParamFormatAPI = null;
25273
+ /**
25274
+ * Search predicate controlling how user-search queries match against this field
25275
+ * in the LIKE-based search path used when the entity does not have FullTextSearchEnabled.
25276
+ * Valid values: 'BeginsWith' | 'Contains' | 'EndsWith' | 'Exact'. Default 'Contains'.
25277
+ * Honored by GenericDatabaseProvider.createViewUserSearchSQL.
25278
+ */
25279
+ _this7.UserSearchPredicateAPI = null;
23342
25280
  _this7.IncludeInGeneratedForm = null;
23343
25281
  _this7.GeneratedFormSection = null;
23344
25282
  _this7.IsVirtual = null;
@@ -23874,7 +25812,7 @@ var EntityFieldInfo = /*#__PURE__*/function (_BaseInfo7) {
23874
25812
  }, {
23875
25813
  key: "NeedsClearCompanion",
23876
25814
  get: function get() {
23877
- return this.AllowsNull && this.HasDefaultValue;
25815
+ return this.AllowsNull;
23878
25816
  }
23879
25817
  /**
23880
25818
  * Returns true if the field is a "special" field (see list below) and is handled inside the DB layer and should be ignored in validation by the BaseEntity architecture
@@ -24577,13 +26515,38 @@ var EntityInfo = /*#__PURE__*/function (_BaseInfo0) {
24577
26515
  }, {
24578
26516
  key: "NameField",
24579
26517
  get: function get() {
24580
- var f = this.Fields.find(function (f) {
26518
+ var _this$Fields$find;
26519
+ // Multiple fields can have IsNameField=true (e.g. Entity has both `Name`
26520
+ // and `DisplayName` marked). Without a deterministic preference, the
26521
+ // pick depends on `this.Fields` insertion order — which differs between
26522
+ // SQL Server (where `Name` happens to come first) and PostgreSQL (where
26523
+ // `DisplayName` does). Codegen builds JOIN aliases off NameField, so
26524
+ // the divergence produces views like `vwDatasetItems` that SELECT the
26525
+ // wrong column on PG (`DisplayName AS "Entity"` instead of
26526
+ // `Name AS "Entity"`), and downstream consumers like
26527
+ // TemplateEngineBase.GetDatasetByName then look up `"Templates"`
26528
+ // (the DisplayName) instead of `"MJ: Templates"` (the actual Name) and
26529
+ // crash with `Entity Templates not found in metadata`.
26530
+ //
26531
+ // Resolution rule: when more than one field claims IsNameField, prefer
26532
+ // the one literally named `Name`. Falls back to the first IsNameField
26533
+ // match (preserves prior behavior when there's no `Name` field), then
26534
+ // to a field named `Name` even without IsNameField set (legacy default).
26535
+ var candidates = this.Fields.filter(function (f) {
24581
26536
  return f.IsNameField;
24582
26537
  });
24583
- if (!f) return this.Fields.find(function (f) {
24584
- var _f$Name;
24585
- return ((_f$Name = f.Name) === null || _f$Name === void 0 ? void 0 : _f$Name.trim().toLowerCase()) === 'name';
24586
- });else return f;
26538
+ if (candidates.length > 1) {
26539
+ var literalName = candidates.find(function (f) {
26540
+ var _f$Name;
26541
+ return ((_f$Name = f.Name) === null || _f$Name === void 0 ? void 0 : _f$Name.trim().toLowerCase()) === 'name';
26542
+ });
26543
+ if (literalName) return literalName;
26544
+ }
26545
+ if (candidates.length > 0) return candidates[0];
26546
+ return (_this$Fields$find = this.Fields.find(function (f) {
26547
+ var _f$Name2;
26548
+ return ((_f$Name2 = f.Name) === null || _f$Name2 === void 0 ? void 0 : _f$Name2.trim().toLowerCase()) === 'name';
26549
+ })) !== null && _this$Fields$find !== void 0 ? _this$Fields$find : null;
24587
26550
  }
24588
26551
  /**************************************************************************
24589
26552
  * IS-A Type Relationship Computed Properties
@@ -26319,8 +28282,32 @@ var EntityField = /*#__PURE__*/function () {
26319
28282
  }
26320
28283
  }
26321
28284
  } else {
26322
- // for strings we're good to just set the value
26323
- this.Value = fieldInfo.DefaultValue;
28285
+ // For strings: strip PostgreSQL's typed-literal wrapper.
28286
+ //
28287
+ // PG's pg_get_expr() (used by vwSQLColumnsAndEntityFields →
28288
+ // EntityField.DefaultValue) renders a string default like:
28289
+ // 'Single'::character varying
28290
+ // 'pending'::text
28291
+ // SQL Server stores the same default as just `'Single'` or
28292
+ // `'pending'`. If we set the field value to the raw PG form,
28293
+ // the value is `'Single'::character varying` (27 chars), and
28294
+ // a MaxLength=20 constraint immediately fails validation —
28295
+ // even though the actual content is `Single` (6 chars).
28296
+ //
28297
+ // Unwrap a leading single-quoted string followed by a `::type`
28298
+ // suffix. Function-call defaults (`nextval('...')`,
28299
+ // `now() AT TIME ZONE 'UTC'`) deliberately don't match this
28300
+ // shape and are left untouched — the database evaluates them
28301
+ // server-side at INSERT time.
28302
+ var dv = fieldInfo.DefaultValue.trim();
28303
+ var pgTypedLiteral = /^'((?:[^']|'')*)'::[A-Za-z][\w "()\[\],]*$/;
28304
+ var m = dv.match(pgTypedLiteral);
28305
+ if (m) {
28306
+ // Replace the SQL-escaped doubled quotes back to a single quote.
28307
+ this.Value = m[1].replace(/''/g, "'");
28308
+ } else {
28309
+ this.Value = fieldInfo.DefaultValue;
28310
+ }
26324
28311
  }
26325
28312
  this._NeverSet = true; // set this back to true because we are setting the default value and we want to be able to set this ONCE from BaseEntity when we load
26326
28313
  } else {
@@ -30978,9 +32965,9 @@ function telemetryManager_assertThisInitialized(e) { if (void 0 === e) throw new
30978
32965
  function telemetryManager_isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (telemetryManager_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
30979
32966
  function telemetryManager_inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && telemetryManager_setPrototypeOf(t, e); }
30980
32967
  function telemetryManager_setPrototypeOf(t, e) { return telemetryManager_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, telemetryManager_setPrototypeOf(t, e); }
30981
- function _superPropGet(t, o, e, r) { var p = _get(telemetryManager_getPrototypeOf(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; }
30982
- function _get() { return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { var p = _superPropBase(e, t); if (p) { var n = Object.getOwnPropertyDescriptor(p, t); return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; } }, _get.apply(null, arguments); }
30983
- function _superPropBase(t, o) { for (; !{}.hasOwnProperty.call(t, o) && null !== (t = telemetryManager_getPrototypeOf(t));); return t; }
32968
+ function telemetryManager_superPropGet(t, o, e, r) { var p = telemetryManager_get(telemetryManager_getPrototypeOf(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; }
32969
+ function telemetryManager_get() { return telemetryManager_get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { var p = telemetryManager_superPropBase(e, t); if (p) { var n = Object.getOwnPropertyDescriptor(p, t); return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; } }, telemetryManager_get.apply(null, arguments); }
32970
+ function telemetryManager_superPropBase(t, o) { for (; !{}.hasOwnProperty.call(t, o) && null !== (t = telemetryManager_getPrototypeOf(t));); return t; }
30984
32971
  function telemetryManager_getPrototypeOf(t) { return telemetryManager_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, telemetryManager_getPrototypeOf(t); }
30985
32972
  function telemetryManager_toConsumableArray(r) { return telemetryManager_arrayWithoutHoles(r) || telemetryManager_iterableToArray(r) || telemetryManager_unsupportedIterableToArray(r) || telemetryManager_nonIterableSpread(); }
30986
32973
  function telemetryManager_nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
@@ -32137,7 +34124,7 @@ var TelemetryManager = /*#__PURE__*/function (_BaseSingleton) {
32137
34124
  * Returns the singleton instance of TelemetryManager
32138
34125
  */
32139
34126
  function get() {
32140
- return _superPropGet(TelemetryManager, "getInstance", this, 2)([]);
34127
+ return telemetryManager_superPropGet(TelemetryManager, "getInstance", this, 2)([]);
32141
34128
  }
32142
34129
  }]);
32143
34130
  }(dist/* BaseSingleton */.tC);
@@ -44436,7 +46423,7 @@ var BaseEngine = /*#__PURE__*/function (_BaseSingleton) {
44436
46423
  key: "syncLocalCacheForConfig",
44437
46424
  value: (function () {
44438
46425
  var _syncLocalCacheForConfig = baseEngine_asyncToGenerator(/*#__PURE__*/baseEngine_regenerator().m(function _callee12(config, event) {
44439
- var entity, provider, connectionString, params, fingerprint, key, updatedAt, entityData;
46426
+ var entity, provider, connectionString, params, fingerprint, key, rawUpdatedAt, updatedAt, entityData;
44440
46427
  return baseEngine_regenerator().w(function (_context12) {
44441
46428
  while (1) switch (_context12.n) {
44442
46429
  case 0:
@@ -44472,8 +46459,14 @@ var BaseEngine = /*#__PURE__*/function (_BaseSingleton) {
44472
46459
  LogStatus("BaseEngine.syncLocalCacheForConfig: Cannot sync - primary key is incomplete for ".concat(config.EntityName));
44473
46460
  return _context12.a(2);
44474
46461
  case 2:
44475
- // Get the updated timestamp from the entity
44476
- updatedAt = entity.Get('__mj_UpdatedAt') || new Date().toISOString();
46462
+ // Get the updated timestamp from the entity and normalize to an ISO string.
46463
+ // entity.Get returns Date|string|number|null depending on field hydration and the
46464
+ // storage round-trip. The downstream cache and smart-cache-check protocol require
46465
+ // an ISO string — without this normalization, a Date or numeric ms can leak into
46466
+ // the GraphQL request as `cacheStatus.maxUpdatedAt` and crash the server's
46467
+ // `new Date(...).toISOString()` with `RangeError: Invalid time value`.
46468
+ rawUpdatedAt = entity.Get('__mj_UpdatedAt');
46469
+ updatedAt = rawUpdatedAt ? new Date(rawUpdatedAt).toISOString() : new Date().toISOString();
44477
46470
  if (!(event.type === 'delete')) {
44478
46471
  _context12.n = 4;
44479
46472
  break;
@@ -47623,6 +49616,7 @@ function databaseProviderBase_setPrototypeOf(t, e) { return databaseProviderBase
47623
49616
 
47624
49617
 
47625
49618
 
49619
+
47626
49620
  // Re-export PlatformSQL types from their canonical location for backward compatibility
47627
49621
 
47628
49622
  /**
@@ -47637,19 +49631,24 @@ function databaseProviderBase_setPrototypeOf(t, e) { return databaseProviderBase
47637
49631
  */
47638
49632
  var DatabaseProviderBase = /*#__PURE__*/function (_ProviderBase) {
47639
49633
  function DatabaseProviderBase() {
49634
+ var _this;
47640
49635
  databaseProviderBase_classCallCheck(this, DatabaseProviderBase);
47641
- return databaseProviderBase_callSuper(this, DatabaseProviderBase, arguments);
49636
+ _this = databaseProviderBase_callSuper(this, DatabaseProviderBase, arguments);
49637
+ _this._dialect = null;
49638
+ /**************************************************************************/
49639
+ // END ---- RunReport
49640
+ /**************************************************************************/
49641
+ return _this;
47642
49642
  }
49643
+ /**
49644
+ * Server-side providers trust the local cache completely because it is
49645
+ * kept in perfect sync via BaseEntity save/delete events and cross-server
49646
+ * Redis pub/sub. No lightweight DB validation needed on cache hits.
49647
+ */
47643
49648
  databaseProviderBase_inherits(DatabaseProviderBase, _ProviderBase);
47644
49649
  return databaseProviderBase_createClass(DatabaseProviderBase, [{
47645
49650
  key: "TrustLocalCacheCompletely",
47646
- get:
47647
- /**
47648
- * Server-side providers trust the local cache completely because it is
47649
- * kept in perfect sync via BaseEntity save/delete events and cross-server
47650
- * Redis pub/sub. No lightweight DB validation needed on cache hits.
47651
- */
47652
- function get() {
49651
+ get: function get() {
47653
49652
  return true;
47654
49653
  }
47655
49654
  /**
@@ -47674,6 +49673,28 @@ var DatabaseProviderBase = /*#__PURE__*/function (_ProviderBase) {
47674
49673
  get: function get() {
47675
49674
  return 'sqlserver';
47676
49675
  }
49676
+ /**
49677
+ * The {@link SQLDialect} instance matching this provider's `PlatformKey`.
49678
+ *
49679
+ * Use this whenever runtime code needs to emit dialect-specific SQL
49680
+ * (boolean literals, identifier quoting, casts, …) — it spares callers
49681
+ * from doing `GetDialect(provider.PlatformKey)` every time, and keeps
49682
+ * dialect resolution in one place. Resolves lazily and is cached so
49683
+ * repeated access is free.
49684
+ *
49685
+ * Example:
49686
+ * ```typescript
49687
+ * const lit = provider.Dialect.BooleanLiteral(true); // '1' on SS, 'TRUE' on PG
49688
+ * ```
49689
+ */
49690
+ }, {
49691
+ key: "Dialect",
49692
+ get: function get() {
49693
+ if (!this._dialect) {
49694
+ this._dialect = GetDialect(this.PlatformKey);
49695
+ }
49696
+ return this._dialect;
49697
+ }
47677
49698
  /**
47678
49699
  * Gets the MemberJunction core schema name (e.g. '__mj').
47679
49700
  * Subclasses should override if they have a different way to resolve this.
@@ -47751,7 +49772,7 @@ var DatabaseProviderBase = /*#__PURE__*/function (_ProviderBase) {
47751
49772
  }, {
47752
49773
  key: "DiffObjects",
47753
49774
  value: function DiffObjects(oldData, newData, entityInfo, quoteToEscape) {
47754
- var _this = this;
49775
+ var _this2 = this;
47755
49776
  if (!oldData || !newData) return null;
47756
49777
  var changes = {};
47757
49778
  var _loop = function _loop(key) {
@@ -47760,10 +49781,10 @@ var DatabaseProviderBase = /*#__PURE__*/function (_ProviderBase) {
47760
49781
  });
47761
49782
  if (!f) return 1; // continue
47762
49783
  // skip if field not found in entity info
47763
- var bDiff = _this.isFieldDifferent(f, oldData[key], newData[key]);
49784
+ var bDiff = _this2.isFieldDifferent(f, oldData[key], newData[key]);
47764
49785
  if (bDiff) {
47765
- var o = _this.escapeValueForDiff(oldData[key], quoteToEscape);
47766
- var n = _this.escapeValueForDiff(newData[key], quoteToEscape);
49786
+ var o = _this2.escapeValueForDiff(oldData[key], quoteToEscape);
49787
+ var n = _this2.escapeValueForDiff(newData[key], quoteToEscape);
47767
49788
  changes[key] = {
47768
49789
  field: key,
47769
49790
  oldValue: o,
@@ -47852,11 +49873,11 @@ var DatabaseProviderBase = /*#__PURE__*/function (_ProviderBase) {
47852
49873
  }, {
47853
49874
  key: "EscapeQuotesInProperties",
47854
49875
  value: function EscapeQuotesInProperties(obj, quoteToEscape) {
47855
- var _this2 = this;
49876
+ var _this3 = this;
47856
49877
  if (obj === null || obj === undefined) return obj;
47857
49878
  if (Array.isArray(obj)) {
47858
49879
  return obj.map(function (item) {
47859
- return _this2.EscapeQuotesInProperties(item, quoteToEscape);
49880
+ return _this3.EscapeQuotesInProperties(item, quoteToEscape);
47860
49881
  });
47861
49882
  }
47862
49883
  if (obj instanceof Date) return obj.toISOString();
@@ -48335,14 +50356,14 @@ var DatabaseProviderBase = /*#__PURE__*/function (_ProviderBase) {
48335
50356
  }, {
48336
50357
  key: "parseRecordDependencyResults",
48337
50358
  value: function parseRecordDependencyResults(result) {
48338
- var _this3 = this;
50359
+ var _this4 = this;
48339
50360
  var recordDependencies = [];
48340
50361
  var _iterator3 = databaseProviderBase_createForOfIteratorHelper(result),
48341
50362
  _step3;
48342
50363
  try {
48343
50364
  var _loop2 = function _loop2() {
48344
50365
  var r = _step3.value;
48345
- var entityInfo = _this3.EntityByName(r.EntityName);
50366
+ var entityInfo = _this4.EntityByName(r.EntityName);
48346
50367
  if (!entityInfo) {
48347
50368
  throw new Error("Entity ".concat(r.EntityName, " not found in metadata"));
48348
50369
  }
@@ -48880,7 +50901,7 @@ var DatabaseProviderBase = /*#__PURE__*/function (_ProviderBase) {
48880
50901
  }, {
48881
50902
  key: "BuildEntityRecordNameSQL",
48882
50903
  value: function BuildEntityRecordNameSQL(entityName, compositeKey) {
48883
- var _this4 = this;
50904
+ var _this5 = this;
48884
50905
  var e = this.EntityByName(entityName);
48885
50906
  if (!e) throw new Error('Entity ' + entityName + ' not found');
48886
50907
  // Collect ALL IsNameField fields in Sequence order for multi-field name support
@@ -48911,7 +50932,7 @@ var DatabaseProviderBase = /*#__PURE__*/function (_ProviderBase) {
48911
50932
  });
48912
50933
  var quotes = pk && pk.NeedsQuotes ? "'" : '';
48913
50934
  if (where.length > 0) where += ' AND ';
48914
- where += _this4.QuoteIdentifier(pkv.FieldName) + '=' + quotes + pkv.Value + quotes;
50935
+ where += _this5.QuoteIdentifier(pkv.FieldName) + '=' + quotes + pkv.Value + quotes;
48915
50936
  };
48916
50937
  for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
48917
50938
  _loop4();
@@ -48923,7 +50944,7 @@ var DatabaseProviderBase = /*#__PURE__*/function (_ProviderBase) {
48923
50944
  _iterator5.f();
48924
50945
  }
48925
50946
  var selectFields = nameFields.map(function (f) {
48926
- return _this4.QuoteIdentifier(f.Name);
50947
+ return _this5.QuoteIdentifier(f.Name);
48927
50948
  }).join(', ');
48928
50949
  return 'SELECT ' + selectFields + ' FROM ' + this.QuoteSchemaAndView(e.SchemaName, e.BaseView) + ' WHERE ' + where;
48929
50950
  }
@@ -49059,7 +51080,7 @@ var DatabaseProviderBase = /*#__PURE__*/function (_ProviderBase) {
49059
51080
  key: "Save",
49060
51081
  value: (function () {
49061
51082
  var _Save = databaseProviderBase_asyncToGenerator(/*#__PURE__*/databaseProviderBase_regenerator().m(function _callee14(entity, user, options) {
49062
- var _this5 = this;
51083
+ var _this6 = this;
49063
51084
  var entityResult, bNewRecord, bReplay, saveContext, validationMessage, createRLSPass, updateRLSPass, sqlDetails, _sqlDetails$parameter, extraData, result, _sqlDetails$parameter2, execOptions, rawResult, patches, _t8;
49064
51085
  return databaseProviderBase_regenerator().w(function (_context16) {
49065
51086
  while (1) switch (_context16.p = _context16.n) {
@@ -49192,12 +51213,12 @@ var DatabaseProviderBase = /*#__PURE__*/function (_ProviderBase) {
49192
51213
  }
49193
51214
  extraData.entityName = entity.EntityInfo.Name;
49194
51215
  entity.TransactionGroup.AddTransaction(new TransactionItem(entity, entityResult.Type === 'create' ? 'Create' : 'Update', sqlDetails.fullSQL, (_sqlDetails$parameter = sqlDetails.parameters) !== null && _sqlDetails$parameter !== void 0 ? _sqlDetails$parameter : null, extraData, function (transactionResult, success) {
49195
- _this5.OnResumeRefresh();
51216
+ _this6.OnResumeRefresh();
49196
51217
  entityResult.EndedAt = new Date();
49197
51218
  if (success && transactionResult) {
49198
- _this5.OnAfterSaveExecute(entity, user, options, saveContext);
51219
+ _this6.OnAfterSaveExecute(entity, user, options, saveContext);
49199
51220
  entityResult.Success = true;
49200
- entityResult.NewValues = _this5.MapTransactionResultToNewValues(transactionResult);
51221
+ entityResult.NewValues = _this6.MapTransactionResultToNewValues(transactionResult);
49201
51222
  } else {
49202
51223
  entityResult.Success = false;
49203
51224
  entityResult.Message = 'Transaction Failed';
@@ -49293,7 +51314,7 @@ var DatabaseProviderBase = /*#__PURE__*/function (_ProviderBase) {
49293
51314
  key: "Delete",
49294
51315
  value: (function () {
49295
51316
  var _Delete = databaseProviderBase_asyncToGenerator(/*#__PURE__*/databaseProviderBase_regenerator().m(function _callee15(entity, options, user) {
49296
- var _this6 = this;
51317
+ var _this7 = this;
49297
51318
  var entityResult, bReplay, sqlDetails, deleteRLSPass, _sqlDetails$parameter3, extraData, d, _sqlDetails$parameter4, execOptions, _t9;
49298
51319
  return databaseProviderBase_regenerator().w(function (_context17) {
49299
51320
  while (1) switch (_context17.p = _context17.n) {
@@ -49362,7 +51383,7 @@ var DatabaseProviderBase = /*#__PURE__*/function (_ProviderBase) {
49362
51383
  entity.TransactionGroup.AddTransaction(new TransactionItem(entity, 'Delete', sqlDetails.fullSQL, (_sqlDetails$parameter3 = sqlDetails.parameters) !== null && _sqlDetails$parameter3 !== void 0 ? _sqlDetails$parameter3 : null, extraData, function (transactionResult, success) {
49363
51384
  entityResult.EndedAt = new Date();
49364
51385
  if (success && transactionResult) {
49365
- _this6.OnAfterDeleteExecute(entity, user, options);
51386
+ _this7.OnAfterDeleteExecute(entity, user, options);
49366
51387
  var _iterator7 = databaseProviderBase_createForOfIteratorHelper(entity.PrimaryKeys),
49367
51388
  _step7;
49368
51389
  try {
@@ -49378,7 +51399,7 @@ var DatabaseProviderBase = /*#__PURE__*/function (_ProviderBase) {
49378
51399
  } finally {
49379
51400
  _iterator7.f();
49380
51401
  }
49381
- entityResult.NewValues = _this6.MapTransactionResultToNewValues(transactionResult);
51402
+ entityResult.NewValues = _this7.MapTransactionResultToNewValues(transactionResult);
49382
51403
  entityResult.Success = true;
49383
51404
  } else {
49384
51405
  entityResult.Success = false;
@@ -51414,7 +53435,7 @@ __webpack_require__.r(__webpack_exports__);
51414
53435
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
51415
53436
  /* harmony export */ UserViewEngine: () => (/* binding */ UserViewEngine)
51416
53437
  /* harmony export */ });
51417
- /* harmony import */ var _memberjunction_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(925);
53438
+ /* harmony import */ var _memberjunction_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(310);
51418
53439
  /* harmony import */ var _memberjunction_global__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(300);
51419
53440
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
51420
53441
  function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i.return) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
@@ -51782,8 +53803,8 @@ __webpack_require__.d(__webpack_exports__, {
51782
53803
 
51783
53804
  // UNUSED EXPORTS: AIAgentPermissionProvider, AccessControlRuleProvider, ApplicationRolePermissionProvider, ArtifactExtractor, ArtifactMetadataEngine, ArtifactPermissionProvider, CollectionPermissionProvider, ConversationEngine, CreateShareNotification, DEFAULT_AGGREGATE_DISPLAY, DashboardEngine, DashboardPermissionProvider, EncryptionEngineBase, EntityPermissionProvider, EntityPermissionType, EntitySaveOptions, FileStorageEngineBase, GeoDataEngine, InstanceConfigEngine, KnowledgeHubMetadataEngine, LoadMJAccessControlRuleEntityExtended, LoadMJArtifactPermissionEntityExtended, LoadMJCollectionPermissionEntityExtended, LoadMJConversationDetailEntityExtended, LoadMJDashboardPermissionEntityExtended, LoadPermissionEntityExtensions, LoadPermissionProviders, MCPEngine, MJAIActionEntity, MJAIActionSchema, MJAIAgentActionEntity, MJAIAgentActionSchema, MJAIAgentArtifactTypeEntity, MJAIAgentArtifactTypeSchema, MJAIAgentCategoryEntity, MJAIAgentCategorySchema, MJAIAgentClientToolEntity, MJAIAgentClientToolSchema, MJAIAgentConfigurationEntity, MJAIAgentConfigurationSchema, MJAIAgentDataSourceEntity, MJAIAgentDataSourceSchema, MJAIAgentEntity, MJAIAgentExampleEntity, MJAIAgentExampleSchema, MJAIAgentLearningCycleEntity, MJAIAgentLearningCycleSchema, MJAIAgentModalityEntity, MJAIAgentModalitySchema, MJAIAgentModelEntity, MJAIAgentModelSchema, MJAIAgentNoteEntity, MJAIAgentNoteSchema, MJAIAgentNoteTypeEntity, MJAIAgentNoteTypeSchema, MJAIAgentPermissionEntity, MJAIAgentPermissionSchema, MJAIAgentPromptEntity, MJAIAgentPromptSchema, MJAIAgentRelationshipEntity, MJAIAgentRelationshipSchema, MJAIAgentRequestEntity, MJAIAgentRequestSchema, MJAIAgentRequestTypeEntity, MJAIAgentRequestTypeSchema, MJAIAgentRunEntity, MJAIAgentRunMediaEntity, MJAIAgentRunMediaSchema, MJAIAgentRunSchema, MJAIAgentRunStepEntity, MJAIAgentRunStepSchema, MJAIAgentSchema, MJAIAgentStepEntity, MJAIAgentStepPathEntity, MJAIAgentStepPathSchema, MJAIAgentStepSchema, MJAIAgentTypeEntity, MJAIAgentTypeSchema, MJAIArchitectureEntity, MJAIArchitectureSchema, MJAIClientToolDefinitionEntity, MJAIClientToolDefinitionSchema, MJAIConfigurationEntity, MJAIConfigurationParamEntity, MJAIConfigurationParamSchema, MJAIConfigurationSchema, MJAICredentialBindingEntity, MJAICredentialBindingSchema, MJAIModalityEntity, MJAIModalitySchema, MJAIModelActionEntity, MJAIModelActionSchema, MJAIModelArchitectureEntity, MJAIModelArchitectureSchema, MJAIModelCostEntity, MJAIModelCostSchema, MJAIModelEntity, MJAIModelModalityEntity, MJAIModelModalitySchema, MJAIModelPriceTypeEntity, MJAIModelPriceTypeSchema, MJAIModelPriceUnitTypeEntity, MJAIModelPriceUnitTypeSchema, MJAIModelSchema, MJAIModelTypeEntity, MJAIModelTypeSchema, MJAIModelVendorEntity, MJAIModelVendorSchema, MJAIPromptCategoryEntity, MJAIPromptCategorySchema, MJAIPromptEntity, MJAIPromptModelEntity, MJAIPromptModelSchema, MJAIPromptRunEntity, MJAIPromptRunMediaEntity, MJAIPromptRunMediaSchema, MJAIPromptRunSchema, MJAIPromptSchema, MJAIPromptTypeEntity, MJAIPromptTypeSchema, MJAIResultCacheEntity, MJAIResultCacheSchema, MJAIVendorEntity, MJAIVendorSchema, MJAIVendorTypeDefinitionEntity, MJAIVendorTypeDefinitionSchema, MJAIVendorTypeEntity, MJAIVendorTypeSchema, MJAPIApplicationEntity, MJAPIApplicationSchema, MJAPIApplicationScopeEntity, MJAPIApplicationScopeSchema, MJAPIKeyApplicationEntity, MJAPIKeyApplicationSchema, MJAPIKeyEntity, MJAPIKeySchema, MJAPIKeyScopeEntity, MJAPIKeyScopeSchema, MJAPIKeyUsageLogEntity, MJAPIKeyUsageLogSchema, MJAPIScopeEntity, MJAPIScopeSchema, MJAccessControlRuleEntity, MJAccessControlRuleEntityExtended, MJAccessControlRuleSchema, MJActionAuthorizationEntity, MJActionAuthorizationSchema, MJActionCategoryEntity, MJActionCategorySchema, MJActionContextEntity, MJActionContextSchema, MJActionContextTypeEntity, MJActionContextTypeSchema, MJActionEntity, MJActionExecutionLogEntity, MJActionExecutionLogSchema, MJActionFilterEntity, MJActionFilterSchema, MJActionLibraryEntity, MJActionLibrarySchema, MJActionParamEntity, MJActionParamSchema, MJActionResultCodeEntity, MJActionResultCodeSchema, MJActionSchema, MJApplicationEntity, MJApplicationEntityEntity, MJApplicationEntitySchema, MJApplicationRoleEntity, MJApplicationRoleSchema, MJApplicationSchema, MJApplicationSettingEntity, MJApplicationSettingSchema, MJArchiveConfigurationEntity, MJArchiveConfigurationEntityEntity, MJArchiveConfigurationEntitySchema, MJArchiveConfigurationSchema, MJArchiveRunDetailEntity, MJArchiveRunDetailSchema, MJArchiveRunEntity, MJArchiveRunSchema, MJArtifactEntity, MJArtifactPermissionEntity, MJArtifactPermissionEntityExtended, MJArtifactPermissionSchema, MJArtifactSchema, MJArtifactTypeEntity, MJArtifactTypeSchema, MJArtifactUseEntity, MJArtifactUseSchema, MJArtifactVersionAttributeEntity, MJArtifactVersionAttributeSchema, MJArtifactVersionEntity, MJArtifactVersionSchema, MJAuditLogEntity, MJAuditLogSchema, MJAuditLogTypeEntity, MJAuditLogTypeSchema, MJAuthorizationEntity, MJAuthorizationRoleEntity, MJAuthorizationRoleSchema, MJAuthorizationSchema, MJCollectionArtifactEntity, MJCollectionArtifactSchema, MJCollectionEntity, MJCollectionPermissionEntity, MJCollectionPermissionEntityExtended, MJCollectionPermissionSchema, MJCollectionSchema, MJCommunicationBaseMessageTypeEntity, MJCommunicationBaseMessageTypeSchema, MJCommunicationLogEntity, MJCommunicationLogSchema, MJCommunicationProviderEntity, MJCommunicationProviderMessageTypeEntity, MJCommunicationProviderMessageTypeSchema, MJCommunicationProviderSchema, MJCommunicationRunEntity, MJCommunicationRunSchema, MJCompanyEntity, MJCompanyIntegrationEntity, MJCompanyIntegrationEntityMapEntity, MJCompanyIntegrationEntityMapSchema, MJCompanyIntegrationFieldMapEntity, MJCompanyIntegrationFieldMapSchema, MJCompanyIntegrationRecordMapEntity, MJCompanyIntegrationRecordMapSchema, MJCompanyIntegrationRunAPILogEntity, MJCompanyIntegrationRunAPILogSchema, MJCompanyIntegrationRunDetailEntity, MJCompanyIntegrationRunDetailSchema, MJCompanyIntegrationRunEntity, MJCompanyIntegrationRunSchema, MJCompanyIntegrationSchema, MJCompanyIntegrationSyncWatermarkEntity, MJCompanyIntegrationSyncWatermarkSchema, MJCompanySchema, MJComponentDependencyEntity, MJComponentDependencySchema, MJComponentEntity, MJComponentEntityExtended, MJComponentLibraryEntity, MJComponentLibraryLinkEntity, MJComponentLibraryLinkSchema, MJComponentLibrarySchema, MJComponentRegistryEntity, MJComponentRegistrySchema, MJComponentSchema, MJContentFileTypeEntity, MJContentFileTypeSchema, MJContentItemAttributeEntity, MJContentItemAttributeSchema, MJContentItemDuplicateEntity, MJContentItemDuplicateSchema, MJContentItemEntity, MJContentItemSchema, MJContentItemTagEntity, MJContentItemTagSchema, MJContentProcessRunDetailEntity, MJContentProcessRunDetailSchema, MJContentProcessRunEntity, MJContentProcessRunPromptRunEntity, MJContentProcessRunPromptRunSchema, MJContentProcessRunSchema, MJContentSourceEntity, MJContentSourceParamEntity, MJContentSourceParamSchema, MJContentSourceSchema, MJContentSourceTypeEntity, MJContentSourceTypeParamEntity, MJContentSourceTypeParamSchema, MJContentSourceTypeSchema, MJContentTypeAttributeEntity, MJContentTypeAttributeSchema, MJContentTypeEntity, MJContentTypeSchema, MJConversationArtifactEntity, MJConversationArtifactPermissionEntity, MJConversationArtifactPermissionSchema, MJConversationArtifactSchema, MJConversationArtifactVersionEntity, MJConversationArtifactVersionSchema, MJConversationDetailArtifactEntity, MJConversationDetailArtifactSchema, MJConversationDetailAttachmentEntity, MJConversationDetailAttachmentSchema, MJConversationDetailEntity, MJConversationDetailEntityExtended, MJConversationDetailRatingEntity, MJConversationDetailRatingSchema, MJConversationDetailSchema, MJConversationEntity, MJConversationSchema, MJCountryEntity, MJCountrySchema, MJCredentialCategoryEntity, MJCredentialCategorySchema, MJCredentialEntity, MJCredentialSchema, MJCredentialTypeEntity, MJCredentialTypeSchema, MJDashboardCategoryEntity, MJDashboardCategoryLinkEntity, MJDashboardCategoryLinkSchema, MJDashboardCategoryPermissionEntity, MJDashboardCategoryPermissionSchema, MJDashboardCategorySchema, MJDashboardEntity, MJDashboardEntityExtended, MJDashboardPartTypeEntity, MJDashboardPartTypeSchema, MJDashboardPermissionEntity, MJDashboardPermissionEntityExtended, MJDashboardPermissionSchema, MJDashboardSchema, MJDashboardUserPreferenceEntity, MJDashboardUserPreferenceSchema, MJDashboardUserStateEntity, MJDashboardUserStateSchema, MJDataContextEntity, MJDataContextItemEntity, MJDataContextItemSchema, MJDataContextSchema, MJDatasetEntity, MJDatasetItemEntity, MJDatasetItemSchema, MJDatasetSchema, MJDuplicateRunDetailEntity, MJDuplicateRunDetailMatchEntity, MJDuplicateRunDetailMatchSchema, MJDuplicateRunDetailSchema, MJDuplicateRunEntity, MJDuplicateRunSchema, MJEmployeeCompanyIntegrationEntity, MJEmployeeCompanyIntegrationSchema, MJEmployeeEntity, MJEmployeeRoleEntity, MJEmployeeRoleSchema, MJEmployeeSchema, MJEmployeeSkillEntity, MJEmployeeSkillSchema, MJEncryptionAlgorithmEntity, MJEncryptionAlgorithmSchema, MJEncryptionKeyEntity, MJEncryptionKeySchema, MJEncryptionKeySourceEntity, MJEncryptionKeySourceSchema, MJEntityAIActionEntity, MJEntityAIActionSchema, MJEntityActionEntity, MJEntityActionFilterEntity, MJEntityActionFilterSchema, MJEntityActionInvocationEntity, MJEntityActionInvocationSchema, MJEntityActionInvocationTypeEntity, MJEntityActionInvocationTypeSchema, MJEntityActionParamEntity, MJEntityActionParamSchema, MJEntityActionSchema, MJEntityCommunicationFieldEntity, MJEntityCommunicationFieldSchema, MJEntityCommunicationMessageTypeEntity, MJEntityCommunicationMessageTypeSchema, MJEntityDocumentEntity, MJEntityDocumentRunEntity, MJEntityDocumentRunSchema, MJEntityDocumentSchema, MJEntityDocumentSettingEntity, MJEntityDocumentSettingSchema, MJEntityDocumentTypeEntity, MJEntityDocumentTypeSchema, MJEntityEntity, MJEntityEntityExtended, MJEntityFieldEntity, MJEntityFieldEntityExtended, MJEntityFieldSchema, MJEntityFieldValueEntity, MJEntityFieldValueSchema, MJEntityOrganicKeyEntity, MJEntityOrganicKeyRelatedEntityEntity, MJEntityOrganicKeyRelatedEntitySchema, MJEntityOrganicKeySchema, MJEntityPermissionEntity, MJEntityPermissionSchema, MJEntityRecordDocumentEntity, MJEntityRecordDocumentSchema, MJEntityRelationshipDisplayComponentEntity, MJEntityRelationshipDisplayComponentSchema, MJEntityRelationshipEntity, MJEntityRelationshipSchema, MJEntitySchema, MJEntitySettingEntity, MJEntitySettingSchema, MJEnvironmentEntity, MJEnvironmentEntityExtended, MJEnvironmentSchema, MJErrorLogEntity, MJErrorLogSchema, MJExplorerNavigationItemEntity, MJExplorerNavigationItemSchema, MJFileCategoryEntity, MJFileCategorySchema, MJFileEntity, MJFileEntityRecordLinkEntity, MJFileEntityRecordLinkSchema, MJFileSchema, MJFileStorageAccountEntity, MJFileStorageAccountPermissionEntity, MJFileStorageAccountPermissionSchema, MJFileStorageAccountSchema, MJFileStorageProviderEntity, MJFileStorageProviderSchema, MJGeneratedCodeCategoryEntity, MJGeneratedCodeCategorySchema, MJGeneratedCodeEntity, MJGeneratedCodeSchema, MJInstanceConfigurationEntity, MJInstanceConfigurationSchema, MJIntegrationEntity, MJIntegrationObjectEntity, MJIntegrationObjectFieldEntity, MJIntegrationObjectFieldSchema, MJIntegrationObjectSchema, MJIntegrationSchema, MJIntegrationSourceTypeEntity, MJIntegrationSourceTypeSchema, MJIntegrationURLFormatEntity, MJIntegrationURLFormatSchema, MJKnowledgeHubSavedSearchEntity, MJKnowledgeHubSavedSearchSchema, MJLibraryEntity, MJLibraryItemEntity, MJLibraryItemSchema, MJLibrarySchema, MJListCategoryEntity, MJListCategorySchema, MJListDetailEntity, MJListDetailEntityExtended, MJListDetailSchema, MJListEntity, MJListInvitationEntity, MJListInvitationSchema, MJListSchema, MJListShareEntity, MJListShareSchema, MJMCPServerConnectionEntity, MJMCPServerConnectionPermissionEntity, MJMCPServerConnectionPermissionSchema, MJMCPServerConnectionSchema, MJMCPServerConnectionToolEntity, MJMCPServerConnectionToolSchema, MJMCPServerEntity, MJMCPServerSchema, MJMCPServerToolEntity, MJMCPServerToolSchema, MJMCPToolExecutionLogEntity, MJMCPToolExecutionLogSchema, MJMCPToolFavoriteEntity, MJMCPToolFavoriteSchema, MJOAuthAuthServerMetadataCacheEntity, MJOAuthAuthServerMetadataCacheSchema, MJOAuthAuthorizationStateEntity, MJOAuthAuthorizationStateSchema, MJOAuthClientRegistrationEntity, MJOAuthClientRegistrationSchema, MJOAuthTokenEntity, MJOAuthTokenSchema, MJOpenAppDependencyEntity, MJOpenAppDependencySchema, MJOpenAppEntity, MJOpenAppInstallHistoryEntity, MJOpenAppInstallHistorySchema, MJOpenAppSchema, MJOutputDeliveryTypeEntity, MJOutputDeliveryTypeSchema, MJOutputFormatTypeEntity, MJOutputFormatTypeSchema, MJOutputTriggerTypeEntity, MJOutputTriggerTypeSchema, MJPermissionDomainEntity, MJPermissionDomainSchema, MJProjectEntity, MJProjectSchema, MJPublicLinkEntity, MJPublicLinkSchema, MJQueryCategoryEntity, MJQueryCategorySchema, MJQueryDependencyEntity, MJQueryDependencySchema, MJQueryEntity, MJQueryEntityEntity, MJQueryEntitySchema, MJQueryFieldEntity, MJQueryFieldSchema, MJQueryParameterEntity, MJQueryParameterSchema, MJQueryPermissionEntity, MJQueryPermissionSchema, MJQuerySQLEntity, MJQuerySQLSchema, MJQuerySchema, MJQueueEntity, MJQueueSchema, MJQueueTaskEntity, MJQueueTaskSchema, MJQueueTypeEntity, MJQueueTypeSchema, MJRecommendationEntity, MJRecommendationItemEntity, MJRecommendationItemSchema, MJRecommendationProviderEntity, MJRecommendationProviderSchema, MJRecommendationRunEntity, MJRecommendationRunSchema, MJRecommendationSchema, MJRecordChangeEntity, MJRecordChangeReplayRunEntity, MJRecordChangeReplayRunSchema, MJRecordChangeSchema, MJRecordGeoCodeEntity, MJRecordGeoCodeSchema, MJRecordLinkEntity, MJRecordLinkSchema, MJRecordMergeDeletionLogEntity, MJRecordMergeDeletionLogSchema, MJRecordMergeLogEntity, MJRecordMergeLogSchema, MJReportCategoryEntity, MJReportCategorySchema, MJReportEntity, MJReportSchema, MJReportSnapshotEntity, MJReportSnapshotSchema, MJReportUserStateEntity, MJReportUserStateSchema, MJReportVersionEntity, MJReportVersionSchema, MJResourceLinkEntity, MJResourceLinkSchema, MJResourcePermissionEntity, MJResourcePermissionEntityExtended, MJResourcePermissionSchema, MJResourceTypeEntity, MJResourceTypeSchema, MJRoleEntity, MJRoleSchema, MJRowLevelSecurityFilterEntity, MJRowLevelSecurityFilterSchema, MJSQLDialectEntity, MJSQLDialectSchema, MJScheduledActionEntity, MJScheduledActionEntityExtended, MJScheduledActionParamEntity, MJScheduledActionParamSchema, MJScheduledActionSchema, MJScheduledJobEntity, MJScheduledJobRunEntity, MJScheduledJobRunSchema, MJScheduledJobSchema, MJScheduledJobTypeEntity, MJScheduledJobTypeSchema, MJSchemaInfoEntity, MJSchemaInfoSchema, MJSearchProviderEntity, MJSearchProviderSchema, MJSkillEntity, MJSkillSchema, MJStateProvinceEntity, MJStateProvinceSchema, MJTagAuditLogEntity, MJTagAuditLogSchema, MJTagCoOccurrenceEntity, MJTagCoOccurrenceSchema, MJTagEntity, MJTagSchema, MJTagScopeEntity, MJTagScopeSchema, MJTagSuggestionEntity, MJTagSuggestionSchema, MJTagSynonymEntity, MJTagSynonymSchema, MJTaggedItemEntity, MJTaggedItemSchema, MJTaskDependencyEntity, MJTaskDependencySchema, MJTaskEntity, MJTaskSchema, MJTaskTypeEntity, MJTaskTypeSchema, MJTemplateCategoryEntity, MJTemplateCategorySchema, MJTemplateContentEntity, MJTemplateContentSchema, MJTemplateContentTypeEntity, MJTemplateContentTypeSchema, MJTemplateEntity, MJTemplateEntityExtended, MJTemplateParamEntity, MJTemplateParamSchema, MJTemplateSchema, MJTestEntity, MJTestRubricEntity, MJTestRubricSchema, MJTestRunEntity, MJTestRunFeedbackEntity, MJTestRunFeedbackSchema, MJTestRunOutputEntity, MJTestRunOutputSchema, MJTestRunOutputTypeEntity, MJTestRunOutputTypeSchema, MJTestRunSchema, MJTestSchema, MJTestSuiteEntity, MJTestSuiteRunEntity, MJTestSuiteRunSchema, MJTestSuiteSchema, MJTestSuiteTestEntity, MJTestSuiteTestSchema, MJTestTypeEntity, MJTestTypeSchema, MJUserApplicationEntity, MJUserApplicationEntityEntity, MJUserApplicationEntitySchema, MJUserApplicationSchema, MJUserEntity, MJUserFavoriteEntity, MJUserFavoriteSchema, MJUserNotificationEntity, MJUserNotificationPreferenceEntity, MJUserNotificationPreferenceSchema, MJUserNotificationSchema, MJUserNotificationTypeEntity, MJUserNotificationTypeSchema, MJUserRecordLogEntity, MJUserRecordLogSchema, MJUserRoleEntity, MJUserRoleSchema, MJUserSchema, MJUserSettingEntity, MJUserSettingSchema, MJUserViewCategoryEntity, MJUserViewCategorySchema, MJUserViewEntity, MJUserViewEntityExtended, MJUserViewRunDetailEntity, MJUserViewRunDetailSchema, MJUserViewRunEntity, MJUserViewRunSchema, MJUserViewSchema, MJVectorDatabaseEntity, MJVectorDatabaseSchema, MJVectorIndexEntity, MJVectorIndexSchema, MJVersionInstallationEntity, MJVersionInstallationSchema, MJVersionLabelEntity, MJVersionLabelItemEntity, MJVersionLabelItemSchema, MJVersionLabelRestoreEntity, MJVersionLabelRestoreSchema, MJVersionLabelSchema, MJWorkflowEngineEntity, MJWorkflowEngineSchema, MJWorkflowEntity, MJWorkflowRunEntity, MJWorkflowRunSchema, MJWorkflowSchema, MJWorkspaceEntity, MJWorkspaceItemEntity, MJWorkspaceItemSchema, MJWorkspaceSchema, PERMISSION_DOMAIN_ICONS, PERMISSION_DOMAIN_ICON_FALLBACK, PermissionEngine, QueryEngine, QueryPermissionProvider, RegisterShareNotificationHandler, ResourceData, ResourcePermissionEngine, ResourcePermissionProvider, SearchEngineBase, TypeTablesCache, UserInfoEngine, UserViewEngine, ViewColumnInfo, ViewFilterInfo, ViewFilterLogicInfo, ViewGridState, ViewSortDirectionInfo, ViewSortInfo, assertCallerMayCreateShare, buildActionsSummary, checkShareManagePermission, dispatchShareNotificationAfterSave, loadModule, parseConversationDetailComplete
51784
53805
 
51785
- // EXTERNAL MODULE: ../../MJCore/dist/index.js + 75 modules
51786
- var dist = __webpack_require__(925);
53806
+ // EXTERNAL MODULE: ../../MJCore/dist/index.js + 81 modules
53807
+ var dist = __webpack_require__(310);
51787
53808
  // EXTERNAL MODULE: ../../MJGlobal/dist/index.js + 16 modules
51788
53809
  var MJGlobal_dist = __webpack_require__(300);
51789
53810
  ;// ../../MJCoreEntities/node_modules/zod/lib/index.mjs
@@ -56405,7 +58426,7 @@ function _regenerator(){/*! regenerator-runtime -- Copyright (c) 2014-present, F
56405
58426
  * zod schema definition for the entity MJ: Component Dependencies
56406
58427
  */var MJComponentDependencySchema=z.object({ID:z.string().describe("\n * * Field Name: ID\n * * Display Name: ID\n * * SQL Data Type: uniqueidentifier\n * * Default Value: newsequentialid()\n * * Description: Primary key for component dependency"),ComponentID:z.string().describe("\n * * Field Name: ComponentID\n * * Display Name: Component ID\n * * SQL Data Type: uniqueidentifier\n * * Related Entity/Foreign Key: MJ: Components (vwComponents.ID)\n * * Description: Foreign key to parent Component that has the dependency"),DependencyComponentID:z.string().describe("\n * * Field Name: DependencyComponentID\n * * Display Name: Dependency Component ID\n * * SQL Data Type: uniqueidentifier\n * * Related Entity/Foreign Key: MJ: Components (vwComponents.ID)\n * * Description: Foreign key to the Component that is depended upon"),__mj_CreatedAt:z.date().describe("\n * * Field Name: __mj_CreatedAt\n * * Display Name: Created At\n * * SQL Data Type: datetimeoffset\n * * Default Value: getutcdate()"),__mj_UpdatedAt:z.date().describe("\n * * Field Name: __mj_UpdatedAt\n * * Display Name: Updated At\n * * SQL Data Type: datetimeoffset\n * * Default Value: getutcdate()"),Component:z.string().describe("\n * * Field Name: Component\n * * Display Name: Component\n * * SQL Data Type: nvarchar(500)"),DependencyComponent:z.string().describe("\n * * Field Name: DependencyComponent\n * * Display Name: Dependency Component\n * * SQL Data Type: nvarchar(500)")});/**
56407
58428
  * zod schema definition for the entity MJ: Component Libraries
56408
- */var MJComponentLibrarySchema=z.object({ID:z.string().describe("\n * * Field Name: ID\n * * Display Name: ID\n * * SQL Data Type: uniqueidentifier\n * * Default Value: newsequentialid()\n * * Description: Primary key for the component library"),Name:z.string().describe("\n * * Field Name: Name\n * * Display Name: Name\n * * SQL Data Type: nvarchar(500)\n * * Description: NPM-style package name (e.g., recharts, lodash, @memberjunction/lib-name)"),DisplayName:z.string().nullable().describe("\n * * Field Name: DisplayName\n * * Display Name: Display Name\n * * SQL Data Type: nvarchar(500)\n * * Description: User-friendly display name for the library"),Version:z.string().nullable().describe("\n * * Field Name: Version\n * * Display Name: Version\n * * SQL Data Type: nvarchar(100)\n * * Description: Library version number"),GlobalVariable:z.string().nullable().describe("\n * * Field Name: GlobalVariable\n * * Display Name: Global Variable\n * * SQL Data Type: nvarchar(255)\n * * Description: Global variable name when loaded (e.g., _ for lodash, React for react)"),Category:z.union([z.literal('Charting'),z.literal('Core'),z.literal('Other'),z.literal('Runtime'),z.literal('UI'),z.literal('Utility')]).nullable().describe("\n * * Field Name: Category\n * * Display Name: Category\n * * SQL Data Type: nvarchar(100)\n * * Value List Type: List\n * * Possible Values \n * * Charting\n * * Core\n * * Other\n * * Runtime\n * * UI\n * * Utility\n * * Description: Library category: Core, Runtime, UI, Charting, Utility, or Other"),CDNUrl:z.string().nullable().describe("\n * * Field Name: CDNUrl\n * * Display Name: CDN Url\n * * SQL Data Type: nvarchar(1000)\n * * Description: CDN URL for loading the library JavaScript"),CDNCssUrl:z.string().nullable().describe("\n * * Field Name: CDNCssUrl\n * * Display Name: CDN Css Url\n * * SQL Data Type: nvarchar(1000)\n * * Description: Optional CDN URL for loading library CSS"),Description:z.string().nullable().describe("\n * * Field Name: Description\n * * Display Name: Description\n * * SQL Data Type: nvarchar(MAX)\n * * Description: Description of the library and its capabilities"),__mj_CreatedAt:z.date().describe("\n * * Field Name: __mj_CreatedAt\n * * Display Name: Created At\n * * SQL Data Type: datetimeoffset\n * * Default Value: getutcdate()"),__mj_UpdatedAt:z.date().describe("\n * * Field Name: __mj_UpdatedAt\n * * Display Name: Updated At\n * * SQL Data Type: datetimeoffset\n * * Default Value: getutcdate()"),Status:z.union([z.literal('Active'),z.literal('Deprecated'),z.literal('Disabled')]).describe("\n * * Field Name: Status\n * * Display Name: Status\n * * SQL Data Type: nvarchar(20)\n * * Default Value: Active\n * * Value List Type: List\n * * Possible Values \n * * Active\n * * Deprecated\n * * Disabled\n * * Description: Status of the component library. Active: fully supported; Deprecated: works but shows console warning; Disabled: throws error if used"),LintRules:z.string().nullable().describe("\n * * Field Name: LintRules\n * * Display Name: Lint Rules\n * * SQL Data Type: nvarchar(MAX)\n * * Description: JSON configuration for library-specific lint rules that are applied during component validation. This field contains structured rules that define how components using this library should be validated, including DOM element requirements, initialization patterns, lifecycle methods, and common error patterns. Example structure: {\"initialization\": {\"constructorName\": \"Chart\", \"elementType\": \"canvas\"}, \"lifecycle\": {\"requiredMethods\": [\"render\"], \"cleanupMethods\": [\"destroy\"]}}. The linter dynamically applies these rules based on the libraries referenced in a component spec, enabling extensible validation without hardcoding library-specific logic."),Dependencies:z.string().nullable().describe("\n * * Field Name: Dependencies\n * * Display Name: Dependencies\n * * SQL Data Type: nvarchar(MAX)\n * * Description: JSON object defining dependencies for this component library. Format: { \"libraryName\": \"versionSpec\", ... }. Version specifications follow NPM-style syntax (e.g., \"~1.0.0\", \"^1.2.3\", \"2.3.4\"). Dependencies are loaded before this library to ensure proper execution context."),UsageType:z.union([z.literal('Both'),z.literal('Dependency'),z.literal('Direct')]).describe("\n * * Field Name: UsageType\n * * Display Name: Usage Type\n * * SQL Data Type: nvarchar(50)\n * * Default Value: Both\n * * Value List Type: List\n * * Possible Values \n * * Both\n * * Dependency\n * * Direct\n * * Description: Controls how the library can be used: Direct (by components), Dependency (only as dependency), or Both")});/**
58429
+ */var MJComponentLibrarySchema=z.object({ID:z.string().describe("\n * * Field Name: ID\n * * Display Name: ID\n * * SQL Data Type: uniqueidentifier\n * * Default Value: newsequentialid()\n * * Description: Primary key for the component library"),Name:z.string().describe("\n * * Field Name: Name\n * * Display Name: Name\n * * SQL Data Type: nvarchar(500)\n * * Description: NPM-style package name (e.g., recharts, lodash, @memberjunction/lib-name)"),DisplayName:z.string().nullable().describe("\n * * Field Name: DisplayName\n * * Display Name: Display Name\n * * SQL Data Type: nvarchar(500)\n * * Description: User-friendly display name for the library"),Version:z.string().nullable().describe("\n * * Field Name: Version\n * * Display Name: Version\n * * SQL Data Type: nvarchar(100)\n * * Description: Library version number"),GlobalVariable:z.string().nullable().describe("\n * * Field Name: GlobalVariable\n * * Display Name: Global Variable\n * * SQL Data Type: nvarchar(255)\n * * Description: Global variable name when loaded (e.g., _ for lodash, React for react)"),Category:z.union([z.literal('Charting'),z.literal('Core'),z.literal('Other'),z.literal('Runtime'),z.literal('UI'),z.literal('Utility')]).nullable().describe("\n * * Field Name: Category\n * * Display Name: Category\n * * SQL Data Type: nvarchar(100)\n * * Value List Type: List\n * * Possible Values \n * * Charting\n * * Core\n * * Other\n * * Runtime\n * * UI\n * * Utility\n * * Description: Library category: Core, Runtime, UI, Charting, Utility, or Other"),CDNUrl:z.string().nullable().describe("\n * * Field Name: CDNUrl\n * * Display Name: CDN URL\n * * SQL Data Type: nvarchar(1000)\n * * Description: CDN URL for loading the library JavaScript"),CDNCssUrl:z.string().nullable().describe("\n * * Field Name: CDNCssUrl\n * * Display Name: CDN CSS URL\n * * SQL Data Type: nvarchar(1000)\n * * Description: Optional CDN URL for loading library CSS"),Description:z.string().nullable().describe("\n * * Field Name: Description\n * * Display Name: Description\n * * SQL Data Type: nvarchar(MAX)\n * * Description: Description of the library and its capabilities"),__mj_CreatedAt:z.date().describe("\n * * Field Name: __mj_CreatedAt\n * * Display Name: Created At\n * * SQL Data Type: datetimeoffset\n * * Default Value: getutcdate()"),__mj_UpdatedAt:z.date().describe("\n * * Field Name: __mj_UpdatedAt\n * * Display Name: Updated At\n * * SQL Data Type: datetimeoffset\n * * Default Value: getutcdate()"),Status:z.union([z.literal('Active'),z.literal('Deprecated'),z.literal('Disabled')]).describe("\n * * Field Name: Status\n * * Display Name: Status\n * * SQL Data Type: nvarchar(20)\n * * Default Value: Active\n * * Value List Type: List\n * * Possible Values \n * * Active\n * * Deprecated\n * * Disabled\n * * Description: Status of the component library. Active: fully supported; Deprecated: works but shows console warning; Disabled: throws error if used"),LintRules:z.string().nullable().describe("\n * * Field Name: LintRules\n * * Display Name: Lint Rules\n * * SQL Data Type: nvarchar(MAX)\n * * Description: JSON configuration for library-specific lint rules that are applied during component validation. This field contains structured rules that define how components using this library should be validated, including DOM element requirements, initialization patterns, lifecycle methods, and common error patterns. Example structure: {\"initialization\": {\"constructorName\": \"Chart\", \"elementType\": \"canvas\"}, \"lifecycle\": {\"requiredMethods\": [\"render\"], \"cleanupMethods\": [\"destroy\"]}}. The linter dynamically applies these rules based on the libraries referenced in a component spec, enabling extensible validation without hardcoding library-specific logic."),Dependencies:z.string().nullable().describe("\n * * Field Name: Dependencies\n * * Display Name: Dependencies\n * * SQL Data Type: nvarchar(MAX)\n * * Description: JSON object defining dependencies for this component library. Format: { \"libraryName\": \"versionSpec\", ... }. Version specifications follow NPM-style syntax (e.g., \"~1.0.0\", \"^1.2.3\", \"2.3.4\"). Dependencies are loaded before this library to ensure proper execution context."),UsageType:z.union([z.literal('Both'),z.literal('Dependency'),z.literal('Direct')]).describe("\n * * Field Name: UsageType\n * * Display Name: Usage Type\n * * SQL Data Type: nvarchar(50)\n * * Default Value: Both\n * * Value List Type: List\n * * Possible Values \n * * Both\n * * Dependency\n * * Direct\n * * Description: Controls how the library can be used: Direct (by components), Dependency (only as dependency), or Both"),UsageInstructions:z.string().nullable().describe("\n * * Field Name: UsageInstructions\n * * Display Name: Usage Instructions\n * * SQL Data Type: nvarchar(MAX)\n * * Description: Markdown-formatted usage instructions for AI code generators and agents. Injected into prompts when a component references this library. Covers container requirements, initialization patterns, required config options, and common pitfalls. Distinct from Description which is a high-level summary of what the library does.")});/**
56409
58430
  * zod schema definition for the entity MJ: Component Library Links
56410
58431
  */var MJComponentLibraryLinkSchema=z.object({ID:z.string().describe("\n * * Field Name: ID\n * * Display Name: ID\n * * SQL Data Type: uniqueidentifier\n * * Default Value: newsequentialid()\n * * Description: Primary key for component-library relationship"),ComponentID:z.string().describe("\n * * Field Name: ComponentID\n * * Display Name: Component ID\n * * SQL Data Type: uniqueidentifier\n * * Related Entity/Foreign Key: MJ: Components (vwComponents.ID)\n * * Description: Foreign key to Component that depends on the library"),LibraryID:z.string().describe("\n * * Field Name: LibraryID\n * * Display Name: Library ID\n * * SQL Data Type: uniqueidentifier\n * * Related Entity/Foreign Key: MJ: Component Libraries (vwComponentLibraries.ID)\n * * Description: Foreign key to ComponentLibrary that the component depends on"),MinVersion:z.string().nullable().describe("\n * * Field Name: MinVersion\n * * Display Name: Min Version\n * * SQL Data Type: nvarchar(100)\n * * Description: Minimum version requirement using semantic versioning (e.g., ^1.0.0, ~2.5.0)"),__mj_CreatedAt:z.date().describe("\n * * Field Name: __mj_CreatedAt\n * * Display Name: Created At\n * * SQL Data Type: datetimeoffset\n * * Default Value: getutcdate()"),__mj_UpdatedAt:z.date().describe("\n * * Field Name: __mj_UpdatedAt\n * * Display Name: Updated At\n * * SQL Data Type: datetimeoffset\n * * Default Value: getutcdate()"),Component:z.string().describe("\n * * Field Name: Component\n * * Display Name: Component\n * * SQL Data Type: nvarchar(500)"),Library:z.string().describe("\n * * Field Name: Library\n * * Display Name: Library\n * * SQL Data Type: nvarchar(500)")});/**
56411
58432
  * zod schema definition for the entity MJ: Component Registries
@@ -68476,12 +70497,12 @@ _context63.p=1;_context63.n=2;return provider.BeginTransaction();case 2:_context
68476
70497
  * * Description: Library category: Core, Runtime, UI, Charting, Utility, or Other
68477
70498
  */},{key:"Category",get:function get(){return this.Get('Category');},set:function set(value){this.Set('Category',value);}/**
68478
70499
  * * Field Name: CDNUrl
68479
- * * Display Name: CDN Url
70500
+ * * Display Name: CDN URL
68480
70501
  * * SQL Data Type: nvarchar(1000)
68481
70502
  * * Description: CDN URL for loading the library JavaScript
68482
70503
  */},{key:"CDNUrl",get:function get(){return this.Get('CDNUrl');},set:function set(value){this.Set('CDNUrl',value);}/**
68483
70504
  * * Field Name: CDNCssUrl
68484
- * * Display Name: CDN Css Url
70505
+ * * Display Name: CDN CSS URL
68485
70506
  * * SQL Data Type: nvarchar(1000)
68486
70507
  * * Description: Optional CDN URL for loading library CSS
68487
70508
  */},{key:"CDNCssUrl",get:function get(){return this.Get('CDNCssUrl');},set:function set(value){this.Set('CDNCssUrl',value);}/**
@@ -68531,7 +70552,12 @@ _context63.p=1;_context63.n=2;return provider.BeginTransaction();case 2:_context
68531
70552
  * * Dependency
68532
70553
  * * Direct
68533
70554
  * * Description: Controls how the library can be used: Direct (by components), Dependency (only as dependency), or Both
68534
- */},{key:"UsageType",get:function get(){return this.Get('UsageType');},set:function set(value){this.Set('UsageType',value);}}]);}(dist/* BaseEntity */.HC);MJComponentLibraryEntity=__decorate([(0,MJGlobal_dist/* RegisterClass */.Y5)(dist/* BaseEntity */.HC,'MJ: Component Libraries')],MJComponentLibraryEntity);/**
70555
+ */},{key:"UsageType",get:function get(){return this.Get('UsageType');},set:function set(value){this.Set('UsageType',value);}/**
70556
+ * * Field Name: UsageInstructions
70557
+ * * Display Name: Usage Instructions
70558
+ * * SQL Data Type: nvarchar(MAX)
70559
+ * * Description: Markdown-formatted usage instructions for AI code generators and agents. Injected into prompts when a component references this library. Covers container requirements, initialization patterns, required config options, and common pitfalls. Distinct from Description which is a high-level summary of what the library does.
70560
+ */},{key:"UsageInstructions",get:function get(){return this.Get('UsageInstructions');},set:function set(value){this.Set('UsageInstructions',value);}}]);}(dist/* BaseEntity */.HC);MJComponentLibraryEntity=__decorate([(0,MJGlobal_dist/* RegisterClass */.Y5)(dist/* BaseEntity */.HC,'MJ: Component Libraries')],MJComponentLibraryEntity);/**
68535
70561
  * MJ: Component Library Links - strongly typed entity sub-class
68536
70562
  * * Schema: __mj
68537
70563
  * * Base Table: ComponentLibraryLink
@@ -113041,8 +115067,8 @@ var ComponentRegistry = /*#__PURE__*/function () {
113041
115067
  }
113042
115068
  }]);
113043
115069
  }();
113044
- // EXTERNAL MODULE: ../../MJCore/dist/index.js + 75 modules
113045
- var dist = __webpack_require__(925);
115070
+ // EXTERNAL MODULE: ../../MJCore/dist/index.js + 81 modules
115071
+ var dist = __webpack_require__(310);
113046
115072
  // EXTERNAL MODULE: ../../MJGlobal/dist/index.js + 16 modules
113047
115073
  var MJGlobal_dist = __webpack_require__(300);
113048
115074
  // EXTERNAL MODULE: ../../MJCoreEntities/dist/index.js + 47 modules
@@ -115136,6 +117162,10 @@ var ComponentManager = /*#__PURE__*/function () {
115136
117162
  startTime,
115137
117163
  componentKey,
115138
117164
  existingPromise,
117165
+ namespace,
117166
+ version,
117167
+ contentHash,
117168
+ registered,
115139
117169
  loadPromise,
115140
117170
  result,
115141
117171
  _args = arguments;
@@ -115153,28 +117183,44 @@ var ComponentManager = /*#__PURE__*/function () {
115153
117183
  });
115154
117184
  existingPromise = this.loadingPromises.get(componentKey);
115155
117185
  if (!(existingPromise && !options.forceRefresh)) {
117186
+ _context.n = 2;
117187
+ break;
117188
+ }
117189
+ namespace = spec.namespace || options.defaultNamespace || 'Global';
117190
+ version = spec.version || options.defaultVersion || 'latest';
117191
+ contentHash = this.calculateHash(spec);
117192
+ registered = this.registry.get(spec.name, namespace, version, contentHash);
117193
+ if (!registered) {
115156
117194
  _context.n = 1;
115157
117195
  break;
115158
117196
  }
117197
+ this.log("Component already registered (circular dep resolution): ".concat(spec.name));
117198
+ return _context.a(2, {
117199
+ success: true,
117200
+ component: registered,
117201
+ spec: spec,
117202
+ fromCache: true
117203
+ });
117204
+ case 1:
115159
117205
  this.log("Component already loading: ".concat(spec.name, ", waiting..."));
115160
117206
  return _context.a(2, existingPromise);
115161
- case 1:
117207
+ case 2:
115162
117208
  loadPromise = this.doLoadComponent(spec, options, componentKey, startTime);
115163
117209
  this.loadingPromises.set(componentKey, loadPromise);
115164
- _context.p = 2;
115165
- _context.n = 3;
117210
+ _context.p = 3;
117211
+ _context.n = 4;
115166
117212
  return loadPromise;
115167
- case 3:
117213
+ case 4:
115168
117214
  result = _context.v;
115169
117215
  return _context.a(2, result);
115170
- case 4:
115171
- _context.p = 4;
115172
- this.loadingPromises.delete(componentKey);
115173
- return _context.f(4);
115174
117216
  case 5:
117217
+ _context.p = 5;
117218
+ this.loadingPromises.delete(componentKey);
117219
+ return _context.f(5);
117220
+ case 6:
115175
117221
  return _context.a(2);
115176
117222
  }
115177
- }, _callee, this, [[2,, 4, 5]]);
117223
+ }, _callee, this, [[3,, 5, 6]]);
115178
117224
  }));
115179
117225
  function loadComponent(_x) {
115180
117226
  return _loadComponent.apply(this, arguments);
@@ -115491,7 +117537,7 @@ var ComponentManager = /*#__PURE__*/function () {
115491
117537
  key: "loadComponentRecursive",
115492
117538
  value: function () {
115493
117539
  var _loadComponentRecursive = component_manager_asyncToGenerator(/*#__PURE__*/component_manager_regenerator().m(function _callee4(spec, options, loaded, errors, components, stats, visited) {
115494
- var componentKey, result, _result$spec2, _iterator2, _step2, dep, depSpec, _t6;
117540
+ var componentKey, result, _result$spec2, dependencies, _iterator2, _step2, dep, depSpec, _t6;
115495
117541
  return component_manager_regenerator().w(function (_context5) {
115496
117542
  while (1) switch (_context5.p = _context5.n) {
115497
117543
  case 0:
@@ -115525,11 +117571,12 @@ var ComponentManager = /*#__PURE__*/function () {
115525
117571
  stats.compiled++;
115526
117572
  }
115527
117573
  }
115528
- if (!((_result$spec2 = result.spec) !== null && _result$spec2 !== void 0 && _result$spec2.dependencies)) {
117574
+ dependencies = spec.dependencies || ((_result$spec2 = result.spec) === null || _result$spec2 === void 0 ? void 0 : _result$spec2.dependencies);
117575
+ if (!dependencies) {
115529
117576
  _context5.n = 9;
115530
117577
  break;
115531
117578
  }
115532
- _iterator2 = component_manager_createForOfIteratorHelper(result.spec.dependencies);
117579
+ _iterator2 = component_manager_createForOfIteratorHelper(dependencies);
115533
117580
  _context5.p = 3;
115534
117581
  _iterator2.s();
115535
117582
  case 4: