@codelitdev/platform-cli 0.1.0-alpha.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/LICENSE +21 -0
- package/dist/bin.d.ts +2 -0
- package/dist/bin.js +43 -0
- package/dist/codemod-readme-title.d.ts +5 -0
- package/dist/codemod-readme-title.js +21 -0
- package/dist/create.d.ts +6 -0
- package/dist/create.js +124 -0
- package/dist/doctor.d.ts +12 -0
- package/dist/doctor.js +111 -0
- package/dist/fs.d.ts +5 -0
- package/dist/fs.js +42 -0
- package/dist/git.d.ts +1 -0
- package/dist/git.js +19 -0
- package/dist/hash.d.ts +2 -0
- package/dist/hash.js +8 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +4 -0
- package/dist/manifest.d.ts +12 -0
- package/dist/manifest.js +31 -0
- package/dist/template.d.ts +2 -0
- package/dist/template.js +23 -0
- package/dist/upgrade.d.ts +13 -0
- package/dist/upgrade.js +97 -0
- package/package.json +41 -0
- package/template/.github/workflows/platform-conformance.yml +28 -0
- package/template/README.md +5 -0
- package/template/apps/api/.env.example +18 -0
- package/template/apps/api/README.md +3 -0
- package/template/apps/api/billing.config.ts +25 -0
- package/template/apps/api/drizzle.config.ts +7 -0
- package/template/apps/api/package.json +53 -0
- package/template/apps/api/scripts/generate-auth-schema.mjs +173 -0
- package/template/apps/api/scripts/migrate.mjs +15 -0
- package/template/apps/api/src/app.test.ts +479 -0
- package/template/apps/api/src/auth/api-keys.ts +131 -0
- package/template/apps/api/src/auth/authenticate.ts +166 -0
- package/template/apps/api/src/auth/better-auth.ts +38 -0
- package/template/apps/api/src/auth/oauth.ts +9 -0
- package/template/apps/api/src/auth/options.ts +69 -0
- package/template/apps/api/src/billing.ts +58 -0
- package/template/apps/api/src/conformance-adapter.ts +335 -0
- package/template/apps/api/src/db/migrate.ts +26 -0
- package/template/apps/api/src/db/migrations/0000_application.sql +72 -0
- package/template/apps/api/src/db/migrations/0000_auth.sql +178 -0
- package/template/apps/api/src/db/migrations/0001_billing.sql +234 -0
- package/template/apps/api/src/db/schema/auth.generated.ts +185 -0
- package/template/apps/api/src/db/schema/billing.generated.ts +447 -0
- package/template/apps/api/src/db/schema/index.ts +3 -0
- package/template/apps/api/src/db/schema/notes.ts +31 -0
- package/template/apps/api/src/db/schema/tenants.ts +83 -0
- package/template/apps/api/src/deps.ts +12 -0
- package/template/apps/api/src/dispatch.ts +476 -0
- package/template/apps/api/src/express-app.ts +161 -0
- package/template/apps/api/src/invitations.ts +217 -0
- package/template/apps/api/src/logger.ts +26 -0
- package/template/apps/api/src/main.ts +98 -0
- package/template/apps/api/src/mcp.ts +127 -0
- package/template/apps/api/src/notes.ts +251 -0
- package/template/apps/api/src/openapi.ts +12 -0
- package/template/apps/api/src/permissions.ts +35 -0
- package/template/apps/api/src/runtime.ts +167 -0
- package/template/apps/api/src/seed.ts +340 -0
- package/template/apps/api/src/tenancy.ts +116 -0
- package/template/apps/api/src/types.ts +20 -0
- package/template/apps/api/src/worker.ts +57 -0
- package/template/apps/api/tsconfig.json +14 -0
- package/template/apps/web/.env.example +7 -0
- package/template/apps/web/app/api/[...path]/route.ts +51 -0
- package/template/apps/web/app/globals.css +156 -0
- package/template/apps/web/app/layout.tsx +34 -0
- package/template/apps/web/app/login/page.tsx +127 -0
- package/template/apps/web/app/notes/page.tsx +93 -0
- package/template/apps/web/app/page.tsx +80 -0
- package/template/apps/web/components/auth-gate.tsx +34 -0
- package/template/apps/web/components/browser-observability.tsx +53 -0
- package/template/apps/web/components/tenant-switcher.tsx +51 -0
- package/template/apps/web/lib/observability-config.ts +15 -0
- package/template/apps/web/next-env.d.ts +2 -0
- package/template/apps/web/next.config.ts +7 -0
- package/template/apps/web/package.json +26 -0
- package/template/apps/web/tsconfig.json +21 -0
- package/template/biome.template.json +50 -0
- package/template/docker-compose.yml +14 -0
- package/template/package.json +40 -0
- package/template/packages/api-contract/package.json +23 -0
- package/template/packages/api-contract/src/index.ts +256 -0
- package/template/packages/api-contract/src/mcp-parity.ts +158 -0
- package/template/packages/api-contract/tsconfig.json +11 -0
- package/template/patches/@anatine__zod-openapi@1.14.2.patch +14 -0
- package/template/tooling/platform/config.ts +2 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"lib": ["dom", "dom.iterable", "es2022"],
|
|
5
|
+
"allowJs": false,
|
|
6
|
+
"skipLibCheck": true,
|
|
7
|
+
"strict": true,
|
|
8
|
+
"noEmit": true,
|
|
9
|
+
"esModuleInterop": true,
|
|
10
|
+
"module": "esnext",
|
|
11
|
+
"moduleResolution": "bundler",
|
|
12
|
+
"resolveJsonModule": true,
|
|
13
|
+
"isolatedModules": true,
|
|
14
|
+
"jsx": "preserve",
|
|
15
|
+
"incremental": false,
|
|
16
|
+
"plugins": [{ "name": "next" }],
|
|
17
|
+
"paths": { "@/*": ["./*"] }
|
|
18
|
+
},
|
|
19
|
+
"include": ["**/*.ts", "**/*.tsx"],
|
|
20
|
+
"exclude": ["node_modules"]
|
|
21
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://biomejs.dev/schemas/2.5.12/schema.json",
|
|
3
|
+
"vcs": {
|
|
4
|
+
"enabled": true,
|
|
5
|
+
"clientKind": "git",
|
|
6
|
+
"useIgnoreFile": true
|
|
7
|
+
},
|
|
8
|
+
"files": {
|
|
9
|
+
"includes": [
|
|
10
|
+
"**",
|
|
11
|
+
"!**/.next/**",
|
|
12
|
+
"!**/coverage/**",
|
|
13
|
+
"!**/dist/**",
|
|
14
|
+
"!**/migrations/**",
|
|
15
|
+
"!**/node_modules/**",
|
|
16
|
+
"!**/*.generated.ts"
|
|
17
|
+
]
|
|
18
|
+
},
|
|
19
|
+
"formatter": {
|
|
20
|
+
"enabled": true,
|
|
21
|
+
"indentStyle": "space",
|
|
22
|
+
"lineWidth": 88
|
|
23
|
+
},
|
|
24
|
+
"linter": {
|
|
25
|
+
"enabled": true,
|
|
26
|
+
"rules": {
|
|
27
|
+
"recommended": true,
|
|
28
|
+
"suspicious": {
|
|
29
|
+
"noExplicitAny": "off"
|
|
30
|
+
},
|
|
31
|
+
"style": {
|
|
32
|
+
"noNonNullAssertion": "off"
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"javascript": {
|
|
37
|
+
"formatter": {
|
|
38
|
+
"quoteStyle": "double",
|
|
39
|
+
"jsxQuoteStyle": "double",
|
|
40
|
+
"quoteProperties": "asNeeded",
|
|
41
|
+
"trailingCommas": "all",
|
|
42
|
+
"semicolons": "always"
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"json": {
|
|
46
|
+
"formatter": {
|
|
47
|
+
"trailingCommas": "none"
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
services:
|
|
2
|
+
postgres:
|
|
3
|
+
image: postgres:16-alpine
|
|
4
|
+
environment:
|
|
5
|
+
POSTGRES_USER: __PRODUCT_SLUG__
|
|
6
|
+
POSTGRES_PASSWORD: __PRODUCT_SLUG__
|
|
7
|
+
POSTGRES_DB: __PRODUCT_SLUG__
|
|
8
|
+
ports:
|
|
9
|
+
- "5433:5432"
|
|
10
|
+
healthcheck:
|
|
11
|
+
test: ["CMD-SHELL", "pg_isready -U __PRODUCT_SLUG__ -d __PRODUCT_SLUG__"]
|
|
12
|
+
interval: 5s
|
|
13
|
+
timeout: 5s
|
|
14
|
+
retries: 10
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "__PRODUCT_SLUG__",
|
|
3
|
+
"private": true,
|
|
4
|
+
"version": "0.0.0",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"packageManager": "bun@1.4.1",
|
|
7
|
+
"engines": {
|
|
8
|
+
"bun": ">=1.4.1"
|
|
9
|
+
},
|
|
10
|
+
"workspaces": [
|
|
11
|
+
"apps/*",
|
|
12
|
+
"packages/*"
|
|
13
|
+
],
|
|
14
|
+
"trustedDependencies": [
|
|
15
|
+
"esbuild"
|
|
16
|
+
],
|
|
17
|
+
"overrides": {
|
|
18
|
+
"esbuild": "0.28.2",
|
|
19
|
+
"postcss": "8.5.28",
|
|
20
|
+
"qs": "6.16.0",
|
|
21
|
+
"ts-deepmerge": "8.0.0"
|
|
22
|
+
},
|
|
23
|
+
"patchedDependencies": {
|
|
24
|
+
"@anatine/zod-openapi@1.14.2": "patches/@anatine__zod-openapi@1.14.2.patch"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@biomejs/biome": "2.5.12",
|
|
28
|
+
"@types/bun": "1.4.1"
|
|
29
|
+
},
|
|
30
|
+
"scripts": {
|
|
31
|
+
"lint": "bun run --workspaces --if-present lint",
|
|
32
|
+
"format": "biome format --write .",
|
|
33
|
+
"format:check": "biome ci --linter-enabled=false .",
|
|
34
|
+
"typecheck": "bun run --workspaces --if-present typecheck",
|
|
35
|
+
"test": "bun run --workspaces --if-present test",
|
|
36
|
+
"build": "bun run --workspaces --if-present build",
|
|
37
|
+
"generate:check": "bun run --filter @__PRODUCT_SLUG__/api check:drift",
|
|
38
|
+
"migrate": "bun apps/api/scripts/migrate.mjs"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@__PRODUCT_SLUG__/api-contract",
|
|
3
|
+
"private": true,
|
|
4
|
+
"version": "0.0.0",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": {
|
|
8
|
+
"types": "./src/index.ts",
|
|
9
|
+
"import": "./src/index.ts"
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"scripts": {
|
|
13
|
+
"build": "tsc -p tsconfig.json --noEmit",
|
|
14
|
+
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
15
|
+
},
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"@ts-rest/core": "^3.52.1",
|
|
18
|
+
"zod": "^3.25.76"
|
|
19
|
+
},
|
|
20
|
+
"devDependencies": {
|
|
21
|
+
"typescript": "^5.9.3"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
import { initContract } from "@ts-rest/core";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
|
|
4
|
+
const c = initContract();
|
|
5
|
+
|
|
6
|
+
export const platformErrorSchema = z.object({
|
|
7
|
+
code: z.enum([
|
|
8
|
+
"unauthenticated",
|
|
9
|
+
"credential_ambiguous",
|
|
10
|
+
"tenant_required",
|
|
11
|
+
"tenant_forbidden",
|
|
12
|
+
"forbidden",
|
|
13
|
+
"not_found",
|
|
14
|
+
"conflict",
|
|
15
|
+
"validation_failed",
|
|
16
|
+
"rate_limited",
|
|
17
|
+
"internal_error",
|
|
18
|
+
]),
|
|
19
|
+
message: z.string(),
|
|
20
|
+
details: z
|
|
21
|
+
.record(z.union([z.string(), z.number(), z.boolean(), z.null()]))
|
|
22
|
+
.optional(),
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
export const healthResponseSchema = z.object({
|
|
26
|
+
status: z.literal("ok"),
|
|
27
|
+
service: z.string(),
|
|
28
|
+
time: z.string(),
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
export const readinessResponseSchema = z.object({
|
|
32
|
+
status: z.enum(["ready", "not_ready"]),
|
|
33
|
+
checks: z.record(z.boolean()),
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
export const noteSchema = z.object({
|
|
37
|
+
id: z.string(),
|
|
38
|
+
tenantId: z.string(),
|
|
39
|
+
title: z.string(),
|
|
40
|
+
body: z.string(),
|
|
41
|
+
createdAt: z.string(),
|
|
42
|
+
updatedAt: z.string(),
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
export const createNoteBodySchema = z.object({
|
|
46
|
+
title: z.string().min(1).max(200),
|
|
47
|
+
body: z.string().max(8000).default(""),
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
export const updateNoteBodySchema = z.object({
|
|
51
|
+
title: z.string().min(1).max(200).optional(),
|
|
52
|
+
body: z.string().max(8000).optional(),
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
export const entitlementSchema = z.object({
|
|
56
|
+
tenantId: z.string(),
|
|
57
|
+
activePaidPlan: z.string().nullable(),
|
|
58
|
+
entitled: z.boolean(),
|
|
59
|
+
subscriptionStatus: z.string().nullable(),
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
export const tenantSchema = z.object({
|
|
63
|
+
id: z.string(),
|
|
64
|
+
name: z.string(),
|
|
65
|
+
selected: z.boolean().optional(),
|
|
66
|
+
});
|
|
67
|
+
export const apiKeySchema = z.object({
|
|
68
|
+
id: z.string(),
|
|
69
|
+
publicId: z.string(),
|
|
70
|
+
raw: z.string().optional(),
|
|
71
|
+
expiresAt: z.string().nullable().optional(),
|
|
72
|
+
revokedAt: z.string().nullable().optional(),
|
|
73
|
+
lastUsedAt: z.string().nullable().optional(),
|
|
74
|
+
createdAt: z.string().optional(),
|
|
75
|
+
});
|
|
76
|
+
export const invitationSchema = z.object({
|
|
77
|
+
ok: z.literal(true),
|
|
78
|
+
id: z.string(),
|
|
79
|
+
token: z.string().optional(),
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
export const contract = c.router({
|
|
83
|
+
health: {
|
|
84
|
+
method: "GET",
|
|
85
|
+
path: "/health",
|
|
86
|
+
responses: { 200: healthResponseSchema },
|
|
87
|
+
summary: "Liveness",
|
|
88
|
+
},
|
|
89
|
+
ready: {
|
|
90
|
+
method: "GET",
|
|
91
|
+
path: "/ready",
|
|
92
|
+
responses: { 200: readinessResponseSchema, 503: readinessResponseSchema },
|
|
93
|
+
summary: "Readiness",
|
|
94
|
+
},
|
|
95
|
+
listNotes: {
|
|
96
|
+
method: "GET",
|
|
97
|
+
path: "/v1/notes",
|
|
98
|
+
responses: {
|
|
99
|
+
200: z.object({ items: z.array(noteSchema) }),
|
|
100
|
+
400: platformErrorSchema,
|
|
101
|
+
401: platformErrorSchema,
|
|
102
|
+
403: platformErrorSchema,
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
createNote: {
|
|
106
|
+
method: "POST",
|
|
107
|
+
path: "/v1/notes",
|
|
108
|
+
body: createNoteBodySchema,
|
|
109
|
+
responses: {
|
|
110
|
+
201: noteSchema,
|
|
111
|
+
400: platformErrorSchema,
|
|
112
|
+
401: platformErrorSchema,
|
|
113
|
+
403: platformErrorSchema,
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
updateNote: {
|
|
117
|
+
method: "PATCH",
|
|
118
|
+
path: "/v1/notes/:noteId",
|
|
119
|
+
pathParams: z.object({ noteId: z.string() }),
|
|
120
|
+
body: updateNoteBodySchema,
|
|
121
|
+
responses: {
|
|
122
|
+
200: noteSchema,
|
|
123
|
+
400: platformErrorSchema,
|
|
124
|
+
401: platformErrorSchema,
|
|
125
|
+
403: platformErrorSchema,
|
|
126
|
+
404: platformErrorSchema,
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
deleteNote: {
|
|
130
|
+
method: "DELETE",
|
|
131
|
+
path: "/v1/notes/:noteId",
|
|
132
|
+
pathParams: z.object({ noteId: z.string() }),
|
|
133
|
+
responses: {
|
|
134
|
+
200: z.object({ id: z.string() }),
|
|
135
|
+
400: platformErrorSchema,
|
|
136
|
+
401: platformErrorSchema,
|
|
137
|
+
403: platformErrorSchema,
|
|
138
|
+
404: platformErrorSchema,
|
|
139
|
+
},
|
|
140
|
+
},
|
|
141
|
+
getEntitlement: {
|
|
142
|
+
method: "GET",
|
|
143
|
+
path: "/v1/billing/entitlement",
|
|
144
|
+
responses: {
|
|
145
|
+
200: entitlementSchema,
|
|
146
|
+
400: platformErrorSchema,
|
|
147
|
+
401: platformErrorSchema,
|
|
148
|
+
403: platformErrorSchema,
|
|
149
|
+
},
|
|
150
|
+
},
|
|
151
|
+
listTenants: {
|
|
152
|
+
method: "GET",
|
|
153
|
+
path: "/v1/tenants",
|
|
154
|
+
responses: {
|
|
155
|
+
200: z.object({ items: z.array(tenantSchema) }),
|
|
156
|
+
401: platformErrorSchema,
|
|
157
|
+
403: platformErrorSchema,
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
createTenant: {
|
|
161
|
+
method: "POST",
|
|
162
|
+
path: "/v1/tenants",
|
|
163
|
+
body: z.object({ name: z.string().min(1).max(200) }),
|
|
164
|
+
responses: {
|
|
165
|
+
201: tenantSchema,
|
|
166
|
+
400: platformErrorSchema,
|
|
167
|
+
401: platformErrorSchema,
|
|
168
|
+
},
|
|
169
|
+
},
|
|
170
|
+
selectTenant: {
|
|
171
|
+
method: "POST",
|
|
172
|
+
path: "/api/tenant/select",
|
|
173
|
+
body: z.object({ tenantId: z.string().min(1) }),
|
|
174
|
+
responses: {
|
|
175
|
+
204: z.undefined(),
|
|
176
|
+
400: platformErrorSchema,
|
|
177
|
+
401: platformErrorSchema,
|
|
178
|
+
403: platformErrorSchema,
|
|
179
|
+
},
|
|
180
|
+
},
|
|
181
|
+
listApiKeys: {
|
|
182
|
+
method: "GET",
|
|
183
|
+
path: "/v1/api-keys",
|
|
184
|
+
responses: {
|
|
185
|
+
200: z.object({ items: z.array(apiKeySchema.omit({ raw: true })) }),
|
|
186
|
+
401: platformErrorSchema,
|
|
187
|
+
403: platformErrorSchema,
|
|
188
|
+
},
|
|
189
|
+
},
|
|
190
|
+
createApiKey: {
|
|
191
|
+
method: "POST",
|
|
192
|
+
path: "/v1/api-keys",
|
|
193
|
+
body: z.object({
|
|
194
|
+
permissions: z.array(z.string()).default([]),
|
|
195
|
+
expiresAt: z.string().datetime().optional(),
|
|
196
|
+
}),
|
|
197
|
+
responses: {
|
|
198
|
+
201: apiKeySchema.required({ raw: true }),
|
|
199
|
+
400: platformErrorSchema,
|
|
200
|
+
401: platformErrorSchema,
|
|
201
|
+
403: platformErrorSchema,
|
|
202
|
+
},
|
|
203
|
+
},
|
|
204
|
+
revokeApiKey: {
|
|
205
|
+
method: "DELETE",
|
|
206
|
+
path: "/v1/api-keys/:publicId",
|
|
207
|
+
pathParams: z.object({ publicId: z.string() }),
|
|
208
|
+
responses: {
|
|
209
|
+
204: z.undefined(),
|
|
210
|
+
401: platformErrorSchema,
|
|
211
|
+
403: platformErrorSchema,
|
|
212
|
+
404: platformErrorSchema,
|
|
213
|
+
},
|
|
214
|
+
},
|
|
215
|
+
createInvitation: {
|
|
216
|
+
method: "POST",
|
|
217
|
+
path: "/v1/invitations",
|
|
218
|
+
body: z.object({
|
|
219
|
+
email: z.string().email(),
|
|
220
|
+
role: z.string().min(1),
|
|
221
|
+
permissions: z.array(z.string()).default([]),
|
|
222
|
+
}),
|
|
223
|
+
responses: {
|
|
224
|
+
201: invitationSchema,
|
|
225
|
+
400: platformErrorSchema,
|
|
226
|
+
401: platformErrorSchema,
|
|
227
|
+
403: platformErrorSchema,
|
|
228
|
+
},
|
|
229
|
+
},
|
|
230
|
+
acceptInvitation: {
|
|
231
|
+
method: "POST",
|
|
232
|
+
path: "/v1/invitations/accept",
|
|
233
|
+
body: z.object({ token: z.string().min(1), email: z.string().email() }),
|
|
234
|
+
responses: {
|
|
235
|
+
200: z.object({ ok: z.literal(true), tenantId: z.string() }),
|
|
236
|
+
400: platformErrorSchema,
|
|
237
|
+
401: platformErrorSchema,
|
|
238
|
+
403: platformErrorSchema,
|
|
239
|
+
404: platformErrorSchema,
|
|
240
|
+
},
|
|
241
|
+
},
|
|
242
|
+
revokeInvitation: {
|
|
243
|
+
method: "DELETE",
|
|
244
|
+
path: "/v1/invitations/:invitationId",
|
|
245
|
+
pathParams: z.object({ invitationId: z.string() }),
|
|
246
|
+
responses: {
|
|
247
|
+
204: z.undefined(),
|
|
248
|
+
401: platformErrorSchema,
|
|
249
|
+
403: platformErrorSchema,
|
|
250
|
+
404: platformErrorSchema,
|
|
251
|
+
},
|
|
252
|
+
},
|
|
253
|
+
});
|
|
254
|
+
|
|
255
|
+
export type Contract = typeof contract;
|
|
256
|
+
export { mcpParityManifest } from "./mcp-parity.js";
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
export const mcpParityManifest = [
|
|
2
|
+
{
|
|
3
|
+
capability: "notes.list",
|
|
4
|
+
risk: "read",
|
|
5
|
+
rest: { operationId: "listNotes" },
|
|
6
|
+
mcp: { tool: "notes.list" },
|
|
7
|
+
parity: "required",
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
capability: "notes.create",
|
|
11
|
+
risk: "write",
|
|
12
|
+
rest: { operationId: "createNote" },
|
|
13
|
+
mcp: { tool: "notes.create" },
|
|
14
|
+
parity: "required",
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
capability: "notes.update",
|
|
18
|
+
risk: "write",
|
|
19
|
+
rest: { operationId: "updateNote" },
|
|
20
|
+
mcp: { tool: "notes.update" },
|
|
21
|
+
parity: "required",
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
capability: "notes.delete",
|
|
25
|
+
risk: "destructive",
|
|
26
|
+
rest: { operationId: "deleteNote" },
|
|
27
|
+
mcp: { tool: "notes.delete" },
|
|
28
|
+
parity: "required",
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
capability: "health",
|
|
32
|
+
rest: { operationId: "health" },
|
|
33
|
+
parity: "exempt",
|
|
34
|
+
exemption: {
|
|
35
|
+
reason: "Health is transport-specific and has no MCP tool.",
|
|
36
|
+
owner: "platform",
|
|
37
|
+
reviewBy: "2027-09-01",
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
capability: "ready",
|
|
42
|
+
rest: { operationId: "ready" },
|
|
43
|
+
parity: "exempt",
|
|
44
|
+
exemption: {
|
|
45
|
+
reason: "Readiness is transport-specific and has no MCP tool.",
|
|
46
|
+
owner: "platform",
|
|
47
|
+
reviewBy: "2027-09-01",
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
capability: "billing.entitlement",
|
|
52
|
+
rest: { operationId: "getEntitlement" },
|
|
53
|
+
parity: "exempt",
|
|
54
|
+
exemption: {
|
|
55
|
+
reason: "Billing entitlement remains REST-only in the reference vertical.",
|
|
56
|
+
owner: "platform",
|
|
57
|
+
reviewBy: "2027-09-01",
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
capability: "tenant.list",
|
|
62
|
+
rest: { operationId: "listTenants" },
|
|
63
|
+
parity: "exempt",
|
|
64
|
+
exemption: {
|
|
65
|
+
reason:
|
|
66
|
+
"Tenant administration is account-scoped and REST-only in the reference vertical.",
|
|
67
|
+
owner: "platform",
|
|
68
|
+
reviewBy: "2027-09-01",
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
capability: "tenant.create",
|
|
73
|
+
rest: { operationId: "createTenant" },
|
|
74
|
+
parity: "exempt",
|
|
75
|
+
exemption: {
|
|
76
|
+
reason:
|
|
77
|
+
"Tenant administration is account-scoped and REST-only in the reference vertical.",
|
|
78
|
+
owner: "platform",
|
|
79
|
+
reviewBy: "2027-09-01",
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
capability: "tenant.select",
|
|
84
|
+
rest: { operationId: "selectTenant" },
|
|
85
|
+
parity: "exempt",
|
|
86
|
+
exemption: {
|
|
87
|
+
reason:
|
|
88
|
+
"Tenant selection persists browser account state and has no MCP equivalent.",
|
|
89
|
+
owner: "platform",
|
|
90
|
+
reviewBy: "2027-09-01",
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
capability: "api-key.list",
|
|
95
|
+
rest: { operationId: "listApiKeys" },
|
|
96
|
+
parity: "exempt",
|
|
97
|
+
exemption: {
|
|
98
|
+
reason:
|
|
99
|
+
"Credential administration remains REST-only to avoid exposing secret-management flows over MCP.",
|
|
100
|
+
owner: "platform",
|
|
101
|
+
reviewBy: "2027-09-01",
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
capability: "api-key.create",
|
|
106
|
+
rest: { operationId: "createApiKey" },
|
|
107
|
+
parity: "exempt",
|
|
108
|
+
exemption: {
|
|
109
|
+
reason:
|
|
110
|
+
"Credential administration remains REST-only to avoid exposing secret-management flows over MCP.",
|
|
111
|
+
owner: "platform",
|
|
112
|
+
reviewBy: "2027-09-01",
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
capability: "api-key.revoke",
|
|
117
|
+
rest: { operationId: "revokeApiKey" },
|
|
118
|
+
parity: "exempt",
|
|
119
|
+
exemption: {
|
|
120
|
+
reason:
|
|
121
|
+
"Credential administration remains REST-only to avoid exposing secret-management flows over MCP.",
|
|
122
|
+
owner: "platform",
|
|
123
|
+
reviewBy: "2027-09-01",
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
capability: "invitation.create",
|
|
128
|
+
rest: { operationId: "createInvitation" },
|
|
129
|
+
parity: "exempt",
|
|
130
|
+
exemption: {
|
|
131
|
+
reason:
|
|
132
|
+
"Invitation delivery is a browser and email workflow, not an MCP capability.",
|
|
133
|
+
owner: "platform",
|
|
134
|
+
reviewBy: "2027-09-01",
|
|
135
|
+
},
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
capability: "invitation.accept",
|
|
139
|
+
rest: { operationId: "acceptInvitation" },
|
|
140
|
+
parity: "exempt",
|
|
141
|
+
exemption: {
|
|
142
|
+
reason:
|
|
143
|
+
"Invitation acceptance binds an authenticated browser identity and remains REST-only.",
|
|
144
|
+
owner: "platform",
|
|
145
|
+
reviewBy: "2027-09-01",
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
capability: "invitation.revoke",
|
|
150
|
+
rest: { operationId: "revokeInvitation" },
|
|
151
|
+
parity: "exempt",
|
|
152
|
+
exemption: {
|
|
153
|
+
reason: "Invitation administration remains REST-only in the reference vertical.",
|
|
154
|
+
owner: "platform",
|
|
155
|
+
reviewBy: "2027-09-01",
|
|
156
|
+
},
|
|
157
|
+
},
|
|
158
|
+
] as const;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
diff --git a/src/lib/zod-openapi.js b/src/lib/zod-openapi.js
|
|
2
|
+
index cc71afb4d872b755908f03b9cf441112240405de..20b60b6e9a2f586f4d527eeecfff982909c46428 100644
|
|
3
|
+
--- a/src/lib/zod-openapi.js
|
|
4
|
+
+++ b/src/lib/zod-openapi.js
|
|
5
|
+
@@ -2,6 +2,9 @@
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.generateSchema = exports.extendApi = void 0;
|
|
8
|
+
const ts_deepmerge_1 = require("ts-deepmerge");
|
|
9
|
+
+// ts-deepmerge 8 exposes its CommonJS API as a named `merge` export.
|
|
10
|
+
+// Preserve compatibility with this package's generated default-import calls.
|
|
11
|
+
+ts_deepmerge_1.default ??= ts_deepmerge_1.merge;
|
|
12
|
+
const zod_1 = require("zod");
|
|
13
|
+
function extendApi(schema, SchemaObject = {}) {
|
|
14
|
+
schema.metaOpenApi = Object.assign(schema.metaOpenApi || {}, SchemaObject);
|