@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.
Files changed (94) hide show
  1. package/README.md +475 -80
  2. package/chunks/action-4GZI2M5B.js +62 -0
  3. package/chunks/action-4W5GUGEG.js +63 -0
  4. package/chunks/{action-HJYZCPUN.js → action-5LF4XYHX.js} +10 -7
  5. package/chunks/{action-SRBN7N3R.js → action-5N3P43MD.js} +17 -12
  6. package/chunks/{action-RBOLLIGX.js → action-5RL4NWUZ.js} +17 -17
  7. package/chunks/{action-SNPOOW6S.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-BAQYJ6UE.js → action-EAUTQ77U.js} +27 -23
  14. package/chunks/{action-QYGOPSTY.js → action-FBRY5JKU.js} +16 -16
  15. package/chunks/{action-VOFDW3U2.js → action-GFLRD7LO.js} +6 -5
  16. package/chunks/{action-LPVITMWA.js → action-GWYYTUTM.js} +4 -3
  17. package/chunks/{action-4NGK5XMD.js → action-HT42NUUX.js} +29 -24
  18. package/chunks/action-JEYDBB3P.js +147 -0
  19. package/chunks/{action-E4YSRFGT.js → action-KDUFU7TZ.js} +11 -13
  20. package/chunks/{action-BRSSC2SR.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-OX2566BE.js → action-R4PGILN4.js} +30 -26
  25. package/chunks/{action-CPLH2CQ5.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-T5XMJXPO.js → action-X7BA7PQQ.js} +10 -8
  29. package/chunks/{action-LVDU6YOI.js → action-XLE37MZL.js} +16 -16
  30. package/chunks/{action-BOZNBCNZ.js → action-XOADBXSX.js} +16 -12
  31. package/chunks/{action-SCOXTCPR.js → action-YSVTZVKV.js} +38 -19
  32. package/chunks/{action-YRX6SN5F.js → action-ZFI77WA5.js} +8 -6
  33. package/chunks/{action-ATGZOWSH.js → action-ZKA3RR3S.js} +15 -11
  34. package/chunks/actions-3SAMH7A5.js +182 -0
  35. package/chunks/{agent-ASPV3R5U.js → agent-2ESZI7NO.js} +7 -5
  36. package/chunks/{asyncapi-H4FU6GPC.js → asyncapi-4HGVM3PR.js} +14 -10
  37. package/chunks/{build.action-6V6GXI3X.js → build.action-VBGFGACM.js} +21 -19
  38. package/chunks/chunk-35Z7VTJT.js +453 -0
  39. package/chunks/chunk-36LXIJIZ.js +52 -0
  40. package/chunks/{chunk-BIKOD3SG.js → chunk-43WALAW3.js} +251 -103
  41. package/chunks/{chunk-C2KAWRIX.js → chunk-5ENKYZA4.js} +1 -1
  42. package/chunks/{chunk-ZJVYOZFB.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-ISXH6Q7I.js → chunk-ATNTXKMS.js} +45 -274
  46. package/chunks/{chunk-BDEPNGTO.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-LG7IFACX.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-2PPRO2QB.js → chunk-VYFGRLVQ.js} +1 -1
  66. package/chunks/{chunk-GPNB7ISG.js → chunk-WB6PWTMU.js} +5 -13
  67. package/chunks/{chunk-4X47MN6Q.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-2DSVF5AD.js → chunk-ZGNDXPLU.js} +3 -3
  71. package/chunks/{chunk-XEDGMZJD.js → chunk-ZGVZU6L2.js} +81 -25
  72. package/chunks/{chunk-QXQZVEDC.js → chunk-ZKJPLWRJ.js} +2 -2
  73. package/chunks/{chunk-MLSZVVTT.js → chunk-ZYBLQ5CT.js} +13 -7
  74. package/chunks/{create.action-P6DLCK4W.js → create.action-DBNIS665.js} +21 -19
  75. package/chunks/{delete.action-HJKRRHE2.js → delete.action-GBOZC45K.js} +21 -19
  76. package/chunks/{delete.action-Z3GAA4ZN.js → delete.action-K7BLK7DK.js} +21 -19
  77. package/chunks/{get.action-IT4EHAV4.js → get.action-N3JOY3OU.js} +17 -12
  78. package/chunks/get.action-QHKMYZBK.js +91 -0
  79. package/chunks/{list.action-WLIAO5UW.js → list.action-6SSO3JVN.js} +45 -15
  80. package/chunks/{list.action-2FU5UZNH.js → list.action-TJCS6UEY.js} +41 -21
  81. package/chunks/{publish.action-T4J4DRXR.js → publish.action-T24VHRMR.js} +29 -24
  82. package/chunks/query-WKATAJJ6.js +129 -0
  83. package/chunks/scripts-VIBLGKYG.js +102 -0
  84. package/chunks/{update.action-3OVS3HWC.js → update.action-OGYNBXRU.js} +24 -19
  85. package/chunks/{update.action-MY7QPSSU.js → update.action-VOE6PH5F.js} +24 -19
  86. package/docs.html +1363 -320
  87. package/index.js +417 -174
  88. package/package.json +14 -13
  89. package/skills/scalar-cli/SKILL.md +13 -1
  90. package/template.md +157 -15
  91. package/chunks/action-JAHFRYWZ.js +0 -423
  92. package/chunks/action-N7BA5I3E.js +0 -229
  93. package/chunks/chunk-CWCETP6H.js +0 -610
  94. package/chunks/chunk-K74E42RV.js +0 -7311
