@oj-module/cli 0.1.17 → 0.1.20
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/devkit/README.md +11 -10
- package/devkit/SKILL.md +32 -18
- package/devkit/manual.md +318 -131
- package/package.json +2 -2
- package/shell-dist/assets/contract.js +0 -55
- package/shell-dist/assets/runtime.js +206 -212
- package/shell-dist/index.html +2 -2
- package/shell-dist/versions.json +5 -5
- package/src/build.ts +1 -0
- package/src/contract/__tests__/check-api.test.ts +74 -0
- package/src/contract/__tests__/emit-client.test.ts +132 -0
- package/src/contract/__tests__/emit-jsonschema-zod.test.ts +93 -0
- package/src/contract/__tests__/mock.test.ts +56 -0
- package/src/contract/__tests__/openapi-ir.test.ts +137 -0
- package/src/contract/__tests__/run-api.test.ts +67 -0
- package/src/contract/check.ts +67 -294
- package/src/contract/emit-client.ts +23 -15
- package/src/contract/emit-jsonschema-zod.ts +209 -0
- package/src/contract/emit-oj-schema.ts +108 -161
- package/src/contract/emit-stub.ts +17 -57
- package/src/contract/handler-scan.ts +263 -0
- package/src/contract/ir.ts +11 -179
- package/src/contract/json-schema-sample.ts +72 -0
- package/src/contract/mock.ts +28 -100
- package/src/contract/openapi-ir.ts +145 -0
- package/src/contract/run.ts +71 -120
- package/src/dev.ts +20 -18
- package/src/init.ts +18 -3
- package/src/oj.ts +6 -2
- package/src/vendor.ts +8 -4
- package/templates/api/config.yaml +1 -0
- package/templates/api/src/auth/api.ts +66 -0
- package/templates/api/src/notification/_shared/notify.ts +199 -0
- package/templates/api/src/notification/api.ts +231 -0
- package/templates/api/src/notification/del/api.ts +47 -0
- package/templates/api/src/notification/manifest.yaml +3 -1
- package/templates/api/src/notification/migrations/0001__create_notifications.sql +1 -1
- package/templates/api/src/notification/migrations/0002__notifications_user.sql +9 -0
- package/templates/api/src/notification/migrations/0003__notifications_broadcast.sql +22 -0
- package/templates/api/src/notification/schema.yaml +23 -1
- package/templates/api/src/notification/seed.sql +6 -4
- package/templates/api/src/personal-center/upload/api.ts +12 -1
- package/templates/env.d.ts +1 -1
- package/templates/openapi.json +471 -0
- package/templates/web/src/auth/__client/api.schemas.ts +8 -0
- package/templates/web/src/auth/__client/api.ts +110 -0
- package/templates/web/src/notification/__client/api.schemas.ts +50 -0
- package/templates/web/src/notification/{client → __client}/api.ts +29 -29
- package/templates/web/src/notification/entry.ts +11 -9
- package/templates/web/src/notifications/__client/api.schemas.ts +8 -0
- package/templates/web/src/notifications/__client/api.ts +80 -0
- package/templates/web/src/personal-center/__client/api.schemas.ts +10 -0
- package/templates/web/src/personal-center/__client/api.ts +88 -0
- package/templates/web/src/web/__client/api.schemas.ts +8 -0
- package/templates/web/src/web/__client/api.ts +110 -0
- package/vendor/host-versions.json +5 -5
- package/src/contract/emit-meta.ts +0 -175
- package/src/contract/emit-schema.ts +0 -133
- package/src/contract/evaluate.ts +0 -88
- package/templates/api/src/auth/login/api.ts +0 -27
- package/templates/api/src/auth/logout/api.ts +0 -10
- package/templates/api/src/auth/refresh/api.ts +0 -26
- package/templates/api/src/notification/contract.ts +0 -98
- package/templates/api/src/notification/notifications/api.ts +0 -24
- package/templates/api/src/notification/notifications/clear/api.ts +0 -13
- package/templates/api/src/notification/notifications/read/api.ts +0 -19
- package/templates/api/src/notification/notifications/read-all/api.ts +0 -13
- package/templates/api/src/personal-center/contract.ts +0 -16
- package/templates/web/src/notification/client/api.schemas.ts +0 -50
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
// 生成物:ojm api 从契约生成,勿手改(改动请改契约文件后重跑 ojm api)
|
|
3
|
-
// AC-D15:仅供 DEV 校验动态 import,生产构建不进产物
|
|
4
|
-
import { z } from "@oj-module/runtime";
|
|
5
|
-
|
|
6
|
-
export const schemas = {
|
|
7
|
-
del: {
|
|
8
|
-
body: z.object({
|
|
9
|
-
id: z.string(),
|
|
10
|
-
userId: z.union([z.string(), z.number()]).optional(),
|
|
11
|
-
}),
|
|
12
|
-
},
|
|
13
|
-
fetchNotifications: {
|
|
14
|
-
data: z.array(z.object({
|
|
15
|
-
id: z.string(),
|
|
16
|
-
scope: z.enum(["user","broadcast"]),
|
|
17
|
-
avatar: z.string(),
|
|
18
|
-
date: z.string(),
|
|
19
|
-
isRead: z.boolean().optional(),
|
|
20
|
-
message: z.string(),
|
|
21
|
-
title: z.string(),
|
|
22
|
-
link: z.string().nullable().optional(),
|
|
23
|
-
category: z.enum(["notice","pm","mention"]).optional(),
|
|
24
|
-
})),
|
|
25
|
-
},
|
|
26
|
-
markRead: {
|
|
27
|
-
body: z.object({
|
|
28
|
-
id: z.string(),
|
|
29
|
-
}),
|
|
30
|
-
},
|
|
31
|
-
push: {
|
|
32
|
-
body: z.object({
|
|
33
|
-
userId: z.union([z.string(), z.number()]).optional(),
|
|
34
|
-
title: z.string(),
|
|
35
|
-
message: z.string(),
|
|
36
|
-
link: z.string().optional(),
|
|
37
|
-
avatar: z.string().optional(),
|
|
38
|
-
category: z.enum(["notice","pm","mention"]).optional(),
|
|
39
|
-
}),
|
|
40
|
-
},
|
|
41
|
-
pushBroadcast: {
|
|
42
|
-
body: z.object({
|
|
43
|
-
title: z.string(),
|
|
44
|
-
message: z.string(),
|
|
45
|
-
link: z.string().optional(),
|
|
46
|
-
avatar: z.string().optional(),
|
|
47
|
-
category: z.enum(["notice","pm","mention"]).optional(),
|
|
48
|
-
}),
|
|
49
|
-
},
|
|
50
|
-
};
|