@orion-js/paginated-mongodb 3.11.8 → 3.12.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/dist/index.cjs +18878 -0
- package/dist/index.d.ts +58 -0
- package/dist/index.js +18850 -0
- package/package.json +27 -23
- package/LICENSE +0 -21
- package/lib/index.d.ts +0 -4
- package/lib/index.js +0 -21
- package/lib/paginatedResolver/getModel.d.ts +0 -5
- package/lib/paginatedResolver/getModel.js +0 -77
- package/lib/paginatedResolver/hash.d.ts +0 -1
- package/lib/paginatedResolver/hash.js +0 -8
- package/lib/paginatedResolver/index.d.ts +0 -36
- package/lib/paginatedResolver/index.js +0 -44
- package/lib/paginatedResolver/index.test.d.ts +0 -1
- package/lib/paginatedResolver/index.test.js +0 -127
- package/lib/paginatedResolver/params.d.ts +0 -5
- package/lib/paginatedResolver/params.js +0 -52
- package/lib/paginatedResolver/params.test.d.ts +0 -1
- package/lib/paginatedResolver/params.test.js +0 -149
- package/lib/paginatedResolver/setOptions.d.ts +0 -10
- package/lib/paginatedResolver/setOptions.js +0 -21
- package/lib/service/index.d.ts +0 -5
- package/lib/service/index.js +0 -23
- package/lib/tests/setup.d.ts +0 -1
- package/lib/tests/setup.js +0 -19
- package/lib/tokenPaginatedResolver/getReturnModel.d.ts +0 -5
- package/lib/tokenPaginatedResolver/getReturnModel.js +0 -19
- package/lib/tokenPaginatedResolver/index.d.ts +0 -10
- package/lib/tokenPaginatedResolver/index.js +0 -128
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
// Generated by dts-bundle-generator v9.5.1
|
|
2
|
+
|
|
3
|
+
export interface PaginatedCursor {
|
|
4
|
+
count?: () => Promise<number> | number;
|
|
5
|
+
toArray: () => Promise<any[]>;
|
|
6
|
+
limit?: (newLimit: number) => void;
|
|
7
|
+
skip?: (newSkip: number) => void;
|
|
8
|
+
sort?: (newSort: {
|
|
9
|
+
[key: string]: 1 | -1;
|
|
10
|
+
}) => void;
|
|
11
|
+
}
|
|
12
|
+
export type PaginatedResolverGetCursorResultWithCount = {
|
|
13
|
+
count: () => Promise<number> | number;
|
|
14
|
+
cursor: PaginatedCursor;
|
|
15
|
+
};
|
|
16
|
+
export type PaginatedResolverGetCursorResult = PaginatedCursor | PaginatedResolverGetCursorResultWithCount;
|
|
17
|
+
export interface PaginatedResolverOpts {
|
|
18
|
+
returns: any;
|
|
19
|
+
getCursor: (params?: any, viewer?: any) => Promise<PaginatedResolverGetCursorResult>;
|
|
20
|
+
allowedSorts?: string[];
|
|
21
|
+
defaultSortBy?: string;
|
|
22
|
+
defaultSortType?: "asc" | "desc";
|
|
23
|
+
params?: any;
|
|
24
|
+
modelName?: string;
|
|
25
|
+
permissionsOptions?: any;
|
|
26
|
+
}
|
|
27
|
+
export function paginatedResolver({ returns, params, allowedSorts, defaultSortBy, defaultSortType, getCursor, getCursorAndCount, modelName, ...otherOptions }: PaginatedResolverOpts & {
|
|
28
|
+
[key: string]: any;
|
|
29
|
+
}): import("@orion-js/resolvers").Resolver<(params: any, viewer: any, info?: any) => Promise<{
|
|
30
|
+
cursor: PaginatedCursor;
|
|
31
|
+
params: any;
|
|
32
|
+
viewer: any;
|
|
33
|
+
options: {
|
|
34
|
+
skip: number;
|
|
35
|
+
limit: any;
|
|
36
|
+
};
|
|
37
|
+
count: number;
|
|
38
|
+
}>, undefined>;
|
|
39
|
+
declare function _default({ collection, params, resolve, ...otherOptions }: {
|
|
40
|
+
[x: string]: any;
|
|
41
|
+
collection: any;
|
|
42
|
+
params: any;
|
|
43
|
+
resolve: any;
|
|
44
|
+
}): import("@orion-js/resolvers").Resolver<(params: any, viewer: any, info?: any) => Promise<{
|
|
45
|
+
params: any;
|
|
46
|
+
cursor: any;
|
|
47
|
+
viewer: any;
|
|
48
|
+
}>, undefined>;
|
|
49
|
+
export interface PagiantedQueryDescriptor extends Omit<PropertyDecorator, "value"> {
|
|
50
|
+
value?: PaginatedResolverOpts["getCursor"];
|
|
51
|
+
}
|
|
52
|
+
export declare function PaginatedQuery(options: Omit<PaginatedResolverOpts, "getCursor">): (target: any, propertyKey: string, descriptor: PagiantedQueryDescriptor) => void;
|
|
53
|
+
|
|
54
|
+
export {
|
|
55
|
+
_default as tokenPaginatedResolver,
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export {};
|