@@ -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
+ };
@@ -6,28 +6,30 @@ import {
6
6
  managedSchema,
7
7
  siteDeploySchema,
8
8
  workspaceSchema
9
- } from "./chunk-BIKOD3SG.js";
9
+ } from "./chunk-43WALAW3.js";
10
10
  import {
11
11
  userSchema
12
- } from "./chunk-MLSZVVTT.js";
12
+ } from "./chunk-ZYBLQ5CT.js";
13
13
  import {
14
14
  sdkSchema
15
- } from "./chunk-FDC2IESH.js";
15
+ } from "./chunk-IPZP3VRA.js";
16
16
  import {
17
17
  teamSchema
18
- } from "./chunk-5UHLAJQD.js";
18
+ } from "./chunk-GYRQPDTK.js";
19
19
  import {
20
20
  activeDeploymentSchema,
21
21
  publishRecordSchema,
22
22
  themeSchema
23
- } from "./chunk-5JLVQVKO.js";
23
+ } from "./chunk-6M7TL2G2.js";
24
24
  import {
25
25
  managedDocSchema,
26
26
  ruleSchema
27
- } from "./chunk-KCCFN4F7.js";
27
+ } from "./chunk-GLWTVLKM.js";
28
28
  import {
29
+ docInstanceOriginSchema,
30
+ docInstanceSchema,
29
31
  docVersionRecordSchema
30
- } from "./chunk-6XWCMJDB.js";
32
+ } from "./chunk-MNNGUUKJ.js";
31
33
  import {
32
34
  brandedUid,
33
35
  emailSchema,
@@ -39,7 +41,7 @@ import {
39
41
  timestampSchema,
40
42
  unixTimestamp,
41
43
  zod_default
42
- } from "./chunk-IKT5F47M.js";
44
+ } from "./chunk-VVRUSQCY.js";
43
45
 
44
46
  // ../../packages/entities/dist/admins/index.js
