@groundbrick/repository-base 0.0.1

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.
@@ -0,0 +1,3 @@
1
+ // packages/repository-base/src/types/Entity.ts
2
+ export {};
3
+ //# sourceMappingURL=Entity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Entity.js","sourceRoot":"","sources":["../../src/types/Entity.ts"],"names":[],"mappings":"AAAA,+CAA+C"}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Pagination options for repository queries
3
+ */
4
+ export interface PaginationOptions {
5
+ limit?: number;
6
+ offset?: number;
7
+ }
8
+ /**
9
+ * Sorting options for repository queries
10
+ */
11
+ export interface SortOptions {
12
+ column: string;
13
+ direction?: 'ASC' | 'DESC';
14
+ }
15
+ /**
16
+ * Combined query options for repository methods
17
+ */
18
+ export interface QueryOptions {
19
+ pagination?: PaginationOptions;
20
+ sort?: SortOptions | SortOptions[];
21
+ }
22
+ /**
23
+ * Options for the findMany method
24
+ */
25
+ export interface FindManyOptions extends QueryOptions {
26
+ condition?: string;
27
+ params?: any[];
28
+ }
29
+ /**
30
+ * Result wrapper for paginated queries
31
+ */
32
+ export interface PaginatedResult<T> {
33
+ data: T[];
34
+ total: number;
35
+ limit: number;
36
+ offset: number;
37
+ hasNext: boolean;
38
+ hasPrevious: boolean;
39
+ }
40
+ //# sourceMappingURL=QueryOptions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"QueryOptions.d.ts","sourceRoot":"","sources":["../../src/types/QueryOptions.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,UAAU,CAAC,EAAE,iBAAiB,CAAC;IAC/B,IAAI,CAAC,EAAE,WAAW,GAAG,WAAW,EAAE,CAAC;CACpC;AAED;;GAEG;AACH,MAAM,WAAW,eAAgB,SAAQ,YAAY;IACnD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe,CAAC,CAAC;IAChC,IAAI,EAAE,CAAC,EAAE,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,OAAO,CAAC;CACtB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=QueryOptions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"QueryOptions.js","sourceRoot":"","sources":["../../src/types/QueryOptions.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ export * from './Entity.js';
2
+ export * from './QueryOptions.js';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from './Entity.js';
2
+ export * from './QueryOptions.js';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC"}
package/package.json ADDED
@@ -0,0 +1,63 @@
1
+ {
2
+ "name": "@groundbrick/repository-base",
3
+ "version": "0.0.1",
4
+ "description": "Base repository classes with generic CRUD operations and query building",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "import": "./dist/index.js",
11
+ "require": "./dist/index.js",
12
+ "types": "./dist/index.d.ts"
13
+ }
14
+ },
15
+ "files": [
16
+ "dist/**/*",
17
+ "README.md",
18
+ "LICENSE"
19
+ ],
20
+ "scripts": {
21
+ "build": "tsc",
22
+ "dev": "tsc --watch",
23
+ "test": "vitest run",
24
+ "test:watch": "vitest",
25
+ "test:coverage": "vitest run --coverage",
26
+ "clean": "rm -rf dist *.tsbuildinfo",
27
+ "lint": "eslint src/**/*.ts",
28
+ "lint:fix": "eslint src/**/*.ts --fix",
29
+ "prepublishOnly": "npm run build"
30
+ },
31
+ "keywords": [
32
+ "typescript",
33
+ "repository",
34
+ "crud",
35
+ "database",
36
+ "microframework",
37
+ "postgresql",
38
+ "mysql",
39
+ "orm",
40
+ "query-builder"
41
+ ],
42
+ "author": "Cleiton Marques <cleiton.marques@200.systems>",
43
+ "license": "MIT",
44
+ "repository": {
45
+ "type": "git",
46
+ "url": "git+https://github.com/200Systems/bitbrick-microframework.git",
47
+ "directory": "packages/repository-base"
48
+ },
49
+ "dependencies": {
50
+ "@groundbrick/logger": "workspace:*",
51
+ "@groundbrick/db-core": "workspace:*"
52
+ },
53
+ "devDependencies": {
54
+ "@types/node": "^20.10.0",
55
+ "typescript": "^5.8.3"
56
+ },
57
+ "engines": {
58
+ "node": ">=18.0.0"
59
+ },
60
+ "publishConfig": {
61
+ "access": "public"
62
+ }
63
+ }