@beingniloy/megon 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/index.js +6 -6
- package/dist/bin/worker.js +882 -882
- package/package.json +1 -1
package/dist/bin/worker.js
CHANGED
|
@@ -83157,6 +83157,12 @@ var init_local_context = __esm(() => {
|
|
|
83157
83157
|
})(LocalContext ||= {});
|
|
83158
83158
|
});
|
|
83159
83159
|
|
|
83160
|
+
// ../../node_modules/drizzle-orm/column-common.js
|
|
83161
|
+
var OriginalColumn;
|
|
83162
|
+
var init_column_common = __esm(() => {
|
|
83163
|
+
OriginalColumn = Symbol.for("drizzle:OriginalColumn");
|
|
83164
|
+
});
|
|
83165
|
+
|
|
83160
83166
|
// ../../node_modules/drizzle-orm/entity.js
|
|
83161
83167
|
function is6(value8, type3) {
|
|
83162
83168
|
if (!value8 || typeof value8 !== "object")
|
|
@@ -83180,46 +83186,6 @@ var init_entity = __esm(() => {
|
|
|
83180
83186
|
hasOwnEntityKind = Symbol.for("drizzle:hasOwnEntityKind");
|
|
83181
83187
|
});
|
|
83182
83188
|
|
|
83183
|
-
// ../../node_modules/drizzle-orm/logger.js
|
|
83184
|
-
var ConsoleLogWriter, DefaultLogger, NoopLogger;
|
|
83185
|
-
var init_logger = __esm(() => {
|
|
83186
|
-
init_entity();
|
|
83187
|
-
ConsoleLogWriter = class {
|
|
83188
|
-
static [entityKind] = "ConsoleLogWriter";
|
|
83189
|
-
write(message) {
|
|
83190
|
-
console.log(message);
|
|
83191
|
-
}
|
|
83192
|
-
};
|
|
83193
|
-
DefaultLogger = class {
|
|
83194
|
-
static [entityKind] = "DefaultLogger";
|
|
83195
|
-
writer;
|
|
83196
|
-
constructor(config3) {
|
|
83197
|
-
this.writer = config3?.writer ?? new ConsoleLogWriter;
|
|
83198
|
-
}
|
|
83199
|
-
logQuery(query, params) {
|
|
83200
|
-
const stringifiedParams = params.map((p) => {
|
|
83201
|
-
try {
|
|
83202
|
-
return JSON.stringify(p);
|
|
83203
|
-
} catch {
|
|
83204
|
-
return String(p);
|
|
83205
|
-
}
|
|
83206
|
-
});
|
|
83207
|
-
const paramsStr = stringifiedParams.length ? ` -- params: [${stringifiedParams.join(", ")}]` : "";
|
|
83208
|
-
this.writer.write(`Query: ${query}${paramsStr}`);
|
|
83209
|
-
}
|
|
83210
|
-
};
|
|
83211
|
-
NoopLogger = class {
|
|
83212
|
-
static [entityKind] = "NoopLogger";
|
|
83213
|
-
logQuery() {}
|
|
83214
|
-
};
|
|
83215
|
-
});
|
|
83216
|
-
|
|
83217
|
-
// ../../node_modules/drizzle-orm/column-common.js
|
|
83218
|
-
var OriginalColumn;
|
|
83219
|
-
var init_column_common = __esm(() => {
|
|
83220
|
-
OriginalColumn = Symbol.for("drizzle:OriginalColumn");
|
|
83221
|
-
});
|
|
83222
|
-
|
|
83223
83189
|
// ../../node_modules/drizzle-orm/column.js
|
|
83224
83190
|
var Column;
|
|
83225
83191
|
var init_column = __esm(() => {
|
|
@@ -83792,251 +83758,6 @@ var init_sql = __esm(() => {
|
|
|
83792
83758
|
};
|
|
83793
83759
|
});
|
|
83794
83760
|
|
|
83795
|
-
// ../../node_modules/drizzle-orm/alias.js
|
|
83796
|
-
function aliasedTable(table2, tableAlias) {
|
|
83797
|
-
return new Proxy(table2, new TableAliasProxyHandler(tableAlias, false, false));
|
|
83798
|
-
}
|
|
83799
|
-
function aliasedColumn(column, alias) {
|
|
83800
|
-
return new Proxy(column, new ColumnAliasProxyHandler(alias));
|
|
83801
|
-
}
|
|
83802
|
-
function aliasedTableColumn(column, tableAlias) {
|
|
83803
|
-
return new Proxy(column, new ColumnTableAliasProxyHandler(new Proxy(column.table, new TableAliasProxyHandler(tableAlias, false, false)), false));
|
|
83804
|
-
}
|
|
83805
|
-
function mapColumnsInAliasedSQLToAlias(query, alias) {
|
|
83806
|
-
return new SQL.Aliased(mapColumnsInSQLToAlias(query.sql, alias), query.fieldAlias);
|
|
83807
|
-
}
|
|
83808
|
-
function mapColumnsInSQLToAlias(query, alias) {
|
|
83809
|
-
return sql.join(query.queryChunks.map((c) => {
|
|
83810
|
-
if (is6(c, Column))
|
|
83811
|
-
return aliasedTableColumn(c, alias);
|
|
83812
|
-
if (is6(c, SQL))
|
|
83813
|
-
return mapColumnsInSQLToAlias(c, alias);
|
|
83814
|
-
if (is6(c, SQL.Aliased))
|
|
83815
|
-
return mapColumnsInAliasedSQLToAlias(c, alias);
|
|
83816
|
-
return c;
|
|
83817
|
-
}));
|
|
83818
|
-
}
|
|
83819
|
-
function getOriginalColumnFromAlias(column) {
|
|
83820
|
-
return column[OriginalColumn]();
|
|
83821
|
-
}
|
|
83822
|
-
var ColumnTableAliasProxyHandler, ViewSelectionAliasProxyHandler, TableAliasProxyHandler, ColumnAliasProxyHandler;
|
|
83823
|
-
var init_alias = __esm(() => {
|
|
83824
|
-
init_column_common();
|
|
83825
|
-
init_entity();
|
|
83826
|
-
init_column();
|
|
83827
|
-
init_table();
|
|
83828
|
-
init_sql();
|
|
83829
|
-
init_subquery();
|
|
83830
|
-
init_view_common();
|
|
83831
|
-
ColumnTableAliasProxyHandler = class {
|
|
83832
|
-
static [entityKind] = "ColumnTableAliasProxyHandler";
|
|
83833
|
-
constructor(table2, ignoreColumnAlias) {
|
|
83834
|
-
this.table = table2;
|
|
83835
|
-
this.ignoreColumnAlias = ignoreColumnAlias;
|
|
83836
|
-
}
|
|
83837
|
-
get(columnObj, prop) {
|
|
83838
|
-
if (prop === "table")
|
|
83839
|
-
return this.table;
|
|
83840
|
-
if (prop === "isAlias" && this.ignoreColumnAlias)
|
|
83841
|
-
return false;
|
|
83842
|
-
return columnObj[prop];
|
|
83843
|
-
}
|
|
83844
|
-
};
|
|
83845
|
-
ViewSelectionAliasProxyHandler = class {
|
|
83846
|
-
static [entityKind] = "ViewSelectionAliasProxyHandler";
|
|
83847
|
-
constructor(view, selection, ignoreColumnAlias) {
|
|
83848
|
-
this.view = view;
|
|
83849
|
-
this.selection = selection;
|
|
83850
|
-
this.ignoreColumnAlias = ignoreColumnAlias;
|
|
83851
|
-
}
|
|
83852
|
-
get(selection, prop) {
|
|
83853
|
-
const value8 = selection[prop];
|
|
83854
|
-
if (is6(value8, Column))
|
|
83855
|
-
return new Proxy(value8, new ColumnTableAliasProxyHandler(this.view, this.ignoreColumnAlias));
|
|
83856
|
-
if (is6(value8, Subquery) || is6(value8, SQL) || is6(value8, SQL.Aliased) || isSQLWrapper(value8) || typeof value8 !== "object" || value8 === null)
|
|
83857
|
-
return value8;
|
|
83858
|
-
return new Proxy(value8, this);
|
|
83859
|
-
}
|
|
83860
|
-
};
|
|
83861
|
-
TableAliasProxyHandler = class {
|
|
83862
|
-
static [entityKind] = "TableAliasProxyHandler";
|
|
83863
|
-
constructor(alias, replaceOriginalName, ignoreColumnAlias) {
|
|
83864
|
-
this.alias = alias;
|
|
83865
|
-
this.replaceOriginalName = replaceOriginalName;
|
|
83866
|
-
this.ignoreColumnAlias = ignoreColumnAlias;
|
|
83867
|
-
}
|
|
83868
|
-
get(target, prop) {
|
|
83869
|
-
if (prop === Table.Symbol.IsAlias)
|
|
83870
|
-
return true;
|
|
83871
|
-
if (prop === Table.Symbol.Name)
|
|
83872
|
-
return this.alias;
|
|
83873
|
-
if (this.replaceOriginalName && prop === Table.Symbol.OriginalName)
|
|
83874
|
-
return this.alias;
|
|
83875
|
-
if (prop === ViewBaseConfig)
|
|
83876
|
-
return {
|
|
83877
|
-
...target[ViewBaseConfig],
|
|
83878
|
-
name: this.alias,
|
|
83879
|
-
isAlias: true,
|
|
83880
|
-
selectedFields: new Proxy(target[ViewBaseConfig].selectedFields, new ViewSelectionAliasProxyHandler(new Proxy(target, this), target[ViewBaseConfig].selectedFields, this.ignoreColumnAlias))
|
|
83881
|
-
};
|
|
83882
|
-
if (prop === Table.Symbol.Columns) {
|
|
83883
|
-
const columns = target[Table.Symbol.Columns];
|
|
83884
|
-
if (!columns)
|
|
83885
|
-
return columns;
|
|
83886
|
-
if (is6(target, View))
|
|
83887
|
-
return new Proxy(target[Table.Symbol.Columns], new ViewSelectionAliasProxyHandler(new Proxy(target, this), target[Table.Symbol.Columns], this.ignoreColumnAlias));
|
|
83888
|
-
const proxiedColumns = {};
|
|
83889
|
-
Object.keys(columns).map((key) => {
|
|
83890
|
-
proxiedColumns[key] = new Proxy(columns[key], new ColumnTableAliasProxyHandler(new Proxy(target, this), this.ignoreColumnAlias));
|
|
83891
|
-
});
|
|
83892
|
-
return proxiedColumns;
|
|
83893
|
-
}
|
|
83894
|
-
const value8 = target[prop];
|
|
83895
|
-
if (is6(value8, Column))
|
|
83896
|
-
return new Proxy(value8, new ColumnTableAliasProxyHandler(new Proxy(target, this), this.ignoreColumnAlias));
|
|
83897
|
-
return value8;
|
|
83898
|
-
}
|
|
83899
|
-
};
|
|
83900
|
-
ColumnAliasProxyHandler = class {
|
|
83901
|
-
static [entityKind] = "ColumnAliasProxyHandler";
|
|
83902
|
-
constructor(alias) {
|
|
83903
|
-
this.alias = alias;
|
|
83904
|
-
}
|
|
83905
|
-
get(target, prop) {
|
|
83906
|
-
if (prop === "isAlias")
|
|
83907
|
-
return true;
|
|
83908
|
-
if (prop === "name")
|
|
83909
|
-
return this.alias;
|
|
83910
|
-
if (prop === "keyAsName")
|
|
83911
|
-
return false;
|
|
83912
|
-
if (prop === OriginalColumn)
|
|
83913
|
-
return () => target;
|
|
83914
|
-
return target[prop];
|
|
83915
|
-
}
|
|
83916
|
-
};
|
|
83917
|
-
Column.prototype.as = function(alias) {
|
|
83918
|
-
return aliasedColumn(this, alias);
|
|
83919
|
-
};
|
|
83920
|
-
});
|
|
83921
|
-
|
|
83922
|
-
// ../../node_modules/drizzle-orm/query-promise.js
|
|
83923
|
-
var QueryPromise;
|
|
83924
|
-
var init_query_promise = __esm(() => {
|
|
83925
|
-
init_entity();
|
|
83926
|
-
QueryPromise = class {
|
|
83927
|
-
static [entityKind] = "QueryPromise";
|
|
83928
|
-
[Symbol.toStringTag] = "QueryPromise";
|
|
83929
|
-
catch(onRejected) {
|
|
83930
|
-
return this.then(undefined, onRejected);
|
|
83931
|
-
}
|
|
83932
|
-
finally(onFinally) {
|
|
83933
|
-
return this.then((value8) => {
|
|
83934
|
-
onFinally?.();
|
|
83935
|
-
return value8;
|
|
83936
|
-
}, (reason2) => {
|
|
83937
|
-
onFinally?.();
|
|
83938
|
-
throw reason2;
|
|
83939
|
-
});
|
|
83940
|
-
}
|
|
83941
|
-
then(onFulfilled, onRejected) {
|
|
83942
|
-
return this.execute().then(onFulfilled, onRejected);
|
|
83943
|
-
}
|
|
83944
|
-
};
|
|
83945
|
-
});
|
|
83946
|
-
|
|
83947
|
-
// ../../node_modules/drizzle-orm/column-builder.js
|
|
83948
|
-
var ColumnBuilder;
|
|
83949
|
-
var init_column_builder = __esm(() => {
|
|
83950
|
-
init_entity();
|
|
83951
|
-
ColumnBuilder = class {
|
|
83952
|
-
static [entityKind] = "ColumnBuilder";
|
|
83953
|
-
config;
|
|
83954
|
-
constructor(name2, dataType, columnType) {
|
|
83955
|
-
this.config = {
|
|
83956
|
-
name: name2,
|
|
83957
|
-
keyAsName: name2 === "",
|
|
83958
|
-
notNull: false,
|
|
83959
|
-
default: undefined,
|
|
83960
|
-
hasDefault: false,
|
|
83961
|
-
primaryKey: false,
|
|
83962
|
-
isUnique: false,
|
|
83963
|
-
uniqueName: undefined,
|
|
83964
|
-
uniqueType: undefined,
|
|
83965
|
-
dataType,
|
|
83966
|
-
columnType,
|
|
83967
|
-
generated: undefined
|
|
83968
|
-
};
|
|
83969
|
-
}
|
|
83970
|
-
$type() {
|
|
83971
|
-
return this;
|
|
83972
|
-
}
|
|
83973
|
-
notNull() {
|
|
83974
|
-
this.config.notNull = true;
|
|
83975
|
-
return this;
|
|
83976
|
-
}
|
|
83977
|
-
default(value8) {
|
|
83978
|
-
this.config.default = value8;
|
|
83979
|
-
this.config.hasDefault = true;
|
|
83980
|
-
return this;
|
|
83981
|
-
}
|
|
83982
|
-
$defaultFn(fn3) {
|
|
83983
|
-
this.config.defaultFn = fn3;
|
|
83984
|
-
this.config.hasDefault = true;
|
|
83985
|
-
return this;
|
|
83986
|
-
}
|
|
83987
|
-
$default = this.$defaultFn;
|
|
83988
|
-
$onUpdateFn(fn3) {
|
|
83989
|
-
this.config.onUpdateFn = fn3;
|
|
83990
|
-
this.config.hasDefault = true;
|
|
83991
|
-
return this;
|
|
83992
|
-
}
|
|
83993
|
-
$onUpdate = this.$onUpdateFn;
|
|
83994
|
-
primaryKey() {
|
|
83995
|
-
this.config.primaryKey = true;
|
|
83996
|
-
this.config.notNull = true;
|
|
83997
|
-
return this;
|
|
83998
|
-
}
|
|
83999
|
-
setName(name2) {
|
|
84000
|
-
if (this.config.name !== "")
|
|
84001
|
-
return;
|
|
84002
|
-
this.config.name = name2;
|
|
84003
|
-
}
|
|
84004
|
-
};
|
|
84005
|
-
});
|
|
84006
|
-
|
|
84007
|
-
// ../../node_modules/drizzle-orm/errors.js
|
|
84008
|
-
var DrizzleError, DrizzleQueryError, TransactionRollbackError;
|
|
84009
|
-
var init_errors4 = __esm(() => {
|
|
84010
|
-
init_entity();
|
|
84011
|
-
DrizzleError = class extends Error {
|
|
84012
|
-
static [entityKind] = "DrizzleError";
|
|
84013
|
-
constructor({ message, cause }) {
|
|
84014
|
-
super(message);
|
|
84015
|
-
this.name = "DrizzleError";
|
|
84016
|
-
this.cause = cause;
|
|
84017
|
-
}
|
|
84018
|
-
};
|
|
84019
|
-
DrizzleQueryError = class DrizzleQueryError2 extends Error {
|
|
84020
|
-
static [entityKind] = "DrizzleQueryError";
|
|
84021
|
-
constructor(query, params, cause) {
|
|
84022
|
-
super(`Failed query: ${query}
|
|
84023
|
-
params: ${params}`);
|
|
84024
|
-
this.query = query;
|
|
84025
|
-
this.params = params;
|
|
84026
|
-
this.cause = cause;
|
|
84027
|
-
Error.captureStackTrace(this, DrizzleQueryError2);
|
|
84028
|
-
if (cause)
|
|
84029
|
-
this.cause = cause;
|
|
84030
|
-
}
|
|
84031
|
-
};
|
|
84032
|
-
TransactionRollbackError = class extends DrizzleError {
|
|
84033
|
-
static [entityKind] = "TransactionRollbackError";
|
|
84034
|
-
constructor() {
|
|
84035
|
-
super({ message: "Rollback" });
|
|
84036
|
-
}
|
|
84037
|
-
};
|
|
84038
|
-
});
|
|
84039
|
-
|
|
84040
83761
|
// ../../node_modules/drizzle-orm/sql/expressions/conditions.js
|
|
84041
83762
|
function bindIfParam(value8, column) {
|
|
84042
83763
|
if (isDriverValueEncoder(column) && !isSQLWrapper(value8) && !is6(value8, Param) && !is6(value8, Placeholder) && !is6(value8, Column) && !is6(value8, Table) && !is6(value8, View))
|
|
@@ -84174,300 +83895,6 @@ var init_select = __esm(() => {
|
|
|
84174
83895
|
init_sql();
|
|
84175
83896
|
});
|
|
84176
83897
|
|
|
84177
|
-
// ../../node_modules/drizzle-orm/relations.js
|
|
84178
|
-
function mapRelationalRow(row, buildQueryResultSelection, mapColumnValue = (value8) => value8, parseJson2 = false, parseJsonIfString = false, path5) {
|
|
84179
|
-
for (const selectionItem of buildQueryResultSelection) {
|
|
84180
|
-
if (selectionItem.selection) {
|
|
84181
|
-
const currentPath = `${path5 ? `${path5}.` : ""}${selectionItem.key}`;
|
|
84182
|
-
if (row[selectionItem.key] === null)
|
|
84183
|
-
continue;
|
|
84184
|
-
if (parseJson2) {
|
|
84185
|
-
row[selectionItem.key] = JSON.parse(row[selectionItem.key]);
|
|
84186
|
-
if (row[selectionItem.key] === null)
|
|
84187
|
-
continue;
|
|
84188
|
-
}
|
|
84189
|
-
if (parseJsonIfString && typeof row[selectionItem.key] === "string")
|
|
84190
|
-
row[selectionItem.key] = JSON.parse(row[selectionItem.key]);
|
|
84191
|
-
if (selectionItem.isArray) {
|
|
84192
|
-
for (const item of row[selectionItem.key])
|
|
84193
|
-
mapRelationalRow(item, selectionItem.selection, mapColumnValue, false, parseJsonIfString, currentPath);
|
|
84194
|
-
continue;
|
|
84195
|
-
}
|
|
84196
|
-
mapRelationalRow(row[selectionItem.key], selectionItem.selection, mapColumnValue, false, parseJsonIfString, currentPath);
|
|
84197
|
-
continue;
|
|
84198
|
-
}
|
|
84199
|
-
const field = selectionItem.field;
|
|
84200
|
-
const value8 = mapColumnValue(row[selectionItem.key]);
|
|
84201
|
-
if (value8 === null)
|
|
84202
|
-
continue;
|
|
84203
|
-
let decoder2;
|
|
84204
|
-
if (is6(field, Column))
|
|
84205
|
-
decoder2 = field;
|
|
84206
|
-
else if (is6(field, SQL))
|
|
84207
|
-
decoder2 = field.decoder;
|
|
84208
|
-
else if (is6(field, SQL.Aliased))
|
|
84209
|
-
decoder2 = field.sql.decoder;
|
|
84210
|
-
else if (is6(field, Table) || is6(field, View))
|
|
84211
|
-
decoder2 = noopDecoder;
|
|
84212
|
-
else
|
|
84213
|
-
decoder2 = field.getSQL().decoder;
|
|
84214
|
-
row[selectionItem.key] = "mapFromJsonValue" in decoder2 ? decoder2.mapFromJsonValue(value8) : decoder2.mapFromDriverValue(value8);
|
|
84215
|
-
}
|
|
84216
|
-
return row;
|
|
84217
|
-
}
|
|
84218
|
-
function fieldSelectionToSQL(table2, target) {
|
|
84219
|
-
const field = table2[TableColumns][target];
|
|
84220
|
-
return field ? is6(field, Column) ? field : is6(field, SQL.Aliased) ? sql`${table2}.${sql.identifier(field.fieldAlias)}` : sql`${table2}.${sql.identifier(target)}` : sql`${table2}.${sql.identifier(target)}`;
|
|
84221
|
-
}
|
|
84222
|
-
function relationsFieldFilterToSQL(column, filter21) {
|
|
84223
|
-
if (typeof filter21 !== "object" || is6(filter21, Placeholder))
|
|
84224
|
-
return eq(column, filter21);
|
|
84225
|
-
const entries10 = Object.entries(filter21);
|
|
84226
|
-
if (!entries10.length)
|
|
84227
|
-
return;
|
|
84228
|
-
const parts3 = [];
|
|
84229
|
-
for (const [target, value8] of entries10) {
|
|
84230
|
-
if (value8 === undefined)
|
|
84231
|
-
continue;
|
|
84232
|
-
switch (target) {
|
|
84233
|
-
case "NOT": {
|
|
84234
|
-
const res = relationsFieldFilterToSQL(column, value8);
|
|
84235
|
-
if (!res)
|
|
84236
|
-
continue;
|
|
84237
|
-
parts3.push(not5(res));
|
|
84238
|
-
continue;
|
|
84239
|
-
}
|
|
84240
|
-
case "OR":
|
|
84241
|
-
if (!value8.length)
|
|
84242
|
-
continue;
|
|
84243
|
-
parts3.push(or5(...value8.map((subFilter) => relationsFieldFilterToSQL(column, subFilter))));
|
|
84244
|
-
continue;
|
|
84245
|
-
case "AND":
|
|
84246
|
-
if (!value8.length)
|
|
84247
|
-
continue;
|
|
84248
|
-
parts3.push(and3(...value8.map((subFilter) => relationsFieldFilterToSQL(column, subFilter))));
|
|
84249
|
-
continue;
|
|
84250
|
-
case "isNotNull":
|
|
84251
|
-
case "isNull":
|
|
84252
|
-
if (!value8)
|
|
84253
|
-
continue;
|
|
84254
|
-
parts3.push(operators[target](column));
|
|
84255
|
-
continue;
|
|
84256
|
-
case "in":
|
|
84257
|
-
parts3.push(operators.inArray(column, value8));
|
|
84258
|
-
continue;
|
|
84259
|
-
case "notIn":
|
|
84260
|
-
parts3.push(operators.notInArray(column, value8));
|
|
84261
|
-
continue;
|
|
84262
|
-
default:
|
|
84263
|
-
parts3.push(operators[target](column, value8));
|
|
84264
|
-
continue;
|
|
84265
|
-
}
|
|
84266
|
-
}
|
|
84267
|
-
if (!parts3.length)
|
|
84268
|
-
return;
|
|
84269
|
-
return and3(...parts3);
|
|
84270
|
-
}
|
|
84271
|
-
function relationsFilterToSQL(table2, filter21, tableRelations = {}, tablesRelations = {}, casing, depth = 0) {
|
|
84272
|
-
const entries10 = Object.entries(filter21);
|
|
84273
|
-
if (!entries10.length)
|
|
84274
|
-
return;
|
|
84275
|
-
const parts3 = [];
|
|
84276
|
-
for (const [target, value8] of entries10) {
|
|
84277
|
-
if (value8 === undefined)
|
|
84278
|
-
continue;
|
|
84279
|
-
switch (target) {
|
|
84280
|
-
case "RAW": {
|
|
84281
|
-
const processed = typeof value8 === "function" ? value8(table2, operators) : value8.getSQL();
|
|
84282
|
-
parts3.push(processed);
|
|
84283
|
-
continue;
|
|
84284
|
-
}
|
|
84285
|
-
case "OR":
|
|
84286
|
-
if (!value8?.length)
|
|
84287
|
-
continue;
|
|
84288
|
-
parts3.push(or5(...value8.map((subFilter) => relationsFilterToSQL(table2, subFilter, tableRelations, tablesRelations, casing, depth))));
|
|
84289
|
-
continue;
|
|
84290
|
-
case "AND":
|
|
84291
|
-
if (!value8?.length)
|
|
84292
|
-
continue;
|
|
84293
|
-
parts3.push(and3(...value8.map((subFilter) => relationsFilterToSQL(table2, subFilter, tableRelations, tablesRelations, casing, depth))));
|
|
84294
|
-
continue;
|
|
84295
|
-
case "NOT": {
|
|
84296
|
-
if (value8 === undefined)
|
|
84297
|
-
continue;
|
|
84298
|
-
const built = relationsFilterToSQL(table2, value8, tableRelations, tablesRelations, casing, depth);
|
|
84299
|
-
if (!built)
|
|
84300
|
-
continue;
|
|
84301
|
-
parts3.push(not5(built));
|
|
84302
|
-
continue;
|
|
84303
|
-
}
|
|
84304
|
-
default: {
|
|
84305
|
-
if (table2[TableColumns][target]) {
|
|
84306
|
-
const colFilter = relationsFieldFilterToSQL(fieldSelectionToSQL(table2, target), value8);
|
|
84307
|
-
if (colFilter)
|
|
84308
|
-
parts3.push(colFilter);
|
|
84309
|
-
continue;
|
|
84310
|
-
}
|
|
84311
|
-
const relation = tableRelations[target];
|
|
84312
|
-
if (!relation)
|
|
84313
|
-
throw new DrizzleError({ message: `Unknown relational filter field: "${target}"` });
|
|
84314
|
-
const targetTable = aliasedTable(relation.targetTable, `f${depth}`);
|
|
84315
|
-
const throughTable = relation.throughTable ? aliasedTable(relation.throughTable, `ft${depth}`) : undefined;
|
|
84316
|
-
const targetConfig = tablesRelations[relation.targetTableName];
|
|
84317
|
-
const { filter: relationFilter, joinCondition } = relationToSQL(casing, relation, table2, targetTable, throughTable);
|
|
84318
|
-
const filter22 = and3(relationFilter, typeof value8 === "boolean" ? undefined : relationsFilterToSQL(targetTable, value8, targetConfig.relations, tablesRelations, casing, depth + 1));
|
|
84319
|
-
const subquery = throughTable ? sql`(select * from ${getTableAsAliasSQL(targetTable)} inner join ${getTableAsAliasSQL(throughTable)} on ${joinCondition}${sql` where ${filter22}`.if(filter22)} limit 1)` : sql`(select * from ${getTableAsAliasSQL(targetTable)}${sql` where ${filter22}`.if(filter22)} limit 1)`;
|
|
84320
|
-
if (filter22)
|
|
84321
|
-
parts3.push((value8 ? exists2 : notExists)(subquery));
|
|
84322
|
-
}
|
|
84323
|
-
}
|
|
84324
|
-
}
|
|
84325
|
-
return and3(...parts3);
|
|
84326
|
-
}
|
|
84327
|
-
function relationsOrderToSQL(table2, orders) {
|
|
84328
|
-
if (typeof orders === "function") {
|
|
84329
|
-
const data2 = orders(table2, orderByOperators);
|
|
84330
|
-
return is6(data2, SQL) ? data2 : Array.isArray(data2) ? data2.length ? sql.join(data2.map((o) => is6(o, SQL) ? o : asc(o)), sql`, `) : undefined : is6(data2, Column) ? asc(data2) : undefined;
|
|
84331
|
-
}
|
|
84332
|
-
const entries10 = Object.entries(orders).filter(([_2, value8]) => value8);
|
|
84333
|
-
if (!entries10.length)
|
|
84334
|
-
return;
|
|
84335
|
-
return sql.join(entries10.map(([target, value8]) => (value8 === "asc" ? asc : desc)(fieldSelectionToSQL(table2, target))), sql`, `);
|
|
84336
|
-
}
|
|
84337
|
-
function relationExtrasToSQL(table2, extras) {
|
|
84338
|
-
const subqueries = [];
|
|
84339
|
-
const selection = [];
|
|
84340
|
-
for (const [key, field] of Object.entries(extras)) {
|
|
84341
|
-
if (!field)
|
|
84342
|
-
continue;
|
|
84343
|
-
const extra = typeof field === "function" ? field(table2, { sql: operators.sql }) : field;
|
|
84344
|
-
const query = sql`(${extra.getSQL()}) as ${sql.identifier(key)}`;
|
|
84345
|
-
query.decoder = extra.getSQL().decoder;
|
|
84346
|
-
subqueries.push(query);
|
|
84347
|
-
selection.push({
|
|
84348
|
-
key,
|
|
84349
|
-
field: query
|
|
84350
|
-
});
|
|
84351
|
-
}
|
|
84352
|
-
return {
|
|
84353
|
-
sql: subqueries.length ? sql.join(subqueries, sql`, `) : undefined,
|
|
84354
|
-
selection
|
|
84355
|
-
};
|
|
84356
|
-
}
|
|
84357
|
-
function relationToSQL(casing, relation, sourceTable, targetTable, throughTable) {
|
|
84358
|
-
if (relation.through) {
|
|
84359
|
-
const outerColumnWhere = relation.sourceColumns.map((s, i2) => {
|
|
84360
|
-
const t = relation.through.source[i2];
|
|
84361
|
-
return eq(sql`${sourceTable}.${sql.identifier(casing.getColumnCasing(s))}`, sql`${throughTable}.${sql.identifier(is6(t._.column, Column) ? casing.getColumnCasing(t._.column) : t._.key)}`);
|
|
84362
|
-
});
|
|
84363
|
-
const innerColumnWhere = relation.targetColumns.map((s, i2) => {
|
|
84364
|
-
const t = relation.through.target[i2];
|
|
84365
|
-
return eq(sql`${throughTable}.${sql.identifier(is6(t._.column, Column) ? casing.getColumnCasing(t._.column) : t._.key)}`, sql`${targetTable}.${sql.identifier(casing.getColumnCasing(s))}`);
|
|
84366
|
-
});
|
|
84367
|
-
return {
|
|
84368
|
-
filter: and3(relation.where ? relationsFilterToSQL(relation.isReversed ? sourceTable : targetTable, relation.where) : undefined, ...outerColumnWhere),
|
|
84369
|
-
joinCondition: and3(...innerColumnWhere)
|
|
84370
|
-
};
|
|
84371
|
-
}
|
|
84372
|
-
return { filter: and3(...relation.sourceColumns.map((s, i2) => {
|
|
84373
|
-
const t = relation.targetColumns[i2];
|
|
84374
|
-
return eq(sql`${sourceTable}.${sql.identifier(casing.getColumnCasing(s))}`, sql`${targetTable}.${sql.identifier(casing.getColumnCasing(t))}`);
|
|
84375
|
-
}), relation.where ? relationsFilterToSQL(relation.isReversed ? sourceTable : targetTable, relation.where) : undefined) };
|
|
84376
|
-
}
|
|
84377
|
-
function getTableAsAliasSQL(table2) {
|
|
84378
|
-
return sql`${table2[IsAlias] ? sql`${sql`${sql.identifier(table2[TableSchema] ?? "")}.`.if(table2[TableSchema])}${sql.identifier(table2[OriginalName])} as ${table2}` : table2}`;
|
|
84379
|
-
}
|
|
84380
|
-
var Relation, One, operators, orderByOperators;
|
|
84381
|
-
var init_relations = __esm(() => {
|
|
84382
|
-
init_entity();
|
|
84383
|
-
init_column();
|
|
84384
|
-
init_sql();
|
|
84385
|
-
init_alias();
|
|
84386
|
-
init_errors4();
|
|
84387
|
-
init_conditions();
|
|
84388
|
-
init_select();
|
|
84389
|
-
init_table();
|
|
84390
|
-
Relation = class {
|
|
84391
|
-
static [entityKind] = "RelationV2";
|
|
84392
|
-
fieldName;
|
|
84393
|
-
sourceColumns;
|
|
84394
|
-
targetColumns;
|
|
84395
|
-
alias;
|
|
84396
|
-
where;
|
|
84397
|
-
sourceTable;
|
|
84398
|
-
targetTable;
|
|
84399
|
-
through;
|
|
84400
|
-
throughTable;
|
|
84401
|
-
isReversed;
|
|
84402
|
-
sourceColumnTableNames = [];
|
|
84403
|
-
targetColumnTableNames = [];
|
|
84404
|
-
constructor(targetTable, targetTableName) {
|
|
84405
|
-
this.targetTableName = targetTableName;
|
|
84406
|
-
this.targetTable = targetTable;
|
|
84407
|
-
}
|
|
84408
|
-
};
|
|
84409
|
-
One = class extends Relation {
|
|
84410
|
-
static [entityKind] = "OneV2";
|
|
84411
|
-
relationType = "one";
|
|
84412
|
-
optional;
|
|
84413
|
-
constructor(tables, targetTable, targetTableName, config3) {
|
|
84414
|
-
super(targetTable, targetTableName);
|
|
84415
|
-
this.alias = config3?.alias;
|
|
84416
|
-
this.where = config3?.where;
|
|
84417
|
-
if (config3?.from)
|
|
84418
|
-
this.sourceColumns = (Array.isArray(config3.from) ? config3.from : [config3.from]).map((it2) => {
|
|
84419
|
-
this.throughTable ??= it2._.through ? tables[it2._.through._.tableName] : undefined;
|
|
84420
|
-
this.sourceColumnTableNames.push(it2._.tableName);
|
|
84421
|
-
return it2._.column;
|
|
84422
|
-
});
|
|
84423
|
-
if (config3?.to)
|
|
84424
|
-
this.targetColumns = (Array.isArray(config3.to) ? config3.to : [config3.to]).map((it2) => {
|
|
84425
|
-
this.throughTable ??= it2._.through ? tables[it2._.through._.tableName] : undefined;
|
|
84426
|
-
this.targetColumnTableNames.push(it2._.tableName);
|
|
84427
|
-
return it2._.column;
|
|
84428
|
-
});
|
|
84429
|
-
if (this.throughTable)
|
|
84430
|
-
this.through = {
|
|
84431
|
-
source: (Array.isArray(config3?.from) ? config3.from : (config3?.from) ? [config3.from] : []).map((c) => c._.through),
|
|
84432
|
-
target: (Array.isArray(config3?.to) ? config3.to : (config3?.to) ? [config3.to] : []).map((c) => c._.through)
|
|
84433
|
-
};
|
|
84434
|
-
this.optional = config3?.optional ?? true;
|
|
84435
|
-
}
|
|
84436
|
-
};
|
|
84437
|
-
operators = {
|
|
84438
|
-
and: and3,
|
|
84439
|
-
between: between7,
|
|
84440
|
-
eq,
|
|
84441
|
-
exists: exists2,
|
|
84442
|
-
gt: gt2,
|
|
84443
|
-
gte: gte2,
|
|
84444
|
-
ilike,
|
|
84445
|
-
inArray,
|
|
84446
|
-
arrayContains,
|
|
84447
|
-
arrayContained,
|
|
84448
|
-
arrayOverlaps,
|
|
84449
|
-
isNull: isNull3,
|
|
84450
|
-
isNotNull: isNotNull2,
|
|
84451
|
-
like,
|
|
84452
|
-
lt: lt2,
|
|
84453
|
-
lte: lte2,
|
|
84454
|
-
ne: ne2,
|
|
84455
|
-
not: not5,
|
|
84456
|
-
notBetween,
|
|
84457
|
-
notExists,
|
|
84458
|
-
notLike,
|
|
84459
|
-
notIlike,
|
|
84460
|
-
notInArray,
|
|
84461
|
-
or: or5,
|
|
84462
|
-
sql
|
|
84463
|
-
};
|
|
84464
|
-
orderByOperators = {
|
|
84465
|
-
sql,
|
|
84466
|
-
asc,
|
|
84467
|
-
desc
|
|
84468
|
-
};
|
|
84469
|
-
});
|
|
84470
|
-
|
|
84471
83898
|
// ../../node_modules/drizzle-orm/sql/functions/aggregate.js
|
|
84472
83899
|
function count4(expression) {
|
|
84473
83900
|
return sql`count(${expression || sql.raw("*")})`.mapWith(Number);
|
|
@@ -84476,134 +83903,6 @@ var init_aggregate = __esm(() => {
|
|
|
84476
83903
|
init_sql();
|
|
84477
83904
|
});
|
|
84478
83905
|
|
|
84479
|
-
// ../../node_modules/drizzle-orm/utils.js
|
|
84480
|
-
function mapResultRow(columns, row, joinsNotNullableMap) {
|
|
84481
|
-
const nullifyMap = {};
|
|
84482
|
-
const result6 = columns.reduce((result7, { path: path5, field }, columnIndex) => {
|
|
84483
|
-
let decoder2;
|
|
84484
|
-
if (is6(field, Column))
|
|
84485
|
-
decoder2 = field;
|
|
84486
|
-
else if (is6(field, SQL))
|
|
84487
|
-
decoder2 = field.decoder;
|
|
84488
|
-
else if (is6(field, Subquery))
|
|
84489
|
-
decoder2 = field._.sql.decoder;
|
|
84490
|
-
else
|
|
84491
|
-
decoder2 = field.sql.decoder;
|
|
84492
|
-
let node = result7;
|
|
84493
|
-
for (const [pathChunkIndex, pathChunk] of path5.entries())
|
|
84494
|
-
if (pathChunkIndex < path5.length - 1) {
|
|
84495
|
-
if (!(pathChunk in node))
|
|
84496
|
-
node[pathChunk] = {};
|
|
84497
|
-
node = node[pathChunk];
|
|
84498
|
-
} else {
|
|
84499
|
-
const rawValue = row[columnIndex];
|
|
84500
|
-
const value8 = node[pathChunk] = rawValue === null ? null : decoder2.mapFromDriverValue(rawValue);
|
|
84501
|
-
if (joinsNotNullableMap && is6(field, Column) && path5.length === 2) {
|
|
84502
|
-
const objectName = path5[0];
|
|
84503
|
-
if (!(objectName in nullifyMap))
|
|
84504
|
-
nullifyMap[objectName] = value8 === null ? getTableName(field.table) : false;
|
|
84505
|
-
else if (typeof nullifyMap[objectName] === "string" && nullifyMap[objectName] !== getTableName(field.table))
|
|
84506
|
-
nullifyMap[objectName] = false;
|
|
84507
|
-
}
|
|
84508
|
-
}
|
|
84509
|
-
return result7;
|
|
84510
|
-
}, {});
|
|
84511
|
-
if (joinsNotNullableMap && Object.keys(nullifyMap).length > 0) {
|
|
84512
|
-
for (const [objectName, tableName] of Object.entries(nullifyMap))
|
|
84513
|
-
if (typeof tableName === "string" && !joinsNotNullableMap[tableName])
|
|
84514
|
-
result6[objectName] = null;
|
|
84515
|
-
}
|
|
84516
|
-
return result6;
|
|
84517
|
-
}
|
|
84518
|
-
function orderSelectedFields(fields, pathPrefix) {
|
|
84519
|
-
return Object.entries(fields).reduce((result6, [name2, field]) => {
|
|
84520
|
-
if (typeof name2 !== "string")
|
|
84521
|
-
return result6;
|
|
84522
|
-
const newPath = pathPrefix ? [...pathPrefix, name2] : [name2];
|
|
84523
|
-
if (is6(field, Column) || is6(field, SQL) || is6(field, SQL.Aliased) || is6(field, Subquery))
|
|
84524
|
-
result6.push({
|
|
84525
|
-
path: newPath,
|
|
84526
|
-
field
|
|
84527
|
-
});
|
|
84528
|
-
else if (is6(field, Table))
|
|
84529
|
-
result6.push(...orderSelectedFields(field[Table.Symbol.Columns], newPath));
|
|
84530
|
-
else
|
|
84531
|
-
result6.push(...orderSelectedFields(field, newPath));
|
|
84532
|
-
return result6;
|
|
84533
|
-
}, []);
|
|
84534
|
-
}
|
|
84535
|
-
function haveSameKeys(left, right) {
|
|
84536
|
-
const leftKeys = Object.keys(left);
|
|
84537
|
-
const rightKeys = Object.keys(right);
|
|
84538
|
-
if (leftKeys.length !== rightKeys.length)
|
|
84539
|
-
return false;
|
|
84540
|
-
for (const [index2, key] of leftKeys.entries())
|
|
84541
|
-
if (key !== rightKeys[index2])
|
|
84542
|
-
return false;
|
|
84543
|
-
return true;
|
|
84544
|
-
}
|
|
84545
|
-
function mapUpdateSet(table2, values12) {
|
|
84546
|
-
const entries10 = Object.entries(values12).filter(([, value8]) => value8 !== undefined).map(([key, value8]) => {
|
|
84547
|
-
if (is6(value8, SQL) || is6(value8, Column))
|
|
84548
|
-
return [key, value8];
|
|
84549
|
-
else
|
|
84550
|
-
return [key, new Param(value8, table2[Table.Symbol.Columns][key])];
|
|
84551
|
-
});
|
|
84552
|
-
if (entries10.length === 0)
|
|
84553
|
-
throw new Error("No values to set");
|
|
84554
|
-
return Object.fromEntries(entries10);
|
|
84555
|
-
}
|
|
84556
|
-
function applyMixins(baseClass, extendedClasses) {
|
|
84557
|
-
for (const extendedClass of extendedClasses)
|
|
84558
|
-
for (const name2 of Object.getOwnPropertyNames(extendedClass.prototype)) {
|
|
84559
|
-
if (name2 === "constructor")
|
|
84560
|
-
continue;
|
|
84561
|
-
Object.defineProperty(baseClass.prototype, name2, Object.getOwnPropertyDescriptor(extendedClass.prototype, name2) || Object.create(null));
|
|
84562
|
-
}
|
|
84563
|
-
}
|
|
84564
|
-
function getTableColumns(table2) {
|
|
84565
|
-
return table2[Table.Symbol.Columns];
|
|
84566
|
-
}
|
|
84567
|
-
function getTableLikeName(table2) {
|
|
84568
|
-
return is6(table2, Subquery) ? table2._.alias : is6(table2, View) ? table2[ViewBaseConfig].name : is6(table2, SQL) ? undefined : table2[Table.Symbol.IsAlias] ? table2[Table.Symbol.Name] : table2[Table.Symbol.BaseName];
|
|
84569
|
-
}
|
|
84570
|
-
function getColumnNameAndConfig(a, b) {
|
|
84571
|
-
return {
|
|
84572
|
-
name: typeof a === "string" && a.length > 0 ? a : "",
|
|
84573
|
-
config: typeof a === "object" ? a : b
|
|
84574
|
-
};
|
|
84575
|
-
}
|
|
84576
|
-
var textDecoder, CONSTANTS;
|
|
84577
|
-
var init_utils2 = __esm(() => {
|
|
84578
|
-
init_entity();
|
|
84579
|
-
init_column();
|
|
84580
|
-
init_table();
|
|
84581
|
-
init_sql();
|
|
84582
|
-
init_subquery();
|
|
84583
|
-
init_view_common();
|
|
84584
|
-
textDecoder = typeof TextDecoder === "undefined" ? null : new TextDecoder;
|
|
84585
|
-
CONSTANTS = {
|
|
84586
|
-
INT8_MIN: -128,
|
|
84587
|
-
INT8_MAX: 127,
|
|
84588
|
-
INT8_UNSIGNED_MAX: 255,
|
|
84589
|
-
INT16_MIN: -32768,
|
|
84590
|
-
INT16_MAX: 32767,
|
|
84591
|
-
INT16_UNSIGNED_MAX: 65535,
|
|
84592
|
-
INT24_MIN: -8388608,
|
|
84593
|
-
INT24_MAX: 8388607,
|
|
84594
|
-
INT24_UNSIGNED_MAX: 16777215,
|
|
84595
|
-
INT32_MIN: -2147483648,
|
|
84596
|
-
INT32_MAX: 2147483647,
|
|
84597
|
-
INT32_UNSIGNED_MAX: 4294967295,
|
|
84598
|
-
INT48_MIN: -140737488355328,
|
|
84599
|
-
INT48_MAX: 140737488355327,
|
|
84600
|
-
INT48_UNSIGNED_MAX: 281474976710655,
|
|
84601
|
-
INT64_MIN: -9223372036854775808n,
|
|
84602
|
-
INT64_MAX: 9223372036854775807n,
|
|
84603
|
-
INT64_UNSIGNED_MAX: 18446744073709551615n
|
|
84604
|
-
};
|
|
84605
|
-
});
|
|
84606
|
-
|
|
84607
83906
|
// ../../node_modules/drizzle-orm/index.js
|
|
84608
83907
|
var init_drizzle_orm = __esm(() => {
|
|
84609
83908
|
init_sql();
|
|
@@ -84782,7 +84081,7 @@ var init_meta = __esm(() => {
|
|
|
84782
84081
|
|
|
84783
84082
|
// ../../packages/server/src/effect/logger.ts
|
|
84784
84083
|
var EffectLogger;
|
|
84785
|
-
var
|
|
84084
|
+
var init_logger = __esm(async () => {
|
|
84786
84085
|
init_dist();
|
|
84787
84086
|
await init_log();
|
|
84788
84087
|
((EffectLogger) => {
|
|
@@ -84879,7 +84178,7 @@ var init_instance_state = __esm(async () => {
|
|
|
84879
84178
|
init_instance_registry();
|
|
84880
84179
|
init_workspace_context();
|
|
84881
84180
|
await __promiseAll([
|
|
84882
|
-
|
|
84181
|
+
init_logger(),
|
|
84883
84182
|
init_instance()
|
|
84884
84183
|
]);
|
|
84885
84184
|
((InstanceState) => {
|
|
@@ -84931,6 +84230,228 @@ var init_instance_state = __esm(async () => {
|
|
|
84931
84230
|
})(InstanceState ||= {});
|
|
84932
84231
|
});
|
|
84933
84232
|
|
|
84233
|
+
// ../../node_modules/drizzle-orm/utils.js
|
|
84234
|
+
function mapResultRow2(columns, row, joinsNotNullableMap) {
|
|
84235
|
+
const nullifyMap = {};
|
|
84236
|
+
const result6 = columns.reduce((result7, { path: path5, field }, columnIndex) => {
|
|
84237
|
+
let decoder2;
|
|
84238
|
+
if (is6(field, Column))
|
|
84239
|
+
decoder2 = field;
|
|
84240
|
+
else if (is6(field, SQL))
|
|
84241
|
+
decoder2 = field.decoder;
|
|
84242
|
+
else if (is6(field, Subquery))
|
|
84243
|
+
decoder2 = field._.sql.decoder;
|
|
84244
|
+
else
|
|
84245
|
+
decoder2 = field.sql.decoder;
|
|
84246
|
+
let node = result7;
|
|
84247
|
+
for (const [pathChunkIndex, pathChunk] of path5.entries())
|
|
84248
|
+
if (pathChunkIndex < path5.length - 1) {
|
|
84249
|
+
if (!(pathChunk in node))
|
|
84250
|
+
node[pathChunk] = {};
|
|
84251
|
+
node = node[pathChunk];
|
|
84252
|
+
} else {
|
|
84253
|
+
const rawValue = row[columnIndex];
|
|
84254
|
+
const value8 = node[pathChunk] = rawValue === null ? null : decoder2.mapFromDriverValue(rawValue);
|
|
84255
|
+
if (joinsNotNullableMap && is6(field, Column) && path5.length === 2) {
|
|
84256
|
+
const objectName = path5[0];
|
|
84257
|
+
if (!(objectName in nullifyMap))
|
|
84258
|
+
nullifyMap[objectName] = value8 === null ? getTableName(field.table) : false;
|
|
84259
|
+
else if (typeof nullifyMap[objectName] === "string" && nullifyMap[objectName] !== getTableName(field.table))
|
|
84260
|
+
nullifyMap[objectName] = false;
|
|
84261
|
+
}
|
|
84262
|
+
}
|
|
84263
|
+
return result7;
|
|
84264
|
+
}, {});
|
|
84265
|
+
if (joinsNotNullableMap && Object.keys(nullifyMap).length > 0) {
|
|
84266
|
+
for (const [objectName, tableName] of Object.entries(nullifyMap))
|
|
84267
|
+
if (typeof tableName === "string" && !joinsNotNullableMap[tableName])
|
|
84268
|
+
result6[objectName] = null;
|
|
84269
|
+
}
|
|
84270
|
+
return result6;
|
|
84271
|
+
}
|
|
84272
|
+
function orderSelectedFields2(fields, pathPrefix) {
|
|
84273
|
+
return Object.entries(fields).reduce((result6, [name3, field]) => {
|
|
84274
|
+
if (typeof name3 !== "string")
|
|
84275
|
+
return result6;
|
|
84276
|
+
const newPath = pathPrefix ? [...pathPrefix, name3] : [name3];
|
|
84277
|
+
if (is6(field, Column) || is6(field, SQL) || is6(field, SQL.Aliased) || is6(field, Subquery))
|
|
84278
|
+
result6.push({
|
|
84279
|
+
path: newPath,
|
|
84280
|
+
field
|
|
84281
|
+
});
|
|
84282
|
+
else if (is6(field, Table))
|
|
84283
|
+
result6.push(...orderSelectedFields2(field[Table.Symbol.Columns], newPath));
|
|
84284
|
+
else
|
|
84285
|
+
result6.push(...orderSelectedFields2(field, newPath));
|
|
84286
|
+
return result6;
|
|
84287
|
+
}, []);
|
|
84288
|
+
}
|
|
84289
|
+
function haveSameKeys2(left, right) {
|
|
84290
|
+
const leftKeys = Object.keys(left);
|
|
84291
|
+
const rightKeys = Object.keys(right);
|
|
84292
|
+
if (leftKeys.length !== rightKeys.length)
|
|
84293
|
+
return false;
|
|
84294
|
+
for (const [index2, key] of leftKeys.entries())
|
|
84295
|
+
if (key !== rightKeys[index2])
|
|
84296
|
+
return false;
|
|
84297
|
+
return true;
|
|
84298
|
+
}
|
|
84299
|
+
function mapUpdateSet2(table2, values12) {
|
|
84300
|
+
const entries10 = Object.entries(values12).filter(([, value8]) => value8 !== undefined).map(([key, value8]) => {
|
|
84301
|
+
if (is6(value8, SQL) || is6(value8, Column))
|
|
84302
|
+
return [key, value8];
|
|
84303
|
+
else
|
|
84304
|
+
return [key, new Param(value8, table2[Table.Symbol.Columns][key])];
|
|
84305
|
+
});
|
|
84306
|
+
if (entries10.length === 0)
|
|
84307
|
+
throw new Error("No values to set");
|
|
84308
|
+
return Object.fromEntries(entries10);
|
|
84309
|
+
}
|
|
84310
|
+
function applyMixins2(baseClass, extendedClasses) {
|
|
84311
|
+
for (const extendedClass of extendedClasses)
|
|
84312
|
+
for (const name3 of Object.getOwnPropertyNames(extendedClass.prototype)) {
|
|
84313
|
+
if (name3 === "constructor")
|
|
84314
|
+
continue;
|
|
84315
|
+
Object.defineProperty(baseClass.prototype, name3, Object.getOwnPropertyDescriptor(extendedClass.prototype, name3) || Object.create(null));
|
|
84316
|
+
}
|
|
84317
|
+
}
|
|
84318
|
+
function getTableColumns2(table2) {
|
|
84319
|
+
return table2[Table.Symbol.Columns];
|
|
84320
|
+
}
|
|
84321
|
+
function getTableLikeName2(table2) {
|
|
84322
|
+
return is6(table2, Subquery) ? table2._.alias : is6(table2, View) ? table2[ViewBaseConfig].name : is6(table2, SQL) ? undefined : table2[Table.Symbol.IsAlias] ? table2[Table.Symbol.Name] : table2[Table.Symbol.BaseName];
|
|
84323
|
+
}
|
|
84324
|
+
function getColumnNameAndConfig2(a, b) {
|
|
84325
|
+
return {
|
|
84326
|
+
name: typeof a === "string" && a.length > 0 ? a : "",
|
|
84327
|
+
config: typeof a === "object" ? a : b
|
|
84328
|
+
};
|
|
84329
|
+
}
|
|
84330
|
+
var textDecoder2, CONSTANTS2;
|
|
84331
|
+
var init_utils2 = __esm(() => {
|
|
84332
|
+
init_entity();
|
|
84333
|
+
init_column();
|
|
84334
|
+
init_table();
|
|
84335
|
+
init_sql();
|
|
84336
|
+
init_subquery();
|
|
84337
|
+
init_view_common();
|
|
84338
|
+
textDecoder2 = typeof TextDecoder === "undefined" ? null : new TextDecoder;
|
|
84339
|
+
CONSTANTS2 = {
|
|
84340
|
+
INT8_MIN: -128,
|
|
84341
|
+
INT8_MAX: 127,
|
|
84342
|
+
INT8_UNSIGNED_MAX: 255,
|
|
84343
|
+
INT16_MIN: -32768,
|
|
84344
|
+
INT16_MAX: 32767,
|
|
84345
|
+
INT16_UNSIGNED_MAX: 65535,
|
|
84346
|
+
INT24_MIN: -8388608,
|
|
84347
|
+
INT24_MAX: 8388607,
|
|
84348
|
+
INT24_UNSIGNED_MAX: 16777215,
|
|
84349
|
+
INT32_MIN: -2147483648,
|
|
84350
|
+
INT32_MAX: 2147483647,
|
|
84351
|
+
INT32_UNSIGNED_MAX: 4294967295,
|
|
84352
|
+
INT48_MIN: -140737488355328,
|
|
84353
|
+
INT48_MAX: 140737488355327,
|
|
84354
|
+
INT48_UNSIGNED_MAX: 281474976710655,
|
|
84355
|
+
INT64_MIN: -9223372036854775808n,
|
|
84356
|
+
INT64_MAX: 9223372036854775807n,
|
|
84357
|
+
INT64_UNSIGNED_MAX: 18446744073709551615n
|
|
84358
|
+
};
|
|
84359
|
+
});
|
|
84360
|
+
|
|
84361
|
+
// ../../node_modules/drizzle-orm/logger.js
|
|
84362
|
+
var ConsoleLogWriter2, DefaultLogger2, NoopLogger2;
|
|
84363
|
+
var init_logger2 = __esm(() => {
|
|
84364
|
+
init_entity();
|
|
84365
|
+
ConsoleLogWriter2 = class {
|
|
84366
|
+
static [entityKind] = "ConsoleLogWriter";
|
|
84367
|
+
write(message) {
|
|
84368
|
+
console.log(message);
|
|
84369
|
+
}
|
|
84370
|
+
};
|
|
84371
|
+
DefaultLogger2 = class {
|
|
84372
|
+
static [entityKind] = "DefaultLogger";
|
|
84373
|
+
writer;
|
|
84374
|
+
constructor(config3) {
|
|
84375
|
+
this.writer = config3?.writer ?? new ConsoleLogWriter2;
|
|
84376
|
+
}
|
|
84377
|
+
logQuery(query, params) {
|
|
84378
|
+
const stringifiedParams = params.map((p) => {
|
|
84379
|
+
try {
|
|
84380
|
+
return JSON.stringify(p);
|
|
84381
|
+
} catch {
|
|
84382
|
+
return String(p);
|
|
84383
|
+
}
|
|
84384
|
+
});
|
|
84385
|
+
const paramsStr = stringifiedParams.length ? ` -- params: [${stringifiedParams.join(", ")}]` : "";
|
|
84386
|
+
this.writer.write(`Query: ${query}${paramsStr}`);
|
|
84387
|
+
}
|
|
84388
|
+
};
|
|
84389
|
+
NoopLogger2 = class {
|
|
84390
|
+
static [entityKind] = "NoopLogger";
|
|
84391
|
+
logQuery() {}
|
|
84392
|
+
};
|
|
84393
|
+
});
|
|
84394
|
+
|
|
84395
|
+
// ../../node_modules/drizzle-orm/column-builder.js
|
|
84396
|
+
var ColumnBuilder2;
|
|
84397
|
+
var init_column_builder = __esm(() => {
|
|
84398
|
+
init_entity();
|
|
84399
|
+
ColumnBuilder2 = class {
|
|
84400
|
+
static [entityKind] = "ColumnBuilder";
|
|
84401
|
+
config;
|
|
84402
|
+
constructor(name3, dataType, columnType) {
|
|
84403
|
+
this.config = {
|
|
84404
|
+
name: name3,
|
|
84405
|
+
keyAsName: name3 === "",
|
|
84406
|
+
notNull: false,
|
|
84407
|
+
default: undefined,
|
|
84408
|
+
hasDefault: false,
|
|
84409
|
+
primaryKey: false,
|
|
84410
|
+
isUnique: false,
|
|
84411
|
+
uniqueName: undefined,
|
|
84412
|
+
uniqueType: undefined,
|
|
84413
|
+
dataType,
|
|
84414
|
+
columnType,
|
|
84415
|
+
generated: undefined
|
|
84416
|
+
};
|
|
84417
|
+
}
|
|
84418
|
+
$type() {
|
|
84419
|
+
return this;
|
|
84420
|
+
}
|
|
84421
|
+
notNull() {
|
|
84422
|
+
this.config.notNull = true;
|
|
84423
|
+
return this;
|
|
84424
|
+
}
|
|
84425
|
+
default(value8) {
|
|
84426
|
+
this.config.default = value8;
|
|
84427
|
+
this.config.hasDefault = true;
|
|
84428
|
+
return this;
|
|
84429
|
+
}
|
|
84430
|
+
$defaultFn(fn3) {
|
|
84431
|
+
this.config.defaultFn = fn3;
|
|
84432
|
+
this.config.hasDefault = true;
|
|
84433
|
+
return this;
|
|
84434
|
+
}
|
|
84435
|
+
$default = this.$defaultFn;
|
|
84436
|
+
$onUpdateFn(fn3) {
|
|
84437
|
+
this.config.onUpdateFn = fn3;
|
|
84438
|
+
this.config.hasDefault = true;
|
|
84439
|
+
return this;
|
|
84440
|
+
}
|
|
84441
|
+
$onUpdate = this.$onUpdateFn;
|
|
84442
|
+
primaryKey() {
|
|
84443
|
+
this.config.primaryKey = true;
|
|
84444
|
+
this.config.notNull = true;
|
|
84445
|
+
return this;
|
|
84446
|
+
}
|
|
84447
|
+
setName(name3) {
|
|
84448
|
+
if (this.config.name !== "")
|
|
84449
|
+
return;
|
|
84450
|
+
this.config.name = name3;
|
|
84451
|
+
}
|
|
84452
|
+
};
|
|
84453
|
+
});
|
|
84454
|
+
|
|
84934
84455
|
// ../../node_modules/drizzle-orm/sqlite-core/foreign-keys.js
|
|
84935
84456
|
var ForeignKeyBuilder, ForeignKey;
|
|
84936
84457
|
var init_foreign_keys = __esm(() => {
|
|
@@ -85004,7 +84525,7 @@ var init_common = __esm(() => {
|
|
|
85004
84525
|
init_column();
|
|
85005
84526
|
init_column_builder();
|
|
85006
84527
|
init_foreign_keys();
|
|
85007
|
-
SQLiteColumnBuilder = class extends
|
|
84528
|
+
SQLiteColumnBuilder = class extends ColumnBuilder2 {
|
|
85008
84529
|
static [entityKind] = "SQLiteColumnBuilder";
|
|
85009
84530
|
foreignKeyConfigs = [];
|
|
85010
84531
|
references(ref, actions = {}) {
|
|
@@ -85058,7 +84579,7 @@ var init_common = __esm(() => {
|
|
|
85058
84579
|
|
|
85059
84580
|
// ../../node_modules/drizzle-orm/sqlite-core/columns/integer.js
|
|
85060
84581
|
function integer3(a, b) {
|
|
85061
|
-
const { name: name3, config: config3 } =
|
|
84582
|
+
const { name: name3, config: config3 } = getColumnNameAndConfig2(a, b);
|
|
85062
84583
|
if (config3?.mode === "timestamp" || config3?.mode === "timestamp_ms")
|
|
85063
84584
|
return new SQLiteTimestampBuilder(name3, config3.mode);
|
|
85064
84585
|
if (config3?.mode === "boolean")
|
|
@@ -85159,7 +84680,7 @@ var init_integer = __esm(() => {
|
|
|
85159
84680
|
|
|
85160
84681
|
// ../../node_modules/drizzle-orm/sqlite-core/columns/text.js
|
|
85161
84682
|
function text2(a, b = {}) {
|
|
85162
|
-
const { name: name3, config: config3 } =
|
|
84683
|
+
const { name: name3, config: config3 } = getColumnNameAndConfig2(a, b);
|
|
85163
84684
|
if (config3.mode === "json")
|
|
85164
84685
|
return new SQLiteTextJsonBuilder(name3);
|
|
85165
84686
|
return new SQLiteTextBuilder(name3, config3);
|
|
@@ -85277,7 +84798,7 @@ function hexToText(hexString) {
|
|
|
85277
84798
|
return result6;
|
|
85278
84799
|
}
|
|
85279
84800
|
function blob(a, b) {
|
|
85280
|
-
const { name: name3, config: config3 } =
|
|
84801
|
+
const { name: name3, config: config3 } = getColumnNameAndConfig2(a, b);
|
|
85281
84802
|
if (config3?.mode === "json")
|
|
85282
84803
|
return new SQLiteBlobJsonBuilder(name3);
|
|
85283
84804
|
if (config3?.mode === "bigint")
|
|
@@ -85310,7 +84831,7 @@ var init_blob = __esm(() => {
|
|
|
85310
84831
|
const buf = Buffer.isBuffer(value8) ? value8 : value8 instanceof ArrayBuffer ? Buffer.from(value8) : value8.buffer ? Buffer.from(value8.buffer, value8.byteOffset, value8.byteLength) : Buffer.from(value8);
|
|
85311
84832
|
return BigInt(buf.toString("utf8"));
|
|
85312
84833
|
}
|
|
85313
|
-
return BigInt(
|
|
84834
|
+
return BigInt(textDecoder2.decode(value8));
|
|
85314
84835
|
}
|
|
85315
84836
|
mapToDriverValue(value8) {
|
|
85316
84837
|
return Buffer.from(value8.toString());
|
|
@@ -85337,7 +84858,7 @@ var init_blob = __esm(() => {
|
|
|
85337
84858
|
const buf = Buffer.isBuffer(value8) ? value8 : value8 instanceof ArrayBuffer ? Buffer.from(value8) : value8.buffer ? Buffer.from(value8.buffer, value8.byteOffset, value8.byteLength) : Buffer.from(value8);
|
|
85338
84859
|
return JSON.parse(buf.toString("utf8"));
|
|
85339
84860
|
}
|
|
85340
|
-
return JSON.parse(
|
|
84861
|
+
return JSON.parse(textDecoder2.decode(value8));
|
|
85341
84862
|
}
|
|
85342
84863
|
mapToDriverValue(value8) {
|
|
85343
84864
|
return Buffer.from(JSON.stringify(value8));
|
|
@@ -85370,7 +84891,7 @@ var init_blob = __esm(() => {
|
|
|
85370
84891
|
// ../../node_modules/drizzle-orm/sqlite-core/columns/custom.js
|
|
85371
84892
|
function customType(customTypeParams) {
|
|
85372
84893
|
return (a, b) => {
|
|
85373
|
-
const { name: name3, config: config3 } =
|
|
84894
|
+
const { name: name3, config: config3 } = getColumnNameAndConfig2(a, b);
|
|
85374
84895
|
return new SQLiteCustomColumnBuilder(name3, config3, customTypeParams);
|
|
85375
84896
|
};
|
|
85376
84897
|
}
|
|
@@ -85438,7 +84959,7 @@ var init_custom = __esm(() => {
|
|
|
85438
84959
|
|
|
85439
84960
|
// ../../node_modules/drizzle-orm/sqlite-core/columns/numeric.js
|
|
85440
84961
|
function numeric2(a, b) {
|
|
85441
|
-
const { name: name3, config: config3 } =
|
|
84962
|
+
const { name: name3, config: config3 } = getColumnNameAndConfig2(a, b);
|
|
85442
84963
|
const mode = config3?.mode;
|
|
85443
84964
|
return mode === "number" ? new SQLiteNumericNumberBuilder(name3) : mode === "bigint" ? new SQLiteNumericBigIntBuilder(name3) : new SQLiteNumericBuilder(name3);
|
|
85444
84965
|
}
|
|
@@ -85988,7 +85509,7 @@ var init_int_common = __esm(() => {
|
|
|
85988
85509
|
|
|
85989
85510
|
// ../../node_modules/drizzle-orm/pg-core/columns/bigint.js
|
|
85990
85511
|
function bigint11(a, b) {
|
|
85991
|
-
const { name: name3, config: config3 } =
|
|
85512
|
+
const { name: name3, config: config3 } = getColumnNameAndConfig2(a, b);
|
|
85992
85513
|
if (config3.mode === "number")
|
|
85993
85514
|
return new PgBigInt53Builder(name3);
|
|
85994
85515
|
if (config3.mode === "string")
|
|
@@ -86063,7 +85584,7 @@ var init_bigint = __esm(() => {
|
|
|
86063
85584
|
|
|
86064
85585
|
// ../../node_modules/drizzle-orm/pg-core/columns/bigserial.js
|
|
86065
85586
|
function bigserial(a, b) {
|
|
86066
|
-
const { name: name3, config: config3 } =
|
|
85587
|
+
const { name: name3, config: config3 } = getColumnNameAndConfig2(a, b);
|
|
86067
85588
|
if (config3.mode === "number")
|
|
86068
85589
|
return new PgBigSerial53Builder(name3);
|
|
86069
85590
|
return new PgBigSerial64Builder(name3);
|
|
@@ -86144,7 +85665,7 @@ var init_boolean = __esm(() => {
|
|
|
86144
85665
|
|
|
86145
85666
|
// ../../node_modules/drizzle-orm/pg-core/columns/char.js
|
|
86146
85667
|
function char(a, b = {}) {
|
|
86147
|
-
const { name: name3, config: config3 } =
|
|
85668
|
+
const { name: name3, config: config3 } = getColumnNameAndConfig2(a, b);
|
|
86148
85669
|
return new PgCharBuilder(name3, config3);
|
|
86149
85670
|
}
|
|
86150
85671
|
var PgCharBuilder, PgChar;
|
|
@@ -86207,7 +85728,7 @@ var init_cidr = __esm(() => {
|
|
|
86207
85728
|
// ../../node_modules/drizzle-orm/pg-core/columns/custom.js
|
|
86208
85729
|
function customType2(customTypeParams) {
|
|
86209
85730
|
return (a, b) => {
|
|
86210
|
-
const { name: name3, config: config3 } =
|
|
85731
|
+
const { name: name3, config: config3 } = getColumnNameAndConfig2(a, b);
|
|
86211
85732
|
return new PgCustomColumnBuilder(name3, config3, customTypeParams);
|
|
86212
85733
|
};
|
|
86213
85734
|
}
|
|
@@ -86312,7 +85833,7 @@ var init_date_common = __esm(() => {
|
|
|
86312
85833
|
|
|
86313
85834
|
// ../../node_modules/drizzle-orm/pg-core/columns/date.js
|
|
86314
85835
|
function date9(a, b) {
|
|
86315
|
-
const { name: name3, config: config3 } =
|
|
85836
|
+
const { name: name3, config: config3 } = getColumnNameAndConfig2(a, b);
|
|
86316
85837
|
if (config3?.mode === "date")
|
|
86317
85838
|
return new PgDateBuilder(name3);
|
|
86318
85839
|
return new PgDateStringBuilder(name3);
|
|
@@ -86463,7 +85984,7 @@ var init_integer2 = __esm(() => {
|
|
|
86463
85984
|
|
|
86464
85985
|
// ../../node_modules/drizzle-orm/pg-core/columns/interval.js
|
|
86465
85986
|
function interval(a, b = {}) {
|
|
86466
|
-
const { name: name3, config: config3 } =
|
|
85987
|
+
const { name: name3, config: config3 } = getColumnNameAndConfig2(a, b);
|
|
86467
85988
|
return new PgIntervalBuilder(name3, config3);
|
|
86468
85989
|
}
|
|
86469
85990
|
var PgIntervalBuilder, PgInterval;
|
|
@@ -86578,7 +86099,7 @@ var init_jsonb = __esm(() => {
|
|
|
86578
86099
|
|
|
86579
86100
|
// ../../node_modules/drizzle-orm/pg-core/columns/line.js
|
|
86580
86101
|
function line(a, b) {
|
|
86581
|
-
const { name: name3, config: config3 } =
|
|
86102
|
+
const { name: name3, config: config3 } = getColumnNameAndConfig2(a, b);
|
|
86582
86103
|
if (!config3?.mode || config3.mode === "tuple")
|
|
86583
86104
|
return new PgLineBuilder(name3);
|
|
86584
86105
|
return new PgLineABCBuilder(name3);
|
|
@@ -86696,7 +86217,7 @@ var init_macaddr8 = __esm(() => {
|
|
|
86696
86217
|
|
|
86697
86218
|
// ../../node_modules/drizzle-orm/pg-core/columns/numeric.js
|
|
86698
86219
|
function numeric3(a, b) {
|
|
86699
|
-
const { name: name3, config: config3 } =
|
|
86220
|
+
const { name: name3, config: config3 } = getColumnNameAndConfig2(a, b);
|
|
86700
86221
|
const mode = config3?.mode;
|
|
86701
86222
|
return mode === "number" ? new PgNumericNumberBuilder(name3, config3?.precision, config3?.scale) : mode === "bigint" ? new PgNumericBigIntBuilder(name3, config3?.precision, config3?.scale) : new PgNumericBuilder(name3, config3?.precision, config3?.scale);
|
|
86702
86223
|
}
|
|
@@ -86815,7 +86336,7 @@ var init_numeric2 = __esm(() => {
|
|
|
86815
86336
|
|
|
86816
86337
|
// ../../node_modules/drizzle-orm/pg-core/columns/point.js
|
|
86817
86338
|
function point(a, b) {
|
|
86818
|
-
const { name: name3, config: config3 } =
|
|
86339
|
+
const { name: name3, config: config3 } = getColumnNameAndConfig2(a, b);
|
|
86819
86340
|
if (!config3?.mode || config3.mode === "tuple")
|
|
86820
86341
|
return new PgPointTupleBuilder(name3);
|
|
86821
86342
|
return new PgPointObjectBuilder(name3);
|
|
@@ -86925,7 +86446,7 @@ var init_utils3 = () => {};
|
|
|
86925
86446
|
|
|
86926
86447
|
// ../../node_modules/drizzle-orm/pg-core/columns/postgis_extension/geometry.js
|
|
86927
86448
|
function geometry(a, b) {
|
|
86928
|
-
const { name: name3, config: config3 } =
|
|
86449
|
+
const { name: name3, config: config3 } = getColumnNameAndConfig2(a, b);
|
|
86929
86450
|
if (!config3?.mode || config3.mode === "tuple")
|
|
86930
86451
|
return new PgGeometryBuilder(name3, config3?.srid);
|
|
86931
86452
|
return new PgGeometryObjectBuilder(name3, config3?.srid);
|
|
@@ -87113,7 +86634,7 @@ var init_smallserial = __esm(() => {
|
|
|
87113
86634
|
|
|
87114
86635
|
// ../../node_modules/drizzle-orm/pg-core/columns/text.js
|
|
87115
86636
|
function text3(a, b = {}) {
|
|
87116
|
-
const { name: name3, config: config3 } =
|
|
86637
|
+
const { name: name3, config: config3 } = getColumnNameAndConfig2(a, b);
|
|
87117
86638
|
return new PgTextBuilder(name3, config3);
|
|
87118
86639
|
}
|
|
87119
86640
|
var PgTextBuilder, PgText;
|
|
@@ -87146,7 +86667,7 @@ var init_text2 = __esm(() => {
|
|
|
87146
86667
|
|
|
87147
86668
|
// ../../node_modules/drizzle-orm/pg-core/columns/time.js
|
|
87148
86669
|
function time4(a, b = {}) {
|
|
87149
|
-
const { name: name3, config: config3 } =
|
|
86670
|
+
const { name: name3, config: config3 } = getColumnNameAndConfig2(a, b);
|
|
87150
86671
|
return new PgTimeBuilder(name3, config3.withTimezone ?? false, config3.precision);
|
|
87151
86672
|
}
|
|
87152
86673
|
var PgTimeBuilder, PgTime;
|
|
@@ -87185,7 +86706,7 @@ var init_time = __esm(() => {
|
|
|
87185
86706
|
|
|
87186
86707
|
// ../../node_modules/drizzle-orm/pg-core/columns/timestamp.js
|
|
87187
86708
|
function timestamp(a, b = {}) {
|
|
87188
|
-
const { name: name3, config: config3 } =
|
|
86709
|
+
const { name: name3, config: config3 } = getColumnNameAndConfig2(a, b);
|
|
87189
86710
|
if (config3?.mode === "string")
|
|
87190
86711
|
return new PgTimestampStringBuilder(name3, config3.withTimezone ?? false, config3.precision);
|
|
87191
86712
|
return new PgTimestampBuilder(name3, config3?.withTimezone ?? false, config3?.precision);
|
|
@@ -87300,7 +86821,7 @@ var init_uuid = __esm(() => {
|
|
|
87300
86821
|
|
|
87301
86822
|
// ../../node_modules/drizzle-orm/pg-core/columns/varchar.js
|
|
87302
86823
|
function varchar(a, b = {}) {
|
|
87303
|
-
const { name: name3, config: config3 } =
|
|
86824
|
+
const { name: name3, config: config3 } = getColumnNameAndConfig2(a, b);
|
|
87304
86825
|
return new PgVarcharBuilder(name3, config3);
|
|
87305
86826
|
}
|
|
87306
86827
|
var PgVarcharBuilder, PgVarchar;
|
|
@@ -87334,7 +86855,7 @@ var init_varchar = __esm(() => {
|
|
|
87334
86855
|
|
|
87335
86856
|
// ../../node_modules/drizzle-orm/pg-core/columns/vector_extension/bit.js
|
|
87336
86857
|
function bit(a, b) {
|
|
87337
|
-
const { name: name3, config: config3 } =
|
|
86858
|
+
const { name: name3, config: config3 } = getColumnNameAndConfig2(a, b);
|
|
87338
86859
|
return new PgBinaryVectorBuilder(name3, config3);
|
|
87339
86860
|
}
|
|
87340
86861
|
var PgBinaryVectorBuilder, PgBinaryVector;
|
|
@@ -87363,7 +86884,7 @@ var init_bit = __esm(() => {
|
|
|
87363
86884
|
|
|
87364
86885
|
// ../../node_modules/drizzle-orm/pg-core/columns/vector_extension/halfvec.js
|
|
87365
86886
|
function halfvec(a, b) {
|
|
87366
|
-
const { name: name3, config: config3 } =
|
|
86887
|
+
const { name: name3, config: config3 } = getColumnNameAndConfig2(a, b);
|
|
87367
86888
|
return new PgHalfVectorBuilder(name3, config3);
|
|
87368
86889
|
}
|
|
87369
86890
|
var PgHalfVectorBuilder, PgHalfVector;
|
|
@@ -87398,7 +86919,7 @@ var init_halfvec = __esm(() => {
|
|
|
87398
86919
|
|
|
87399
86920
|
// ../../node_modules/drizzle-orm/pg-core/columns/vector_extension/sparsevec.js
|
|
87400
86921
|
function sparsevec(a, b) {
|
|
87401
|
-
const { name: name3, config: config3 } =
|
|
86922
|
+
const { name: name3, config: config3 } = getColumnNameAndConfig2(a, b);
|
|
87402
86923
|
return new PgSparseVectorBuilder(name3, config3);
|
|
87403
86924
|
}
|
|
87404
86925
|
var PgSparseVectorBuilder, PgSparseVector;
|
|
@@ -87427,7 +86948,7 @@ var init_sparsevec = __esm(() => {
|
|
|
87427
86948
|
|
|
87428
86949
|
// ../../node_modules/drizzle-orm/pg-core/columns/vector_extension/vector.js
|
|
87429
86950
|
function vector(a, b) {
|
|
87430
|
-
const { name: name3, config: config3 } =
|
|
86951
|
+
const { name: name3, config: config3 } = getColumnNameAndConfig2(a, b);
|
|
87431
86952
|
return new PgVectorBuilder(name3, config3);
|
|
87432
86953
|
}
|
|
87433
86954
|
var PgVectorBuilder, PgVector;
|
|
@@ -87646,7 +87167,7 @@ function getOperators() {
|
|
|
87646
87167
|
sql
|
|
87647
87168
|
};
|
|
87648
87169
|
}
|
|
87649
|
-
function
|
|
87170
|
+
function getOrderByOperators2() {
|
|
87650
87171
|
return {
|
|
87651
87172
|
sql,
|
|
87652
87173
|
asc,
|
|
@@ -87707,7 +87228,7 @@ function createOne(sourceTable) {
|
|
|
87707
87228
|
}
|
|
87708
87229
|
function createMany(sourceTable) {
|
|
87709
87230
|
return function many(referencedTable, config3) {
|
|
87710
|
-
return new
|
|
87231
|
+
return new Many2(sourceTable, referencedTable, config3);
|
|
87711
87232
|
};
|
|
87712
87233
|
}
|
|
87713
87234
|
function normalizeRelation(schema2, tableNamesMap, relation) {
|
|
@@ -87767,7 +87288,7 @@ function mapRelationalRow2(tablesConfig, tableConfig, row, buildQueryResultSelec
|
|
|
87767
87288
|
}
|
|
87768
87289
|
return result6;
|
|
87769
87290
|
}
|
|
87770
|
-
var Relation2, Relations, One2,
|
|
87291
|
+
var Relation2, Relations, One2, Many2;
|
|
87771
87292
|
var init__relations = __esm(() => {
|
|
87772
87293
|
init_entity();
|
|
87773
87294
|
init_column();
|
|
@@ -87807,20 +87328,45 @@ var init__relations = __esm(() => {
|
|
|
87807
87328
|
return relation;
|
|
87808
87329
|
}
|
|
87809
87330
|
};
|
|
87810
|
-
|
|
87331
|
+
Many2 = class Many3 extends Relation2 {
|
|
87811
87332
|
static [entityKind] = "Many";
|
|
87812
87333
|
constructor(sourceTable, referencedTable, config3) {
|
|
87813
87334
|
super(sourceTable, referencedTable, config3?.relationName);
|
|
87814
87335
|
this.config = config3;
|
|
87815
87336
|
}
|
|
87816
87337
|
withFieldName(fieldName) {
|
|
87817
|
-
const relation = new
|
|
87338
|
+
const relation = new Many3(this.sourceTable, this.referencedTable, this.config);
|
|
87818
87339
|
relation.fieldName = fieldName;
|
|
87819
87340
|
return relation;
|
|
87820
87341
|
}
|
|
87821
87342
|
};
|
|
87822
87343
|
});
|
|
87823
87344
|
|
|
87345
|
+
// ../../node_modules/drizzle-orm/query-promise.js
|
|
87346
|
+
var QueryPromise2;
|
|
87347
|
+
var init_query_promise = __esm(() => {
|
|
87348
|
+
init_entity();
|
|
87349
|
+
QueryPromise2 = class {
|
|
87350
|
+
static [entityKind] = "QueryPromise";
|
|
87351
|
+
[Symbol.toStringTag] = "QueryPromise";
|
|
87352
|
+
catch(onRejected) {
|
|
87353
|
+
return this.then(undefined, onRejected);
|
|
87354
|
+
}
|
|
87355
|
+
finally(onFinally) {
|
|
87356
|
+
return this.then((value8) => {
|
|
87357
|
+
onFinally?.();
|
|
87358
|
+
return value8;
|
|
87359
|
+
}, (reason2) => {
|
|
87360
|
+
onFinally?.();
|
|
87361
|
+
throw reason2;
|
|
87362
|
+
});
|
|
87363
|
+
}
|
|
87364
|
+
then(onFulfilled, onRejected) {
|
|
87365
|
+
return this.execute().then(onFulfilled, onRejected);
|
|
87366
|
+
}
|
|
87367
|
+
};
|
|
87368
|
+
});
|
|
87369
|
+
|
|
87824
87370
|
// ../../node_modules/drizzle-orm/sqlite-core/query-builders/_query.js
|
|
87825
87371
|
var _RelationalQueryBuilder, SQLiteRelationalQuery, SQLiteSyncRelationalQuery;
|
|
87826
87372
|
var init__query = __esm(() => {
|
|
@@ -87852,7 +87398,7 @@ var init__query = __esm(() => {
|
|
|
87852
87398
|
} : { limit: 1 }, "first");
|
|
87853
87399
|
}
|
|
87854
87400
|
};
|
|
87855
|
-
SQLiteRelationalQuery = class extends
|
|
87401
|
+
SQLiteRelationalQuery = class extends QueryPromise2 {
|
|
87856
87402
|
static [entityKind] = "SQLiteAsyncRelationalQuery";
|
|
87857
87403
|
mode;
|
|
87858
87404
|
constructor(fullSchema, schema2, tableNamesMap, table2, tableConfig, dialect, session, config3, mode) {
|
|
@@ -87965,6 +87511,460 @@ var init_count = __esm(() => {
|
|
|
87965
87511
|
};
|
|
87966
87512
|
});
|
|
87967
87513
|
|
|
87514
|
+
// ../../node_modules/drizzle-orm/alias.js
|
|
87515
|
+
function aliasedTable2(table2, tableAlias) {
|
|
87516
|
+
return new Proxy(table2, new TableAliasProxyHandler2(tableAlias, false, false));
|
|
87517
|
+
}
|
|
87518
|
+
function aliasedColumn2(column, alias) {
|
|
87519
|
+
return new Proxy(column, new ColumnAliasProxyHandler2(alias));
|
|
87520
|
+
}
|
|
87521
|
+
function aliasedTableColumn2(column, tableAlias) {
|
|
87522
|
+
return new Proxy(column, new ColumnTableAliasProxyHandler2(new Proxy(column.table, new TableAliasProxyHandler2(tableAlias, false, false)), false));
|
|
87523
|
+
}
|
|
87524
|
+
function mapColumnsInAliasedSQLToAlias2(query, alias) {
|
|
87525
|
+
return new SQL.Aliased(mapColumnsInSQLToAlias2(query.sql, alias), query.fieldAlias);
|
|
87526
|
+
}
|
|
87527
|
+
function mapColumnsInSQLToAlias2(query, alias) {
|
|
87528
|
+
return sql.join(query.queryChunks.map((c) => {
|
|
87529
|
+
if (is6(c, Column))
|
|
87530
|
+
return aliasedTableColumn2(c, alias);
|
|
87531
|
+
if (is6(c, SQL))
|
|
87532
|
+
return mapColumnsInSQLToAlias2(c, alias);
|
|
87533
|
+
if (is6(c, SQL.Aliased))
|
|
87534
|
+
return mapColumnsInAliasedSQLToAlias2(c, alias);
|
|
87535
|
+
return c;
|
|
87536
|
+
}));
|
|
87537
|
+
}
|
|
87538
|
+
function getOriginalColumnFromAlias2(column) {
|
|
87539
|
+
return column[OriginalColumn]();
|
|
87540
|
+
}
|
|
87541
|
+
var ColumnTableAliasProxyHandler2, ViewSelectionAliasProxyHandler2, TableAliasProxyHandler2, ColumnAliasProxyHandler2;
|
|
87542
|
+
var init_alias = __esm(() => {
|
|
87543
|
+
init_column_common();
|
|
87544
|
+
init_entity();
|
|
87545
|
+
init_column();
|
|
87546
|
+
init_table();
|
|
87547
|
+
init_sql();
|
|
87548
|
+
init_subquery();
|
|
87549
|
+
init_view_common();
|
|
87550
|
+
ColumnTableAliasProxyHandler2 = class {
|
|
87551
|
+
static [entityKind] = "ColumnTableAliasProxyHandler";
|
|
87552
|
+
constructor(table2, ignoreColumnAlias) {
|
|
87553
|
+
this.table = table2;
|
|
87554
|
+
this.ignoreColumnAlias = ignoreColumnAlias;
|
|
87555
|
+
}
|
|
87556
|
+
get(columnObj, prop) {
|
|
87557
|
+
if (prop === "table")
|
|
87558
|
+
return this.table;
|
|
87559
|
+
if (prop === "isAlias" && this.ignoreColumnAlias)
|
|
87560
|
+
return false;
|
|
87561
|
+
return columnObj[prop];
|
|
87562
|
+
}
|
|
87563
|
+
};
|
|
87564
|
+
ViewSelectionAliasProxyHandler2 = class {
|
|
87565
|
+
static [entityKind] = "ViewSelectionAliasProxyHandler";
|
|
87566
|
+
constructor(view, selection, ignoreColumnAlias) {
|
|
87567
|
+
this.view = view;
|
|
87568
|
+
this.selection = selection;
|
|
87569
|
+
this.ignoreColumnAlias = ignoreColumnAlias;
|
|
87570
|
+
}
|
|
87571
|
+
get(selection, prop) {
|
|
87572
|
+
const value8 = selection[prop];
|
|
87573
|
+
if (is6(value8, Column))
|
|
87574
|
+
return new Proxy(value8, new ColumnTableAliasProxyHandler2(this.view, this.ignoreColumnAlias));
|
|
87575
|
+
if (is6(value8, Subquery) || is6(value8, SQL) || is6(value8, SQL.Aliased) || isSQLWrapper(value8) || typeof value8 !== "object" || value8 === null)
|
|
87576
|
+
return value8;
|
|
87577
|
+
return new Proxy(value8, this);
|
|
87578
|
+
}
|
|
87579
|
+
};
|
|
87580
|
+
TableAliasProxyHandler2 = class {
|
|
87581
|
+
static [entityKind] = "TableAliasProxyHandler";
|
|
87582
|
+
constructor(alias, replaceOriginalName, ignoreColumnAlias) {
|
|
87583
|
+
this.alias = alias;
|
|
87584
|
+
this.replaceOriginalName = replaceOriginalName;
|
|
87585
|
+
this.ignoreColumnAlias = ignoreColumnAlias;
|
|
87586
|
+
}
|
|
87587
|
+
get(target, prop) {
|
|
87588
|
+
if (prop === Table.Symbol.IsAlias)
|
|
87589
|
+
return true;
|
|
87590
|
+
if (prop === Table.Symbol.Name)
|
|
87591
|
+
return this.alias;
|
|
87592
|
+
if (this.replaceOriginalName && prop === Table.Symbol.OriginalName)
|
|
87593
|
+
return this.alias;
|
|
87594
|
+
if (prop === ViewBaseConfig)
|
|
87595
|
+
return {
|
|
87596
|
+
...target[ViewBaseConfig],
|
|
87597
|
+
name: this.alias,
|
|
87598
|
+
isAlias: true,
|
|
87599
|
+
selectedFields: new Proxy(target[ViewBaseConfig].selectedFields, new ViewSelectionAliasProxyHandler2(new Proxy(target, this), target[ViewBaseConfig].selectedFields, this.ignoreColumnAlias))
|
|
87600
|
+
};
|
|
87601
|
+
if (prop === Table.Symbol.Columns) {
|
|
87602
|
+
const columns = target[Table.Symbol.Columns];
|
|
87603
|
+
if (!columns)
|
|
87604
|
+
return columns;
|
|
87605
|
+
if (is6(target, View))
|
|
87606
|
+
return new Proxy(target[Table.Symbol.Columns], new ViewSelectionAliasProxyHandler2(new Proxy(target, this), target[Table.Symbol.Columns], this.ignoreColumnAlias));
|
|
87607
|
+
const proxiedColumns = {};
|
|
87608
|
+
Object.keys(columns).map((key) => {
|
|
87609
|
+
proxiedColumns[key] = new Proxy(columns[key], new ColumnTableAliasProxyHandler2(new Proxy(target, this), this.ignoreColumnAlias));
|
|
87610
|
+
});
|
|
87611
|
+
return proxiedColumns;
|
|
87612
|
+
}
|
|
87613
|
+
const value8 = target[prop];
|
|
87614
|
+
if (is6(value8, Column))
|
|
87615
|
+
return new Proxy(value8, new ColumnTableAliasProxyHandler2(new Proxy(target, this), this.ignoreColumnAlias));
|
|
87616
|
+
return value8;
|
|
87617
|
+
}
|
|
87618
|
+
};
|
|
87619
|
+
ColumnAliasProxyHandler2 = class {
|
|
87620
|
+
static [entityKind] = "ColumnAliasProxyHandler";
|
|
87621
|
+
constructor(alias) {
|
|
87622
|
+
this.alias = alias;
|
|
87623
|
+
}
|
|
87624
|
+
get(target, prop) {
|
|
87625
|
+
if (prop === "isAlias")
|
|
87626
|
+
return true;
|
|
87627
|
+
if (prop === "name")
|
|
87628
|
+
return this.alias;
|
|
87629
|
+
if (prop === "keyAsName")
|
|
87630
|
+
return false;
|
|
87631
|
+
if (prop === OriginalColumn)
|
|
87632
|
+
return () => target;
|
|
87633
|
+
return target[prop];
|
|
87634
|
+
}
|
|
87635
|
+
};
|
|
87636
|
+
Column.prototype.as = function(alias) {
|
|
87637
|
+
return aliasedColumn2(this, alias);
|
|
87638
|
+
};
|
|
87639
|
+
});
|
|
87640
|
+
|
|
87641
|
+
// ../../node_modules/drizzle-orm/errors.js
|
|
87642
|
+
var DrizzleError2, DrizzleQueryError2, TransactionRollbackError2;
|
|
87643
|
+
var init_errors4 = __esm(() => {
|
|
87644
|
+
init_entity();
|
|
87645
|
+
DrizzleError2 = class extends Error {
|
|
87646
|
+
static [entityKind] = "DrizzleError";
|
|
87647
|
+
constructor({ message, cause }) {
|
|
87648
|
+
super(message);
|
|
87649
|
+
this.name = "DrizzleError";
|
|
87650
|
+
this.cause = cause;
|
|
87651
|
+
}
|
|
87652
|
+
};
|
|
87653
|
+
DrizzleQueryError2 = class DrizzleQueryError3 extends Error {
|
|
87654
|
+
static [entityKind] = "DrizzleQueryError";
|
|
87655
|
+
constructor(query, params, cause) {
|
|
87656
|
+
super(`Failed query: ${query}
|
|
87657
|
+
params: ${params}`);
|
|
87658
|
+
this.query = query;
|
|
87659
|
+
this.params = params;
|
|
87660
|
+
this.cause = cause;
|
|
87661
|
+
Error.captureStackTrace(this, DrizzleQueryError3);
|
|
87662
|
+
if (cause)
|
|
87663
|
+
this.cause = cause;
|
|
87664
|
+
}
|
|
87665
|
+
};
|
|
87666
|
+
TransactionRollbackError2 = class extends DrizzleError2 {
|
|
87667
|
+
static [entityKind] = "TransactionRollbackError";
|
|
87668
|
+
constructor() {
|
|
87669
|
+
super({ message: "Rollback" });
|
|
87670
|
+
}
|
|
87671
|
+
};
|
|
87672
|
+
});
|
|
87673
|
+
|
|
87674
|
+
// ../../node_modules/drizzle-orm/relations.js
|
|
87675
|
+
function mapRelationalRow3(row, buildQueryResultSelection, mapColumnValue = (value8) => value8, parseJson2 = false, parseJsonIfString = false, path5) {
|
|
87676
|
+
for (const selectionItem of buildQueryResultSelection) {
|
|
87677
|
+
if (selectionItem.selection) {
|
|
87678
|
+
const currentPath = `${path5 ? `${path5}.` : ""}${selectionItem.key}`;
|
|
87679
|
+
if (row[selectionItem.key] === null)
|
|
87680
|
+
continue;
|
|
87681
|
+
if (parseJson2) {
|
|
87682
|
+
row[selectionItem.key] = JSON.parse(row[selectionItem.key]);
|
|
87683
|
+
if (row[selectionItem.key] === null)
|
|
87684
|
+
continue;
|
|
87685
|
+
}
|
|
87686
|
+
if (parseJsonIfString && typeof row[selectionItem.key] === "string")
|
|
87687
|
+
row[selectionItem.key] = JSON.parse(row[selectionItem.key]);
|
|
87688
|
+
if (selectionItem.isArray) {
|
|
87689
|
+
for (const item of row[selectionItem.key])
|
|
87690
|
+
mapRelationalRow3(item, selectionItem.selection, mapColumnValue, false, parseJsonIfString, currentPath);
|
|
87691
|
+
continue;
|
|
87692
|
+
}
|
|
87693
|
+
mapRelationalRow3(row[selectionItem.key], selectionItem.selection, mapColumnValue, false, parseJsonIfString, currentPath);
|
|
87694
|
+
continue;
|
|
87695
|
+
}
|
|
87696
|
+
const field = selectionItem.field;
|
|
87697
|
+
const value8 = mapColumnValue(row[selectionItem.key]);
|
|
87698
|
+
if (value8 === null)
|
|
87699
|
+
continue;
|
|
87700
|
+
let decoder2;
|
|
87701
|
+
if (is6(field, Column))
|
|
87702
|
+
decoder2 = field;
|
|
87703
|
+
else if (is6(field, SQL))
|
|
87704
|
+
decoder2 = field.decoder;
|
|
87705
|
+
else if (is6(field, SQL.Aliased))
|
|
87706
|
+
decoder2 = field.sql.decoder;
|
|
87707
|
+
else if (is6(field, Table) || is6(field, View))
|
|
87708
|
+
decoder2 = noopDecoder;
|
|
87709
|
+
else
|
|
87710
|
+
decoder2 = field.getSQL().decoder;
|
|
87711
|
+
row[selectionItem.key] = "mapFromJsonValue" in decoder2 ? decoder2.mapFromJsonValue(value8) : decoder2.mapFromDriverValue(value8);
|
|
87712
|
+
}
|
|
87713
|
+
return row;
|
|
87714
|
+
}
|
|
87715
|
+
function fieldSelectionToSQL2(table2, target) {
|
|
87716
|
+
const field = table2[TableColumns][target];
|
|
87717
|
+
return field ? is6(field, Column) ? field : is6(field, SQL.Aliased) ? sql`${table2}.${sql.identifier(field.fieldAlias)}` : sql`${table2}.${sql.identifier(target)}` : sql`${table2}.${sql.identifier(target)}`;
|
|
87718
|
+
}
|
|
87719
|
+
function relationsFieldFilterToSQL(column, filter21) {
|
|
87720
|
+
if (typeof filter21 !== "object" || is6(filter21, Placeholder))
|
|
87721
|
+
return eq(column, filter21);
|
|
87722
|
+
const entries10 = Object.entries(filter21);
|
|
87723
|
+
if (!entries10.length)
|
|
87724
|
+
return;
|
|
87725
|
+
const parts3 = [];
|
|
87726
|
+
for (const [target, value8] of entries10) {
|
|
87727
|
+
if (value8 === undefined)
|
|
87728
|
+
continue;
|
|
87729
|
+
switch (target) {
|
|
87730
|
+
case "NOT": {
|
|
87731
|
+
const res = relationsFieldFilterToSQL(column, value8);
|
|
87732
|
+
if (!res)
|
|
87733
|
+
continue;
|
|
87734
|
+
parts3.push(not5(res));
|
|
87735
|
+
continue;
|
|
87736
|
+
}
|
|
87737
|
+
case "OR":
|
|
87738
|
+
if (!value8.length)
|
|
87739
|
+
continue;
|
|
87740
|
+
parts3.push(or5(...value8.map((subFilter) => relationsFieldFilterToSQL(column, subFilter))));
|
|
87741
|
+
continue;
|
|
87742
|
+
case "AND":
|
|
87743
|
+
if (!value8.length)
|
|
87744
|
+
continue;
|
|
87745
|
+
parts3.push(and3(...value8.map((subFilter) => relationsFieldFilterToSQL(column, subFilter))));
|
|
87746
|
+
continue;
|
|
87747
|
+
case "isNotNull":
|
|
87748
|
+
case "isNull":
|
|
87749
|
+
if (!value8)
|
|
87750
|
+
continue;
|
|
87751
|
+
parts3.push(operators2[target](column));
|
|
87752
|
+
continue;
|
|
87753
|
+
case "in":
|
|
87754
|
+
parts3.push(operators2.inArray(column, value8));
|
|
87755
|
+
continue;
|
|
87756
|
+
case "notIn":
|
|
87757
|
+
parts3.push(operators2.notInArray(column, value8));
|
|
87758
|
+
continue;
|
|
87759
|
+
default:
|
|
87760
|
+
parts3.push(operators2[target](column, value8));
|
|
87761
|
+
continue;
|
|
87762
|
+
}
|
|
87763
|
+
}
|
|
87764
|
+
if (!parts3.length)
|
|
87765
|
+
return;
|
|
87766
|
+
return and3(...parts3);
|
|
87767
|
+
}
|
|
87768
|
+
function relationsFilterToSQL2(table2, filter21, tableRelations = {}, tablesRelations = {}, casing, depth = 0) {
|
|
87769
|
+
const entries10 = Object.entries(filter21);
|
|
87770
|
+
if (!entries10.length)
|
|
87771
|
+
return;
|
|
87772
|
+
const parts3 = [];
|
|
87773
|
+
for (const [target, value8] of entries10) {
|
|
87774
|
+
if (value8 === undefined)
|
|
87775
|
+
continue;
|
|
87776
|
+
switch (target) {
|
|
87777
|
+
case "RAW": {
|
|
87778
|
+
const processed = typeof value8 === "function" ? value8(table2, operators2) : value8.getSQL();
|
|
87779
|
+
parts3.push(processed);
|
|
87780
|
+
continue;
|
|
87781
|
+
}
|
|
87782
|
+
case "OR":
|
|
87783
|
+
if (!value8?.length)
|
|
87784
|
+
continue;
|
|
87785
|
+
parts3.push(or5(...value8.map((subFilter) => relationsFilterToSQL2(table2, subFilter, tableRelations, tablesRelations, casing, depth))));
|
|
87786
|
+
continue;
|
|
87787
|
+
case "AND":
|
|
87788
|
+
if (!value8?.length)
|
|
87789
|
+
continue;
|
|
87790
|
+
parts3.push(and3(...value8.map((subFilter) => relationsFilterToSQL2(table2, subFilter, tableRelations, tablesRelations, casing, depth))));
|
|
87791
|
+
continue;
|
|
87792
|
+
case "NOT": {
|
|
87793
|
+
if (value8 === undefined)
|
|
87794
|
+
continue;
|
|
87795
|
+
const built = relationsFilterToSQL2(table2, value8, tableRelations, tablesRelations, casing, depth);
|
|
87796
|
+
if (!built)
|
|
87797
|
+
continue;
|
|
87798
|
+
parts3.push(not5(built));
|
|
87799
|
+
continue;
|
|
87800
|
+
}
|
|
87801
|
+
default: {
|
|
87802
|
+
if (table2[TableColumns][target]) {
|
|
87803
|
+
const colFilter = relationsFieldFilterToSQL(fieldSelectionToSQL2(table2, target), value8);
|
|
87804
|
+
if (colFilter)
|
|
87805
|
+
parts3.push(colFilter);
|
|
87806
|
+
continue;
|
|
87807
|
+
}
|
|
87808
|
+
const relation = tableRelations[target];
|
|
87809
|
+
if (!relation)
|
|
87810
|
+
throw new DrizzleError2({ message: `Unknown relational filter field: "${target}"` });
|
|
87811
|
+
const targetTable = aliasedTable2(relation.targetTable, `f${depth}`);
|
|
87812
|
+
const throughTable = relation.throughTable ? aliasedTable2(relation.throughTable, `ft${depth}`) : undefined;
|
|
87813
|
+
const targetConfig = tablesRelations[relation.targetTableName];
|
|
87814
|
+
const { filter: relationFilter, joinCondition } = relationToSQL2(casing, relation, table2, targetTable, throughTable);
|
|
87815
|
+
const filter22 = and3(relationFilter, typeof value8 === "boolean" ? undefined : relationsFilterToSQL2(targetTable, value8, targetConfig.relations, tablesRelations, casing, depth + 1));
|
|
87816
|
+
const subquery = throughTable ? sql`(select * from ${getTableAsAliasSQL2(targetTable)} inner join ${getTableAsAliasSQL2(throughTable)} on ${joinCondition}${sql` where ${filter22}`.if(filter22)} limit 1)` : sql`(select * from ${getTableAsAliasSQL2(targetTable)}${sql` where ${filter22}`.if(filter22)} limit 1)`;
|
|
87817
|
+
if (filter22)
|
|
87818
|
+
parts3.push((value8 ? exists2 : notExists)(subquery));
|
|
87819
|
+
}
|
|
87820
|
+
}
|
|
87821
|
+
}
|
|
87822
|
+
return and3(...parts3);
|
|
87823
|
+
}
|
|
87824
|
+
function relationsOrderToSQL2(table2, orders) {
|
|
87825
|
+
if (typeof orders === "function") {
|
|
87826
|
+
const data2 = orders(table2, orderByOperators2);
|
|
87827
|
+
return is6(data2, SQL) ? data2 : Array.isArray(data2) ? data2.length ? sql.join(data2.map((o) => is6(o, SQL) ? o : asc(o)), sql`, `) : undefined : is6(data2, Column) ? asc(data2) : undefined;
|
|
87828
|
+
}
|
|
87829
|
+
const entries10 = Object.entries(orders).filter(([_2, value8]) => value8);
|
|
87830
|
+
if (!entries10.length)
|
|
87831
|
+
return;
|
|
87832
|
+
return sql.join(entries10.map(([target, value8]) => (value8 === "asc" ? asc : desc)(fieldSelectionToSQL2(table2, target))), sql`, `);
|
|
87833
|
+
}
|
|
87834
|
+
function relationExtrasToSQL2(table2, extras) {
|
|
87835
|
+
const subqueries = [];
|
|
87836
|
+
const selection = [];
|
|
87837
|
+
for (const [key, field] of Object.entries(extras)) {
|
|
87838
|
+
if (!field)
|
|
87839
|
+
continue;
|
|
87840
|
+
const extra = typeof field === "function" ? field(table2, { sql: operators2.sql }) : field;
|
|
87841
|
+
const query = sql`(${extra.getSQL()}) as ${sql.identifier(key)}`;
|
|
87842
|
+
query.decoder = extra.getSQL().decoder;
|
|
87843
|
+
subqueries.push(query);
|
|
87844
|
+
selection.push({
|
|
87845
|
+
key,
|
|
87846
|
+
field: query
|
|
87847
|
+
});
|
|
87848
|
+
}
|
|
87849
|
+
return {
|
|
87850
|
+
sql: subqueries.length ? sql.join(subqueries, sql`, `) : undefined,
|
|
87851
|
+
selection
|
|
87852
|
+
};
|
|
87853
|
+
}
|
|
87854
|
+
function relationToSQL2(casing, relation, sourceTable, targetTable, throughTable) {
|
|
87855
|
+
if (relation.through) {
|
|
87856
|
+
const outerColumnWhere = relation.sourceColumns.map((s, i2) => {
|
|
87857
|
+
const t = relation.through.source[i2];
|
|
87858
|
+
return eq(sql`${sourceTable}.${sql.identifier(casing.getColumnCasing(s))}`, sql`${throughTable}.${sql.identifier(is6(t._.column, Column) ? casing.getColumnCasing(t._.column) : t._.key)}`);
|
|
87859
|
+
});
|
|
87860
|
+
const innerColumnWhere = relation.targetColumns.map((s, i2) => {
|
|
87861
|
+
const t = relation.through.target[i2];
|
|
87862
|
+
return eq(sql`${throughTable}.${sql.identifier(is6(t._.column, Column) ? casing.getColumnCasing(t._.column) : t._.key)}`, sql`${targetTable}.${sql.identifier(casing.getColumnCasing(s))}`);
|
|
87863
|
+
});
|
|
87864
|
+
return {
|
|
87865
|
+
filter: and3(relation.where ? relationsFilterToSQL2(relation.isReversed ? sourceTable : targetTable, relation.where) : undefined, ...outerColumnWhere),
|
|
87866
|
+
joinCondition: and3(...innerColumnWhere)
|
|
87867
|
+
};
|
|
87868
|
+
}
|
|
87869
|
+
return { filter: and3(...relation.sourceColumns.map((s, i2) => {
|
|
87870
|
+
const t = relation.targetColumns[i2];
|
|
87871
|
+
return eq(sql`${sourceTable}.${sql.identifier(casing.getColumnCasing(s))}`, sql`${targetTable}.${sql.identifier(casing.getColumnCasing(t))}`);
|
|
87872
|
+
}), relation.where ? relationsFilterToSQL2(relation.isReversed ? sourceTable : targetTable, relation.where) : undefined) };
|
|
87873
|
+
}
|
|
87874
|
+
function getTableAsAliasSQL2(table2) {
|
|
87875
|
+
return sql`${table2[IsAlias] ? sql`${sql`${sql.identifier(table2[TableSchema] ?? "")}.`.if(table2[TableSchema])}${sql.identifier(table2[OriginalName])} as ${table2}` : table2}`;
|
|
87876
|
+
}
|
|
87877
|
+
var Relation3, One4, operators2, orderByOperators2;
|
|
87878
|
+
var init_relations = __esm(() => {
|
|
87879
|
+
init_entity();
|
|
87880
|
+
init_column();
|
|
87881
|
+
init_sql();
|
|
87882
|
+
init_alias();
|
|
87883
|
+
init_errors4();
|
|
87884
|
+
init_conditions();
|
|
87885
|
+
init_select();
|
|
87886
|
+
init_table();
|
|
87887
|
+
Relation3 = class {
|
|
87888
|
+
static [entityKind] = "RelationV2";
|
|
87889
|
+
fieldName;
|
|
87890
|
+
sourceColumns;
|
|
87891
|
+
targetColumns;
|
|
87892
|
+
alias;
|
|
87893
|
+
where;
|
|
87894
|
+
sourceTable;
|
|
87895
|
+
targetTable;
|
|
87896
|
+
through;
|
|
87897
|
+
throughTable;
|
|
87898
|
+
isReversed;
|
|
87899
|
+
sourceColumnTableNames = [];
|
|
87900
|
+
targetColumnTableNames = [];
|
|
87901
|
+
constructor(targetTable, targetTableName) {
|
|
87902
|
+
this.targetTableName = targetTableName;
|
|
87903
|
+
this.targetTable = targetTable;
|
|
87904
|
+
}
|
|
87905
|
+
};
|
|
87906
|
+
One4 = class extends Relation3 {
|
|
87907
|
+
static [entityKind] = "OneV2";
|
|
87908
|
+
relationType = "one";
|
|
87909
|
+
optional;
|
|
87910
|
+
constructor(tables, targetTable, targetTableName, config3) {
|
|
87911
|
+
super(targetTable, targetTableName);
|
|
87912
|
+
this.alias = config3?.alias;
|
|
87913
|
+
this.where = config3?.where;
|
|
87914
|
+
if (config3?.from)
|
|
87915
|
+
this.sourceColumns = (Array.isArray(config3.from) ? config3.from : [config3.from]).map((it2) => {
|
|
87916
|
+
this.throughTable ??= it2._.through ? tables[it2._.through._.tableName] : undefined;
|
|
87917
|
+
this.sourceColumnTableNames.push(it2._.tableName);
|
|
87918
|
+
return it2._.column;
|
|
87919
|
+
});
|
|
87920
|
+
if (config3?.to)
|
|
87921
|
+
this.targetColumns = (Array.isArray(config3.to) ? config3.to : [config3.to]).map((it2) => {
|
|
87922
|
+
this.throughTable ??= it2._.through ? tables[it2._.through._.tableName] : undefined;
|
|
87923
|
+
this.targetColumnTableNames.push(it2._.tableName);
|
|
87924
|
+
return it2._.column;
|
|
87925
|
+
});
|
|
87926
|
+
if (this.throughTable)
|
|
87927
|
+
this.through = {
|
|
87928
|
+
source: (Array.isArray(config3?.from) ? config3.from : (config3?.from) ? [config3.from] : []).map((c) => c._.through),
|
|
87929
|
+
target: (Array.isArray(config3?.to) ? config3.to : (config3?.to) ? [config3.to] : []).map((c) => c._.through)
|
|
87930
|
+
};
|
|
87931
|
+
this.optional = config3?.optional ?? true;
|
|
87932
|
+
}
|
|
87933
|
+
};
|
|
87934
|
+
operators2 = {
|
|
87935
|
+
and: and3,
|
|
87936
|
+
between: between7,
|
|
87937
|
+
eq,
|
|
87938
|
+
exists: exists2,
|
|
87939
|
+
gt: gt2,
|
|
87940
|
+
gte: gte2,
|
|
87941
|
+
ilike,
|
|
87942
|
+
inArray,
|
|
87943
|
+
arrayContains,
|
|
87944
|
+
arrayContained,
|
|
87945
|
+
arrayOverlaps,
|
|
87946
|
+
isNull: isNull3,
|
|
87947
|
+
isNotNull: isNotNull2,
|
|
87948
|
+
like,
|
|
87949
|
+
lt: lt2,
|
|
87950
|
+
lte: lte2,
|
|
87951
|
+
ne: ne2,
|
|
87952
|
+
not: not5,
|
|
87953
|
+
notBetween,
|
|
87954
|
+
notExists,
|
|
87955
|
+
notLike,
|
|
87956
|
+
notIlike,
|
|
87957
|
+
notInArray,
|
|
87958
|
+
or: or5,
|
|
87959
|
+
sql
|
|
87960
|
+
};
|
|
87961
|
+
orderByOperators2 = {
|
|
87962
|
+
sql,
|
|
87963
|
+
asc,
|
|
87964
|
+
desc
|
|
87965
|
+
};
|
|
87966
|
+
});
|
|
87967
|
+
|
|
87968
87968
|
// ../../node_modules/drizzle-orm/sqlite-core/query-builders/query.js
|
|
87969
87969
|
var RelationalQueryBuilder, SQLiteRelationalQuery2, SQLiteSyncRelationalQuery2;
|
|
87970
87970
|
var init_query = __esm(() => {
|
|
@@ -87991,7 +87991,7 @@ var init_query = __esm(() => {
|
|
|
87991
87991
|
return this.mode === "sync" ? new SQLiteSyncRelationalQuery2(this.schema, this.table, this.tableConfig, this.dialect, this.session, config3 ?? true, "first", this.rowMode, this.forbidJsonb) : new SQLiteRelationalQuery2(this.schema, this.table, this.tableConfig, this.dialect, this.session, config3 ?? true, "first", this.rowMode, this.forbidJsonb);
|
|
87992
87992
|
}
|
|
87993
87993
|
};
|
|
87994
|
-
SQLiteRelationalQuery2 = class extends
|
|
87994
|
+
SQLiteRelationalQuery2 = class extends QueryPromise2 {
|
|
87995
87995
|
static [entityKind] = "SQLiteAsyncRelationalQueryV2";
|
|
87996
87996
|
mode;
|
|
87997
87997
|
table;
|
|
@@ -88020,7 +88020,7 @@ var init_query = __esm(() => {
|
|
|
88020
88020
|
_prepare(isOneTimeQuery = true) {
|
|
88021
88021
|
const { query, builtQuery } = this._toSQL();
|
|
88022
88022
|
return this.session[isOneTimeQuery ? "prepareOneTimeRelationalQuery" : "prepareRelationalQuery"](builtQuery, undefined, this.mode === "first" ? "get" : "all", (rawRows, mapColumnValue) => {
|
|
88023
|
-
const rows = rawRows.map((row) =>
|
|
88023
|
+
const rows = rawRows.map((row) => mapRelationalRow3(row, query.selection, mapColumnValue, !this.rowMode));
|
|
88024
88024
|
if (this.mode === "first")
|
|
88025
88025
|
return rows[0];
|
|
88026
88026
|
return rows;
|
|
@@ -88078,7 +88078,7 @@ var SQLiteRaw;
|
|
|
88078
88078
|
var init_raw = __esm(() => {
|
|
88079
88079
|
init_entity();
|
|
88080
88080
|
init_query_promise();
|
|
88081
|
-
SQLiteRaw = class extends
|
|
88081
|
+
SQLiteRaw = class extends QueryPromise2 {
|
|
88082
88082
|
static [entityKind] = "SQLiteRaw";
|
|
88083
88083
|
config;
|
|
88084
88084
|
constructor(execute2, getSQL, action, dialect, mapBatchResult) {
|
|
@@ -88151,7 +88151,7 @@ var init_selection_proxy = __esm(() => {
|
|
|
88151
88151
|
}
|
|
88152
88152
|
if (is6(value8, Column)) {
|
|
88153
88153
|
if (this.config.alias)
|
|
88154
|
-
return new Proxy(value8, new
|
|
88154
|
+
return new Proxy(value8, new ColumnTableAliasProxyHandler2(new Proxy(value8.table, new TableAliasProxyHandler2(this.config.alias, this.config.replaceOriginalName ?? false, true)), true));
|
|
88155
88155
|
return value8;
|
|
88156
88156
|
}
|
|
88157
88157
|
if (typeof value8 !== "object" || value8 === null)
|
|
@@ -88189,7 +88189,7 @@ var init_delete = __esm(() => {
|
|
|
88189
88189
|
init_query_promise();
|
|
88190
88190
|
init_selection_proxy();
|
|
88191
88191
|
init_table2();
|
|
88192
|
-
SQLiteDeleteBase = class extends
|
|
88192
|
+
SQLiteDeleteBase = class extends QueryPromise2 {
|
|
88193
88193
|
static [entityKind] = "SQLiteDelete";
|
|
88194
88194
|
config;
|
|
88195
88195
|
constructor(table2, session, dialect, withList) {
|
|
@@ -88225,7 +88225,7 @@ var init_delete = __esm(() => {
|
|
|
88225
88225
|
return this;
|
|
88226
88226
|
}
|
|
88227
88227
|
returning(fields = this.table[SQLiteTable.Symbol.Columns]) {
|
|
88228
|
-
this.config.returning =
|
|
88228
|
+
this.config.returning = orderSelectedFields2(fields);
|
|
88229
88229
|
return this;
|
|
88230
88230
|
}
|
|
88231
88231
|
getSQL() {
|
|
@@ -88296,7 +88296,7 @@ function createSetOperator(type3, isAll) {
|
|
|
88296
88296
|
rightSelect: select
|
|
88297
88297
|
}));
|
|
88298
88298
|
for (const setOperator of setOperators)
|
|
88299
|
-
if (!
|
|
88299
|
+
if (!haveSameKeys2(leftSelect.getSelectedFields(), setOperator.rightSelect.getSelectedFields()))
|
|
88300
88300
|
throw new Error("Set operator error (union / intersect / except): selected fields are not the same or are in a different order");
|
|
88301
88301
|
return leftSelect.addSetOperators(setOperators);
|
|
88302
88302
|
};
|
|
@@ -88345,7 +88345,7 @@ var init_select2 = __esm(() => {
|
|
|
88345
88345
|
else if (is6(source, SQL))
|
|
88346
88346
|
fields = {};
|
|
88347
88347
|
else
|
|
88348
|
-
fields =
|
|
88348
|
+
fields = getTableColumns2(source);
|
|
88349
88349
|
return new SQLiteSelectBase({
|
|
88350
88350
|
table: source,
|
|
88351
88351
|
fields,
|
|
@@ -88384,7 +88384,7 @@ var init_select2 = __esm(() => {
|
|
|
88384
88384
|
selectedFields: fields,
|
|
88385
88385
|
config: this.config
|
|
88386
88386
|
};
|
|
88387
|
-
this.tableName =
|
|
88387
|
+
this.tableName = getTableLikeName2(table2);
|
|
88388
88388
|
this.joinsNotNullableMap = typeof this.tableName === "string" ? { [this.tableName]: true } : {};
|
|
88389
88389
|
for (const item of extractUsedTable(table2))
|
|
88390
88390
|
this.usedTables.add(item);
|
|
@@ -88395,7 +88395,7 @@ var init_select2 = __esm(() => {
|
|
|
88395
88395
|
createJoin(joinType) {
|
|
88396
88396
|
return (table2, on) => {
|
|
88397
88397
|
const baseTableName = this.tableName;
|
|
88398
|
-
const tableName =
|
|
88398
|
+
const tableName = getTableLikeName2(table2);
|
|
88399
88399
|
for (const item of extractUsedTable(table2))
|
|
88400
88400
|
this.usedTables.add(item);
|
|
88401
88401
|
if (typeof tableName === "string" && this.config.joins?.some((join9) => join9.alias === tableName))
|
|
@@ -88450,7 +88450,7 @@ var init_select2 = __esm(() => {
|
|
|
88450
88450
|
createSetOperator(type3, isAll) {
|
|
88451
88451
|
return (rightSelection) => {
|
|
88452
88452
|
const rightSelect = typeof rightSelection === "function" ? rightSelection(getSQLiteSetOperators()) : rightSelection;
|
|
88453
|
-
if (!
|
|
88453
|
+
if (!haveSameKeys2(this.getSelectedFields(), rightSelect.getSelectedFields()))
|
|
88454
88454
|
throw new Error("Set operator error (union / intersect / except): selected fields are not the same or are in a different order");
|
|
88455
88455
|
this.config.setOperators.push({
|
|
88456
88456
|
type: type3,
|
|
@@ -88566,7 +88566,7 @@ var init_select2 = __esm(() => {
|
|
|
88566
88566
|
_prepare(isOneTimeQuery = true) {
|
|
88567
88567
|
if (!this.session)
|
|
88568
88568
|
throw new Error("Cannot execute a query on a query builder. Please use a database instance instead.");
|
|
88569
|
-
const fieldsList =
|
|
88569
|
+
const fieldsList = orderSelectedFields2(this.config.fields);
|
|
88570
88570
|
const query = this.session[isOneTimeQuery ? "prepareOneTimeQuery" : "prepareQuery"](this.dialect.sqlToQuery(this.getSQL()), fieldsList, "all", true, undefined, {
|
|
88571
88571
|
type: "select",
|
|
88572
88572
|
tables: [...this.usedTables]
|
|
@@ -88605,7 +88605,7 @@ var init_select2 = __esm(() => {
|
|
|
88605
88605
|
return this.all();
|
|
88606
88606
|
}
|
|
88607
88607
|
};
|
|
88608
|
-
|
|
88608
|
+
applyMixins2(SQLiteSelectBase, [QueryPromise2]);
|
|
88609
88609
|
union12 = createSetOperator("union", false);
|
|
88610
88610
|
unionAll = createSetOperator("union", true);
|
|
88611
88611
|
intersect = createSetOperator("intersect", false);
|
|
@@ -88889,13 +88889,13 @@ var init_dialect = __esm(() => {
|
|
|
88889
88889
|
} else if (is6(field, Column))
|
|
88890
88890
|
if (field.columnType === "SQLiteNumericBigInt")
|
|
88891
88891
|
if (isSingleTable)
|
|
88892
|
-
chunk.push(field.isAlias ? sql`cast(${sql.identifier(this.casing.getColumnCasing(
|
|
88892
|
+
chunk.push(field.isAlias ? sql`cast(${sql.identifier(this.casing.getColumnCasing(getOriginalColumnFromAlias2(field)))} as text) as ${field}` : sql`cast(${sql.identifier(this.casing.getColumnCasing(field))} as text)`);
|
|
88893
88893
|
else
|
|
88894
|
-
chunk.push(field.isAlias ? sql`cast(${
|
|
88894
|
+
chunk.push(field.isAlias ? sql`cast(${getOriginalColumnFromAlias2(field)} as text) as ${field}` : sql`cast(${field} as text)`);
|
|
88895
88895
|
else if (isSingleTable)
|
|
88896
|
-
chunk.push(field.isAlias ? sql`${sql.identifier(this.casing.getColumnCasing(
|
|
88896
|
+
chunk.push(field.isAlias ? sql`${sql.identifier(this.casing.getColumnCasing(getOriginalColumnFromAlias2(field)))} as ${field}` : sql.identifier(this.casing.getColumnCasing(field)));
|
|
88897
88897
|
else
|
|
88898
|
-
chunk.push(field.isAlias ? sql`${
|
|
88898
|
+
chunk.push(field.isAlias ? sql`${getOriginalColumnFromAlias2(field)} as ${field}` : field);
|
|
88899
88899
|
else if (is6(field, Subquery)) {
|
|
88900
88900
|
const entries10 = Object.entries(field._.selectedFields);
|
|
88901
88901
|
if (entries10.length === 1) {
|
|
@@ -88960,7 +88960,7 @@ var init_dialect = __esm(() => {
|
|
|
88960
88960
|
return table2;
|
|
88961
88961
|
}
|
|
88962
88962
|
buildSelectQuery({ withList, fields, fieldsFlat, where, having, table: table2, joins, orderBy, groupBy: groupBy4, limit, offset, distinct, setOperators }) {
|
|
88963
|
-
const fieldsList = fieldsFlat ??
|
|
88963
|
+
const fieldsList = fieldsFlat ?? orderSelectedFields2(fields);
|
|
88964
88964
|
for (const f of fieldsList)
|
|
88965
88965
|
if (is6(f.field, Column) && getTableName(f.field.table) !== (is6(table2, Subquery) ? table2._.alias : is6(table2, SQLiteViewBase) ? table2[ViewBaseConfig].name : is6(table2, SQL) ? undefined : getTableName(table2)) && !((table3) => joins?.some(({ alias }) => alias === (table3[Table.Symbol.IsAlias] ? getTableName(table3) : table3[Table.Symbol.BaseName])))(f.field.table)) {
|
|
88966
88966
|
const tableName = getTableName(f.field.table);
|
|
@@ -89086,16 +89086,16 @@ var init_dialect = __esm(() => {
|
|
|
89086
89086
|
selection = Object.entries(tableConfig.columns).map(([key, value8]) => ({
|
|
89087
89087
|
dbKey: value8.name,
|
|
89088
89088
|
tsKey: key,
|
|
89089
|
-
field:
|
|
89089
|
+
field: aliasedTableColumn2(value8, tableAlias),
|
|
89090
89090
|
relationTableTsKey: undefined,
|
|
89091
89091
|
isJson: false,
|
|
89092
89092
|
selection: []
|
|
89093
89093
|
}));
|
|
89094
89094
|
else {
|
|
89095
|
-
const aliasedColumns = Object.fromEntries(Object.entries(tableConfig.columns).map(([key, value8]) => [key,
|
|
89095
|
+
const aliasedColumns = Object.fromEntries(Object.entries(tableConfig.columns).map(([key, value8]) => [key, aliasedTableColumn2(value8, tableAlias)]));
|
|
89096
89096
|
if (config3.where) {
|
|
89097
89097
|
const whereSql = typeof config3.where === "function" ? config3.where(aliasedColumns, getOperators()) : config3.where;
|
|
89098
|
-
where = whereSql &&
|
|
89098
|
+
where = whereSql && mapColumnsInSQLToAlias2(whereSql, tableAlias);
|
|
89099
89099
|
}
|
|
89100
89100
|
const fieldsSelection = [];
|
|
89101
89101
|
let selectedColumns = [];
|
|
@@ -89134,25 +89134,25 @@ var init_dialect = __esm(() => {
|
|
|
89134
89134
|
for (const [tsKey, value8] of Object.entries(extras))
|
|
89135
89135
|
fieldsSelection.push({
|
|
89136
89136
|
tsKey,
|
|
89137
|
-
value:
|
|
89137
|
+
value: mapColumnsInAliasedSQLToAlias2(value8, tableAlias)
|
|
89138
89138
|
});
|
|
89139
89139
|
}
|
|
89140
89140
|
for (const { tsKey, value: value8 } of fieldsSelection)
|
|
89141
89141
|
selection.push({
|
|
89142
89142
|
dbKey: is6(value8, SQL.Aliased) ? value8.fieldAlias : tableConfig.columns[tsKey].name,
|
|
89143
89143
|
tsKey,
|
|
89144
|
-
field: is6(value8, Column) ?
|
|
89144
|
+
field: is6(value8, Column) ? aliasedTableColumn2(value8, tableAlias) : value8,
|
|
89145
89145
|
relationTableTsKey: undefined,
|
|
89146
89146
|
isJson: false,
|
|
89147
89147
|
selection: []
|
|
89148
89148
|
});
|
|
89149
|
-
let orderByOrig = typeof config3.orderBy === "function" ? config3.orderBy(aliasedColumns,
|
|
89149
|
+
let orderByOrig = typeof config3.orderBy === "function" ? config3.orderBy(aliasedColumns, getOrderByOperators2()) : config3.orderBy ?? [];
|
|
89150
89150
|
if (!Array.isArray(orderByOrig))
|
|
89151
89151
|
orderByOrig = [orderByOrig];
|
|
89152
89152
|
orderBy = orderByOrig.map((orderByValue) => {
|
|
89153
89153
|
if (is6(orderByValue, Column))
|
|
89154
|
-
return
|
|
89155
|
-
return
|
|
89154
|
+
return aliasedTableColumn2(orderByValue, tableAlias);
|
|
89155
|
+
return mapColumnsInSQLToAlias2(orderByValue, tableAlias);
|
|
89156
89156
|
});
|
|
89157
89157
|
limit = config3.limit;
|
|
89158
89158
|
offset = config3.offset;
|
|
@@ -89160,7 +89160,7 @@ var init_dialect = __esm(() => {
|
|
|
89160
89160
|
const normalizedRelation = normalizeRelation(schema2, tableNamesMap, relation);
|
|
89161
89161
|
const relationTableTsName = tableNamesMap[getTableUniqueName(relation.referencedTable)];
|
|
89162
89162
|
const relationTableAlias = `${tableAlias}_${selectedRelationTsKey}`;
|
|
89163
|
-
const joinOn2 = and3(...normalizedRelation.fields.map((field2, i2) => eq(
|
|
89163
|
+
const joinOn2 = and3(...normalizedRelation.fields.map((field2, i2) => eq(aliasedTableColumn2(normalizedRelation.references[i2], relationTableAlias), aliasedTableColumn2(field2, tableAlias))));
|
|
89164
89164
|
const builtRelation = this._buildRelationalQuery({
|
|
89165
89165
|
fullSchema,
|
|
89166
89166
|
schema: schema2,
|
|
@@ -89187,12 +89187,12 @@ var init_dialect = __esm(() => {
|
|
|
89187
89187
|
}
|
|
89188
89188
|
}
|
|
89189
89189
|
if (selection.length === 0)
|
|
89190
|
-
throw new
|
|
89190
|
+
throw new DrizzleError2({ message: `No fields selected for table "${tableConfig.tsName}" ("${tableAlias}"). You need to have at least one item in "columns", "with" or "extras". If you need to select all columns, omit the "columns" key or set it to undefined.` });
|
|
89191
89191
|
let result6;
|
|
89192
89192
|
where = and3(joinOn, where);
|
|
89193
89193
|
if (nestedQueryRelation) {
|
|
89194
89194
|
let field = sql`json_array(${sql.join(selection.map(({ field: field2 }) => is6(field2, SQLiteColumn) ? sql.identifier(this.casing.getColumnCasing(field2)) : is6(field2, SQL.Aliased) ? field2.sql : field2), sql`, `)})`;
|
|
89195
|
-
if (is6(nestedQueryRelation,
|
|
89195
|
+
if (is6(nestedQueryRelation, Many2))
|
|
89196
89196
|
field = sql`coalesce(json_group_array(${field}), json_array())`;
|
|
89197
89197
|
const nestedSelection = [{
|
|
89198
89198
|
dbKey: "data",
|
|
@@ -89204,7 +89204,7 @@ var init_dialect = __esm(() => {
|
|
|
89204
89204
|
}];
|
|
89205
89205
|
if (limit !== undefined || offset !== undefined || orderBy.length > 0) {
|
|
89206
89206
|
result6 = this.buildSelectQuery({
|
|
89207
|
-
table:
|
|
89207
|
+
table: aliasedTable2(table2, tableAlias),
|
|
89208
89208
|
fields: {},
|
|
89209
89209
|
fieldsFlat: [{
|
|
89210
89210
|
path: [],
|
|
@@ -89221,13 +89221,13 @@ var init_dialect = __esm(() => {
|
|
|
89221
89221
|
offset = undefined;
|
|
89222
89222
|
orderBy = undefined;
|
|
89223
89223
|
} else
|
|
89224
|
-
result6 =
|
|
89224
|
+
result6 = aliasedTable2(table2, tableAlias);
|
|
89225
89225
|
result6 = this.buildSelectQuery({
|
|
89226
89226
|
table: is6(result6, SQLiteTable) ? result6 : new Subquery(result6, {}, tableAlias),
|
|
89227
89227
|
fields: {},
|
|
89228
89228
|
fieldsFlat: nestedSelection.map(({ field: field2 }) => ({
|
|
89229
89229
|
path: [],
|
|
89230
|
-
field: is6(field2, Column) ?
|
|
89230
|
+
field: is6(field2, Column) ? aliasedTableColumn2(field2, tableAlias) : field2
|
|
89231
89231
|
})),
|
|
89232
89232
|
joins,
|
|
89233
89233
|
where,
|
|
@@ -89238,11 +89238,11 @@ var init_dialect = __esm(() => {
|
|
|
89238
89238
|
});
|
|
89239
89239
|
} else
|
|
89240
89240
|
result6 = this.buildSelectQuery({
|
|
89241
|
-
table:
|
|
89241
|
+
table: aliasedTable2(table2, tableAlias),
|
|
89242
89242
|
fields: {},
|
|
89243
89243
|
fieldsFlat: selection.map(({ field }) => ({
|
|
89244
89244
|
path: [],
|
|
89245
|
-
field: is6(field, Column) ?
|
|
89245
|
+
field: is6(field, Column) ? aliasedTableColumn2(field, tableAlias) : field
|
|
89246
89246
|
})),
|
|
89247
89247
|
joins,
|
|
89248
89248
|
where,
|
|
@@ -89258,7 +89258,7 @@ var init_dialect = __esm(() => {
|
|
|
89258
89258
|
};
|
|
89259
89259
|
}
|
|
89260
89260
|
nestedSelectionerror() {
|
|
89261
|
-
throw new
|
|
89261
|
+
throw new DrizzleError2({ message: `Views with nested selections are not supported by the relational query builder` });
|
|
89262
89262
|
}
|
|
89263
89263
|
buildRqbColumn(table2, column, key) {
|
|
89264
89264
|
if (is6(column, Column)) {
|
|
@@ -89336,13 +89336,13 @@ var init_dialect = __esm(() => {
|
|
|
89336
89336
|
const currentPath = errorPath ?? "";
|
|
89337
89337
|
const currentDepth = depth ?? 0;
|
|
89338
89338
|
if (!currentDepth)
|
|
89339
|
-
table2 =
|
|
89339
|
+
table2 = aliasedTable2(table2, `d${currentDepth}`);
|
|
89340
89340
|
const limit = isSingle ? 1 : params?.limit;
|
|
89341
89341
|
const offset = params?.offset;
|
|
89342
89342
|
const columns = this.buildColumns(table2, selection, params);
|
|
89343
|
-
const where = params?.where && relationWhere ? and3(
|
|
89344
|
-
const order = params?.orderBy ?
|
|
89345
|
-
const extras = params?.extras ?
|
|
89343
|
+
const where = params?.where && relationWhere ? and3(relationsFilterToSQL2(table2, params.where, tableConfig.relations, schema2, this.casing), relationWhere) : params?.where ? relationsFilterToSQL2(table2, params.where, tableConfig.relations, schema2, this.casing) : relationWhere;
|
|
89344
|
+
const order = params?.orderBy ? relationsOrderToSQL2(table2, params.orderBy) : undefined;
|
|
89345
|
+
const extras = params?.extras ? relationExtrasToSQL2(table2, params.extras) : undefined;
|
|
89346
89346
|
if (extras)
|
|
89347
89347
|
selection.push(...extras.selection);
|
|
89348
89348
|
const joins = params ? (() => {
|
|
@@ -89354,11 +89354,11 @@ var init_dialect = __esm(() => {
|
|
|
89354
89354
|
return;
|
|
89355
89355
|
return sql.join(withEntries.map(([k2, join9]) => {
|
|
89356
89356
|
const relation = tableConfig.relations[k2];
|
|
89357
|
-
const isSingle2 = is6(relation,
|
|
89358
|
-
const targetTable =
|
|
89359
|
-
const throughTable = relation.throughTable ?
|
|
89360
|
-
const { filter: filter21, joinCondition } =
|
|
89361
|
-
const throughJoin2 = throughTable ? sql` inner join ${
|
|
89357
|
+
const isSingle2 = is6(relation, One4);
|
|
89358
|
+
const targetTable = aliasedTable2(relation.targetTable, `d${currentDepth + 1}`);
|
|
89359
|
+
const throughTable = relation.throughTable ? aliasedTable2(relation.throughTable, `tr${currentDepth}`) : undefined;
|
|
89360
|
+
const { filter: filter21, joinCondition } = relationToSQL2(this.casing, relation, table2, targetTable, throughTable);
|
|
89361
|
+
const throughJoin2 = throughTable ? sql` inner join ${getTableAsAliasSQL2(throughTable)} on ${joinCondition}` : undefined;
|
|
89362
89362
|
const innerQuery = this.buildRelationalQuery({
|
|
89363
89363
|
table: targetTable,
|
|
89364
89364
|
mode: isSingle2 ? "first" : "many",
|
|
@@ -89392,9 +89392,9 @@ var init_dialect = __esm(() => {
|
|
|
89392
89392
|
joins
|
|
89393
89393
|
].filter((e) => e !== undefined);
|
|
89394
89394
|
if (!selectionArr.length)
|
|
89395
|
-
throw new
|
|
89395
|
+
throw new DrizzleError2({ message: `No fields selected for table "${tableConfig.name}"${currentPath ? ` ("${currentPath}")` : ""}` });
|
|
89396
89396
|
return {
|
|
89397
|
-
sql: sql`select ${sql.join(selectionArr, sql`, `)} from ${
|
|
89397
|
+
sql: sql`select ${sql.join(selectionArr, sql`, `)} from ${getTableAsAliasSQL2(table2)}${throughJoin}${sql` where ${where}`.if(where)}${sql` order by ${order}`.if(order)}${sql` limit ${limit}`.if(limit !== undefined)}${sql` offset ${offset}`.if(offset !== undefined)}`,
|
|
89398
89398
|
selection
|
|
89399
89399
|
};
|
|
89400
89400
|
}
|
|
@@ -89559,12 +89559,12 @@ var init_insert = __esm(() => {
|
|
|
89559
89559
|
}
|
|
89560
89560
|
select(selectQuery) {
|
|
89561
89561
|
const select = typeof selectQuery === "function" ? selectQuery(new QueryBuilder) : selectQuery;
|
|
89562
|
-
if (!is6(select, SQL) && !
|
|
89562
|
+
if (!is6(select, SQL) && !haveSameKeys2(this.table[TableColumns], select._.selectedFields))
|
|
89563
89563
|
throw new Error("Insert select error: selected fields are not the same or are in a different order compared to the table definition");
|
|
89564
89564
|
return new SQLiteInsertBase(this.table, select, this.session, this.dialect, this.withList, true);
|
|
89565
89565
|
}
|
|
89566
89566
|
};
|
|
89567
|
-
SQLiteInsertBase = class extends
|
|
89567
|
+
SQLiteInsertBase = class extends QueryPromise2 {
|
|
89568
89568
|
static [entityKind] = "SQLiteInsert";
|
|
89569
89569
|
config;
|
|
89570
89570
|
constructor(table2, values12, session, dialect, withList, select) {
|
|
@@ -89579,7 +89579,7 @@ var init_insert = __esm(() => {
|
|
|
89579
89579
|
};
|
|
89580
89580
|
}
|
|
89581
89581
|
returning(fields = this.config.table[SQLiteTable.Symbol.Columns]) {
|
|
89582
|
-
this.config.returning =
|
|
89582
|
+
this.config.returning = orderSelectedFields2(fields);
|
|
89583
89583
|
return this;
|
|
89584
89584
|
}
|
|
89585
89585
|
onConflictDoNothing(config3 = {}) {
|
|
@@ -89603,7 +89603,7 @@ var init_insert = __esm(() => {
|
|
|
89603
89603
|
const targetWhereSql = config3.targetWhere ? sql` where ${config3.targetWhere}` : undefined;
|
|
89604
89604
|
const setWhereSql = config3.setWhere ? sql` where ${config3.setWhere}` : undefined;
|
|
89605
89605
|
const targetSql = Array.isArray(config3.target) ? sql`${config3.target}` : sql`${[config3.target]}`;
|
|
89606
|
-
const setSql = this.dialect.buildUpdateSet(this.config.table,
|
|
89606
|
+
const setSql = this.dialect.buildUpdateSet(this.config.table, mapUpdateSet2(this.config.table, config3.set));
|
|
89607
89607
|
this.config.onConflict.push(sql` on conflict ${targetSql}${targetWhereSql} do update set ${setSql}${whereSql}${setWhereSql}`);
|
|
89608
89608
|
return this;
|
|
89609
89609
|
}
|
|
@@ -89666,10 +89666,10 @@ var init_update = __esm(() => {
|
|
|
89666
89666
|
this.withList = withList;
|
|
89667
89667
|
}
|
|
89668
89668
|
set(values12) {
|
|
89669
|
-
return new SQLiteUpdateBase(this.table,
|
|
89669
|
+
return new SQLiteUpdateBase(this.table, mapUpdateSet2(this.table, values12), this.session, this.dialect, this.withList);
|
|
89670
89670
|
}
|
|
89671
89671
|
};
|
|
89672
|
-
SQLiteUpdateBase = class extends
|
|
89672
|
+
SQLiteUpdateBase = class extends QueryPromise2 {
|
|
89673
89673
|
static [entityKind] = "SQLiteUpdate";
|
|
89674
89674
|
config;
|
|
89675
89675
|
constructor(table2, set23, session, dialect, withList) {
|
|
@@ -89689,7 +89689,7 @@ var init_update = __esm(() => {
|
|
|
89689
89689
|
}
|
|
89690
89690
|
createJoin(joinType) {
|
|
89691
89691
|
return (table2, on) => {
|
|
89692
|
-
const tableName =
|
|
89692
|
+
const tableName = getTableLikeName2(table2);
|
|
89693
89693
|
if (typeof tableName === "string" && this.config.joins.some((join9) => join9.alias === tableName))
|
|
89694
89694
|
throw new Error(`Alias "${tableName}" is already used in this query`);
|
|
89695
89695
|
if (typeof on === "function") {
|
|
@@ -89738,7 +89738,7 @@ var init_update = __esm(() => {
|
|
|
89738
89738
|
return this;
|
|
89739
89739
|
}
|
|
89740
89740
|
returning(fields = this.config.table[SQLiteTable.Symbol.Columns]) {
|
|
89741
|
-
this.config.returning =
|
|
89741
|
+
this.config.returning = orderSelectedFields2(fields);
|
|
89742
89742
|
return this;
|
|
89743
89743
|
}
|
|
89744
89744
|
getSQL() {
|
|
@@ -89973,7 +89973,7 @@ var init_session = __esm(() => {
|
|
|
89973
89973
|
init_query_promise();
|
|
89974
89974
|
init_cache();
|
|
89975
89975
|
init_errors4();
|
|
89976
|
-
ExecuteResultSync = class extends
|
|
89976
|
+
ExecuteResultSync = class extends QueryPromise2 {
|
|
89977
89977
|
static [entityKind] = "ExecuteResultSync";
|
|
89978
89978
|
constructor(resultCb) {
|
|
89979
89979
|
super();
|
|
@@ -90009,26 +90009,26 @@ var init_session = __esm(() => {
|
|
|
90009
90009
|
try {
|
|
90010
90010
|
return await query();
|
|
90011
90011
|
} catch (e) {
|
|
90012
|
-
throw new
|
|
90012
|
+
throw new DrizzleQueryError2(queryString, params, e);
|
|
90013
90013
|
}
|
|
90014
90014
|
if (this.cacheConfig && !this.cacheConfig.enabled)
|
|
90015
90015
|
try {
|
|
90016
90016
|
return await query();
|
|
90017
90017
|
} catch (e) {
|
|
90018
|
-
throw new
|
|
90018
|
+
throw new DrizzleQueryError2(queryString, params, e);
|
|
90019
90019
|
}
|
|
90020
90020
|
if ((this.queryMetadata.type === "insert" || this.queryMetadata.type === "update" || this.queryMetadata.type === "delete") && this.queryMetadata.tables.length > 0)
|
|
90021
90021
|
try {
|
|
90022
90022
|
const [res] = await Promise.all([query(), this.cache.onMutate({ tables: this.queryMetadata.tables })]);
|
|
90023
90023
|
return res;
|
|
90024
90024
|
} catch (e) {
|
|
90025
|
-
throw new
|
|
90025
|
+
throw new DrizzleQueryError2(queryString, params, e);
|
|
90026
90026
|
}
|
|
90027
90027
|
if (!this.cacheConfig)
|
|
90028
90028
|
try {
|
|
90029
90029
|
return await query();
|
|
90030
90030
|
} catch (e) {
|
|
90031
|
-
throw new
|
|
90031
|
+
throw new DrizzleQueryError2(queryString, params, e);
|
|
90032
90032
|
}
|
|
90033
90033
|
if (this.queryMetadata.type === "select") {
|
|
90034
90034
|
const fromCache = await this.cache.get(this.cacheConfig.tag ?? await hashQuery(queryString, params), this.queryMetadata.tables, this.cacheConfig.tag !== undefined, this.cacheConfig.autoInvalidate);
|
|
@@ -90037,7 +90037,7 @@ var init_session = __esm(() => {
|
|
|
90037
90037
|
try {
|
|
90038
90038
|
result6 = await query();
|
|
90039
90039
|
} catch (e) {
|
|
90040
|
-
throw new
|
|
90040
|
+
throw new DrizzleQueryError2(queryString, params, e);
|
|
90041
90041
|
}
|
|
90042
90042
|
await this.cache.put(this.cacheConfig.tag ?? await hashQuery(queryString, params), result6, this.cacheConfig.autoInvalidate ? this.queryMetadata.tables : [], this.cacheConfig.tag !== undefined, this.cacheConfig.config);
|
|
90043
90043
|
return result6;
|
|
@@ -90047,7 +90047,7 @@ var init_session = __esm(() => {
|
|
|
90047
90047
|
try {
|
|
90048
90048
|
return await query();
|
|
90049
90049
|
} catch (e) {
|
|
90050
|
-
throw new
|
|
90050
|
+
throw new DrizzleQueryError2(queryString, params, e);
|
|
90051
90051
|
}
|
|
90052
90052
|
}
|
|
90053
90053
|
getQuery() {
|
|
@@ -90094,7 +90094,7 @@ var init_session = __esm(() => {
|
|
|
90094
90094
|
try {
|
|
90095
90095
|
return this.prepareOneTimeQuery(staticQuery, undefined, "run", false).run();
|
|
90096
90096
|
} catch (err2) {
|
|
90097
|
-
throw new
|
|
90097
|
+
throw new DrizzleError2({
|
|
90098
90098
|
cause: err2,
|
|
90099
90099
|
message: `Failed to run the query '${staticQuery.sql}'`
|
|
90100
90100
|
});
|
|
@@ -90134,7 +90134,7 @@ var init_session = __esm(() => {
|
|
|
90134
90134
|
this.nestedIndex = nestedIndex;
|
|
90135
90135
|
}
|
|
90136
90136
|
rollback() {
|
|
90137
|
-
throw new
|
|
90137
|
+
throw new TransactionRollbackError2;
|
|
90138
90138
|
}
|
|
90139
90139
|
};
|
|
90140
90140
|
});
|
|
@@ -90155,7 +90155,7 @@ var init_session2 = __esm(() => {
|
|
|
90155
90155
|
init_entity();
|
|
90156
90156
|
init_utils2();
|
|
90157
90157
|
init_sql();
|
|
90158
|
-
|
|
90158
|
+
init_logger2();
|
|
90159
90159
|
init_sqlite_core();
|
|
90160
90160
|
init_session();
|
|
90161
90161
|
SQLiteBunSession = class extends SQLiteSession {
|
|
@@ -90166,7 +90166,7 @@ var init_session2 = __esm(() => {
|
|
|
90166
90166
|
this.client = client;
|
|
90167
90167
|
this.relations = relations;
|
|
90168
90168
|
this.schema = schema2;
|
|
90169
|
-
this.logger = options4.logger ?? new
|
|
90169
|
+
this.logger = options4.logger ?? new NoopLogger2;
|
|
90170
90170
|
}
|
|
90171
90171
|
exec(query) {
|
|
90172
90172
|
this.client.exec(query);
|
|
@@ -90230,7 +90230,7 @@ var init_session2 = __esm(() => {
|
|
|
90230
90230
|
const rows = this.values(placeholderValues);
|
|
90231
90231
|
if (customResultMapper)
|
|
90232
90232
|
return customResultMapper(rows);
|
|
90233
|
-
return rows.map((row) =>
|
|
90233
|
+
return rows.map((row) => mapResultRow2(fields, row, joinsNotNullableMap));
|
|
90234
90234
|
}
|
|
90235
90235
|
get(placeholderValues) {
|
|
90236
90236
|
if (this.isRqbV2Query)
|
|
@@ -90249,7 +90249,7 @@ var init_session2 = __esm(() => {
|
|
|
90249
90249
|
return;
|
|
90250
90250
|
if (customResultMapper)
|
|
90251
90251
|
return customResultMapper([row]);
|
|
90252
|
-
return
|
|
90252
|
+
return mapResultRow2(fields, row, joinsNotNullableMap);
|
|
90253
90253
|
}
|
|
90254
90254
|
allRqbV2(placeholderValues) {
|
|
90255
90255
|
const { query, logger, stmt, customResultMapper } = this;
|
|
@@ -90283,7 +90283,7 @@ function construct(client, config3 = {}) {
|
|
|
90283
90283
|
const dialect = new SQLiteSyncDialect({ casing: config3.casing });
|
|
90284
90284
|
let logger;
|
|
90285
90285
|
if (config3.logger === true)
|
|
90286
|
-
logger = new
|
|
90286
|
+
logger = new DefaultLogger2;
|
|
90287
90287
|
else if (config3.logger !== false)
|
|
90288
90288
|
logger = config3.logger;
|
|
90289
90289
|
let schema2;
|
|
@@ -90317,7 +90317,7 @@ var init_driver = __esm(() => {
|
|
|
90317
90317
|
init_session2();
|
|
90318
90318
|
init_entity();
|
|
90319
90319
|
init__relations();
|
|
90320
|
-
|
|
90320
|
+
init_logger2();
|
|
90321
90321
|
init_db();
|
|
90322
90322
|
init_dialect();
|
|
90323
90323
|
SQLiteBunDatabase = class extends BaseSQLiteDatabase {
|
|
@@ -90875,8 +90875,8 @@ var require_lib = __commonJS((exports2, module2) => {
|
|
|
90875
90875
|
const p = getPathPart(envPart, cmd);
|
|
90876
90876
|
for (const ext2 of pathExt) {
|
|
90877
90877
|
const withExt = p + ext2;
|
|
90878
|
-
const
|
|
90879
|
-
if (
|
|
90878
|
+
const is8 = await isexe(withExt, { pathExt: pathExtExe, ignoreErrors: true });
|
|
90879
|
+
if (is8) {
|
|
90880
90880
|
if (!opt.all) {
|
|
90881
90881
|
return withExt;
|
|
90882
90882
|
}
|
|
@@ -90899,8 +90899,8 @@ var require_lib = __commonJS((exports2, module2) => {
|
|
|
90899
90899
|
const p = getPathPart(pathEnvPart, cmd);
|
|
90900
90900
|
for (const ext2 of pathExt) {
|
|
90901
90901
|
const withExt = p + ext2;
|
|
90902
|
-
const
|
|
90903
|
-
if (
|
|
90902
|
+
const is8 = isexeSync(withExt, { pathExt: pathExtExe, ignoreErrors: true });
|
|
90903
|
+
if (is8) {
|
|
90904
90904
|
if (!opt.all) {
|
|
90905
90905
|
return withExt;
|
|
90906
90906
|
}
|
|
@@ -92802,7 +92802,7 @@ var init_oltp = __esm(async () => {
|
|
|
92802
92802
|
init_observability();
|
|
92803
92803
|
init_flag();
|
|
92804
92804
|
init_meta();
|
|
92805
|
-
await
|
|
92805
|
+
await init_logger();
|
|
92806
92806
|
((Observability) => {
|
|
92807
92807
|
const base2 = Flag.OTEL_EXPORTER_OTLP_ENDPOINT;
|
|
92808
92808
|
Observability.enabled = !!base2;
|
|
@@ -95258,7 +95258,7 @@ var init_installation = __esm(async () => {
|
|
|
95258
95258
|
});
|
|
95259
95259
|
for (const check6 of checks3) {
|
|
95260
95260
|
const output = yield* check6.command();
|
|
95261
|
-
const installedName = check6.name === "brew" || check6.name === "choco" || check6.name === "scoop" ? "megon" : "megon
|
|
95261
|
+
const installedName = check6.name === "brew" || check6.name === "choco" || check6.name === "scoop" ? "megon" : "@beingniloy/megon";
|
|
95262
95262
|
if (output.includes(installedName)) {
|
|
95263
95263
|
return check6.name;
|
|
95264
95264
|
}
|
|
@@ -95283,7 +95283,7 @@ var init_installation = __esm(async () => {
|
|
|
95283
95283
|
const reg = r || "https://registry.npmjs.org";
|
|
95284
95284
|
const registry2 = reg.endsWith("/") ? reg.slice(0, -1) : reg;
|
|
95285
95285
|
const channel = Installation.CHANNEL;
|
|
95286
|
-
const response2 = yield* httpOk.execute(exports_HttpClientRequest.get(`${registry2}/megon
|
|
95286
|
+
const response2 = yield* httpOk.execute(exports_HttpClientRequest.get(`${registry2}/@beingniloy/megon/${channel}`).pipe(exports_HttpClientRequest.acceptJson));
|
|
95287
95287
|
const data3 = yield* exports_HttpClientResponse.schemaBodyJson(NpmPackage)(response2);
|
|
95288
95288
|
return data3.version;
|
|
95289
95289
|
}
|
|
@@ -95308,13 +95308,13 @@ var init_installation = __esm(async () => {
|
|
|
95308
95308
|
result6 = yield* upgradeCurl(target);
|
|
95309
95309
|
break;
|
|
95310
95310
|
case "npm":
|
|
95311
|
-
result6 = yield* run7(["npm", "install", "-g",
|
|
95311
|
+
result6 = yield* run7(["npm", "install", "-g", `@beingniloy/megon@${target}`]);
|
|
95312
95312
|
break;
|
|
95313
95313
|
case "pnpm":
|
|
95314
|
-
result6 = yield* run7(["pnpm", "install", "-g",
|
|
95314
|
+
result6 = yield* run7(["pnpm", "install", "-g", `@beingniloy/megon@${target}`]);
|
|
95315
95315
|
break;
|
|
95316
95316
|
case "bun":
|
|
95317
|
-
result6 = yield* run7(["bun", "install", "-g",
|
|
95317
|
+
result6 = yield* run7(["bun", "install", "-g", `@beingniloy/megon@${target}`]);
|
|
95318
95318
|
break;
|
|
95319
95319
|
case "brew": {
|
|
95320
95320
|
const formula = yield* getBrewFormula();
|
|
@@ -110016,7 +110016,7 @@ var require_index_min3 = __commonJS((exports2) => {
|
|
|
110016
110016
|
var H3 = R3((g) => {
|
|
110017
110017
|
Object.defineProperty(g, "__esModule", { value: true });
|
|
110018
110018
|
g.unescape = g.escape = g.AST = g.Minimatch = g.match = g.makeRe = g.braceExpand = g.defaults = g.filter = g.GLOBSTAR = g.sep = g.minimatch = undefined;
|
|
110019
|
-
var Si2 = Ke3(), jt3 = Xe3(),
|
|
110019
|
+
var Si2 = Ke3(), jt3 = Xe3(), is8 = pe3(), vi2 = me3(), Ei2 = kt3(), _i2 = (n16, t12, e5 = {}) => ((0, jt3.assertValidPattern)(t12), !e5.nocomment && t12.charAt(0) === "#" ? false : new J2(t12, e5).match(n16));
|
|
110020
110020
|
g.minimatch = _i2;
|
|
110021
110021
|
var Oi2 = /^\*+([^+@!?\*\[\(]*)$/, xi2 = (n16) => (t12) => !t12.startsWith(".") && t12.endsWith(n16), Ti2 = (n16) => (t12) => t12.endsWith(n16), Ci2 = (n16) => (n16 = n16.toLowerCase(), (t12) => !t12.startsWith(".") && t12.toLowerCase().endsWith(n16)), Ri2 = (n16) => (n16 = n16.toLowerCase(), (t12) => t12.toLowerCase().endsWith(n16)), Ai2 = /^\*+\.\*+$/, ki2 = (n16) => !n16.startsWith(".") && n16.includes("."), Mi2 = (n16) => n16 !== "." && n16 !== ".." && n16.includes("."), Pi2 = /^\.\*+$/, Di2 = (n16) => n16 !== "." && n16 !== ".." && n16.startsWith("."), Fi2 = /^\*+$/, ji2 = (n16) => n16.length !== 0 && !n16.startsWith("."), Ni2 = (n16) => n16.length !== 0 && n16 !== "." && n16 !== "..", Li2 = /^\?+([^+@!?\*\[\(]*)?$/, Wi2 = ([n16, t12 = ""]) => {
|
|
110022
110022
|
let e5 = rs2([n16]);
|
|
@@ -110327,7 +110327,7 @@ globstar while`, t12, d2, e5, u2, m2), this.matchOne(t12.slice(d2), e5.slice(u2)
|
|
|
110327
110327
|
return "";
|
|
110328
110328
|
let s2, i5 = null;
|
|
110329
110329
|
(s2 = t12.match(Fi2)) ? i5 = e5.dot ? Ni2 : ji2 : (s2 = t12.match(Oi2)) ? i5 = (e5.nocase ? e5.dot ? Ri2 : Ci2 : e5.dot ? Ti2 : xi2)(s2[1]) : (s2 = t12.match(Li2)) ? i5 = (e5.nocase ? e5.dot ? Bi2 : Wi2 : e5.dot ? Ii2 : Gi)(s2) : (s2 = t12.match(Ai2)) ? i5 = e5.dot ? Mi2 : ki2 : (s2 = t12.match(Pi2)) && (i5 = Di2);
|
|
110330
|
-
let r7 =
|
|
110330
|
+
let r7 = is8.AST.fromGlob(t12, this.options).toMMPattern();
|
|
110331
110331
|
return i5 && typeof r7 == "object" && Reflect.defineProperty(r7, "test", { value: i5 }), r7;
|
|
110332
110332
|
}
|
|
110333
110333
|
makeRe() {
|
|
@@ -110408,7 +110408,7 @@ globstar while`, t12, d2, e5, u2, m2), this.matchOne(t12.slice(d2), e5.slice(u2)
|
|
|
110408
110408
|
Object.defineProperty(g, "unescape", { enumerable: true, get: function() {
|
|
110409
110409
|
return tr.unescape;
|
|
110410
110410
|
} });
|
|
110411
|
-
g.minimatch.AST =
|
|
110411
|
+
g.minimatch.AST = is8.AST;
|
|
110412
110412
|
g.minimatch.Minimatch = J2;
|
|
110413
110413
|
g.minimatch.escape = vi2.escape;
|
|
110414
110414
|
g.minimatch.unescape = Ei2.unescape;
|
|
@@ -116133,11 +116133,11 @@ var require_is = __commonJS((exports2, module2) => {
|
|
|
116133
116133
|
|
|
116134
116134
|
// ../../node_modules/@npmcli/git/lib/find.js
|
|
116135
116135
|
var require_find = __commonJS((exports2, module2) => {
|
|
116136
|
-
var
|
|
116136
|
+
var is8 = require_is();
|
|
116137
116137
|
var { dirname: dirname4 } = __require("path");
|
|
116138
116138
|
module2.exports = async ({ cwd = process.cwd(), root } = {}) => {
|
|
116139
116139
|
while (true) {
|
|
116140
|
-
if (await
|
|
116140
|
+
if (await is8({ cwd })) {
|
|
116141
116141
|
return cwd;
|
|
116142
116142
|
}
|
|
116143
116143
|
const next3 = dirname4(cwd);
|
|
@@ -122948,7 +122948,7 @@ var require_index_min4 = __commonJS((exports2) => {
|
|
|
122948
122948
|
};
|
|
122949
122949
|
Object.defineProperty(W3, "__esModule", { value: true });
|
|
122950
122950
|
W3.WriteStreamSync = W3.WriteStream = W3.ReadStreamSync = W3.ReadStream = undefined;
|
|
122951
|
-
var Fo = xr(__require("events")), B4 = xr(__require("fs")), Co = We3(), Bo = B4.default.writev, ye3 = Symbol("_autoClose"), $2 = Symbol("_close"), _t2 = Symbol("_ended"), p2 = Symbol("_fd"),
|
|
122951
|
+
var Fo = xr(__require("events")), B4 = xr(__require("fs")), Co = We3(), Bo = B4.default.writev, ye3 = Symbol("_autoClose"), $2 = Symbol("_close"), _t2 = Symbol("_ended"), p2 = Symbol("_fd"), is8 = Symbol("_finished"), fe3 = Symbol("_flags"), ss2 = Symbol("_flush"), as6 = Symbol("_handleChunk"), hs2 = Symbol("_makeBuf"), yt3 = Symbol("_mode"), Zt2 = Symbol("_needDrain"), Ge3 = Symbol("_onerror"), Ye3 = Symbol("_onopen"), rs2 = Symbol("_onread"), He3 = Symbol("_onwrite"), Ee3 = Symbol("_open"), V3 = Symbol("_path"), we3 = Symbol("_pos"), ee3 = Symbol("_queue"), Ze3 = Symbol("_read"), ns2 = Symbol("_readSize"), ce3 = Symbol("_reading"), wt3 = Symbol("_remain"), os5 = Symbol("_size"), Gt3 = Symbol("_write"), Ne3 = Symbol("_writing"), Yt3 = Symbol("_defaultFlag"), Me3 = Symbol("_errored"), Kt3 = class extends Co.Minipass {
|
|
122952
122952
|
[Me3] = false;
|
|
122953
122953
|
[p2];
|
|
122954
122954
|
[V3];
|
|
@@ -123071,7 +123071,7 @@ var require_index_min4 = __commonJS((exports2) => {
|
|
|
123071
123071
|
[p2];
|
|
123072
123072
|
[Yt3];
|
|
123073
123073
|
[fe3];
|
|
123074
|
-
[
|
|
123074
|
+
[is8] = false;
|
|
123075
123075
|
[we3];
|
|
123076
123076
|
constructor(e5, t12) {
|
|
123077
123077
|
t12 = t12 || {}, super(t12), this[V3] = e5, this[p2] = typeof t12.fd == "number" ? t12.fd : undefined, this[yt3] = t12.mode === undefined ? 438 : t12.mode, this[we3] = typeof t12.start == "number" ? t12.start : undefined, this[ye3] = typeof t12.autoClose == "boolean" ? t12.autoClose : true;
|
|
@@ -123111,7 +123111,7 @@ var require_index_min4 = __commonJS((exports2) => {
|
|
|
123111
123111
|
B4.default.write(this[p2], e5, 0, e5.length, this[we3], (t12, i5) => this[He3](t12, i5));
|
|
123112
123112
|
}
|
|
123113
123113
|
[He3](e5, t12) {
|
|
123114
|
-
e5 ? this[Ge3](e5) : (this[we3] !== undefined && typeof t12 == "number" && (this[we3] += t12), this[ee3].length ? this[ss2]() : (this[Ne3] = false, this[_t2] && !this[
|
|
123114
|
+
e5 ? this[Ge3](e5) : (this[we3] !== undefined && typeof t12 == "number" && (this[we3] += t12), this[ee3].length ? this[ss2]() : (this[Ne3] = false, this[_t2] && !this[is8] ? (this[is8] = true, this[$2](), this.emit("finish")) : this[Zt2] && (this[Zt2] = false, this.emit("drain"))));
|
|
123115
123115
|
}
|
|
123116
123116
|
[ss2]() {
|
|
123117
123117
|
if (this[ee3].length === 0)
|
|
@@ -175397,7 +175397,7 @@ var init_bus = __esm(async () => {
|
|
|
175397
175397
|
init_bus_event();
|
|
175398
175398
|
init_global();
|
|
175399
175399
|
await __promiseAll([
|
|
175400
|
-
|
|
175400
|
+
init_logger(),
|
|
175401
175401
|
init_log(),
|
|
175402
175402
|
init_instance_state(),
|
|
175403
175403
|
init_run_service()
|
|
@@ -201154,7 +201154,7 @@ var require_is2 = __commonJS((exports2) => {
|
|
|
201154
201154
|
var require_messages = __commonJS((exports2) => {
|
|
201155
201155
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
201156
201156
|
exports2.Message = exports2.NotificationType9 = exports2.NotificationType8 = exports2.NotificationType7 = exports2.NotificationType6 = exports2.NotificationType5 = exports2.NotificationType4 = exports2.NotificationType3 = exports2.NotificationType2 = exports2.NotificationType1 = exports2.NotificationType0 = exports2.NotificationType = exports2.RequestType9 = exports2.RequestType8 = exports2.RequestType7 = exports2.RequestType6 = exports2.RequestType5 = exports2.RequestType4 = exports2.RequestType3 = exports2.RequestType2 = exports2.RequestType1 = exports2.RequestType = exports2.RequestType0 = exports2.AbstractMessageSignature = exports2.ParameterStructures = exports2.ResponseError = exports2.ErrorCodes = undefined;
|
|
201157
|
-
var
|
|
201157
|
+
var is8 = require_is2();
|
|
201158
201158
|
var ErrorCodes;
|
|
201159
201159
|
(function(ErrorCodes2) {
|
|
201160
201160
|
ErrorCodes2.ParseError = -32700;
|
|
@@ -201177,7 +201177,7 @@ var require_messages = __commonJS((exports2) => {
|
|
|
201177
201177
|
class ResponseError extends Error {
|
|
201178
201178
|
constructor(code, message, data2) {
|
|
201179
201179
|
super(message);
|
|
201180
|
-
this.code =
|
|
201180
|
+
this.code = is8.number(code) ? code : ErrorCodes.UnknownErrorCode;
|
|
201181
201181
|
this.data = data2;
|
|
201182
201182
|
Object.setPrototypeOf(this, ResponseError.prototype);
|
|
201183
201183
|
}
|
|
@@ -201394,17 +201394,17 @@ var require_messages = __commonJS((exports2) => {
|
|
|
201394
201394
|
(function(Message2) {
|
|
201395
201395
|
function isRequest2(message) {
|
|
201396
201396
|
const candidate = message;
|
|
201397
|
-
return candidate &&
|
|
201397
|
+
return candidate && is8.string(candidate.method) && (is8.string(candidate.id) || is8.number(candidate.id));
|
|
201398
201398
|
}
|
|
201399
201399
|
Message2.isRequest = isRequest2;
|
|
201400
201400
|
function isNotification(message) {
|
|
201401
201401
|
const candidate = message;
|
|
201402
|
-
return candidate &&
|
|
201402
|
+
return candidate && is8.string(candidate.method) && message.id === undefined;
|
|
201403
201403
|
}
|
|
201404
201404
|
Message2.isNotification = isNotification;
|
|
201405
201405
|
function isResponse(message) {
|
|
201406
201406
|
const candidate = message;
|
|
201407
|
-
return candidate && (candidate.result !== undefined || !!candidate.error) && (
|
|
201407
|
+
return candidate && (candidate.result !== undefined || !!candidate.error) && (is8.string(candidate.id) || is8.number(candidate.id) || candidate.id === null);
|
|
201408
201408
|
}
|
|
201409
201409
|
Message2.isResponse = isResponse;
|
|
201410
201410
|
})(Message || (exports2.Message = Message = {}));
|
|
@@ -201951,11 +201951,11 @@ var require_cancellation = __commonJS((exports2) => {
|
|
|
201951
201951
|
isCancellationRequested: true,
|
|
201952
201952
|
onCancellationRequested: events_1.Event.None
|
|
201953
201953
|
});
|
|
201954
|
-
function
|
|
201954
|
+
function is8(value8) {
|
|
201955
201955
|
const candidate = value8;
|
|
201956
201956
|
return candidate && (candidate === CancellationToken2.None || candidate === CancellationToken2.Cancelled || Is2.boolean(candidate.isCancellationRequested) && !!candidate.onCancellationRequested);
|
|
201957
201957
|
}
|
|
201958
|
-
CancellationToken2.is =
|
|
201958
|
+
CancellationToken2.is = is8;
|
|
201959
201959
|
})(CancellationToken || (exports2.CancellationToken = CancellationToken = {}));
|
|
201960
201960
|
var shortcutEvent = Object.freeze(function(callback5, context7) {
|
|
201961
201961
|
const handle2 = (0, ral_1.default)().timer.setTimeout(callback5.bind(context7), 0);
|
|
@@ -202175,11 +202175,11 @@ var require_messageReader = __commonJS((exports2) => {
|
|
|
202175
202175
|
var semaphore_1 = require_semaphore();
|
|
202176
202176
|
var MessageReader;
|
|
202177
202177
|
(function(MessageReader2) {
|
|
202178
|
-
function
|
|
202178
|
+
function is8(value8) {
|
|
202179
202179
|
let candidate = value8;
|
|
202180
202180
|
return candidate && Is2.func(candidate.listen) && Is2.func(candidate.dispose) && Is2.func(candidate.onError) && Is2.func(candidate.onClose) && Is2.func(candidate.onPartialMessage);
|
|
202181
202181
|
}
|
|
202182
|
-
MessageReader2.is =
|
|
202182
|
+
MessageReader2.is = is8;
|
|
202183
202183
|
})(MessageReader || (exports2.MessageReader = MessageReader = {}));
|
|
202184
202184
|
|
|
202185
202185
|
class AbstractMessageReader {
|
|
@@ -202366,11 +202366,11 @@ var require_messageWriter = __commonJS((exports2) => {
|
|
|
202366
202366
|
`;
|
|
202367
202367
|
var MessageWriter;
|
|
202368
202368
|
(function(MessageWriter2) {
|
|
202369
|
-
function
|
|
202369
|
+
function is8(value8) {
|
|
202370
202370
|
let candidate = value8;
|
|
202371
202371
|
return candidate && Is2.func(candidate.dispose) && Is2.func(candidate.onClose) && Is2.func(candidate.onError) && Is2.func(candidate.write);
|
|
202372
202372
|
}
|
|
202373
|
-
MessageWriter2.is =
|
|
202373
|
+
MessageWriter2.is = is8;
|
|
202374
202374
|
})(MessageWriter || (exports2.MessageWriter = MessageWriter = {}));
|
|
202375
202375
|
|
|
202376
202376
|
class AbstractMessageWriter {
|
|
@@ -202630,10 +202630,10 @@ var require_connection = __commonJS((exports2) => {
|
|
|
202630
202630
|
})(CancelNotification || (CancelNotification = {}));
|
|
202631
202631
|
var ProgressToken;
|
|
202632
202632
|
(function(ProgressToken2) {
|
|
202633
|
-
function
|
|
202633
|
+
function is8(value8) {
|
|
202634
202634
|
return typeof value8 === "string" || typeof value8 === "number";
|
|
202635
202635
|
}
|
|
202636
|
-
ProgressToken2.is =
|
|
202636
|
+
ProgressToken2.is = is8;
|
|
202637
202637
|
})(ProgressToken || (exports2.ProgressToken = ProgressToken = {}));
|
|
202638
202638
|
var ProgressNotification;
|
|
202639
202639
|
(function(ProgressNotification2) {
|
|
@@ -202646,10 +202646,10 @@ var require_connection = __commonJS((exports2) => {
|
|
|
202646
202646
|
exports2.ProgressType = ProgressType;
|
|
202647
202647
|
var StarRequestHandler;
|
|
202648
202648
|
(function(StarRequestHandler2) {
|
|
202649
|
-
function
|
|
202649
|
+
function is8(value8) {
|
|
202650
202650
|
return Is2.func(value8);
|
|
202651
202651
|
}
|
|
202652
|
-
StarRequestHandler2.is =
|
|
202652
|
+
StarRequestHandler2.is = is8;
|
|
202653
202653
|
})(StarRequestHandler || (StarRequestHandler = {}));
|
|
202654
202654
|
exports2.NullLogger = Object.freeze({
|
|
202655
202655
|
error: () => {},
|
|
@@ -202751,27 +202751,27 @@ var require_connection = __commonJS((exports2) => {
|
|
|
202751
202751
|
exports2.ConnectionError = ConnectionError;
|
|
202752
202752
|
var ConnectionStrategy;
|
|
202753
202753
|
(function(ConnectionStrategy2) {
|
|
202754
|
-
function
|
|
202754
|
+
function is8(value8) {
|
|
202755
202755
|
const candidate = value8;
|
|
202756
202756
|
return candidate && Is2.func(candidate.cancelUndispatched);
|
|
202757
202757
|
}
|
|
202758
|
-
ConnectionStrategy2.is =
|
|
202758
|
+
ConnectionStrategy2.is = is8;
|
|
202759
202759
|
})(ConnectionStrategy || (exports2.ConnectionStrategy = ConnectionStrategy = {}));
|
|
202760
202760
|
var IdCancellationReceiverStrategy;
|
|
202761
202761
|
(function(IdCancellationReceiverStrategy2) {
|
|
202762
|
-
function
|
|
202762
|
+
function is8(value8) {
|
|
202763
202763
|
const candidate = value8;
|
|
202764
202764
|
return candidate && (candidate.kind === undefined || candidate.kind === "id") && Is2.func(candidate.createCancellationTokenSource) && (candidate.dispose === undefined || Is2.func(candidate.dispose));
|
|
202765
202765
|
}
|
|
202766
|
-
IdCancellationReceiverStrategy2.is =
|
|
202766
|
+
IdCancellationReceiverStrategy2.is = is8;
|
|
202767
202767
|
})(IdCancellationReceiverStrategy || (exports2.IdCancellationReceiverStrategy = IdCancellationReceiverStrategy = {}));
|
|
202768
202768
|
var RequestCancellationReceiverStrategy;
|
|
202769
202769
|
(function(RequestCancellationReceiverStrategy2) {
|
|
202770
|
-
function
|
|
202770
|
+
function is8(value8) {
|
|
202771
202771
|
const candidate = value8;
|
|
202772
202772
|
return candidate && candidate.kind === "request" && Is2.func(candidate.createCancellationTokenSource) && (candidate.dispose === undefined || Is2.func(candidate.dispose));
|
|
202773
202773
|
}
|
|
202774
|
-
RequestCancellationReceiverStrategy2.is =
|
|
202774
|
+
RequestCancellationReceiverStrategy2.is = is8;
|
|
202775
202775
|
})(RequestCancellationReceiverStrategy || (exports2.RequestCancellationReceiverStrategy = RequestCancellationReceiverStrategy = {}));
|
|
202776
202776
|
var CancellationReceiverStrategy;
|
|
202777
202777
|
(function(CancellationReceiverStrategy2) {
|
|
@@ -202780,10 +202780,10 @@ var require_connection = __commonJS((exports2) => {
|
|
|
202780
202780
|
return new cancellation_1.CancellationTokenSource;
|
|
202781
202781
|
}
|
|
202782
202782
|
});
|
|
202783
|
-
function
|
|
202783
|
+
function is8(value8) {
|
|
202784
202784
|
return IdCancellationReceiverStrategy.is(value8) || RequestCancellationReceiverStrategy.is(value8);
|
|
202785
202785
|
}
|
|
202786
|
-
CancellationReceiverStrategy2.is =
|
|
202786
|
+
CancellationReceiverStrategy2.is = is8;
|
|
202787
202787
|
})(CancellationReceiverStrategy || (exports2.CancellationReceiverStrategy = CancellationReceiverStrategy = {}));
|
|
202788
202788
|
var CancellationSenderStrategy;
|
|
202789
202789
|
(function(CancellationSenderStrategy2) {
|
|
@@ -202793,11 +202793,11 @@ var require_connection = __commonJS((exports2) => {
|
|
|
202793
202793
|
},
|
|
202794
202794
|
cleanup(_3) {}
|
|
202795
202795
|
});
|
|
202796
|
-
function
|
|
202796
|
+
function is8(value8) {
|
|
202797
202797
|
const candidate = value8;
|
|
202798
202798
|
return candidate && Is2.func(candidate.sendCancellation) && Is2.func(candidate.cleanup);
|
|
202799
202799
|
}
|
|
202800
|
-
CancellationSenderStrategy2.is =
|
|
202800
|
+
CancellationSenderStrategy2.is = is8;
|
|
202801
202801
|
})(CancellationSenderStrategy || (exports2.CancellationSenderStrategy = CancellationSenderStrategy = {}));
|
|
202802
202802
|
var CancellationStrategy;
|
|
202803
202803
|
(function(CancellationStrategy2) {
|
|
@@ -202805,27 +202805,27 @@ var require_connection = __commonJS((exports2) => {
|
|
|
202805
202805
|
receiver: CancellationReceiverStrategy.Message,
|
|
202806
202806
|
sender: CancellationSenderStrategy.Message
|
|
202807
202807
|
});
|
|
202808
|
-
function
|
|
202808
|
+
function is8(value8) {
|
|
202809
202809
|
const candidate = value8;
|
|
202810
202810
|
return candidate && CancellationReceiverStrategy.is(candidate.receiver) && CancellationSenderStrategy.is(candidate.sender);
|
|
202811
202811
|
}
|
|
202812
|
-
CancellationStrategy2.is =
|
|
202812
|
+
CancellationStrategy2.is = is8;
|
|
202813
202813
|
})(CancellationStrategy || (exports2.CancellationStrategy = CancellationStrategy = {}));
|
|
202814
202814
|
var MessageStrategy;
|
|
202815
202815
|
(function(MessageStrategy2) {
|
|
202816
|
-
function
|
|
202816
|
+
function is8(value8) {
|
|
202817
202817
|
const candidate = value8;
|
|
202818
202818
|
return candidate && Is2.func(candidate.handleMessage);
|
|
202819
202819
|
}
|
|
202820
|
-
MessageStrategy2.is =
|
|
202820
|
+
MessageStrategy2.is = is8;
|
|
202821
202821
|
})(MessageStrategy || (exports2.MessageStrategy = MessageStrategy = {}));
|
|
202822
202822
|
var ConnectionOptions;
|
|
202823
202823
|
(function(ConnectionOptions2) {
|
|
202824
|
-
function
|
|
202824
|
+
function is8(value8) {
|
|
202825
202825
|
const candidate = value8;
|
|
202826
202826
|
return candidate && (CancellationStrategy.is(candidate.cancellationStrategy) || ConnectionStrategy.is(candidate.connectionStrategy) || MessageStrategy.is(candidate.messageStrategy));
|
|
202827
202827
|
}
|
|
202828
|
-
ConnectionOptions2.is =
|
|
202828
|
+
ConnectionOptions2.is = is8;
|
|
202829
202829
|
})(ConnectionOptions || (exports2.ConnectionOptions = ConnectionOptions = {}));
|
|
202830
202830
|
var ConnectionState;
|
|
202831
202831
|
(function(ConnectionState2) {
|
|
@@ -206841,7 +206841,7 @@ var init_message_v2 = __esm(async () => {
|
|
|
206841
206841
|
init_snapshot(),
|
|
206842
206842
|
init_sync(),
|
|
206843
206843
|
init_db2(),
|
|
206844
|
-
|
|
206844
|
+
init_logger()
|
|
206845
206845
|
]);
|
|
206846
206846
|
((MessageV2) => {
|
|
206847
206847
|
function isMedia(mime) {
|
|
@@ -248563,7 +248563,7 @@ var init_plugin = __esm(async () => {
|
|
|
248563
248563
|
init_zai(),
|
|
248564
248564
|
init_qoder(),
|
|
248565
248565
|
init_cline(),
|
|
248566
|
-
|
|
248566
|
+
init_logger(),
|
|
248567
248567
|
init_instance_state(),
|
|
248568
248568
|
init_run_service(),
|
|
248569
248569
|
init_loader(),
|
|
@@ -265904,7 +265904,7 @@ var init_mcp = __esm(async () => {
|
|
|
265904
265904
|
init_oauth_callback(),
|
|
265905
265905
|
init_auth4(),
|
|
265906
265906
|
init_bus(),
|
|
265907
|
-
|
|
265907
|
+
init_logger(),
|
|
265908
265908
|
init_instance_state(),
|
|
265909
265909
|
init_run_service()
|
|
265910
265910
|
]);
|
|
@@ -267736,7 +267736,7 @@ var init_command = __esm(async () => {
|
|
|
267736
267736
|
init_review();
|
|
267737
267737
|
await __promiseAll([
|
|
267738
267738
|
init_instance_state(),
|
|
267739
|
-
|
|
267739
|
+
init_logger(),
|
|
267740
267740
|
init_config(),
|
|
267741
267741
|
init_mcp(),
|
|
267742
267742
|
init_skill(),
|
|
@@ -279140,7 +279140,7 @@ var init_aws4fetch_esm = __esm(() => {
|
|
|
279140
279140
|
function createBedrockEventStreamDecoder(body3, processEvent) {
|
|
279141
279141
|
const codec3 = new EventStreamCodec(import_util_utf82.toUtf8, import_util_utf82.fromUtf8);
|
|
279142
279142
|
let buffer4 = new Uint8Array(0);
|
|
279143
|
-
const
|
|
279143
|
+
const textDecoder3 = new TextDecoder;
|
|
279144
279144
|
return body3.pipeThrough(new TransformStream({
|
|
279145
279145
|
async transform(chunk, controller) {
|
|
279146
279146
|
var _a25, _b16;
|
|
@@ -279159,7 +279159,7 @@ function createBedrockEventStreamDecoder(body3, processEvent) {
|
|
|
279159
279159
|
buffer4 = buffer4.slice(totalLength);
|
|
279160
279160
|
const messageType = (_a25 = decoded.headers[":message-type"]) == null ? undefined : _a25.value;
|
|
279161
279161
|
const eventType = (_b16 = decoded.headers[":event-type"]) == null ? undefined : _b16.value;
|
|
279162
|
-
const data2 =
|
|
279162
|
+
const data2 = textDecoder3.decode(decoded.body);
|
|
279163
279163
|
await processEvent({ messageType, eventType, data: data2 }, controller);
|
|
279164
279164
|
} catch (e6) {
|
|
279165
279165
|
break;
|
|
@@ -394557,7 +394557,7 @@ var require_cbor = __commonJS((exports2) => {
|
|
|
394557
394557
|
var USE_BUFFER$1 = typeof Buffer !== "undefined";
|
|
394558
394558
|
var payload = alloc(0);
|
|
394559
394559
|
var dataView$1 = new DataView(payload.buffer, payload.byteOffset, payload.byteLength);
|
|
394560
|
-
var
|
|
394560
|
+
var textDecoder3 = USE_TEXT_DECODER ? new TextDecoder : null;
|
|
394561
394561
|
var _offset = 0;
|
|
394562
394562
|
function setPayload(bytes) {
|
|
394563
394563
|
payload = bytes;
|
|
@@ -394687,8 +394687,8 @@ var require_cbor = __commonJS((exports2) => {
|
|
|
394687
394687
|
if (USE_BUFFER$1 && bytes.constructor?.name === "Buffer") {
|
|
394688
394688
|
return bytes.toString("utf-8", at4, to);
|
|
394689
394689
|
}
|
|
394690
|
-
if (
|
|
394691
|
-
return
|
|
394690
|
+
if (textDecoder3) {
|
|
394691
|
+
return textDecoder3.decode(bytes.subarray(at4, to));
|
|
394692
394692
|
}
|
|
394693
394693
|
return serde.toUtf8(bytes.subarray(at4, to));
|
|
394694
394694
|
}
|
|
@@ -405738,7 +405738,7 @@ var init_provider = __esm(async () => {
|
|
|
405738
405738
|
init_env(),
|
|
405739
405739
|
init_instance(),
|
|
405740
405740
|
init_global2(),
|
|
405741
|
-
|
|
405741
|
+
init_logger(),
|
|
405742
405742
|
init_instance_state(),
|
|
405743
405743
|
init_run_service(),
|
|
405744
405744
|
init_installation(),
|
|
@@ -425467,7 +425467,7 @@ var init_processor = __esm(async () => {
|
|
|
425467
425467
|
init_permission(),
|
|
425468
425468
|
init_plugin(),
|
|
425469
425469
|
init_snapshot(),
|
|
425470
|
-
|
|
425470
|
+
init_logger(),
|
|
425471
425471
|
init_session3(),
|
|
425472
425472
|
init_llm(),
|
|
425473
425473
|
init_message_v2(),
|
|
@@ -429511,7 +429511,7 @@ var init_external_directory = __esm(async () => {
|
|
|
429511
429511
|
init_dist();
|
|
429512
429512
|
init_filesystem2();
|
|
429513
429513
|
await __promiseAll([
|
|
429514
|
-
|
|
429514
|
+
init_logger(),
|
|
429515
429515
|
init_instance(),
|
|
429516
429516
|
init_config()
|
|
429517
429517
|
]);
|
|
@@ -433644,7 +433644,7 @@ var require_select = __commonJS((exports2, module2) => {
|
|
|
433644
433644
|
};
|
|
433645
433645
|
},
|
|
433646
433646
|
attr: function(key, op, val, i6) {
|
|
433647
|
-
op =
|
|
433647
|
+
op = operators3[op];
|
|
433648
433648
|
return function(el) {
|
|
433649
433649
|
var attr;
|
|
433650
433650
|
switch (key) {
|
|
@@ -433899,7 +433899,7 @@ var require_select = __commonJS((exports2, module2) => {
|
|
|
433899
433899
|
};
|
|
433900
433900
|
}
|
|
433901
433901
|
};
|
|
433902
|
-
var
|
|
433902
|
+
var operators3 = {
|
|
433903
433903
|
"-": function() {
|
|
433904
433904
|
return true;
|
|
433905
433905
|
},
|
|
@@ -434221,7 +434221,7 @@ var require_select = __commonJS((exports2, module2) => {
|
|
|
434221
434221
|
return find2(sel, context7);
|
|
434222
434222
|
};
|
|
434223
434223
|
exports2.selectors = selectors;
|
|
434224
|
-
exports2.operators =
|
|
434224
|
+
exports2.operators = operators3;
|
|
434225
434225
|
exports2.combinators = combinators;
|
|
434226
434226
|
exports2.matches = function(el, sel) {
|
|
434227
434227
|
var test = { sel };
|
|
@@ -447495,21 +447495,21 @@ function trimTrailingNewlines(string14) {
|
|
|
447495
447495
|
return string14.substring(0, indexEnd);
|
|
447496
447496
|
}
|
|
447497
447497
|
function isBlock(node) {
|
|
447498
|
-
return
|
|
447498
|
+
return is8(node, blockElements);
|
|
447499
447499
|
}
|
|
447500
447500
|
function isVoid2(node) {
|
|
447501
|
-
return
|
|
447501
|
+
return is8(node, voidElements);
|
|
447502
447502
|
}
|
|
447503
447503
|
function hasVoid(node) {
|
|
447504
447504
|
return has19(node, voidElements);
|
|
447505
447505
|
}
|
|
447506
447506
|
function isMeaningfulWhenBlank(node) {
|
|
447507
|
-
return
|
|
447507
|
+
return is8(node, meaningfulWhenBlankElements);
|
|
447508
447508
|
}
|
|
447509
447509
|
function hasMeaningfulWhenBlank(node) {
|
|
447510
447510
|
return has19(node, meaningfulWhenBlankElements);
|
|
447511
447511
|
}
|
|
447512
|
-
function
|
|
447512
|
+
function is8(node, tagNames) {
|
|
447513
447513
|
return tagNames.indexOf(node.nodeName) >= 0;
|
|
447514
447514
|
}
|
|
447515
447515
|
function has19(node, tagNames) {
|
|
@@ -448551,7 +448551,7 @@ var init_skill3 = __esm(async () => {
|
|
|
448551
448551
|
init_dist();
|
|
448552
448552
|
init_Stream();
|
|
448553
448553
|
await __promiseAll([
|
|
448554
|
-
|
|
448554
|
+
init_logger(),
|
|
448555
448555
|
init_tool(),
|
|
448556
448556
|
init_skill(),
|
|
448557
448557
|
init_ripgrep(),
|
|
@@ -451554,7 +451554,7 @@ var init_prompt = __esm(async () => {
|
|
|
451554
451554
|
init_llm(),
|
|
451555
451555
|
init_shell(),
|
|
451556
451556
|
init_truncate(),
|
|
451557
|
-
|
|
451557
|
+
init_logger(),
|
|
451558
451558
|
init_instance_state(),
|
|
451559
451559
|
init_run_service(),
|
|
451560
451560
|
init_task2(),
|
|
@@ -453661,7 +453661,7 @@ var init_pty = __esm(async () => {
|
|
|
453661
453661
|
init_log(),
|
|
453662
453662
|
init_shell(),
|
|
453663
453663
|
init_plugin(),
|
|
453664
|
-
|
|
453664
|
+
init_logger()
|
|
453665
453665
|
]);
|
|
453666
453666
|
((Pty) => {
|
|
453667
453667
|
const log12 = Log.create({ service: "pty" });
|