45
47
  var scalarAdminSchema = entitySchema.extend({
@@ -48,6 +50,41 @@ var scalarAdminSchema = entitySchema.extend({
48
50
  role: zod_default.enum(["admin", "super-admin"])
49
51
  }).meta({ id: "scalar-admin" });
50
52
 
53
+ // ../../packages/entities/dist/deploys/ai-catalog.js
54
+ function isOriginPath(value) {
55
+ try {
56
+ return value.startsWith("/") && !value.startsWith("//") && !/[\\?#\r\n]/.test(value) && !value.split("/").some((segment) => {
57
+ const decoded = decodeURIComponent(segment);
58
+ return [".", ".."].includes(decoded) || /[/\\]/.test(decoded);
59
+ });
60
+ } catch {
61
+ return false;
62
+ }
63
+ }
64
+ var resourcePath = external_exports.string().refine(isOriginPath);
65
+ var apiInventoryEntrySchema = external_exports.object({
66
+ id: external_exports.string().min(1),
67
+ title: external_exports.string().trim().min(1),
68
+ path: resourcePath
69
+ });
70
+ var aiInventorySchema = external_exports.object({
71
+ title: external_exports.string().trim().min(1),
72
+ apis: external_exports.array(external_exports.unknown()),
73
+ mcp: external_exports.object({
74
+ url: external_exports.url({ protocol: /^https?$/ }).optional()
75
+ }).nullable()
76
+ });
77
+
78
+ // ../../packages/entities/dist/deploys/mcp-server-card.js
79
+ var mcpDefinitionSchema = external_exports.object({
80
+ server: external_exports.object({ name: external_exports.string().min(1), version: external_exports.string().min(1) }),
81
+ capabilities: external_exports.object({
82
+ tools: external_exports.record(external_exports.string(), external_exports.unknown()),
83
+ resources: external_exports.array(external_exports.unknown()),
84
+ prompts: external_exports.array(external_exports.unknown())
85
+ })
86
+ });
87
+
51
88
  // ../../packages/entities/dist/namespace/schema.js
52
89
  var namespaceTombstoneSchema = entitySchema.extend({
53
90
  uid: brandedUid().default(mintUid).meta({ default: "nanoid()" }),
@@ -72,22 +109,13 @@ var BaseCollections = {
72
109
  Users: "users",
73
110
  ScalarAdmins: "admin-users",
74
111
  SignupMeta: "signup-meta",
75
- ExchangeTokens: "exchange-tokens",
76
- HostingExchange: "hosting-exchange",
77
- HostingLoginTokens: "hosting-login-tokens",
78
- HostingOauthStates: "hosting-oauth-states",
79
- OauthClients: "oauth-clients",
80
- OauthAuthorizationRequests: "oauth-authorization-requests",
81
- OauthAuthorizationCodes: "oauth-authorization-codes",
82
112
  Passwords: "passwords",
83
113
  SignupOtp: "signup-otp",
84
114
  GithubUsers: "github-users",
85
115
  BitbucketUsers: "bitbucket-users",
86
- RefreshTokens: "refresh-tokens",
87
116
  LoginAttempts: "login-attempts",
88
117
  Teams: "team",
89
118
  Deploys: "deploys",
90
- SamlStates: "saml-states",
91
119
  SignupData: "signup-data",
92
120
  Projects: (teamUid) => `team/${teamUid}/projects`,
93
121
  GithubProjects: (teamUid) => `team/${teamUid}/projects-github`,
@@ -110,6 +138,7 @@ var BaseCollections = {
110
138
  LoginPortals: (teamUid) => `team/${teamUid}/login-portals`,
111
139
  UserInfoHookSecrets: (teamUid) => `team/${teamUid}/user-info-hook-secrets`,
112
140
  Sdks: (teamUid) => `team/${teamUid}/sdks`,
141
+ SdkVersions: (teamUid, sdkUid) => `team/${teamUid}/sdks/${sdkUid}/versions`,
113
142
  SdkBuilds: (teamUid) => `team/${teamUid}/sdk-builds`,
114
143
  SdkBuildLogs: (teamUid) => `team/${teamUid}/sdk-build-logs`,
115
144
  McpServers: (teamUid) => `team/${teamUid}/mcp-servers`,
@@ -122,7 +151,16 @@ var BaseCollections = {
122
151
  WebhookEventClaims: "webhook-event-claims",
123
152
  OauthStates: "oauth-states",
124
153
  Waitlist: "waitlist",
125
- BannedUsers: "banned-users"
154
+ BannedUsers: "banned-users",
155
+ AuthAttempts: "auth-attempts",
156
+ AuthChallenges: "auth-challenges",
157
+ AuthCodes: "auth-codes",
158
+ AuthConsents: "auth-consents",
159
+ AuthFamilies: "auth-families",
160
+ AuthRefreshTokens: "auth-refresh-tokens",
161
+ AuthSessions: "auth-sessions",
162
+ AuthCounters: "auth-counters",
163
+ AuthRevocations: "auth-revocations"
126
164
  };
127
165
  var MONGO_PLACEHOLDER_UID = "<uid-0>";
128
166
 
@@ -169,6 +207,24 @@ var edgeCacheProjectSchema = external_exports.object({
169
207
  var edgeCacheGithubProjectSchema = edgeCacheProjectSchema;
170
208
  var edgeCacheDocsProjectSchema = edgeCacheProjectSchema;
171
209
  var PROJECT_TABLE = "project";
210
+ var DOC_INSTANCE_TABLE = "docInstance";
211
+ var docInstanceIndexFields = [
212
+ "_path",
213
+ "version",
214
+ "jsonSha",
215
+ "commitSha"
216
+ ];
217
+ var docInstanceProjection = {
218
+ uid: 1,
219
+ createdAt: 1,
220
+ version: 1,
221
+ jsonSha: 1,
222
+ yamlSha: 1,
223
+ parentInstanceUid: 1,
224
+ mergeParentUid: 1,
225
+ origin: 1,
226
+ _path: 1
227
+ };
172
228
  var edgeCachePublishRecordSchema = publishRecordSchema.pick({ uid: true, projectUid: true, agentToken: true }).extend(requiredUid).transform(({ uid, projectUid, agentToken }) => ({
173
229
  uid,
174
230
  projectUid,
@@ -188,6 +244,48 @@ var edgeCacheDocVersionSchema = docVersionRecordSchema.pick({
188
244
  version: true,
189
245
  upgraded: true
190
246
  }).extend({ ...requiredUid, _path: external_exports.string() });
247
+ var edgeCacheInstanceOriginSchema = external_exports.union([
248
+ external_exports.strictObject({ type: external_exports.literal("platform") }),
249
+ external_exports.strictObject({ type: external_exports.literal("url") }),
250
+ external_exports.strictObject({
251
+ type: external_exports.literal("git"),
252
+ commitSha: external_exports.string().nullable(),
253
+ draft: external_exports.literal(true).nullable()
254
+ })
255
+ ]);
256
+ var edgeCacheInstanceOriginInputSchema = external_exports.union([
257
+ docInstanceOriginSchema,
258
+ edgeCacheInstanceOriginSchema
259
+ ]);
260
+ function projectInstanceOrigin(origin) {
261
+ if (origin.type !== "git")
262
+ return { type: origin.type };
263
+ return {
264
+ type: "git",
265
+ commitSha: origin.commitSha,
266
+ draft: origin.draft === null ? null : true
267
+ };
268
+ }
269
+ var edgeCacheDocInstanceSchema = docInstanceSchema.pick({
270
+ uid: true,
271
+ version: true,
272
+ jsonSha: true,
273
+ yamlSha: true,
274
+ parentInstanceUid: true,
275
+ mergeParentUid: true
276
+ }).extend({
277
+ ...requiredUid,
278
+ createdAt: timestampSchema.optional(),
279
+ origin: edgeCacheInstanceOriginInputSchema.default({ type: "platform" }),
280
+ _path: external_exports.string()
281
+ }).transform((instance) => {
282
+ const origin = projectInstanceOrigin(instance.origin);
283
+ return {
284
+ ...instance,
285
+ origin,
286
+ commitSha: origin.type === "git" ? origin.commitSha : null
287
+ };
288
+ });
191
289
  var edgeCacheRuleSchema = ruleSchema.pick(registryRequiredFields).extend(entityExtension).transform(generateRegistryPath);
192
290
  var edgeCacheSdkSchema = sdkSchema.pick({ ...registryRequiredFields, versions: true, targets: true }).extend(entityExtension).transform(generateRegistryPath);
193
291
  var edgeCacheWorkspaceSchema = workspaceSchema.pick({ ...registryRequiredFields, version: true, versions: true }).extend(entityExtension).transform(generateRegistryPath);
@@ -375,6 +473,33 @@ var edgeCacheCollections = {
375
473
  _path: 1
376
474
  }
377
475
  }),
476
+ apiInstance: defineCollection({
477
+ schema: edgeCacheDocInstanceSchema,
478
+ indexFields: docInstanceIndexFields,
479
+ tableName: DOC_INSTANCE_TABLE,
480
+ mongoCollection: "team/<uid-0>/managed-docs/<uid-1>/instances",
481
+ source: "api",
482
+ priority: 3,
483
+ projection: docInstanceProjection
484
+ }),
485
+ schemaInstance: defineCollection({
486
+ schema: edgeCacheDocInstanceSchema,
487
+ indexFields: docInstanceIndexFields,
488
+ tableName: DOC_INSTANCE_TABLE,
489
+ mongoCollection: "team/<uid-0>/managed-schemas/<uid-1>/instances",
490
+ source: "schema",
491
+ priority: 2,
492
+ projection: docInstanceProjection
493
+ }),
494
+ ruleInstance: defineCollection({
495
+ schema: edgeCacheDocInstanceSchema,
496
+ indexFields: docInstanceIndexFields,
497
+ tableName: DOC_INSTANCE_TABLE,
498
+ mongoCollection: "team/<uid-0>/rules/<uid-1>/instances",
499
+ source: "rule",
500
+ priority: 1,
501
+ projection: docInstanceProjection
502
+ }),
378
503
  rule: defineCollection({
379
504
  schema: edgeCacheRuleSchema,
380
505
  indexFields: ["_registryPath"],
@@ -511,6 +636,15 @@ for (const [key, config] of Object.entries(edgeCacheCollections)) {
511
636
  prioritiesByTable.set(config.tableName, taken);
512
637
  }
513
638
 
639
+ // ../../packages/entities/dist/database/edge-cache-seed.js
640
+ var edgeCacheSeedRecordSchema = external_exports.object({
641
+ seedId: external_exports.string().min(1),
642
+ status: external_exports.enum(["seeding", "complete"]),
643
+ fingerprint: external_exports.string().nullable().default(null),
644
+ startedAt: external_exports.number().nullable().default(null),
645
+ everCompleted: external_exports.boolean().default(false)
646
+ });
647
+
514
648
  // ../../packages/entities/dist/database/mcp-domain-holder.js
515
649
  var MCP_SERVERS_MONGO_COLLECTION = BaseCollections.McpServers(MONGO_PLACEHOLDER_UID);
516
650
 
@@ -0,0 +1,92 @@
1
+ import { createRequire as $$cR } from "node:module"; const require = $$cR(import.meta.url);
2
+ import {
3
+ BaseCollections
4
+ } from "./chunk-JXGF5EHC.js";
5
+ import {
6
+ sdkTrackedApiVersionSpec
7
+ } from "./chunk-KHF2QXBG.js";
8
+ import {
9
+ err,
10
+ ok
11
+ } from "./chunk-5ENKYZA4.js";
12
+ import {
13
+ managedDocSchema
14
+ } from "./chunk-GLWTVLKM.js";
15
+
16
+ // src/domains/sdk/inspect-sdk.ts
17
+ var sdkMetadata = (sdk, builds) => {
18
+ const latestBuild = builds.filter((build) => build.sdk.uid === sdk.uid).reduce(
19
+ (latest, build) => !latest || build.createdAt > latest.createdAt ? build : latest,
20
+ null
21
+ );
22
+ return {
23
+ uid: sdk.uid,
24
+ namespace: sdk.namespace,
25
+ slug: sdk.slug,
26
+ title: sdk.title,
27
+ description: sdk.description,
28
+ isPrivate: sdk.isPrivate,
29
+ createdAt: sdk.createdAt,
30
+ updatedAt: sdk.updatedAt,
31
+ api: sdk.apiUid ? {
32
+ uid: sdk.apiUid,
33
+ trackedVersion: sdkTrackedApiVersionSpec(sdk) ?? null
34
+ } : null,
35
+ currentVersion: sdk.currentVersion,
36
+ targets: sdk.targets.map(({ language, slug }) => ({ language, slug })),
37
+ versions: sdk.versions.map((version) => ({
38
+ version: version.version,
39
+ apiVersion: version.apiVersion,
40
+ status: version.status,
41
+ languages: version.languages,
42
+ createdAt: version.createdAt ?? null,
43
+ publishedAt: version.publishedAt ?? null,
44
+ targets: Object.entries(version.targets).map(([language, state]) => ({
45
+ language,
46
+ activeBuild: state.activeBuild ?? null,
47
+ builtAt: state.builtAt ?? null
48
+ }))
49
+ })),
50
+ latestBuild: latestBuild ? {
51
+ uid: latestBuild.uid,
52
+ version: latestBuild.sdk.version,
53
+ createdAt: latestBuild.createdAt,
54
+ api: {
55
+ uid: latestBuild.api.uid,
56
+ namespace: latestBuild.api.namespace,
57
+ slug: latestBuild.api.slug,
58
+ version: latestBuild.api.version
59
+ },
60
+ targets: latestBuild.targets.map(
61
+ ({ language, slug, buildStatus, gitStatus }) => ({
62
+ language,
63
+ slug,
64
+ buildStatus,
65
+ gitStatus: gitStatus ?? null
66
+ })
67
+ )
68
+ } : null
69
+ };
70
+ };
71
+ var inspectSdk = async (client, teamUid, sdk, builds) => {
72
+ const metadata = sdkMetadata(sdk, builds);
73
+ if (!sdk.apiUid || !metadata.api) return ok({ ...metadata, api: null });
74
+ const api = await client.getOne({
75
+ collectionPath: BaseCollections.ManagedDocs(teamUid),
76
+ query: { uid: sdk.apiUid },
77
+ schema: managedDocSchema.nullable()
78
+ });
79
+ if (api.error) return err(api.message);
80
+ return ok({
81
+ ...metadata,
82
+ api: {
83
+ ...metadata.api,
84
+ namespace: api.data?.namespace ?? null,
85
+ slug: api.data?.slug ?? null
86
+ }
87
+ });
88
+ };
89
+
90
+ export {
91
+ inspectSdk
92
+ };