@emeryld/rrroutes-contract 2.2.10 → 2.2.11
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/core/routesV3.builder.d.ts +6 -10
- package/dist/crud/routesV3.crud.d.ts +8 -12
- package/dist/index.cjs +44 -990
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +44 -990
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { AnyLeaf, Append, HttpMethod, Leaf, Merge, MergeArray, MethodCfg, NodeCfg, Prettify } from './routesV3.core';
|
|
3
|
-
declare const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
type
|
|
3
|
+
declare const paginationQueryShape: {
|
|
4
|
+
pagination_cursor: z.ZodOptional<z.ZodString>;
|
|
5
|
+
pagination_limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
6
|
+
};
|
|
7
|
+
type PaginationShape = typeof paginationQueryShape;
|
|
8
8
|
type ZodTypeAny = z.ZodTypeAny;
|
|
9
9
|
type ParamZod<Name extends string, S extends ZodTypeAny> = z.ZodObject<{
|
|
10
10
|
[K in Name]: S;
|
|
@@ -29,11 +29,7 @@ type FeedField<C extends MethodCfg> = C['feed'] extends true ? {
|
|
|
29
29
|
} : {
|
|
30
30
|
feed?: boolean;
|
|
31
31
|
};
|
|
32
|
-
type AddPaginationToQuery<Q extends AnyZodObject | undefined> = Q extends z.ZodObject<infer Shape> ? z.ZodObject<Shape &
|
|
33
|
-
pagination: PaginationField;
|
|
34
|
-
}> : z.ZodObject<{
|
|
35
|
-
pagination: PaginationField;
|
|
36
|
-
}>;
|
|
32
|
+
type AddPaginationToQuery<Q extends AnyZodObject | undefined> = Q extends z.ZodObject<infer Shape> ? z.ZodObject<Shape & PaginationShape> : z.ZodObject<PaginationShape>;
|
|
37
33
|
type FeedQueryField<C extends MethodCfg> = {
|
|
38
34
|
querySchema: AddPaginationToQuery<C['querySchema'] extends AnyZodObject ? C['querySchema'] : undefined>;
|
|
39
35
|
};
|
|
@@ -2,21 +2,17 @@ import { z, ZodType } from 'zod';
|
|
|
2
2
|
import { resource as baseResource, type Branch as _Branch } from '../core/routesV3.builder';
|
|
3
3
|
import { type AnyLeaf, type Leaf, type NodeCfg } from '../core/routesV3.core';
|
|
4
4
|
/** Default cursor pagination used by list (GET collection). */
|
|
5
|
+
declare const crudPaginationShape: {
|
|
6
|
+
pagination_cursor: z.ZodOptional<z.ZodString>;
|
|
7
|
+
pagination_limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
8
|
+
};
|
|
5
9
|
export declare const CrudDefaultPagination: z.ZodObject<{
|
|
6
|
-
|
|
7
|
-
|
|
10
|
+
pagination_cursor: z.ZodOptional<z.ZodString>;
|
|
11
|
+
pagination_limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
8
12
|
}, z.core.$strip>;
|
|
9
|
-
|
|
10
|
-
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
11
|
-
cursor: z.ZodOptional<z.ZodString>;
|
|
12
|
-
}, z.core.$strip>>>;
|
|
13
|
-
type CrudPaginationField = typeof CrudPaginationField;
|
|
13
|
+
type CrudPaginationShape = typeof crudPaginationShape;
|
|
14
14
|
type AnyCrudZodObject = z.ZodObject<any>;
|
|
15
|
-
type AddCrudPagination<Q extends AnyCrudZodObject | undefined> = Q extends z.ZodObject<infer Shape> ? z.ZodObject<Shape &
|
|
16
|
-
pagination: CrudPaginationField;
|
|
17
|
-
}> : z.ZodObject<{
|
|
18
|
-
pagination: CrudPaginationField;
|
|
19
|
-
}>;
|
|
15
|
+
type AddCrudPagination<Q extends AnyCrudZodObject | undefined> = Q extends z.ZodObject<infer Shape> ? z.ZodObject<Shape & CrudPaginationShape> : z.ZodObject<CrudPaginationShape>;
|
|
20
16
|
/**
|
|
21
17
|
* Merge two Zod schemas at runtime; matches the typing pattern used in builder.
|
|
22
18
|
* @param a Existing params schema inherited from parent branches.
|