@blitznocode/blitz-orm 0.6.4 → 0.7.0-beta

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 CHANGED
@@ -22,6 +22,8 @@ type QueryConfig = {
22
22
  };
23
23
  type MutateConfig = {
24
24
  noMetadata?: boolean;
25
+ preQuery?: boolean;
26
+ ignoreNonexistingThings?: boolean;
25
27
  };
26
28
  type BormConfig = {
27
29
  server: {
@@ -96,6 +98,9 @@ type BQLMutationBlock = {
96
98
  $entity: string;
97
99
  } | {
98
100
  $relation: string;
101
+ } | {
102
+ $thing: string;
103
+ $thingType: 'entity' | 'relation';
99
104
  });
100
105
  type FilledBQLMutationBlock = WithRequired<BQLMutationBlock, '$tempId' | '$op'>;
101
106
  type RawBQLMutation<T extends Record<string, any> = Record<string, any>> = ({
@@ -121,8 +126,11 @@ type RawBQLQuery = {
121
126
  $entity: string;
122
127
  } | {
123
128
  $relation: string;
129
+ } | {
130
+ $thing: string;
131
+ $thingType: 'entity' | 'relation';
124
132
  });
125
- type ParsedBQLQuery = Omit<RawBQLQuery, '$entity' | '$relation'> & {
133
+ type ParsedBQLQuery = Omit<RawBQLQuery, '$entity' | '$relation' | '$thing' | '$thingType'> & {
126
134
  $localFilters?: Record<string, any>;
127
135
  $nestedFilters?: Record<string, any>;
128
136
  } & ({
@@ -252,7 +260,8 @@ type CardinalityType = 'ONE' | 'MANY' | 'INTERVAL';
252
260
  type RightType = 'CREATE' | 'DELETE' | 'UPDATE' | 'LINK' | 'UNLINK';
253
261
  type BQLFieldObj = {
254
262
  $path: string;
255
- } & Omit<RawBQLQuery, '$entity' | '$relation'>;
263
+ $as?: string;
264
+ } & Omit<RawBQLQuery, '$entity' | '$relation' | '$thing' | '$thingType'>;
256
265
  type BQLField = string | BQLFieldObj;
257
266
 
258
267
  type EnrichedBormSchema = {
@@ -366,8 +375,8 @@ declare class BormClient {
366
375
  init: () => Promise<void>;
367
376
  introspect: () => Promise<BormSchema>;
368
377
  define: () => Promise<void>;
369
- query: (query: RawBQLQuery, queryConfig?: QueryConfig) => Promise<BQLResponse>;
370
- mutate: (mutation: RawBQLMutation | RawBQLMutation[], mutationConfig?: any) => Promise<BQLResponseMulti>;
378
+ query: (query: RawBQLQuery | RawBQLQuery[], queryConfig?: QueryConfig) => Promise<BQLResponse>;
379
+ mutate: (mutation: RawBQLMutation | RawBQLMutation[], mutationConfig?: MutateConfig) => Promise<BQLResponseMulti>;
371
380
  close: () => Promise<void>;
372
381
  }
373
382
 
package/dist/index.d.ts CHANGED
@@ -22,6 +22,8 @@ type QueryConfig = {
22
22
  };
23
23
  type MutateConfig = {
24
24
  noMetadata?: boolean;
25
+ preQuery?: boolean;
26
+ ignoreNonexistingThings?: boolean;
25
27
  };
26
28
  type BormConfig = {
27
29
  server: {
@@ -96,6 +98,9 @@ type BQLMutationBlock = {
96
98
  $entity: string;
97
99
  } | {
98
100
  $relation: string;
101
+ } | {
102
+ $thing: string;
103
+ $thingType: 'entity' | 'relation';
99
104
  });
100
105
  type FilledBQLMutationBlock = WithRequired<BQLMutationBlock, '$tempId' | '$op'>;
101
106
  type RawBQLMutation<T extends Record<string, any> = Record<string, any>> = ({
@@ -121,8 +126,11 @@ type RawBQLQuery = {
121
126
  $entity: string;
122
127
  } | {
123
128
  $relation: string;
129
+ } | {
130
+ $thing: string;
131
+ $thingType: 'entity' | 'relation';
124
132
  });
125
- type ParsedBQLQuery = Omit<RawBQLQuery, '$entity' | '$relation'> & {
133
+ type ParsedBQLQuery = Omit<RawBQLQuery, '$entity' | '$relation' | '$thing' | '$thingType'> & {
126
134
  $localFilters?: Record<string, any>;
127
135
  $nestedFilters?: Record<string, any>;
128
136
  } & ({
@@ -252,7 +260,8 @@ type CardinalityType = 'ONE' | 'MANY' | 'INTERVAL';
252
260
  type RightType = 'CREATE' | 'DELETE' | 'UPDATE' | 'LINK' | 'UNLINK';
253
261
  type BQLFieldObj = {
254
262
  $path: string;
255
- } & Omit<RawBQLQuery, '$entity' | '$relation'>;
263
+ $as?: string;
264
+ } & Omit<RawBQLQuery, '$entity' | '$relation' | '$thing' | '$thingType'>;
256
265
  type BQLField = string | BQLFieldObj;
257
266
 
258
267
  type EnrichedBormSchema = {
@@ -366,8 +375,8 @@ declare class BormClient {
366
375
  init: () => Promise<void>;
367
376
  introspect: () => Promise<BormSchema>;
368
377
  define: () => Promise<void>;
369
- query: (query: RawBQLQuery, queryConfig?: QueryConfig) => Promise<BQLResponse>;
370
- mutate: (mutation: RawBQLMutation | RawBQLMutation[], mutationConfig?: any) => Promise<BQLResponseMulti>;
378
+ query: (query: RawBQLQuery | RawBQLQuery[], queryConfig?: QueryConfig) => Promise<BQLResponse>;
379
+ mutate: (mutation: RawBQLMutation | RawBQLMutation[], mutationConfig?: MutateConfig) => Promise<BQLResponseMulti>;
371
380
  close: () => Promise<void>;
372
381
  }
373
382