@deessejs/collections 0.0.28 → 0.0.30
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/drizzle/index.d.ts +31 -0
- package/dist/drizzle/index.js +24 -0
- package/dist/drizzle/types.d.ts +0 -0
- package/dist/drizzle/types.js +1 -0
- package/dist/dsl/index.d.ts +1 -0
- package/dist/dsl/index.js +17 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/package.json +11 -3
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Collection } from "../collections/types";
|
|
2
|
+
import { FieldKind } from "../fields";
|
|
3
|
+
export declare const DrizzleTypes: Record<FieldKind, () => any>;
|
|
4
|
+
export declare const toDrizzle: (collection: Collection) => import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
5
|
+
name: string;
|
|
6
|
+
schema: undefined;
|
|
7
|
+
columns: {
|
|
8
|
+
[x: string]: import("drizzle-orm/pg-core").PgColumn<{
|
|
9
|
+
name: any;
|
|
10
|
+
tableName: string;
|
|
11
|
+
dataType: any;
|
|
12
|
+
columnType: any;
|
|
13
|
+
data: any;
|
|
14
|
+
driverParam: any;
|
|
15
|
+
notNull: false;
|
|
16
|
+
hasDefault: false;
|
|
17
|
+
isPrimaryKey: false;
|
|
18
|
+
isAutoincrement: false;
|
|
19
|
+
hasRuntimeDefault: false;
|
|
20
|
+
enumValues: any;
|
|
21
|
+
baseColumn: never;
|
|
22
|
+
identity: undefined;
|
|
23
|
+
generated: undefined;
|
|
24
|
+
}, {}, {
|
|
25
|
+
[x: string]: any;
|
|
26
|
+
[x: number]: any;
|
|
27
|
+
[x: symbol]: any;
|
|
28
|
+
}>;
|
|
29
|
+
};
|
|
30
|
+
dialect: "pg";
|
|
31
|
+
}>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.toDrizzle = exports.DrizzleTypes = void 0;
|
|
4
|
+
const pg_core_1 = require("drizzle-orm/pg-core");
|
|
5
|
+
exports.DrizzleTypes = {
|
|
6
|
+
boolean: () => (0, pg_core_1.boolean)(),
|
|
7
|
+
integer: () => (0, pg_core_1.integer)(),
|
|
8
|
+
serial: () => (0, pg_core_1.serial)(),
|
|
9
|
+
text: () => (0, pg_core_1.text)(),
|
|
10
|
+
varchar: () => (0, pg_core_1.varchar)(),
|
|
11
|
+
char: () => (0, pg_core_1.char)(),
|
|
12
|
+
numeric: () => (0, pg_core_1.numeric)(),
|
|
13
|
+
decimal: () => (0, pg_core_1.decimal)(),
|
|
14
|
+
json: () => (0, pg_core_1.json)(),
|
|
15
|
+
uuid: () => (0, pg_core_1.uuid)(),
|
|
16
|
+
timestamp: () => (0, pg_core_1.timestamp)(),
|
|
17
|
+
};
|
|
18
|
+
const toDrizzle = (collection) => {
|
|
19
|
+
return (0, pg_core_1.pgTable)(collection.slug, Object.fromEntries(Object.entries(collection.fields).map(([name, field]) => {
|
|
20
|
+
const kind = field.type.dsl.kind;
|
|
21
|
+
return [name, exports.DrizzleTypes[kind]()];
|
|
22
|
+
})));
|
|
23
|
+
};
|
|
24
|
+
exports.toDrizzle = toDrizzle;
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './collections';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./collections"), exports);
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -19,3 +19,5 @@ __exportStar(require("./collections"), exports);
|
|
|
19
19
|
__exportStar(require("./fields"), exports);
|
|
20
20
|
__exportStar(require("./providers"), exports);
|
|
21
21
|
__exportStar(require("./plugins"), exports);
|
|
22
|
+
__exportStar(require("./dsl"), exports);
|
|
23
|
+
__exportStar(require("./drizzle"), exports);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deessejs/collections",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.30",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -40,23 +40,31 @@
|
|
|
40
40
|
},
|
|
41
41
|
"homepage": "https://github.com/Developers-Secrets-Inc/collections#readme",
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"zod": "^4.1.12",
|
|
44
43
|
"@testing-library/dom": "^10.4.1",
|
|
45
44
|
"@testing-library/user-event": "^14.6.1",
|
|
46
45
|
"@types/jsdom": "^27.0.0",
|
|
47
46
|
"@types/node": "^20.0.0",
|
|
47
|
+
"@types/pg": "^8.15.6",
|
|
48
48
|
"@types/sinon": "^21.0.0",
|
|
49
49
|
"@typescript-eslint/eslint-plugin": "^6.0.0",
|
|
50
50
|
"@typescript-eslint/parser": "^6.0.0",
|
|
51
51
|
"@vitest/coverage-v8": "^4.0.13",
|
|
52
52
|
"@vitest/ui": "^4.0.13",
|
|
53
|
+
"drizzle-kit": "^0.31.8",
|
|
53
54
|
"eslint": "^8.0.0",
|
|
54
55
|
"jsdom": "^27.2.0",
|
|
55
56
|
"sinon": "^21.0.0",
|
|
57
|
+
"tsx": "^4.21.0",
|
|
56
58
|
"typescript": "^5.0.0",
|
|
57
|
-
"vitest": "^4.0.13"
|
|
59
|
+
"vitest": "^4.0.13",
|
|
60
|
+
"zod": "^4.1.12"
|
|
58
61
|
},
|
|
59
62
|
"peerDependencies": {
|
|
60
63
|
"zod": "^4.1.12"
|
|
64
|
+
},
|
|
65
|
+
"dependencies": {
|
|
66
|
+
"dotenv": "^17.2.3",
|
|
67
|
+
"drizzle-orm": "^0.45.0",
|
|
68
|
+
"pg": "^8.16.3"
|
|
61
69
|
}
|
|
62
70
|
}
|