@syntropix/database 0.2.0 → 0.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/dist/index.cjs +18 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +107 -86
- package/dist/index.d.ts +107 -86
- package/dist/index.js +18 -9
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,96 @@
|
|
|
1
1
|
import { ObjectId } from 'bson';
|
|
2
2
|
|
|
3
|
+
declare const SortType: {
|
|
4
|
+
readonly Descending: "Descending";
|
|
5
|
+
readonly Ascending: "Ascending";
|
|
6
|
+
};
|
|
7
|
+
type SortType = (typeof SortType)[keyof typeof SortType];
|
|
8
|
+
declare enum AggregateFunction {
|
|
9
|
+
Count = "Count",
|
|
10
|
+
Sum = "Sum",
|
|
11
|
+
Avg = "Avg",
|
|
12
|
+
Min = "Min",
|
|
13
|
+
Max = "Max",
|
|
14
|
+
CountDistinct = "CountDistinct"
|
|
15
|
+
}
|
|
16
|
+
interface Join {
|
|
17
|
+
table: string;
|
|
18
|
+
on: any;
|
|
19
|
+
}
|
|
20
|
+
interface Aggregate {
|
|
21
|
+
column: string;
|
|
22
|
+
function: AggregateFunction;
|
|
23
|
+
alias: string;
|
|
24
|
+
}
|
|
25
|
+
interface GroupBy {
|
|
26
|
+
columns: string[];
|
|
27
|
+
}
|
|
28
|
+
interface Sort {
|
|
29
|
+
column: string;
|
|
30
|
+
direction: SortType;
|
|
31
|
+
}
|
|
32
|
+
interface SimilarityOptions {
|
|
33
|
+
threshold: number;
|
|
34
|
+
order?: SortType;
|
|
35
|
+
alias?: string;
|
|
36
|
+
}
|
|
37
|
+
declare enum FilterOperation {
|
|
38
|
+
LT = "LT",
|
|
39
|
+
LTE = "LTE",
|
|
40
|
+
GT = "GT",
|
|
41
|
+
GTE = "GTE",
|
|
42
|
+
EQ = "EQ",
|
|
43
|
+
NEQ = "NEQ",
|
|
44
|
+
Between = "Between",
|
|
45
|
+
In = "In",
|
|
46
|
+
Contains = "Contains",
|
|
47
|
+
Overlap = "Overlap",
|
|
48
|
+
NotIn = "NotIn",
|
|
49
|
+
Like = "Like",
|
|
50
|
+
NotLike = "NotLike",
|
|
51
|
+
ILike = "ILike",
|
|
52
|
+
NotILike = "NotILike",
|
|
53
|
+
IsNull = "IsNull",
|
|
54
|
+
IsNotNull = "IsNotNull",
|
|
55
|
+
Similarity = "Similarity",
|
|
56
|
+
SimilarityDistance = "SimilarityDistance",
|
|
57
|
+
WordSimilarity = "WordSimilarity",
|
|
58
|
+
WordSimilarityDistance = "WordSimilarityDistance",
|
|
59
|
+
StrictWordSimilarity = "StrictWordSimilarity",
|
|
60
|
+
StrictWordSimilarityDistance = "StrictWordSimilarityDistance",
|
|
61
|
+
EuclideanDistance = "EuclideanDistance",
|
|
62
|
+
NegativeInnerProduct = "NegativeInnerProduct",
|
|
63
|
+
CosineDistance = "CosineDistance"
|
|
64
|
+
}
|
|
65
|
+
interface FilterItem {
|
|
66
|
+
columnName: string;
|
|
67
|
+
operator: FilterOperation;
|
|
68
|
+
staticValue?: any;
|
|
69
|
+
columnValue?: string;
|
|
70
|
+
simiarityOptions?: SimilarityOptions;
|
|
71
|
+
}
|
|
72
|
+
type FilterGroup = FilterItem[];
|
|
73
|
+
type Filter = FilterGroup[];
|
|
74
|
+
|
|
75
|
+
declare const AccessType: {
|
|
76
|
+
readonly None: "None";
|
|
77
|
+
readonly Read: "Read";
|
|
78
|
+
readonly Write: "Write";
|
|
79
|
+
readonly Admin: "Admin";
|
|
80
|
+
};
|
|
81
|
+
type AccessType = (typeof AccessType)[keyof typeof AccessType];
|
|
82
|
+
interface SyntropixDBRowAccess {
|
|
83
|
+
read?: Filter;
|
|
84
|
+
write?: Filter;
|
|
85
|
+
}
|
|
86
|
+
interface SyntropixDBAccess {
|
|
87
|
+
tableAccess: AccessType;
|
|
88
|
+
rowAccess?: Record<string, SyntropixDBRowAccess>;
|
|
89
|
+
columnAccess: Record<string, AccessType>;
|
|
90
|
+
createdAt: Date;
|
|
91
|
+
updatedAt: Date;
|
|
92
|
+
}
|
|
93
|
+
|
|
3
94
|
interface StringType {
|
|
4
95
|
String: number;
|
|
5
96
|
}
|
|
@@ -24,14 +115,6 @@ interface ArrayType {
|
|
|
24
115
|
type ArrayDataTypeSchema = StringType | DecimalType | MoneyType | EnumType | 'Text' | 'Integer' | 'BigInteger' | 'Double' | 'DateTime' | 'Timestamp' | 'Date' | 'Boolean' | 'Uuid' | 'Json';
|
|
25
116
|
type ColumnDataTypeSchema = StringType | VectorType | ArrayType | EnumType | MoneyType | DecimalType | 'Text' | 'Integer' | 'BigInteger' | 'Double' | 'DateTime' | 'Timestamp' | 'Date' | 'Boolean' | 'Uuid' | 'Json';
|
|
26
117
|
|
|
27
|
-
declare const AccessType: {
|
|
28
|
-
readonly None: "None";
|
|
29
|
-
readonly Read: "Read";
|
|
30
|
-
readonly Write: "Write";
|
|
31
|
-
readonly Admin: "Admin";
|
|
32
|
-
};
|
|
33
|
-
type AccessType = (typeof AccessType)[keyof typeof AccessType];
|
|
34
|
-
|
|
35
118
|
interface SyntropixDBColumn {
|
|
36
119
|
id: string;
|
|
37
120
|
name: string;
|
|
@@ -56,10 +139,20 @@ interface ColumnCreateOptions {
|
|
|
56
139
|
defaultAccess?: AccessType;
|
|
57
140
|
}
|
|
58
141
|
|
|
59
|
-
|
|
142
|
+
declare const IndexType: {
|
|
143
|
+
readonly Gin: "Gin";
|
|
144
|
+
readonly GinTrgmOps: "GinTrgmOps";
|
|
145
|
+
readonly IvfflatL2Ops: "IvfflatL2Ops";
|
|
146
|
+
readonly InfflatCosineOps: "InfflatCosineOps";
|
|
147
|
+
readonly InfflatIpOps: "InfflatIpOps";
|
|
148
|
+
};
|
|
149
|
+
type IndexType = (typeof IndexType)[keyof typeof IndexType];
|
|
150
|
+
interface SyntropixDBIndex {
|
|
60
151
|
name?: string;
|
|
152
|
+
unique: boolean;
|
|
153
|
+
nullsNotDistinct: boolean;
|
|
61
154
|
columns: string[];
|
|
62
|
-
|
|
155
|
+
indexType: IndexType;
|
|
63
156
|
}
|
|
64
157
|
|
|
65
158
|
declare const ForeignKeyAction: {
|
|
@@ -95,78 +188,6 @@ interface ForeignKeyFieldOptions extends FieldOptions {
|
|
|
95
188
|
onUpdate?: ForeignKeyAction;
|
|
96
189
|
}
|
|
97
190
|
|
|
98
|
-
declare const SortType: {
|
|
99
|
-
readonly Descending: "Descending";
|
|
100
|
-
readonly Ascending: "Ascending";
|
|
101
|
-
};
|
|
102
|
-
type SortType = (typeof SortType)[keyof typeof SortType];
|
|
103
|
-
declare enum AggregateFunction {
|
|
104
|
-
Count = "Count",
|
|
105
|
-
Sum = "Sum",
|
|
106
|
-
Avg = "Avg",
|
|
107
|
-
Min = "Min",
|
|
108
|
-
Max = "Max",
|
|
109
|
-
CountDistinct = "CountDistinct"
|
|
110
|
-
}
|
|
111
|
-
interface Join {
|
|
112
|
-
table: string;
|
|
113
|
-
on: any;
|
|
114
|
-
}
|
|
115
|
-
interface Aggregate {
|
|
116
|
-
column: string;
|
|
117
|
-
function: AggregateFunction;
|
|
118
|
-
alias: string;
|
|
119
|
-
}
|
|
120
|
-
interface GroupBy {
|
|
121
|
-
columns: string[];
|
|
122
|
-
}
|
|
123
|
-
interface Sort {
|
|
124
|
-
column: string;
|
|
125
|
-
direction: SortType;
|
|
126
|
-
}
|
|
127
|
-
interface SimilarityOptions {
|
|
128
|
-
threshold: number;
|
|
129
|
-
order?: SortType;
|
|
130
|
-
alias?: string;
|
|
131
|
-
}
|
|
132
|
-
declare enum FilterOperation {
|
|
133
|
-
LT = "LT",
|
|
134
|
-
LTE = "LTE",
|
|
135
|
-
GT = "GT",
|
|
136
|
-
GTE = "GTE",
|
|
137
|
-
EQ = "EQ",
|
|
138
|
-
NEQ = "NEQ",
|
|
139
|
-
Between = "Between",
|
|
140
|
-
In = "In",
|
|
141
|
-
Contains = "Contains",
|
|
142
|
-
Overlap = "Overlap",
|
|
143
|
-
NotIn = "NotIn",
|
|
144
|
-
Like = "Like",
|
|
145
|
-
NotLike = "NotLike",
|
|
146
|
-
ILike = "ILike",
|
|
147
|
-
NotILike = "NotILike",
|
|
148
|
-
IsNull = "IsNull",
|
|
149
|
-
IsNotNull = "IsNotNull",
|
|
150
|
-
Similarity = "Similarity",
|
|
151
|
-
SimilarityDistance = "SimilarityDistance",
|
|
152
|
-
WordSimilarity = "WordSimilarity",
|
|
153
|
-
WordSimilarityDistance = "WordSimilarityDistance",
|
|
154
|
-
StrictWordSimilarity = "StrictWordSimilarity",
|
|
155
|
-
StrictWordSimilarityDistance = "StrictWordSimilarityDistance",
|
|
156
|
-
EuclideanDistance = "EuclideanDistance",
|
|
157
|
-
NegativeInnerProduct = "NegativeInnerProduct",
|
|
158
|
-
CosineDistance = "CosineDistance"
|
|
159
|
-
}
|
|
160
|
-
interface FilterItem {
|
|
161
|
-
columnName: string;
|
|
162
|
-
operator: FilterOperation;
|
|
163
|
-
staticValue?: any;
|
|
164
|
-
columnValue?: string;
|
|
165
|
-
simiarityOptions?: SimilarityOptions;
|
|
166
|
-
}
|
|
167
|
-
type FilterGroup = FilterItem[];
|
|
168
|
-
type Filter = FilterGroup[];
|
|
169
|
-
|
|
170
191
|
interface SyntropixDBTable {
|
|
171
192
|
id: string;
|
|
172
193
|
name: string;
|
|
@@ -177,7 +198,7 @@ interface SyntropixDBTable {
|
|
|
177
198
|
defaultAccess: AccessType | null;
|
|
178
199
|
columns: SyntropixDBColumn[];
|
|
179
200
|
foreignKeys: SyntropixDBForeignKey[];
|
|
180
|
-
indexes:
|
|
201
|
+
indexes: SyntropixDBIndex[];
|
|
181
202
|
}
|
|
182
203
|
interface SyntropixDBTableSchema {
|
|
183
204
|
id: string;
|
|
@@ -216,7 +237,7 @@ interface TableCreateDto {
|
|
|
216
237
|
description: string;
|
|
217
238
|
columns: ColumnCreateDto[];
|
|
218
239
|
foreignKeys: SyntropixDBForeignKey[];
|
|
219
|
-
indexes:
|
|
240
|
+
indexes: SyntropixDBIndex[];
|
|
220
241
|
defaultAccess?: AccessType;
|
|
221
242
|
metadata?: Record<string, any>;
|
|
222
243
|
visible?: boolean;
|
|
@@ -465,7 +486,7 @@ declare class BaseModel {
|
|
|
465
486
|
protected static getTableName(): string;
|
|
466
487
|
protected static getDisplayName(): string;
|
|
467
488
|
static getDescription(): string;
|
|
468
|
-
protected static getIndexes():
|
|
489
|
+
protected static getIndexes(): SyntropixDBIndex[];
|
|
469
490
|
protected static getFields(): Record<string, Field>;
|
|
470
491
|
protected static getPrimaryKeyName(): string;
|
|
471
492
|
protected static getAssociations(): ForeignKeyField[];
|
|
@@ -579,4 +600,4 @@ declare const COSINE_DISTANCE: (field: string, value: any, options: SimilarityOp
|
|
|
579
600
|
declare const Value: (value: any) => any;
|
|
580
601
|
declare function FilterWrapper(filter: Filter | FilterGroup | FilterItem | undefined): Filter | undefined;
|
|
581
602
|
|
|
582
|
-
export { AND, AccessType, type Aggregate, AggregateFunction, ArrayDataType, type ArrayDataTypeSchema, ArrayField, type ArrayType, BETWEEN, BaseClient, BaseModel, BooleanField, CONTAINS, COSINE_DISTANCE, ClientConfig, Column, type ColumnCreateDto, type ColumnCreateOptions, type ColumnCreateResponse, ColumnDataType, type ColumnDataTypeSchema, DataClient, DateField, DateTimeField, DecimalField, type DecimalType, type DeleteDataDto, type DeleteDataPayloadDto, Description, DoubleField, EQ, EQ_COL, EUCLIDEAN_DISTANCE, EnumField, type EnumType, Field, type FieldOptions, type Filter, type FilterGroup, type FilterItem, FilterOperation, FilterWrapper, ForeignKey, ForeignKeyAction, ForeignKeyField, type ForeignKeyFieldOptions, GT, GTE, GTE_COL, GT_COL, type GroupBy, IN, IS_NOT_NULL, IS_NULL, I_LIKE,
|
|
603
|
+
export { AND, AccessType, type Aggregate, AggregateFunction, ArrayDataType, type ArrayDataTypeSchema, ArrayField, type ArrayType, BETWEEN, BaseClient, BaseModel, BooleanField, CONTAINS, COSINE_DISTANCE, ClientConfig, Column, type ColumnCreateDto, type ColumnCreateOptions, type ColumnCreateResponse, ColumnDataType, type ColumnDataTypeSchema, DataClient, DateField, DateTimeField, DecimalField, type DecimalType, type DeleteDataDto, type DeleteDataPayloadDto, Description, DoubleField, EQ, EQ_COL, EUCLIDEAN_DISTANCE, EnumField, type EnumType, Field, type FieldOptions, type Filter, type FilterGroup, type FilterItem, FilterOperation, FilterWrapper, ForeignKey, ForeignKeyAction, ForeignKeyField, type ForeignKeyFieldOptions, GT, GTE, GTE_COL, GT_COL, type GroupBy, IN, IS_NOT_NULL, IS_NULL, I_LIKE, IndexType, type InsertDataDto, type InsertDto, IntegerField, type Join, JsonField, LIKE, LT, LTE, LTE_COL, LT_COL, MoneyField, type MoneyType, NE, NEGATIVE_INNER_PRODUCT, NE_COL, NOT_IN, NOT_I_LIKE, NOT_LIKE, OR, OVERLAP, type QueryDto, type QueryPayloadDto, SIMILARITY, SIMILARITY_DISTANCE, STRICT_WORD_SIMILARITY, STRICT_WORD_SIMILARITY_DISTANCE, type SimilarityOptions, type Sort, SortType, StringField, type StringType, SyntropixClient, type SyntropixDBAccess, type SyntropixDBColumn, type SyntropixDBForeignKey, type SyntropixDBIndex, type SyntropixDBRowAccess, type SyntropixDBTable, type SyntropixDBTableListItem, type SyntropixDBTableSchema, type SyntropixErrorResponse, type SyntropixResponse, type SyntropixSuccessResponse, type TableAddColumnDto, TableClient, type TableCreateDto, type TableCreateResponse, type TableDropColumnDto, type TableDropDto, type TableGetListDto, type TableGetSchemaDto, type TableListResponse, type TableModifyColumnDto, type TableRenameDto, type TableSchemaResponse, type TableTruncateDto, TextField, TimestampField, type UpdateDto, type UpdatePayloadDto, UuidField, Value, VectorField, type VectorType, WORD_SIMILARITY, WORD_SIMILARITY_DISTANCE };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,96 @@
|
|
|
1
1
|
import { ObjectId } from 'bson';
|
|
2
2
|
|
|
3
|
+
declare const SortType: {
|
|
4
|
+
readonly Descending: "Descending";
|
|
5
|
+
readonly Ascending: "Ascending";
|
|
6
|
+
};
|
|
7
|
+
type SortType = (typeof SortType)[keyof typeof SortType];
|
|
8
|
+
declare enum AggregateFunction {
|
|
9
|
+
Count = "Count",
|
|
10
|
+
Sum = "Sum",
|
|
11
|
+
Avg = "Avg",
|
|
12
|
+
Min = "Min",
|
|
13
|
+
Max = "Max",
|
|
14
|
+
CountDistinct = "CountDistinct"
|
|
15
|
+
}
|
|
16
|
+
interface Join {
|
|
17
|
+
table: string;
|
|
18
|
+
on: any;
|
|
19
|
+
}
|
|
20
|
+
interface Aggregate {
|
|
21
|
+
column: string;
|
|
22
|
+
function: AggregateFunction;
|
|
23
|
+
alias: string;
|
|
24
|
+
}
|
|
25
|
+
interface GroupBy {
|
|
26
|
+
columns: string[];
|
|
27
|
+
}
|
|
28
|
+
interface Sort {
|
|
29
|
+
column: string;
|
|
30
|
+
direction: SortType;
|
|
31
|
+
}
|
|
32
|
+
interface SimilarityOptions {
|
|
33
|
+
threshold: number;
|
|
34
|
+
order?: SortType;
|
|
35
|
+
alias?: string;
|
|
36
|
+
}
|
|
37
|
+
declare enum FilterOperation {
|
|
38
|
+
LT = "LT",
|
|
39
|
+
LTE = "LTE",
|
|
40
|
+
GT = "GT",
|
|
41
|
+
GTE = "GTE",
|
|
42
|
+
EQ = "EQ",
|
|
43
|
+
NEQ = "NEQ",
|
|
44
|
+
Between = "Between",
|
|
45
|
+
In = "In",
|
|
46
|
+
Contains = "Contains",
|
|
47
|
+
Overlap = "Overlap",
|
|
48
|
+
NotIn = "NotIn",
|
|
49
|
+
Like = "Like",
|
|
50
|
+
NotLike = "NotLike",
|
|
51
|
+
ILike = "ILike",
|
|
52
|
+
NotILike = "NotILike",
|
|
53
|
+
IsNull = "IsNull",
|
|
54
|
+
IsNotNull = "IsNotNull",
|
|
55
|
+
Similarity = "Similarity",
|
|
56
|
+
SimilarityDistance = "SimilarityDistance",
|
|
57
|
+
WordSimilarity = "WordSimilarity",
|
|
58
|
+
WordSimilarityDistance = "WordSimilarityDistance",
|
|
59
|
+
StrictWordSimilarity = "StrictWordSimilarity",
|
|
60
|
+
StrictWordSimilarityDistance = "StrictWordSimilarityDistance",
|
|
61
|
+
EuclideanDistance = "EuclideanDistance",
|
|
62
|
+
NegativeInnerProduct = "NegativeInnerProduct",
|
|
63
|
+
CosineDistance = "CosineDistance"
|
|
64
|
+
}
|
|
65
|
+
interface FilterItem {
|
|
66
|
+
columnName: string;
|
|
67
|
+
operator: FilterOperation;
|
|
68
|
+
staticValue?: any;
|
|
69
|
+
columnValue?: string;
|
|
70
|
+
simiarityOptions?: SimilarityOptions;
|
|
71
|
+
}
|
|
72
|
+
type FilterGroup = FilterItem[];
|
|
73
|
+
type Filter = FilterGroup[];
|
|
74
|
+
|
|
75
|
+
declare const AccessType: {
|
|
76
|
+
readonly None: "None";
|
|
77
|
+
readonly Read: "Read";
|
|
78
|
+
readonly Write: "Write";
|
|
79
|
+
readonly Admin: "Admin";
|
|
80
|
+
};
|
|
81
|
+
type AccessType = (typeof AccessType)[keyof typeof AccessType];
|
|
82
|
+
interface SyntropixDBRowAccess {
|
|
83
|
+
read?: Filter;
|
|
84
|
+
write?: Filter;
|
|
85
|
+
}
|
|
86
|
+
interface SyntropixDBAccess {
|
|
87
|
+
tableAccess: AccessType;
|
|
88
|
+
rowAccess?: Record<string, SyntropixDBRowAccess>;
|
|
89
|
+
columnAccess: Record<string, AccessType>;
|
|
90
|
+
createdAt: Date;
|
|
91
|
+
updatedAt: Date;
|
|
92
|
+
}
|
|
93
|
+
|
|
3
94
|
interface StringType {
|
|
4
95
|
String: number;
|
|
5
96
|
}
|
|
@@ -24,14 +115,6 @@ interface ArrayType {
|
|
|
24
115
|
type ArrayDataTypeSchema = StringType | DecimalType | MoneyType | EnumType | 'Text' | 'Integer' | 'BigInteger' | 'Double' | 'DateTime' | 'Timestamp' | 'Date' | 'Boolean' | 'Uuid' | 'Json';
|
|
25
116
|
type ColumnDataTypeSchema = StringType | VectorType | ArrayType | EnumType | MoneyType | DecimalType | 'Text' | 'Integer' | 'BigInteger' | 'Double' | 'DateTime' | 'Timestamp' | 'Date' | 'Boolean' | 'Uuid' | 'Json';
|
|
26
117
|
|
|
27
|
-
declare const AccessType: {
|
|
28
|
-
readonly None: "None";
|
|
29
|
-
readonly Read: "Read";
|
|
30
|
-
readonly Write: "Write";
|
|
31
|
-
readonly Admin: "Admin";
|
|
32
|
-
};
|
|
33
|
-
type AccessType = (typeof AccessType)[keyof typeof AccessType];
|
|
34
|
-
|
|
35
118
|
interface SyntropixDBColumn {
|
|
36
119
|
id: string;
|
|
37
120
|
name: string;
|
|
@@ -56,10 +139,20 @@ interface ColumnCreateOptions {
|
|
|
56
139
|
defaultAccess?: AccessType;
|
|
57
140
|
}
|
|
58
141
|
|
|
59
|
-
|
|
142
|
+
declare const IndexType: {
|
|
143
|
+
readonly Gin: "Gin";
|
|
144
|
+
readonly GinTrgmOps: "GinTrgmOps";
|
|
145
|
+
readonly IvfflatL2Ops: "IvfflatL2Ops";
|
|
146
|
+
readonly InfflatCosineOps: "InfflatCosineOps";
|
|
147
|
+
readonly InfflatIpOps: "InfflatIpOps";
|
|
148
|
+
};
|
|
149
|
+
type IndexType = (typeof IndexType)[keyof typeof IndexType];
|
|
150
|
+
interface SyntropixDBIndex {
|
|
60
151
|
name?: string;
|
|
152
|
+
unique: boolean;
|
|
153
|
+
nullsNotDistinct: boolean;
|
|
61
154
|
columns: string[];
|
|
62
|
-
|
|
155
|
+
indexType: IndexType;
|
|
63
156
|
}
|
|
64
157
|
|
|
65
158
|
declare const ForeignKeyAction: {
|
|
@@ -95,78 +188,6 @@ interface ForeignKeyFieldOptions extends FieldOptions {
|
|
|
95
188
|
onUpdate?: ForeignKeyAction;
|
|
96
189
|
}
|
|
97
190
|
|
|
98
|
-
declare const SortType: {
|
|
99
|
-
readonly Descending: "Descending";
|
|
100
|
-
readonly Ascending: "Ascending";
|
|
101
|
-
};
|
|
102
|
-
type SortType = (typeof SortType)[keyof typeof SortType];
|
|
103
|
-
declare enum AggregateFunction {
|
|
104
|
-
Count = "Count",
|
|
105
|
-
Sum = "Sum",
|
|
106
|
-
Avg = "Avg",
|
|
107
|
-
Min = "Min",
|
|
108
|
-
Max = "Max",
|
|
109
|
-
CountDistinct = "CountDistinct"
|
|
110
|
-
}
|
|
111
|
-
interface Join {
|
|
112
|
-
table: string;
|
|
113
|
-
on: any;
|
|
114
|
-
}
|
|
115
|
-
interface Aggregate {
|
|
116
|
-
column: string;
|
|
117
|
-
function: AggregateFunction;
|
|
118
|
-
alias: string;
|
|
119
|
-
}
|
|
120
|
-
interface GroupBy {
|
|
121
|
-
columns: string[];
|
|
122
|
-
}
|
|
123
|
-
interface Sort {
|
|
124
|
-
column: string;
|
|
125
|
-
direction: SortType;
|
|
126
|
-
}
|
|
127
|
-
interface SimilarityOptions {
|
|
128
|
-
threshold: number;
|
|
129
|
-
order?: SortType;
|
|
130
|
-
alias?: string;
|
|
131
|
-
}
|
|
132
|
-
declare enum FilterOperation {
|
|
133
|
-
LT = "LT",
|
|
134
|
-
LTE = "LTE",
|
|
135
|
-
GT = "GT",
|
|
136
|
-
GTE = "GTE",
|
|
137
|
-
EQ = "EQ",
|
|
138
|
-
NEQ = "NEQ",
|
|
139
|
-
Between = "Between",
|
|
140
|
-
In = "In",
|
|
141
|
-
Contains = "Contains",
|
|
142
|
-
Overlap = "Overlap",
|
|
143
|
-
NotIn = "NotIn",
|
|
144
|
-
Like = "Like",
|
|
145
|
-
NotLike = "NotLike",
|
|
146
|
-
ILike = "ILike",
|
|
147
|
-
NotILike = "NotILike",
|
|
148
|
-
IsNull = "IsNull",
|
|
149
|
-
IsNotNull = "IsNotNull",
|
|
150
|
-
Similarity = "Similarity",
|
|
151
|
-
SimilarityDistance = "SimilarityDistance",
|
|
152
|
-
WordSimilarity = "WordSimilarity",
|
|
153
|
-
WordSimilarityDistance = "WordSimilarityDistance",
|
|
154
|
-
StrictWordSimilarity = "StrictWordSimilarity",
|
|
155
|
-
StrictWordSimilarityDistance = "StrictWordSimilarityDistance",
|
|
156
|
-
EuclideanDistance = "EuclideanDistance",
|
|
157
|
-
NegativeInnerProduct = "NegativeInnerProduct",
|
|
158
|
-
CosineDistance = "CosineDistance"
|
|
159
|
-
}
|
|
160
|
-
interface FilterItem {
|
|
161
|
-
columnName: string;
|
|
162
|
-
operator: FilterOperation;
|
|
163
|
-
staticValue?: any;
|
|
164
|
-
columnValue?: string;
|
|
165
|
-
simiarityOptions?: SimilarityOptions;
|
|
166
|
-
}
|
|
167
|
-
type FilterGroup = FilterItem[];
|
|
168
|
-
type Filter = FilterGroup[];
|
|
169
|
-
|
|
170
191
|
interface SyntropixDBTable {
|
|
171
192
|
id: string;
|
|
172
193
|
name: string;
|
|
@@ -177,7 +198,7 @@ interface SyntropixDBTable {
|
|
|
177
198
|
defaultAccess: AccessType | null;
|
|
178
199
|
columns: SyntropixDBColumn[];
|
|
179
200
|
foreignKeys: SyntropixDBForeignKey[];
|
|
180
|
-
indexes:
|
|
201
|
+
indexes: SyntropixDBIndex[];
|
|
181
202
|
}
|
|
182
203
|
interface SyntropixDBTableSchema {
|
|
183
204
|
id: string;
|
|
@@ -216,7 +237,7 @@ interface TableCreateDto {
|
|
|
216
237
|
description: string;
|
|
217
238
|
columns: ColumnCreateDto[];
|
|
218
239
|
foreignKeys: SyntropixDBForeignKey[];
|
|
219
|
-
indexes:
|
|
240
|
+
indexes: SyntropixDBIndex[];
|
|
220
241
|
defaultAccess?: AccessType;
|
|
221
242
|
metadata?: Record<string, any>;
|
|
222
243
|
visible?: boolean;
|
|
@@ -465,7 +486,7 @@ declare class BaseModel {
|
|
|
465
486
|
protected static getTableName(): string;
|
|
466
487
|
protected static getDisplayName(): string;
|
|
467
488
|
static getDescription(): string;
|
|
468
|
-
protected static getIndexes():
|
|
489
|
+
protected static getIndexes(): SyntropixDBIndex[];
|
|
469
490
|
protected static getFields(): Record<string, Field>;
|
|
470
491
|
protected static getPrimaryKeyName(): string;
|
|
471
492
|
protected static getAssociations(): ForeignKeyField[];
|
|
@@ -579,4 +600,4 @@ declare const COSINE_DISTANCE: (field: string, value: any, options: SimilarityOp
|
|
|
579
600
|
declare const Value: (value: any) => any;
|
|
580
601
|
declare function FilterWrapper(filter: Filter | FilterGroup | FilterItem | undefined): Filter | undefined;
|
|
581
602
|
|
|
582
|
-
export { AND, AccessType, type Aggregate, AggregateFunction, ArrayDataType, type ArrayDataTypeSchema, ArrayField, type ArrayType, BETWEEN, BaseClient, BaseModel, BooleanField, CONTAINS, COSINE_DISTANCE, ClientConfig, Column, type ColumnCreateDto, type ColumnCreateOptions, type ColumnCreateResponse, ColumnDataType, type ColumnDataTypeSchema, DataClient, DateField, DateTimeField, DecimalField, type DecimalType, type DeleteDataDto, type DeleteDataPayloadDto, Description, DoubleField, EQ, EQ_COL, EUCLIDEAN_DISTANCE, EnumField, type EnumType, Field, type FieldOptions, type Filter, type FilterGroup, type FilterItem, FilterOperation, FilterWrapper, ForeignKey, ForeignKeyAction, ForeignKeyField, type ForeignKeyFieldOptions, GT, GTE, GTE_COL, GT_COL, type GroupBy, IN, IS_NOT_NULL, IS_NULL, I_LIKE,
|
|
603
|
+
export { AND, AccessType, type Aggregate, AggregateFunction, ArrayDataType, type ArrayDataTypeSchema, ArrayField, type ArrayType, BETWEEN, BaseClient, BaseModel, BooleanField, CONTAINS, COSINE_DISTANCE, ClientConfig, Column, type ColumnCreateDto, type ColumnCreateOptions, type ColumnCreateResponse, ColumnDataType, type ColumnDataTypeSchema, DataClient, DateField, DateTimeField, DecimalField, type DecimalType, type DeleteDataDto, type DeleteDataPayloadDto, Description, DoubleField, EQ, EQ_COL, EUCLIDEAN_DISTANCE, EnumField, type EnumType, Field, type FieldOptions, type Filter, type FilterGroup, type FilterItem, FilterOperation, FilterWrapper, ForeignKey, ForeignKeyAction, ForeignKeyField, type ForeignKeyFieldOptions, GT, GTE, GTE_COL, GT_COL, type GroupBy, IN, IS_NOT_NULL, IS_NULL, I_LIKE, IndexType, type InsertDataDto, type InsertDto, IntegerField, type Join, JsonField, LIKE, LT, LTE, LTE_COL, LT_COL, MoneyField, type MoneyType, NE, NEGATIVE_INNER_PRODUCT, NE_COL, NOT_IN, NOT_I_LIKE, NOT_LIKE, OR, OVERLAP, type QueryDto, type QueryPayloadDto, SIMILARITY, SIMILARITY_DISTANCE, STRICT_WORD_SIMILARITY, STRICT_WORD_SIMILARITY_DISTANCE, type SimilarityOptions, type Sort, SortType, StringField, type StringType, SyntropixClient, type SyntropixDBAccess, type SyntropixDBColumn, type SyntropixDBForeignKey, type SyntropixDBIndex, type SyntropixDBRowAccess, type SyntropixDBTable, type SyntropixDBTableListItem, type SyntropixDBTableSchema, type SyntropixErrorResponse, type SyntropixResponse, type SyntropixSuccessResponse, type TableAddColumnDto, TableClient, type TableCreateDto, type TableCreateResponse, type TableDropColumnDto, type TableDropDto, type TableGetListDto, type TableGetSchemaDto, type TableListResponse, type TableModifyColumnDto, type TableRenameDto, type TableSchemaResponse, type TableTruncateDto, TextField, TimestampField, type UpdateDto, type UpdatePayloadDto, UuidField, Value, VectorField, type VectorType, WORD_SIMILARITY, WORD_SIMILARITY_DISTANCE };
|
package/dist/index.js
CHANGED
|
@@ -5,6 +5,23 @@ import { EJSON } from 'bson';
|
|
|
5
5
|
var __defProp = Object.defineProperty;
|
|
6
6
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
7
7
|
|
|
8
|
+
// src/types/model/access.ts
|
|
9
|
+
var AccessType = {
|
|
10
|
+
None: "None",
|
|
11
|
+
Read: "Read",
|
|
12
|
+
Write: "Write",
|
|
13
|
+
Admin: "Admin"
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
// src/types/model/db-index.ts
|
|
17
|
+
var IndexType = {
|
|
18
|
+
Gin: "Gin",
|
|
19
|
+
GinTrgmOps: "GinTrgmOps",
|
|
20
|
+
IvfflatL2Ops: "IvfflatL2Ops",
|
|
21
|
+
InfflatCosineOps: "InfflatCosineOps",
|
|
22
|
+
InfflatIpOps: "InfflatIpOps"
|
|
23
|
+
};
|
|
24
|
+
|
|
8
25
|
// src/types/model/filter.ts
|
|
9
26
|
var SortType = {
|
|
10
27
|
Descending: "Descending",
|
|
@@ -57,14 +74,6 @@ var ForeignKeyAction = {
|
|
|
57
74
|
NoAction: "NoAction",
|
|
58
75
|
SetDefault: "SetDefault"
|
|
59
76
|
};
|
|
60
|
-
|
|
61
|
-
// src/types/model/shared.ts
|
|
62
|
-
var AccessType = {
|
|
63
|
-
None: "None",
|
|
64
|
-
Read: "Read",
|
|
65
|
-
Write: "Write",
|
|
66
|
-
Admin: "Admin"
|
|
67
|
-
};
|
|
68
77
|
function handleError(error) {
|
|
69
78
|
const axiosErr = error;
|
|
70
79
|
if (axiosErr.response?.data?.status === "error") {
|
|
@@ -1147,6 +1156,6 @@ var BaseModel = class {
|
|
|
1147
1156
|
}
|
|
1148
1157
|
};
|
|
1149
1158
|
|
|
1150
|
-
export { AND, AccessType, AggregateFunction, ArrayDataType, ArrayField, BETWEEN, BaseClient, BaseModel, BooleanField, CONTAINS, COSINE_DISTANCE, ClientConfig, Column, ColumnDataType, DataClient, DateField, DateTimeField, DecimalField, Description, DoubleField, EQ, EQ_COL, EUCLIDEAN_DISTANCE, EnumField, Field, FilterOperation, FilterWrapper, ForeignKey, ForeignKeyAction, ForeignKeyField, GT, GTE, GTE_COL, GT_COL, IN, IS_NOT_NULL, IS_NULL, I_LIKE, IntegerField, JsonField, LIKE, LT, LTE, LTE_COL, LT_COL, MoneyField, NE, NEGATIVE_INNER_PRODUCT, NE_COL, NOT_IN, NOT_I_LIKE, NOT_LIKE, OR, OVERLAP, SIMILARITY, SIMILARITY_DISTANCE, STRICT_WORD_SIMILARITY, STRICT_WORD_SIMILARITY_DISTANCE, SortType, StringField, SyntropixClient, TableClient, TextField, TimestampField, UuidField, Value, VectorField, WORD_SIMILARITY, WORD_SIMILARITY_DISTANCE };
|
|
1159
|
+
export { AND, AccessType, AggregateFunction, ArrayDataType, ArrayField, BETWEEN, BaseClient, BaseModel, BooleanField, CONTAINS, COSINE_DISTANCE, ClientConfig, Column, ColumnDataType, DataClient, DateField, DateTimeField, DecimalField, Description, DoubleField, EQ, EQ_COL, EUCLIDEAN_DISTANCE, EnumField, Field, FilterOperation, FilterWrapper, ForeignKey, ForeignKeyAction, ForeignKeyField, GT, GTE, GTE_COL, GT_COL, IN, IS_NOT_NULL, IS_NULL, I_LIKE, IndexType, IntegerField, JsonField, LIKE, LT, LTE, LTE_COL, LT_COL, MoneyField, NE, NEGATIVE_INNER_PRODUCT, NE_COL, NOT_IN, NOT_I_LIKE, NOT_LIKE, OR, OVERLAP, SIMILARITY, SIMILARITY_DISTANCE, STRICT_WORD_SIMILARITY, STRICT_WORD_SIMILARITY_DISTANCE, SortType, StringField, SyntropixClient, TableClient, TextField, TimestampField, UuidField, Value, VectorField, WORD_SIMILARITY, WORD_SIMILARITY_DISTANCE };
|
|
1151
1160
|
//# sourceMappingURL=index.js.map
|
|
1152
1161
|
//# sourceMappingURL=index.js.map
|