next-data-kit 3.0.1 → 5.0.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/README.md +96 -36
- package/dist/action-DwiE6Cov.d.cts +182 -0
- package/dist/action-DwiE6Cov.d.ts +182 -0
- package/dist/client/components/data-kit-table.d.ts +1 -1
- package/dist/client/components/data-kit-table.d.ts.map +1 -1
- package/dist/client/components/data-kit-table.js +0 -3
- package/dist/client/components/data-kit-table.js.map +1 -1
- package/dist/client/components/data-kit.d.ts.map +1 -1
- package/dist/client/components/data-kit.js +0 -3
- package/dist/client/components/data-kit.js.map +1 -1
- package/dist/client/context/index.d.ts.map +1 -1
- package/dist/client/context/index.js +0 -6
- package/dist/client/context/index.js.map +1 -1
- package/dist/client/hooks/useDataKit.d.ts.map +1 -1
- package/dist/client/hooks/useDataKit.js +0 -3
- package/dist/client/hooks/useDataKit.js.map +1 -1
- package/dist/client/hooks/usePagination.d.ts.map +1 -1
- package/dist/client/hooks/usePagination.js +1 -7
- package/dist/client/hooks/usePagination.js.map +1 -1
- package/dist/client/hooks/useSelection.d.ts.map +1 -1
- package/dist/client/hooks/useSelection.js +0 -6
- package/dist/client/hooks/useSelection.js.map +1 -1
- package/dist/client/utils/index.d.ts.map +1 -1
- package/dist/client/utils/index.js +0 -15
- package/dist/client/utils/index.js.map +1 -1
- package/dist/index.cjs +87 -69
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +64 -108
- package/dist/index.d.ts +64 -108
- package/dist/index.js +87 -69
- package/dist/index.js.map +1 -1
- package/dist/server/utils.d.ts +52 -0
- package/dist/server/utils.d.ts.map +1 -0
- package/dist/server/utils.js +117 -0
- package/dist/server/utils.js.map +1 -0
- package/dist/server.cjs +90 -59
- package/dist/server.cjs.map +1 -1
- package/dist/server.d.cts +26 -17
- package/dist/server.d.ts +26 -17
- package/dist/server.js +88 -60
- package/dist/server.js.map +1 -1
- package/dist/types/{component.d.ts → client/component.d.ts} +3 -3
- package/dist/types/client/component.d.ts.map +1 -0
- package/dist/types/client/component.js.map +1 -0
- package/dist/types/{hook.d.ts → client/hook.d.ts} +1 -1
- package/dist/types/client/hook.d.ts.map +1 -0
- package/dist/types/client/hook.js.map +1 -0
- package/dist/types/client/selectable.d.ts.map +1 -0
- package/dist/types/client/selectable.js.map +1 -0
- package/dist/types/index.cjs +0 -11
- package/dist/types/index.cjs.map +1 -1
- package/dist/types/index.d.cts +5 -4
- package/dist/types/index.d.ts +7 -7
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +2 -2
- package/dist/types/index.js.map +1 -1
- package/dist/types/next-data-kit.d.ts +1 -5
- package/dist/types/next-data-kit.d.ts.map +1 -1
- package/dist/types/next-data-kit.js +1 -11
- package/dist/types/next-data-kit.js.map +1 -1
- package/dist/types/server/action.d.ts +43 -0
- package/dist/types/server/action.d.ts.map +1 -0
- package/dist/types/server/action.js +7 -0
- package/dist/types/server/action.js.map +1 -0
- package/dist/types/server/database/mongo.d.ts +47 -0
- package/dist/types/server/database/mongo.d.ts.map +1 -0
- package/dist/types/server/database/mongo.js +7 -0
- package/dist/types/server/database/mongo.js.map +1 -0
- package/package.json +6 -1
- package/dist/next-data-kit-DBl9PPWh.d.cts +0 -225
- package/dist/next-data-kit-DBl9PPWh.d.ts +0 -225
- package/dist/types/component.d.ts.map +0 -1
- package/dist/types/component.js.map +0 -1
- package/dist/types/database/mongo.d.ts +0 -129
- package/dist/types/database/mongo.d.ts.map +0 -1
- package/dist/types/database/mongo.js +0 -8
- package/dist/types/database/mongo.js.map +0 -1
- package/dist/types/hook.d.ts.map +0 -1
- package/dist/types/hook.js.map +0 -1
- package/dist/types/selectable.d.ts.map +0 -1
- package/dist/types/selectable.js.map +0 -1
- /package/dist/types/{component.js → client/component.js} +0 -0
- /package/dist/types/{hook.js → client/hook.js} +0 -0
- /package/dist/types/{selectable.d.ts → client/selectable.d.ts} +0 -0
- /package/dist/types/{selectable.js → client/selectable.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"next-data-kit.d.ts","sourceRoot":"","sources":["../../src/types/next-data-kit.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"next-data-kit.d.ts","sourceRoot":"","sources":["../../src/types/next-data-kit.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAE7E;;GAEG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI;KAC5B,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,UAAU;CAC3B,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;CACd,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IAC3B,CAAC,GAAG,EAAE,MAAM,GAAG;QAEd,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC;QAExB,KAAK,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;CACF,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,mBAAmB,CAAC,CAAC,GAAG,OAAO,IAAI;IAC9C,CAAC,EAAE,EAAE,MAAM,GAAG,CAAC,IAAI,EAAE,OAAO,KAAK,iBAAiB,CAAC,CAAC,CAAC,CAAC;CACtD,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,6BAA6B,CAAC,IAAI,GAAG,OAAO,EAAE,OAAO,GAAG,iBAAiB,CAAC,IAAI,CAAC,IAAI;IAC9F,CAAC,EAAE,EAAE,MAAM,GAAG,CAAC,IAAI,EAAE,OAAO,KAAK,OAAO,CAAC;CACzC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,aAAa,CAAC,CAAC,GAAG,OAAO,I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AAE,CAAC,EAAE,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC"}
|
|
@@ -3,15 +3,5 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Core types for the next-data-kit server action and components.
|
|
5
5
|
*/
|
|
6
|
-
|
|
7
|
-
* Calculate pagination info from next-data-kit result
|
|
8
|
-
*/
|
|
9
|
-
export const calculatePagination = (page, limit, total) => ({
|
|
10
|
-
currentPage: page,
|
|
11
|
-
totalPages: Math.ceil(total / limit),
|
|
12
|
-
totalItems: total,
|
|
13
|
-
itemsPerPage: limit,
|
|
14
|
-
hasNextPage: page * limit < total,
|
|
15
|
-
hasPrevPage: page > 1,
|
|
16
|
-
});
|
|
6
|
+
export {};
|
|
17
7
|
//# sourceMappingURL=next-data-kit.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"next-data-kit.js","sourceRoot":"","sources":["../../src/types/next-data-kit.ts"],"names":[],"mappings":"AAAA;;;;GAIG
|
|
1
|
+
{"version":3,"file":"next-data-kit.js","sourceRoot":"","sources":["../../src/types/next-data-kit.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* next-data-kit - Server Action Types
|
|
3
|
+
*
|
|
4
|
+
* Types for the server action and data kit operations.
|
|
5
|
+
*/
|
|
6
|
+
import type { Model } from 'mongoose';
|
|
7
|
+
import type { TDataKitInput, TDataKitAdapter, TFilterCustomConfigWithFilter, TSortOptions } from '../next-data-kit';
|
|
8
|
+
import type { TMongoFilterQuery } from './database/mongo';
|
|
9
|
+
/**
|
|
10
|
+
* Extract document type from a Mongoose Model.
|
|
11
|
+
*/
|
|
12
|
+
export type TExtractDocType<M> = M extends Model<infer TRawDocType, any, any, any, any, any> ? TRawDocType : never;
|
|
13
|
+
/**
|
|
14
|
+
* Base options shared by both mongoose and adapter versions
|
|
15
|
+
*/
|
|
16
|
+
export type TBaseOptions<TDoc, R> = {
|
|
17
|
+
input: TDataKitInput<TDoc>;
|
|
18
|
+
item: (item: TDoc) => Promise<R> | R;
|
|
19
|
+
filterAllowed?: string[];
|
|
20
|
+
maxLimit?: number;
|
|
21
|
+
queryAllowed?: (keyof TDoc | string)[];
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Options when using a Mongoose model
|
|
25
|
+
*/
|
|
26
|
+
export type TMongooseOptions<M, TDoc, R> = TBaseOptions<TDoc, R> & {
|
|
27
|
+
model: M;
|
|
28
|
+
adapter?: never;
|
|
29
|
+
filter?: (filterInput?: Record<string, unknown>) => TMongoFilterQuery<TDoc>;
|
|
30
|
+
filterCustom?: TFilterCustomConfigWithFilter<TDoc, TMongoFilterQuery<TDoc>>;
|
|
31
|
+
defaultSort?: TSortOptions<TDoc>;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Options when using a custom adapter
|
|
35
|
+
*/
|
|
36
|
+
export type TAdapterOptions<TDoc, R> = TBaseOptions<TDoc, R> & {
|
|
37
|
+
adapter: TDataKitAdapter<TDoc>;
|
|
38
|
+
model?: never;
|
|
39
|
+
filter?: never;
|
|
40
|
+
filterCustom?: TFilterCustomConfigWithFilter<TDoc, unknown>;
|
|
41
|
+
defaultSort?: never;
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=action.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action.d.ts","sourceRoot":"","sources":["../../../src/types/server/action.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,6BAA6B,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACpH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAE1D;;GAEG;AAEH,MAAM,MAAM,eAAe,CAAC,CAAC,IAAI,CAAC,SAAS,K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AAE,OAAO,CAAC,CAAC;IAC5D,WAAW,CAAC,EAAE,KAAK,CAAC;CACpB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action.js","sourceRoot":"","sources":["../../../src/types/server/action.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* next-data-kit - Database Types (Mongo)
|
|
3
|
+
*
|
|
4
|
+
* MongoDB-specific types for filters and queries.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Sort order for database queries
|
|
8
|
+
*/
|
|
9
|
+
export type TSortOrder = 1 | -1 | 'asc' | 'desc' | 'ascending' | 'descending';
|
|
10
|
+
/**
|
|
11
|
+
* Filter operators for individual fields (Mongo subset)
|
|
12
|
+
*/
|
|
13
|
+
export type TMongoFilterOperators<T> = {
|
|
14
|
+
$eq?: T;
|
|
15
|
+
$ne?: T;
|
|
16
|
+
$gt?: T;
|
|
17
|
+
$gte?: T;
|
|
18
|
+
$lt?: T;
|
|
19
|
+
$lte?: T;
|
|
20
|
+
$in?: T[];
|
|
21
|
+
$nin?: T[];
|
|
22
|
+
$exists?: boolean;
|
|
23
|
+
$regex?: string | RegExp;
|
|
24
|
+
$options?: string;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Mongo root operators.
|
|
28
|
+
*/
|
|
29
|
+
export type TMongoRootFilterOperators<T> = {
|
|
30
|
+
$and?: TMongoFilterQuery<T>[];
|
|
31
|
+
$or?: TMongoFilterQuery<T>[];
|
|
32
|
+
$nor?: TMongoFilterQuery<T>[];
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Mongo filter query type.
|
|
36
|
+
*/
|
|
37
|
+
export type TMongoFilterQuery<T> = {
|
|
38
|
+
[P in keyof T]?: T[P] | TMongoFilterOperators<T[P]>;
|
|
39
|
+
} & TMongoRootFilterOperators<T>;
|
|
40
|
+
/**
|
|
41
|
+
* Minimal Mongoose Model interface for the adapter.
|
|
42
|
+
*/
|
|
43
|
+
export type TMongoModel<_TRawDocType = unknown, _TQueryHelpers = object> = {
|
|
44
|
+
countDocuments(filter?: any): Promise<number>;
|
|
45
|
+
find(filter?: any, projection?: any, options?: any): any;
|
|
46
|
+
};
|
|
47
|
+
//# sourceMappingURL=mongo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mongo.d.ts","sourceRoot":"","sources":["../../../../src/types/server/database/mongo.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK,GAAG,MAAM,GAAG,WAAW,GAAG,YAAY,CAAC;AAE9E;;GAEG;AACH,MAAM,MAAM,qBAAqB,CAAC,CAAC,IAAI;IACtC,GAAG,CAAC,EAAE,CAAC,CAAC;IACR,GAAG,CAAC,EAAE,CAAC,CAAC;IACR,GAAG,CAAC,EAAE,CAAC,CAAC;IACR,IAAI,CAAC,EAAE,CAAC,CAAC;IACT,GAAG,CAAC,EAAE,CAAC,CAAC;IACR,IAAI,CAAC,EAAE,CAAC,CAAC;IACT,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC;IACV,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC;IACX,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,yBAAyB,CAAC,CAAC,IAAI;IAC1C,IAAI,CAAC,EAAE,iBAAiB,CAAC,CAAC,CAAC,EAAE,CAAC;IAC9B,GAAG,CAAC,EAAE,iBAAiB,CAAC,CAAC,CAAC,EAAE,CAAC;IAC7B,IAAI,CAAC,EAAE,iBAAiB,CAAC,CAAC,CAAC,EAAE,CAAC;CAC9B,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,iBAAiB,CAAC,CAAC,IAAI;KACjC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,qBAAqB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CACnD,GAAG,yBAAyB,CAAC,CAAC,CAAC,CAAC;AAEjC;;GAEG;AAEH,MAAM,MAAM,WAAW,CAAC,YAAY,GAAG,OAAO,EAAE,cAAc,GAAG,MAAM,IAAI;IAC1E,cAAc,CAAC,MAAM,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC9C,IAAI,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,UAAU,CAAC,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,GAAG,CAAC;CACzD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mongo.js","sourceRoot":"","sources":["../../../../src/types/server/database/mongo.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "next-data-kit",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"description": "A powerful table utility for server-side pagination, filtering, and sorting with React components",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -94,6 +94,7 @@
|
|
|
94
94
|
"class-variance-authority": "^0.7.1",
|
|
95
95
|
"eslint": "^9.17.0",
|
|
96
96
|
"lucide-react": "^0.469.0",
|
|
97
|
+
"mongoose": "^9.0.2",
|
|
97
98
|
"semantic-release": "^24.2.9",
|
|
98
99
|
"tsup": "^8.3.5",
|
|
99
100
|
"typescript": "^5.7.2",
|
|
@@ -110,10 +111,14 @@
|
|
|
110
111
|
"@radix-ui/react-switch": ">=1.0.0",
|
|
111
112
|
"class-variance-authority": ">=0.7.0",
|
|
112
113
|
"lucide-react": ">=0.0.0",
|
|
114
|
+
"mongoose": ">=6.0.0",
|
|
113
115
|
"react": ">=18.0.0",
|
|
114
116
|
"zod": ">=3.0.0"
|
|
115
117
|
},
|
|
116
118
|
"peerDependenciesMeta": {
|
|
119
|
+
"mongoose": {
|
|
120
|
+
"optional": true
|
|
121
|
+
},
|
|
117
122
|
"react": {
|
|
118
123
|
"optional": true
|
|
119
124
|
},
|
|
@@ -1,225 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* next-data-kit - Database Types (Mongo)
|
|
3
|
-
*
|
|
4
|
-
* MongoDB-specific types.
|
|
5
|
-
* Consolidated into a single file for simplicity.
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* Sort order for database queries
|
|
9
|
-
*/
|
|
10
|
-
type TSortOrder = 1 | -1 | 'asc' | 'desc' | 'ascending' | 'descending';
|
|
11
|
-
/**
|
|
12
|
-
* ObjectId placeholder type - compatible with MongoDB ObjectId.
|
|
13
|
-
*/
|
|
14
|
-
type TObjectId = {
|
|
15
|
-
toString(): string;
|
|
16
|
-
toHexString(): string;
|
|
17
|
-
equals(otherId: TObjectId | string): boolean;
|
|
18
|
-
};
|
|
19
|
-
/**
|
|
20
|
-
* Generic document type that represents a database document with an ID.
|
|
21
|
-
*/
|
|
22
|
-
type TDocument<TId = unknown> = {
|
|
23
|
-
_id: TId;
|
|
24
|
-
createdAt?: Date;
|
|
25
|
-
updatedAt?: Date;
|
|
26
|
-
};
|
|
27
|
-
/**
|
|
28
|
-
* Mongo document base (includes common Mongo-only fields).
|
|
29
|
-
*/
|
|
30
|
-
type TMongoDocument = TDocument<string | TObjectId> & {
|
|
31
|
-
__v?: number;
|
|
32
|
-
};
|
|
33
|
-
/**
|
|
34
|
-
* Hydrated document type - represents a document with methods.
|
|
35
|
-
*/
|
|
36
|
-
type THydratedDocument<T, TId = unknown> = T & TDocument<TId>;
|
|
37
|
-
/**
|
|
38
|
-
* Hydrated Mongo document.
|
|
39
|
-
*/
|
|
40
|
-
type TMongoHydratedDocument<T> = T & TMongoDocument & {
|
|
41
|
-
toObject(): T;
|
|
42
|
-
toJSON(): T;
|
|
43
|
-
};
|
|
44
|
-
/**
|
|
45
|
-
* Filter operators for individual fields (Mongo subset)
|
|
46
|
-
*/
|
|
47
|
-
type TMongoFilterOperators<T> = {
|
|
48
|
-
$eq?: T;
|
|
49
|
-
$ne?: T;
|
|
50
|
-
$gt?: T;
|
|
51
|
-
$gte?: T;
|
|
52
|
-
$lt?: T;
|
|
53
|
-
$lte?: T;
|
|
54
|
-
$in?: T[];
|
|
55
|
-
$nin?: T[];
|
|
56
|
-
$exists?: boolean;
|
|
57
|
-
$all?: T extends Array<infer U> ? U[] : never;
|
|
58
|
-
$elemMatch?: T extends Array<infer U> ? TMongoFilterQuery<U> : never;
|
|
59
|
-
$size?: number;
|
|
60
|
-
$regex?: string | RegExp;
|
|
61
|
-
$options?: string;
|
|
62
|
-
$type?: string | number;
|
|
63
|
-
};
|
|
64
|
-
/**
|
|
65
|
-
* Mongo root operators.
|
|
66
|
-
*/
|
|
67
|
-
type TMongoRootFilterOperators<T> = {
|
|
68
|
-
$and?: TMongoFilterQuery<T>[];
|
|
69
|
-
$or?: TMongoFilterQuery<T>[];
|
|
70
|
-
$nor?: TMongoFilterQuery<T>[];
|
|
71
|
-
$not?: TMongoFilterQuery<T>;
|
|
72
|
-
$text?: {
|
|
73
|
-
$search: string;
|
|
74
|
-
$language?: string;
|
|
75
|
-
$caseSensitive?: boolean;
|
|
76
|
-
$diacriticSensitive?: boolean;
|
|
77
|
-
};
|
|
78
|
-
$where?: string | ((this: T) => boolean);
|
|
79
|
-
};
|
|
80
|
-
/**
|
|
81
|
-
* Mongo filter query type.
|
|
82
|
-
*/
|
|
83
|
-
type TMongoFilterQuery<T> = {
|
|
84
|
-
[P in keyof T]?: T[P] | TMongoFilterOperators<T[P]>;
|
|
85
|
-
} & TMongoRootFilterOperators<T>;
|
|
86
|
-
/**
|
|
87
|
-
* Populate options for query builder.
|
|
88
|
-
*/
|
|
89
|
-
type TPopulateOptions = {
|
|
90
|
-
path: string;
|
|
91
|
-
select?: string | Record<string, 0 | 1>;
|
|
92
|
-
model?: string;
|
|
93
|
-
match?: Record<string, unknown>;
|
|
94
|
-
populate?: TPopulateOptions | TPopulateOptions[];
|
|
95
|
-
};
|
|
96
|
-
/**
|
|
97
|
-
* Query builder for chaining query operations.
|
|
98
|
-
*/
|
|
99
|
-
type TQueryBuilder<TResult, TQueryHelpers = object> = Promise<TResult> & {
|
|
100
|
-
sort(options: Record<string, TSortOrder>): TQueryBuilder<TResult, TQueryHelpers>;
|
|
101
|
-
limit(count: number): TQueryBuilder<TResult, TQueryHelpers>;
|
|
102
|
-
skip(count: number): TQueryBuilder<TResult, TQueryHelpers>;
|
|
103
|
-
select(fields: string | Record<string, 0 | 1>): TQueryBuilder<TResult, TQueryHelpers>;
|
|
104
|
-
populate(path: string | TPopulateOptions): TQueryBuilder<TResult, TQueryHelpers>;
|
|
105
|
-
lean(): TQueryBuilder<TResult, TQueryHelpers>;
|
|
106
|
-
exec(): Promise<TResult>;
|
|
107
|
-
};
|
|
108
|
-
/**
|
|
109
|
-
* Generic Model type.
|
|
110
|
-
*/
|
|
111
|
-
type TModel<TRawDocType = unknown, TQueryHelpers = object, TId = unknown, TFilter = unknown> = {
|
|
112
|
-
countDocuments(filter?: TFilter): Promise<number>;
|
|
113
|
-
find(filter?: TFilter): TQueryBuilder<TRawDocType[], TQueryHelpers>;
|
|
114
|
-
findOne(filter?: TFilter): TQueryBuilder<TRawDocType | null, TQueryHelpers>;
|
|
115
|
-
findById(id: TId): TQueryBuilder<TRawDocType | null, TQueryHelpers>;
|
|
116
|
-
};
|
|
117
|
-
/**
|
|
118
|
-
* Convenience alias for a Mongo-backed model.
|
|
119
|
-
*/
|
|
120
|
-
type TMongoModel<TRawDocType = unknown, TQueryHelpers = object> = TModel<TRawDocType, TQueryHelpers, string | TObjectId, TMongoFilterQuery<TRawDocType>>;
|
|
121
|
-
/**
|
|
122
|
-
* Extract raw document type from a Model
|
|
123
|
-
*/
|
|
124
|
-
type TExtractDocType<M> = M extends TModel<infer TRawDocType, unknown, unknown, unknown> ? TRawDocType : never;
|
|
125
|
-
/**
|
|
126
|
-
* Extract hydrated document type from a Model
|
|
127
|
-
*/
|
|
128
|
-
type TExtractHydratedDoc<M> = M extends TModel<infer TRawDocType, unknown, infer TId, unknown> ? THydratedDocument<TRawDocType, TId> : never;
|
|
129
|
-
|
|
130
|
-
/**
|
|
131
|
-
* next-data-kit - React Data Kit Types
|
|
132
|
-
*
|
|
133
|
-
* Core types for the next-data-kit server action and components.
|
|
134
|
-
*/
|
|
135
|
-
|
|
136
|
-
/**
|
|
137
|
-
* Sort options type that references keys from the item type
|
|
138
|
-
*/
|
|
139
|
-
type TSortOptions<T> = {
|
|
140
|
-
[K in keyof T]?: TSortOrder;
|
|
141
|
-
};
|
|
142
|
-
/**
|
|
143
|
-
* Sort entry for array-based sorting
|
|
144
|
-
*/
|
|
145
|
-
type TSortEntry = {
|
|
146
|
-
path: string;
|
|
147
|
-
value: 1 | -1;
|
|
148
|
-
};
|
|
149
|
-
/**
|
|
150
|
-
* Filter configuration for automatic filtering
|
|
151
|
-
*/
|
|
152
|
-
type TFilterConfig = {
|
|
153
|
-
[key: string]: {
|
|
154
|
-
type: 'REGEX' | 'EXACT';
|
|
155
|
-
field?: string;
|
|
156
|
-
};
|
|
157
|
-
};
|
|
158
|
-
/**
|
|
159
|
-
* Custom filter configuration
|
|
160
|
-
* Allows defining custom filter functions for specific filter keys
|
|
161
|
-
*/
|
|
162
|
-
type TFilterCustomConfig<T = unknown> = {
|
|
163
|
-
[id: string]: (data: unknown) => TMongoFilterQuery<T>;
|
|
164
|
-
};
|
|
165
|
-
/**
|
|
166
|
-
* Variant of TFilterCustomConfig that allows customizing the returned filter shape.
|
|
167
|
-
* Useful for Mongo (operator-based) vs. other ORMs (where clauses) in the future.
|
|
168
|
-
*/
|
|
169
|
-
type TFilterCustomConfigWithFilter<TDoc = unknown, TFilter = TMongoFilterQuery<TDoc>> = {
|
|
170
|
-
[id: string]: (data: unknown) => TFilter;
|
|
171
|
-
};
|
|
172
|
-
/**
|
|
173
|
-
* React Data Kit server action input
|
|
174
|
-
*/
|
|
175
|
-
type TDataKitInput<T = unknown> = {
|
|
176
|
-
action?: 'FETCH';
|
|
177
|
-
page?: number;
|
|
178
|
-
limit?: number;
|
|
179
|
-
sort?: TSortOptions<T>;
|
|
180
|
-
sorts?: TSortEntry[];
|
|
181
|
-
query?: Record<string, string | number | boolean>;
|
|
182
|
-
filter?: Record<string, unknown>;
|
|
183
|
-
filterConfig?: TFilterConfig;
|
|
184
|
-
filterCustom?: TFilterCustomConfig<T>;
|
|
185
|
-
};
|
|
186
|
-
/**
|
|
187
|
-
* React Data Kit server action result
|
|
188
|
-
*/
|
|
189
|
-
type TDataKitResult<R> = {
|
|
190
|
-
type: 'ITEMS';
|
|
191
|
-
items: R[];
|
|
192
|
-
documentTotal: number;
|
|
193
|
-
};
|
|
194
|
-
/**
|
|
195
|
-
* Pagination info for client-side use
|
|
196
|
-
*/
|
|
197
|
-
type TPaginationInfo = {
|
|
198
|
-
currentPage: number;
|
|
199
|
-
totalPages: number;
|
|
200
|
-
totalItems: number;
|
|
201
|
-
itemsPerPage: number;
|
|
202
|
-
hasNextPage: boolean;
|
|
203
|
-
hasPrevPage: boolean;
|
|
204
|
-
};
|
|
205
|
-
/**
|
|
206
|
-
* Calculate pagination info from next-data-kit result
|
|
207
|
-
*/
|
|
208
|
-
declare const calculatePagination: (page: number, limit: number, total: number) => TPaginationInfo;
|
|
209
|
-
/**
|
|
210
|
-
* React Data Kit Adapter Interface
|
|
211
|
-
* Defines the contract for a database adapter.
|
|
212
|
-
*/
|
|
213
|
-
type TDataKitAdapter<T> = (params: Readonly<{
|
|
214
|
-
filter: Record<string, unknown>;
|
|
215
|
-
sorts: TSortEntry[];
|
|
216
|
-
limit: number;
|
|
217
|
-
page: number;
|
|
218
|
-
skip: number;
|
|
219
|
-
input: TDataKitInput<T>;
|
|
220
|
-
}>) => Promise<{
|
|
221
|
-
items: T[];
|
|
222
|
-
total: number;
|
|
223
|
-
}>;
|
|
224
|
-
|
|
225
|
-
export { type TDataKitInput as T, type TDataKitAdapter as a, type TMongoModel as b, type TMongoFilterQuery as c, type TFilterCustomConfigWithFilter as d, type TSortOptions as e, type TDataKitResult as f, type TExtractDocType as g, type TModel as h, type THydratedDocument as i, type TSortOrder as j, type TFilterCustomConfig as k, type TFilterConfig as l, type TMongoFilterOperators as m, type TMongoRootFilterOperators as n, type TObjectId as o, type TMongoDocument as p, type TMongoHydratedDocument as q, type TSortEntry as r, type TDocument as s, type TQueryBuilder as t, type TPopulateOptions as u, type TExtractHydratedDoc as v, type TPaginationInfo as w, calculatePagination as x };
|
|
@@ -1,225 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* next-data-kit - Database Types (Mongo)
|
|
3
|
-
*
|
|
4
|
-
* MongoDB-specific types.
|
|
5
|
-
* Consolidated into a single file for simplicity.
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* Sort order for database queries
|
|
9
|
-
*/
|
|
10
|
-
type TSortOrder = 1 | -1 | 'asc' | 'desc' | 'ascending' | 'descending';
|
|
11
|
-
/**
|
|
12
|
-
* ObjectId placeholder type - compatible with MongoDB ObjectId.
|
|
13
|
-
*/
|
|
14
|
-
type TObjectId = {
|
|
15
|
-
toString(): string;
|
|
16
|
-
toHexString(): string;
|
|
17
|
-
equals(otherId: TObjectId | string): boolean;
|
|
18
|
-
};
|
|
19
|
-
/**
|
|
20
|
-
* Generic document type that represents a database document with an ID.
|
|
21
|
-
*/
|
|
22
|
-
type TDocument<TId = unknown> = {
|
|
23
|
-
_id: TId;
|
|
24
|
-
createdAt?: Date;
|
|
25
|
-
updatedAt?: Date;
|
|
26
|
-
};
|
|
27
|
-
/**
|
|
28
|
-
* Mongo document base (includes common Mongo-only fields).
|
|
29
|
-
*/
|
|
30
|
-
type TMongoDocument = TDocument<string | TObjectId> & {
|
|
31
|
-
__v?: number;
|
|
32
|
-
};
|
|
33
|
-
/**
|
|
34
|
-
* Hydrated document type - represents a document with methods.
|
|
35
|
-
*/
|
|
36
|
-
type THydratedDocument<T, TId = unknown> = T & TDocument<TId>;
|
|
37
|
-
/**
|
|
38
|
-
* Hydrated Mongo document.
|
|
39
|
-
*/
|
|
40
|
-
type TMongoHydratedDocument<T> = T & TMongoDocument & {
|
|
41
|
-
toObject(): T;
|
|
42
|
-
toJSON(): T;
|
|
43
|
-
};
|
|
44
|
-
/**
|
|
45
|
-
* Filter operators for individual fields (Mongo subset)
|
|
46
|
-
*/
|
|
47
|
-
type TMongoFilterOperators<T> = {
|
|
48
|
-
$eq?: T;
|
|
49
|
-
$ne?: T;
|
|
50
|
-
$gt?: T;
|
|
51
|
-
$gte?: T;
|
|
52
|
-
$lt?: T;
|
|
53
|
-
$lte?: T;
|
|
54
|
-
$in?: T[];
|
|
55
|
-
$nin?: T[];
|
|
56
|
-
$exists?: boolean;
|
|
57
|
-
$all?: T extends Array<infer U> ? U[] : never;
|
|
58
|
-
$elemMatch?: T extends Array<infer U> ? TMongoFilterQuery<U> : never;
|
|
59
|
-
$size?: number;
|
|
60
|
-
$regex?: string | RegExp;
|
|
61
|
-
$options?: string;
|
|
62
|
-
$type?: string | number;
|
|
63
|
-
};
|
|
64
|
-
/**
|
|
65
|
-
* Mongo root operators.
|
|
66
|
-
*/
|
|
67
|
-
type TMongoRootFilterOperators<T> = {
|
|
68
|
-
$and?: TMongoFilterQuery<T>[];
|
|
69
|
-
$or?: TMongoFilterQuery<T>[];
|
|
70
|
-
$nor?: TMongoFilterQuery<T>[];
|
|
71
|
-
$not?: TMongoFilterQuery<T>;
|
|
72
|
-
$text?: {
|
|
73
|
-
$search: string;
|
|
74
|
-
$language?: string;
|
|
75
|
-
$caseSensitive?: boolean;
|
|
76
|
-
$diacriticSensitive?: boolean;
|
|
77
|
-
};
|
|
78
|
-
$where?: string | ((this: T) => boolean);
|
|
79
|
-
};
|
|
80
|
-
/**
|
|
81
|
-
* Mongo filter query type.
|
|
82
|
-
*/
|
|
83
|
-
type TMongoFilterQuery<T> = {
|
|
84
|
-
[P in keyof T]?: T[P] | TMongoFilterOperators<T[P]>;
|
|
85
|
-
} & TMongoRootFilterOperators<T>;
|
|
86
|
-
/**
|
|
87
|
-
* Populate options for query builder.
|
|
88
|
-
*/
|
|
89
|
-
type TPopulateOptions = {
|
|
90
|
-
path: string;
|
|
91
|
-
select?: string | Record<string, 0 | 1>;
|
|
92
|
-
model?: string;
|
|
93
|
-
match?: Record<string, unknown>;
|
|
94
|
-
populate?: TPopulateOptions | TPopulateOptions[];
|
|
95
|
-
};
|
|
96
|
-
/**
|
|
97
|
-
* Query builder for chaining query operations.
|
|
98
|
-
*/
|
|
99
|
-
type TQueryBuilder<TResult, TQueryHelpers = object> = Promise<TResult> & {
|
|
100
|
-
sort(options: Record<string, TSortOrder>): TQueryBuilder<TResult, TQueryHelpers>;
|
|
101
|
-
limit(count: number): TQueryBuilder<TResult, TQueryHelpers>;
|
|
102
|
-
skip(count: number): TQueryBuilder<TResult, TQueryHelpers>;
|
|
103
|
-
select(fields: string | Record<string, 0 | 1>): TQueryBuilder<TResult, TQueryHelpers>;
|
|
104
|
-
populate(path: string | TPopulateOptions): TQueryBuilder<TResult, TQueryHelpers>;
|
|
105
|
-
lean(): TQueryBuilder<TResult, TQueryHelpers>;
|
|
106
|
-
exec(): Promise<TResult>;
|
|
107
|
-
};
|
|
108
|
-
/**
|
|
109
|
-
* Generic Model type.
|
|
110
|
-
*/
|
|
111
|
-
type TModel<TRawDocType = unknown, TQueryHelpers = object, TId = unknown, TFilter = unknown> = {
|
|
112
|
-
countDocuments(filter?: TFilter): Promise<number>;
|
|
113
|
-
find(filter?: TFilter): TQueryBuilder<TRawDocType[], TQueryHelpers>;
|
|
114
|
-
findOne(filter?: TFilter): TQueryBuilder<TRawDocType | null, TQueryHelpers>;
|
|
115
|
-
findById(id: TId): TQueryBuilder<TRawDocType | null, TQueryHelpers>;
|
|
116
|
-
};
|
|
117
|
-
/**
|
|
118
|
-
* Convenience alias for a Mongo-backed model.
|
|
119
|
-
*/
|
|
120
|
-
type TMongoModel<TRawDocType = unknown, TQueryHelpers = object> = TModel<TRawDocType, TQueryHelpers, string | TObjectId, TMongoFilterQuery<TRawDocType>>;
|
|
121
|
-
/**
|
|
122
|
-
* Extract raw document type from a Model
|
|
123
|
-
*/
|
|
124
|
-
type TExtractDocType<M> = M extends TModel<infer TRawDocType, unknown, unknown, unknown> ? TRawDocType : never;
|
|
125
|
-
/**
|
|
126
|
-
* Extract hydrated document type from a Model
|
|
127
|
-
*/
|
|
128
|
-
type TExtractHydratedDoc<M> = M extends TModel<infer TRawDocType, unknown, infer TId, unknown> ? THydratedDocument<TRawDocType, TId> : never;
|
|
129
|
-
|
|
130
|
-
/**
|
|
131
|
-
* next-data-kit - React Data Kit Types
|
|
132
|
-
*
|
|
133
|
-
* Core types for the next-data-kit server action and components.
|
|
134
|
-
*/
|
|
135
|
-
|
|
136
|
-
/**
|
|
137
|
-
* Sort options type that references keys from the item type
|
|
138
|
-
*/
|
|
139
|
-
type TSortOptions<T> = {
|
|
140
|
-
[K in keyof T]?: TSortOrder;
|
|
141
|
-
};
|
|
142
|
-
/**
|
|
143
|
-
* Sort entry for array-based sorting
|
|
144
|
-
*/
|
|
145
|
-
type TSortEntry = {
|
|
146
|
-
path: string;
|
|
147
|
-
value: 1 | -1;
|
|
148
|
-
};
|
|
149
|
-
/**
|
|
150
|
-
* Filter configuration for automatic filtering
|
|
151
|
-
*/
|
|
152
|
-
type TFilterConfig = {
|
|
153
|
-
[key: string]: {
|
|
154
|
-
type: 'REGEX' | 'EXACT';
|
|
155
|
-
field?: string;
|
|
156
|
-
};
|
|
157
|
-
};
|
|
158
|
-
/**
|
|
159
|
-
* Custom filter configuration
|
|
160
|
-
* Allows defining custom filter functions for specific filter keys
|
|
161
|
-
*/
|
|
162
|
-
type TFilterCustomConfig<T = unknown> = {
|
|
163
|
-
[id: string]: (data: unknown) => TMongoFilterQuery<T>;
|
|
164
|
-
};
|
|
165
|
-
/**
|
|
166
|
-
* Variant of TFilterCustomConfig that allows customizing the returned filter shape.
|
|
167
|
-
* Useful for Mongo (operator-based) vs. other ORMs (where clauses) in the future.
|
|
168
|
-
*/
|
|
169
|
-
type TFilterCustomConfigWithFilter<TDoc = unknown, TFilter = TMongoFilterQuery<TDoc>> = {
|
|
170
|
-
[id: string]: (data: unknown) => TFilter;
|
|
171
|
-
};
|
|
172
|
-
/**
|
|
173
|
-
* React Data Kit server action input
|
|
174
|
-
*/
|
|
175
|
-
type TDataKitInput<T = unknown> = {
|
|
176
|
-
action?: 'FETCH';
|
|
177
|
-
page?: number;
|
|
178
|
-
limit?: number;
|
|
179
|
-
sort?: TSortOptions<T>;
|
|
180
|
-
sorts?: TSortEntry[];
|
|
181
|
-
query?: Record<string, string | number | boolean>;
|
|
182
|
-
filter?: Record<string, unknown>;
|
|
183
|
-
filterConfig?: TFilterConfig;
|
|
184
|
-
filterCustom?: TFilterCustomConfig<T>;
|
|
185
|
-
};
|
|
186
|
-
/**
|
|
187
|
-
* React Data Kit server action result
|
|
188
|
-
*/
|
|
189
|
-
type TDataKitResult<R> = {
|
|
190
|
-
type: 'ITEMS';
|
|
191
|
-
items: R[];
|
|
192
|
-
documentTotal: number;
|
|
193
|
-
};
|
|
194
|
-
/**
|
|
195
|
-
* Pagination info for client-side use
|
|
196
|
-
*/
|
|
197
|
-
type TPaginationInfo = {
|
|
198
|
-
currentPage: number;
|
|
199
|
-
totalPages: number;
|
|
200
|
-
totalItems: number;
|
|
201
|
-
itemsPerPage: number;
|
|
202
|
-
hasNextPage: boolean;
|
|
203
|
-
hasPrevPage: boolean;
|
|
204
|
-
};
|
|
205
|
-
/**
|
|
206
|
-
* Calculate pagination info from next-data-kit result
|
|
207
|
-
*/
|
|
208
|
-
declare const calculatePagination: (page: number, limit: number, total: number) => TPaginationInfo;
|
|
209
|
-
/**
|
|
210
|
-
* React Data Kit Adapter Interface
|
|
211
|
-
* Defines the contract for a database adapter.
|
|
212
|
-
*/
|
|
213
|
-
type TDataKitAdapter<T> = (params: Readonly<{
|
|
214
|
-
filter: Record<string, unknown>;
|
|
215
|
-
sorts: TSortEntry[];
|
|
216
|
-
limit: number;
|
|
217
|
-
page: number;
|
|
218
|
-
skip: number;
|
|
219
|
-
input: TDataKitInput<T>;
|
|
220
|
-
}>) => Promise<{
|
|
221
|
-
items: T[];
|
|
222
|
-
total: number;
|
|
223
|
-
}>;
|
|
224
|
-
|
|
225
|
-
export { type TDataKitInput as T, type TDataKitAdapter as a, type TMongoModel as b, type TMongoFilterQuery as c, type TFilterCustomConfigWithFilter as d, type TSortOptions as e, type TDataKitResult as f, type TExtractDocType as g, type TModel as h, type THydratedDocument as i, type TSortOrder as j, type TFilterCustomConfig as k, type TFilterConfig as l, type TMongoFilterOperators as m, type TMongoRootFilterOperators as n, type TObjectId as o, type TMongoDocument as p, type TMongoHydratedDocument as q, type TSortEntry as r, type TDocument as s, type TQueryBuilder as t, type TPopulateOptions as u, type TExtractHydratedDoc as v, type TPaginationInfo as w, calculatePagination as x };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../src/types/component.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACrE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAMhD;;GAEG;AACH,KAAK,6BAA6B,CAAC,CAAC,IAC/B,CAAC,SAAS,cAAc,CAAC,MAAM,CAAC,CAAC,GAC/B,CAAC,GACD,CAAC,SAAS;IAAE,KAAK,EAAE,CAAC,MAAM,CAAC,CAAC,EAAE,CAAA;CAAE,GAChC,CAAC,GACD,CAAC,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,CAAC,GAC1B,EAAE,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