hysteria-orm 12.2.0 → 12.2.2

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/lib/index.d.cts CHANGED
@@ -3005,6 +3005,24 @@ declare class QueryBuilder<T extends Model = any, S extends Record<string, any>
3005
3005
  selectJsonRaw<ValueType = any, Alias extends string = string>(raw: string, alias: Alias): QueryBuilder<T, ComposeRawSelect<S, {
3006
3006
  [K in Alias]: ValueType;
3007
3007
  }>, D>;
3008
+ countDistinct<Alias extends string = string>(column: string, alias: Alias): QueryBuilder<T, ComposeRawSelect<S, {
3009
+ [K in Alias]: number;
3010
+ }>, D>;
3011
+ sumDistinct<Alias extends string = string>(column: string, alias: Alias): QueryBuilder<T, ComposeRawSelect<S, {
3012
+ [K in Alias]: number;
3013
+ }>, D>;
3014
+ avgDistinct<Alias extends string = string>(column: string, alias: Alias): QueryBuilder<T, ComposeRawSelect<S, {
3015
+ [K in Alias]: number;
3016
+ }>, D>;
3017
+ rank<Alias extends string = never>(alias?: Alias, options?: WindowOptions): QueryBuilder<T, ComposeRawSelect<S, {
3018
+ [K in Alias]: number;
3019
+ }>, D>;
3020
+ denseRank<Alias extends string = never>(alias?: Alias, options?: WindowOptions): QueryBuilder<T, ComposeRawSelect<S, {
3021
+ [K in Alias]: number;
3022
+ }>, D>;
3023
+ rowNumber<Alias extends string = never>(alias?: Alias, options?: WindowOptions): QueryBuilder<T, ComposeRawSelect<S, {
3024
+ [K in Alias]: number;
3025
+ }>, D>;
3008
3026
  /**
3009
3027
  * @description Executes the query and returns true if the query returns at least one result, false otherwise.
3010
3028
  */
