@lsby/net-core-kysely 2.0.3
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/cjs/index.cjs +44 -0
- package/dist/cjs/index.d.cts +11 -0
- package/dist/esm/index.d.ts +11 -0
- package/dist/esm/index.js +19 -0
- package/package.json +49 -0
@@ -0,0 +1,44 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __defProp = Object.defineProperty;
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
6
|
+
var __export = (target, all) => {
|
7
|
+
for (var name in all)
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
9
|
+
};
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
12
|
+
for (let key of __getOwnPropNames(from))
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
15
|
+
}
|
16
|
+
return to;
|
17
|
+
};
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
19
|
+
|
20
|
+
// src/index.ts
|
21
|
+
var src_exports = {};
|
22
|
+
__export(src_exports, {
|
23
|
+
Kysely\u63D2\u4EF6: () => Kysely\u63D2\u4EF6
|
24
|
+
});
|
25
|
+
module.exports = __toCommonJS(src_exports);
|
26
|
+
var import_zod = require("zod");
|
27
|
+
var import_net_core = require("@lsby/net-core");
|
28
|
+
var import_ts_kysely = require("@lsby/ts-kysely");
|
29
|
+
var Kysely\u63D2\u4EF6Zod = (name) => {
|
30
|
+
return import_zod.z.object({
|
31
|
+
[name]: import_zod.z.custom((instance) => instance instanceof import_ts_kysely.Kysely\u7BA1\u7406\u5668)
|
32
|
+
});
|
33
|
+
};
|
34
|
+
var Kysely\u63D2\u4EF6 = class extends import_net_core.\u63D2\u4EF6 {
|
35
|
+
constructor(name, kysely) {
|
36
|
+
super(Kysely\u63D2\u4EF6Zod(name), async (_request, _response) => {
|
37
|
+
return { [name]: kysely };
|
38
|
+
});
|
39
|
+
}
|
40
|
+
};
|
41
|
+
// Annotate the CommonJS export names for ESM import in node:
|
42
|
+
0 && (module.exports = {
|
43
|
+
Kysely\u63D2\u4EF6
|
44
|
+
});
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import { z } from 'zod';
|
2
|
+
import { 插件 as __ } from '@lsby/net-core';
|
3
|
+
import { Kysely管理器 as Kysely___ } from '@lsby/ts-kysely';
|
4
|
+
|
5
|
+
declare class Kysely插件<NAME extends string, DB> extends __<z.ZodObject<{
|
6
|
+
[key in NAME]: z.ZodType<Kysely___<DB>>;
|
7
|
+
}>> {
|
8
|
+
constructor(name: NAME, kysely: Kysely___<DB>);
|
9
|
+
}
|
10
|
+
|
11
|
+
export { Kysely插件 };
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import { z } from 'zod';
|
2
|
+
import { 插件 as __ } from '@lsby/net-core';
|
3
|
+
import { Kysely管理器 as Kysely___ } from '@lsby/ts-kysely';
|
4
|
+
|
5
|
+
declare class Kysely插件<NAME extends string, DB> extends __<z.ZodObject<{
|
6
|
+
[key in NAME]: z.ZodType<Kysely___<DB>>;
|
7
|
+
}>> {
|
8
|
+
constructor(name: NAME, kysely: Kysely___<DB>);
|
9
|
+
}
|
10
|
+
|
11
|
+
export { Kysely插件 };
|
@@ -0,0 +1,19 @@
|
|
1
|
+
// src/index.ts
|
2
|
+
import { z } from "zod";
|
3
|
+
import { \u63D2\u4EF6 } from "@lsby/net-core";
|
4
|
+
import { Kysely\u7BA1\u7406\u5668 } from "@lsby/ts-kysely";
|
5
|
+
var Kysely\u63D2\u4EF6Zod = (name) => {
|
6
|
+
return z.object({
|
7
|
+
[name]: z.custom((instance) => instance instanceof Kysely\u7BA1\u7406\u5668)
|
8
|
+
});
|
9
|
+
};
|
10
|
+
var Kysely\u63D2\u4EF6 = class extends \u63D2\u4EF6 {
|
11
|
+
constructor(name, kysely) {
|
12
|
+
super(Kysely\u63D2\u4EF6Zod(name), async (_request, _response) => {
|
13
|
+
return { [name]: kysely };
|
14
|
+
});
|
15
|
+
}
|
16
|
+
};
|
17
|
+
export {
|
18
|
+
Kysely\u63D2\u4EF6
|
19
|
+
};
|
package/package.json
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
{
|
2
|
+
"name": "@lsby/net-core-kysely",
|
3
|
+
"version": "2.0.3",
|
4
|
+
"type": "module",
|
5
|
+
"exports": {
|
6
|
+
"require": "./dist/cjs/index.cjs",
|
7
|
+
"import": "./dist/esm/index.js"
|
8
|
+
},
|
9
|
+
"files": [
|
10
|
+
"dist"
|
11
|
+
],
|
12
|
+
"scripts": {
|
13
|
+
"build:all": "npm run build:cjs && npm run build:esm",
|
14
|
+
"build:cjs": "tsup src/**/*.ts --format cjs --clean --dts -d dist/cjs",
|
15
|
+
"build:esm": "tsup src/**/*.ts --format esm --clean --dts -d dist/esm",
|
16
|
+
"check:all": "npm run check:format && npm run check:lint && npm run check:type",
|
17
|
+
"check:format": "prettier --write .",
|
18
|
+
"check:lint": "eslint . --fix",
|
19
|
+
"check:type": "tsc --noEmit",
|
20
|
+
"check:type:watch": "tsc --noEmit -w",
|
21
|
+
"prepare": "husky",
|
22
|
+
"pub:public": "npm run check:all && npm run test:base && npm run build:all && bumpp && npm publish --access public",
|
23
|
+
"test:base": "npm run check:all && vitest run",
|
24
|
+
"test:coverage": "npm run check:all && vitest run --coverage && open-cli ./coverage/index.html"
|
25
|
+
},
|
26
|
+
"dependencies": {},
|
27
|
+
"devDependencies": {
|
28
|
+
"@ianvs/prettier-plugin-sort-imports": "^4.2.1",
|
29
|
+
"@lsby/eslint-config": "^0.1.2",
|
30
|
+
"@types/node": "^20.12.10",
|
31
|
+
"@vitest/coverage-v8": "^2.0.2",
|
32
|
+
"bumpp": "^9.4.1",
|
33
|
+
"husky": "^9.1.4",
|
34
|
+
"open-cli": "^8.0.0",
|
35
|
+
"prettier": "3.2.5",
|
36
|
+
"prettier-plugin-packagejson": "^2.5.0",
|
37
|
+
"tsup": "^8.0.2",
|
38
|
+
"typescript": "^5.4.5",
|
39
|
+
"vitest": "^2.0.2"
|
40
|
+
},
|
41
|
+
"peerDependencies": {
|
42
|
+
"@lsby/net-core": "^0.6.0",
|
43
|
+
"@lsby/ts-fp-data": "^0.2.4",
|
44
|
+
"@lsby/ts-kysely": "^0.2.3",
|
45
|
+
"kysely": "^0.27.4",
|
46
|
+
"zod": "3.23.8"
|
47
|
+
},
|
48
|
+
"packageManager": "pnpm@9.5.0"
|
49
|
+
}
|