@rushdb/javascript-sdk 0.17.0 → 1.0.0
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/README.md +75 -59
- package/dist/api/api.d.ts +260 -19
- package/dist/api/index.d.ts +0 -1
- package/dist/api/rest-api-proxy.d.ts +1 -1
- package/dist/api/types.d.ts +0 -60
- package/dist/api/utils.d.ts +3 -33
- package/dist/common/constants.d.ts +2 -0
- package/dist/common/utils.d.ts +4 -2
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.node.d.ts +492 -69
- package/dist/index.worker.d.ts +492 -69
- package/dist/network/HttpClient.d.ts +1 -1
- package/dist/network/types.d.ts +3 -2
- package/dist/sdk/errors.d.ts +2 -1
- package/dist/sdk/model.d.ts +160 -20
- package/dist/sdk/record.d.ts +23 -67
- package/dist/sdk/sdk.d.ts +465 -42
- package/dist/sdk/utils.d.ts +2 -2
- package/dist/types/expressions.d.ts +11 -2
- package/dist/types/query.d.ts +8 -3
- package/dist/types/schema.d.ts +6 -4
- package/dist/types/utils.d.ts +2 -0
- package/dist/types/value.d.ts +18 -11
- package/package.json +1 -1
- package/dist/api/create-api.d.ts +0 -66
package/dist/index.node.d.ts
CHANGED
|
@@ -1,137 +1,560 @@
|
|
|
1
1
|
import { HttpClient, HttpClientResponse } from './network/HttpClient.js';
|
|
2
|
-
import { DBRecordsBatchDraft, Model, type DBRecord, DBRecordInstance, DBRecordDraft, DBRecordsArrayInstance, Transaction, EmptyTargetError, NonUniqueResultError, UniquenessError, idToDate, idToTimestamp, type Relation, type InferType, type SDKConfig } from './sdk/index.js';
|
|
3
2
|
import { type ApiResponse, RestAPI } from './api/index.js';
|
|
4
3
|
declare const RushDB: {
|
|
5
|
-
new (token?: string, config?: SDKConfig): {
|
|
4
|
+
new (token?: string, config?: import("./sdk/types.js").SDKConfig): {
|
|
6
5
|
state: import("./sdk/types.js").State;
|
|
7
|
-
models: Map<string, Model>;
|
|
8
|
-
registerModel(model: Model): Model<any>;
|
|
9
|
-
getModels(): Map<string, Model>;
|
|
10
|
-
getModel<Label extends keyof import("./types/query.js").Models | string = never>(label: Label): Label extends keyof import("./types/query.js").Models ? Model<import("./types/query.js").Models[Label]> : Model | undefined;
|
|
6
|
+
models: Map<string, import("./sdk/model.js").Model>;
|
|
7
|
+
registerModel(model: import("./sdk/model.js").Model): import("./sdk/model.js").Model<any>;
|
|
8
|
+
getModels(): Map<string, import("./sdk/model.js").Model>;
|
|
9
|
+
getModel<Label extends keyof import("./types/query.js").Models | string = never>(label: Label): Label extends keyof import("./types/query.js").Models ? import("./sdk/model.js").Model<import("./types/query.js").Models[Label]> : import("./sdk/model.js").Model | undefined;
|
|
11
10
|
toInstance<S extends import("./types/schema.js").Schema = import("./types/schema.js").Schema>(record: import("./types/utils.js").FlattenTypes<{
|
|
12
11
|
readonly __id: string;
|
|
13
12
|
readonly __label: string;
|
|
14
13
|
readonly __proptypes?: import("./types/utils.js").FlattenTypes<{ [Key in import("./types/schema.js").RequiredKeysRead<S>]: S[Key]["type"]; } & { [Key_1 in import("./types/schema.js").OptionalKeysRead<S>]?: S[Key_1]["type"] | undefined; }> | undefined;
|
|
15
|
-
} & import("./types/utils.js").FlattenTypes<import("./sdk/record.js").RecordProps<S>>>): DBRecordInstance<S, import("./types/query.js").SearchQuery<S>>;
|
|
16
|
-
api: ReturnType<typeof import("./api/create-api.js").createApi>;
|
|
14
|
+
} & import("./types/utils.js").FlattenTypes<import("./sdk/record.js").RecordProps<S>>>): import("./sdk/record.js").DBRecordInstance<S, import("./types/query.js").SearchQuery<S>>;
|
|
17
15
|
fetcher: ReturnType<typeof import("./network/index.js").createFetcher>;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
16
|
+
options: import("./sdk/types.js").SDKConfig["options"];
|
|
17
|
+
logger: import("./sdk/types.js").SDKConfig["logger"];
|
|
18
|
+
_extractTargetIds(target: import("./sdk/record.js").RelationTarget, operation: string): Array<string>;
|
|
19
|
+
records: {
|
|
20
|
+
attach: ({ source, target, options }: {
|
|
21
|
+
source: import("./sdk/record.js").DBRecordTarget;
|
|
22
|
+
target: import("./sdk/record.js").RelationTarget;
|
|
23
|
+
options?: import("./sdk/record.js").RelationOptions;
|
|
24
|
+
}, transaction?: import("./sdk/transaction.js").Transaction | string) => Promise<ApiResponse<{
|
|
25
|
+
message: string;
|
|
26
|
+
}>>;
|
|
27
|
+
detach: ({ source, target, options }: {
|
|
28
|
+
source: import("./sdk/record.js").DBRecordTarget;
|
|
29
|
+
target: import("./sdk/record.js").RelationTarget;
|
|
30
|
+
options?: import("./sdk/record.js").RelationDetachOptions;
|
|
31
|
+
}, transaction?: import("./sdk/transaction.js").Transaction | string) => Promise<ApiResponse<{
|
|
32
|
+
message: string;
|
|
33
|
+
}>>;
|
|
34
|
+
create: <S extends import("./types/schema.js").Schema = any>({ label, data, options }: {
|
|
35
|
+
label: string;
|
|
36
|
+
data: import("./types/value.js").PropertyDraft[] | import("./types/utils.js").FlattenTypes<{ [Key in import("./types/schema.js").RequiredKeysWrite<S>]: S[Key]["multiple"] extends true ? {
|
|
37
|
+
boolean: boolean;
|
|
38
|
+
datetime: import("./types/value.js").DatetimeObject | string;
|
|
39
|
+
null: null;
|
|
40
|
+
number: number;
|
|
41
|
+
string: string;
|
|
42
|
+
vector: Array<number>;
|
|
43
|
+
}[S[Key]["type"]][] : {
|
|
44
|
+
boolean: boolean;
|
|
45
|
+
datetime: import("./types/value.js").DatetimeObject | string;
|
|
46
|
+
null: null;
|
|
47
|
+
number: number;
|
|
48
|
+
string: string;
|
|
49
|
+
vector: Array<number>;
|
|
50
|
+
}[S[Key]["type"]]; } & { [Key_1 in import("./types/schema.js").OptionalKeysWrite<S>]?: (S[Key_1]["multiple"] extends true ? {
|
|
51
|
+
boolean: boolean;
|
|
52
|
+
datetime: import("./types/value.js").DatetimeObject | string;
|
|
53
|
+
null: null;
|
|
54
|
+
number: number;
|
|
55
|
+
string: string;
|
|
56
|
+
vector: Array<number>;
|
|
57
|
+
}[S[Key_1]["type"]][] : {
|
|
58
|
+
boolean: boolean;
|
|
59
|
+
datetime: import("./types/value.js").DatetimeObject | string;
|
|
60
|
+
null: null;
|
|
61
|
+
number: number;
|
|
62
|
+
string: string;
|
|
63
|
+
vector: Array<number>;
|
|
64
|
+
}[S[Key_1]["type"]]) | undefined; }>;
|
|
65
|
+
options?: Omit<import("./sdk/record.js").DBRecordCreationOptions, "returnResult" | "capitalizeLabels" | "relationshipType">;
|
|
66
|
+
}, transaction?: import("./sdk/transaction.js").Transaction | string) => Promise<import("./sdk/record.js").DBRecordInstance<S, import("./types/query.js").SearchQuery<S>>>;
|
|
67
|
+
createMany: <S extends import("./types/schema.js").Schema = any>(data: {
|
|
68
|
+
label: string;
|
|
69
|
+
data: import("./types/utils.js").MaybeArray<import("./types/utils.js").AnyObject>;
|
|
70
|
+
options?: import("./sdk/record.js").DBRecordCreationOptions;
|
|
71
|
+
}, transaction?: import("./sdk/transaction.js").Transaction | string) => Promise<import("./sdk/record.js").DBRecordsArrayInstance<S, import("./types/query.js").SearchQuery<S>>>;
|
|
72
|
+
delete: <S extends import("./types/schema.js").Schema = any>(searchQuery: import("./types/query.js").SearchQuery<S>, transaction?: import("./sdk/transaction.js").Transaction | string) => Promise<ApiResponse<{
|
|
73
|
+
message: string;
|
|
74
|
+
}>>;
|
|
75
|
+
deleteById: (idOrIds: import("./types/utils.js").MaybeArray<string>, transaction?: import("./sdk/transaction.js").Transaction | string) => Promise<ApiResponse<{
|
|
76
|
+
message: string;
|
|
77
|
+
}>>;
|
|
78
|
+
export: <S extends import("./types/schema.js").Schema = any>(searchQuery: import("./types/query.js").SearchQuery<S>, transaction?: import("./sdk/transaction.js").Transaction | string) => Promise<ApiResponse<{
|
|
79
|
+
dateTime: string;
|
|
80
|
+
fileContent: string;
|
|
81
|
+
}>>;
|
|
82
|
+
find: <S extends import("./types/schema.js").Schema = any, Q extends import("./types/query.js").SearchQuery<S> = import("./types/query.js").SearchQuery<S>>(searchQueryWithEntryPoint: Q & {
|
|
83
|
+
id?: string;
|
|
84
|
+
}, transaction?: import("./sdk/transaction.js").Transaction | string) => Promise<import("./sdk/record.js").DBRecordsArrayInstance<S, Q>>;
|
|
85
|
+
findById: <S extends import("./types/schema.js").Schema = import("./types/schema.js").Schema, Arg extends import("./types/utils.js").MaybeArray<string> = import("./types/utils.js").MaybeArray<string>, Result = Arg extends string[] ? import("./sdk/record.js").DBRecordsArrayInstance<S, import("./types/query.js").SearchQuery<S>> : import("./sdk/record.js").DBRecordInstance<S, import("./types/query.js").SearchQuery<S>>>(idOrIds: Arg, transaction?: import("./sdk/transaction.js").Transaction | string) => Promise<Result>;
|
|
86
|
+
findOne: <S extends import("./types/schema.js").Schema = any, Q extends import("./types/query.js").SearchQuery<S> = import("./types/query.js").SearchQuery<S>>(searchQuery: Q, transaction?: import("./sdk/transaction.js").Transaction | string) => Promise<import("./sdk/record.js").DBRecordInstance<S, import("./types/query.js").SearchQuery<S>>>;
|
|
87
|
+
findUniq: <S extends import("./types/schema.js").Schema = any, Q extends import("./types/query.js").SearchQuery<S> = import("./types/query.js").SearchQuery<S>>(searchQuery: Q, transaction?: import("./sdk/transaction.js").Transaction | string) => Promise<import("./sdk/record.js").DBRecordInstance<S, Q>>;
|
|
88
|
+
set: <S extends import("./types/schema.js").Schema = any>({ target, label, data, options }: {
|
|
89
|
+
target: import("./sdk/record.js").DBRecordTarget;
|
|
90
|
+
label: string;
|
|
91
|
+
data: import("./types/value.js").PropertyDraft[] | import("./types/utils.js").FlattenTypes<{ [Key in import("./types/schema.js").RequiredKeysWrite<S>]: S[Key]["multiple"] extends true ? {
|
|
92
|
+
boolean: boolean;
|
|
93
|
+
datetime: import("./types/value.js").DatetimeObject | string;
|
|
94
|
+
null: null;
|
|
95
|
+
number: number;
|
|
96
|
+
string: string;
|
|
97
|
+
vector: Array<number>;
|
|
98
|
+
}[S[Key]["type"]][] : {
|
|
99
|
+
boolean: boolean;
|
|
100
|
+
datetime: import("./types/value.js").DatetimeObject | string;
|
|
101
|
+
null: null;
|
|
102
|
+
number: number;
|
|
103
|
+
string: string;
|
|
104
|
+
vector: Array<number>;
|
|
105
|
+
}[S[Key]["type"]]; } & { [Key_1 in import("./types/schema.js").OptionalKeysWrite<S>]?: (S[Key_1]["multiple"] extends true ? {
|
|
106
|
+
boolean: boolean;
|
|
107
|
+
datetime: import("./types/value.js").DatetimeObject | string;
|
|
108
|
+
null: null;
|
|
109
|
+
number: number;
|
|
110
|
+
string: string;
|
|
111
|
+
vector: Array<number>;
|
|
112
|
+
}[S[Key_1]["type"]][] : {
|
|
113
|
+
boolean: boolean;
|
|
114
|
+
datetime: import("./types/value.js").DatetimeObject | string;
|
|
115
|
+
null: null;
|
|
116
|
+
number: number;
|
|
117
|
+
string: string;
|
|
118
|
+
vector: Array<number>;
|
|
119
|
+
}[S[Key_1]["type"]]) | undefined; }>;
|
|
120
|
+
options?: Omit<import("./sdk/record.js").DBRecordCreationOptions, "returnResult" | "capitalizeLabels" | "relationshipType">;
|
|
121
|
+
}, transaction?: import("./sdk/transaction.js").Transaction | string) => Promise<import("./sdk/record.js").DBRecordInstance<S, import("./types/query.js").SearchQuery<S>>>;
|
|
122
|
+
update: <S extends import("./types/schema.js").Schema = any>({ target, label, data, options }: {
|
|
123
|
+
target: import("./sdk/record.js").DBRecordTarget;
|
|
124
|
+
label: string;
|
|
125
|
+
data: import("./types/value.js").PropertyDraft[] | Partial<import("./types/utils.js").FlattenTypes<{ [Key in import("./types/schema.js").RequiredKeysWrite<S>]: S[Key]["multiple"] extends true ? {
|
|
126
|
+
boolean: boolean;
|
|
127
|
+
datetime: import("./types/value.js").DatetimeObject | string;
|
|
128
|
+
null: null;
|
|
129
|
+
number: number;
|
|
130
|
+
string: string;
|
|
131
|
+
vector: Array<number>;
|
|
132
|
+
}[S[Key]["type"]][] : {
|
|
133
|
+
boolean: boolean;
|
|
134
|
+
datetime: import("./types/value.js").DatetimeObject | string;
|
|
135
|
+
null: null;
|
|
136
|
+
number: number;
|
|
137
|
+
string: string;
|
|
138
|
+
vector: Array<number>;
|
|
139
|
+
}[S[Key]["type"]]; } & { [Key_1 in import("./types/schema.js").OptionalKeysWrite<S>]?: (S[Key_1]["multiple"] extends true ? {
|
|
140
|
+
boolean: boolean;
|
|
141
|
+
datetime: import("./types/value.js").DatetimeObject | string;
|
|
142
|
+
null: null;
|
|
143
|
+
number: number;
|
|
144
|
+
string: string;
|
|
145
|
+
vector: Array<number>;
|
|
146
|
+
}[S[Key_1]["type"]][] : {
|
|
147
|
+
boolean: boolean;
|
|
148
|
+
datetime: import("./types/value.js").DatetimeObject | string;
|
|
149
|
+
null: null;
|
|
150
|
+
number: number;
|
|
151
|
+
string: string;
|
|
152
|
+
vector: Array<number>;
|
|
153
|
+
}[S[Key_1]["type"]]) | undefined; }>>;
|
|
154
|
+
options?: Omit<import("./sdk/record.js").DBRecordCreationOptions, "returnResult" | "capitalizeLabels" | "relationshipType">;
|
|
155
|
+
}, transaction?: import("./sdk/transaction.js").Transaction | string) => Promise<import("./sdk/record.js").DBRecordInstance<S, import("./types/query.js").SearchQuery<S>>>;
|
|
156
|
+
};
|
|
157
|
+
relationships: {
|
|
158
|
+
find: <S extends import("./types/schema.js").Schema = any>(searchQuery: import("./types/query.js").SearchQuery<S>, transaction?: import("./sdk/transaction.js").Transaction | string) => Promise<ApiResponse<import("./sdk/record.js").Relation[]>>;
|
|
25
159
|
};
|
|
26
160
|
properties: {
|
|
27
|
-
delete: (id: string, transaction?: Transaction | string) => Promise<ApiResponse<import("./types/value.js").Property>>;
|
|
28
|
-
find: <S extends import("./types/schema.js").Schema = any>(
|
|
29
|
-
findById: (id: string, transaction?: Transaction | string) => Promise<ApiResponse<import("./types/value.js").Property>>;
|
|
30
|
-
values: (id: string, options?: import("./types/value.js").PropertyValuesOptions, transaction?: Transaction | string) => Promise<ApiResponse<
|
|
161
|
+
delete: (id: string, transaction?: import("./sdk/transaction.js").Transaction | string) => Promise<ApiResponse<import("./types/value.js").Property>>;
|
|
162
|
+
find: <S extends import("./types/schema.js").Schema = any>(searchQuery: import("./types/query.js").SearchQuery<S>, transaction?: import("./sdk/transaction.js").Transaction | string) => Promise<ApiResponse<import("./types/value.js").Property[]>>;
|
|
163
|
+
findById: (id: string, transaction?: import("./sdk/transaction.js").Transaction | string) => Promise<ApiResponse<import("./types/value.js").Property>>;
|
|
164
|
+
values: (id: string, options?: import("./types/value.js").PropertyValuesOptions, transaction?: import("./sdk/transaction.js").Transaction | string) => Promise<ApiResponse<{
|
|
165
|
+
metadata?: string;
|
|
166
|
+
name: string;
|
|
167
|
+
type: import("./types/value.js").PropertyType;
|
|
168
|
+
} & {
|
|
169
|
+
id: string;
|
|
170
|
+
} & import("./types/value.js").PropertyValuesData>>;
|
|
31
171
|
};
|
|
32
172
|
labels: {
|
|
33
|
-
find: <S extends import("./types/schema.js").Schema = any>(
|
|
173
|
+
find: <S extends import("./types/schema.js").Schema = any>(searchQuery: import("./types/query.js").SearchQuery<S>, transaction?: import("./sdk/transaction.js").Transaction | string) => Promise<ApiResponse<Record<string, number>>>;
|
|
34
174
|
};
|
|
35
175
|
tx: {
|
|
36
176
|
begin: (config?: Partial<{
|
|
37
177
|
ttl: number;
|
|
38
|
-
}>) => Promise<Transaction>;
|
|
39
|
-
commit: (
|
|
178
|
+
}>) => Promise<import("./sdk/transaction.js").Transaction>;
|
|
179
|
+
commit: (tx: string | import("./sdk/transaction.js").Transaction) => Promise<ApiResponse<{
|
|
40
180
|
message: string;
|
|
41
181
|
}>>;
|
|
42
|
-
get: (
|
|
43
|
-
rollback: (
|
|
182
|
+
get: (tx: string | import("./sdk/transaction.js").Transaction) => Promise<import("./sdk/transaction.js").Transaction>;
|
|
183
|
+
rollback: (tx: string | import("./sdk/transaction.js").Transaction) => Promise<ApiResponse<{
|
|
44
184
|
message: string;
|
|
45
185
|
}>>;
|
|
46
186
|
};
|
|
47
187
|
};
|
|
48
188
|
instance: {
|
|
49
189
|
state: import("./sdk/types.js").State;
|
|
50
|
-
models: Map<string, Model>;
|
|
51
|
-
registerModel(model: Model): Model<any>;
|
|
52
|
-
getModels(): Map<string, Model>;
|
|
53
|
-
getModel<Label extends keyof import("./types/query.js").Models | string = never>(label: Label): Label extends keyof import("./types/query.js").Models ? Model<import("./types/query.js").Models[Label]> : Model | undefined;
|
|
190
|
+
models: Map<string, import("./sdk/model.js").Model>;
|
|
191
|
+
registerModel(model: import("./sdk/model.js").Model): import("./sdk/model.js").Model<any>;
|
|
192
|
+
getModels(): Map<string, import("./sdk/model.js").Model>;
|
|
193
|
+
getModel<Label extends keyof import("./types/query.js").Models | string = never>(label: Label): Label extends keyof import("./types/query.js").Models ? import("./sdk/model.js").Model<import("./types/query.js").Models[Label]> : import("./sdk/model.js").Model | undefined;
|
|
54
194
|
toInstance<S extends import("./types/schema.js").Schema = import("./types/schema.js").Schema>(record: import("./types/utils.js").FlattenTypes<{
|
|
55
195
|
readonly __id: string;
|
|
56
196
|
readonly __label: string;
|
|
57
197
|
readonly __proptypes?: import("./types/utils.js").FlattenTypes<{ [Key in import("./types/schema.js").RequiredKeysRead<S>]: S[Key]["type"]; } & { [Key_1 in import("./types/schema.js").OptionalKeysRead<S>]?: S[Key_1]["type"] | undefined; }> | undefined;
|
|
58
|
-
} & import("./types/utils.js").FlattenTypes<import("./sdk/record.js").RecordProps<S>>>): DBRecordInstance<S, import("./types/query.js").SearchQuery<S>>;
|
|
59
|
-
api: ReturnType<typeof import("./api/create-api.js").createApi>;
|
|
198
|
+
} & import("./types/utils.js").FlattenTypes<import("./sdk/record.js").RecordProps<S>>>): import("./sdk/record.js").DBRecordInstance<S, import("./types/query.js").SearchQuery<S>>;
|
|
60
199
|
fetcher: ReturnType<typeof import("./network/index.js").createFetcher>;
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
200
|
+
options: import("./sdk/types.js").SDKConfig["options"];
|
|
201
|
+
logger: import("./sdk/types.js").SDKConfig["logger"];
|
|
202
|
+
_extractTargetIds(target: import("./sdk/record.js").RelationTarget, operation: string): Array<string>;
|
|
203
|
+
records: {
|
|
204
|
+
attach: ({ source, target, options }: {
|
|
205
|
+
source: import("./sdk/record.js").DBRecordTarget;
|
|
206
|
+
target: import("./sdk/record.js").RelationTarget;
|
|
207
|
+
options?: import("./sdk/record.js").RelationOptions;
|
|
208
|
+
}, transaction?: import("./sdk/transaction.js").Transaction | string) => Promise<ApiResponse<{
|
|
209
|
+
message: string;
|
|
210
|
+
}>>;
|
|
211
|
+
detach: ({ source, target, options }: {
|
|
212
|
+
source: import("./sdk/record.js").DBRecordTarget;
|
|
213
|
+
target: import("./sdk/record.js").RelationTarget;
|
|
214
|
+
options?: import("./sdk/record.js").RelationDetachOptions;
|
|
215
|
+
}, transaction?: import("./sdk/transaction.js").Transaction | string) => Promise<ApiResponse<{
|
|
216
|
+
message: string;
|
|
217
|
+
}>>;
|
|
218
|
+
create: <S extends import("./types/schema.js").Schema = any>({ label, data, options }: {
|
|
219
|
+
label: string;
|
|
220
|
+
data: import("./types/value.js").PropertyDraft[] | import("./types/utils.js").FlattenTypes<{ [Key in import("./types/schema.js").RequiredKeysWrite<S>]: S[Key]["multiple"] extends true ? {
|
|
221
|
+
boolean: boolean;
|
|
222
|
+
datetime: import("./types/value.js").DatetimeObject | string;
|
|
223
|
+
null: null;
|
|
224
|
+
number: number;
|
|
225
|
+
string: string;
|
|
226
|
+
vector: Array<number>;
|
|
227
|
+
}[S[Key]["type"]][] : {
|
|
228
|
+
boolean: boolean;
|
|
229
|
+
datetime: import("./types/value.js").DatetimeObject | string;
|
|
230
|
+
null: null;
|
|
231
|
+
number: number;
|
|
232
|
+
string: string;
|
|
233
|
+
vector: Array<number>;
|
|
234
|
+
}[S[Key]["type"]]; } & { [Key_1 in import("./types/schema.js").OptionalKeysWrite<S>]?: (S[Key_1]["multiple"] extends true ? {
|
|
235
|
+
boolean: boolean;
|
|
236
|
+
datetime: import("./types/value.js").DatetimeObject | string;
|
|
237
|
+
null: null;
|
|
238
|
+
number: number;
|
|
239
|
+
string: string;
|
|
240
|
+
vector: Array<number>;
|
|
241
|
+
}[S[Key_1]["type"]][] : {
|
|
242
|
+
boolean: boolean;
|
|
243
|
+
datetime: import("./types/value.js").DatetimeObject | string;
|
|
244
|
+
null: null;
|
|
245
|
+
number: number;
|
|
246
|
+
string: string;
|
|
247
|
+
vector: Array<number>;
|
|
248
|
+
}[S[Key_1]["type"]]) | undefined; }>;
|
|
249
|
+
options?: Omit<import("./sdk/record.js").DBRecordCreationOptions, "returnResult" | "capitalizeLabels" | "relationshipType">;
|
|
250
|
+
}, transaction?: import("./sdk/transaction.js").Transaction | string) => Promise<import("./sdk/record.js").DBRecordInstance<S, import("./types/query.js").SearchQuery<S>>>;
|
|
251
|
+
createMany: <S extends import("./types/schema.js").Schema = any>(data: {
|
|
252
|
+
label: string;
|
|
253
|
+
data: import("./types/utils.js").MaybeArray<import("./types/utils.js").AnyObject>;
|
|
254
|
+
options?: import("./sdk/record.js").DBRecordCreationOptions;
|
|
255
|
+
}, transaction?: import("./sdk/transaction.js").Transaction | string) => Promise<import("./sdk/record.js").DBRecordsArrayInstance<S, import("./types/query.js").SearchQuery<S>>>;
|
|
256
|
+
delete: <S extends import("./types/schema.js").Schema = any>(searchQuery: import("./types/query.js").SearchQuery<S>, transaction?: import("./sdk/transaction.js").Transaction | string) => Promise<ApiResponse<{
|
|
257
|
+
message: string;
|
|
258
|
+
}>>;
|
|
259
|
+
deleteById: (idOrIds: import("./types/utils.js").MaybeArray<string>, transaction?: import("./sdk/transaction.js").Transaction | string) => Promise<ApiResponse<{
|
|
260
|
+
message: string;
|
|
261
|
+
}>>;
|
|
262
|
+
export: <S extends import("./types/schema.js").Schema = any>(searchQuery: import("./types/query.js").SearchQuery<S>, transaction?: import("./sdk/transaction.js").Transaction | string) => Promise<ApiResponse<{
|
|
263
|
+
dateTime: string;
|
|
264
|
+
fileContent: string;
|
|
265
|
+
}>>;
|
|
266
|
+
find: <S extends import("./types/schema.js").Schema = any, Q extends import("./types/query.js").SearchQuery<S> = import("./types/query.js").SearchQuery<S>>(searchQueryWithEntryPoint: Q & {
|
|
267
|
+
id?: string;
|
|
268
|
+
}, transaction?: import("./sdk/transaction.js").Transaction | string) => Promise<import("./sdk/record.js").DBRecordsArrayInstance<S, Q>>;
|
|
269
|
+
findById: <S extends import("./types/schema.js").Schema = import("./types/schema.js").Schema, Arg extends import("./types/utils.js").MaybeArray<string> = import("./types/utils.js").MaybeArray<string>, Result = Arg extends string[] ? import("./sdk/record.js").DBRecordsArrayInstance<S, import("./types/query.js").SearchQuery<S>> : import("./sdk/record.js").DBRecordInstance<S, import("./types/query.js").SearchQuery<S>>>(idOrIds: Arg, transaction?: import("./sdk/transaction.js").Transaction | string) => Promise<Result>;
|
|
270
|
+
findOne: <S extends import("./types/schema.js").Schema = any, Q extends import("./types/query.js").SearchQuery<S> = import("./types/query.js").SearchQuery<S>>(searchQuery: Q, transaction?: import("./sdk/transaction.js").Transaction | string) => Promise<import("./sdk/record.js").DBRecordInstance<S, import("./types/query.js").SearchQuery<S>>>;
|
|
271
|
+
findUniq: <S extends import("./types/schema.js").Schema = any, Q extends import("./types/query.js").SearchQuery<S> = import("./types/query.js").SearchQuery<S>>(searchQuery: Q, transaction?: import("./sdk/transaction.js").Transaction | string) => Promise<import("./sdk/record.js").DBRecordInstance<S, Q>>;
|
|
272
|
+
set: <S extends import("./types/schema.js").Schema = any>({ target, label, data, options }: {
|
|
273
|
+
target: import("./sdk/record.js").DBRecordTarget;
|
|
274
|
+
label: string;
|
|
275
|
+
data: import("./types/value.js").PropertyDraft[] | import("./types/utils.js").FlattenTypes<{ [Key in import("./types/schema.js").RequiredKeysWrite<S>]: S[Key]["multiple"] extends true ? {
|
|
276
|
+
boolean: boolean;
|
|
277
|
+
datetime: import("./types/value.js").DatetimeObject | string;
|
|
278
|
+
null: null;
|
|
279
|
+
number: number;
|
|
280
|
+
string: string;
|
|
281
|
+
vector: Array<number>;
|
|
282
|
+
}[S[Key]["type"]][] : {
|
|
283
|
+
boolean: boolean;
|
|
284
|
+
datetime: import("./types/value.js").DatetimeObject | string;
|
|
285
|
+
null: null;
|
|
286
|
+
number: number;
|
|
287
|
+
string: string;
|
|
288
|
+
vector: Array<number>;
|
|
289
|
+
}[S[Key]["type"]]; } & { [Key_1 in import("./types/schema.js").OptionalKeysWrite<S>]?: (S[Key_1]["multiple"] extends true ? {
|
|
290
|
+
boolean: boolean;
|
|
291
|
+
datetime: import("./types/value.js").DatetimeObject | string;
|
|
292
|
+
null: null;
|
|
293
|
+
number: number;
|
|
294
|
+
string: string;
|
|
295
|
+
vector: Array<number>;
|
|
296
|
+
}[S[Key_1]["type"]][] : {
|
|
297
|
+
boolean: boolean;
|
|
298
|
+
datetime: import("./types/value.js").DatetimeObject | string;
|
|
299
|
+
null: null;
|
|
300
|
+
number: number;
|
|
301
|
+
string: string;
|
|
302
|
+
vector: Array<number>;
|
|
303
|
+
}[S[Key_1]["type"]]) | undefined; }>;
|
|
304
|
+
options?: Omit<import("./sdk/record.js").DBRecordCreationOptions, "returnResult" | "capitalizeLabels" | "relationshipType">;
|
|
305
|
+
}, transaction?: import("./sdk/transaction.js").Transaction | string) => Promise<import("./sdk/record.js").DBRecordInstance<S, import("./types/query.js").SearchQuery<S>>>;
|
|
306
|
+
update: <S extends import("./types/schema.js").Schema = any>({ target, label, data, options }: {
|
|
307
|
+
target: import("./sdk/record.js").DBRecordTarget;
|
|
308
|
+
label: string;
|
|
309
|
+
data: import("./types/value.js").PropertyDraft[] | Partial<import("./types/utils.js").FlattenTypes<{ [Key in import("./types/schema.js").RequiredKeysWrite<S>]: S[Key]["multiple"] extends true ? {
|
|
310
|
+
boolean: boolean;
|
|
311
|
+
datetime: import("./types/value.js").DatetimeObject | string;
|
|
312
|
+
null: null;
|
|
313
|
+
number: number;
|
|
314
|
+
string: string;
|
|
315
|
+
vector: Array<number>;
|
|
316
|
+
}[S[Key]["type"]][] : {
|
|
317
|
+
boolean: boolean;
|
|
318
|
+
datetime: import("./types/value.js").DatetimeObject | string;
|
|
319
|
+
null: null;
|
|
320
|
+
number: number;
|
|
321
|
+
string: string;
|
|
322
|
+
vector: Array<number>;
|
|
323
|
+
}[S[Key]["type"]]; } & { [Key_1 in import("./types/schema.js").OptionalKeysWrite<S>]?: (S[Key_1]["multiple"] extends true ? {
|
|
324
|
+
boolean: boolean;
|
|
325
|
+
datetime: import("./types/value.js").DatetimeObject | string;
|
|
326
|
+
null: null;
|
|
327
|
+
number: number;
|
|
328
|
+
string: string;
|
|
329
|
+
vector: Array<number>;
|
|
330
|
+
}[S[Key_1]["type"]][] : {
|
|
331
|
+
boolean: boolean;
|
|
332
|
+
datetime: import("./types/value.js").DatetimeObject | string;
|
|
333
|
+
null: null;
|
|
334
|
+
number: number;
|
|
335
|
+
string: string;
|
|
336
|
+
vector: Array<number>;
|
|
337
|
+
}[S[Key_1]["type"]]) | undefined; }>>;
|
|
338
|
+
options?: Omit<import("./sdk/record.js").DBRecordCreationOptions, "returnResult" | "capitalizeLabels" | "relationshipType">;
|
|
339
|
+
}, transaction?: import("./sdk/transaction.js").Transaction | string) => Promise<import("./sdk/record.js").DBRecordInstance<S, import("./types/query.js").SearchQuery<S>>>;
|
|
340
|
+
};
|
|
341
|
+
relationships: {
|
|
342
|
+
find: <S extends import("./types/schema.js").Schema = any>(searchQuery: import("./types/query.js").SearchQuery<S>, transaction?: import("./sdk/transaction.js").Transaction | string) => Promise<ApiResponse<import("./sdk/record.js").Relation[]>>;
|
|
68
343
|
};
|
|
69
344
|
properties: {
|
|
70
|
-
delete: (id: string, transaction?: Transaction | string) => Promise<ApiResponse<import("./types/value.js").Property>>;
|
|
71
|
-
find: <S extends import("./types/schema.js").Schema = any>(
|
|
72
|
-
findById: (id: string, transaction?: Transaction | string) => Promise<ApiResponse<import("./types/value.js").Property>>;
|
|
73
|
-
values: (id: string, options?: import("./types/value.js").PropertyValuesOptions, transaction?: Transaction | string) => Promise<ApiResponse<
|
|
345
|
+
delete: (id: string, transaction?: import("./sdk/transaction.js").Transaction | string) => Promise<ApiResponse<import("./types/value.js").Property>>;
|
|
346
|
+
find: <S extends import("./types/schema.js").Schema = any>(searchQuery: import("./types/query.js").SearchQuery<S>, transaction?: import("./sdk/transaction.js").Transaction | string) => Promise<ApiResponse<import("./types/value.js").Property[]>>;
|
|
347
|
+
findById: (id: string, transaction?: import("./sdk/transaction.js").Transaction | string) => Promise<ApiResponse<import("./types/value.js").Property>>;
|
|
348
|
+
values: (id: string, options?: import("./types/value.js").PropertyValuesOptions, transaction?: import("./sdk/transaction.js").Transaction | string) => Promise<ApiResponse<{
|
|
349
|
+
metadata?: string;
|
|
350
|
+
name: string;
|
|
351
|
+
type: import("./types/value.js").PropertyType;
|
|
352
|
+
} & {
|
|
353
|
+
id: string;
|
|
354
|
+
} & import("./types/value.js").PropertyValuesData>>;
|
|
74
355
|
};
|
|
75
356
|
labels: {
|
|
76
|
-
find: <S extends import("./types/schema.js").Schema = any>(
|
|
357
|
+
find: <S extends import("./types/schema.js").Schema = any>(searchQuery: import("./types/query.js").SearchQuery<S>, transaction?: import("./sdk/transaction.js").Transaction | string) => Promise<ApiResponse<Record<string, number>>>;
|
|
77
358
|
};
|
|
78
359
|
tx: {
|
|
79
360
|
begin: (config?: Partial<{
|
|
80
361
|
ttl: number;
|
|
81
|
-
}>) => Promise<Transaction>;
|
|
82
|
-
commit: (
|
|
362
|
+
}>) => Promise<import("./sdk/transaction.js").Transaction>;
|
|
363
|
+
commit: (tx: string | import("./sdk/transaction.js").Transaction) => Promise<ApiResponse<{
|
|
83
364
|
message: string;
|
|
84
365
|
}>>;
|
|
85
|
-
get: (
|
|
86
|
-
rollback: (
|
|
366
|
+
get: (tx: string | import("./sdk/transaction.js").Transaction) => Promise<import("./sdk/transaction.js").Transaction>;
|
|
367
|
+
rollback: (tx: string | import("./sdk/transaction.js").Transaction) => Promise<ApiResponse<{
|
|
87
368
|
message: string;
|
|
88
369
|
}>>;
|
|
89
370
|
};
|
|
90
371
|
};
|
|
91
372
|
getInstance(): {
|
|
92
373
|
state: import("./sdk/types.js").State;
|
|
93
|
-
models: Map<string, Model>;
|
|
94
|
-
registerModel(model: Model): Model<any>;
|
|
95
|
-
getModels(): Map<string, Model>;
|
|
96
|
-
getModel<Label extends keyof import("./types/query.js").Models | string = never>(label: Label): Label extends keyof import("./types/query.js").Models ? Model<import("./types/query.js").Models[Label]> : Model | undefined;
|
|
374
|
+
models: Map<string, import("./sdk/model.js").Model>;
|
|
375
|
+
registerModel(model: import("./sdk/model.js").Model): import("./sdk/model.js").Model<any>;
|
|
376
|
+
getModels(): Map<string, import("./sdk/model.js").Model>;
|
|
377
|
+
getModel<Label extends keyof import("./types/query.js").Models | string = never>(label: Label): Label extends keyof import("./types/query.js").Models ? import("./sdk/model.js").Model<import("./types/query.js").Models[Label]> : import("./sdk/model.js").Model | undefined;
|
|
97
378
|
toInstance<S extends import("./types/schema.js").Schema = import("./types/schema.js").Schema>(record: import("./types/utils.js").FlattenTypes<{
|
|
98
379
|
readonly __id: string;
|
|
99
380
|
readonly __label: string;
|
|
100
381
|
readonly __proptypes?: import("./types/utils.js").FlattenTypes<{ [Key in import("./types/schema.js").RequiredKeysRead<S>]: S[Key]["type"]; } & { [Key_1 in import("./types/schema.js").OptionalKeysRead<S>]?: S[Key_1]["type"] | undefined; }> | undefined;
|
|
101
|
-
} & import("./types/utils.js").FlattenTypes<import("./sdk/record.js").RecordProps<S>>>): DBRecordInstance<S, import("./types/query.js").SearchQuery<S>>;
|
|
102
|
-
api: ReturnType<typeof import("./api/create-api.js").createApi>;
|
|
382
|
+
} & import("./types/utils.js").FlattenTypes<import("./sdk/record.js").RecordProps<S>>>): import("./sdk/record.js").DBRecordInstance<S, import("./types/query.js").SearchQuery<S>>;
|
|
103
383
|
fetcher: ReturnType<typeof import("./network/index.js").createFetcher>;
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
384
|
+
options: import("./sdk/types.js").SDKConfig["options"];
|
|
385
|
+
logger: import("./sdk/types.js").SDKConfig["logger"];
|
|
386
|
+
_extractTargetIds(target: import("./sdk/record.js").RelationTarget, operation: string): Array<string>;
|
|
387
|
+
records: {
|
|
388
|
+
attach: ({ source, target, options }: {
|
|
389
|
+
source: import("./sdk/record.js").DBRecordTarget;
|
|
390
|
+
target: import("./sdk/record.js").RelationTarget;
|
|
391
|
+
options?: import("./sdk/record.js").RelationOptions;
|
|
392
|
+
}, transaction?: import("./sdk/transaction.js").Transaction | string) => Promise<ApiResponse<{
|
|
393
|
+
message: string;
|
|
394
|
+
}>>;
|
|
395
|
+
detach: ({ source, target, options }: {
|
|
396
|
+
source: import("./sdk/record.js").DBRecordTarget;
|
|
397
|
+
target: import("./sdk/record.js").RelationTarget;
|
|
398
|
+
options?: import("./sdk/record.js").RelationDetachOptions;
|
|
399
|
+
}, transaction?: import("./sdk/transaction.js").Transaction | string) => Promise<ApiResponse<{
|
|
400
|
+
message: string;
|
|
401
|
+
}>>;
|
|
402
|
+
create: <S extends import("./types/schema.js").Schema = any>({ label, data, options }: {
|
|
403
|
+
label: string;
|
|
404
|
+
data: import("./types/value.js").PropertyDraft[] | import("./types/utils.js").FlattenTypes<{ [Key in import("./types/schema.js").RequiredKeysWrite<S>]: S[Key]["multiple"] extends true ? {
|
|
405
|
+
boolean: boolean;
|
|
406
|
+
datetime: import("./types/value.js").DatetimeObject | string;
|
|
407
|
+
null: null;
|
|
408
|
+
number: number;
|
|
409
|
+
string: string;
|
|
410
|
+
vector: Array<number>;
|
|
411
|
+
}[S[Key]["type"]][] : {
|
|
412
|
+
boolean: boolean;
|
|
413
|
+
datetime: import("./types/value.js").DatetimeObject | string;
|
|
414
|
+
null: null;
|
|
415
|
+
number: number;
|
|
416
|
+
string: string;
|
|
417
|
+
vector: Array<number>;
|
|
418
|
+
}[S[Key]["type"]]; } & { [Key_1 in import("./types/schema.js").OptionalKeysWrite<S>]?: (S[Key_1]["multiple"] extends true ? {
|
|
419
|
+
boolean: boolean;
|
|
420
|
+
datetime: import("./types/value.js").DatetimeObject | string;
|
|
421
|
+
null: null;
|
|
422
|
+
number: number;
|
|
423
|
+
string: string;
|
|
424
|
+
vector: Array<number>;
|
|
425
|
+
}[S[Key_1]["type"]][] : {
|
|
426
|
+
boolean: boolean;
|
|
427
|
+
datetime: import("./types/value.js").DatetimeObject | string;
|
|
428
|
+
null: null;
|
|
429
|
+
number: number;
|
|
430
|
+
string: string;
|
|
431
|
+
vector: Array<number>;
|
|
432
|
+
}[S[Key_1]["type"]]) | undefined; }>;
|
|
433
|
+
options?: Omit<import("./sdk/record.js").DBRecordCreationOptions, "returnResult" | "capitalizeLabels" | "relationshipType">;
|
|
434
|
+
}, transaction?: import("./sdk/transaction.js").Transaction | string) => Promise<import("./sdk/record.js").DBRecordInstance<S, import("./types/query.js").SearchQuery<S>>>;
|
|
435
|
+
createMany: <S extends import("./types/schema.js").Schema = any>(data: {
|
|
436
|
+
label: string;
|
|
437
|
+
data: import("./types/utils.js").MaybeArray<import("./types/utils.js").AnyObject>;
|
|
438
|
+
options?: import("./sdk/record.js").DBRecordCreationOptions;
|
|
439
|
+
}, transaction?: import("./sdk/transaction.js").Transaction | string) => Promise<import("./sdk/record.js").DBRecordsArrayInstance<S, import("./types/query.js").SearchQuery<S>>>;
|
|
440
|
+
delete: <S extends import("./types/schema.js").Schema = any>(searchQuery: import("./types/query.js").SearchQuery<S>, transaction?: import("./sdk/transaction.js").Transaction | string) => Promise<ApiResponse<{
|
|
441
|
+
message: string;
|
|
442
|
+
}>>;
|
|
443
|
+
deleteById: (idOrIds: import("./types/utils.js").MaybeArray<string>, transaction?: import("./sdk/transaction.js").Transaction | string) => Promise<ApiResponse<{
|
|
444
|
+
message: string;
|
|
445
|
+
}>>;
|
|
446
|
+
export: <S extends import("./types/schema.js").Schema = any>(searchQuery: import("./types/query.js").SearchQuery<S>, transaction?: import("./sdk/transaction.js").Transaction | string) => Promise<ApiResponse<{
|
|
447
|
+
dateTime: string;
|
|
448
|
+
fileContent: string;
|
|
449
|
+
}>>;
|
|
450
|
+
find: <S extends import("./types/schema.js").Schema = any, Q extends import("./types/query.js").SearchQuery<S> = import("./types/query.js").SearchQuery<S>>(searchQueryWithEntryPoint: Q & {
|
|
451
|
+
id?: string;
|
|
452
|
+
}, transaction?: import("./sdk/transaction.js").Transaction | string) => Promise<import("./sdk/record.js").DBRecordsArrayInstance<S, Q>>;
|
|
453
|
+
findById: <S extends import("./types/schema.js").Schema = import("./types/schema.js").Schema, Arg extends import("./types/utils.js").MaybeArray<string> = import("./types/utils.js").MaybeArray<string>, Result = Arg extends string[] ? import("./sdk/record.js").DBRecordsArrayInstance<S, import("./types/query.js").SearchQuery<S>> : import("./sdk/record.js").DBRecordInstance<S, import("./types/query.js").SearchQuery<S>>>(idOrIds: Arg, transaction?: import("./sdk/transaction.js").Transaction | string) => Promise<Result>;
|
|
454
|
+
findOne: <S extends import("./types/schema.js").Schema = any, Q extends import("./types/query.js").SearchQuery<S> = import("./types/query.js").SearchQuery<S>>(searchQuery: Q, transaction?: import("./sdk/transaction.js").Transaction | string) => Promise<import("./sdk/record.js").DBRecordInstance<S, import("./types/query.js").SearchQuery<S>>>;
|
|
455
|
+
findUniq: <S extends import("./types/schema.js").Schema = any, Q extends import("./types/query.js").SearchQuery<S> = import("./types/query.js").SearchQuery<S>>(searchQuery: Q, transaction?: import("./sdk/transaction.js").Transaction | string) => Promise<import("./sdk/record.js").DBRecordInstance<S, Q>>;
|
|
456
|
+
set: <S extends import("./types/schema.js").Schema = any>({ target, label, data, options }: {
|
|
457
|
+
target: import("./sdk/record.js").DBRecordTarget;
|
|
458
|
+
label: string;
|
|
459
|
+
data: import("./types/value.js").PropertyDraft[] | import("./types/utils.js").FlattenTypes<{ [Key in import("./types/schema.js").RequiredKeysWrite<S>]: S[Key]["multiple"] extends true ? {
|
|
460
|
+
boolean: boolean;
|
|
461
|
+
datetime: import("./types/value.js").DatetimeObject | string;
|
|
462
|
+
null: null;
|
|
463
|
+
number: number;
|
|
464
|
+
string: string;
|
|
465
|
+
vector: Array<number>;
|
|
466
|
+
}[S[Key]["type"]][] : {
|
|
467
|
+
boolean: boolean;
|
|
468
|
+
datetime: import("./types/value.js").DatetimeObject | string;
|
|
469
|
+
null: null;
|
|
470
|
+
number: number;
|
|
471
|
+
string: string;
|
|
472
|
+
vector: Array<number>;
|
|
473
|
+
}[S[Key]["type"]]; } & { [Key_1 in import("./types/schema.js").OptionalKeysWrite<S>]?: (S[Key_1]["multiple"] extends true ? {
|
|
474
|
+
boolean: boolean;
|
|
475
|
+
datetime: import("./types/value.js").DatetimeObject | string;
|
|
476
|
+
null: null;
|
|
477
|
+
number: number;
|
|
478
|
+
string: string;
|
|
479
|
+
vector: Array<number>;
|
|
480
|
+
}[S[Key_1]["type"]][] : {
|
|
481
|
+
boolean: boolean;
|
|
482
|
+
datetime: import("./types/value.js").DatetimeObject | string;
|
|
483
|
+
null: null;
|
|
484
|
+
number: number;
|
|
485
|
+
string: string;
|
|
486
|
+
vector: Array<number>;
|
|
487
|
+
}[S[Key_1]["type"]]) | undefined; }>;
|
|
488
|
+
options?: Omit<import("./sdk/record.js").DBRecordCreationOptions, "returnResult" | "capitalizeLabels" | "relationshipType">;
|
|
489
|
+
}, transaction?: import("./sdk/transaction.js").Transaction | string) => Promise<import("./sdk/record.js").DBRecordInstance<S, import("./types/query.js").SearchQuery<S>>>;
|
|
490
|
+
update: <S extends import("./types/schema.js").Schema = any>({ target, label, data, options }: {
|
|
491
|
+
target: import("./sdk/record.js").DBRecordTarget;
|
|
492
|
+
label: string;
|
|
493
|
+
data: import("./types/value.js").PropertyDraft[] | Partial<import("./types/utils.js").FlattenTypes<{ [Key in import("./types/schema.js").RequiredKeysWrite<S>]: S[Key]["multiple"] extends true ? {
|
|
494
|
+
boolean: boolean;
|
|
495
|
+
datetime: import("./types/value.js").DatetimeObject | string;
|
|
496
|
+
null: null;
|
|
497
|
+
number: number;
|
|
498
|
+
string: string;
|
|
499
|
+
vector: Array<number>;
|
|
500
|
+
}[S[Key]["type"]][] : {
|
|
501
|
+
boolean: boolean;
|
|
502
|
+
datetime: import("./types/value.js").DatetimeObject | string;
|
|
503
|
+
null: null;
|
|
504
|
+
number: number;
|
|
505
|
+
string: string;
|
|
506
|
+
vector: Array<number>;
|
|
507
|
+
}[S[Key]["type"]]; } & { [Key_1 in import("./types/schema.js").OptionalKeysWrite<S>]?: (S[Key_1]["multiple"] extends true ? {
|
|
508
|
+
boolean: boolean;
|
|
509
|
+
datetime: import("./types/value.js").DatetimeObject | string;
|
|
510
|
+
null: null;
|
|
511
|
+
number: number;
|
|
512
|
+
string: string;
|
|
513
|
+
vector: Array<number>;
|
|
514
|
+
}[S[Key_1]["type"]][] : {
|
|
515
|
+
boolean: boolean;
|
|
516
|
+
datetime: import("./types/value.js").DatetimeObject | string;
|
|
517
|
+
null: null;
|
|
518
|
+
number: number;
|
|
519
|
+
string: string;
|
|
520
|
+
vector: Array<number>;
|
|
521
|
+
}[S[Key_1]["type"]]) | undefined; }>>;
|
|
522
|
+
options?: Omit<import("./sdk/record.js").DBRecordCreationOptions, "returnResult" | "capitalizeLabels" | "relationshipType">;
|
|
523
|
+
}, transaction?: import("./sdk/transaction.js").Transaction | string) => Promise<import("./sdk/record.js").DBRecordInstance<S, import("./types/query.js").SearchQuery<S>>>;
|
|
524
|
+
};
|
|
525
|
+
relationships: {
|
|
526
|
+
find: <S extends import("./types/schema.js").Schema = any>(searchQuery: import("./types/query.js").SearchQuery<S>, transaction?: import("./sdk/transaction.js").Transaction | string) => Promise<ApiResponse<import("./sdk/record.js").Relation[]>>;
|
|
111
527
|
};
|
|
112
528
|
properties: {
|
|
113
|
-
delete: (id: string, transaction?: Transaction | string) => Promise<ApiResponse<import("./types/value.js").Property>>;
|
|
114
|
-
find: <S extends import("./types/schema.js").Schema = any>(
|
|
115
|
-
findById: (id: string, transaction?: Transaction | string) => Promise<ApiResponse<import("./types/value.js").Property>>;
|
|
116
|
-
values: (id: string, options?: import("./types/value.js").PropertyValuesOptions, transaction?: Transaction | string) => Promise<ApiResponse<
|
|
529
|
+
delete: (id: string, transaction?: import("./sdk/transaction.js").Transaction | string) => Promise<ApiResponse<import("./types/value.js").Property>>;
|
|
530
|
+
find: <S extends import("./types/schema.js").Schema = any>(searchQuery: import("./types/query.js").SearchQuery<S>, transaction?: import("./sdk/transaction.js").Transaction | string) => Promise<ApiResponse<import("./types/value.js").Property[]>>;
|
|
531
|
+
findById: (id: string, transaction?: import("./sdk/transaction.js").Transaction | string) => Promise<ApiResponse<import("./types/value.js").Property>>;
|
|
532
|
+
values: (id: string, options?: import("./types/value.js").PropertyValuesOptions, transaction?: import("./sdk/transaction.js").Transaction | string) => Promise<ApiResponse<{
|
|
533
|
+
metadata?: string;
|
|
534
|
+
name: string;
|
|
535
|
+
type: import("./types/value.js").PropertyType;
|
|
536
|
+
} & {
|
|
537
|
+
id: string;
|
|
538
|
+
} & import("./types/value.js").PropertyValuesData>>;
|
|
117
539
|
};
|
|
118
540
|
labels: {
|
|
119
|
-
find: <S extends import("./types/schema.js").Schema = any>(
|
|
541
|
+
find: <S extends import("./types/schema.js").Schema = any>(searchQuery: import("./types/query.js").SearchQuery<S>, transaction?: import("./sdk/transaction.js").Transaction | string) => Promise<ApiResponse<Record<string, number>>>;
|
|
120
542
|
};
|
|
121
543
|
tx: {
|
|
122
544
|
begin: (config?: Partial<{
|
|
123
545
|
ttl: number;
|
|
124
|
-
}>) => Promise<Transaction>;
|
|
125
|
-
commit: (
|
|
546
|
+
}>) => Promise<import("./sdk/transaction.js").Transaction>;
|
|
547
|
+
commit: (tx: string | import("./sdk/transaction.js").Transaction) => Promise<ApiResponse<{
|
|
126
548
|
message: string;
|
|
127
549
|
}>>;
|
|
128
|
-
get: (
|
|
129
|
-
rollback: (
|
|
550
|
+
get: (tx: string | import("./sdk/transaction.js").Transaction) => Promise<import("./sdk/transaction.js").Transaction>;
|
|
551
|
+
rollback: (tx: string | import("./sdk/transaction.js").Transaction) => Promise<ApiResponse<{
|
|
130
552
|
message: string;
|
|
131
553
|
}>>;
|
|
132
554
|
};
|
|
133
555
|
};
|
|
134
556
|
};
|
|
135
|
-
export { RushDB,
|
|
557
|
+
export { RushDB, HttpClient, HttpClientResponse, RestAPI, type ApiResponse };
|
|
136
558
|
export * from './types/index.js';
|
|
559
|
+
export * from './sdk/index.js';
|
|
137
560
|
export default RushDB;
|