@@ -4854,6 +4872,7 @@ declare abstract class JoinQueryBuilder<T extends Model, S extends Record<string
4854
4872
  declare class SelectQueryBuilder<T extends Model, S extends Record<string, any> = Record<string, any>> extends JoinQueryBuilder<T, S> {
4855
4873
  protected dbType: SqlDataSourceType;
4856
4874
  protected modelSelectedColumns: string[];
4875
+ protected userOutputColumns: string[];
4857
4876
  protected withQuery?: string;
4858
4877
  protected fromNode: FromNode;
4859
4878
  protected distinctNode: DistinctNode | null;
@@ -4875,6 +4894,14 @@ declare class SelectQueryBuilder<T extends Model, S extends Record<string, any>
4875
4894
  * @description Adds a raw SELECT statement to the query
4876
4895
  */
4877
4896
  selectRaw(statement: string): this;
4897
+ /**
4898
+ * @description Output names the user authored into the SELECT list: raw
4899
+ * statements, tuple aliases, and the aliases passed to selectFunc, window,
4900
+ * distinct-aggregate and JSON select helpers. The serializer returns these
4901
+ * keys verbatim instead of mapping them back to model property names.
4902
+ * @internal
4903
+ */
4904
+ protected collectUserOutputNames(): string[];
4878
4905
  /**
4879
4906
  * @description Selects a SQL function applied to a column with a typed alias.
4880
4907
  * @description Provides intellisense for common SQL functions while accepting any custom function.
@@ -4891,15 +4918,15 @@ declare class SelectQueryBuilder<T extends Model, S extends Record<string, any>
4891
4918
  * @description Adds `count(DISTINCT column)` to the SELECT list.
4892
4919
  * @example .countDistinct("status", "statuses").many()
4893
4920
  */
4894
- countDistinct(column: string, alias?: string): this;
4921
+ countDistinct(column: string, alias: string): this;
4895
4922
  /**
4896
4923
  * @description Adds `sum(DISTINCT column)` to the SELECT list.
4897
4924
  */
4898
- sumDistinct(column: string, alias?: string): this;
4925
+ sumDistinct(column: string, alias: string): this;
4899
4926
  /**
4900
4927
  * @description Adds `avg(DISTINCT column)` to the SELECT list.
4901
4928
  */
4902
- avgDistinct(column: string, alias?: string): this;
4929
+ avgDistinct(column: string, alias: string): this;
4903
4930
  /**
4904
4931
  * @description Adds `rank() OVER (...)` to the SELECT list.
4905
4932
  * @example .rank("r", { partitionBy: "teamId", orderBy: { column: "score", order: "desc" } })
@@ -7084,6 +7111,24 @@ declare class ModelQueryBuilder<T extends Model, S extends Record<string, any> =
7084
7111
  selectFunc<F extends SqlFunction, Alias extends string>(sqlFunc: F, column: ModelKey<T> | "*" | (string & {}), alias: Alias): ModelQueryBuilder<T, ComposeSelect<S, {
7085
7112
  [K in Alias]: SqlFunctionReturnType<F>;
7086
7113
  }>, R, D>;
7114
+ countDistinct<Alias extends string = string>(column: ModelKey<T> | (string & {}), alias: Alias): ModelQueryBuilder<T, ComposeSelect<S, {
7115
+ [K in Alias]: number;
7116
+ }>, R, D>;
7117
+ sumDistinct<Alias extends string = string>(column: ModelKey<T> | (string & {}), alias: Alias): ModelQueryBuilder<T, ComposeSelect<S, {
7118
+ [K in Alias]: number;
7119
+ }>, R, D>;
7120
+ avgDistinct<Alias extends string = string>(column: ModelKey<T> | (string & {}), alias: Alias): ModelQueryBuilder<T, ComposeSelect<S, {
7121
+ [K in Alias]: number;
7122
+ }>, R, D>;
7123
+ rank<Alias extends string = never>(alias?: Alias, options?: WindowOptions): ModelQueryBuilder<T, ComposeSelect<S, {
7124
+ [K in Alias]: number;
7125
+ }>, R, D>;
7126
+ denseRank<Alias extends string = never>(alias?: Alias, options?: WindowOptions): ModelQueryBuilder<T, ComposeSelect<S, {
7127
+ [K in Alias]: number;
7128
+ }>, R, D>;
7129
+ rowNumber<Alias extends string = never>(alias?: Alias, options?: WindowOptions): ModelQueryBuilder<T, ComposeSelect<S, {
7130
+ [K in Alias]: number;
7131
+ }>, R, D>;
7087
7132
  /**
7088
7133
  * @description Clears the SELECT clause and resets to default model type
7089
7134
  * @example
package/lib/index.d.ts CHANGED
@@ -3005,6 +3005,24 @@ declare class QueryBuilder<T extends Model = any, S extends Record<string, any>
3005
3005
  selectJsonRaw<ValueType = any, Alias extends string = string>(raw: string, alias: Alias): QueryBuilder<T, ComposeRawSelect<S, {
3006
3006
  [K in Alias]: ValueType;
3007
3007
  }>, D>;
3008
+ countDistinct<Alias extends string = string>(column: string, alias: Alias): QueryBuilder<T, ComposeRawSelect<S, {
3009
+ [K in Alias]: number;
3010
+ }>, D>;
3011
+ sumDistinct<Alias extends string = string>(column: string, alias: Alias): QueryBuilder<T, ComposeRawSelect<S, {
3012
+ [K in Alias]: number;
3013
+ }>, D>;
3014
+ avgDistinct<Alias extends string = string>(column: string, alias: Alias): QueryBuilder<T, ComposeRawSelect<S, {
3015
+ [K in Alias]: number;
3016
+ }>, D>;
3017
+ rank<Alias extends string = never>(alias?: Alias, options?: WindowOptions): QueryBuilder<T, ComposeRawSelect<S, {
3018
+ [K in Alias]: number;
3019
+ }>, D>;
3020
+ denseRank<Alias extends string = never>(alias?: Alias, options?: WindowOptions): QueryBuilder<T, ComposeRawSelect<S, {
3021
+ [K in Alias]: number;
3022
+ }>, D>;
3023
+ rowNumber<Alias extends string = never>(alias?: Alias, options?: WindowOptions): QueryBuilder<T, ComposeRawSelect<S, {
3024
+ [K in Alias]: number;
3025
+ }>, D>;
3008
3026
  /**
3009
3027
  * @description Executes the query and returns true if the query returns at least one result, false otherwise.
3010
3028
  */
@@ -4854,6 +4872,7 @@ declare abstract class JoinQueryBuilder<T extends Model, S extends Record<string
4854
4872
  declare class SelectQueryBuilder<T extends Model, S extends Record<string, any> = Record<string, any>> extends JoinQueryBuilder<T, S> {
4855
4873
  protected dbType: SqlDataSourceType;
4856
4874
  protected modelSelectedColumns: string[];
4875
+ protected userOutputColumns: string[];
4857
4876
  protected withQuery?: string;
4858
4877
  protected fromNode: FromNode;
4859
4878
  protected distinctNode: DistinctNode | null;
@@ -4875,6 +4894,14 @@ declare class SelectQueryBuilder<T extends Model, S extends Record<string, any>
4875
4894
  * @description Adds a raw SELECT statement to the query
4876
4895
  */
4877
4896
  selectRaw(statement: string): this;
4897
+ /**
4898
+ * @description Output names the user authored into the SELECT list: raw
4899
+ * statements, tuple aliases, and the aliases passed to selectFunc, window,
4900
+ * distinct-aggregate and JSON select helpers. The serializer returns these
4901
+ * keys verbatim instead of mapping them back to model property names.
4902
+ * @internal
4903
+ */
4904
+ protected collectUserOutputNames(): string[];
4878
4905
  /**
4879
4906
  * @description Selects a SQL function applied to a column with a typed alias.
4880
4907
  * @description Provides intellisense for common SQL functions while accepting any custom function.
@@ -4891,15 +4918,15 @@ declare class SelectQueryBuilder<T extends Model, S extends Record<string, any>
4891
4918
  * @description Adds `count(DISTINCT column)` to the SELECT list.
4892
4919
  * @example .countDistinct("status", "statuses").many()
4893
4920
  */
4894
- countDistinct(column: string, alias?: string): this;
4921
+ countDistinct(column: string, alias: string): this;
4895
4922
  /**
4896
4923
  * @description Adds `sum(DISTINCT column)` to the SELECT list.
4897
4924
  */
4898
- sumDistinct(column: string, alias?: string): this;
4925
+ sumDistinct(column: string, alias: string): this;
4899
4926
  /**
4900
4927
  * @description Adds `avg(DISTINCT column)` to the SELECT list.
4901
4928
  */
4902
- avgDistinct(column: string, alias?: string): this;
4929
+ avgDistinct(column: string, alias: string): this;
4903
4930
  /**
4904
4931
  * @description Adds `rank() OVER (...)` to the SELECT list.
4905
4932
  * @example .rank("r", { partitionBy: "teamId", orderBy: { column: "score", order: "desc" } })
@@ -7084,6 +7111,24 @@ declare class ModelQueryBuilder<T extends Model, S extends Record<string, any> =
7084
7111
  selectFunc<F extends SqlFunction, Alias extends string>(sqlFunc: F, column: ModelKey<T> | "*" | (string & {}), alias: Alias): ModelQueryBuilder<T, ComposeSelect<S, {
7085
7112
  [K in Alias]: SqlFunctionReturnType<F>;
7086
7113
  }>, R, D>;
7114
+ countDistinct<Alias extends string = string>(column: ModelKey<T> | (string & {}), alias: Alias): ModelQueryBuilder<T, ComposeSelect<S, {
7115
+ [K in Alias]: number;
7116
+ }>, R, D>;
7117
+ sumDistinct<Alias extends string = string>(column: ModelKey<T> | (string & {}), alias: Alias): ModelQueryBuilder<T, ComposeSelect<S, {
7118
+ [K in Alias]: number;
7119
+ }>, R, D>;
7120
+ avgDistinct<Alias extends string = string>(column: ModelKey<T> | (string & {}), alias: Alias): ModelQueryBuilder<T, ComposeSelect<S, {
7121
+ [K in Alias]: number;
7122
+ }>, R, D>;
7123
+ rank<Alias extends string = never>(alias?: Alias, options?: WindowOptions): ModelQueryBuilder<T, ComposeSelect<S, {
7124
+ [K in Alias]: number;
7125
+ }>, R, D>;
7126
+ denseRank<Alias extends string = never>(alias?: Alias, options?: WindowOptions): ModelQueryBuilder<T, ComposeSelect<S, {
7127
+ [K in Alias]: number;
7128
+ }>, R, D>;
7129
+ rowNumber<Alias extends string = never>(alias?: Alias, options?: WindowOptions): ModelQueryBuilder<T, ComposeSelect<S, {
7130
+ [K in Alias]: number;
7131
+ }>, R, D>;
7087
7132
  /**
7088
7133
  * @description Clears the SELECT clause and resets to default model type
7089
7134
  * @example