@rushdb/javascript-sdk 0.9.4 → 0.10.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/{types → dist}/api/create-api.d.ts +6 -6
- package/{types → dist}/api/types.d.ts +17 -17
- package/dist/index.cjs +1 -0
- package/dist/index.mjs +1 -0
- package/dist/index.node.d.ts +137 -0
- package/dist/index.worker.d.ts +137 -0
- package/{types → dist}/sdk/model.d.ts +19 -15
- package/{types → dist}/sdk/record.d.ts +15 -12
- package/{types → dist}/sdk/sdk.d.ts +27 -27
- package/{types → dist}/sdk/transaction.d.ts +2 -2
- package/{types → dist}/types/query.d.ts +15 -8
- package/package.json +36 -39
- package/CHANGELOG.md +0 -180
- package/cjs/api/api.js +0 -328
- package/cjs/api/constants.js +0 -7
- package/cjs/api/create-api.js +0 -323
- package/cjs/api/index.js +0 -8
- package/cjs/api/rest-api-proxy.js +0 -22
- package/cjs/api/types.js +0 -2
- package/cjs/api/utils.js +0 -155
- package/cjs/common/constants.js +0 -10
- package/cjs/common/utils.js +0 -46
- package/cjs/index.cjs.node.js +0 -24
- package/cjs/index.cjs.worker.js +0 -24
- package/cjs/network/FetchHttpClient.js +0 -138
- package/cjs/network/HttpClient.js +0 -59
- package/cjs/network/NodeHttpClient.js +0 -103
- package/cjs/network/index.js +0 -28
- package/cjs/network/types.js +0 -2
- package/cjs/package.json +0 -4
- package/cjs/sdk/constants.js +0 -13
- package/cjs/sdk/errors.js +0 -27
- package/cjs/sdk/index.js +0 -23
- package/cjs/sdk/model.js +0 -147
- package/cjs/sdk/record.js +0 -122
- package/cjs/sdk/sdk.js +0 -46
- package/cjs/sdk/transaction.js +0 -17
- package/cjs/sdk/types.js +0 -2
- package/cjs/sdk/utils.js +0 -103
- package/cjs/types/expressions.js +0 -2
- package/cjs/types/index.js +0 -21
- package/cjs/types/query.js +0 -2
- package/cjs/types/schema.js +0 -2
- package/cjs/types/utils.js +0 -2
- package/cjs/types/value.js +0 -2
- package/esm/api/api.js +0 -324
- package/esm/api/constants.js +0 -4
- package/esm/api/create-api.js +0 -319
- package/esm/api/index.js +0 -2
- package/esm/api/rest-api-proxy.js +0 -18
- package/esm/api/types.js +0 -1
- package/esm/api/utils.js +0 -139
- package/esm/common/constants.js +0 -7
- package/esm/common/utils.js +0 -37
- package/esm/index.esm.node.js +0 -6
- package/esm/index.esm.worker.js +0 -6
- package/esm/network/FetchHttpClient.js +0 -133
- package/esm/network/HttpClient.js +0 -53
- package/esm/network/NodeHttpClient.js +0 -98
- package/esm/network/index.js +0 -24
- package/esm/network/types.js +0 -1
- package/esm/package.json +0 -4
- package/esm/sdk/constants.js +0 -10
- package/esm/sdk/errors.js +0 -21
- package/esm/sdk/index.js +0 -7
- package/esm/sdk/model.js +0 -143
- package/esm/sdk/record.js +0 -115
- package/esm/sdk/sdk.js +0 -42
- package/esm/sdk/transaction.js +0 -13
- package/esm/sdk/types.js +0 -1
- package/esm/sdk/utils.js +0 -93
- package/esm/types/expressions.js +0 -1
- package/esm/types/index.js +0 -5
- package/esm/types/query.js +0 -1
- package/esm/types/schema.js +0 -1
- package/esm/types/utils.js +0 -1
- package/esm/types/value.js +0 -1
- package/types/index.d.ts +0 -60
- /package/{types → dist}/api/api.d.ts +0 -0
- /package/{types → dist}/api/constants.d.ts +0 -0
- /package/{types → dist}/api/index.d.ts +0 -0
- /package/{types → dist}/api/rest-api-proxy.d.ts +0 -0
- /package/{types → dist}/api/utils.d.ts +0 -0
- /package/{types → dist}/common/constants.d.ts +0 -0
- /package/{types → dist}/common/utils.d.ts +0 -0
- /package/{types → dist}/network/FetchHttpClient.d.ts +0 -0
- /package/{types → dist}/network/HttpClient.d.ts +0 -0
- /package/{types → dist}/network/NodeHttpClient.d.ts +0 -0
- /package/{types → dist}/network/index.d.ts +0 -0
- /package/{types → dist}/network/types.d.ts +0 -0
- /package/{types → dist}/sdk/constants.d.ts +0 -0
- /package/{types → dist}/sdk/errors.d.ts +0 -0
- /package/{types → dist}/sdk/index.d.ts +0 -0
- /package/{types → dist}/sdk/types.d.ts +0 -0
- /package/{types → dist}/sdk/utils.d.ts +0 -0
- /package/{types → dist}/types/expressions.d.ts +0 -0
- /package/{types → dist}/types/index.d.ts +0 -0
- /package/{types → dist}/types/schema.d.ts +0 -0
- /package/{types → dist}/types/utils.d.ts +0 -0
- /package/{types → dist}/types/value.d.ts +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AnyObject,
|
|
1
|
+
import type { AnyObject, ExtractAggregateFields, FlattenTypes, InferSchemaTypesRead, InferSchemaTypesWrite, MaybeArray, OptionalKeysRead, PropertyType, PropertyValue, PropertyWithValue, RequiredKeysRead, Schema, SearchQuery } from '../types/index.js';
|
|
2
2
|
import type { Transaction } from './transaction.js';
|
|
3
3
|
import { RestApiProxy } from '../api/rest-api-proxy.js';
|
|
4
4
|
type DBRecordInternalProps<S extends Schema = Schema> = {
|
|
@@ -13,6 +13,9 @@ type DBRecordInternalProps<S extends Schema = Schema> = {
|
|
|
13
13
|
export type RecordProps<S extends Schema = Schema> = S extends S ? InferSchemaTypesRead<S> : {
|
|
14
14
|
[K in keyof S]?: S[K];
|
|
15
15
|
};
|
|
16
|
+
export type DBRecordInferred<S extends Schema, Q extends SearchQuery<S>> = Q extends {
|
|
17
|
+
aggregate: infer A extends Record<string, any>;
|
|
18
|
+
} ? DBRecord<S> & ExtractAggregateFields<A> : DBRecord<S>;
|
|
16
19
|
export type DBRecord<S extends Schema = Schema> = FlattenTypes<DBRecordInternalProps<S> & FlattenTypes<RecordProps<S>>>;
|
|
17
20
|
export type DBRecordTarget = DBRecord<any> | DBRecordInstance<any> | string;
|
|
18
21
|
export type RelationTarget = DBRecordsArrayInstance<any> | MaybeArray<DBRecord<any>> | MaybeArray<DBRecordInstance<any>> | MaybeArray<string>;
|
|
@@ -84,30 +87,30 @@ export declare class DBRecordDraft {
|
|
|
84
87
|
}[] | undefined;
|
|
85
88
|
};
|
|
86
89
|
}
|
|
87
|
-
export declare class DBRecordInstance<S extends Schema = Schema> extends RestApiProxy {
|
|
88
|
-
data?:
|
|
89
|
-
constructor(data?:
|
|
90
|
+
export declare class DBRecordInstance<S extends Schema = Schema, Q extends SearchQuery<S> = SearchQuery<S>> extends RestApiProxy {
|
|
91
|
+
data?: DBRecordInferred<S, Q>;
|
|
92
|
+
constructor(data?: DBRecordInferred<S, Q>);
|
|
90
93
|
get id(): string;
|
|
91
94
|
get label(): string;
|
|
92
95
|
get proptypes(): FlattenTypes<FlattenTypes<{ [Key in RequiredKeysRead<S>]: S[Key]["type"]; } & { [Key_1 in OptionalKeysRead<S>]?: S[Key_1]["type"] | undefined; }>> | undefined;
|
|
93
96
|
get date(): Date;
|
|
94
97
|
get timestamp(): number;
|
|
95
|
-
delete(transaction?: Transaction | string): Promise<import("../
|
|
98
|
+
delete(transaction?: Transaction | string): Promise<import("../index.node.js").ApiResponse<{
|
|
96
99
|
message: string;
|
|
97
100
|
}, Record<string, any>>>;
|
|
98
|
-
update<S extends Schema = Schema>(partialData: DBRecordDraft | Partial<InferSchemaTypesWrite<S>>, transaction?: Transaction | string): Promise<DBRecordInstance<S
|
|
99
|
-
set<S extends Schema = Schema>(data: DBRecordDraft | InferSchemaTypesWrite<S>, transaction?: Transaction | string): Promise<DBRecordInstance<S
|
|
100
|
-
attach(target: RelationTarget, options?: RelationOptions, transaction?: Transaction | string): Promise<import("../
|
|
101
|
+
update<S extends Schema = Schema>(partialData: DBRecordDraft | Partial<InferSchemaTypesWrite<S>>, transaction?: Transaction | string): Promise<DBRecordInstance<S, SearchQuery<S>>>;
|
|
102
|
+
set<S extends Schema = Schema>(data: DBRecordDraft | InferSchemaTypesWrite<S>, transaction?: Transaction | string): Promise<DBRecordInstance<S, SearchQuery<S>>>;
|
|
103
|
+
attach(target: RelationTarget, options?: RelationOptions, transaction?: Transaction | string): Promise<import("../index.node.js").ApiResponse<{
|
|
101
104
|
message: string;
|
|
102
105
|
}, Record<string, any>>>;
|
|
103
|
-
detach(target: RelationTarget, options?: RelationDetachOptions, transaction?: Transaction | string): Promise<import("../
|
|
106
|
+
detach(target: RelationTarget, options?: RelationDetachOptions, transaction?: Transaction | string): Promise<import("../index.node.js").ApiResponse<{
|
|
104
107
|
message: string;
|
|
105
108
|
}, Record<string, any>>>;
|
|
106
109
|
}
|
|
107
|
-
export declare class DBRecordsArrayInstance<S extends Schema = Schema> extends RestApiProxy {
|
|
108
|
-
data?:
|
|
110
|
+
export declare class DBRecordsArrayInstance<S extends Schema = Schema, Q extends SearchQuery<S> = SearchQuery<S>> extends RestApiProxy {
|
|
111
|
+
data?: DBRecordInferred<S, Q>[];
|
|
109
112
|
total: number | undefined;
|
|
110
113
|
searchParams?: SearchQuery<S>;
|
|
111
|
-
constructor(data?:
|
|
114
|
+
constructor(data?: DBRecordInferred<S, Q>[], total?: number, searchParams?: SearchQuery<S>);
|
|
112
115
|
}
|
|
113
116
|
export {};
|
|
@@ -14,7 +14,7 @@ export declare const initSDK: (httpClient: HttpClient) => {
|
|
|
14
14
|
readonly __id: string;
|
|
15
15
|
readonly __label: string;
|
|
16
16
|
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;
|
|
17
|
-
} & import("../types/utils.js").FlattenTypes<import("./record.js").RecordProps<S>>>): DBRecordInstance<S
|
|
17
|
+
} & import("../types/utils.js").FlattenTypes<import("./record.js").RecordProps<S>>>): DBRecordInstance<S, import("../types/query.js").SearchQuery<S>>;
|
|
18
18
|
api: ReturnType<typeof import("../api/create-api.js").createApi>;
|
|
19
19
|
fetcher: ReturnType<typeof import("../network/index.js").createFetcher>;
|
|
20
20
|
records: import("../api/types.js").RecordsApi;
|
|
@@ -23,26 +23,26 @@ export declare const initSDK: (httpClient: HttpClient) => {
|
|
|
23
23
|
pagination?: Pick<import("../types/query.js").SearchQuery, "limit" | "skip">;
|
|
24
24
|
search?: import("../types/query.js").SearchQuery<S> | undefined;
|
|
25
25
|
transaction?: import("./transaction.js").Transaction | string;
|
|
26
|
-
}) => Promise<import("../
|
|
26
|
+
}) => Promise<import("../index.node.js").ApiResponse<import("./record.js").Relation[]>>;
|
|
27
27
|
};
|
|
28
28
|
properties: {
|
|
29
|
-
delete: (id: string, transaction?: import("./transaction.js").Transaction | string) => Promise<import("../
|
|
30
|
-
find: <S extends Schema = any>(searchParams: import("../types/query.js").SearchQuery<S>, transaction?: import("./transaction.js").Transaction | string) => Promise<import("../
|
|
31
|
-
findById: (id: string, transaction?: import("./transaction.js").Transaction | string) => Promise<import("../
|
|
32
|
-
values: (id: string, transaction?: import("./transaction.js").Transaction | string) => Promise<import("../
|
|
29
|
+
delete: (id: string, transaction?: import("./transaction.js").Transaction | string) => Promise<import("../index.node.js").ApiResponse<import("../types/value.js").Property>>;
|
|
30
|
+
find: <S extends Schema = any>(searchParams: import("../types/query.js").SearchQuery<S>, transaction?: import("./transaction.js").Transaction | string) => Promise<import("../index.node.js").ApiResponse<import("../types/value.js").Property[]>>;
|
|
31
|
+
findById: (id: string, transaction?: import("./transaction.js").Transaction | string) => Promise<import("../index.node.js").ApiResponse<import("../types/value.js").Property>>;
|
|
32
|
+
values: (id: string, transaction?: import("./transaction.js").Transaction | string) => Promise<import("../index.node.js").ApiResponse<import("../types/value.js").Property & import("../types/value.js").PropertyValuesData>>;
|
|
33
33
|
};
|
|
34
34
|
labels: {
|
|
35
|
-
find: <S extends Schema = any>(searchParams: import("../types/query.js").SearchQuery<S>, transaction?: import("./transaction.js").Transaction | string) => Promise<import("../
|
|
35
|
+
find: <S extends Schema = any>(searchParams: import("../types/query.js").SearchQuery<S>, transaction?: import("./transaction.js").Transaction | string) => Promise<import("../index.node.js").ApiResponse<Record<string, number>>>;
|
|
36
36
|
};
|
|
37
37
|
tx: {
|
|
38
38
|
begin: (config?: Partial<{
|
|
39
39
|
ttl: number;
|
|
40
40
|
}>) => Promise<import("./transaction.js").Transaction>;
|
|
41
|
-
commit: (id: string) => Promise<import("../
|
|
41
|
+
commit: (id: string) => Promise<import("../index.node.js").ApiResponse<{
|
|
42
42
|
message: string;
|
|
43
43
|
}>>;
|
|
44
44
|
get: (id: string) => Promise<import("./transaction.js").Transaction>;
|
|
45
|
-
rollback: (id: string) => Promise<import("../
|
|
45
|
+
rollback: (id: string) => Promise<import("../index.node.js").ApiResponse<{
|
|
46
46
|
message: string;
|
|
47
47
|
}>>;
|
|
48
48
|
};
|
|
@@ -57,7 +57,7 @@ export declare const initSDK: (httpClient: HttpClient) => {
|
|
|
57
57
|
readonly __id: string;
|
|
58
58
|
readonly __label: string;
|
|
59
59
|
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;
|
|
60
|
-
} & import("../types/utils.js").FlattenTypes<import("./record.js").RecordProps<S>>>): DBRecordInstance<S
|
|
60
|
+
} & import("../types/utils.js").FlattenTypes<import("./record.js").RecordProps<S>>>): DBRecordInstance<S, import("../types/query.js").SearchQuery<S>>;
|
|
61
61
|
api: ReturnType<typeof import("../api/create-api.js").createApi>;
|
|
62
62
|
fetcher: ReturnType<typeof import("../network/index.js").createFetcher>;
|
|
63
63
|
records: import("../api/types.js").RecordsApi;
|
|
@@ -66,26 +66,26 @@ export declare const initSDK: (httpClient: HttpClient) => {
|
|
|
66
66
|
pagination?: Pick<import("../types/query.js").SearchQuery, "limit" | "skip">;
|
|
67
67
|
search?: import("../types/query.js").SearchQuery<S> | undefined;
|
|
68
68
|
transaction?: import("./transaction.js").Transaction | string;
|
|
69
|
-
}) => Promise<import("../
|
|
69
|
+
}) => Promise<import("../index.node.js").ApiResponse<import("./record.js").Relation[]>>;
|
|
70
70
|
};
|
|
71
71
|
properties: {
|
|
72
|
-
delete: (id: string, transaction?: import("./transaction.js").Transaction | string) => Promise<import("../
|
|
73
|
-
find: <S extends Schema = any>(searchParams: import("../types/query.js").SearchQuery<S>, transaction?: import("./transaction.js").Transaction | string) => Promise<import("../
|
|
74
|
-
findById: (id: string, transaction?: import("./transaction.js").Transaction | string) => Promise<import("../
|
|
75
|
-
values: (id: string, transaction?: import("./transaction.js").Transaction | string) => Promise<import("../
|
|
72
|
+
delete: (id: string, transaction?: import("./transaction.js").Transaction | string) => Promise<import("../index.node.js").ApiResponse<import("../types/value.js").Property>>;
|
|
73
|
+
find: <S extends Schema = any>(searchParams: import("../types/query.js").SearchQuery<S>, transaction?: import("./transaction.js").Transaction | string) => Promise<import("../index.node.js").ApiResponse<import("../types/value.js").Property[]>>;
|
|
74
|
+
findById: (id: string, transaction?: import("./transaction.js").Transaction | string) => Promise<import("../index.node.js").ApiResponse<import("../types/value.js").Property>>;
|
|
75
|
+
values: (id: string, transaction?: import("./transaction.js").Transaction | string) => Promise<import("../index.node.js").ApiResponse<import("../types/value.js").Property & import("../types/value.js").PropertyValuesData>>;
|
|
76
76
|
};
|
|
77
77
|
labels: {
|
|
78
|
-
find: <S extends Schema = any>(searchParams: import("../types/query.js").SearchQuery<S>, transaction?: import("./transaction.js").Transaction | string) => Promise<import("../
|
|
78
|
+
find: <S extends Schema = any>(searchParams: import("../types/query.js").SearchQuery<S>, transaction?: import("./transaction.js").Transaction | string) => Promise<import("../index.node.js").ApiResponse<Record<string, number>>>;
|
|
79
79
|
};
|
|
80
80
|
tx: {
|
|
81
81
|
begin: (config?: Partial<{
|
|
82
82
|
ttl: number;
|
|
83
83
|
}>) => Promise<import("./transaction.js").Transaction>;
|
|
84
|
-
commit: (id: string) => Promise<import("../
|
|
84
|
+
commit: (id: string) => Promise<import("../index.node.js").ApiResponse<{
|
|
85
85
|
message: string;
|
|
86
86
|
}>>;
|
|
87
87
|
get: (id: string) => Promise<import("./transaction.js").Transaction>;
|
|
88
|
-
rollback: (id: string) => Promise<import("../
|
|
88
|
+
rollback: (id: string) => Promise<import("../index.node.js").ApiResponse<{
|
|
89
89
|
message: string;
|
|
90
90
|
}>>;
|
|
91
91
|
};
|
|
@@ -100,7 +100,7 @@ export declare const initSDK: (httpClient: HttpClient) => {
|
|
|
100
100
|
readonly __id: string;
|
|
101
101
|
readonly __label: string;
|
|
102
102
|
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;
|
|
103
|
-
} & import("../types/utils.js").FlattenTypes<import("./record.js").RecordProps<S>>>): DBRecordInstance<S
|
|
103
|
+
} & import("../types/utils.js").FlattenTypes<import("./record.js").RecordProps<S>>>): DBRecordInstance<S, import("../types/query.js").SearchQuery<S>>;
|
|
104
104
|
api: ReturnType<typeof import("../api/create-api.js").createApi>;
|
|
105
105
|
fetcher: ReturnType<typeof import("../network/index.js").createFetcher>;
|
|
106
106
|
records: import("../api/types.js").RecordsApi;
|
|
@@ -109,26 +109,26 @@ export declare const initSDK: (httpClient: HttpClient) => {
|
|
|
109
109
|
pagination?: Pick<import("../types/query.js").SearchQuery, "limit" | "skip">;
|
|
110
110
|
search?: import("../types/query.js").SearchQuery<S> | undefined;
|
|
111
111
|
transaction?: import("./transaction.js").Transaction | string;
|
|
112
|
-
}) => Promise<import("../
|
|
112
|
+
}) => Promise<import("../index.node.js").ApiResponse<import("./record.js").Relation[]>>;
|
|
113
113
|
};
|
|
114
114
|
properties: {
|
|
115
|
-
delete: (id: string, transaction?: import("./transaction.js").Transaction | string) => Promise<import("../
|
|
116
|
-
find: <S extends Schema = any>(searchParams: import("../types/query.js").SearchQuery<S>, transaction?: import("./transaction.js").Transaction | string) => Promise<import("../
|
|
117
|
-
findById: (id: string, transaction?: import("./transaction.js").Transaction | string) => Promise<import("../
|
|
118
|
-
values: (id: string, transaction?: import("./transaction.js").Transaction | string) => Promise<import("../
|
|
115
|
+
delete: (id: string, transaction?: import("./transaction.js").Transaction | string) => Promise<import("../index.node.js").ApiResponse<import("../types/value.js").Property>>;
|
|
116
|
+
find: <S extends Schema = any>(searchParams: import("../types/query.js").SearchQuery<S>, transaction?: import("./transaction.js").Transaction | string) => Promise<import("../index.node.js").ApiResponse<import("../types/value.js").Property[]>>;
|
|
117
|
+
findById: (id: string, transaction?: import("./transaction.js").Transaction | string) => Promise<import("../index.node.js").ApiResponse<import("../types/value.js").Property>>;
|
|
118
|
+
values: (id: string, transaction?: import("./transaction.js").Transaction | string) => Promise<import("../index.node.js").ApiResponse<import("../types/value.js").Property & import("../types/value.js").PropertyValuesData>>;
|
|
119
119
|
};
|
|
120
120
|
labels: {
|
|
121
|
-
find: <S extends Schema = any>(searchParams: import("../types/query.js").SearchQuery<S>, transaction?: import("./transaction.js").Transaction | string) => Promise<import("../
|
|
121
|
+
find: <S extends Schema = any>(searchParams: import("../types/query.js").SearchQuery<S>, transaction?: import("./transaction.js").Transaction | string) => Promise<import("../index.node.js").ApiResponse<Record<string, number>>>;
|
|
122
122
|
};
|
|
123
123
|
tx: {
|
|
124
124
|
begin: (config?: Partial<{
|
|
125
125
|
ttl: number;
|
|
126
126
|
}>) => Promise<import("./transaction.js").Transaction>;
|
|
127
|
-
commit: (id: string) => Promise<import("../
|
|
127
|
+
commit: (id: string) => Promise<import("../index.node.js").ApiResponse<{
|
|
128
128
|
message: string;
|
|
129
129
|
}>>;
|
|
130
130
|
get: (id: string) => Promise<import("./transaction.js").Transaction>;
|
|
131
|
-
rollback: (id: string) => Promise<import("../
|
|
131
|
+
rollback: (id: string) => Promise<import("../index.node.js").ApiResponse<{
|
|
132
132
|
message: string;
|
|
133
133
|
}>>;
|
|
134
134
|
};
|
|
@@ -2,10 +2,10 @@ import { RestApiProxy } from '../api/rest-api-proxy.js';
|
|
|
2
2
|
export declare class Transaction extends RestApiProxy {
|
|
3
3
|
readonly id: string;
|
|
4
4
|
constructor(id: string);
|
|
5
|
-
rollback(): Promise<import("../
|
|
5
|
+
rollback(): Promise<import("../index.node.js").ApiResponse<{
|
|
6
6
|
message: string;
|
|
7
7
|
}>>;
|
|
8
|
-
commit(): Promise<import("../
|
|
8
|
+
commit(): Promise<import("../index.node.js").ApiResponse<{
|
|
9
9
|
message: string;
|
|
10
10
|
}>>;
|
|
11
11
|
}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import type { RelationOptions } from '../sdk/index.js';
|
|
2
|
-
import type { BooleanExpression,
|
|
1
|
+
import type { Model, RelationOptions } from '../sdk/index.js';
|
|
2
|
+
import type { BooleanExpression, DatetimeExpression, LogicalGrouping, NullExpression, NumberExpression, PropertyExpression, PropertyExpressionByType, StringExpression } from './expressions.js';
|
|
3
3
|
import type { Schema } from './schema.js';
|
|
4
|
-
import type { MaybeArray, RequireAtLeastOne } from './utils.js';
|
|
5
|
-
export type
|
|
6
|
-
|
|
7
|
-
[Key in keyof Models]?: {
|
|
4
|
+
import type { AnyObject, MaybeArray, RequireAtLeastOne } from './utils.js';
|
|
5
|
+
export type Related<M extends Record<string, Model['schema']> = Models> = keyof M extends never ? AnyObject : {
|
|
6
|
+
[Key in keyof M]?: {
|
|
8
7
|
$alias?: string;
|
|
9
|
-
$relation?:
|
|
10
|
-
} & Where<
|
|
8
|
+
$relation?: RelationOptions | string;
|
|
9
|
+
} & Where<M[Key]>;
|
|
11
10
|
};
|
|
12
11
|
export type LogicalExpressionValue<T = PropertyExpression & Related> = AndExpression<T> | NorExpression<T> | NotExpression<T> | OrExpression<T> | T | XorExpression<T>;
|
|
13
12
|
export type AndExpression<T = PropertyExpression & Related> = {
|
|
@@ -80,6 +79,14 @@ export type Aggregate = {
|
|
|
80
79
|
} | {
|
|
81
80
|
[field: string]: AggregateFn | string;
|
|
82
81
|
};
|
|
82
|
+
type InferAggregateType<T extends AggregateFn | string> = T extends string ? any : T extends {
|
|
83
|
+
fn: 'sum' | 'avg' | 'min' | 'max' | 'count';
|
|
84
|
+
} ? number : T extends {
|
|
85
|
+
fn: 'collect';
|
|
86
|
+
} ? any[] : never;
|
|
87
|
+
export type ExtractAggregateFields<A extends Record<string, AggregateFn>> = {
|
|
88
|
+
[K in keyof A]: InferAggregateType<A[K]>;
|
|
89
|
+
};
|
|
83
90
|
export type WhereClause<S extends Schema = Schema> = {
|
|
84
91
|
where?: Where<S>;
|
|
85
92
|
};
|
package/package.json
CHANGED
|
@@ -2,20 +2,45 @@
|
|
|
2
2
|
"name": "@rushdb/javascript-sdk",
|
|
3
3
|
"description": "RushDB Javascript SDK",
|
|
4
4
|
"keywords": [
|
|
5
|
-
"neo4j",
|
|
6
5
|
"database",
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"
|
|
6
|
+
"graph database",
|
|
7
|
+
"instant database",
|
|
8
|
+
"instant-database",
|
|
9
|
+
"instantdatabase",
|
|
10
|
+
"instant db",
|
|
11
|
+
"instant-db",
|
|
11
12
|
"instantdb",
|
|
13
|
+
"neo4j",
|
|
14
|
+
"cypher",
|
|
15
|
+
"ai",
|
|
16
|
+
"ai database",
|
|
17
|
+
"etl",
|
|
18
|
+
"data-pipeline",
|
|
19
|
+
"data science",
|
|
20
|
+
"data-science",
|
|
21
|
+
"data management",
|
|
22
|
+
"data-management",
|
|
23
|
+
"machine learning",
|
|
24
|
+
"machine-learning",
|
|
25
|
+
"persistence",
|
|
26
|
+
"db",
|
|
27
|
+
"graph",
|
|
28
|
+
"graphs",
|
|
29
|
+
"graph-database",
|
|
30
|
+
"self-hosted",
|
|
31
|
+
"rush-db",
|
|
32
|
+
"rush db",
|
|
12
33
|
"rushdb"
|
|
13
34
|
],
|
|
14
35
|
"license": "Apache-2.0",
|
|
15
|
-
"version": "0.
|
|
36
|
+
"version": "0.10.0",
|
|
16
37
|
"type": "module",
|
|
17
|
-
"
|
|
18
|
-
|
|
38
|
+
"files": [
|
|
39
|
+
"dist"
|
|
40
|
+
],
|
|
41
|
+
"main": "./dist/index.cjs",
|
|
42
|
+
"module": "./dist/index.mjs",
|
|
43
|
+
"types": "./dist/index.worker.d.ts",
|
|
19
44
|
"devDependencies": {},
|
|
20
45
|
"peerDependencies": {},
|
|
21
46
|
"sideEffects": false,
|
|
@@ -27,38 +52,10 @@
|
|
|
27
52
|
"type": "https",
|
|
28
53
|
"url": "https://github.com/rush-db/rushdb"
|
|
29
54
|
},
|
|
30
|
-
"exports": {
|
|
31
|
-
"types": "./types/index.d.ts",
|
|
32
|
-
"browser": {
|
|
33
|
-
"import": "./esm/index.esm.worker.js",
|
|
34
|
-
"require": "./cjs/index.cjs.worker.js"
|
|
35
|
-
},
|
|
36
|
-
"bun": {
|
|
37
|
-
"import": "./esm/index.esm.worker.js",
|
|
38
|
-
"require": "./cjs/index.cjs.worker.js"
|
|
39
|
-
},
|
|
40
|
-
"deno": {
|
|
41
|
-
"import": "./esm/index.esm.worker.js",
|
|
42
|
-
"require": "./cjs/index.cjs.worker.js"
|
|
43
|
-
},
|
|
44
|
-
"worker": {
|
|
45
|
-
"import": "./esm/index.esm.worker.js",
|
|
46
|
-
"require": "./cjs/index.cjs.worker.js"
|
|
47
|
-
},
|
|
48
|
-
"workerd": {
|
|
49
|
-
"import": "./esm/index.esm.worker.js",
|
|
50
|
-
"require": "./cjs/index.cjs.worker.js"
|
|
51
|
-
},
|
|
52
|
-
"default": {
|
|
53
|
-
"import": "./esm/index.esm.node.js",
|
|
54
|
-
"require": "./cjs/index.cjs.node.js"
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
55
|
"scripts": {
|
|
58
|
-
"build": "pnpm clean && pnpm build
|
|
59
|
-
"build
|
|
60
|
-
"build
|
|
61
|
-
"postbuild": "node scripts/post-build.js",
|
|
56
|
+
"build": "pnpm clean && pnpm build:package && pnpm build:types",
|
|
57
|
+
"build:package": "node esbuild.config.cjs",
|
|
58
|
+
"build:types": "tsc --emitDeclarationOnly --outDir dist",
|
|
62
59
|
"types:check": "tsc --noEmit",
|
|
63
60
|
"clean": "rm -rf ./dist ./node_modules/.cache ./coverage ./esm ./cjs ./types",
|
|
64
61
|
"flush": "rm -rf node_modules",
|
package/CHANGELOG.md
DELETED
|
@@ -1,180 +0,0 @@
|
|
|
1
|
-
# @rushdb/javascript-sdk
|
|
2
|
-
|
|
3
|
-
## 0.9.4
|
|
4
|
-
|
|
5
|
-
### Patch Changes
|
|
6
|
-
|
|
7
|
-
- 09e2d57: Update docs, minor fixes and cleanups
|
|
8
|
-
|
|
9
|
-
## 0.9.3
|
|
10
|
-
|
|
11
|
-
### Patch Changes
|
|
12
|
-
|
|
13
|
-
- 22ce867: billing setup update for dev/prod envs
|
|
14
|
-
|
|
15
|
-
## 0.9.2
|
|
16
|
-
|
|
17
|
-
### Patch Changes
|
|
18
|
-
|
|
19
|
-
- eafe1b5: updated secret credentials
|
|
20
|
-
|
|
21
|
-
## 0.9.1
|
|
22
|
-
|
|
23
|
-
### Patch Changes
|
|
24
|
-
|
|
25
|
-
- b055539: Dashboard/website: Introduced start plan, updated dashboard && website layouts
|
|
26
|
-
|
|
27
|
-
## 0.9.0
|
|
28
|
-
|
|
29
|
-
### Minor Changes
|
|
30
|
-
|
|
31
|
-
- 6cc7392: Release 0.9.0 version with updated billing
|
|
32
|
-
|
|
33
|
-
## 0.8.2
|
|
34
|
-
|
|
35
|
-
### Patch Changes
|
|
36
|
-
|
|
37
|
-
- 6e900d7: bump other packages to 0.8.1
|
|
38
|
-
|
|
39
|
-
## 0.8.1
|
|
40
|
-
|
|
41
|
-
### Patch Changes
|
|
42
|
-
|
|
43
|
-
- 3d65528: Core/Dashboard/Website now accept billing data from internal billing service instead of hardcoded values
|
|
44
|
-
|
|
45
|
-
## 0.8.0
|
|
46
|
-
|
|
47
|
-
### Minor Changes
|
|
48
|
-
|
|
49
|
-
- 49e3153: Dependencies update & landing page rework
|
|
50
|
-
|
|
51
|
-
## 0.7.2
|
|
52
|
-
|
|
53
|
-
### Patch Changes
|
|
54
|
-
|
|
55
|
-
- c32b9bf: Aggregations minor fixes
|
|
56
|
-
|
|
57
|
-
## 0.7.1
|
|
58
|
-
|
|
59
|
-
### Patch Changes
|
|
60
|
-
|
|
61
|
-
- 0551051: Restore original skip & limit behaviour for nested search
|
|
62
|
-
|
|
63
|
-
## 0.7.0
|
|
64
|
-
|
|
65
|
-
### Minor Changes
|
|
66
|
-
|
|
67
|
-
- 5470782: Fix result cut-off for nested queries and url parsing in node.js env at sdk's networking
|
|
68
|
-
|
|
69
|
-
## 0.6.0
|
|
70
|
-
|
|
71
|
-
### Minor Changes
|
|
72
|
-
|
|
73
|
-
- 6ec52f2: Add simple backup module, cli command and minor fixes
|
|
74
|
-
|
|
75
|
-
## 0.5.0
|
|
76
|
-
|
|
77
|
-
### Minor Changes
|
|
78
|
-
|
|
79
|
-
- 3112626: Implemented logger feature for sdk
|
|
80
|
-
|
|
81
|
-
## 0.4.1
|
|
82
|
-
|
|
83
|
-
### Patch Changes
|
|
84
|
-
|
|
85
|
-
- 070d094: Minor cloud update
|
|
86
|
-
|
|
87
|
-
## 0.4.0
|
|
88
|
-
|
|
89
|
-
### Minor Changes
|
|
90
|
-
|
|
91
|
-
- 0e04a46: Version bump
|
|
92
|
-
|
|
93
|
-
### Patch Changes
|
|
94
|
-
|
|
95
|
-
- 4f83de0: Minor fixes and updates
|
|
96
|
-
- defeaf0: Minor fixes and updates
|
|
97
|
-
|
|
98
|
-
## 0.3.1
|
|
99
|
-
|
|
100
|
-
### Patch Changes
|
|
101
|
-
|
|
102
|
-
- d3b73ac: Minor fixes
|
|
103
|
-
|
|
104
|
-
## 0.3.0
|
|
105
|
-
|
|
106
|
-
### Minor Changes
|
|
107
|
-
|
|
108
|
-
- 70d108d: CLI commands & datetime helpers in the Javascript SDK
|
|
109
|
-
|
|
110
|
-
## 0.2.10
|
|
111
|
-
|
|
112
|
-
### Patch Changes
|
|
113
|
-
|
|
114
|
-
- 89f2783: Update readme and license
|
|
115
|
-
|
|
116
|
-
## 0.2.9
|
|
117
|
-
|
|
118
|
-
### Patch Changes
|
|
119
|
-
|
|
120
|
-
- 9580ede: Update infrastructure and minor fixes
|
|
121
|
-
|
|
122
|
-
## 0.2.8
|
|
123
|
-
|
|
124
|
-
### Patch Changes
|
|
125
|
-
|
|
126
|
-
- 1cf62ae: Minor fixes and cleanups
|
|
127
|
-
|
|
128
|
-
## 0.2.7
|
|
129
|
-
|
|
130
|
-
### Patch Changes
|
|
131
|
-
|
|
132
|
-
- 147cc2b: Build docker image only on version bump
|
|
133
|
-
|
|
134
|
-
## 0.2.6
|
|
135
|
-
|
|
136
|
-
### Patch Changes
|
|
137
|
-
|
|
138
|
-
- 89852a4: Update docker image release
|
|
139
|
-
|
|
140
|
-
## 0.2.5
|
|
141
|
-
|
|
142
|
-
### Patch Changes
|
|
143
|
-
|
|
144
|
-
- cd0be33: Release flow improvements
|
|
145
|
-
|
|
146
|
-
## 0.2.4
|
|
147
|
-
|
|
148
|
-
### Patch Changes
|
|
149
|
-
|
|
150
|
-
- 3741a7e: Release workflow change
|
|
151
|
-
|
|
152
|
-
## 0.2.3
|
|
153
|
-
|
|
154
|
-
### Patch Changes
|
|
155
|
-
|
|
156
|
-
- c7f1eb9: Update workflow
|
|
157
|
-
|
|
158
|
-
## 0.2.2
|
|
159
|
-
|
|
160
|
-
### Patch Changes
|
|
161
|
-
|
|
162
|
-
- de0fb17: Update release workflow
|
|
163
|
-
|
|
164
|
-
## 0.2.1
|
|
165
|
-
|
|
166
|
-
### Patch Changes
|
|
167
|
-
|
|
168
|
-
- f934b0f: Bump version
|
|
169
|
-
|
|
170
|
-
## 0.2.0
|
|
171
|
-
|
|
172
|
-
### Minor Changes
|
|
173
|
-
|
|
174
|
-
- cb1e4be: Update readme, cleanups, build public image
|
|
175
|
-
|
|
176
|
-
## 0.1.0
|
|
177
|
-
|
|
178
|
-
### Minor Changes
|
|
179
|
-
|
|
180
|
-
- 0fc7f66: Initial release before migrating to RushDB domain
|