@blitznocode/blitz-orm 0.10.0 → 0.10.4
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.d.mts +21 -17
- package/dist/index.d.ts +21 -17
- package/dist/index.js +36 -65
- package/dist/index.mjs +37 -66
- package/dist/magic-string.es-3CTDYLTI.mjs +15 -0
- package/package.json +14 -11
package/dist/index.d.mts
CHANGED
|
@@ -1,22 +1,6 @@
|
|
|
1
1
|
import { TypeDBCredential, TypeDBDriver, TypeDBSession } from 'typedb-driver';
|
|
2
2
|
import { Surreal } from 'surrealdb.node';
|
|
3
3
|
|
|
4
|
-
type ThingType = 'entity' | 'relation';
|
|
5
|
-
type BormMetadata = {
|
|
6
|
-
$id: string;
|
|
7
|
-
$op?: string;
|
|
8
|
-
$entity?: string;
|
|
9
|
-
$relation?: string;
|
|
10
|
-
$tempId?: string;
|
|
11
|
-
};
|
|
12
|
-
type WithBormMetadata<T> = T extends any[] ? T[number] extends object ? Array<WithBormMetadataObject<T[number]>> : T : T extends object ? WithBormMetadataObject<T> : T;
|
|
13
|
-
type WithBormMetadataObject<T> = {
|
|
14
|
-
[K in keyof T]: WithBormMetadata<T[K]>;
|
|
15
|
-
} & BormMetadata;
|
|
16
|
-
type BQLResponseSingle = Record<string | symbol, any>;
|
|
17
|
-
type BQLResponseMulti = BQLResponseSingle[];
|
|
18
|
-
type BQLResponse = BQLResponseSingle | BQLResponseMulti;
|
|
19
|
-
|
|
20
4
|
interface TypeDBProvider extends CommonProvider {
|
|
21
5
|
provider: 'typeDB';
|
|
22
6
|
url: string;
|
|
@@ -83,6 +67,22 @@ type AtLeastOne<T, U = {
|
|
|
83
67
|
type DBHandles = AtLeastOne<AllDbHandles>;
|
|
84
68
|
type DBHandleKey = keyof DBHandles;
|
|
85
69
|
|
|
70
|
+
type ThingType = 'entity' | 'relation';
|
|
71
|
+
type BormMetadata = {
|
|
72
|
+
$id: string;
|
|
73
|
+
$op?: string;
|
|
74
|
+
$entity?: string;
|
|
75
|
+
$relation?: string;
|
|
76
|
+
$tempId?: string;
|
|
77
|
+
};
|
|
78
|
+
type WithBormMetadata<T> = T extends any[] ? T[number] extends object ? Array<WithBormMetadataObject<T[number]>> : T : T extends object ? WithBormMetadataObject<T> : T;
|
|
79
|
+
type WithBormMetadataObject<T> = {
|
|
80
|
+
[K in keyof T]: WithBormMetadata<T[K]>;
|
|
81
|
+
} & BormMetadata;
|
|
82
|
+
type BQLResponseSingle = Record<string | symbol, any>;
|
|
83
|
+
type BQLResponseMulti = BQLResponseSingle[];
|
|
84
|
+
type BQLResponse = BQLResponseSingle | BQLResponseMulti;
|
|
85
|
+
|
|
86
86
|
type BormSchema = {
|
|
87
87
|
entities: {
|
|
88
88
|
[s: string]: BormEntity;
|
|
@@ -131,7 +131,8 @@ type Action = {
|
|
|
131
131
|
type NodeFunctionParams = [
|
|
132
132
|
currentNode: EnrichedBQLMutationBlock,
|
|
133
133
|
parentNode: EnrichedBQLMutationBlock,
|
|
134
|
-
context: Record<string, any
|
|
134
|
+
context: Record<string, any>,
|
|
135
|
+
dbNode: EnrichedBQLMutationBlock | Record<string, never>
|
|
135
136
|
];
|
|
136
137
|
type TransFormAction = {
|
|
137
138
|
type: 'transform';
|
|
@@ -341,6 +342,7 @@ declare const Schema: unique symbol;
|
|
|
341
342
|
declare const QueryPath: unique symbol;
|
|
342
343
|
declare const EdgeType: unique symbol;
|
|
343
344
|
declare const EdgeSchema: unique symbol;
|
|
345
|
+
declare const DBNode: unique symbol;
|
|
344
346
|
|
|
345
347
|
type Sorter = {
|
|
346
348
|
field: string;
|
|
@@ -505,12 +507,14 @@ type EnrichedBQLMutationBlock = {
|
|
|
505
507
|
[key: string]: any;
|
|
506
508
|
$id?: string | string[];
|
|
507
509
|
$filter?: Filter;
|
|
510
|
+
$fields?: any[];
|
|
508
511
|
$tempId?: string;
|
|
509
512
|
$op: BormOperation;
|
|
510
513
|
$thing: string;
|
|
511
514
|
$thingType: 'entity' | 'relation';
|
|
512
515
|
[EdgeSchema]?: EnrichedDataField | EnrichedLinkField | EnrichedRoleField;
|
|
513
516
|
[EdgeType]?: 'linkField' | 'roleField';
|
|
517
|
+
[DBNode]?: EnrichedBQLMutationBlock | Record<string, never>;
|
|
514
518
|
};
|
|
515
519
|
type RawBQLMutation<T extends Record<string, any> = Record<string, any>> = ({
|
|
516
520
|
$id?: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,22 +1,6 @@
|
|
|
1
1
|
import { TypeDBCredential, TypeDBDriver, TypeDBSession } from 'typedb-driver';
|
|
2
2
|
import { Surreal } from 'surrealdb.node';
|
|
3
3
|
|
|
4
|
-
type ThingType = 'entity' | 'relation';
|
|
5
|
-
type BormMetadata = {
|
|
6
|
-
$id: string;
|
|
7
|
-
$op?: string;
|
|
8
|
-
$entity?: string;
|
|
9
|
-
$relation?: string;
|
|
10
|
-
$tempId?: string;
|
|
11
|
-
};
|
|
12
|
-
type WithBormMetadata<T> = T extends any[] ? T[number] extends object ? Array<WithBormMetadataObject<T[number]>> : T : T extends object ? WithBormMetadataObject<T> : T;
|
|
13
|
-
type WithBormMetadataObject<T> = {
|
|
14
|
-
[K in keyof T]: WithBormMetadata<T[K]>;
|
|
15
|
-
} & BormMetadata;
|
|
16
|
-
type BQLResponseSingle = Record<string | symbol, any>;
|
|
17
|
-
type BQLResponseMulti = BQLResponseSingle[];
|
|
18
|
-
type BQLResponse = BQLResponseSingle | BQLResponseMulti;
|
|
19
|
-
|
|
20
4
|
interface TypeDBProvider extends CommonProvider {
|
|
21
5
|
provider: 'typeDB';
|
|
22
6
|
url: string;
|
|
@@ -83,6 +67,22 @@ type AtLeastOne<T, U = {
|
|
|
83
67
|
type DBHandles = AtLeastOne<AllDbHandles>;
|
|
84
68
|
type DBHandleKey = keyof DBHandles;
|
|
85
69
|
|
|
70
|
+
type ThingType = 'entity' | 'relation';
|
|
71
|
+
type BormMetadata = {
|
|
72
|
+
$id: string;
|
|
73
|
+
$op?: string;
|
|
74
|
+
$entity?: string;
|
|
75
|
+
$relation?: string;
|
|
76
|
+
$tempId?: string;
|
|
77
|
+
};
|
|
78
|
+
type WithBormMetadata<T> = T extends any[] ? T[number] extends object ? Array<WithBormMetadataObject<T[number]>> : T : T extends object ? WithBormMetadataObject<T> : T;
|
|
79
|
+
type WithBormMetadataObject<T> = {
|
|
80
|
+
[K in keyof T]: WithBormMetadata<T[K]>;
|
|
81
|
+
} & BormMetadata;
|
|
82
|
+
type BQLResponseSingle = Record<string | symbol, any>;
|
|
83
|
+
type BQLResponseMulti = BQLResponseSingle[];
|
|
84
|
+
type BQLResponse = BQLResponseSingle | BQLResponseMulti;
|
|
85
|
+
|
|
86
86
|
type BormSchema = {
|
|
87
87
|
entities: {
|
|
88
88
|
[s: string]: BormEntity;
|
|
@@ -131,7 +131,8 @@ type Action = {
|
|
|
131
131
|
type NodeFunctionParams = [
|
|
132
132
|
currentNode: EnrichedBQLMutationBlock,
|
|
133
133
|
parentNode: EnrichedBQLMutationBlock,
|
|
134
|
-
context: Record<string, any
|
|
134
|
+
context: Record<string, any>,
|
|
135
|
+
dbNode: EnrichedBQLMutationBlock | Record<string, never>
|
|
135
136
|
];
|
|
136
137
|
type TransFormAction = {
|
|
137
138
|
type: 'transform';
|
|
@@ -341,6 +342,7 @@ declare const Schema: unique symbol;
|
|
|
341
342
|
declare const QueryPath: unique symbol;
|
|
342
343
|
declare const EdgeType: unique symbol;
|
|
343
344
|
declare const EdgeSchema: unique symbol;
|
|
345
|
+
declare const DBNode: unique symbol;
|
|
344
346
|
|
|
345
347
|
type Sorter = {
|
|
346
348
|
field: string;
|
|
@@ -505,12 +507,14 @@ type EnrichedBQLMutationBlock = {
|
|
|
505
507
|
[key: string]: any;
|
|
506
508
|
$id?: string | string[];
|
|
507
509
|
$filter?: Filter;
|
|
510
|
+
$fields?: any[];
|
|
508
511
|
$tempId?: string;
|
|
509
512
|
$op: BormOperation;
|
|
510
513
|
$thing: string;
|
|
511
514
|
$thingType: 'entity' | 'relation';
|
|
512
515
|
[EdgeSchema]?: EnrichedDataField | EnrichedLinkField | EnrichedRoleField;
|
|
513
516
|
[EdgeType]?: 'linkField' | 'roleField';
|
|
517
|
+
[DBNode]?: EnrichedBQLMutationBlock | Record<string, never>;
|
|
514
518
|
};
|
|
515
519
|
type RawBQLMutation<T extends Record<string, any> = Record<string, any>> = ({
|
|
516
520
|
$id?: string;
|