rads-db 0.1.14 → 0.1.16

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.
Files changed (2) hide show
  1. package/dist/index.d.ts +8 -7
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -3,7 +3,7 @@ import { EntityMeta, RadsDb } from '_rads-db';
3
3
  export { RadsDb } from '_rads-db';
4
4
 
5
5
  interface GetManyArgs<E, EN extends keyof EntityMeta, W> extends GetArgs<E, EN, W> {
6
- cursor?: string;
6
+ cursor?: string | null;
7
7
  maxItemCount?: number;
8
8
  orderBy?: string;
9
9
  }
@@ -20,7 +20,7 @@ type GetArgsInclude<E, EN extends keyof EntityMeta, R extends keyof E = keyof En
20
20
  };
21
21
  interface GetManyResponse<E, EN extends keyof EntityMeta, A extends GetArgs<E, EN, any>> {
22
22
  nodes: GetResponse<E, EN, A>[];
23
- cursor?: string | null;
23
+ cursor: string | null;
24
24
  }
25
25
  type GetResponse<E, EN extends keyof EntityMeta, A extends GetArgs<E, EN, any>> = A extends {
26
26
  include: any;
@@ -35,11 +35,12 @@ interface GetResponseIncludeSelect<E, I> {
35
35
  type GetResponseNoInclude<E, EN extends keyof EntityMeta> = {
36
36
  [K in keyof E]: K extends keyof EntityMeta[EN]['relations'] ? Pick<E[K], 'id'> : E[K];
37
37
  };
38
- type PutArgs<T> = T extends object ? {
38
+ type DeepPartial<T> = {
39
+ [K in keyof T]?: DeepPartial<T[K]>;
40
+ };
41
+ type PutArgs<T> = {
39
42
  id: string;
40
- } & {
41
- [P in keyof T]?: PutArgs<T[P]>;
42
- } : T;
43
+ } & DeepPartial<T>;
43
44
  interface EntityMethods<E, EN extends keyof EntityMeta, W> {
44
45
  get<A extends GetArgs<E, EN, W>>(args: A): GetResponse<E, EN, A>;
45
46
  getMany<A extends GetManyArgs<E, EN, W>>(args: A): GetManyResponse<E, EN, A>;
@@ -114,4 +115,4 @@ declare function field(meta?: FieldDecoratorArgs): (a: any, b?: ClassFieldDecora
114
115
  declare function createRads(args?: CreateRadsArgs): RadsDb;
115
116
  declare function getRestRoutes(db: RadsDb, prefix?: string): Record<string, Record<string, Function>>;
116
117
 
117
- export { CreateRadsArgs, Driver, DriverOptions, EntityDecoratorArgs, EntityMethods, FieldDecoratorArgs, FieldDefinition, GenerateClientNormalizedOptions, GenerateClientOptions, GetArgs, GetArgsAny, GetArgsInclude, GetManyArgs, GetManyArgsAny, GetManyResponse, GetResponse, GetResponseInclude, GetResponseIncludeSelect, GetResponseNoInclude, MemoryDriverOptions, MinimalDriver, PutArgs, RestDriverOptions, Schema, SchemaValidators, TypeDefinition, createRads, entity, field, getRestRoutes };
118
+ export { CreateRadsArgs, DeepPartial, Driver, DriverOptions, EntityDecoratorArgs, EntityMethods, FieldDecoratorArgs, FieldDefinition, GenerateClientNormalizedOptions, GenerateClientOptions, GetArgs, GetArgsAny, GetArgsInclude, GetManyArgs, GetManyArgsAny, GetManyResponse, GetResponse, GetResponseInclude, GetResponseIncludeSelect, GetResponseNoInclude, MemoryDriverOptions, MinimalDriver, PutArgs, RestDriverOptions, Schema, SchemaValidators, TypeDefinition, createRads, entity, field, getRestRoutes };
package/package.json CHANGED
@@ -28,7 +28,7 @@
28
28
  "require": "./integrations/*.cjs"
29
29
  }
30
30
  },
31
- "version": "0.1.14",
31
+ "version": "0.1.16",
32
32
  "description": "Say goodbye to boilerplate code and hello to efficient and elegant syntax.",
33
33
  "keywords": [],
34
34
  "author": "",