@scalar/cli 2.15.0 → 2.18.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 (112) hide show
  1. package/README.md +121 -25
  2. package/chunks/{action-3W4IC7QL.js → action-2WVJ2WEW.js} +26 -27
  3. package/chunks/{action-HOCCP353.js → action-4BDZ2CXP.js} +12 -13
  4. package/chunks/{action-3QQSKGM3.js → action-5AXDB5VN.js} +21 -23
  5. package/chunks/{action-LD5B5QQ4.js → action-6I3TJLRO.js} +34 -33
  6. package/chunks/{action-T7SD3ETN.js → action-6WZN63LT.js} +299 -75
  7. package/chunks/{action-IUAYC2SC.js → action-7GZGVTYI.js} +1071 -775
  8. package/chunks/{action-2BGAMGXU.js → action-7ZCJAWI2.js} +9 -9
  9. package/chunks/{action-6HFH7DAW.js → action-A6YOY24G.js} +14 -10
  10. package/chunks/{action-IU2AVNOW.js → action-AGGHY4N2.js} +26 -26
  11. package/chunks/{action-B2WWTOF6.js → action-BVZOA2G5.js} +15 -16
  12. package/chunks/{action-2UZWKMSJ.js → action-BYDJ4R4F.js} +18 -19
  13. package/chunks/{action-HDT7EO7W.js → action-CBAL5CYB.js} +19 -21
  14. package/chunks/action-COFGCCYS.js +89 -0
  15. package/chunks/action-CYU5Q5LT.js +254 -0
  16. package/chunks/{action-MJHLG7AE.js → action-DTQH6CKR.js} +33 -33
  17. package/chunks/{action-P2RPH5R2.js → action-ED5WLLIE.js} +11 -12
  18. package/chunks/action-F4CQ4DW3.js +654 -0
  19. package/chunks/{action-SRFBOLDL.js → action-GQDQU2WE.js} +1 -1
  20. package/chunks/{action-PDSSIW2A.js → action-GVW5PSPT.js} +26 -28
  21. package/chunks/{action-WOLNPEUQ.js → action-H5VRLFCY.js} +16 -12
  22. package/chunks/{action-G2WBTXOK.js → action-IWEAWDT3.js} +19 -19
  23. package/chunks/{action-NZJ4Z64U.js → action-JN6JVQUV.js} +16 -18
  24. package/chunks/{action-PNSWHIHC.js → action-KVM76ZKQ.js} +20 -20
  25. package/chunks/{action-JNH4DCZX.js → action-LLMFEBHH.js} +3 -4
  26. package/chunks/{action-QJMRAFOF.js → action-PEG7AUA6.js} +20 -19
  27. package/chunks/{action-2HPMP473.js → action-QC72LLYE.js} +13 -11
  28. package/chunks/{action-ZTLOQZTT.js → action-QP6MRSQW.js} +16 -15
  29. package/chunks/{action-4HXB3YQR.js → action-R53K22GE.js} +230 -52
  30. package/chunks/{action-U2RJ3ZAU.js → action-SJPWL723.js} +6 -5
  31. package/chunks/{action-57SV3ZBM.js → action-T3R4SDAI.js} +9 -9
  32. package/chunks/{action-777R7LOG.js → action-TT7ZJNST.js} +25 -25
  33. package/chunks/{action-TY4BZEMN.js → action-UPVVJE26.js} +18 -19
  34. package/chunks/{action-MBAAYXKK.js → action-V35W4MRK.js} +18 -19
  35. package/chunks/{action-TR2T2UYB.js → action-W4KGRBRV.js} +9 -9
  36. package/chunks/{action-ENDUKGWS.js → action-ZIVYJCC2.js} +16 -18
  37. package/chunks/{action-7LK4RUDP.js → action-ZU5X2KQX.js} +52 -49
  38. package/chunks/{actions-D5OHPBWC.js → actions-CERT7BL4.js} +25 -26
  39. package/chunks/{actions-RI42JY6H.js → actions-RCIS37Y6.js} +22 -24
  40. package/chunks/{agent-NA3QFKJX.js → agent-CT3RRYPJ.js} +7 -7
  41. package/chunks/{asyncapi-YBTWMTW6.js → asyncapi-DVBS23QW.js} +17 -18
  42. package/chunks/{build.action-4YDNDBXC.js → build.action-7MKMMV6V.js} +38 -32
  43. package/chunks/{chunk-MGGMCT77.js → chunk-36UI2W7I.js} +1 -1
  44. package/chunks/chunk-4BMOCIYO.js +536 -0
  45. package/chunks/{chunk-ADQ6B6QI.js → chunk-5DRLDTTU.js} +1 -1
  46. package/chunks/{chunk-G5WWW7VD.js → chunk-5EO2CVAR.js} +6 -6
  47. package/chunks/{chunk-Q26DFKTY.js → chunk-5GZAGHKL.js} +1 -1
  48. package/chunks/{chunk-DWJMPHLY.js → chunk-7LUXRNKV.js} +27 -2
  49. package/chunks/{chunk-BY4NGQ5D.js → chunk-A2MPF6GE.js} +7 -3
  50. package/chunks/{chunk-5D3T63G4.js → chunk-BIQFYZP6.js} +1 -1
  51. package/chunks/chunk-CNJ4TLU7.js +83 -0
  52. package/chunks/{chunk-UM3WZUGF.js → chunk-CWCRBWA6.js} +7 -3
  53. package/chunks/{chunk-Z6HOHGUJ.js → chunk-CYIGEQOJ.js} +2 -2
  54. package/chunks/{chunk-4S3DGMMZ.js → chunk-DUIMDHQQ.js} +1 -1
  55. package/chunks/{chunk-W7P6VTCG.js → chunk-DVA4NCCY.js} +6 -4
  56. package/chunks/chunk-DWWY3LPC.js +85 -0
  57. package/chunks/{chunk-USVU6AC2.js → chunk-F6E7FJEC.js} +18 -12
  58. package/chunks/{chunk-E24BNP6E.js → chunk-FDW4LC45.js} +1 -1
  59. package/chunks/{chunk-TW2UASEW.js → chunk-FMPJSW6A.js} +4 -4
  60. package/chunks/{chunk-IPWJEGPD.js → chunk-GCVB22TG.js} +2 -2
  61. package/chunks/{chunk-6BQHLHBE.js → chunk-GXKNYM54.js} +3 -3
  62. package/chunks/chunk-I25ZCHBJ.js +22 -0
  63. package/chunks/{chunk-I57ID5K7.js → chunk-JBMHCTZD.js} +8 -1
  64. package/chunks/{chunk-KOLEQNLG.js → chunk-JEOQ7LSA.js} +1 -1
  65. package/chunks/{chunk-QMERQSPM.js → chunk-KI2AVDKM.js} +8 -6
  66. package/chunks/{chunk-2KSOARE4.js → chunk-KSY2GH53.js} +3 -3
  67. package/chunks/{chunk-SHRUJFQI.js → chunk-KWQVA66H.js} +105 -18
  68. package/chunks/{chunk-DLYMDGFW.js → chunk-LPWRG2MS.js} +4 -4
  69. package/chunks/{chunk-Y6GKZ2FM.js → chunk-LVUMNGVA.js} +1 -1
  70. package/chunks/{chunk-PIDLENYN.js → chunk-M34HMQMV.js} +42 -83
  71. package/chunks/{chunk-7FS7BAUX.js → chunk-MRZ5A7LB.js} +133 -19
  72. package/chunks/chunk-O3I3LTTJ.js +24 -0
  73. package/chunks/{chunk-VBHPHAGS.js → chunk-O4DJIA6Y.js} +2 -18
  74. package/chunks/chunk-OKLL5422.js +263 -0
  75. package/chunks/{chunk-HIDIW2FN.js → chunk-OQE3WKI3.js} +1 -1
  76. package/chunks/{chunk-ERZ3HYB5.js → chunk-PMDHYIB4.js} +9 -21
  77. package/chunks/{chunk-IDGT5RAQ.js → chunk-RELSIFIL.js} +2 -2
  78. package/chunks/{chunk-BOCMOHQA.js → chunk-RGJPENX7.js} +1 -1
  79. package/chunks/{chunk-7FGJIUDN.js → chunk-RHAQ4XBA.js} +3 -3
  80. package/chunks/chunk-RQ7QBRJT.js +93 -0
  81. package/chunks/chunk-S3LY7RKP.js +54 -0
  82. package/chunks/{chunk-T76K7QNX.js → chunk-S5OGPH2P.js} +3 -3
  83. package/chunks/{chunk-ANP5XF26.js → chunk-U36HEOGO.js} +12625 -1369
  84. package/chunks/{chunk-IPUJEBMI.js → chunk-UWRJCJVG.js} +1 -1
  85. package/chunks/chunk-V7DBDXSJ.js +24 -0
  86. package/chunks/{chunk-RRYUCZYO.js → chunk-WGTZEX4Y.js} +7 -3
  87. package/chunks/{chunk-7PNOYE6B.js → chunk-Y3CXAIAG.js} +30 -3
  88. package/chunks/{chunk-GOKHFNB2.js → chunk-Z7EH7CJC.js} +3 -3
  89. package/chunks/{chunk-42MIV6WF.js → chunk-ZMJW5UWU.js} +6 -5
  90. package/chunks/chunk-ZQDAPKWX.js +111 -0
  91. package/chunks/{create.action-52K3XAYN.js → create.action-VA2ISPIM.js} +27 -29
  92. package/chunks/{delete.action-47LPLTOX.js → delete.action-AIWMDGXV.js} +26 -28
  93. package/chunks/{delete.action-3NMOQPIR.js → delete.action-GEN6OD7A.js} +26 -28
  94. package/chunks/{diff.action-5TLC2EHT.js → diff.action-LBK656RN.js} +32 -27
  95. package/chunks/{get.action-BCMLG7C7.js → get.action-5SWRNQ3D.js} +20 -19
  96. package/chunks/{get.action-TOZ474GO.js → get.action-UPPPGGI4.js} +29 -23
  97. package/chunks/{list.action-6ZWEENT6.js → list.action-YJZBC25S.js} +26 -28
  98. package/chunks/{list.action-CMAA5KTY.js → list.action-YOWWC4I4.js} +54 -25
  99. package/chunks/{publish.action-U3VIU5LZ.js → publish.action-QMVDHDJZ.js} +52 -49
  100. package/chunks/{update.action-UQHZYVTP.js → update.action-GFDZIGEP.js} +27 -29
  101. package/chunks/{update.action-QZOP25ME.js → update.action-SNGKPS7A.js} +26 -28
  102. package/index.js +688 -212
  103. package/package.json +11 -11
  104. package/skills/scalar-cli/SKILL.md +4 -3
  105. package/template.md +120 -24
  106. package/chunks/action-3KP3WVPZ.js +0 -112
  107. package/chunks/action-APBLB3IU.js +0 -235
  108. package/chunks/chunk-BLY2CF4S.js +0 -58
  109. package/chunks/chunk-BMQFEKHA.js +0 -3534
  110. package/chunks/chunk-EOTD7HAV.js +0 -318
  111. package/chunks/chunk-QXOUDBFK.js +0 -92
  112. package/chunks/chunk-TR5U7G7T.js +0 -32
