hysteria-orm 10.2.1 → 10.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/cli.cjs +14 -14
- package/lib/cli.cjs.map +1 -1
- package/lib/cli.js +14 -14
- package/lib/cli.js.map +1 -1
- package/lib/index.cjs +12 -12
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +409 -3
- package/lib/index.d.ts +409 -3
- package/lib/index.js +12 -12
- package/lib/index.js.map +1 -1
- package/package.json +7 -1
package/lib/index.d.cts
CHANGED
|
@@ -707,6 +707,318 @@ type ForeignKeyOptions = CommonConstraintOptions & {
|
|
|
707
707
|
};
|
|
708
708
|
type CreateTableContext = "alter_table" | "create_table";
|
|
709
709
|
|
|
710
|
+
/**
|
|
711
|
+
* @description AdminJS plugin types - All AdminJS imports are done at runtime via dynamic import()
|
|
712
|
+
* @description This ensures the plugin is completely optional
|
|
713
|
+
*/
|
|
714
|
+
|
|
715
|
+
/**
|
|
716
|
+
* @description Configuration options for AdminJS integration
|
|
717
|
+
*/
|
|
718
|
+
type AdminJsOptions = {
|
|
719
|
+
/**
|
|
720
|
+
* @description Whether to enable AdminJS admin panel
|
|
721
|
+
* @default false
|
|
722
|
+
*/
|
|
723
|
+
enabled?: boolean;
|
|
724
|
+
/**
|
|
725
|
+
* @description The root path for the AdminJS panel
|
|
726
|
+
* @default '/admin'
|
|
727
|
+
*/
|
|
728
|
+
rootPath?: string;
|
|
729
|
+
/**
|
|
730
|
+
* @description Custom branding options for AdminJS
|
|
731
|
+
*/
|
|
732
|
+
branding?: AdminJsBranding;
|
|
733
|
+
/**
|
|
734
|
+
* @description Models to expose in the AdminJS panel
|
|
735
|
+
* @description If not provided, all models registered in the SqlDataSource will be used
|
|
736
|
+
*/
|
|
737
|
+
resources?: (typeof Model)[];
|
|
738
|
+
/**
|
|
739
|
+
* @description Custom resource options for specific models
|
|
740
|
+
*/
|
|
741
|
+
resourceOptions?: Record<string, AdminJsResourceOptions>;
|
|
742
|
+
/**
|
|
743
|
+
* @description Locale settings for AdminJS
|
|
744
|
+
*/
|
|
745
|
+
locale?: AdminJsLocale;
|
|
746
|
+
/**
|
|
747
|
+
* @description Assets configuration
|
|
748
|
+
*/
|
|
749
|
+
assets?: AdminJsAssets;
|
|
750
|
+
/**
|
|
751
|
+
* @description Settings configuration
|
|
752
|
+
*/
|
|
753
|
+
settings?: AdminJsSettings;
|
|
754
|
+
/**
|
|
755
|
+
* @description Custom pages to add to AdminJS
|
|
756
|
+
*/
|
|
757
|
+
pages?: Record<string, AdminJsPage>;
|
|
758
|
+
};
|
|
759
|
+
type AdminJsBranding = {
|
|
760
|
+
/**
|
|
761
|
+
* @description Company name displayed in the admin panel
|
|
762
|
+
*/
|
|
763
|
+
companyName?: string;
|
|
764
|
+
/**
|
|
765
|
+
* @description URL to the company logo
|
|
766
|
+
*/
|
|
767
|
+
logo?: string;
|
|
768
|
+
/**
|
|
769
|
+
* @description URL to the favicon
|
|
770
|
+
*/
|
|
771
|
+
favicon?: string;
|
|
772
|
+
/**
|
|
773
|
+
* @description Whether to display the "Made with AdminJS" notice
|
|
774
|
+
* @default true
|
|
775
|
+
*/
|
|
776
|
+
withMadeWithLove?: boolean;
|
|
777
|
+
/**
|
|
778
|
+
* @description Theme settings
|
|
779
|
+
*/
|
|
780
|
+
theme?: Record<string, unknown>;
|
|
781
|
+
/**
|
|
782
|
+
* @description Software brothers branding override
|
|
783
|
+
*/
|
|
784
|
+
softwareBrothers?: boolean;
|
|
785
|
+
};
|
|
786
|
+
type AdminJsResourceOptions = {
|
|
787
|
+
/**
|
|
788
|
+
* @description Navigation settings for this resource
|
|
789
|
+
*/
|
|
790
|
+
navigation?: {
|
|
791
|
+
name?: string;
|
|
792
|
+
icon?: string;
|
|
793
|
+
} | null;
|
|
794
|
+
/**
|
|
795
|
+
* @description Custom name for the resource
|
|
796
|
+
*/
|
|
797
|
+
name?: string;
|
|
798
|
+
/**
|
|
799
|
+
* @description Properties configuration
|
|
800
|
+
*/
|
|
801
|
+
properties?: Record<string, AdminJsPropertyOptions>;
|
|
802
|
+
/**
|
|
803
|
+
* @description Actions configuration
|
|
804
|
+
*/
|
|
805
|
+
actions?: Record<string, AdminJsActionOptions>;
|
|
806
|
+
/**
|
|
807
|
+
* @description Sort configuration
|
|
808
|
+
*/
|
|
809
|
+
sort?: {
|
|
810
|
+
sortBy?: string;
|
|
811
|
+
direction?: "asc" | "desc";
|
|
812
|
+
};
|
|
813
|
+
/**
|
|
814
|
+
* @description List of properties to display in list view
|
|
815
|
+
*/
|
|
816
|
+
listProperties?: string[];
|
|
817
|
+
/**
|
|
818
|
+
* @description List of properties to display in show view
|
|
819
|
+
*/
|
|
820
|
+
showProperties?: string[];
|
|
821
|
+
/**
|
|
822
|
+
* @description List of properties to display in edit view
|
|
823
|
+
*/
|
|
824
|
+
editProperties?: string[];
|
|
825
|
+
/**
|
|
826
|
+
* @description List of properties to display in filter view
|
|
827
|
+
*/
|
|
828
|
+
filterProperties?: string[];
|
|
829
|
+
/**
|
|
830
|
+
* @description Parent resource for navigation grouping
|
|
831
|
+
*/
|
|
832
|
+
parent?: {
|
|
833
|
+
name?: string;
|
|
834
|
+
icon?: string;
|
|
835
|
+
} | null;
|
|
836
|
+
};
|
|
837
|
+
type AdminJsPropertyOptions = {
|
|
838
|
+
/**
|
|
839
|
+
* @description Whether the property is visible in the list view
|
|
840
|
+
*/
|
|
841
|
+
isVisible?: boolean | {
|
|
842
|
+
list?: boolean;
|
|
843
|
+
edit?: boolean;
|
|
844
|
+
filter?: boolean;
|
|
845
|
+
show?: boolean;
|
|
846
|
+
};
|
|
847
|
+
/**
|
|
848
|
+
* @description Position of the property in forms
|
|
849
|
+
*/
|
|
850
|
+
position?: number;
|
|
851
|
+
/**
|
|
852
|
+
* @description Whether the property is required
|
|
853
|
+
*/
|
|
854
|
+
isRequired?: boolean;
|
|
855
|
+
/**
|
|
856
|
+
* @description Whether the property is an ID
|
|
857
|
+
*/
|
|
858
|
+
isId?: boolean;
|
|
859
|
+
/**
|
|
860
|
+
* @description Whether the property is a title
|
|
861
|
+
*/
|
|
862
|
+
isTitle?: boolean;
|
|
863
|
+
/**
|
|
864
|
+
* @description Whether the property is disabled in edit forms
|
|
865
|
+
*/
|
|
866
|
+
isDisabled?: boolean;
|
|
867
|
+
/**
|
|
868
|
+
* @description Whether the property is an array
|
|
869
|
+
*/
|
|
870
|
+
isArray?: boolean;
|
|
871
|
+
/**
|
|
872
|
+
* @description Whether the property is sortable
|
|
873
|
+
*/
|
|
874
|
+
isSortable?: boolean;
|
|
875
|
+
/**
|
|
876
|
+
* @description Property type override
|
|
877
|
+
*/
|
|
878
|
+
type?: string;
|
|
879
|
+
/**
|
|
880
|
+
* @description Available values for select/enum properties
|
|
881
|
+
*/
|
|
882
|
+
availableValues?: Array<{
|
|
883
|
+
value: string | number;
|
|
884
|
+
label: string;
|
|
885
|
+
}>;
|
|
886
|
+
/**
|
|
887
|
+
* @description Custom components for rendering
|
|
888
|
+
*/
|
|
889
|
+
components?: {
|
|
890
|
+
list?: string;
|
|
891
|
+
show?: string;
|
|
892
|
+
edit?: string;
|
|
893
|
+
filter?: string;
|
|
894
|
+
};
|
|
895
|
+
/**
|
|
896
|
+
* @description Custom props to pass to components
|
|
897
|
+
*/
|
|
898
|
+
props?: Record<string, unknown>;
|
|
899
|
+
/**
|
|
900
|
+
* @description Description shown in the UI
|
|
901
|
+
*/
|
|
902
|
+
description?: string;
|
|
903
|
+
};
|
|
904
|
+
type AdminJsActionOptions = {
|
|
905
|
+
/**
|
|
906
|
+
* @description Action type
|
|
907
|
+
*/
|
|
908
|
+
actionType?: "record" | "resource" | "bulk";
|
|
909
|
+
/**
|
|
910
|
+
* @description Whether the action is visible
|
|
911
|
+
*/
|
|
912
|
+
isVisible?: boolean;
|
|
913
|
+
/**
|
|
914
|
+
* @description Whether the action is accessible
|
|
915
|
+
*/
|
|
916
|
+
isAccessible?: boolean;
|
|
917
|
+
/**
|
|
918
|
+
* @description Icon for the action
|
|
919
|
+
*/
|
|
920
|
+
icon?: string;
|
|
921
|
+
/**
|
|
922
|
+
* @description Label for the action
|
|
923
|
+
*/
|
|
924
|
+
label?: string;
|
|
925
|
+
/**
|
|
926
|
+
* @description Guard message shown before action execution
|
|
927
|
+
*/
|
|
928
|
+
guard?: string;
|
|
929
|
+
/**
|
|
930
|
+
* @description Whether to show the action in the drawer
|
|
931
|
+
*/
|
|
932
|
+
showInDrawer?: boolean;
|
|
933
|
+
/**
|
|
934
|
+
* @description Whether to hide the action button
|
|
935
|
+
*/
|
|
936
|
+
hideActionHeader?: boolean;
|
|
937
|
+
/**
|
|
938
|
+
* @description Custom component for the action
|
|
939
|
+
*/
|
|
940
|
+
component?: string | false;
|
|
941
|
+
/**
|
|
942
|
+
* @description Container width for the action
|
|
943
|
+
*/
|
|
944
|
+
containerWidth?: number | string;
|
|
945
|
+
/**
|
|
946
|
+
* @description Layout configuration
|
|
947
|
+
*/
|
|
948
|
+
layout?: unknown[];
|
|
949
|
+
};
|
|
950
|
+
type AdminJsLocale = {
|
|
951
|
+
/**
|
|
952
|
+
* @description Language code
|
|
953
|
+
*/
|
|
954
|
+
language?: string;
|
|
955
|
+
/**
|
|
956
|
+
* @description Available languages
|
|
957
|
+
*/
|
|
958
|
+
availableLanguages?: string[];
|
|
959
|
+
/**
|
|
960
|
+
* @description Custom translations
|
|
961
|
+
*/
|
|
962
|
+
translations?: Record<string, Record<string, unknown>>;
|
|
963
|
+
/**
|
|
964
|
+
* @description Whether to show the language selector
|
|
965
|
+
*/
|
|
966
|
+
withBackend?: boolean;
|
|
967
|
+
};
|
|
968
|
+
type AdminJsAssets = {
|
|
969
|
+
/**
|
|
970
|
+
* @description Custom styles to include
|
|
971
|
+
*/
|
|
972
|
+
styles?: string[];
|
|
973
|
+
/**
|
|
974
|
+
* @description Custom scripts to include
|
|
975
|
+
*/
|
|
976
|
+
scripts?: string[];
|
|
977
|
+
};
|
|
978
|
+
type AdminJsSettings = {
|
|
979
|
+
/**
|
|
980
|
+
* @description Default number of items per page
|
|
981
|
+
*/
|
|
982
|
+
defaultPerPage?: number;
|
|
983
|
+
};
|
|
984
|
+
type AdminJsPage = {
|
|
985
|
+
/**
|
|
986
|
+
* @description Page component path
|
|
987
|
+
*/
|
|
988
|
+
component?: string;
|
|
989
|
+
/**
|
|
990
|
+
* @description Page icon
|
|
991
|
+
*/
|
|
992
|
+
icon?: string;
|
|
993
|
+
/**
|
|
994
|
+
* @description Handler for the page
|
|
995
|
+
*/
|
|
996
|
+
handler?: (request: unknown, response: unknown, context: unknown) => Promise<unknown>;
|
|
997
|
+
};
|
|
998
|
+
type AdminJsAdminInstance = {
|
|
999
|
+
options: {
|
|
1000
|
+
rootPath: string;
|
|
1001
|
+
[key: string]: unknown;
|
|
1002
|
+
};
|
|
1003
|
+
watch: () => Promise<void>;
|
|
1004
|
+
initialize: () => Promise<void>;
|
|
1005
|
+
resources: unknown[];
|
|
1006
|
+
findResource: (resourceId: string) => unknown;
|
|
1007
|
+
};
|
|
1008
|
+
/**
|
|
1009
|
+
* @description Return type for getAdminJs method
|
|
1010
|
+
*/
|
|
1011
|
+
type AdminJsInstance = {
|
|
1012
|
+
/**
|
|
1013
|
+
* @description The AdminJS instance
|
|
1014
|
+
*/
|
|
1015
|
+
admin: AdminJsAdminInstance;
|
|
1016
|
+
/**
|
|
1017
|
+
* @description Express router for AdminJS (if using express adapter)
|
|
1018
|
+
*/
|
|
1019
|
+
router?: unknown;
|
|
1020
|
+
};
|
|
1021
|
+
|
|
710
1022
|
interface CacheAdapter {
|
|
711
1023
|
get<T = void>(key: string): Promise<T>;
|
|
712
1024
|
set<T = any>(key: string, data: T, ttl?: number): Promise<void>;
|
|
@@ -1623,7 +1935,7 @@ declare abstract class Relation {
|
|
|
1623
1935
|
|
|
1624
1936
|
type ColumnDataType = Exclude<keyof CreateTableBuilder, "enum" | "rawColumn" | "custom"> | readonly string[];
|
|
1625
1937
|
type ColumnDataTypeOptionWithLength = {
|
|
1626
|
-
type?: "char" | "varchar" | "string" | "uuid" | "ulid" | "varbinary" | "integer" | "tinyint" | "smallint" | "mediumint" | "bigint";
|
|
1938
|
+
type?: "char" | "varchar" | "string" | "uuid" | "ulid" | "varbinary" | "integer" | "tinyint" | "smallint" | "mediumint" | "bigint" | "increment" | "bigIncrement";
|
|
1627
1939
|
length?: number;
|
|
1628
1940
|
};
|
|
1629
1941
|
type ColumnDataTypeOptionWithEnum = {
|
|
@@ -3072,6 +3384,14 @@ declare class SqlDataSource extends DataSource {
|
|
|
3072
3384
|
* @description Maps global keys to specific handlers for cache handling
|
|
3073
3385
|
*/
|
|
3074
3386
|
cacheKeys: CacheKeys;
|
|
3387
|
+
/**
|
|
3388
|
+
* @description AdminJS configuration options
|
|
3389
|
+
*/
|
|
3390
|
+
private adminJsOptions?;
|
|
3391
|
+
/**
|
|
3392
|
+
* @description Cached AdminJS instance
|
|
3393
|
+
*/
|
|
3394
|
+
private adminJsInstance?;
|
|
3075
3395
|
/**
|
|
3076
3396
|
* @description Establishes the default singleton connection used by default by all the Models, if not configuration is passed, env variables will be used instead
|
|
3077
3397
|
* @description You can continue to use the global sql class exported by hysteria after the connection without having to rely on the return of this function
|
|
@@ -3208,6 +3528,32 @@ declare class SqlDataSource extends DataSource {
|
|
|
3208
3528
|
* ```
|
|
3209
3529
|
*/
|
|
3210
3530
|
static rawStatement(value: string): RawNode;
|
|
3531
|
+
/**
|
|
3532
|
+
* @description Initializes AdminJS with the configured options
|
|
3533
|
+
* @description All AdminJS dependencies are loaded at runtime via dynamic import() to keep the plugin optional
|
|
3534
|
+
* @description To use AdminJS, install: npm install adminjs
|
|
3535
|
+
* @throws {HysteriaError} If AdminJS is not enabled or connection not established
|
|
3536
|
+
* @returns The AdminJS instance
|
|
3537
|
+
*/
|
|
3538
|
+
static initializeAdminJs(): Promise<AdminJsAdminInstance>;
|
|
3539
|
+
/**
|
|
3540
|
+
* @description Initializes AdminJS with Express router
|
|
3541
|
+
* @description All AdminJS dependencies are loaded at runtime via dynamic import() to keep the plugin optional
|
|
3542
|
+
* @description To use AdminJS with Express, install: npm install adminjs @adminjs/express express express-formidable --save-dev
|
|
3543
|
+
* @throws {HysteriaError} If AdminJS is not enabled or connection not established
|
|
3544
|
+
* @returns The AdminJS instance with Express router
|
|
3545
|
+
*/
|
|
3546
|
+
static initializeAdminJsExpress(): Promise<AdminJsInstance>;
|
|
3547
|
+
/**
|
|
3548
|
+
* @description Returns the AdminJS instance if initialized
|
|
3549
|
+
* @returns The AdminJS instance or undefined if not initialized
|
|
3550
|
+
*/
|
|
3551
|
+
static getAdminJs(): AdminJsInstance | undefined;
|
|
3552
|
+
/**
|
|
3553
|
+
* @description Checks if AdminJS is enabled
|
|
3554
|
+
* @returns True if AdminJS is enabled
|
|
3555
|
+
*/
|
|
3556
|
+
static isAdminJsEnabled(): boolean;
|
|
3211
3557
|
private constructor();
|
|
3212
3558
|
/**
|
|
3213
3559
|
* @description Uses the cache adapter to get a value from the cache
|
|
@@ -3371,6 +3717,37 @@ declare class SqlDataSource extends DataSource {
|
|
|
3371
3717
|
modelName: string;
|
|
3372
3718
|
$id?: string;
|
|
3373
3719
|
})[];
|
|
3720
|
+
/**
|
|
3721
|
+
* @description Initializes AdminJS with the configured options
|
|
3722
|
+
* @description All AdminJS dependencies are loaded at runtime via dynamic import() to keep the plugin optional
|
|
3723
|
+
* @description To use AdminJS, install: npm install adminjs
|
|
3724
|
+
* @throws {HysteriaError} If AdminJS is not enabled in the configuration
|
|
3725
|
+
* @returns The AdminJS instance
|
|
3726
|
+
*/
|
|
3727
|
+
initializeAdminJs(): Promise<AdminJsAdminInstance>;
|
|
3728
|
+
/**
|
|
3729
|
+
* @description Initializes AdminJS with Express router
|
|
3730
|
+
* @description All AdminJS dependencies are loaded at runtime via dynamic import() to keep the plugin optional
|
|
3731
|
+
* @description To use AdminJS with Express, install: npm install adminjs @adminjs/express express express-formidable --save-dev
|
|
3732
|
+
* @throws {HysteriaError} If AdminJS is not enabled in the configuration
|
|
3733
|
+
* @returns The AdminJS instance with Express router
|
|
3734
|
+
*/
|
|
3735
|
+
initializeAdminJsExpress(): Promise<AdminJsInstance>;
|
|
3736
|
+
/**
|
|
3737
|
+
* @description Returns the AdminJS instance if initialized
|
|
3738
|
+
* @returns The AdminJS instance or undefined if not initialized
|
|
3739
|
+
*/
|
|
3740
|
+
getAdminJs(): AdminJsInstance | undefined;
|
|
3741
|
+
/**
|
|
3742
|
+
* @description Returns the AdminJS configuration options
|
|
3743
|
+
* @returns The AdminJS configuration options or undefined if not configured
|
|
3744
|
+
*/
|
|
3745
|
+
getAdminJsOptions(): AdminJsOptions | undefined;
|
|
3746
|
+
/**
|
|
3747
|
+
* @description Checks if AdminJS is enabled
|
|
3748
|
+
* @returns True if AdminJS is enabled
|
|
3749
|
+
*/
|
|
3750
|
+
isAdminJsEnabled(): boolean;
|
|
3374
3751
|
/**
|
|
3375
3752
|
* @description Introspects table columns metadata
|
|
3376
3753
|
*/
|
|
@@ -3441,6 +3818,7 @@ type SqlDataSourceInput<D extends SqlDataSourceType, T extends Record<string, Sq
|
|
|
3441
3818
|
models?: T;
|
|
3442
3819
|
/**
|
|
3443
3820
|
* @description The driver specific options to use for the sql data source, it's used to configure the driver specific options for the sql data source
|
|
3821
|
+
* @warning For usage with types, you must have driver types installed if the driver handles types in a type package like e.g. `@types/pg`
|
|
3444
3822
|
*/
|
|
3445
3823
|
driverOptions?: SqlDriverSpecificOptions<D>;
|
|
3446
3824
|
/**
|
|
@@ -3450,6 +3828,11 @@ type SqlDataSourceInput<D extends SqlDataSourceType, T extends Record<string, Sq
|
|
|
3450
3828
|
cacheAdapter?: CacheAdapter;
|
|
3451
3829
|
keys: C;
|
|
3452
3830
|
};
|
|
3831
|
+
/**
|
|
3832
|
+
* @description AdminJS configuration for the admin panel
|
|
3833
|
+
* @description To use AdminJS, install: `npm install adminjs`
|
|
3834
|
+
*/
|
|
3835
|
+
adminJs?: AdminJsOptions;
|
|
3453
3836
|
} & (MysqlSqlDataSourceInput | PostgresSqlDataSourceInput | SqliteDataSourceInput);
|
|
3454
3837
|
type UseConnectionInput<D extends SqlDataSourceType, T extends Record<string, SqlDataSourceModel> = {}, C extends CacheKeys = {}> = {
|
|
3455
3838
|
readonly type: Exclude<DataSourceType, "mongo">;
|
|
@@ -3462,6 +3845,11 @@ type UseConnectionInput<D extends SqlDataSourceType, T extends Record<string, Sq
|
|
|
3462
3845
|
cacheAdapter: CacheAdapter;
|
|
3463
3846
|
keys: C;
|
|
3464
3847
|
};
|
|
3848
|
+
/**
|
|
3849
|
+
* @description AdminJS configuration for the admin panel
|
|
3850
|
+
* @description AdminJS is completely optional - dependencies are loaded at runtime via dynamic import()
|
|
3851
|
+
*/
|
|
3852
|
+
adminJs?: AdminJsOptions;
|
|
3465
3853
|
} & (NotNullableMysqlSqlDataSourceInput | NotNullablePostgresSqlDataSourceInput | NotNullableSqliteDataSourceInput);
|
|
3466
3854
|
type SqlDataSourceType = Exclude<DataSourceType, "mongo">;
|
|
3467
3855
|
type SqlCloneOptions = {
|
|
@@ -4372,6 +4760,8 @@ declare namespace column {
|
|
|
4372
4760
|
var ulid: typeof ulidColumn;
|
|
4373
4761
|
var integer: typeof integerColumn;
|
|
4374
4762
|
var float: typeof floatColumn;
|
|
4763
|
+
var increment: typeof incrementColumn;
|
|
4764
|
+
var bigIncrement: typeof bigIncrementColumn;
|
|
4375
4765
|
var encryption: {
|
|
4376
4766
|
symmetric: typeof symmetric;
|
|
4377
4767
|
asymmetric: typeof asymmetric;
|
|
@@ -4385,6 +4775,22 @@ declare function floatColumn(options?: Omit<ColumnOptions, "serialize">): Proper
|
|
|
4385
4775
|
* @description Defaults type to integer for migration generation
|
|
4386
4776
|
*/
|
|
4387
4777
|
declare function integerColumn(options?: Omit<ColumnOptions, "serialize">): PropertyDecorator;
|
|
4778
|
+
/**
|
|
4779
|
+
* @description Decorator to define an auto-incrementing integer primary key column
|
|
4780
|
+
* @description Automatically sets primaryKey: true and nullable: false
|
|
4781
|
+
* @mysql INTEGER with AUTO_INCREMENT
|
|
4782
|
+
* @postgres SERIAL (INTEGER with auto-increment sequence)
|
|
4783
|
+
* @sqlite INTEGER PRIMARY KEY AUTOINCREMENT
|
|
4784
|
+
*/
|
|
4785
|
+
declare function incrementColumn(options?: Omit<ColumnOptions, "serialize" | "primaryKey" | "nullable">): PropertyDecorator;
|
|
4786
|
+
/**
|
|
4787
|
+
* @description Decorator to define an auto-incrementing bigint primary key column
|
|
4788
|
+
* @description Automatically sets primaryKey: true and nullable: false
|
|
4789
|
+
* @mysql BIGINT with AUTO_INCREMENT
|
|
4790
|
+
* @postgres BIGSERIAL (BIGINT with auto-increment sequence)
|
|
4791
|
+
* @sqlite INTEGER PRIMARY KEY AUTOINCREMENT
|
|
4792
|
+
*/
|
|
4793
|
+
declare function bigIncrementColumn(options?: Omit<ColumnOptions, "serialize" | "primaryKey" | "nullable">): PropertyDecorator;
|
|
4388
4794
|
/**
|
|
4389
4795
|
* @description Decorator to define a uuid column in the model
|
|
4390
4796
|
* @description This will automatically generate a uuid if no value is provided
|
|
@@ -5364,7 +5770,7 @@ type WithPerformanceResult<R = any> = [string, R];
|
|
|
5364
5770
|
*/
|
|
5365
5771
|
declare const withPerformance: <A extends any[], R>(fn: (...args: A) => Promise<R>, returnType?: "millis" | "seconds", fix?: number) => (...args: A) => Promise<WithPerformanceResult<R>>;
|
|
5366
5772
|
|
|
5367
|
-
type HysteriaErrorCode = "ROW_NOT_FOUND" | `UNSUPPORTED_DATABASE_TYPE_${string}` | `RELATION_TYPE_NOT_SUPPORTED_${string}` | `NOT_SUPPORTED_IN_${string}` | `RELATION_NOT_FOUND_IN_MODEL_${string}` | `UNKNOWN_RELATION_TYPE_${string}` | `DISTINCT_ON_NOT_SUPPORTED_IN_${string}` | `CONFLICT_COLUMNS_NOT_PRESENT_IN_DATA` | `CONFLICT_COLUMNS_NOT_PRESENT_IN_DATA_${string}` | `FOREIGN_KEY_VALUES_MISSING_FOR_HAS_ONE_RELATION_${string}` | `FOREIGN_KEY_VALUES_MISSING_FOR_BELONGS_TO_RELATION_${string}` | `PRIMARY_KEY_VALUES_MISSING_FOR_HAS_MANY_RELATION_${string}` | `MANY_TO_MANY_RELATION_NOT_FOUND_FOR_RELATED_MODEL_${string}` | `PRIMARY_KEY_VALUES_MISSING_FOR_MANY_TO_MANY_RELATION_${string}` | `RELATED_MODEL_DOES_NOT_HAVE_A_PRIMARY_KEY_${string}` | `FOR_SHARE_NOT_SUPPORTED_IN_${string}` | `SKIP_LOCKED_NOT_SUPPORTED_IN_${string}` | `LOCK_FOR_UPDATE_NOT_SUPPORTED_${string}` | `KEY_${string}_HAS_NO_HANDLER_IN_CACHE_KEYS_CONFIG` | `CACHE_ADAPTER_NOT_CONFIGURED` | `SQLITE_NOT_SUPPORTED` | `COCKROACHDB_NOT_SUPPORTED` | `RELATION_NOT_FOUND` | `POSTGRES_TABLE_REQUIRED` | `MODEL_HAS_NO_PRIMARY_KEY_VALUE` | `RELATION_NOT_MANY_TO_MANY` | "MATERIALIZED_CTE_NOT_SUPPORTED" | "DUPLICATE_MODEL_KEYS_WHILE_INSTANTIATING_MODELS" | "INVALID_ONE_PARAMETER_WHERE_CONDITION" | "INVALID_PAGINATION_PARAMETERS" | "MISSING_ALIAS_FOR_SUBQUERY" | "MODEL_HAS_NO_PRIMARY_KEY" | "PRIMARY_KEY_NOT_FOUND" | "SQLITE_ONLY_SUPPORTS_SERIALIZABLE_ISOLATION_LEVEL" | "MUST_CALL_BUILD_CTE_AT_LEAST_ONCE" | "REGEXP_NOT_SUPPORTED_IN_SQLITE" | "MANY_TO_MANY_RELATION_MUST_HAVE_A_THROUGH_MODEL" | "INSERT_FAILED" | "MULTIPLE_PRIMARY_KEYS_NOT_ALLOWED" | "FILE_NOT_A_SQL_OR_TXT_FILE" | "CONNECTION_NOT_ESTABLISHED" | "TRANSACTION_NOT_ACTIVE" | "DEVELOPMENT_ERROR" | "MIGRATION_MODULE_NOT_FOUND" | "DRIVER_NOT_FOUND" | "FILE_NOT_FOUND_OR_NOT_ACCESSIBLE" | "ENV_NOT_SET" | "REQUIRED_VALUE_NOT_SET" | "SET_FAILED" | "GET_FAILED" | "REFERENCES_OPTION_REQUIRED" | "DELETE_FAILED" | "INVALID_DEFAULT_VALUE" | "DISCONNECT_FAILED" | "FLUSH_FAILED" | "LEFT_COLUMN_NOT_PROVIDED_FOR_JOIN" | "RIGHT_COLUMN_NOT_PROVIDED_FOR_JOIN" | "MODEL_HAS_NO_PRIMARY_KEY" | "GLOBAL_TRANSACTION_ALREADY_STARTED" | "GLOBAL_TRANSACTION_NOT_STARTED" | "MYSQL_REQUIRES_TABLE_NAME_FOR_INDEX_DROP" | "INVALID_DATE_OBJECT" | "INVALID_DATE_STRING" | "FAILED_TO_PARSE_DATE" | "MIGRATION_MODULE_REQUIRES_TS_NODE" | "FAILED_TO_ENCRYPT_SYMMETRICALLY" | "FAILED_TO_DECRYPT_SYMMETRICALLY" | "FAILED_TO_ENCRYPT_ASYMMETRICALLY" | "FAILED_TO_DECRYPT_ASYMMETRICALLY" | "UNSUPPORTED_RELATION_TYPE" | "LPUSH_FAILED" | "RPUSH_FAILED" | "LPOP_FAILED" | "RPOP_FAILED" | "LRANGE_FAILED" | "LLEN_FAILED" | "HSET_FAILED" | "HMSET_FAILED" | "HGET_FAILED" | "HGETALL_FAILED" | "HMGET_FAILED" | "HDEL_FAILED" | "HEXISTS_FAILED" | "HKEYS_FAILED" | "HLEN_FAILED" | "SADD_FAILED" | "SMEMBERS_FAILED" | "SREM_FAILED" | "SISMEMBER_FAILED" | "SCARD_FAILED" | "SINTER_FAILED" | "SUNION_FAILED" | "SDIFF_FAILED" | "ZADD_FAILED" | "ZRANGE_FAILED" | "ZREVRANGE_FAILED" | "ZREM_FAILED" | "ZSCORE_FAILED" | "ZCARD_FAILED" | "SUBSCRIBE_FAILED" | "UNSUBSCRIBE_FAILED" | "PUBLISH_FAILED" | "PSUBSCRIBE_FAILED" | "PUNSUBSCRIBE_FAILED" | "EXISTS_FAILED" | "EXPIRE_FAILED" | "EXPIREAT_FAILED" | "PEXPIRE_FAILED" | "TTL_FAILED" | "PTTL_FAILED" | "PERSIST_FAILED" | "KEYS_FAILED" | "RENAME_FAILED" | "TYPE_FAILED" | "SCAN_FAILED";
|
|
5773
|
+
type HysteriaErrorCode = "ROW_NOT_FOUND" | `UNSUPPORTED_DATABASE_TYPE_${string}` | `RELATION_TYPE_NOT_SUPPORTED_${string}` | `NOT_SUPPORTED_IN_${string}` | `RELATION_NOT_FOUND_IN_MODEL_${string}` | `UNKNOWN_RELATION_TYPE_${string}` | `DISTINCT_ON_NOT_SUPPORTED_IN_${string}` | `CONFLICT_COLUMNS_NOT_PRESENT_IN_DATA` | `CONFLICT_COLUMNS_NOT_PRESENT_IN_DATA_${string}` | `FOREIGN_KEY_VALUES_MISSING_FOR_HAS_ONE_RELATION_${string}` | `FOREIGN_KEY_VALUES_MISSING_FOR_BELONGS_TO_RELATION_${string}` | `PRIMARY_KEY_VALUES_MISSING_FOR_HAS_MANY_RELATION_${string}` | `MANY_TO_MANY_RELATION_NOT_FOUND_FOR_RELATED_MODEL_${string}` | `PRIMARY_KEY_VALUES_MISSING_FOR_MANY_TO_MANY_RELATION_${string}` | `RELATED_MODEL_DOES_NOT_HAVE_A_PRIMARY_KEY_${string}` | `FOR_SHARE_NOT_SUPPORTED_IN_${string}` | `SKIP_LOCKED_NOT_SUPPORTED_IN_${string}` | `LOCK_FOR_UPDATE_NOT_SUPPORTED_${string}` | `KEY_${string}_HAS_NO_HANDLER_IN_CACHE_KEYS_CONFIG` | `CACHE_ADAPTER_NOT_CONFIGURED` | `SQLITE_NOT_SUPPORTED` | `COCKROACHDB_NOT_SUPPORTED` | `RELATION_NOT_FOUND` | `POSTGRES_TABLE_REQUIRED` | `MODEL_HAS_NO_PRIMARY_KEY_VALUE` | `RELATION_NOT_MANY_TO_MANY` | "MATERIALIZED_CTE_NOT_SUPPORTED" | "DUPLICATE_MODEL_KEYS_WHILE_INSTANTIATING_MODELS" | "INVALID_ONE_PARAMETER_WHERE_CONDITION" | "INVALID_PAGINATION_PARAMETERS" | "MISSING_ALIAS_FOR_SUBQUERY" | "MODEL_HAS_NO_PRIMARY_KEY" | "PRIMARY_KEY_NOT_FOUND" | "SQLITE_ONLY_SUPPORTS_SERIALIZABLE_ISOLATION_LEVEL" | "MUST_CALL_BUILD_CTE_AT_LEAST_ONCE" | "REGEXP_NOT_SUPPORTED_IN_SQLITE" | "MANY_TO_MANY_RELATION_MUST_HAVE_A_THROUGH_MODEL" | "INSERT_FAILED" | "MULTIPLE_PRIMARY_KEYS_NOT_ALLOWED" | "FILE_NOT_A_SQL_OR_TXT_FILE" | "CONNECTION_NOT_ESTABLISHED" | "TRANSACTION_NOT_ACTIVE" | "DEVELOPMENT_ERROR" | "MIGRATION_MODULE_NOT_FOUND" | "DRIVER_NOT_FOUND" | "FILE_NOT_FOUND_OR_NOT_ACCESSIBLE" | "ENV_NOT_SET" | "REQUIRED_VALUE_NOT_SET" | "SET_FAILED" | "GET_FAILED" | "REFERENCES_OPTION_REQUIRED" | "DELETE_FAILED" | "INVALID_DEFAULT_VALUE" | "DISCONNECT_FAILED" | "FLUSH_FAILED" | "LEFT_COLUMN_NOT_PROVIDED_FOR_JOIN" | "RIGHT_COLUMN_NOT_PROVIDED_FOR_JOIN" | "MODEL_HAS_NO_PRIMARY_KEY" | "GLOBAL_TRANSACTION_ALREADY_STARTED" | "GLOBAL_TRANSACTION_NOT_STARTED" | "MYSQL_REQUIRES_TABLE_NAME_FOR_INDEX_DROP" | "INVALID_DATE_OBJECT" | "INVALID_DATE_STRING" | "FAILED_TO_PARSE_DATE" | "MIGRATION_MODULE_REQUIRES_TS_NODE" | "FAILED_TO_ENCRYPT_SYMMETRICALLY" | "FAILED_TO_DECRYPT_SYMMETRICALLY" | "FAILED_TO_ENCRYPT_ASYMMETRICALLY" | "FAILED_TO_DECRYPT_ASYMMETRICALLY" | "UNSUPPORTED_RELATION_TYPE" | "LPUSH_FAILED" | "RPUSH_FAILED" | "LPOP_FAILED" | "RPOP_FAILED" | "LRANGE_FAILED" | "LLEN_FAILED" | "HSET_FAILED" | "HMSET_FAILED" | "HGET_FAILED" | "HGETALL_FAILED" | "HMGET_FAILED" | "HDEL_FAILED" | "HEXISTS_FAILED" | "HKEYS_FAILED" | "HLEN_FAILED" | "SADD_FAILED" | "SMEMBERS_FAILED" | "SREM_FAILED" | "SISMEMBER_FAILED" | "SCARD_FAILED" | "SINTER_FAILED" | "SUNION_FAILED" | "SDIFF_FAILED" | "ZADD_FAILED" | "ZRANGE_FAILED" | "ZREVRANGE_FAILED" | "ZREM_FAILED" | "ZSCORE_FAILED" | "ZCARD_FAILED" | "SUBSCRIBE_FAILED" | "UNSUBSCRIBE_FAILED" | "PUBLISH_FAILED" | "PSUBSCRIBE_FAILED" | "PUNSUBSCRIBE_FAILED" | "EXISTS_FAILED" | "EXPIRE_FAILED" | "EXPIREAT_FAILED" | "PEXPIRE_FAILED" | "TTL_FAILED" | "PTTL_FAILED" | "PERSIST_FAILED" | "KEYS_FAILED" | "RENAME_FAILED" | "TYPE_FAILED" | "SCAN_FAILED" | "ADMINJS_NOT_ENABLED" | "ADMINJS_INITIALIZATION_FAILED" | "ADMINJS_NO_MODELS_PROVIDED";
|
|
5368
5774
|
|
|
5369
5775
|
declare class HysteriaError extends Error {
|
|
5370
5776
|
code: HysteriaErrorCode;
|
|
@@ -5389,4 +5795,4 @@ declare const generateOpenApiModelWithMetadata: <T extends new () => Model>(mode
|
|
|
5389
5795
|
$id?: string;
|
|
5390
5796
|
}>;
|
|
5391
5797
|
|
|
5392
|
-
export { type AnnotatedModel, type AsymmetricEncryptionOptions, type AugmentedSqlDataSource, AutogeneratedModel, type BaseModelMethodOptions, type BaseModelRelationType, type CacheAdapter, type CacheKeys, ClientMigrator, Collection, type ColumnDataTypeOption, type ColumnDataTypeOptionSimple, type ColumnDataTypeOptionWithBinary, type ColumnDataTypeOptionWithDatePrecision, type ColumnDataTypeOptionWithEnum, type ColumnDataTypeOptionWithLength, type ColumnDataTypeOptionWithPrecision, type ColumnDataTypeOptionWithScaleAndPrecision, type ColumnDataTypeOptionWithText, type ColumnOptions, type ColumnType, type CommonDataSourceInput, type CommonSqlMethodReturnType, type ConnectionPolicies, type DataSourceInput, type DataSourceType, type DateColumnOptions, DryModelQueryBuilder, DryQueryBuilder, type FetchHooks, type GetConnectionReturnType, HysteriaError, InMemoryAdapter, type IndexType, type LazyRelationType, type ManyOptions, type ManyToManyOptions, type ManyToManyStringOptions, Migration, Model, type ModelInstanceType, ModelQueryBuilder, type ModelWithoutRelations, MongoDataSource, type MongoDataSourceInput, type MysqlConnectionInstance, type MysqlSqlDataSourceInput, type NotNullableMysqlSqlDataSourceInput, type NotNullablePostgresSqlDataSourceInput, type NotNullableSqliteDataSourceInput, type NumberModelKey, type OneOptions, type PgPoolClientInstance, type PostgresSqlDataSourceInput, QueryBuilder, type RawModelOptions, RedisCacheAdapter, type RedisFetchable, type RedisStorable, type RelatedInstance, type RelationQueryBuilderType, type SqlCloneOptions, type SqlDataSourceInput, type SqlDataSourceModel, type SqlDataSourceType, type SqlDataSourceWithoutTransaction, type SqlDriverSpecificOptions, type SqlPoolType, type Sqlite3ConnectionOptions, type SqliteConnectionInstance, type SqliteDataSourceInput, type StartTransactionOptions, type SymmetricEncryptionOptions, type TableFormat, type ThroughModel, TimestampedModel, Transaction, type TransactionExecutionOptions, type UniqueType, type UseCacheReturnType, type UseConnectionInput, UserMixin, UuidModel, belongsTo, column, createModelFactory, defineMigrator, generateOpenApiModel, generateOpenApiModelSchema, generateOpenApiModelWithMetadata, getCollectionProperties, getIndexes, getModelColumns, type getPoolReturnType, getPrimaryKey, getRelations, getRelationsMetadata, getUniques, hasMany, hasOne, index, HysteriaLogger as logger, manyToMany, MongoDataSource as mongo, property, RedisDataSource as redis, SqlDataSource as sql, unique, view, withPerformance };
|
|
5798
|
+
export { type AdminJsActionOptions, type AdminJsAssets, type AdminJsBranding, type AdminJsInstance, type AdminJsLocale, type AdminJsOptions, type AdminJsPage, type AdminJsPropertyOptions, type AdminJsResourceOptions, type AdminJsSettings, type AnnotatedModel, type AsymmetricEncryptionOptions, type AugmentedSqlDataSource, AutogeneratedModel, type BaseModelMethodOptions, type BaseModelRelationType, type CacheAdapter, type CacheKeys, ClientMigrator, Collection, type ColumnDataTypeOption, type ColumnDataTypeOptionSimple, type ColumnDataTypeOptionWithBinary, type ColumnDataTypeOptionWithDatePrecision, type ColumnDataTypeOptionWithEnum, type ColumnDataTypeOptionWithLength, type ColumnDataTypeOptionWithPrecision, type ColumnDataTypeOptionWithScaleAndPrecision, type ColumnDataTypeOptionWithText, type ColumnOptions, type ColumnType, type CommonDataSourceInput, type CommonSqlMethodReturnType, type ConnectionPolicies, type DataSourceInput, type DataSourceType, type DateColumnOptions, DryModelQueryBuilder, DryQueryBuilder, type FetchHooks, type GetConnectionReturnType, HysteriaError, InMemoryAdapter, type IndexType, type LazyRelationType, type ManyOptions, type ManyToManyOptions, type ManyToManyStringOptions, Migration, Model, type ModelInstanceType, ModelQueryBuilder, type ModelWithoutRelations, MongoDataSource, type MongoDataSourceInput, type MysqlConnectionInstance, type MysqlSqlDataSourceInput, type NotNullableMysqlSqlDataSourceInput, type NotNullablePostgresSqlDataSourceInput, type NotNullableSqliteDataSourceInput, type NumberModelKey, type OneOptions, type PgPoolClientInstance, type PostgresSqlDataSourceInput, QueryBuilder, type RawModelOptions, RedisCacheAdapter, type RedisFetchable, type RedisStorable, type RelatedInstance, type RelationQueryBuilderType, type SqlCloneOptions, type SqlDataSourceInput, type SqlDataSourceModel, type SqlDataSourceType, type SqlDataSourceWithoutTransaction, type SqlDriverSpecificOptions, type SqlPoolType, type Sqlite3ConnectionOptions, type SqliteConnectionInstance, type SqliteDataSourceInput, type StartTransactionOptions, type SymmetricEncryptionOptions, type TableFormat, type ThroughModel, TimestampedModel, Transaction, type TransactionExecutionOptions, type UniqueType, type UseCacheReturnType, type UseConnectionInput, UserMixin, UuidModel, belongsTo, column, createModelFactory, defineMigrator, generateOpenApiModel, generateOpenApiModelSchema, generateOpenApiModelWithMetadata, getCollectionProperties, getIndexes, getModelColumns, type getPoolReturnType, getPrimaryKey, getRelations, getRelationsMetadata, getUniques, hasMany, hasOne, index, HysteriaLogger as logger, manyToMany, MongoDataSource as mongo, property, RedisDataSource as redis, SqlDataSource as sql, unique, view, withPerformance };
|