@scalar/cli 2.8.0 → 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.
Files changed (94) hide show
  1. package/README.md +281 -65
  2. package/chunks/action-4GZI2M5B.js +62 -0
  3. package/chunks/action-4W5GUGEG.js +63 -0
  4. package/chunks/{action-FCAYFPVR.js → action-5LF4XYHX.js} +10 -7
  5. package/chunks/{action-XIUO64C7.js → action-5N3P43MD.js} +17 -12
  6. package/chunks/{action-Y7OUGD56.js → action-5RL4NWUZ.js} +17 -17
  7. package/chunks/{action-LXGXKXZZ.js → action-657A4K2D.js} +16 -16
  8. package/chunks/{action-EOAVVL52.js → action-7XOHYWYM.js} +11 -14
  9. package/chunks/{action-AQRPFQKI.js → action-CABLS46Q.js} +9 -7
  10. package/chunks/{action-F7A2K74G.js → action-CB55NWAU.js} +9 -13
  11. package/chunks/{action-5SK5NE7E.js → action-DKDRAIKV.js} +11 -14
  12. package/chunks/{action-7PEQXDWT.js → action-DTEO4YNX.js} +127 -20
  13. package/chunks/{action-UIKH4SZX.js → action-EAUTQ77U.js} +27 -23
  14. package/chunks/{action-YLF2G4G5.js → action-FBRY5JKU.js} +16 -16
  15. package/chunks/{action-VOFDW3U2.js → action-GFLRD7LO.js} +6 -5
  16. package/chunks/{action-GWXLHL2Z.js → action-GWYYTUTM.js} +4 -3
  17. package/chunks/{action-6BYGBXRC.js → action-HT42NUUX.js} +27 -22
  18. package/chunks/action-JEYDBB3P.js +147 -0
  19. package/chunks/{action-LLH4QPXM.js → action-KDUFU7TZ.js} +11 -13
  20. package/chunks/{action-W3C53GPH.js → action-LYCNT3KA.js} +29 -10
  21. package/chunks/{action-CA4QYPI6.js → action-OJ2NK25F.js} +4 -8
  22. package/chunks/{action-NVI5DWFP.js → action-PAM2EZ22.js} +4 -8
  23. package/chunks/action-PPTFYZWD.js +1552 -0
  24. package/chunks/{action-43YBNBDR.js → action-R4PGILN4.js} +28 -24
  25. package/chunks/{action-QQZLPI42.js → action-TOBU74JH.js} +23 -19
  26. package/chunks/action-U2L5DCFG.js +91 -0
  27. package/chunks/{action-H6OUJWWM.js → action-UUL6SWV4.js} +11 -14
  28. package/chunks/{action-354TUG4H.js → action-X7BA7PQQ.js} +10 -8
  29. package/chunks/{action-WFDNRA7D.js → action-XLE37MZL.js} +16 -16
  30. package/chunks/{action-Y6NXJQ4H.js → action-XOADBXSX.js} +16 -12
  31. package/chunks/{action-LEUD5P2U.js → action-YSVTZVKV.js} +36 -17
  32. package/chunks/{action-YRX6SN5F.js → action-ZFI77WA5.js} +8 -6
  33. package/chunks/{action-HT2DJ34Z.js → action-ZKA3RR3S.js} +15 -11
  34. package/chunks/{actions-OGIVBQC7.js → actions-3SAMH7A5.js} +41 -17
  35. package/chunks/{agent-ASPV3R5U.js → agent-2ESZI7NO.js} +7 -5
  36. package/chunks/{asyncapi-QNFKXHEI.js → asyncapi-4HGVM3PR.js} +14 -10
  37. package/chunks/{build.action-NM6CAE5F.js → build.action-VBGFGACM.js} +19 -17
  38. package/chunks/chunk-35Z7VTJT.js +453 -0
  39. package/chunks/chunk-36LXIJIZ.js +52 -0
  40. package/chunks/{chunk-KKRGBXCE.js → chunk-43WALAW3.js} +248 -103
  41. package/chunks/{chunk-C2KAWRIX.js → chunk-5ENKYZA4.js} +1 -1
  42. package/chunks/{chunk-GTV2BVXV.js → chunk-5SMP756H.js} +2 -2
  43. package/chunks/{chunk-5JLVQVKO.js → chunk-6M7TL2G2.js} +146 -148
  44. package/chunks/chunk-6PSYZO3U.js +24 -0
  45. package/chunks/{chunk-EXY3ZTV4.js → chunk-ATNTXKMS.js} +36 -274
  46. package/chunks/{chunk-PH3WFNXJ.js → chunk-BIMLCGKS.js} +1 -1
  47. package/chunks/{chunk-HGOD6THU.js → chunk-CWVYOXXM.js} +2 -19
  48. package/chunks/chunk-DFOZG7ZV.js +15 -0
  49. package/chunks/chunk-DHZW7Q7U.js +133 -0
  50. package/chunks/{chunk-R5LK6VPY.js → chunk-G4HRW2FZ.js} +13 -20
  51. package/chunks/{chunk-KCCFN4F7.js → chunk-GLWTVLKM.js} +29 -29
  52. package/chunks/{chunk-5UHLAJQD.js → chunk-GYRQPDTK.js} +24 -10
  53. package/chunks/chunk-H467HDVV.js +24 -0
  54. package/chunks/chunk-IPZP3VRA.js +327 -0
  55. package/chunks/{chunk-2OCWX42S.js → chunk-JXGF5EHC.js} +152 -18
  56. package/chunks/chunk-K2HIB5BA.js +92 -0
  57. package/chunks/{chunk-FDC2IESH.js → chunk-KHF2QXBG.js} +1352 -8327
  58. package/chunks/{chunk-IMG35UXX.js → chunk-KZNRQVMY.js} +1 -1
  59. package/chunks/{chunk-OJ2EWIJH.js → chunk-MC4EMNOR.js} +5 -1
  60. package/chunks/{chunk-YILQODZF.js → chunk-MMWSCTDB.js} +7 -4
  61. package/chunks/{chunk-6XWCMJDB.js → chunk-MNNGUUKJ.js} +12 -11
  62. package/chunks/chunk-NAC63XJF.js +10 -0
  63. package/chunks/{chunk-XXSQUBXS.js → chunk-UDBSV3CK.js} +107 -453
  64. package/chunks/{chunk-IKT5F47M.js → chunk-VVRUSQCY.js} +11 -11
  65. package/chunks/{chunk-BPGFSSUH.js → chunk-VYFGRLVQ.js} +1 -1
  66. package/chunks/{chunk-UXJ753NV.js → chunk-WB6PWTMU.js} +5 -13
  67. package/chunks/{chunk-5DEU2DVL.js → chunk-WDIWLXLV.js} +3 -15
  68. package/chunks/{chunk-6YPQGVF4.js → chunk-WIEXQUTD.js} +1 -1
  69. package/chunks/{chunk-W24BETFG.js → chunk-XAGJJNQW.js} +3 -3
  70. package/chunks/{chunk-22HYZ7LE.js → chunk-ZGNDXPLU.js} +3 -3
  71. package/chunks/{chunk-XEDGMZJD.js → chunk-ZGVZU6L2.js} +81 -25
  72. package/chunks/{chunk-L3UXDCBI.js → chunk-ZKJPLWRJ.js} +2 -2
  73. package/chunks/{chunk-MLSZVVTT.js → chunk-ZYBLQ5CT.js} +13 -7
  74. package/chunks/{create.action-FUQ2BVJA.js → create.action-DBNIS665.js} +19 -17
  75. package/chunks/{delete.action-BTDFH7WY.js → delete.action-GBOZC45K.js} +19 -17
  76. package/chunks/{delete.action-47E66R3I.js → delete.action-K7BLK7DK.js} +19 -17
  77. package/chunks/{get.action-XC7KC2JO.js → get.action-N3JOY3OU.js} +17 -12
  78. package/chunks/get.action-QHKMYZBK.js +91 -0
  79. package/chunks/{list.action-LXKEUYKO.js → list.action-6SSO3JVN.js} +45 -15
  80. package/chunks/{list.action-OFGLMRE7.js → list.action-TJCS6UEY.js} +39 -19
  81. package/chunks/{publish.action-OS27XOX4.js → publish.action-T24VHRMR.js} +27 -22
  82. package/chunks/query-WKATAJJ6.js +129 -0
  83. package/chunks/scripts-VIBLGKYG.js +102 -0
  84. package/chunks/{update.action-ZMS4CQ3T.js → update.action-OGYNBXRU.js} +23 -18
  85. package/chunks/{update.action-AEIBLCWD.js → update.action-VOE6PH5F.js} +23 -18
  86. package/docs.html +941 -209
  87. package/index.js +374 -182
  88. package/package.json +14 -13
  89. package/skills/scalar-cli/SKILL.md +7 -1
  90. package/template.md +148 -26
  91. package/chunks/action-JAHFRYWZ.js +0 -423
  92. package/chunks/action-KTYOCA2V.js +0 -229
  93. package/chunks/chunk-K74E42RV.js +0 -7311
  94. package/chunks/chunk-QVQ4PNVL.js +0 -610
