@syntropix/database 0.2.1 → 0.2.3
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 +11 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +94 -83
- package/dist/index.d.ts +94 -83
- package/dist/index.js +11 -11
- 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;
|
|
@@ -105,78 +188,6 @@ interface ForeignKeyFieldOptions extends FieldOptions {
|
|
|
105
188
|
onUpdate?: ForeignKeyAction;
|
|
106
189
|
}
|
|
107
190
|
|
|
108
|
-
declare const SortType: {
|
|
109
|
-
readonly Descending: "Descending";
|
|
110
|
-
readonly Ascending: "Ascending";
|
|
111
|
-
};
|
|
112
|
-
type SortType = (typeof SortType)[keyof typeof SortType];
|
|
113
|
-
declare enum AggregateFunction {
|
|
114
|
-
Count = "Count",
|
|
115
|
-
Sum = "Sum",
|
|
116
|
-
Avg = "Avg",
|
|
117
|
-
Min = "Min",
|
|
118
|
-
Max = "Max",
|
|
119
|
-
CountDistinct = "CountDistinct"
|
|
120
|
-
}
|
|
121
|
-
interface Join {
|
|
122
|
-
table: string;
|
|
123
|
-
on: any;
|
|
124
|
-
}
|
|
125
|
-
interface Aggregate {
|
|
126
|
-
column: string;
|
|
127
|
-
function: AggregateFunction;
|
|
128
|
-
alias: string;
|
|
129
|
-
}
|
|
130
|
-
interface GroupBy {
|
|
131
|
-
columns: string[];
|
|
132
|
-
}
|
|
133
|
-
interface Sort {
|
|
134
|
-
column: string;
|
|
135
|
-
direction: SortType;
|
|
136
|
-
}
|
|
137
|
-
interface SimilarityOptions {
|
|
138
|
-
threshold: number;
|
|
139
|
-
order?: SortType;
|
|
140
|
-
alias?: string;
|
|
141
|
-
}
|
|
142
|
-
declare enum FilterOperation {
|
|
143
|
-
LT = "LT",
|
|
144
|
-
LTE = "LTE",
|
|
145
|
-
GT = "GT",
|
|
146
|
-
GTE = "GTE",
|
|
147
|
-
EQ = "EQ",
|
|
148
|
-
NEQ = "NEQ",
|
|
149
|
-
Between = "Between",
|
|
150
|
-
In = "In",
|
|
151
|
-
Contains = "Contains",
|
|
152
|
-
Overlap = "Overlap",
|
|
153
|
-
NotIn = "NotIn",
|
|
154
|
-
Like = "Like",
|
|
155
|
-
NotLike = "NotLike",
|
|
156
|
-
ILike = "ILike",
|
|
157
|
-
NotILike = "NotILike",
|
|
158
|
-
IsNull = "IsNull",
|
|
159
|
-
IsNotNull = "IsNotNull",
|
|
160
|
-
Similarity = "Similarity",
|
|
161
|
-
SimilarityDistance = "SimilarityDistance",
|
|
162
|
-
WordSimilarity = "WordSimilarity",
|
|
163
|
-
WordSimilarityDistance = "WordSimilarityDistance",
|
|
164
|
-
StrictWordSimilarity = "StrictWordSimilarity",
|
|
165
|
-
StrictWordSimilarityDistance = "StrictWordSimilarityDistance",
|
|
166
|
-
EuclideanDistance = "EuclideanDistance",
|
|
167
|
-
NegativeInnerProduct = "NegativeInnerProduct",
|
|
168
|
-
CosineDistance = "CosineDistance"
|
|
169
|
-
}
|
|
170
|
-
interface FilterItem {
|
|
171
|
-
columnName: string;
|
|
172
|
-
operator: FilterOperation;
|
|
173
|
-
staticValue?: any;
|
|
174
|
-
columnValue?: string;
|
|
175
|
-
simiarityOptions?: SimilarityOptions;
|
|
176
|
-
}
|
|
177
|
-
type FilterGroup = FilterItem[];
|
|
178
|
-
type Filter = FilterGroup[];
|
|
179
|
-
|
|
180
191
|
interface SyntropixDBTable {
|
|
181
192
|
id: string;
|
|
182
193
|
name: string;
|
|
@@ -473,7 +484,7 @@ declare class BaseModel {
|
|
|
473
484
|
private _extra;
|
|
474
485
|
constructor(data?: Record<string, any>);
|
|
475
486
|
protected static getTableName(): string;
|
|
476
|
-
protected static getDisplayName(): string;
|
|
487
|
+
protected static getDisplayName(): string | null;
|
|
477
488
|
static getDescription(): string;
|
|
478
489
|
protected static getIndexes(): SyntropixDBIndex[];
|
|
479
490
|
protected static getFields(): Record<string, Field>;
|
|
@@ -481,7 +492,7 @@ declare class BaseModel {
|
|
|
481
492
|
protected static getAssociations(): ForeignKeyField[];
|
|
482
493
|
protected getFields(): Record<string, Field>;
|
|
483
494
|
protected getTableName(): string;
|
|
484
|
-
protected getDisplayName(): string;
|
|
495
|
+
protected getDisplayName(): string | null;
|
|
485
496
|
protected getPrimaryKeyName(): string;
|
|
486
497
|
protected getPrimaryKey(): Field | undefined;
|
|
487
498
|
protected get client(): SyntropixClient;
|
|
@@ -589,4 +600,4 @@ declare const COSINE_DISTANCE: (field: string, value: any, options: SimilarityOp
|
|
|
589
600
|
declare const Value: (value: any) => any;
|
|
590
601
|
declare function FilterWrapper(filter: Filter | FilterGroup | FilterItem | undefined): Filter | undefined;
|
|
591
602
|
|
|
592
|
-
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 SyntropixDBColumn, type SyntropixDBForeignKey, type SyntropixDBIndex, 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 };
|
|
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;
|
|
@@ -105,78 +188,6 @@ interface ForeignKeyFieldOptions extends FieldOptions {
|
|
|
105
188
|
onUpdate?: ForeignKeyAction;
|
|
106
189
|
}
|
|
107
190
|
|
|
108
|
-
declare const SortType: {
|
|
109
|
-
readonly Descending: "Descending";
|
|
110
|
-
readonly Ascending: "Ascending";
|
|
111
|
-
};
|
|
112
|
-
type SortType = (typeof SortType)[keyof typeof SortType];
|
|
113
|
-
declare enum AggregateFunction {
|
|
114
|
-
Count = "Count",
|
|
115
|
-
Sum = "Sum",
|
|
116
|
-
Avg = "Avg",
|
|
117
|
-
Min = "Min",
|
|
118
|
-
Max = "Max",
|
|
119
|
-
CountDistinct = "CountDistinct"
|
|
120
|
-
}
|
|
121
|
-
interface Join {
|
|
122
|
-
table: string;
|
|
123
|
-
on: any;
|
|
124
|
-
}
|
|
125
|
-
interface Aggregate {
|
|
126
|
-
column: string;
|
|
127
|
-
function: AggregateFunction;
|
|
128
|
-
alias: string;
|
|
129
|
-
}
|
|
130
|
-
interface GroupBy {
|
|
131
|
-
columns: string[];
|
|
132
|
-
}
|
|
133
|
-
interface Sort {
|
|
134
|
-
column: string;
|
|
135
|
-
direction: SortType;
|
|
136
|
-
}
|
|
137
|
-
interface SimilarityOptions {
|
|
138
|
-
threshold: number;
|
|
139
|
-
order?: SortType;
|
|
140
|
-
alias?: string;
|
|
141
|
-
}
|
|
142
|
-
declare enum FilterOperation {
|
|
143
|
-
LT = "LT",
|
|
144
|
-
LTE = "LTE",
|
|
145
|
-
GT = "GT",
|
|
146
|
-
GTE = "GTE",
|
|
147
|
-
EQ = "EQ",
|
|
148
|
-
NEQ = "NEQ",
|
|
149
|
-
Between = "Between",
|
|
150
|
-
In = "In",
|
|
151
|
-
Contains = "Contains",
|
|
152
|
-
Overlap = "Overlap",
|
|
153
|
-
NotIn = "NotIn",
|
|
154
|
-
Like = "Like",
|
|
155
|
-
NotLike = "NotLike",
|
|
156
|
-
ILike = "ILike",
|
|
157
|
-
NotILike = "NotILike",
|
|
158
|
-
IsNull = "IsNull",
|
|
159
|
-
IsNotNull = "IsNotNull",
|
|
160
|
-
Similarity = "Similarity",
|
|
161
|
-
SimilarityDistance = "SimilarityDistance",
|
|
162
|
-
WordSimilarity = "WordSimilarity",
|
|
163
|
-
WordSimilarityDistance = "WordSimilarityDistance",
|
|
164
|
-
StrictWordSimilarity = "StrictWordSimilarity",
|
|
165
|
-
StrictWordSimilarityDistance = "StrictWordSimilarityDistance",
|
|
166
|
-
EuclideanDistance = "EuclideanDistance",
|
|
167
|
-
NegativeInnerProduct = "NegativeInnerProduct",
|
|
168
|
-
CosineDistance = "CosineDistance"
|
|
169
|
-
}
|
|
170
|
-
interface FilterItem {
|
|
171
|
-
columnName: string;
|
|
172
|
-
operator: FilterOperation;
|
|
173
|
-
staticValue?: any;
|
|
174
|
-
columnValue?: string;
|
|
175
|
-
simiarityOptions?: SimilarityOptions;
|
|
176
|
-
}
|
|
177
|
-
type FilterGroup = FilterItem[];
|
|
178
|
-
type Filter = FilterGroup[];
|
|
179
|
-
|
|
180
191
|
interface SyntropixDBTable {
|
|
181
192
|
id: string;
|
|
182
193
|
name: string;
|
|
@@ -473,7 +484,7 @@ declare class BaseModel {
|
|
|
473
484
|
private _extra;
|
|
474
485
|
constructor(data?: Record<string, any>);
|
|
475
486
|
protected static getTableName(): string;
|
|
476
|
-
protected static getDisplayName(): string;
|
|
487
|
+
protected static getDisplayName(): string | null;
|
|
477
488
|
static getDescription(): string;
|
|
478
489
|
protected static getIndexes(): SyntropixDBIndex[];
|
|
479
490
|
protected static getFields(): Record<string, Field>;
|
|
@@ -481,7 +492,7 @@ declare class BaseModel {
|
|
|
481
492
|
protected static getAssociations(): ForeignKeyField[];
|
|
482
493
|
protected getFields(): Record<string, Field>;
|
|
483
494
|
protected getTableName(): string;
|
|
484
|
-
protected getDisplayName(): string;
|
|
495
|
+
protected getDisplayName(): string | null;
|
|
485
496
|
protected getPrimaryKeyName(): string;
|
|
486
497
|
protected getPrimaryKey(): Field | undefined;
|
|
487
498
|
protected get client(): SyntropixClient;
|
|
@@ -589,4 +600,4 @@ declare const COSINE_DISTANCE: (field: string, value: any, options: SimilarityOp
|
|
|
589
600
|
declare const Value: (value: any) => any;
|
|
590
601
|
declare function FilterWrapper(filter: Filter | FilterGroup | FilterItem | undefined): Filter | undefined;
|
|
591
602
|
|
|
592
|
-
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 SyntropixDBColumn, type SyntropixDBForeignKey, type SyntropixDBIndex, 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 };
|
|
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,14 @@ 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
|
+
|
|
8
16
|
// src/types/model/db-index.ts
|
|
9
17
|
var IndexType = {
|
|
10
18
|
Gin: "Gin",
|
|
@@ -66,14 +74,6 @@ var ForeignKeyAction = {
|
|
|
66
74
|
NoAction: "NoAction",
|
|
67
75
|
SetDefault: "SetDefault"
|
|
68
76
|
};
|
|
69
|
-
|
|
70
|
-
// src/types/model/shared.ts
|
|
71
|
-
var AccessType = {
|
|
72
|
-
None: "None",
|
|
73
|
-
Read: "Read",
|
|
74
|
-
Write: "Write",
|
|
75
|
-
Admin: "Admin"
|
|
76
|
-
};
|
|
77
77
|
function handleError(error) {
|
|
78
78
|
const axiosErr = error;
|
|
79
79
|
if (axiosErr.response?.data?.status === "error") {
|
|
@@ -806,7 +806,7 @@ var BaseModel = class {
|
|
|
806
806
|
if ("displayName" in this && typeof this.displayName === "string") {
|
|
807
807
|
return this.displayName;
|
|
808
808
|
}
|
|
809
|
-
return
|
|
809
|
+
return null;
|
|
810
810
|
}
|
|
811
811
|
static getDescription() {
|
|
812
812
|
const metadataDescription = Reflect.getMetadata(DESCRIPTION_KEY, this);
|
|
@@ -897,8 +897,8 @@ var BaseModel = class {
|
|
|
897
897
|
const indexes = this.getIndexes();
|
|
898
898
|
return await client.table.createTable({
|
|
899
899
|
name: this.getTableName(),
|
|
900
|
-
displayName: this.getDisplayName(),
|
|
901
|
-
description: this.getDescription() || "
|
|
900
|
+
displayName: this.getDisplayName() || void 0,
|
|
901
|
+
description: this.getDescription() || "",
|
|
902
902
|
columns,
|
|
903
903
|
foreignKeys,
|
|
904
904
|
indexes
|