@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.
- package/README.md +121 -25
- package/chunks/{action-3W4IC7QL.js → action-2WVJ2WEW.js} +26 -27
- package/chunks/{action-HOCCP353.js → action-4BDZ2CXP.js} +12 -13
- package/chunks/{action-3QQSKGM3.js → action-5AXDB5VN.js} +21 -23
- package/chunks/{action-LD5B5QQ4.js → action-6I3TJLRO.js} +34 -33
- package/chunks/{action-T7SD3ETN.js → action-6WZN63LT.js} +299 -75
- package/chunks/{action-IUAYC2SC.js → action-7GZGVTYI.js} +1071 -775
- package/chunks/{action-2BGAMGXU.js → action-7ZCJAWI2.js} +9 -9
- package/chunks/{action-6HFH7DAW.js → action-A6YOY24G.js} +14 -10
- package/chunks/{action-IU2AVNOW.js → action-AGGHY4N2.js} +26 -26
- package/chunks/{action-B2WWTOF6.js → action-BVZOA2G5.js} +15 -16
- package/chunks/{action-2UZWKMSJ.js → action-BYDJ4R4F.js} +18 -19
- package/chunks/{action-HDT7EO7W.js → action-CBAL5CYB.js} +19 -21
- package/chunks/action-COFGCCYS.js +89 -0
- package/chunks/action-CYU5Q5LT.js +254 -0
- package/chunks/{action-MJHLG7AE.js → action-DTQH6CKR.js} +33 -33
- package/chunks/{action-P2RPH5R2.js → action-ED5WLLIE.js} +11 -12
- package/chunks/action-F4CQ4DW3.js +654 -0
- package/chunks/{action-SRFBOLDL.js → action-GQDQU2WE.js} +1 -1
- package/chunks/{action-PDSSIW2A.js → action-GVW5PSPT.js} +26 -28
- package/chunks/{action-WOLNPEUQ.js → action-H5VRLFCY.js} +16 -12
- package/chunks/{action-G2WBTXOK.js → action-IWEAWDT3.js} +19 -19
- package/chunks/{action-NZJ4Z64U.js → action-JN6JVQUV.js} +16 -18
- package/chunks/{action-PNSWHIHC.js → action-KVM76ZKQ.js} +20 -20
- package/chunks/{action-JNH4DCZX.js → action-LLMFEBHH.js} +3 -4
- package/chunks/{action-QJMRAFOF.js → action-PEG7AUA6.js} +20 -19
- package/chunks/{action-2HPMP473.js → action-QC72LLYE.js} +13 -11
- package/chunks/{action-ZTLOQZTT.js → action-QP6MRSQW.js} +16 -15
- package/chunks/{action-4HXB3YQR.js → action-R53K22GE.js} +230 -52
- package/chunks/{action-U2RJ3ZAU.js → action-SJPWL723.js} +6 -5
- package/chunks/{action-57SV3ZBM.js → action-T3R4SDAI.js} +9 -9
- package/chunks/{action-777R7LOG.js → action-TT7ZJNST.js} +25 -25
- package/chunks/{action-TY4BZEMN.js → action-UPVVJE26.js} +18 -19
- package/chunks/{action-MBAAYXKK.js → action-V35W4MRK.js} +18 -19
- package/chunks/{action-TR2T2UYB.js → action-W4KGRBRV.js} +9 -9
- package/chunks/{action-ENDUKGWS.js → action-ZIVYJCC2.js} +16 -18
- package/chunks/{action-7LK4RUDP.js → action-ZU5X2KQX.js} +52 -49
- package/chunks/{actions-D5OHPBWC.js → actions-CERT7BL4.js} +25 -26
- package/chunks/{actions-RI42JY6H.js → actions-RCIS37Y6.js} +22 -24
- package/chunks/{agent-NA3QFKJX.js → agent-CT3RRYPJ.js} +7 -7
- package/chunks/{asyncapi-YBTWMTW6.js → asyncapi-DVBS23QW.js} +17 -18
- package/chunks/{build.action-4YDNDBXC.js → build.action-7MKMMV6V.js} +38 -32
- package/chunks/{chunk-MGGMCT77.js → chunk-36UI2W7I.js} +1 -1
- package/chunks/chunk-4BMOCIYO.js +536 -0
- package/chunks/{chunk-ADQ6B6QI.js → chunk-5DRLDTTU.js} +1 -1
- package/chunks/{chunk-G5WWW7VD.js → chunk-5EO2CVAR.js} +6 -6
- package/chunks/{chunk-Q26DFKTY.js → chunk-5GZAGHKL.js} +1 -1
- package/chunks/{chunk-DWJMPHLY.js → chunk-7LUXRNKV.js} +27 -2
- package/chunks/{chunk-BY4NGQ5D.js → chunk-A2MPF6GE.js} +7 -3
- package/chunks/{chunk-5D3T63G4.js → chunk-BIQFYZP6.js} +1 -1
- package/chunks/chunk-CNJ4TLU7.js +83 -0
- package/chunks/{chunk-UM3WZUGF.js → chunk-CWCRBWA6.js} +7 -3
- package/chunks/{chunk-Z6HOHGUJ.js → chunk-CYIGEQOJ.js} +2 -2
- package/chunks/{chunk-4S3DGMMZ.js → chunk-DUIMDHQQ.js} +1 -1
- package/chunks/{chunk-W7P6VTCG.js → chunk-DVA4NCCY.js} +6 -4
- package/chunks/chunk-DWWY3LPC.js +85 -0
- package/chunks/{chunk-USVU6AC2.js → chunk-F6E7FJEC.js} +18 -12
- package/chunks/{chunk-E24BNP6E.js → chunk-FDW4LC45.js} +1 -1
- package/chunks/{chunk-TW2UASEW.js → chunk-FMPJSW6A.js} +4 -4
- package/chunks/{chunk-IPWJEGPD.js → chunk-GCVB22TG.js} +2 -2
- package/chunks/{chunk-6BQHLHBE.js → chunk-GXKNYM54.js} +3 -3
- package/chunks/chunk-I25ZCHBJ.js +22 -0
- package/chunks/{chunk-I57ID5K7.js → chunk-JBMHCTZD.js} +8 -1
- package/chunks/{chunk-KOLEQNLG.js → chunk-JEOQ7LSA.js} +1 -1
- package/chunks/{chunk-QMERQSPM.js → chunk-KI2AVDKM.js} +8 -6
- package/chunks/{chunk-2KSOARE4.js → chunk-KSY2GH53.js} +3 -3
- package/chunks/{chunk-SHRUJFQI.js → chunk-KWQVA66H.js} +105 -18
- package/chunks/{chunk-DLYMDGFW.js → chunk-LPWRG2MS.js} +4 -4
- package/chunks/{chunk-Y6GKZ2FM.js → chunk-LVUMNGVA.js} +1 -1
- package/chunks/{chunk-PIDLENYN.js → chunk-M34HMQMV.js} +42 -83
- package/chunks/{chunk-7FS7BAUX.js → chunk-MRZ5A7LB.js} +133 -19
- package/chunks/chunk-O3I3LTTJ.js +24 -0
- package/chunks/{chunk-VBHPHAGS.js → chunk-O4DJIA6Y.js} +2 -18
- package/chunks/chunk-OKLL5422.js +263 -0
- package/chunks/{chunk-HIDIW2FN.js → chunk-OQE3WKI3.js} +1 -1
- package/chunks/{chunk-ERZ3HYB5.js → chunk-PMDHYIB4.js} +9 -21
- package/chunks/{chunk-IDGT5RAQ.js → chunk-RELSIFIL.js} +2 -2
- package/chunks/{chunk-BOCMOHQA.js → chunk-RGJPENX7.js} +1 -1
- package/chunks/{chunk-7FGJIUDN.js → chunk-RHAQ4XBA.js} +3 -3
- package/chunks/chunk-RQ7QBRJT.js +93 -0
- package/chunks/chunk-S3LY7RKP.js +54 -0
- package/chunks/{chunk-T76K7QNX.js → chunk-S5OGPH2P.js} +3 -3
- package/chunks/{chunk-ANP5XF26.js → chunk-U36HEOGO.js} +12625 -1369
- package/chunks/{chunk-IPUJEBMI.js → chunk-UWRJCJVG.js} +1 -1
- package/chunks/chunk-V7DBDXSJ.js +24 -0
- package/chunks/{chunk-RRYUCZYO.js → chunk-WGTZEX4Y.js} +7 -3
- package/chunks/{chunk-7PNOYE6B.js → chunk-Y3CXAIAG.js} +30 -3
- package/chunks/{chunk-GOKHFNB2.js → chunk-Z7EH7CJC.js} +3 -3
- package/chunks/{chunk-42MIV6WF.js → chunk-ZMJW5UWU.js} +6 -5
- package/chunks/chunk-ZQDAPKWX.js +111 -0
- package/chunks/{create.action-52K3XAYN.js → create.action-VA2ISPIM.js} +27 -29
- package/chunks/{delete.action-47LPLTOX.js → delete.action-AIWMDGXV.js} +26 -28
- package/chunks/{delete.action-3NMOQPIR.js → delete.action-GEN6OD7A.js} +26 -28
- package/chunks/{diff.action-5TLC2EHT.js → diff.action-LBK656RN.js} +32 -27
- package/chunks/{get.action-BCMLG7C7.js → get.action-5SWRNQ3D.js} +20 -19
- package/chunks/{get.action-TOZ474GO.js → get.action-UPPPGGI4.js} +29 -23
- package/chunks/{list.action-6ZWEENT6.js → list.action-YJZBC25S.js} +26 -28
- package/chunks/{list.action-CMAA5KTY.js → list.action-YOWWC4I4.js} +54 -25
- package/chunks/{publish.action-U3VIU5LZ.js → publish.action-QMVDHDJZ.js} +52 -49
- package/chunks/{update.action-UQHZYVTP.js → update.action-GFDZIGEP.js} +27 -29
- package/chunks/{update.action-QZOP25ME.js → update.action-SNGKPS7A.js} +26 -28
- package/index.js +688 -212
- package/package.json +11 -11
- package/skills/scalar-cli/SKILL.md +4 -3
- package/template.md +120 -24
- package/chunks/action-3KP3WVPZ.js +0 -112
- package/chunks/action-APBLB3IU.js +0 -235
- package/chunks/chunk-BLY2CF4S.js +0 -58
- package/chunks/chunk-BMQFEKHA.js +0 -3534
- package/chunks/chunk-EOTD7HAV.js +0 -318
- package/chunks/chunk-QXOUDBFK.js +0 -92
- package/chunks/chunk-TR5U7G7T.js +0 -32
|
@@ -0,0 +1,536 @@
|
|
|
1
|
+
import { createRequire as $$cR } from "node:module"; const require = $$cR(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
baseRegistrySchema,
|
|
4
|
+
contentShaSchema
|
|
5
|
+
} from "./chunk-Y3CXAIAG.js";
|
|
6
|
+
import {
|
|
7
|
+
brandedUid,
|
|
8
|
+
docVersionSchema,
|
|
9
|
+
entitySchema,
|
|
10
|
+
external_exports,
|
|
11
|
+
mintUid,
|
|
12
|
+
namespaceSchema,
|
|
13
|
+
nanoidSchema,
|
|
14
|
+
nullAsDefault,
|
|
15
|
+
slugSchema,
|
|
16
|
+
timestampSchema
|
|
17
|
+
} from "./chunk-JBMHCTZD.js";
|
|
18
|
+
|
|
19
|
+
// ../../packages/entities/dist/sdk/schema.js
|
|
20
|
+
var SdkLanguage;
|
|
21
|
+
(function(SdkLanguage2) {
|
|
22
|
+
SdkLanguage2["Typescript"] = "typescript";
|
|
23
|
+
SdkLanguage2["Python"] = "python";
|
|
24
|
+
SdkLanguage2["Cli"] = "cli";
|
|
25
|
+
SdkLanguage2["CSharp"] = "csharp";
|
|
26
|
+
SdkLanguage2["Java"] = "java";
|
|
27
|
+
SdkLanguage2["Ruby"] = "ruby";
|
|
28
|
+
SdkLanguage2["Php"] = "php";
|
|
29
|
+
SdkLanguage2["Go"] = "go";
|
|
30
|
+
SdkLanguage2["Rust"] = "rust";
|
|
31
|
+
SdkLanguage2["Kotlin"] = "kotlin";
|
|
32
|
+
SdkLanguage2["Swift"] = "swift";
|
|
33
|
+
SdkLanguage2["Cpp"] = "cpp";
|
|
34
|
+
SdkLanguage2["Dart"] = "dart";
|
|
35
|
+
})(SdkLanguage || (SdkLanguage = {}));
|
|
36
|
+
var SDK_LANGUAGES = new Set(Object.values(SdkLanguage));
|
|
37
|
+
var SdkLanguageLabels = Object.freeze({
|
|
38
|
+
[SdkLanguage.Typescript]: "Typescript",
|
|
39
|
+
[SdkLanguage.Python]: "Python",
|
|
40
|
+
[SdkLanguage.Cli]: "CLI",
|
|
41
|
+
[SdkLanguage.CSharp]: "C#",
|
|
42
|
+
[SdkLanguage.Java]: "Java",
|
|
43
|
+
[SdkLanguage.Ruby]: "Ruby",
|
|
44
|
+
[SdkLanguage.Php]: "PHP",
|
|
45
|
+
[SdkLanguage.Go]: "Go",
|
|
46
|
+
[SdkLanguage.Rust]: "Rust",
|
|
47
|
+
[SdkLanguage.Kotlin]: "Kotlin",
|
|
48
|
+
[SdkLanguage.Swift]: "Swift",
|
|
49
|
+
[SdkLanguage.Cpp]: "C++",
|
|
50
|
+
[SdkLanguage.Dart]: "Dart"
|
|
51
|
+
});
|
|
52
|
+
var sdkTargetDestinationSchema = external_exports.object({
|
|
53
|
+
provider: external_exports.literal("github").default("github"),
|
|
54
|
+
linkedBy: external_exports.string(),
|
|
55
|
+
/**
|
|
56
|
+
* GitHub App installation that grants push access. Optional because legacy
|
|
57
|
+
* links predate it and it is derivable from `linkedBy` + repo at sync time.
|
|
58
|
+
*/
|
|
59
|
+
installationId: external_exports.number().int().optional(),
|
|
60
|
+
/** GitHub repo id — the auth anchor and the webhook routing key. */
|
|
61
|
+
id: external_exports.number().int(),
|
|
62
|
+
expired: external_exports.boolean().default(false)
|
|
63
|
+
}).meta({ id: "sdk-target-destination" });
|
|
64
|
+
var sdkSampleRepoSchema = external_exports.object({
|
|
65
|
+
provider: external_exports.literal("github").default("github"),
|
|
66
|
+
/**
|
|
67
|
+
* 'pending' from SDK creation until the repo is provisioned in scalar-sdks;
|
|
68
|
+
* 'ready' once it exists (name/installationId are filled in then). The
|
|
69
|
+
* pending state lets the dashboard show the section immediately. Defaults to
|
|
70
|
+
* 'ready' so pre-existing bindings (which always have a repo) read correctly.
|
|
71
|
+
*/
|
|
72
|
+
status: external_exports.enum(["pending", "ready"]).default("ready"),
|
|
73
|
+
/** "scalar-sdks/<repo>" (present once ready). */
|
|
74
|
+
name: external_exports.string().optional(),
|
|
75
|
+
/** scalar-sdks installation that grants push access for the bot (once ready). */
|
|
76
|
+
installationId: external_exports.number().int().optional(),
|
|
77
|
+
baseBranch: external_exports.string().min(1).default("main"),
|
|
78
|
+
/**
|
|
79
|
+
* When provisioning was first kicked for this target (unix seconds), stamped
|
|
80
|
+
* as the pending binding is seeded. The dashboard anchors its stalled-timeout
|
|
81
|
+
* on it so a target added long after the SDK was created still gets the full
|
|
82
|
+
* "Preparing" window instead of reading as stalled immediately. Absent on
|
|
83
|
+
* pre-feature bindings (readers fall back to the SDK's `createdAt`).
|
|
84
|
+
*/
|
|
85
|
+
provisionStartedAt: timestampSchema.optional(),
|
|
86
|
+
/** Last build whose artifact was pushed to the playground. */
|
|
87
|
+
lastSyncedBuild: nanoidSchema.optional()
|
|
88
|
+
}).meta({ id: "sdk-sample-repo" });
|
|
89
|
+
var sdkTargetSchema = external_exports.object({
|
|
90
|
+
language: external_exports.enum(SdkLanguage),
|
|
91
|
+
slug: slugSchema.optional(),
|
|
92
|
+
destination: sdkTargetDestinationSchema.nullable().default(null),
|
|
93
|
+
/**
|
|
94
|
+
* Preview repo in scalar-sdks for this target. Independent of `destination`:
|
|
95
|
+
* it always mirrors the latest build so users can play with the output before
|
|
96
|
+
* setting up a production repo.
|
|
97
|
+
*/
|
|
98
|
+
sample: sdkSampleRepoSchema.nullable().default(null)
|
|
99
|
+
}).meta({ id: "sdk-target" });
|
|
100
|
+
var sdkEnvironmentPolicySchema = external_exports.enum(["automatic", "manual"]).meta({ id: "sdk-environment-policy" });
|
|
101
|
+
var sdkLanguagePoliciesSchema = external_exports.partialRecord(external_exports.enum(SdkLanguage), sdkEnvironmentPolicySchema).meta({ id: "sdk-language-policies" });
|
|
102
|
+
var SDK_PRODUCTION_ENVIRONMENT = "production";
|
|
103
|
+
var sdkRepoCommitShaSchema = external_exports.string().regex(/^(?:[0-9a-f]{40}|[0-9a-f]{64})$/, "Commit sha must be a full lowercase hex sha");
|
|
104
|
+
var sdkLanguagePointerSchema = external_exports.object({
|
|
105
|
+
build: nanoidSchema,
|
|
106
|
+
at: external_exports.number().int().nonnegative()
|
|
107
|
+
}).meta({ id: "sdk-language-pointer" });
|
|
108
|
+
var sdkLanguagePointersSchema = external_exports.partialRecord(external_exports.enum(SdkLanguage), sdkLanguagePointerSchema);
|
|
109
|
+
var sdkDeliveredPointerSchema = sdkLanguagePointerSchema.extend({ snapshot: sdkRepoCommitShaSchema.nullish() }).meta({ id: "sdk-delivered-pointer" });
|
|
110
|
+
var sdkLanguageCurrentSchema = external_exports.object({
|
|
111
|
+
build: nanoidSchema,
|
|
112
|
+
version: external_exports.string(),
|
|
113
|
+
/** The version record's `sortKey`. */
|
|
114
|
+
sortKey: external_exports.string(),
|
|
115
|
+
at: external_exports.number().int().nonnegative(),
|
|
116
|
+
/**
|
|
117
|
+
* When the language's last set-active ran, in epoch milliseconds: a
|
|
118
|
+
* completion moves the tag only for a build triggered after it, whatever
|
|
119
|
+
* its version, so a build in flight at a rollback cannot undo it. Only a
|
|
120
|
+
* set-active writes it; a completion that moves the tag, and a version
|
|
121
|
+
* delete that moves it to another label, carry the stored one on.
|
|
122
|
+
*/
|
|
123
|
+
floor: external_exports.number().int().nonnegative().nullish()
|
|
124
|
+
}).meta({ id: "sdk-language-current" });
|
|
125
|
+
var sdkLanguageCurrentsSchema = external_exports.partialRecord(external_exports.enum(SdkLanguage), sdkLanguageCurrentSchema).meta({ id: "sdk-language-currents" });
|
|
126
|
+
var sdkEnvironmentSchema = external_exports.object({
|
|
127
|
+
/**
|
|
128
|
+
* Per language, the build the git sync last delivered to the language's
|
|
129
|
+
* repository, the next merge's base. `at` is when that sync was
|
|
130
|
+
* dispatched: syncs of one repository run in dispatch order, so a later
|
|
131
|
+
* dispatch is a later delivery whatever order completions arrive in.
|
|
132
|
+
*/
|
|
133
|
+
delivered: nullAsDefault(external_exports.partialRecord(external_exports.enum(SdkLanguage), sdkDeliveredPointerSchema).default(() => ({}))),
|
|
134
|
+
/**
|
|
135
|
+
* Per language, the newest git sync dispatched to the language's
|
|
136
|
+
* repository, `at` being its dispatch time. A sync message older than it
|
|
137
|
+
* is skipped (`supersedeSdkGitSync` in core), so a sync published out of
|
|
138
|
+
* dispatch order never pushes an older build over a newer one. Absent
|
|
139
|
+
* before the first dispatch that records it.
|
|
140
|
+
*/
|
|
141
|
+
dispatched: sdkLanguagePointersSchema.nullish()
|
|
142
|
+
}).meta({ id: "sdk-environment" });
|
|
143
|
+
var emptySdkEnvironment = () => ({
|
|
144
|
+
delivered: {}
|
|
145
|
+
});
|
|
146
|
+
var sdkEnvironmentsSchema = external_exports.object({
|
|
147
|
+
production: nullAsDefault(sdkEnvironmentSchema.default(emptySdkEnvironment))
|
|
148
|
+
});
|
|
149
|
+
var sdkSchema = baseRegistrySchema.extend({
|
|
150
|
+
/** Own uid, branded so it cannot be confused with another entity's uid */
|
|
151
|
+
uid: brandedUid().default(mintUid).meta({ default: void 0 }),
|
|
152
|
+
/**
|
|
153
|
+
* The registry API this SDK is generated from. Null when unlinked — the SDK
|
|
154
|
+
* keeps its versions/builds but can't build a new version until re-linked.
|
|
155
|
+
*
|
|
156
|
+
* Branded as a ManagedDoc uid: this points at a managed DOC, not a managed
|
|
157
|
+
* SCHEMA, so comparing it to a `ManagedSchema` uid is a compile error.
|
|
158
|
+
*/
|
|
159
|
+
apiUid: brandedUid().nullable(),
|
|
160
|
+
/**
|
|
161
|
+
* The current tag per language: what a request without a version serves.
|
|
162
|
+
* Each language is written by one conditional update of its own field.
|
|
163
|
+
* Always stored as an object, a stored null reading as empty, so a dotted
|
|
164
|
+
* `$set` of one language never meets a null parent.
|
|
165
|
+
*/
|
|
166
|
+
current: nullAsDefault(sdkLanguageCurrentsSchema.default(() => ({}))),
|
|
167
|
+
/**
|
|
168
|
+
* The label {@link current} shows as one value, for the CLI and API
|
|
169
|
+
* (`sdkCurrentDisplayVersion`). Serving reads {@link current}.
|
|
170
|
+
*/
|
|
171
|
+
currentVersion: docVersionSchema,
|
|
172
|
+
/**
|
|
173
|
+
* The latest tag: the highest version label holding an active build, the
|
|
174
|
+
* one `latest` names. Moved by one conditional update on
|
|
175
|
+
* {@link latestSortKey}.
|
|
176
|
+
*/
|
|
177
|
+
latestVersion: docVersionSchema.nullish(),
|
|
178
|
+
/** `sdkVersionSortKey` of {@link latestVersion}, which a minted label must exceed to move it. */
|
|
179
|
+
latestSortKey: external_exports.string().nullish(),
|
|
180
|
+
/**
|
|
181
|
+
* Persistent per-language registry: every language the SDK has, each with its
|
|
182
|
+
* registry slug + git destination. Destinations and slugs persist even when
|
|
183
|
+
* the config drops a language; the next build builds the targets the
|
|
184
|
+
* config declares (`sdkDeclaredTargets`).
|
|
185
|
+
*/
|
|
186
|
+
targets: sdkTargetSchema.array().min(1),
|
|
187
|
+
/**
|
|
188
|
+
* Bills this SDK's targets in the standard band whatever its endpoint
|
|
189
|
+
* count. Set on the SDKs a team already had when it moved to 2026 pricing,
|
|
190
|
+
* which keep that price; it does not expire and only an admin clears it.
|
|
191
|
+
* Unset bills by size.
|
|
192
|
+
*/
|
|
193
|
+
billingBandPin: external_exports.literal("standard").nullish(),
|
|
194
|
+
/**
|
|
195
|
+
* The one editable SDK config. A save writes it, bumps
|
|
196
|
+
* {@link configRevision} and stores its blob under its `configSha`; every
|
|
197
|
+
* build snapshots it into `sdkBuildSchema.config`. Absent on SDKs saved
|
|
198
|
+
* before it existed.
|
|
199
|
+
*/
|
|
200
|
+
config: external_exports.string().optional(),
|
|
201
|
+
/**
|
|
202
|
+
* Bumped by every config save. The config build compares it with the
|
|
203
|
+
* revision its task was created for, so saves landing before the task
|
|
204
|
+
* runs build once. Null before the first save that stamps it.
|
|
205
|
+
*/
|
|
206
|
+
configRevision: external_exports.number().int().nonnegative().nullish(),
|
|
207
|
+
/**
|
|
208
|
+
* When a save last changed {@link config}, in unix seconds. Unlike
|
|
209
|
+
* `updatedAt`, which every write stamps, only a config save moves it.
|
|
210
|
+
* Absent before the first save that stamps it.
|
|
211
|
+
*/
|
|
212
|
+
configSavedAt: timestampSchema.nullish(),
|
|
213
|
+
/**
|
|
214
|
+
* When migration 78 folded the SDK's per-version configs into
|
|
215
|
+
* {@link config}, in epoch milliseconds; an SDK created since carries its
|
|
216
|
+
* creation time. Until it is set, {@link config} may predate the SDK's
|
|
217
|
+
* edits, so nothing builds, promotes or saves it (`sdkConfigMigrated`).
|
|
218
|
+
*/
|
|
219
|
+
configFoldedAt: external_exports.number().int().nonnegative().nullish(),
|
|
220
|
+
/**
|
|
221
|
+
* When migration 79 wrote the SDK's version records and {@link current},
|
|
222
|
+
* in epoch milliseconds; an SDK created since carries its creation time.
|
|
223
|
+
* Until it is set, a language without a current is not yet known to have
|
|
224
|
+
* none, so hosting answers a request without a version with a retryable
|
|
225
|
+
* 503 rather than a 404.
|
|
226
|
+
*/
|
|
227
|
+
versionPointersAt: external_exports.number().int().nonnegative().nullish(),
|
|
228
|
+
/**
|
|
229
|
+
* Per-environment delivery. Always stored as objects, down to
|
|
230
|
+
* each environment's maps, so a dotted `$set` never meets a null parent;
|
|
231
|
+
* a stored null or partial shape reads as the empty one.
|
|
232
|
+
*/
|
|
233
|
+
environments: nullAsDefault(sdkEnvironmentsSchema.default(() => ({
|
|
234
|
+
production: emptySdkEnvironment()
|
|
235
|
+
})))
|
|
236
|
+
}).meta({ id: "sdk" });
|
|
237
|
+
var sdkBuildStatusSchema = external_exports.enum(["pending", "error", "generated"]).meta({ id: "sdk-build-status" });
|
|
238
|
+
var sdkBuildStageSchema = external_exports.enum(["dispatch", "generate", "merge", "install", "compile", "package"]).meta({ id: "sdk-build-stage" });
|
|
239
|
+
var sdkGeneratorStageSchema = sdkBuildStageSchema.exclude(["dispatch"]).meta({ id: "sdk-generator-stage" });
|
|
240
|
+
var sdkBuildReasonSchema = external_exports.enum(["document", "config", "custom-code", "manual", "rebuild"]).meta({ id: "sdk-build-reason" });
|
|
241
|
+
var sdkBuildInputsSchema = external_exports.object({
|
|
242
|
+
/** {@link SDK_BUILD_SCHEMA_VERSION} when the build was recorded. */
|
|
243
|
+
schemaVersion: external_exports.number().int().nonnegative(),
|
|
244
|
+
document: external_exports.object({
|
|
245
|
+
uid: nanoidSchema,
|
|
246
|
+
/** The document version label the build was made from. */
|
|
247
|
+
label: docVersionSchema,
|
|
248
|
+
/**
|
|
249
|
+
* The document instance (its commit) read at trigger time, as
|
|
250
|
+
* provenance; the hash keys on {@link jsonSha}, so a revert to the same
|
|
251
|
+
* bytes reuses. Null on builds triggered before it was recorded.
|
|
252
|
+
*/
|
|
253
|
+
instanceUid: external_exports.string().nullish(),
|
|
254
|
+
/** The document instance's `jsonSha`. Null on document versions hashed before it existed. */
|
|
255
|
+
jsonSha: external_exports.string().nullable(),
|
|
256
|
+
/**
|
|
257
|
+
* The sha of the document with its external `$ref`s resolved, when it
|
|
258
|
+
* has any ({@link sdkBuildApiSchema}'s `bundleHash`). Absent on builds
|
|
259
|
+
* recorded before it was, and on documents without one.
|
|
260
|
+
*/
|
|
261
|
+
bundleSha: contentShaSchema.nullish()
|
|
262
|
+
}),
|
|
263
|
+
/**
|
|
264
|
+
* Whether the build reads the document's upgraded variant (normalized to
|
|
265
|
+
* the current OpenAPI version on upload), which is stored under the same
|
|
266
|
+
* `jsonSha` as the raw one. Absent on builds recorded before it counted.
|
|
267
|
+
*/
|
|
268
|
+
upgraded: external_exports.boolean().nullish(),
|
|
269
|
+
/** sha-256 of the config string, naming its blob under the SDK's artifacts. */
|
|
270
|
+
configSha: contentShaSchema,
|
|
271
|
+
/**
|
|
272
|
+
* The `@scalar/sdk-generator` version from core's `SDK_GENERATOR_VERSION`.
|
|
273
|
+
* Null on builds recorded before it was configured, which cannot be hashed.
|
|
274
|
+
*/
|
|
275
|
+
generatorVersion: external_exports.string().nullable(),
|
|
276
|
+
/**
|
|
277
|
+
* The install and compile toolchains baked into sdk-generator's image,
|
|
278
|
+
* from core's `SDK_TOOLCHAIN_VERSION`: changes when a toolchain does,
|
|
279
|
+
* not with each deploy. Absent on builds recorded before it counted.
|
|
280
|
+
*/
|
|
281
|
+
toolchainVersion: external_exports.string().nullish(),
|
|
282
|
+
/** The languages the build covers, sorted. */
|
|
283
|
+
languages: external_exports.enum(SdkLanguage).array(),
|
|
284
|
+
/**
|
|
285
|
+
* The `scalar-next` commit merged per language; null or absent for a
|
|
286
|
+
* language without a live repository.
|
|
287
|
+
*/
|
|
288
|
+
repoShas: external_exports.partialRecord(external_exports.enum(SdkLanguage), sdkRepoCommitShaSchema.nullable()).default({}),
|
|
289
|
+
/**
|
|
290
|
+
* Per language with a `scalar-next` commit, the delivered build the merge
|
|
291
|
+
* stage takes its base from (`deliveredBuild` on `CoreSdkBuildCreated`).
|
|
292
|
+
* Absent for a language without one, and on builds recorded before it
|
|
293
|
+
* was tracked.
|
|
294
|
+
*/
|
|
295
|
+
mergeBases: external_exports.partialRecord(external_exports.enum(SdkLanguage), nanoidSchema).nullish(),
|
|
296
|
+
/**
|
|
297
|
+
* Per language in {@link mergeBases}, the `scalar-generated` commit the
|
|
298
|
+
* delivery recorded as holding that build's output
|
|
299
|
+
* (`deliveredSnapshot` on `CoreSdkBuildCreated`). Absent for a delivery
|
|
300
|
+
* recorded without one.
|
|
301
|
+
*/
|
|
302
|
+
mergeBaseSnapshots: external_exports.partialRecord(external_exports.enum(SdkLanguage), sdkRepoCommitShaSchema).nullish()
|
|
303
|
+
}).meta({ id: "sdk-build-inputs" });
|
|
304
|
+
var sdkGitStatusSchema = external_exports.enum(["pending", "error", "synced", "conflicts"]).meta({ id: "sdk-git-status" });
|
|
305
|
+
var sdkBuildApiSchema = external_exports.object({
|
|
306
|
+
uid: nanoidSchema,
|
|
307
|
+
namespace: namespaceSchema,
|
|
308
|
+
version: docVersionSchema,
|
|
309
|
+
slug: slugSchema,
|
|
310
|
+
upgraded: external_exports.boolean().default(false),
|
|
311
|
+
/**
|
|
312
|
+
* The registry document instance (its commit) read when the build was
|
|
313
|
+
* triggered. Null on builds triggered before it was recorded.
|
|
314
|
+
*/
|
|
315
|
+
instanceUid: external_exports.string().nullish(),
|
|
316
|
+
/**
|
|
317
|
+
* Identity of the API document content this build was enqueued against:
|
|
318
|
+
* the managed doc version's `jsonSha` at enqueue time. Rebuild triggering
|
|
319
|
+
* compares it with the version's current `jsonSha` — an in-place content
|
|
320
|
+
* rewrite that lands between enqueue and generation makes the comparison
|
|
321
|
+
* conservatively re-trigger rather than miss the change. Nullable:
|
|
322
|
+
* document versions hashed before `jsonSha` existed carry none, and
|
|
323
|
+
* mongobase round-trips an unset optional as null.
|
|
324
|
+
*/
|
|
325
|
+
documentHash: external_exports.string().nullable().optional(),
|
|
326
|
+
/**
|
|
327
|
+
* The sha of the document with its external `$ref`s resolved, fixed when
|
|
328
|
+
* the build was recorded and stored at `sdkArtifacts().sdk().bundledDocument()`,
|
|
329
|
+
* so every language generates from the same bytes. Null when the document
|
|
330
|
+
* has no external reference, or one did not resolve; each language then
|
|
331
|
+
* bundles the document itself.
|
|
332
|
+
*/
|
|
333
|
+
bundleHash: contentShaSchema.nullish()
|
|
334
|
+
}).meta({ id: "sdk-build-api" });
|
|
335
|
+
var bundleSdkDocumentRequestSchema = external_exports.object({
|
|
336
|
+
/** The team the registry is read as, so a `$ref` reaches only what it may read. */
|
|
337
|
+
teamUid: nanoidSchema,
|
|
338
|
+
sdkUid: nanoidSchema,
|
|
339
|
+
api: sdkBuildApiSchema
|
|
340
|
+
});
|
|
341
|
+
var bundleSdkDocumentResponseSchema = external_exports.object({
|
|
342
|
+
/** The stored resolved document's sha; null when none was stored. */
|
|
343
|
+
bundleHash: contentShaSchema.nullable(),
|
|
344
|
+
/**
|
|
345
|
+
* Whether an external `$ref` failed to resolve. The build's inputs are then
|
|
346
|
+
* unknown, so it is not hashed, unlike a document with no external `$ref`.
|
|
347
|
+
*/
|
|
348
|
+
referencesFailed: external_exports.boolean()
|
|
349
|
+
});
|
|
350
|
+
var sdkbuildSdkSchema = external_exports.object({
|
|
351
|
+
uid: nanoidSchema,
|
|
352
|
+
namespace: namespaceSchema,
|
|
353
|
+
version: docVersionSchema,
|
|
354
|
+
slug: slugSchema,
|
|
355
|
+
/**
|
|
356
|
+
* The `sdkVersions` record of {@link version}, minted at trigger. Null on
|
|
357
|
+
* builds recorded before version records held their builds.
|
|
358
|
+
*/
|
|
359
|
+
versionUid: nanoidSchema.nullish()
|
|
360
|
+
}).meta({ id: "sdk-build-sdk" });
|
|
361
|
+
var sdkBuildGitSchema = external_exports.object({
|
|
362
|
+
/**
|
|
363
|
+
* The release PR (clean sync) or conflict PR (conflicted sync), when one
|
|
364
|
+
* exists. Nullable: mongobase round-trips an unset optional as null, and a
|
|
365
|
+
* strict number parse would drop the doc on read.
|
|
366
|
+
*/
|
|
367
|
+
pullRequest: external_exports.number().nullable().optional(),
|
|
368
|
+
/**
|
|
369
|
+
* The commit `scalar-next` holds after the sync: the one a clean sync
|
|
370
|
+
* landed, or the one a conflict PR targets. Always written, since released
|
|
371
|
+
* CLIs read it as required; a conflicted sync without one records no
|
|
372
|
+
* `gitSync`. Nullish for records written without it.
|
|
373
|
+
*/
|
|
374
|
+
commitHash: external_exports.string().nullish()
|
|
375
|
+
}).optional().meta({ id: "sdk-build-git" });
|
|
376
|
+
var sdkBuildTargetSchema = external_exports.object({
|
|
377
|
+
/** SDK language to generate */
|
|
378
|
+
language: external_exports.enum(SdkLanguage),
|
|
379
|
+
/**
|
|
380
|
+
* Per-target slug. The build zip is copied to a key under it next to its
|
|
381
|
+
* uid key, and readers fall back to that key when the uid key is missing.
|
|
382
|
+
* Absent on a target without one.
|
|
383
|
+
*/
|
|
384
|
+
slug: slugSchema.optional(),
|
|
385
|
+
/** Build status */
|
|
386
|
+
buildStatus: sdkBuildStatusSchema,
|
|
387
|
+
/**
|
|
388
|
+
* Additional build message. Nullable: mongobase round-trips an unset
|
|
389
|
+
* optional as null, and a strict string parse would drop the doc on read.
|
|
390
|
+
*/
|
|
391
|
+
buildMessage: external_exports.string().nullable().optional(),
|
|
392
|
+
/** Git sync status */
|
|
393
|
+
gitStatus: sdkGitStatusSchema.optional(),
|
|
394
|
+
/**
|
|
395
|
+
* When the target entered `gitStatus: 'pending'`, in unix seconds. Lets a
|
|
396
|
+
* still-"pending" sync be recognized as stalled (a terminal message never
|
|
397
|
+
* arrived) so the dashboard can offer a retry instead of spinning forever.
|
|
398
|
+
* Nullable for the same round-trip reason as buildMessage.
|
|
399
|
+
*/
|
|
400
|
+
syncStartedAt: external_exports.number().nullable().optional(),
|
|
401
|
+
/**
|
|
402
|
+
* When core dispatched the target's git sync, in epoch milliseconds. The
|
|
403
|
+
* delivered pointer (`sdkEnvironmentSchema.delivered`) orders by it, since
|
|
404
|
+
* syncs of one repository run in dispatch order.
|
|
405
|
+
*/
|
|
406
|
+
dispatchedAt: external_exports.number().int().nonnegative().nullish(),
|
|
407
|
+
/**
|
|
408
|
+
* The `dispatchedAt` of the sync whose result set the current `synced` or
|
|
409
|
+
* `conflicts` status, in epoch milliseconds: written by its completion,
|
|
410
|
+
* or by core when a later dispatch superseded it, and cleared when a
|
|
411
|
+
* failure is recorded. Differs from `dispatchedAt` when an older dispatch
|
|
412
|
+
* completes after a newer one went out. A failure of this dispatch or an
|
|
413
|
+
* earlier one leaves that status in place.
|
|
414
|
+
*/
|
|
415
|
+
settledDispatchedAt: external_exports.number().int().nonnegative().nullish(),
|
|
416
|
+
/**
|
|
417
|
+
* The dispatch that marked the target `gitStatus: 'pending'`, unique per
|
|
418
|
+
* dispatch. A dispatch whose message never went out restores only a target
|
|
419
|
+
* still carrying its own id, so a later dispatch is never undone.
|
|
420
|
+
*/
|
|
421
|
+
syncId: external_exports.string().nullish(),
|
|
422
|
+
/** Additional git message. Nullable for the same round-trip reason as buildMessage. */
|
|
423
|
+
gitMessage: external_exports.string().nullable().optional(),
|
|
424
|
+
/**
|
|
425
|
+
* Machine-readable git failure class assigned by the generator (e.g.
|
|
426
|
+
* 'github-workflows-permission'). Nullable for the same round-trip reason
|
|
427
|
+
* as buildMessage.
|
|
428
|
+
*/
|
|
429
|
+
gitErrorCode: external_exports.string().nullable().optional(),
|
|
430
|
+
/** Linked git repository name */
|
|
431
|
+
repository: external_exports.string().nullable().optional(),
|
|
432
|
+
/** Git sync commit and PR */
|
|
433
|
+
gitSync: sdkBuildGitSchema,
|
|
434
|
+
/**
|
|
435
|
+
* The stage a failed language stopped at. Set only with `buildStatus:
|
|
436
|
+
* 'error'`; null on failures recorded before stages existed.
|
|
437
|
+
*/
|
|
438
|
+
failedStage: sdkBuildStageSchema.nullish(),
|
|
439
|
+
/**
|
|
440
|
+
* When the generator started this language (unix seconds). A `pending`
|
|
441
|
+
* target without it is queued; with it, building.
|
|
442
|
+
*/
|
|
443
|
+
startedAt: timestampSchema.nullish(),
|
|
444
|
+
/** Storage key of this language's full build log in the registry bucket, once written. */
|
|
445
|
+
logKey: external_exports.string().nullish(),
|
|
446
|
+
/**
|
|
447
|
+
* The `scalar-next` commit the merge stage merged, as the generator
|
|
448
|
+
* reported it. Provenance only: the hashed commit is `inputs.repoShas`.
|
|
449
|
+
*/
|
|
450
|
+
scalarNextSha: external_exports.string().nullish(),
|
|
451
|
+
/** The commit whose tree the merge stage used as its base, as the generator reported it. */
|
|
452
|
+
mergeBaseSha: external_exports.string().nullish(),
|
|
453
|
+
/**
|
|
454
|
+
* `hashSdkBuildTarget` of the build's inputs for this language: a later
|
|
455
|
+
* target with the same hash reuses this one's output once it succeeded,
|
|
456
|
+
* rather than building. Null on targets that cannot be hashed.
|
|
457
|
+
*/
|
|
458
|
+
hash: external_exports.string().nullish(),
|
|
459
|
+
/**
|
|
460
|
+
* The build whose succeeded target with the same hash this one reused: it
|
|
461
|
+
* holds the output. Null on a target this build built itself.
|
|
462
|
+
*/
|
|
463
|
+
reusedFrom: nanoidSchema.nullish(),
|
|
464
|
+
/**
|
|
465
|
+
* The generator version that ran, as the generator reported it. The
|
|
466
|
+
* hashed version is `inputs.generatorVersion`; a target that ran another
|
|
467
|
+
* is never reused, since its hash does not describe its output.
|
|
468
|
+
*/
|
|
469
|
+
generatorVersion: external_exports.string().nullish()
|
|
470
|
+
}).meta({ id: "sdk-build-target" });
|
|
471
|
+
var sdkBuildSchema = entitySchema.extend({
|
|
472
|
+
teamUid: nanoidSchema,
|
|
473
|
+
/** SDK metadata on generation */
|
|
474
|
+
sdk: sdkbuildSdkSchema,
|
|
475
|
+
/** Original API used to generate SDK */
|
|
476
|
+
api: sdkBuildApiSchema,
|
|
477
|
+
/** Custom SDK config */
|
|
478
|
+
config: external_exports.string(),
|
|
479
|
+
/** Per-language build targets */
|
|
480
|
+
targets: sdkBuildTargetSchema.array().min(1),
|
|
481
|
+
/**
|
|
482
|
+
* What the build is derived from, its provenance. Each target hashes these
|
|
483
|
+
* for its own language. Null on builds recorded before inputs existed.
|
|
484
|
+
*/
|
|
485
|
+
inputs: sdkBuildInputsSchema.nullish(),
|
|
486
|
+
/** What recorded the build. Not part of any hash. */
|
|
487
|
+
reason: sdkBuildReasonSchema.nullish(),
|
|
488
|
+
/**
|
|
489
|
+
* When the trigger recorded the build, in epoch milliseconds: a language's
|
|
490
|
+
* head is its newest triggered head-following target, whatever order the
|
|
491
|
+
* targets complete in. Null on builds recorded before it existed, which
|
|
492
|
+
* order by `createdAt`.
|
|
493
|
+
*/
|
|
494
|
+
triggeredAt: external_exports.number().int().nonnegative().nullish(),
|
|
495
|
+
/**
|
|
496
|
+
* The event that recorded the build, unique per SDK
|
|
497
|
+
* (`sdkBuilds_triggerKeyIndex`), so a redelivered or retried trigger
|
|
498
|
+
* finds its build instead of recording a second one. Null on builds
|
|
499
|
+
* recorded before it existed.
|
|
500
|
+
*/
|
|
501
|
+
triggerKey: external_exports.string().nullish()
|
|
502
|
+
}).meta({ id: "sdk-build" });
|
|
503
|
+
var sdkBuildLogChunkSchema = entitySchema.extend({
|
|
504
|
+
teamUid: nanoidSchema,
|
|
505
|
+
buildUid: nanoidSchema,
|
|
506
|
+
/** The language's stream. Null on chunks from builds that logged every language as one stream. */
|
|
507
|
+
language: external_exports.enum(SdkLanguage).nullish(),
|
|
508
|
+
/** Monotonic order within a build's language stream. */
|
|
509
|
+
sequence: external_exports.number().int(),
|
|
510
|
+
chunk: external_exports.string()
|
|
511
|
+
}).meta({ id: "sdk-build-log-chunk" });
|
|
512
|
+
var sdkCodeSampleSchema = external_exports.object({
|
|
513
|
+
lang: external_exports.string(),
|
|
514
|
+
/**
|
|
515
|
+
* Optional, the way the extension itself defines it — most hand-authored
|
|
516
|
+
* samples carry only `lang` and `source`. Missing labels fall back to `lang`
|
|
517
|
+
* when the SDK service normalizes samples.
|
|
518
|
+
*/
|
|
519
|
+
label: external_exports.string().optional(),
|
|
520
|
+
source: external_exports.string()
|
|
521
|
+
}).meta({ id: "sdk-code-sample" });
|
|
522
|
+
|
|
523
|
+
export {
|
|
524
|
+
SdkLanguage,
|
|
525
|
+
sdkLanguagePoliciesSchema,
|
|
526
|
+
SDK_PRODUCTION_ENVIRONMENT,
|
|
527
|
+
sdkLanguagePointersSchema,
|
|
528
|
+
sdkLanguageCurrentsSchema,
|
|
529
|
+
sdkSchema,
|
|
530
|
+
sdkBuildStatusSchema,
|
|
531
|
+
sdkBuildReasonSchema,
|
|
532
|
+
sdkBuildInputsSchema,
|
|
533
|
+
sdkBuildApiSchema,
|
|
534
|
+
sdkBuildTargetSchema,
|
|
535
|
+
sdkBuildSchema
|
|
536
|
+
};
|
|
@@ -6,7 +6,7 @@ var AGENT_NOTES = [
|
|
|
6
6
|
"Run `scalar context` for this command tree as JSON, or `scalar <command> --help` for a single command.",
|
|
7
7
|
"Log in with a personal token: `scalar auth login --token <token>`, or set `SCALAR_API_KEY` and run `scalar auth login`. An explicit --token overrides SCALAR_API_KEY and must not be empty or whitespace-only. Both store the session on disk for later commands. Without a token, `scalar auth login` opens a browser and waits for a person to log in, so do not run it that way. Check the session with `scalar auth whoami`.",
|
|
8
8
|
"Use --no-input before or after subcommands to disable prompts and browser launches, including under a PTY. Supply required values explicitly; missing inputs fail with exit code 1 and guidance. Piped input is never a confirmation. Cancelled prompts and EOF exit with code 1. The flag does not imply --yes or --force and neither option chooses an unspecified target.",
|
|
9
|
-
"Many commands prompt when a value is left out, such as a slug, a team, or a confirmation before overwriting a file, and missing values fail when interaction is disabled. Pass every value as an argument or flag: for example `--output` on `document bundle` and `document upgrade`, `--yes` on `project rollback`, and `--force` on `project init
|
|
9
|
+
"Many commands prompt when a value is left out, such as a slug, a team, or a confirmation before overwriting a file, and missing values fail when interaction is disabled. Pass every value as an argument or flag: for example `--output` on `document bundle` and `document upgrade`, `--yes` on `project rollback`, and `--force` on `project init` to replace the configuration, docs-quickstart.md, and docs-openapi.json. Project init lists conflicts and stops without --force; --json and --no-input do not grant overwrite permission.",
|
|
10
10
|
"Results go to stdout. Errors go to stderr, prefixed with `[ERROR]`."
|
|
11
11
|
];
|
|
12
12
|
var EXIT_CODES = {
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { createRequire as $$cR } from "node:module"; const require = $$cR(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
getPublishDeploymentUrl
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-36UI2W7I.js";
|
|
5
5
|
import {
|
|
6
6
|
writeJson
|
|
7
7
|
} from "./chunk-SNQFFEYH.js";
|
|
8
8
|
import {
|
|
9
9
|
createDatabaseClient
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import {
|
|
12
|
-
publishRecordSchema
|
|
13
|
-
} from "./chunk-BOCMOHQA.js";
|
|
10
|
+
} from "./chunk-Z7EH7CJC.js";
|
|
14
11
|
import {
|
|
15
12
|
output
|
|
16
13
|
} from "./chunk-T5HJUAWB.js";
|
|
14
|
+
import {
|
|
15
|
+
publishRecordSchema
|
|
16
|
+
} from "./chunk-RGJPENX7.js";
|
|
17
17
|
import {
|
|
18
18
|
external_exports
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-JBMHCTZD.js";
|
|
20
20
|
|
|
21
21
|
// src/domains/project/deployments/observe.ts
|
|
22
22
|
import { performance } from "node:perf_hooks";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire as $$cR } from "node:module"; const require = $$cR(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
external_exports
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-JBMHCTZD.js";
|
|
5
5
|
|
|
6
6
|
// ../../packages/entities/dist/environment/schema.js
|
|
7
7
|
var DEFAULT_ENVIRONMENT = "production";
|
|
@@ -2,7 +2,7 @@ import { createRequire as $$cR } from "node:module"; const require = $$cR(import
|
|
|
2
2
|
|
|
3
3
|
// package.json
|
|
4
4
|
var name = "@scalar/cli";
|
|
5
|
-
var version = "2.
|
|
5
|
+
var version = "2.18.0";
|
|
6
6
|
var bin = {
|
|
7
7
|
scalar: "./dist/index.js",
|
|
8
8
|
"scalar-cli": "./dist/index.js"
|
|
@@ -125,9 +125,34 @@ var package_default = {
|
|
|
125
125
|
}
|
|
126
126
|
};
|
|
127
127
|
|
|
128
|
+
// src/config.ts
|
|
129
|
+
import { portNumbers } from "get-port";
|
|
130
|
+
var config = {
|
|
131
|
+
projects: {
|
|
132
|
+
dashboard: process.env.DASHBOARD_URL ?? "https://dashboard.scalar.com",
|
|
133
|
+
sandbox: process.env.SANDBOX_URL ?? "https://sandbox.scalar.com",
|
|
134
|
+
registry: process.env.REGISTRY_URL ?? "https://registry.scalar.com"
|
|
135
|
+
},
|
|
136
|
+
mcpUrl: process.env.MCP_URL ?? "https://mcp.scalar.com",
|
|
137
|
+
services: {
|
|
138
|
+
api: process.env.BASE_URL ?? "https://services.scalar.com"
|
|
139
|
+
},
|
|
140
|
+
auth: {
|
|
141
|
+
/** The auth server the CLI signs in with and trades personal tokens at */
|
|
142
|
+
origin: process.env.AUTH_URL ?? "https://auth.scalar.com",
|
|
143
|
+
callback: {
|
|
144
|
+
preferredPortRange: process.env.PREFERRED_PORT ? Number.parseInt(process.env.PREFERRED_PORT) : portNumbers(4799, 5100)
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
cdnUrl: process.env.CDN_URL ?? "https://cdn.scalar.com",
|
|
148
|
+
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"),
|
|
149
|
+
ssgDocsIsolateVersion: process.env.SSG_DOCS_ISOLATE_VERSION ?? version
|
|
150
|
+
};
|
|
151
|
+
|
|
128
152
|
export {
|
|
129
153
|
name,
|
|
130
154
|
version,
|
|
131
155
|
bin,
|
|
132
|
-
package_default
|
|
156
|
+
package_default,
|
|
157
|
+
config
|
|
133
158
|
};
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import { createRequire as $$cR } from "node:module"; const require = $$cR(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
err,
|
|
4
|
+
ok
|
|
5
|
+
} from "./chunk-DUIMDHQQ.js";
|
|
2
6
|
|
|
3
7
|
// src/domains/document/helpers/safe-normalize.ts
|
|
4
8
|
import { normalize } from "@scalar/json-magic/helpers/normalize";
|
|
5
9
|
var safeNormalize = (value) => {
|
|
6
10
|
try {
|
|
7
|
-
return normalize(value);
|
|
8
|
-
} catch {
|
|
9
|
-
return
|
|
11
|
+
return ok(normalize(value));
|
|
12
|
+
} catch (error) {
|
|
13
|
+
return err(error instanceof Error ? error.message : String(error));
|
|
10
14
|
}
|
|
11
15
|
};
|
|
12
16
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire as $$cR } from "node:module"; const require = $$cR(import.meta.url);
|
|
2
2
|
|
|
3
|
-
// ../../node_modules/.pnpm/@scalar+helpers@0.
|
|
3
|
+
// ../../node_modules/.pnpm/@scalar+helpers@0.18.0/node_modules/@scalar/helpers/dist/object/is-object.js
|
|
4
4
|
var isObject = (value) => {
|
|
5
5
|
if (value === null || typeof value !== "object") {
|
|
6
6
|
return false;
|