@@ -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-5UHLAJQD.js";
4
+ } from "./chunk-GYRQPDTK.js";
5
5
  import {
6
6
  sharedProjectSchema
7
- } from "./chunk-5JLVQVKO.js";
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-XEDGMZJD.js";
24
+ } from "./chunk-ZGVZU6L2.js";
25
25
  import {
26
26
  external_exports,
27
27
  namespaceSchema,
28
28
  nanoidSchema,
29
29
  slugSchema
30
- } from "./chunk-IKT5F47M.js";
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
- installationName: external_exports.string().min(1).max(100),
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-6XWCMJDB.js";
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-IKT5F47M.js";
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: "nanoid()" }),
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-5JLVQVKO.js";
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-IKT5F47M.js";
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 teamImageSchema = external_exports.string().optional().meta({ id: "team-image" });
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
+ };
@@ -0,0 +1,327 @@
1
+ import { createRequire as $$cR } from "node:module"; const require = $$cR(import.meta.url);
2
+ import {
3
+ baseRegistrySchema,
4
+ contentShaSchema
5
+ } from "./chunk-MNNGUUKJ.js";
6
+ import {
7
+ brandedUid,
8
+ docVersionSchema,
9
+ entitySchema,
10
+ external_exports,
11
+ mintUid,
12
+ namespaceSchema,
13
+ nanoidSchema,
14
+ slugSchema,
15
+ timestampSchema
16
+ } from "./chunk-VVRUSQCY.js";
17
+
18
+ // ../../packages/entities/dist/sdk/schema.js
19
+ var SdkLanguage;
20
+ (function(SdkLanguage2) {
21
+ SdkLanguage2["Typescript"] = "typescript";
22
+ SdkLanguage2["Python"] = "python";
23
+ SdkLanguage2["Cli"] = "cli";
24
+ SdkLanguage2["CSharp"] = "csharp";
25
+ SdkLanguage2["Java"] = "java";
26
+ SdkLanguage2["Ruby"] = "ruby";
27
+ SdkLanguage2["Php"] = "php";
28
+ SdkLanguage2["Go"] = "go";
29
+ SdkLanguage2["Rust"] = "rust";
30
+ SdkLanguage2["Kotlin"] = "kotlin";
31
+ SdkLanguage2["Swift"] = "swift";
32
+ SdkLanguage2["Cpp"] = "cpp";
33
+ SdkLanguage2["Dart"] = "dart";
34
+ })(SdkLanguage || (SdkLanguage = {}));
35
+ var sdkTargetDestinationSchema = external_exports.object({
36
+ provider: external_exports.literal("github").default("github"),
37
+ linkedBy: external_exports.string(),
38
+ /**
39
+ * GitHub App installation that grants push access. Optional because legacy
40
+ * links predate it and it is derivable from `linkedBy` + repo at sync time.
41
+ */
42
+ installationId: external_exports.number().int().optional(),
43
+ /** GitHub repo id — the auth anchor and the webhook routing key. */
44
+ id: external_exports.number().int(),
45
+ expired: external_exports.boolean().default(false)
46
+ }).meta({ id: "sdk-target-destination" });
47
+ var sdkSampleRepoSchema = external_exports.object({
48
+ provider: external_exports.literal("github").default("github"),
49
+ /**
50
+ * 'pending' from SDK creation until the repo is provisioned in scalar-sdks;
51
+ * 'ready' once it exists (name/installationId are filled in then). The
52
+ * pending state lets the dashboard show the section immediately. Defaults to
53
+ * 'ready' so pre-existing bindings (which always have a repo) read correctly.
54
+ */
55
+ status: external_exports.enum(["pending", "ready"]).default("ready"),
56
+ /** "scalar-sdks/<repo>" (present once ready). */
57
+ name: external_exports.string().optional(),
58
+ /** scalar-sdks installation that grants push access for the bot (once ready). */
59
+ installationId: external_exports.number().int().optional(),
60
+ baseBranch: external_exports.string().min(1).default("main"),
61
+ /**
62
+ * When provisioning was first kicked for this target (unix seconds), stamped
63
+ * as the pending binding is seeded. The dashboard anchors its stalled-timeout
64
+ * on it so a target added long after the SDK was created still gets the full
65
+ * "Preparing" window instead of reading as stalled immediately. Absent on
66
+ * pre-feature bindings (readers fall back to the SDK's `createdAt`).
67
+ */
68
+ provisionStartedAt: timestampSchema.optional(),
69
+ /** Last build whose artifact was pushed to the playground. */
70
+ lastSyncedBuild: nanoidSchema.optional()
71
+ }).meta({ id: "sdk-sample-repo" });
72
+ var sdkTargetSchema = external_exports.object({
73
+ language: external_exports.enum(SdkLanguage),
74
+ slug: slugSchema.optional(),
75
+ destination: sdkTargetDestinationSchema.nullable().default(null),
76
+ /**
77
+ * Preview repo in scalar-sdks for this target. Independent of `destination`:
78
+ * it always mirrors the latest build so users can play with the output before
79
+ * setting up a production repo.
80
+ */
81
+ sample: sdkSampleRepoSchema.nullable().default(null)
82
+ }).meta({ id: "sdk-target" });
83
+ var sdkVersionTargetStateSchema = external_exports.object({
84
+ activeSync: external_exports.object({
85
+ repository: external_exports.string(),
86
+ /**
87
+ * The release PR managed by release-please on scalar-next, when one
88
+ * was open after the sync. Release cutting is the repo's own workflow.
89
+ */
90
+ pullRequest: external_exports.number().optional(),
91
+ /** scalar-next tip the sync landed. */
92
+ commitHash: external_exports.string()
93
+ }).optional(),
94
+ /**
95
+ * Set when the last combine merge collided: the build awaiting resolution
96
+ * on the conflict PR (scalar-merge-conflict into scalar-next), resolved by
97
+ * the developer on GitHub. Cleared on a clean reconcile.
98
+ */
99
+ conflict: external_exports.object({
100
+ build: nanoidSchema,
101
+ /** The conflict PR into scalar-next, for deep links. */
102
+ pullRequest: external_exports.number().optional()
103
+ }).optional(),
104
+ activeBuild: nanoidSchema.optional(),
105
+ /**
106
+ * When {@link activeBuild} was recorded (unix seconds) — the closest thing
107
+ * we store to when this language's artifact was generated.
108
+ *
109
+ * The version's own `createdAt`/`publishedAt` cannot answer that. A version
110
+ * is cut when the API document changes and may be built much later, and a
111
+ * rebuild of an already-published version re-points `activeBuild` without
112
+ * moving `publishedAt` — so a reader offered the newest artifact would be
113
+ * told it was built whenever the version first shipped. Absent on builds
114
+ * recorded before this field existed; readers fall back to the version
115
+ * stamps.
116
+ */
117
+ builtAt: timestampSchema.optional()
118
+ }).meta({ id: "sdk-version-target-state" });
119
+ var sdkVersionStatusSchema = external_exports.enum(["draft", "published"]);
120
+ var sdkVersionSchema = external_exports.object({
121
+ version: docVersionSchema,
122
+ /**
123
+ * The exact API version this SDK version was created against (build
124
+ * provenance). Always concrete — the SDK-level `sdkSchema.apiVersion` is
125
+ * the range-capable auto-update spec.
126
+ */
127
+ apiVersion: docVersionSchema.meta({ examples: ["1.2.0"] }),
128
+ createdAt: timestampSchema.optional(),
129
+ /** Draft while being edited; published once a build of it succeeds. */
130
+ status: sdkVersionStatusSchema.default("published").meta({ examples: ["published"] }),
131
+ /** Config snapshot for this version. Defaults to `{}` so pre-migration docs still validate. */
132
+ config: external_exports.string().default("{}").meta({
133
+ examples: ['{"targets":{"typescript":{"packageName":"@acme/sdk"}}}']
134
+ }),
135
+ /** Language targets this version ships, derived from `config`. */
136
+ languages: external_exports.enum(SdkLanguage).array().default([]).meta({ examples: [["typescript"]] }),
137
+ publishedAt: timestampSchema.optional(),
138
+ /** What created/last-touched this version, for display. */
139
+ changeSource: external_exports.enum(["user", "api-version", "created"]).optional(),
140
+ /**
141
+ * Content identity of the API document save that auto-created this
142
+ * version: the managed doc version's `jsonSha` — the same key space as
143
+ * {@link sdkBuildApiSchema}'s `documentHash`. Lets redelivered (or
144
+ * repeated, identical) save events recognize content the SDK already
145
+ * processed instead of minting another version.
146
+ */
147
+ apiDocumentHash: external_exports.string().optional(),
148
+ /** Active sync/build per language, for this version. */
149
+ targets: external_exports.partialRecord(external_exports.enum(SdkLanguage), sdkVersionTargetStateSchema).default({})
150
+ }).meta({ id: "sdk-version" });
151
+ var sdkSchema = baseRegistrySchema.extend({
152
+ /** Own uid, branded so it cannot be confused with another entity's uid */
153
+ uid: brandedUid().default(mintUid).meta({ default: void 0 }),
154
+ /**
155
+ * The registry API this SDK is generated from. Null when unlinked — the SDK
156
+ * keeps its versions/builds but can't build a new version until re-linked.
157
+ *
158
+ * Branded as a ManagedDoc uid: this points at a managed DOC, not a managed
159
+ * SCHEMA, so comparing it to a `ManagedSchema` uid is a compile error.
160
+ */
161
+ apiUid: brandedUid().nullable(),
162
+ /**
163
+ * The API version this SDK follows — the auto-update gate. An exact value
164
+ * (`3.0.1`, kept in sync with the version the SDK is on) auto-rebuilds only
165
+ * when that version's content changes; a range prefix widens it (`~1.2.0`
166
+ * adds patch bumps, `^1.2.3` minors, `3` any 3.x, `*` any version). Ranges
167
+ * are user intent and never rewritten by the platform. Distinct from
168
+ * `sdkVersionSchema.apiVersion`, the exact build provenance of one SDK
169
+ * version. Null while unlinked; absent on pre-feature docs (readers fall
170
+ * back to the tracked version with exact semantics). `docVersionSchema`
171
+ * keeps the same floor as every other version field: non-empty, no
172
+ * reserved names (`latest` would be a spec that can never match).
173
+ */
174
+ apiVersion: docVersionSchema.nullable().optional(),
175
+ /**
176
+ * The version label (`sdkVersionSchema.version`) of the SDK version the
177
+ * platform treats as current: the one a fresh SDK is created on, moved
178
+ * forward as builds publish, and selectable by the user.
179
+ */
180
+ currentVersion: docVersionSchema,
181
+ /**
182
+ * The label of the newest published version, the one hosting serves as
183
+ * `latest`. Publishing moves it forward by compare-and-swap; deleting the
184
+ * version it names moves it to the newest published version left, or null
185
+ * when none is. Absent on SDKs not published since the field existed.
186
+ */
187
+ latestVersion: docVersionSchema.nullish(),
188
+ /** All versions available for SDK. */
189
+ versions: sdkVersionSchema.array().default([]),
190
+ /**
191
+ * Persistent per-language registry: every language the SDK has, each with its
192
+ * registry slug + git destination. Survives across versions — destinations and
193
+ * slugs persist even when a version drops a language. The *active* language set
194
+ * is the latest published version's `languages`.
195
+ */
196
+ targets: sdkTargetSchema.array().min(1),
197
+ /**
198
+ * @deprecated Config now lives per-version (`sdkVersionSchema.config`). Kept
199
+ * optional for the migration/legacy path; new code reads the version config.
200
+ */
201
+ config: external_exports.string().optional()
202
+ }).meta({ id: "sdk" });
203
+ var sdkBuildStatusSchema = external_exports.enum(["pending", "error", "generated"]).meta({ id: "sdk-build-status" });
204
+ var sdkGitStatusSchema = external_exports.enum(["pending", "error", "synced", "conflicts"]).meta({ id: "sdk-git-status" });
205
+ var sdkBuildApiSchema = external_exports.object({
206
+ uid: nanoidSchema,
207
+ namespace: namespaceSchema,
208
+ version: docVersionSchema,
209
+ slug: slugSchema,
210
+ upgraded: external_exports.boolean().default(false),
211
+ /**
212
+ * Identity of the API document content this build was enqueued against:
213
+ * the managed doc version's `jsonSha` at enqueue time. Rebuild triggering
214
+ * compares it with the version's current `jsonSha` — an in-place content
215
+ * rewrite that lands between enqueue and generation makes the comparison
216
+ * conservatively re-trigger rather than miss the change. Nullable:
217
+ * document versions hashed before `jsonSha` existed carry none, and
218
+ * mongobase round-trips an unset optional as null.
219
+ */
220
+ documentHash: external_exports.string().nullable().optional()
221
+ }).meta({ id: "sdk-build-api" });
222
+ var sdkbuildSdkSchema = external_exports.object({
223
+ uid: nanoidSchema,
224
+ namespace: namespaceSchema,
225
+ version: docVersionSchema,
226
+ slug: slugSchema
227
+ }).meta({ id: "sdk-build-sdk" });
228
+ var sdkBuildGitSchema = external_exports.object({
229
+ /**
230
+ * The release PR (clean sync) or conflict PR (conflicted sync), when one
231
+ * exists. Nullable: mongobase round-trips an unset optional as null, and a
232
+ * strict number parse would drop the doc on read.
233
+ */
234
+ pullRequest: external_exports.number().nullable().optional(),
235
+ commitHash: external_exports.string()
236
+ }).optional().meta({ id: "sdk-build-git" });
237
+ var sdkBuildTargetSchema = external_exports.object({
238
+ /** SDK language to generate */
239
+ language: external_exports.enum(SdkLanguage),
240
+ /**
241
+ * Per-target slug. The build zip is copied to a key under it next to its
242
+ * uid key, and readers fall back to that key when the uid key is missing.
243
+ * Absent on a target without one.
244
+ */
245
+ slug: slugSchema.optional(),
246
+ /** Build status */
247
+ buildStatus: sdkBuildStatusSchema,
248
+ /**
249
+ * Additional build message. Nullable: mongobase round-trips an unset
250
+ * optional as null, and a strict string parse would drop the doc on read.
251
+ */
252
+ buildMessage: external_exports.string().nullable().optional(),
253
+ /** Git sync status */
254
+ gitStatus: sdkGitStatusSchema.optional(),
255
+ /**
256
+ * When the target entered `gitStatus: 'pending'`, in unix seconds. Lets a
257
+ * still-"pending" sync be recognized as stalled (a terminal message never
258
+ * arrived) so the dashboard can offer a retry instead of spinning forever.
259
+ * Nullable for the same round-trip reason as buildMessage.
260
+ */
261
+ syncStartedAt: external_exports.number().nullable().optional(),
262
+ /** Additional git message. Nullable for the same round-trip reason as buildMessage. */
263
+ gitMessage: external_exports.string().nullable().optional(),
264
+ /**
265
+ * Machine-readable git failure class assigned by the generator (e.g.
266
+ * 'github-workflows-permission'). Nullable for the same round-trip reason
267
+ * as buildMessage.
268
+ */
269
+ gitErrorCode: external_exports.string().nullable().optional(),
270
+ /** Linked git repository name */
271
+ repository: external_exports.string().nullable().optional(),
272
+ /** Git sync commit and PR */
273
+ gitSync: sdkBuildGitSchema
274
+ }).meta({ id: "sdk-build-target" });
275
+ var sdkBuildSchema = entitySchema.extend({
276
+ teamUid: nanoidSchema,
277
+ /** SDK metadata on generation */
278
+ sdk: sdkbuildSdkSchema,
279
+ /** Original API used to generate SDK */
280
+ api: sdkBuildApiSchema,
281
+ /** Custom SDK config */
282
+ config: external_exports.string(),
283
+ /** Should auto set active sdk version */
284
+ autoBump: external_exports.boolean().default(false),
285
+ /** Per-language build targets */
286
+ targets: sdkBuildTargetSchema.array().min(1)
287
+ }).meta({ id: "sdk-build" });
288
+ var sdkBuildLogChunkSchema = entitySchema.extend({
289
+ teamUid: nanoidSchema,
290
+ buildUid: nanoidSchema,
291
+ /** Monotonic order within a build. */
292
+ sequence: external_exports.number().int(),
293
+ chunk: external_exports.string()
294
+ }).meta({ id: "sdk-build-log-chunk" });
295
+ var sdkCodeSampleSchema = external_exports.object({
296
+ lang: external_exports.string(),
297
+ /**
298
+ * Optional, the way the extension itself defines it — most hand-authored
299
+ * samples carry only `lang` and `source`. Missing labels fall back to `lang`
300
+ * when the SDK service normalizes samples.
301
+ */
302
+ label: external_exports.string().optional(),
303
+ source: external_exports.string()
304
+ }).meta({ id: "sdk-code-sample" });
305
+
306
+ // ../../packages/entities/dist/sdk/version.js
307
+ var sdkVersionRecordSchema = entitySchema.extend({
308
+ /** Own uid, branded so it cannot be confused with another entity's uid */
309
+ uid: brandedUid().default(mintUid).meta({ default: "nanoid()" }),
310
+ version: docVersionSchema,
311
+ /** The exact API version this SDK version was created against. */
312
+ apiVersion: docVersionSchema,
313
+ apiDocumentHash: external_exports.string().nullish(),
314
+ status: sdkVersionStatusSchema,
315
+ publishedAt: timestampSchema.nullish(),
316
+ changeSource: external_exports.enum(["user", "api-version", "created"]).nullish(),
317
+ /** SHA-256 of the config string, naming its blob under the SDK's artifacts. */
318
+ configSha: contentShaSchema,
319
+ languages: external_exports.enum(SdkLanguage).array(),
320
+ targets: external_exports.partialRecord(external_exports.enum(SdkLanguage), sdkVersionTargetStateSchema)
321
+ }).meta({ id: "sdk-version-record" });
322
+
323
+ export {
324
+ SdkLanguage,
325
+ sdkSchema,
326
+ sdkBuildSchema
327
+ };