@scalar/cli 2.7.1 → 2.10.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/README.md +475 -80
- package/chunks/action-4GZI2M5B.js +62 -0
- package/chunks/action-4W5GUGEG.js +63 -0
- package/chunks/{action-HJYZCPUN.js → action-5LF4XYHX.js} +10 -7
- package/chunks/{action-SRBN7N3R.js → action-5N3P43MD.js} +17 -12
- package/chunks/{action-RBOLLIGX.js → action-5RL4NWUZ.js} +17 -17
- package/chunks/{action-SNPOOW6S.js → action-657A4K2D.js} +16 -16
- package/chunks/{action-EOAVVL52.js → action-7XOHYWYM.js} +11 -14
- package/chunks/{action-AQRPFQKI.js → action-CABLS46Q.js} +9 -7
- package/chunks/{action-F7A2K74G.js → action-CB55NWAU.js} +9 -13
- package/chunks/{action-5SK5NE7E.js → action-DKDRAIKV.js} +11 -14
- package/chunks/{action-7PEQXDWT.js → action-DTEO4YNX.js} +127 -20
- package/chunks/{action-BAQYJ6UE.js → action-EAUTQ77U.js} +27 -23
- package/chunks/{action-QYGOPSTY.js → action-FBRY5JKU.js} +16 -16
- package/chunks/{action-VOFDW3U2.js → action-GFLRD7LO.js} +6 -5
- package/chunks/{action-LPVITMWA.js → action-GWYYTUTM.js} +4 -3
- package/chunks/{action-4NGK5XMD.js → action-HT42NUUX.js} +29 -24
- package/chunks/action-JEYDBB3P.js +147 -0
- package/chunks/{action-E4YSRFGT.js → action-KDUFU7TZ.js} +11 -13
- package/chunks/{action-BRSSC2SR.js → action-LYCNT3KA.js} +29 -10
- package/chunks/{action-CA4QYPI6.js → action-OJ2NK25F.js} +4 -8
- package/chunks/{action-NVI5DWFP.js → action-PAM2EZ22.js} +4 -8
- package/chunks/action-PPTFYZWD.js +1552 -0
- package/chunks/{action-OX2566BE.js → action-R4PGILN4.js} +30 -26
- package/chunks/{action-CPLH2CQ5.js → action-TOBU74JH.js} +23 -19
- package/chunks/action-U2L5DCFG.js +91 -0
- package/chunks/{action-H6OUJWWM.js → action-UUL6SWV4.js} +11 -14
- package/chunks/{action-T5XMJXPO.js → action-X7BA7PQQ.js} +10 -8
- package/chunks/{action-LVDU6YOI.js → action-XLE37MZL.js} +16 -16
- package/chunks/{action-BOZNBCNZ.js → action-XOADBXSX.js} +16 -12
- package/chunks/{action-SCOXTCPR.js → action-YSVTZVKV.js} +38 -19
- package/chunks/{action-YRX6SN5F.js → action-ZFI77WA5.js} +8 -6
- package/chunks/{action-ATGZOWSH.js → action-ZKA3RR3S.js} +15 -11
- package/chunks/actions-3SAMH7A5.js +182 -0
- package/chunks/{agent-ASPV3R5U.js → agent-2ESZI7NO.js} +7 -5
- package/chunks/{asyncapi-H4FU6GPC.js → asyncapi-4HGVM3PR.js} +14 -10
- package/chunks/{build.action-6V6GXI3X.js → build.action-VBGFGACM.js} +21 -19
- package/chunks/chunk-35Z7VTJT.js +453 -0
- package/chunks/chunk-36LXIJIZ.js +52 -0
- package/chunks/{chunk-BIKOD3SG.js → chunk-43WALAW3.js} +251 -103
- package/chunks/{chunk-C2KAWRIX.js → chunk-5ENKYZA4.js} +1 -1
- package/chunks/{chunk-ZJVYOZFB.js → chunk-5SMP756H.js} +2 -2
- package/chunks/{chunk-5JLVQVKO.js → chunk-6M7TL2G2.js} +146 -148
- package/chunks/chunk-6PSYZO3U.js +24 -0
- package/chunks/{chunk-ISXH6Q7I.js → chunk-ATNTXKMS.js} +45 -274
- package/chunks/{chunk-BDEPNGTO.js → chunk-BIMLCGKS.js} +1 -1
- package/chunks/{chunk-HGOD6THU.js → chunk-CWVYOXXM.js} +2 -19
- package/chunks/chunk-DFOZG7ZV.js +15 -0
- package/chunks/chunk-DHZW7Q7U.js +133 -0
- package/chunks/{chunk-R5LK6VPY.js → chunk-G4HRW2FZ.js} +13 -20
- package/chunks/{chunk-KCCFN4F7.js → chunk-GLWTVLKM.js} +29 -29
- package/chunks/{chunk-5UHLAJQD.js → chunk-GYRQPDTK.js} +24 -10
- package/chunks/chunk-H467HDVV.js +24 -0
- package/chunks/chunk-IPZP3VRA.js +327 -0
- package/chunks/{chunk-LG7IFACX.js → chunk-JXGF5EHC.js} +152 -18
- package/chunks/chunk-K2HIB5BA.js +92 -0
- package/chunks/{chunk-FDC2IESH.js → chunk-KHF2QXBG.js} +1352 -8327
- package/chunks/{chunk-IMG35UXX.js → chunk-KZNRQVMY.js} +1 -1
- package/chunks/{chunk-OJ2EWIJH.js → chunk-MC4EMNOR.js} +5 -1
- package/chunks/{chunk-YILQODZF.js → chunk-MMWSCTDB.js} +7 -4
- package/chunks/{chunk-6XWCMJDB.js → chunk-MNNGUUKJ.js} +12 -11
- package/chunks/chunk-NAC63XJF.js +10 -0
- package/chunks/{chunk-XXSQUBXS.js → chunk-UDBSV3CK.js} +107 -453
- package/chunks/{chunk-IKT5F47M.js → chunk-VVRUSQCY.js} +11 -11
- package/chunks/{chunk-2PPRO2QB.js → chunk-VYFGRLVQ.js} +1 -1
- package/chunks/{chunk-GPNB7ISG.js → chunk-WB6PWTMU.js} +5 -13
- package/chunks/{chunk-4X47MN6Q.js → chunk-WDIWLXLV.js} +3 -15
- package/chunks/{chunk-6YPQGVF4.js → chunk-WIEXQUTD.js} +1 -1
- package/chunks/{chunk-W24BETFG.js → chunk-XAGJJNQW.js} +3 -3
- package/chunks/{chunk-2DSVF5AD.js → chunk-ZGNDXPLU.js} +3 -3
- package/chunks/{chunk-XEDGMZJD.js → chunk-ZGVZU6L2.js} +81 -25
- package/chunks/{chunk-QXQZVEDC.js → chunk-ZKJPLWRJ.js} +2 -2
- package/chunks/{chunk-MLSZVVTT.js → chunk-ZYBLQ5CT.js} +13 -7
- package/chunks/{create.action-P6DLCK4W.js → create.action-DBNIS665.js} +21 -19
- package/chunks/{delete.action-HJKRRHE2.js → delete.action-GBOZC45K.js} +21 -19
- package/chunks/{delete.action-Z3GAA4ZN.js → delete.action-K7BLK7DK.js} +21 -19
- package/chunks/{get.action-IT4EHAV4.js → get.action-N3JOY3OU.js} +17 -12
- package/chunks/get.action-QHKMYZBK.js +91 -0
- package/chunks/{list.action-WLIAO5UW.js → list.action-6SSO3JVN.js} +45 -15
- package/chunks/{list.action-2FU5UZNH.js → list.action-TJCS6UEY.js} +41 -21
- package/chunks/{publish.action-T4J4DRXR.js → publish.action-T24VHRMR.js} +29 -24
- package/chunks/query-WKATAJJ6.js +129 -0
- package/chunks/scripts-VIBLGKYG.js +102 -0
- package/chunks/{update.action-3OVS3HWC.js → update.action-OGYNBXRU.js} +24 -19
- package/chunks/{update.action-MY7QPSSU.js → update.action-VOE6PH5F.js} +24 -19
- package/docs.html +1363 -320
- package/index.js +417 -174
- package/package.json +14 -13
- package/skills/scalar-cli/SKILL.md +13 -1
- package/template.md +157 -15
- package/chunks/action-JAHFRYWZ.js +0 -423
- package/chunks/action-N7BA5I3E.js +0 -229
- package/chunks/chunk-CWCETP6H.js +0 -610
- package/chunks/chunk-K74E42RV.js +0 -7311
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { createRequire as $$cR } from "node:module"; const require = $$cR(import.meta.url);
|
|
2
|
+
|
|
3
|
+
// package.json
|
|
4
|
+
var name = "@scalar/cli";
|
|
5
|
+
var version = "2.10.0";
|
|
6
|
+
var bin = {
|
|
7
|
+
scalar: "./dist/index.js",
|
|
8
|
+
"scalar-cli": "./dist/index.js"
|
|
9
|
+
};
|
|
10
|
+
var package_default = {
|
|
11
|
+
name,
|
|
12
|
+
description: "A command-line interface to work with OpenAPI files",
|
|
13
|
+
keywords: [
|
|
14
|
+
"scalar",
|
|
15
|
+
"openapi",
|
|
16
|
+
"swagger",
|
|
17
|
+
"cli"
|
|
18
|
+
],
|
|
19
|
+
version,
|
|
20
|
+
author: "Copyright API Documentation Inc. 2026",
|
|
21
|
+
license: "UNLICENSED",
|
|
22
|
+
private: true,
|
|
23
|
+
engines: {
|
|
24
|
+
node: ">=24"
|
|
25
|
+
},
|
|
26
|
+
scripts: {
|
|
27
|
+
build: "tsx esbuild.ts",
|
|
28
|
+
"cli:link": "pnpm run build && npm unlink -g @scalar/cli && npm link",
|
|
29
|
+
dev: "pnpm build && dotenv -o -- pnpm start",
|
|
30
|
+
"generate:docs": "pnpm build && pnpm start readme generate --output README.md",
|
|
31
|
+
"package:portable": "tsx portable/build.ts",
|
|
32
|
+
start: "node dist-tar-unpack/index.js",
|
|
33
|
+
"test:cli": "NODE_ENV=INTEGRATION dotenv -o -- vitest --config test/vitest.config.ts test/**",
|
|
34
|
+
"test:portable": "vitest run --config portable/vitest.config.ts",
|
|
35
|
+
"test:unit": "vitest src portable",
|
|
36
|
+
"types:check": "tsc --noEmit"
|
|
37
|
+
},
|
|
38
|
+
type: "module",
|
|
39
|
+
exports: {
|
|
40
|
+
".": {
|
|
41
|
+
import: "./dist/index.js",
|
|
42
|
+
types: "./dist/index.d.ts",
|
|
43
|
+
default: "./dist/index.js"
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
files: [
|
|
47
|
+
"dist"
|
|
48
|
+
],
|
|
49
|
+
homepage: "https://github.com/scalar/scalar",
|
|
50
|
+
bugs: "https://github.com/scalar/scalar/issues/new/choose",
|
|
51
|
+
repository: {
|
|
52
|
+
type: "git",
|
|
53
|
+
url: "git+https://github.com/scalar/scalar.git",
|
|
54
|
+
directory: "projects/cli"
|
|
55
|
+
},
|
|
56
|
+
bin,
|
|
57
|
+
dependencies: {
|
|
58
|
+
"@clack/prompts": "catalog:*",
|
|
59
|
+
"@hono/node-server": "catalog:*",
|
|
60
|
+
"@quobix/vacuum": "catalog:*",
|
|
61
|
+
"@scalar-org/api-document-lint": "workspace:*",
|
|
62
|
+
"@scalar-org/css": "workspace:*",
|
|
63
|
+
"@scalar-org/entities": "workspace:*",
|
|
64
|
+
"@scalar-org/guide-render": "workspace:*",
|
|
65
|
+
"@scalar-org/helpers": "workspace:*",
|
|
66
|
+
"@scalar-org/mongobase-client": "workspace:*",
|
|
67
|
+
"@scalar-org/oauth": "workspace:*",
|
|
68
|
+
"@scalar-org/scalar-config": "workspace:*",
|
|
69
|
+
"@scalar-org/service-api": "workspace:*",
|
|
70
|
+
"@scalar-org/tokens": "workspace:*",
|
|
71
|
+
"@scalar-org/urls": "workspace:*",
|
|
72
|
+
"@scalar/asyncapi-upgrader": "catalog:scalar",
|
|
73
|
+
"@scalar/asyncapi-validator": "catalog:scalar",
|
|
74
|
+
"@scalar/json-magic": "catalog:scalar",
|
|
75
|
+
"@scalar/mock-server": "catalog:scalar",
|
|
76
|
+
"@scalar/openapi-to-markdown": "catalog:scalar",
|
|
77
|
+
"@scalar/openapi-upgrader": "catalog:scalar",
|
|
78
|
+
"@scalar/openapi-validator": "catalog:scalar",
|
|
79
|
+
"@scalar/postman-to-openapi": "catalog:scalar",
|
|
80
|
+
"@scalar/void-server": "catalog:scalar",
|
|
81
|
+
"@scalar/workspace-store": "catalog:scalar",
|
|
82
|
+
"@stoplight/spectral-core": "catalog:*",
|
|
83
|
+
"@stoplight/spectral-parsers": "catalog:*",
|
|
84
|
+
"@stoplight/spectral-ruleset-bundler": "catalog:*",
|
|
85
|
+
"@stoplight/spectral-rulesets": "catalog:*",
|
|
86
|
+
ansis: "catalog:*",
|
|
87
|
+
chokidar: "catalog:*",
|
|
88
|
+
commander: "catalog:*",
|
|
89
|
+
"console-table-printer": "catalog:*",
|
|
90
|
+
"get-port": "catalog:*",
|
|
91
|
+
hono: "catalog:*",
|
|
92
|
+
ignore: "catalog:*",
|
|
93
|
+
"jsonc-parser": "catalog:*",
|
|
94
|
+
nanoid: "catalog:*",
|
|
95
|
+
neverpanic: "catalog:*",
|
|
96
|
+
prettyjson: "catalog:*",
|
|
97
|
+
semver: "catalog:*",
|
|
98
|
+
"stdout-update": "catalog:*",
|
|
99
|
+
"tar-fs": "catalog:*",
|
|
100
|
+
undici: "catalog:*",
|
|
101
|
+
yaml: "catalog:*"
|
|
102
|
+
},
|
|
103
|
+
devDependencies: {
|
|
104
|
+
"@fastify/static": "catalog:*",
|
|
105
|
+
"@scalar-org/api-framework": "workspace:*",
|
|
106
|
+
"@scalar-org/mongobase": "workspace:*",
|
|
107
|
+
"@scalar-org/random-slug": "workspace:*",
|
|
108
|
+
"@scalar-org/ssg-docs": "workspace:*",
|
|
109
|
+
"@scalar-org/test-helpers": "workspace:*",
|
|
110
|
+
"@scalar/galaxy": "catalog:scalar",
|
|
111
|
+
"@scalar/helpers": "catalog:scalar",
|
|
112
|
+
"@scalar/openapi-types": "catalog:scalar",
|
|
113
|
+
"@scalar/themes": "catalog:scalar",
|
|
114
|
+
"@types/node": "catalog:*",
|
|
115
|
+
"@types/prettyjson": "catalog:*",
|
|
116
|
+
"@types/semver": "catalog:*",
|
|
117
|
+
"@types/tar-fs": "catalog:*",
|
|
118
|
+
esbuild: "catalog:*",
|
|
119
|
+
fastify: "catalog:*",
|
|
120
|
+
"remark-gfm": "catalog:*",
|
|
121
|
+
"remark-parse": "catalog:*",
|
|
122
|
+
"strip-ansi": "catalog:*",
|
|
123
|
+
unified: "catalog:*",
|
|
124
|
+
vite: "catalog:*"
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
export {
|
|
129
|
+
name,
|
|
130
|
+
version,
|
|
131
|
+
bin,
|
|
132
|
+
package_default
|
|
133
|
+
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createRequire as $$cR } from "node:module"; const require = $$cR(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
billingPlanSchema
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-GYRQPDTK.js";
|
|
5
5
|
import {
|
|
6
6
|
sharedProjectSchema
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-6M7TL2G2.js";
|
|
8
8
|
import {
|
|
9
9
|
SCALAR_AGENT_KEY_HEADER,
|
|
10
10
|
agentDocsProjectSchema,
|
|
@@ -21,13 +21,13 @@ import {
|
|
|
21
21
|
mcpServerToolModes,
|
|
22
22
|
mcpServerVersionSchema,
|
|
23
23
|
monthlyUsageSchema
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-ZGVZU6L2.js";
|
|
25
25
|
import {
|
|
26
26
|
external_exports,
|
|
27
27
|
namespaceSchema,
|
|
28
28
|
nanoidSchema,
|
|
29
29
|
slugSchema
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-VVRUSQCY.js";
|
|
31
31
|
|
|
32
32
|
// ../../packages/entities/dist/api/agent/shared.js
|
|
33
33
|
var agentApiErrorSchema = external_exports.object({
|
|
@@ -252,7 +252,8 @@ var DASHBOARD_EDITOR_TOOL_NAMES = /* @__PURE__ */ new Set([
|
|
|
252
252
|
"get_current_file",
|
|
253
253
|
"validate_openapi",
|
|
254
254
|
"summarize_openapi",
|
|
255
|
-
"validate_config"
|
|
255
|
+
"validate_config",
|
|
256
|
+
"render_og_card"
|
|
256
257
|
]);
|
|
257
258
|
var DASHBOARD_SDK_TOOL_NAMES = /* @__PURE__ */ new Set([
|
|
258
259
|
"get_sdk_config",
|
|
@@ -260,6 +261,7 @@ var DASHBOARD_SDK_TOOL_NAMES = /* @__PURE__ */ new Set([
|
|
|
260
261
|
]);
|
|
261
262
|
var DASHBOARD_SDK_CONTEXT_KEY = "sdk-studio";
|
|
262
263
|
var DASHBOARD_EDITOR_CONTEXT_KEY = "docs-editor";
|
|
264
|
+
var DASHBOARD_MCP_INSTALLATION_CONTEXT_KEY = "mcp-installation";
|
|
263
265
|
var DASHBOARD_CHAT_CONTEXT_MAX_CHARS = 12e4;
|
|
264
266
|
var DASHBOARD_CHAT_MAX_MESSAGES = 400;
|
|
265
267
|
var dashboardChatSettingsSchema = external_exports.object({
|
|
@@ -605,7 +607,9 @@ var mcpInstallationRoutes = {
|
|
|
605
607
|
body: external_exports.object({
|
|
606
608
|
name: external_exports.string().min(1).max(100),
|
|
607
609
|
slug: slugSchema.optional(),
|
|
608
|
-
documentAuth: external_exports.record(external_exports.string(), external_exports.unknown())
|
|
610
|
+
documentAuth: external_exports.record(external_exports.string(), external_exports.unknown()),
|
|
611
|
+
/** Private when omitted; the dashboard sends false for Production. */
|
|
612
|
+
isPrivate: external_exports.boolean().optional()
|
|
609
613
|
}),
|
|
610
614
|
response: mcpInstallationSchema,
|
|
611
615
|
responses: { 400: agentApiErrorSchema },
|
|
@@ -675,19 +679,6 @@ var mcpInstallationRoutes = {
|
|
|
675
679
|
requestBodyDescription: "JSON-RPC request handled by the MCP Streamable HTTP transport.",
|
|
676
680
|
summary: "Public MCP endpoint (JSON-RPC over Streamable HTTP)"
|
|
677
681
|
},
|
|
678
|
-
installationChat: {
|
|
679
|
-
method: "POST",
|
|
680
|
-
path: (p) => `/mcp/installations/${p.installationId}/chat`,
|
|
681
|
-
params: external_exports.object({ installationId: external_exports.uuid() }),
|
|
682
|
-
body: external_exports.object({
|
|
683
|
-
id: external_exports.string(),
|
|
684
|
-
messages: external_exports.any().array(),
|
|
685
|
-
system: external_exports.string().max(1e4).optional()
|
|
686
|
-
}),
|
|
687
|
-
responses: { 400: agentApiErrorSchema, 404: agentApiErrorSchema },
|
|
688
|
-
responseMediaType: "text/event-stream",
|
|
689
|
-
summary: "Chat with an MCP installation"
|
|
690
|
-
},
|
|
691
682
|
installationTools: {
|
|
692
683
|
method: "GET",
|
|
693
684
|
path: (p) => `/mcp/installations/${p.installationId}/tools`,
|
|
@@ -794,7 +785,8 @@ var mcpServerRoutes = {
|
|
|
794
785
|
name: external_exports.string().min(1).max(100),
|
|
795
786
|
slug: slugSchema,
|
|
796
787
|
versionUid: external_exports.string(),
|
|
797
|
-
|
|
788
|
+
/** Defaults to Production, the environment the bare address serves. */
|
|
789
|
+
installationName: external_exports.string().min(1).max(100).optional(),
|
|
798
790
|
installationSlug: slugSchema.optional(),
|
|
799
791
|
documentAuth: external_exports.record(external_exports.string(), external_exports.unknown()),
|
|
800
792
|
toolMode: external_exports.enum(mcpServerToolModes).optional()
|
|
@@ -1757,6 +1749,7 @@ export {
|
|
|
1757
1749
|
DASHBOARD_SDK_TOOL_NAMES,
|
|
1758
1750
|
DASHBOARD_SDK_CONTEXT_KEY,
|
|
1759
1751
|
DASHBOARD_EDITOR_CONTEXT_KEY,
|
|
1752
|
+
DASHBOARD_MCP_INSTALLATION_CONTEXT_KEY,
|
|
1760
1753
|
DASHBOARD_CHAT_CONTEXT_MAX_CHARS,
|
|
1761
1754
|
DASHBOARD_CHAT_MAX_MESSAGES,
|
|
1762
1755
|
dashboardChatSettingsSchema,
|
|
@@ -2,18 +2,14 @@ import { createRequire as $$cR } from "node:module"; const require = $$cR(import
|
|
|
2
2
|
import {
|
|
3
3
|
baseRegistrySchema,
|
|
4
4
|
docVersionToolSchema
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import {
|
|
7
|
-
HTTP_METHODS
|
|
8
|
-
} from "./chunk-XEDGMZJD.js";
|
|
5
|
+
} from "./chunk-MNNGUUKJ.js";
|
|
9
6
|
import {
|
|
10
7
|
brandedUid,
|
|
11
|
-
compareVersionsDesc,
|
|
12
8
|
docVersionSchema,
|
|
13
9
|
external_exports,
|
|
14
10
|
mintUid,
|
|
15
11
|
nanoidSchema
|
|
16
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-VVRUSQCY.js";
|
|
17
13
|
|
|
18
14
|
// ../../packages/entities/dist/rule/default-data.js
|
|
19
15
|
var scalarRuleset = `extends: spectral:oas
|
|
@@ -47,38 +43,46 @@ var ApiEmbedStatus;
|
|
|
47
43
|
})(ApiEmbedStatus || (ApiEmbedStatus = {}));
|
|
48
44
|
var managedDocTool = docVersionToolSchema;
|
|
49
45
|
var managedDocVersionSchema = external_exports.object({
|
|
50
|
-
uid: nanoidSchema,
|
|
46
|
+
uid: nanoidSchema.meta({ examples: ["UakgbKJ5m9gl0JDMbcJqL"] }),
|
|
51
47
|
/** Millisecond base timestamp of versions */
|
|
52
|
-
createdAt: external_exports.number(),
|
|
53
|
-
version: docVersionSchema,
|
|
48
|
+
createdAt: external_exports.number().meta({ examples: [17356896e5] }),
|
|
49
|
+
version: docVersionSchema.meta({ examples: ["1.2.0"] }),
|
|
54
50
|
/** OpenAPI version normalized on upload */
|
|
55
|
-
upgraded: external_exports.boolean().default(false),
|
|
51
|
+
upgraded: external_exports.boolean().default(false).meta({ examples: [false] }),
|
|
56
52
|
/** Endpoints (path + method pairs) counted at ingest; null when unknown */
|
|
57
|
-
endpointCount: external_exports.number().int().nullable().default(null),
|
|
53
|
+
endpointCount: external_exports.number().int().nullable().default(null).meta({ examples: [12] }),
|
|
58
54
|
/** Vector embeddings processed, agent is enabled */
|
|
59
|
-
embedStatus: external_exports.enum(ApiEmbedStatus).nullable().default(null),
|
|
60
|
-
tags: external_exports.string().array().default([]),
|
|
55
|
+
embedStatus: external_exports.enum(ApiEmbedStatus).nullable().default(null).meta({ examples: ["complete"] }),
|
|
56
|
+
tags: external_exports.string().array().default([]).meta({ examples: [["products", "orders"]] }),
|
|
61
57
|
tools: managedDocTool.array().optional(),
|
|
62
58
|
/** SHA-256 hex digest of the YAML content the version serves (from its chain head) */
|
|
63
|
-
yamlSha: external_exports.string().optional()
|
|
59
|
+
yamlSha: external_exports.string().optional().meta({
|
|
60
|
+
examples: [
|
|
61
|
+
"abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789"
|
|
62
|
+
]
|
|
63
|
+
}),
|
|
64
64
|
/** SHA-256 hex digest of the JSON content the version serves (from its chain head) */
|
|
65
|
-
jsonSha: external_exports.string().optional()
|
|
65
|
+
jsonSha: external_exports.string().optional().meta({
|
|
66
|
+
examples: [
|
|
67
|
+
"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
|
|
68
|
+
]
|
|
69
|
+
})
|
|
66
70
|
}).meta({ id: "managed-doc-version" });
|
|
67
71
|
var managedDocTypeSchema = external_exports.enum(["openapi", "asyncapi"]);
|
|
68
72
|
var managedDocSchema = baseRegistrySchema.extend({
|
|
69
73
|
/** Own uid, branded so it cannot be confused with another entity's uid */
|
|
70
|
-
uid: brandedUid().default(mintUid).meta({ default:
|
|
74
|
+
uid: brandedUid().default(mintUid).meta({ default: void 0 }),
|
|
71
75
|
/** The current version served to consumers by default */
|
|
72
|
-
version: docVersionSchema,
|
|
76
|
+
version: docVersionSchema.meta({ examples: ["1.2.0"] }),
|
|
73
77
|
/**
|
|
74
78
|
* Whether the document is an OpenAPI or AsyncAPI description, detected from
|
|
75
79
|
* the document content on upload. Defaults to 'openapi' so records created
|
|
76
80
|
* before this field existed parse as OpenAPI, matching the registry's
|
|
77
81
|
* original OpenAPI-only behavior.
|
|
78
82
|
*/
|
|
79
|
-
type: managedDocTypeSchema.default("openapi"),
|
|
83
|
+
type: managedDocTypeSchema.default("openapi").meta({ examples: ["openapi"] }),
|
|
80
84
|
/** Initial upload format, used as the editor default. Absent on older APIs. */
|
|
81
|
-
sourceFormat: external_exports.enum(["json", "yaml"]).optional(),
|
|
85
|
+
sourceFormat: external_exports.enum(["json", "yaml"]).optional().meta({ examples: ["yaml"] }),
|
|
82
86
|
/**
|
|
83
87
|
* Denormalized highest-ranked version label, maintained at ingest so
|
|
84
88
|
* `latest` resolution and list views never re-sort the versions collection.
|
|
@@ -107,7 +111,7 @@ var managedDocSchema = baseRegistrySchema.extend({
|
|
|
107
111
|
*/
|
|
108
112
|
sourceUrl: external_exports.url().optional(),
|
|
109
113
|
/** Theme assigned to API, supports custom theme slugs */
|
|
110
|
-
theme: external_exports.string().default(""),
|
|
114
|
+
theme: external_exports.string().default("").meta({ examples: ["default"] }),
|
|
111
115
|
/**
|
|
112
116
|
* @deprecated The collaborative YJS doc it pointed at was never built —
|
|
113
117
|
* no consumer exists anywhere. Dropped at decommission.
|
|
@@ -115,7 +119,7 @@ var managedDocSchema = baseRegistrySchema.extend({
|
|
|
115
119
|
editableUid: external_exports.string(),
|
|
116
120
|
ruleset: external_exports.string().default(scalarRuleset),
|
|
117
121
|
/** Enable Agent Scalar */
|
|
118
|
-
agentEnabled: external_exports.boolean().default(true),
|
|
122
|
+
agentEnabled: external_exports.boolean().default(true).meta({ examples: [true] }),
|
|
119
123
|
/**
|
|
120
124
|
* Scalar verified status
|
|
121
125
|
*
|
|
@@ -125,6 +129,10 @@ var managedDocSchema = baseRegistrySchema.extend({
|
|
|
125
129
|
verified: external_exports.boolean().default(false)
|
|
126
130
|
}).meta({ id: "managed-doc" });
|
|
127
131
|
|
|
132
|
+
// ../../node_modules/.pnpm/@scalar+helpers@0.16.1/node_modules/@scalar/helpers/dist/http/http-methods.js
|
|
133
|
+
var HTTP_METHODS = ["delete", "get", "head", "options", "patch", "post", "put", "query", "trace"];
|
|
134
|
+
var httpMethods = Object.freeze(new Set(HTTP_METHODS));
|
|
135
|
+
|
|
128
136
|
// ../../packages/entities/dist/managed-doc/count-endpoints.js
|
|
129
137
|
var MAX_OPERATIONS_PER_PATH_ITEM = HTTP_METHODS.length;
|
|
130
138
|
|
|
@@ -135,18 +143,10 @@ function detectManagedDocType(document) {
|
|
|
135
143
|
}
|
|
136
144
|
return "openapi";
|
|
137
145
|
}
|
|
138
|
-
function getLegacyWysiwygVersion(versions) {
|
|
139
|
-
if (versions.includes("latest")) {
|
|
140
|
-
return "latest";
|
|
141
|
-
}
|
|
142
|
-
const latestVersion = [...versions].sort((a, b) => compareVersionsDesc(a, b))[0];
|
|
143
|
-
return latestVersion ?? "latest";
|
|
144
|
-
}
|
|
145
146
|
|
|
146
147
|
export {
|
|
147
148
|
ruleSchema,
|
|
148
149
|
detectManagedDocType,
|
|
149
|
-
getLegacyWysiwygVersion,
|
|
150
150
|
RegistryAsset,
|
|
151
151
|
managedDocVersionSchema,
|
|
152
152
|
managedDocSchema
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire as $$cR } from "node:module"; const require = $$cR(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
customProjectIconSchema
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-6M7TL2G2.js";
|
|
5
5
|
import {
|
|
6
6
|
brandedUid,
|
|
7
7
|
emailSchema,
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
slugSchema,
|
|
15
15
|
timestampSchema,
|
|
16
16
|
unixTimestamp
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-VVRUSQCY.js";
|
|
18
18
|
|
|
19
19
|
// ../../packages/entities/dist/team/access.js
|
|
20
20
|
var ExternalAccessMethod;
|
|
@@ -192,10 +192,10 @@ var roleSchema = external_exports.enum(TeamUserRole).meta({ id: "role" });
|
|
|
192
192
|
var userRefSchema = external_exports.object({
|
|
193
193
|
uid: brandedUid(),
|
|
194
194
|
role: roleSchema,
|
|
195
|
-
displayName: external_exports.string(),
|
|
196
|
-
imageUri: external_exports.string().optional(),
|
|
195
|
+
displayName: external_exports.string().meta({ examples: ["Alex Morgan"] }),
|
|
196
|
+
imageUri: external_exports.string().optional().meta({ examples: ["https://example.com/alex.png"] }),
|
|
197
197
|
activeProjectUid: external_exports.string().default(""),
|
|
198
|
-
nonBillable: external_exports.boolean().default(false).optional()
|
|
198
|
+
nonBillable: external_exports.boolean().default(false).optional().meta({ examples: [false] })
|
|
199
199
|
}).meta({ id: "user-ref" });
|
|
200
200
|
var billingPlanSchema = external_exports.enum(BillingPlan).meta({ id: "billing-plan" });
|
|
201
201
|
var billingInfoSchema = external_exports.preprocess((arg) => {
|
|
@@ -284,13 +284,25 @@ var teamSdkPricing = external_exports.object({
|
|
|
284
284
|
requiredTier: external_exports.enum(requiredTierLiterals)
|
|
285
285
|
}).meta({ id: "team-sdk-pricing" });
|
|
286
286
|
var pendingInviteSchema = external_exports.object({
|
|
287
|
-
uid: nanoidSchema,
|
|
287
|
+
uid: nanoidSchema.meta({ examples: ["UakgbKJ5m9gl0JDMbcJqL"] }),
|
|
288
288
|
role: roleSchema.default(TeamUserRole.Editor),
|
|
289
289
|
email: emailSchema,
|
|
290
|
-
expires: external_exports.number().optional()
|
|
290
|
+
expires: external_exports.number().optional().meta({ examples: [1735776e3] })
|
|
291
291
|
}).meta({ id: "pending-invite" });
|
|
292
|
-
var teamNameSchema = external_exports.string().trim().overwrite((s) => s.length ? s : "Untitled Team").meta({ id: "team-name" });
|
|
293
|
-
var
|
|
292
|
+
var teamNameSchema = external_exports.string().trim().overwrite((s) => s.length ? s : "Untitled Team").meta({ id: "team-name", examples: ["Acme"] });
|
|
293
|
+
var TEAM_NAME_MAX_LENGTH = 100;
|
|
294
|
+
var teamNameInputSchema = teamNameSchema.max(TEAM_NAME_MAX_LENGTH).meta({ id: "team-name-input" });
|
|
295
|
+
var teamImageSchema = external_exports.string().optional().meta({ id: "team-image", examples: ["https://example.com/logo.svg"] });
|
|
296
|
+
var emailAllowanceSchema = external_exports.object({
|
|
297
|
+
/** UTC day the daily count belongs to, as `YYYY-MM-DD`. */
|
|
298
|
+
day: external_exports.string(),
|
|
299
|
+
dayCount: external_exports.number().int().nonnegative(),
|
|
300
|
+
/** UTC month the monthly count belongs to, as `YYYY-MM`. */
|
|
301
|
+
month: external_exports.string(),
|
|
302
|
+
monthCount: external_exports.number().int().nonnegative(),
|
|
303
|
+
/** The month a limit alert was last posted for, so it posts once a month. */
|
|
304
|
+
alertedMonth: external_exports.string().optional()
|
|
305
|
+
});
|
|
294
306
|
var TeamOnboardingState;
|
|
295
307
|
(function(TeamOnboardingState2) {
|
|
296
308
|
TeamOnboardingState2["Setup"] = "setup";
|
|
@@ -369,6 +381,8 @@ var teamSchema = entitySchema.extend({
|
|
|
369
381
|
users: userRefSchema.array(),
|
|
370
382
|
icons: customProjectIconSchema.array().default([]),
|
|
371
383
|
pendingInvites: pendingInviteSchema.array().default([]),
|
|
384
|
+
/** Invite emails this team has sent in the current day and month. */
|
|
385
|
+
emailAllowance: emailAllowanceSchema.optional(),
|
|
372
386
|
/** Team auth configuration */
|
|
373
387
|
authentication: teamAuthenticationSchema.default(schemaModel({}, teamAuthenticationSchema)),
|
|
374
388
|
externalAccess: externalAccessSchema.default(schemaModel({}, externalAccessSchema)),
|
|
@@ -486,7 +500,6 @@ var teamPermissions = {
|
|
|
486
500
|
};
|
|
487
501
|
|
|
488
502
|
export {
|
|
489
|
-
TeamUserRole,
|
|
490
503
|
roleSchema,
|
|
491
504
|
userRefSchema,
|
|
492
505
|
billingPlanSchema,
|
|
@@ -495,6 +508,7 @@ export {
|
|
|
495
508
|
pendingInviteSchema,
|
|
496
509
|
teamNameSchema,
|
|
497
510
|
teamImageSchema,
|
|
511
|
+
emailAllowanceSchema,
|
|
498
512
|
UnifiedDocsMigrationStatus,
|
|
499
513
|
teamSchema
|
|
500
514
|
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { createRequire as $$cR } from "node:module"; const require = $$cR(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
detectManagedDocType
|
|
4
|
+
} from "./chunk-GLWTVLKM.js";
|
|
5
|
+
|
|
6
|
+
// src/domains/document/helpers/safe-normalize.ts
|
|
7
|
+
import { normalize } from "@scalar/json-magic/helpers/normalize";
|
|
8
|
+
var safeNormalize = (value) => {
|
|
9
|
+
try {
|
|
10
|
+
return normalize(value);
|
|
11
|
+
} catch {
|
|
12
|
+
return void 0;
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
// src/domains/document/helpers/document-type.ts
|
|
17
|
+
var isAsyncApiDocument = (document) => detectManagedDocType(document) === "asyncapi";
|
|
18
|
+
var isAsyncApiContent = (content) => content.includes("asyncapi") && isAsyncApiDocument(safeNormalize(content));
|
|
19
|
+
|
|
20
|
+
export {
|
|
21
|
+
safeNormalize,
|
|
22
|
+
isAsyncApiDocument,
|
|
23
|
+
isAsyncApiContent
|
|
24
|
+
};
|