@@ -1,318 +0,0 @@
1
- import { createRequire as $$cR } from "node:module"; const require = $$cR(import.meta.url);
2
- import {
3
- baseRegistrySchema
4
- } from "./chunk-7PNOYE6B.js";
5
- import {
6
- brandedUid,
7
- docVersionSchema,
8
- entitySchema,
9
- external_exports,
10
- mintUid,
11
- namespaceSchema,
12
- nanoidSchema,
13
- slugSchema,
14
- timestampSchema
15
- } from "./chunk-I57ID5K7.js";
16
-
17
- // ../../packages/entities/dist/sdk/schema.js
18
- var SdkLanguage;
19
- (function(SdkLanguage2) {
20
- SdkLanguage2["Typescript"] = "typescript";
21
- SdkLanguage2["Python"] = "python";
22
- SdkLanguage2["Cli"] = "cli";
23
- SdkLanguage2["CSharp"] = "csharp";
24
- SdkLanguage2["Java"] = "java";
25
- SdkLanguage2["Ruby"] = "ruby";
26
- SdkLanguage2["Php"] = "php";
27
- SdkLanguage2["Go"] = "go";
28
- SdkLanguage2["Rust"] = "rust";
29
- SdkLanguage2["Kotlin"] = "kotlin";
30
- SdkLanguage2["Swift"] = "swift";
31
- SdkLanguage2["Cpp"] = "cpp";
32
- SdkLanguage2["Dart"] = "dart";
33
- })(SdkLanguage || (SdkLanguage = {}));
34
- var sdkTargetDestinationSchema = external_exports.object({
35
- provider: external_exports.literal("github").default("github"),
36
- linkedBy: external_exports.string(),
37
- /**
38
- * GitHub App installation that grants push access. Optional because legacy
39
- * links predate it and it is derivable from `linkedBy` + repo at sync time.
40
- */
41
- installationId: external_exports.number().int().optional(),
42
- /** GitHub repo id — the auth anchor and the webhook routing key. */
43
- id: external_exports.number().int(),
44
- expired: external_exports.boolean().default(false)
45
- }).meta({ id: "sdk-target-destination" });
46
- var sdkSampleRepoSchema = external_exports.object({
47
- provider: external_exports.literal("github").default("github"),
48
- /**
49
- * 'pending' from SDK creation until the repo is provisioned in scalar-sdks;
50
- * 'ready' once it exists (name/installationId are filled in then). The
51
- * pending state lets the dashboard show the section immediately. Defaults to
52
- * 'ready' so pre-existing bindings (which always have a repo) read correctly.
53
- */
54
- status: external_exports.enum(["pending", "ready"]).default("ready"),
55
- /** "scalar-sdks/<repo>" (present once ready). */
56
- name: external_exports.string().optional(),
57
- /** scalar-sdks installation that grants push access for the bot (once ready). */
58
- installationId: external_exports.number().int().optional(),
59
- baseBranch: external_exports.string().min(1).default("main"),
60
- /**
61
- * When provisioning was first kicked for this target (unix seconds), stamped
62
- * as the pending binding is seeded. The dashboard anchors its stalled-timeout
63
- * on it so a target added long after the SDK was created still gets the full
64
- * "Preparing" window instead of reading as stalled immediately. Absent on
65
- * pre-feature bindings (readers fall back to the SDK's `createdAt`).
66
- */
67
- provisionStartedAt: timestampSchema.optional(),
68
- /** Last build whose artifact was pushed to the playground. */
69
- lastSyncedBuild: nanoidSchema.optional()
70
- }).meta({ id: "sdk-sample-repo" });
71
- var sdkTargetSchema = external_exports.object({
72
- language: external_exports.enum(SdkLanguage),
73
- slug: slugSchema.optional(),
74
- destination: sdkTargetDestinationSchema.nullable().default(null),
75
- /**
76
- * Preview repo in scalar-sdks for this target. Independent of `destination`:
77
- * it always mirrors the latest build so users can play with the output before
78
- * setting up a production repo.
79
- */
80
- sample: sdkSampleRepoSchema.nullable().default(null)
81
- }).meta({ id: "sdk-target" });
82
- var sdkVersionTargetStateSchema = external_exports.object({
83
- activeSync: external_exports.object({
84
- repository: external_exports.string(),
85
- /**
86
- * The release PR managed by release-please on scalar-next, when one
87
- * was open after the sync. Release cutting is the repo's own workflow.
88
- */
89
- pullRequest: external_exports.number().optional(),
90
- /** scalar-next tip the sync landed. */
91
- commitHash: external_exports.string()
92
- }).optional(),
93
- /**
94
- * Set when the last combine merge collided: the build awaiting resolution
95
- * on the conflict PR (scalar-merge-conflict into scalar-next), resolved by
96
- * the developer on GitHub. Cleared on a clean reconcile.
97
- */
98
- conflict: external_exports.object({
99
- build: nanoidSchema,
100
- /** The conflict PR into scalar-next, for deep links. */
101
- pullRequest: external_exports.number().optional()
102
- }).optional(),
103
- activeBuild: nanoidSchema.optional(),
104
- /**
105
- * When {@link activeBuild} was recorded (unix seconds) — the closest thing
106
- * we store to when this language's artifact was generated.
107
- *
108
- * The version's own `createdAt`/`publishedAt` cannot answer that. A version
109
- * is cut when the API document changes and may be built much later, and a
110
- * rebuild of an already-published version re-points `activeBuild` without
111
- * moving `publishedAt` — so a reader offered the newest artifact would be
112
- * told it was built whenever the version first shipped. Absent on builds
113
- * recorded before this field existed; readers fall back to the version
114
- * stamps.
115
- */
116
- builtAt: timestampSchema.optional()
117
- }).meta({ id: "sdk-version-target-state" });
118
- var sdkVersionStatusSchema = external_exports.enum(["draft", "published"]);
119
- var sdkVersionSchema = external_exports.object({
120
- version: docVersionSchema,
121
- /**
122
- * The exact API version this SDK version was created against (build
123
- * provenance). Always concrete — the SDK-level `sdkSchema.apiVersion` is
124
- * the range-capable auto-update spec.
125
- */
126
- apiVersion: docVersionSchema.meta({ examples: ["1.2.0"] }),
127
- createdAt: timestampSchema.optional(),
128
- /** Draft while being edited; published once a build of it succeeds. */
129
- status: sdkVersionStatusSchema.default("published").meta({ examples: ["published"] }),
130
- /** Config snapshot for this version. Defaults to `{}` so pre-migration docs still validate. */
131
- config: external_exports.string().default("{}").meta({
132
- examples: ['{"targets":{"typescript":{"packageName":"@acme/sdk"}}}']
133
- }),
134
- /** Language targets this version ships, derived from `config`. */
135
- languages: external_exports.enum(SdkLanguage).array().default([]).meta({ examples: [["typescript"]] }),
136
- publishedAt: timestampSchema.optional(),
137
- /** What created/last-touched this version, for display. */
138
- changeSource: external_exports.enum(["user", "api-version", "created"]).optional(),
139
- /**
140
- * Content identity of the API document save that auto-created this
141
- * version: the managed doc version's `jsonSha` — the same key space as
142
- * {@link sdkBuildApiSchema}'s `documentHash`. Lets redelivered (or
143
- * repeated, identical) save events recognize content the SDK already
144
- * processed instead of minting another version.
145
- */
146
- apiDocumentHash: external_exports.string().optional(),
147
- /** Active sync/build per language, for this version. */
148
- targets: external_exports.partialRecord(external_exports.enum(SdkLanguage), sdkVersionTargetStateSchema).default({})
149
- }).meta({ id: "sdk-version" });
150
- var sdkSchema = baseRegistrySchema.extend({
151
- /** Own uid, branded so it cannot be confused with another entity's uid */
152
- uid: brandedUid().default(mintUid).meta({ default: void 0 }),
153
- /**
154
- * The registry API this SDK is generated from. Null when unlinked — the SDK
155
- * keeps its versions/builds but can't build a new version until re-linked.
156
- *
157
- * Branded as a ManagedDoc uid: this points at a managed DOC, not a managed
158
- * SCHEMA, so comparing it to a `ManagedSchema` uid is a compile error.
159
- */
160
- apiUid: brandedUid().nullable(),
161
- /**
162
- * The API version this SDK follows — the auto-update gate. An exact value
163
- * (`3.0.1`, kept in sync with the version the SDK is on) auto-rebuilds only
164
- * when that version's content changes; a range prefix widens it (`~1.2.0`
165
- * adds patch bumps, `^1.2.3` minors, `3` any 3.x, `*` any version). Ranges
166
- * are user intent and never rewritten by the platform. Distinct from
167
- * `sdkVersionSchema.apiVersion`, the exact build provenance of one SDK
168
- * version. Null while unlinked; absent on pre-feature docs (readers fall
169
- * back to the tracked version with exact semantics). `docVersionSchema`
170
- * keeps the same floor as every other version field: non-empty, no
171
- * reserved names (`latest` would be a spec that can never match).
172
- */
173
- apiVersion: docVersionSchema.nullable().optional(),
174
- /**
175
- * The version label (`sdkVersionSchema.version`) of the SDK version the
176
- * platform treats as current: the one a fresh SDK is created on, moved
177
- * forward as builds publish, and selectable by the user.
178
- */
179
- currentVersion: docVersionSchema,
180
- /**
181
- * The label of the newest published version, the one hosting serves as
182
- * `latest`. Publishing moves it forward by compare-and-swap; deleting the
183
- * version it names moves it to the newest published version left, or null
184
- * when none is. Absent on SDKs not published since the field existed.
185
- */
186
- latestVersion: docVersionSchema.nullish(),
187
- /** All versions available for SDK. */
188
- versions: sdkVersionSchema.array().default([]),
189
- /**
190
- * Persistent per-language registry: every language the SDK has, each with its
191
- * registry slug + git destination. Survives across versions — destinations and
192
- * slugs persist even when a version drops a language. The *active* language set
193
- * is the latest published version's `languages`.
194
- */
195
- targets: sdkTargetSchema.array().min(1),
196
- /**
197
- * Bills this SDK's targets in the standard band whatever its endpoint
198
- * count. Set on the SDKs a team already had when it moved to 2026 pricing,
199
- * which keep that price; it does not expire and only an admin clears it.
200
- * Unset bills by size.
201
- */
202
- billingBandPin: external_exports.literal("standard").nullish(),
203
- /**
204
- * @deprecated Config now lives per-version (`sdkVersionSchema.config`). Kept
205
- * optional for the migration/legacy path; new code reads the version config.
206
- */
207
- config: external_exports.string().optional()
208
- }).meta({ id: "sdk" });
209
- var sdkBuildStatusSchema = external_exports.enum(["pending", "error", "generated"]).meta({ id: "sdk-build-status" });
210
- var sdkGitStatusSchema = external_exports.enum(["pending", "error", "synced", "conflicts"]).meta({ id: "sdk-git-status" });
211
- var sdkBuildApiSchema = external_exports.object({
212
- uid: nanoidSchema,
213
- namespace: namespaceSchema,
214
- version: docVersionSchema,
215
- slug: slugSchema,
216
- upgraded: external_exports.boolean().default(false),
217
- /**
218
- * Identity of the API document content this build was enqueued against:
219
- * the managed doc version's `jsonSha` at enqueue time. Rebuild triggering
220
- * compares it with the version's current `jsonSha` — an in-place content
221
- * rewrite that lands between enqueue and generation makes the comparison
222
- * conservatively re-trigger rather than miss the change. Nullable:
223
- * document versions hashed before `jsonSha` existed carry none, and
224
- * mongobase round-trips an unset optional as null.
225
- */
226
- documentHash: external_exports.string().nullable().optional()
227
- }).meta({ id: "sdk-build-api" });
228
- var sdkbuildSdkSchema = external_exports.object({
229
- uid: nanoidSchema,
230
- namespace: namespaceSchema,
231
- version: docVersionSchema,
232
- slug: slugSchema
233
- }).meta({ id: "sdk-build-sdk" });
234
- var sdkBuildGitSchema = external_exports.object({
235
- /**
236
- * The release PR (clean sync) or conflict PR (conflicted sync), when one
237
- * exists. Nullable: mongobase round-trips an unset optional as null, and a
238
- * strict number parse would drop the doc on read.
239
- */
240
- pullRequest: external_exports.number().nullable().optional(),
241
- commitHash: external_exports.string()
242
- }).optional().meta({ id: "sdk-build-git" });
243
- var sdkBuildTargetSchema = external_exports.object({
244
- /** SDK language to generate */
245
- language: external_exports.enum(SdkLanguage),
246
- /**
247
- * Per-target slug. The build zip is copied to a key under it next to its
248
- * uid key, and readers fall back to that key when the uid key is missing.
249
- * Absent on a target without one.
250
- */
251
- slug: slugSchema.optional(),
252
- /** Build status */
253
- buildStatus: sdkBuildStatusSchema,
254
- /**
255
- * Additional build message. Nullable: mongobase round-trips an unset
256
- * optional as null, and a strict string parse would drop the doc on read.
257
- */
258
- buildMessage: external_exports.string().nullable().optional(),
259
- /** Git sync status */
260
- gitStatus: sdkGitStatusSchema.optional(),
261
- /**
262
- * When the target entered `gitStatus: 'pending'`, in unix seconds. Lets a
263
- * still-"pending" sync be recognized as stalled (a terminal message never
264
- * arrived) so the dashboard can offer a retry instead of spinning forever.
265
- * Nullable for the same round-trip reason as buildMessage.
266
- */
267
- syncStartedAt: external_exports.number().nullable().optional(),
268
- /** Additional git message. Nullable for the same round-trip reason as buildMessage. */
269
- gitMessage: external_exports.string().nullable().optional(),
270
- /**
271
- * Machine-readable git failure class assigned by the generator (e.g.
272
- * 'github-workflows-permission'). Nullable for the same round-trip reason
273
- * as buildMessage.
274
- */
275
- gitErrorCode: external_exports.string().nullable().optional(),
276
- /** Linked git repository name */
277
- repository: external_exports.string().nullable().optional(),
278
- /** Git sync commit and PR */
279
- gitSync: sdkBuildGitSchema
280
- }).meta({ id: "sdk-build-target" });
281
- var sdkBuildSchema = entitySchema.extend({
282
- teamUid: nanoidSchema,
283
- /** SDK metadata on generation */
284
- sdk: sdkbuildSdkSchema,
285
- /** Original API used to generate SDK */
286
- api: sdkBuildApiSchema,
287
- /** Custom SDK config */
288
- config: external_exports.string(),
289
- /** Should auto set active sdk version */
290
- autoBump: external_exports.boolean().default(false),
291
- /** Per-language build targets */
292
- targets: sdkBuildTargetSchema.array().min(1)
293
- }).meta({ id: "sdk-build" });
294
- var sdkBuildLogChunkSchema = entitySchema.extend({
295
- teamUid: nanoidSchema,
296
- buildUid: nanoidSchema,
297
- /** Monotonic order within a build. */
298
- sequence: external_exports.number().int(),
299
- chunk: external_exports.string()
300
- }).meta({ id: "sdk-build-log-chunk" });
301
- var sdkCodeSampleSchema = external_exports.object({
302
- lang: external_exports.string(),
303
- /**
304
- * Optional, the way the extension itself defines it — most hand-authored
305
- * samples carry only `lang` and `source`. Missing labels fall back to `lang`
306
- * when the SDK service normalizes samples.
307
- */
308
- label: external_exports.string().optional(),
309
- source: external_exports.string()
310
- }).meta({ id: "sdk-code-sample" });
311
-
312
- export {
313
- SdkLanguage,
314
- sdkVersionTargetStateSchema,
315
- sdkVersionStatusSchema,
316
- sdkSchema,
317
- sdkBuildSchema
318
- };
@@ -1,92 +0,0 @@
1
- import { createRequire as $$cR } from "node:module"; const require = $$cR(import.meta.url);
2
- import {
3
- BaseCollections
4
- } from "./chunk-SHRUJFQI.js";
5
- import {
6
- sdkTrackedApiVersionSpec
7
- } from "./chunk-ANP5XF26.js";
8
- import {
9
- managedDocSchema
10
- } from "./chunk-2KSOARE4.js";
11
- import {
12
- err,
13
- ok
14
- } from "./chunk-4S3DGMMZ.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
- };
@@ -1,32 +0,0 @@
1
- import { createRequire as $$cR } from "node:module"; const require = $$cR(import.meta.url);
2
- import {
3
- version
4
- } from "./chunk-DWJMPHLY.js";
5
-
6
- // src/config.ts
7
- import { portNumbers } from "get-port";
8
- var config = {
9
- projects: {
10
- dashboard: process.env.DASHBOARD_URL ?? "https://dashboard.scalar.com",
11
- sandbox: process.env.SANDBOX_URL ?? "https://sandbox.scalar.com",
12
- registry: process.env.REGISTRY_URL ?? "https://registry.scalar.com"
13
- },
14
- mcpUrl: process.env.MCP_URL ?? "https://mcp.scalar.com",
15
- services: {
16
- api: process.env.BASE_URL ?? "https://services.scalar.com"
17
- },
18
- auth: {
19
- /** The auth server the CLI signs in with and trades personal tokens at */
20
- origin: process.env.AUTH_URL ?? "https://auth.scalar.com",
21
- callback: {
22
- preferredPortRange: process.env.PREFERRED_PORT ? Number.parseInt(process.env.PREFERRED_PORT) : portNumbers(4799, 5100)
23
- }
24
- },
25
- cdnUrl: process.env.CDN_URL ?? "https://cdn.scalar.com",
26
- publishTld: process.env.PUBLISH_TLD ?? ((URL.parse(process.env.BASE_URL ?? "", "https://services.scalar.com")?.hostname ?? "services.scalar.com") === "services.scalar.com" ? "apidocumentation.com" : "staging-apidocumentation.com"),
27
- ssgDocsIsolateVersion: process.env.SSG_DOCS_ISOLATE_VERSION ?? version
28
- };
29
-
30
- export {
31
- config
32
- };