@scalar/cli 2.0.0 → 2.1.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 +42 -2
- package/chunks/action-45OGQB2M.js +138 -0
- package/chunks/action-5R5FDF6S.js +2097 -0
- package/chunks/action-ANU5HGC4.js +34 -0
- package/chunks/action-BMFXENMX.js +176 -0
- package/chunks/action-BNEGJBUH.js +38 -0
- package/chunks/action-BYZUBXVB.js +82 -0
- package/chunks/action-C5VB4ITT.js +132 -0
- package/chunks/action-CCW66QJN.js +72 -0
- package/chunks/action-CLSD7O2R.js +60 -0
- package/chunks/action-CQ56FVES.js +65 -0
- package/chunks/action-CYP4VDK3.js +148 -0
- package/chunks/action-DFKHSDFV.js +36 -0
- package/chunks/action-F4Y6Q2VB.js +92 -0
- package/chunks/action-GB6DM53B.js +70 -0
- package/chunks/action-GEBRPNRT.js +87 -0
- package/chunks/action-H5OHT2GV.js +56 -0
- package/chunks/action-HD2T6BFJ.js +54 -0
- package/chunks/action-HNKM3Q65.js +65 -0
- package/chunks/action-JOSVV6YA.js +71 -0
- package/chunks/action-MENXFJH3.js +204 -0
- package/chunks/action-P7LN6FGY.js +13 -0
- package/chunks/action-PVDDRIM6.js +130 -0
- package/chunks/action-Q5UJ32D6.js +46 -0
- package/chunks/action-R6ZZO26F.js +299 -0
- package/chunks/action-STIEAXOE.js +53 -0
- package/chunks/action-TPBKPHNS.js +110 -0
- package/chunks/action-TWFJNQ2R.js +95 -0
- package/chunks/action-TZ5KGAQT.js +64 -0
- package/chunks/action-UDZUUJSI.js +49 -0
- package/chunks/action-W5BATF4Q.js +197 -0
- package/chunks/agent-XGLOHXNA.js +112 -0
- package/chunks/build.action-LKOILPA6.js +108 -0
- package/chunks/chunk-23I5PKZZ.js +78 -0
- package/chunks/chunk-2BSG2QHO.js +455 -0
- package/chunks/chunk-3MZYUBJ6.js +49 -0
- package/chunks/chunk-47Y4L5IT.js +63361 -0
- package/chunks/chunk-4DGQIAJX.js +359 -0
- package/chunks/chunk-4QS7SJTG.js +138 -0
- package/chunks/chunk-5BISXQX4.js +447 -0
- package/chunks/chunk-5BPPGTUU.js +463 -0
- package/chunks/chunk-AEFPCC4U.js +16 -0
- package/chunks/chunk-AHWWJ3MD.js +32 -0
- package/chunks/chunk-ASMHW5AY.js +19 -0
- package/chunks/chunk-B6QZJWCQ.js +92 -0
- package/chunks/chunk-DOVIWNKQ.js +108 -0
- package/chunks/chunk-H2WRMLYY.js +13780 -0
- package/chunks/chunk-HQKBZOYU.js +34 -0
- package/chunks/chunk-ISGLWBXZ.js +4265 -0
- package/chunks/chunk-IX7LJ3AD.js +17 -0
- package/chunks/chunk-JFIXNSPP.js +26 -0
- package/chunks/chunk-K74E42RV.js +7311 -0
- package/chunks/chunk-KHDYYVYF.js +16 -0
- package/chunks/chunk-KWOL7A6J.js +23 -0
- package/chunks/chunk-NUXPNUSS.js +38 -0
- package/chunks/chunk-OAXFCOJV.js +25 -0
- package/chunks/chunk-P2VH7DOC.js +107 -0
- package/chunks/chunk-P646T2WH.js +1608 -0
- package/chunks/chunk-SHSHFGA7.js +297 -0
- package/chunks/chunk-SXYALPYK.js +2709 -0
- package/chunks/chunk-T7B6WNZC.js +18 -0
- package/chunks/chunk-T7MDADON.js +17 -0
- package/chunks/chunk-TLFMATXR.js +344 -0
- package/chunks/chunk-TQ5XC2E3.js +284 -0
- package/chunks/chunk-UPUTMFD4.js +465 -0
- package/chunks/chunk-VTYTPSXO.js +161 -0
- package/chunks/chunk-X4QLDBB5.js +221 -0
- package/chunks/chunk-ZTVWAKNJ.js +21 -0
- package/chunks/create.action-FFQLBSJH.js +108 -0
- package/chunks/delete.action-QNN3LC2F.js +96 -0
- package/chunks/delete.action-STHQHP4F.js +88 -0
- package/chunks/get.action-OTKYOP3Z.js +87 -0
- package/chunks/list.action-6I5EZAVB.js +95 -0
- package/chunks/list.action-KDM5RHEH.js +116 -0
- package/chunks/publish.action-PODTVRXS.js +182 -0
- package/chunks/update.action-4F6STTEQ.js +101 -0
- package/chunks/update.action-KMD4ZM75.js +95 -0
- package/docs.html +393 -230
- package/index.js +645 -98865
- package/package.json +16 -14
|
@@ -0,0 +1,463 @@
|
|
|
1
|
+
import { createRequire as $$cR } from "node:module"; const require = $$cR(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
baseRegistrySchema
|
|
4
|
+
} from "./chunk-VTYTPSXO.js";
|
|
5
|
+
import {
|
|
6
|
+
brandedUid,
|
|
7
|
+
docVersionSchema,
|
|
8
|
+
entitySchema,
|
|
9
|
+
mintUid,
|
|
10
|
+
namespaceSchema,
|
|
11
|
+
nanoidSchema,
|
|
12
|
+
slugSchema,
|
|
13
|
+
timestampSchema
|
|
14
|
+
} from "./chunk-ISGLWBXZ.js";
|
|
15
|
+
import {
|
|
16
|
+
external_exports
|
|
17
|
+
} from "./chunk-H2WRMLYY.js";
|
|
18
|
+
import {
|
|
19
|
+
require_dist
|
|
20
|
+
} from "./chunk-K74E42RV.js";
|
|
21
|
+
import {
|
|
22
|
+
__toESM
|
|
23
|
+
} from "./chunk-3MZYUBJ6.js";
|
|
24
|
+
|
|
25
|
+
// ../../packages/entities/dist/sdk/schema.js
|
|
26
|
+
var SdkLanguage;
|
|
27
|
+
(function(SdkLanguage2) {
|
|
28
|
+
SdkLanguage2["Typescript"] = "typescript";
|
|
29
|
+
SdkLanguage2["Python"] = "python";
|
|
30
|
+
SdkLanguage2["Cli"] = "cli";
|
|
31
|
+
SdkLanguage2["CSharp"] = "csharp";
|
|
32
|
+
SdkLanguage2["Java"] = "java";
|
|
33
|
+
SdkLanguage2["Ruby"] = "ruby";
|
|
34
|
+
SdkLanguage2["Php"] = "php";
|
|
35
|
+
SdkLanguage2["Go"] = "go";
|
|
36
|
+
SdkLanguage2["Rust"] = "rust";
|
|
37
|
+
SdkLanguage2["Kotlin"] = "kotlin";
|
|
38
|
+
SdkLanguage2["Swift"] = "swift";
|
|
39
|
+
SdkLanguage2["Cpp"] = "cpp";
|
|
40
|
+
SdkLanguage2["Dart"] = "dart";
|
|
41
|
+
})(SdkLanguage || (SdkLanguage = {}));
|
|
42
|
+
var SdkLanguageLabels = {
|
|
43
|
+
[SdkLanguage.Typescript]: "Typescript",
|
|
44
|
+
[SdkLanguage.Python]: "Python",
|
|
45
|
+
[SdkLanguage.Cli]: "CLI",
|
|
46
|
+
[SdkLanguage.CSharp]: "C#",
|
|
47
|
+
[SdkLanguage.Java]: "Java",
|
|
48
|
+
[SdkLanguage.Ruby]: "Ruby",
|
|
49
|
+
[SdkLanguage.Php]: "PHP",
|
|
50
|
+
[SdkLanguage.Go]: "Go",
|
|
51
|
+
[SdkLanguage.Rust]: "Rust",
|
|
52
|
+
[SdkLanguage.Kotlin]: "Kotlin",
|
|
53
|
+
[SdkLanguage.Swift]: "Swift",
|
|
54
|
+
[SdkLanguage.Cpp]: "C++",
|
|
55
|
+
[SdkLanguage.Dart]: "Dart"
|
|
56
|
+
};
|
|
57
|
+
var SdkRegistryLabels = {
|
|
58
|
+
[SdkLanguage.Typescript]: "npm",
|
|
59
|
+
[SdkLanguage.Python]: "PyPI",
|
|
60
|
+
[SdkLanguage.Go]: "Go modules",
|
|
61
|
+
[SdkLanguage.Rust]: "crates.io",
|
|
62
|
+
[SdkLanguage.Java]: "Maven Central",
|
|
63
|
+
[SdkLanguage.Kotlin]: "Maven Central",
|
|
64
|
+
[SdkLanguage.Ruby]: "RubyGems",
|
|
65
|
+
[SdkLanguage.Php]: "Packagist",
|
|
66
|
+
[SdkLanguage.CSharp]: "NuGet",
|
|
67
|
+
[SdkLanguage.Swift]: "Swift Package Manager",
|
|
68
|
+
[SdkLanguage.Dart]: "pub.dev",
|
|
69
|
+
[SdkLanguage.Cli]: "Homebrew"
|
|
70
|
+
};
|
|
71
|
+
var SdkLanguageExperimental = {
|
|
72
|
+
[SdkLanguage.Typescript]: false,
|
|
73
|
+
[SdkLanguage.Python]: false,
|
|
74
|
+
[SdkLanguage.Cli]: false,
|
|
75
|
+
[SdkLanguage.CSharp]: true,
|
|
76
|
+
[SdkLanguage.Java]: true,
|
|
77
|
+
[SdkLanguage.Ruby]: true,
|
|
78
|
+
[SdkLanguage.Php]: true,
|
|
79
|
+
[SdkLanguage.Go]: false,
|
|
80
|
+
[SdkLanguage.Rust]: true,
|
|
81
|
+
[SdkLanguage.Kotlin]: true,
|
|
82
|
+
[SdkLanguage.Swift]: true,
|
|
83
|
+
[SdkLanguage.Cpp]: true,
|
|
84
|
+
[SdkLanguage.Dart]: true
|
|
85
|
+
};
|
|
86
|
+
var sdkTargetDestinationSchema = external_exports.object({
|
|
87
|
+
provider: external_exports.literal("github").default("github"),
|
|
88
|
+
linkedBy: external_exports.string(),
|
|
89
|
+
/**
|
|
90
|
+
* GitHub App installation that grants push access. Optional because legacy
|
|
91
|
+
* links predate it and it is derivable from `linkedBy` + repo at sync time.
|
|
92
|
+
*/
|
|
93
|
+
installationId: external_exports.number().int().optional(),
|
|
94
|
+
/** GitHub repo id — the auth anchor and the webhook routing key. */
|
|
95
|
+
id: external_exports.number().int(),
|
|
96
|
+
expired: external_exports.boolean().default(false)
|
|
97
|
+
}).meta({ id: "sdk-target-destination" });
|
|
98
|
+
var sdkSampleRepoSchema = external_exports.object({
|
|
99
|
+
provider: external_exports.literal("github").default("github"),
|
|
100
|
+
/**
|
|
101
|
+
* 'pending' from SDK creation until the repo is provisioned in scalar-sdks;
|
|
102
|
+
* 'ready' once it exists (name/installationId are filled in then). The
|
|
103
|
+
* pending state lets the dashboard show the section immediately. Defaults to
|
|
104
|
+
* 'ready' so pre-existing bindings (which always have a repo) read correctly.
|
|
105
|
+
*/
|
|
106
|
+
status: external_exports.enum(["pending", "ready"]).default("ready"),
|
|
107
|
+
/** "scalar-sdks/<repo>" (present once ready). */
|
|
108
|
+
name: external_exports.string().optional(),
|
|
109
|
+
/** scalar-sdks installation that grants push access for the bot (once ready). */
|
|
110
|
+
installationId: external_exports.number().int().optional(),
|
|
111
|
+
baseBranch: external_exports.string().min(1).default("main"),
|
|
112
|
+
/**
|
|
113
|
+
* GitHub invitation accept URL, surfaced in the dashboard. Null once the
|
|
114
|
+
* invite has been re-issued for an already-accepted user (no link to show).
|
|
115
|
+
*/
|
|
116
|
+
invitationUrl: external_exports.string().nullable().optional(),
|
|
117
|
+
/**
|
|
118
|
+
* When provisioning was first kicked for this target (unix seconds), stamped
|
|
119
|
+
* as the pending binding is seeded. The dashboard anchors its stalled-timeout
|
|
120
|
+
* on it so a target added long after the SDK was created still gets the full
|
|
121
|
+
* "Preparing" window instead of reading as stalled immediately. Absent on
|
|
122
|
+
* pre-feature bindings (readers fall back to the SDK's `createdAt`).
|
|
123
|
+
*/
|
|
124
|
+
provisionStartedAt: timestampSchema.optional(),
|
|
125
|
+
/** Last build whose artifact was pushed to the playground. */
|
|
126
|
+
lastSyncedBuild: nanoidSchema.optional()
|
|
127
|
+
}).meta({ id: "sdk-sample-repo" });
|
|
128
|
+
var sdkTargetSchema = external_exports.object({
|
|
129
|
+
language: external_exports.enum(SdkLanguage),
|
|
130
|
+
slug: slugSchema,
|
|
131
|
+
destination: sdkTargetDestinationSchema.nullable().default(null),
|
|
132
|
+
/**
|
|
133
|
+
* Preview repo in scalar-sdks for this target. Independent of `destination`:
|
|
134
|
+
* it always mirrors the latest build so users can play with the output before
|
|
135
|
+
* setting up a production repo.
|
|
136
|
+
*/
|
|
137
|
+
sample: sdkSampleRepoSchema.nullable().default(null)
|
|
138
|
+
}).meta({ id: "sdk-target" });
|
|
139
|
+
var sdkVersionTargetStateSchema = external_exports.object({
|
|
140
|
+
activeSync: external_exports.object({
|
|
141
|
+
repository: external_exports.string(),
|
|
142
|
+
/**
|
|
143
|
+
* The release PR managed by release-please on scalar-next, when one
|
|
144
|
+
* was open after the sync. Release cutting is the repo's own workflow.
|
|
145
|
+
*/
|
|
146
|
+
pullRequest: external_exports.number().optional(),
|
|
147
|
+
/** scalar-next tip the sync landed. */
|
|
148
|
+
commitHash: external_exports.string()
|
|
149
|
+
}).optional(),
|
|
150
|
+
/**
|
|
151
|
+
* Set when the last combine merge collided: the build awaiting resolution
|
|
152
|
+
* on the conflict PR (scalar-merge-conflict into scalar-next), resolved by
|
|
153
|
+
* the developer on GitHub. Cleared on a clean reconcile.
|
|
154
|
+
*/
|
|
155
|
+
conflict: external_exports.object({
|
|
156
|
+
build: nanoidSchema,
|
|
157
|
+
/** The conflict PR into scalar-next, for deep links. */
|
|
158
|
+
pullRequest: external_exports.number().optional()
|
|
159
|
+
}).optional(),
|
|
160
|
+
activeBuild: nanoidSchema.optional()
|
|
161
|
+
}).meta({ id: "sdk-version-target-state" });
|
|
162
|
+
var sdkVersionStatusSchema = external_exports.enum(["draft", "published"]);
|
|
163
|
+
var sdkVersionSchema = external_exports.object({
|
|
164
|
+
version: docVersionSchema,
|
|
165
|
+
/**
|
|
166
|
+
* The exact API version this SDK version was created against (build
|
|
167
|
+
* provenance). Always concrete — the SDK-level `sdkSchema.apiVersion` is
|
|
168
|
+
* the range-capable auto-update spec.
|
|
169
|
+
*/
|
|
170
|
+
apiVersion: docVersionSchema,
|
|
171
|
+
createdAt: timestampSchema.optional(),
|
|
172
|
+
/** Draft while being edited; published once a build of it succeeds. */
|
|
173
|
+
status: sdkVersionStatusSchema.default("published"),
|
|
174
|
+
/** Config snapshot for this version. Defaults to `{}` so pre-migration docs still validate. */
|
|
175
|
+
config: external_exports.string().default("{}"),
|
|
176
|
+
/** Language targets this version ships, derived from `config`. */
|
|
177
|
+
languages: external_exports.enum(SdkLanguage).array().default([]),
|
|
178
|
+
publishedAt: timestampSchema.optional(),
|
|
179
|
+
/** What created/last-touched this version, for display. */
|
|
180
|
+
changeSource: external_exports.enum(["user", "api-version", "created"]).optional(),
|
|
181
|
+
changeNote: external_exports.string().optional(),
|
|
182
|
+
/**
|
|
183
|
+
* Content identity of the API document save that auto-created this
|
|
184
|
+
* version: the managed doc version's `jsonSha` — the same key space as
|
|
185
|
+
* {@link sdkBuildApiSchema}'s `documentHash`. Lets redelivered (or
|
|
186
|
+
* repeated, identical) save events recognize content the SDK already
|
|
187
|
+
* processed instead of minting another version.
|
|
188
|
+
*/
|
|
189
|
+
apiDocumentHash: external_exports.string().optional(),
|
|
190
|
+
/** Active sync/build per language, for this version. */
|
|
191
|
+
targets: external_exports.partialRecord(external_exports.enum(SdkLanguage), sdkVersionTargetStateSchema).default({})
|
|
192
|
+
}).meta({ id: "sdk-version" });
|
|
193
|
+
var sdkSchema = baseRegistrySchema.extend({
|
|
194
|
+
/** Own uid, branded so it cannot be confused with another entity's uid */
|
|
195
|
+
uid: brandedUid().default(mintUid).meta({ default: "nanoid()" }),
|
|
196
|
+
/**
|
|
197
|
+
* The registry API this SDK is generated from. Null when unlinked — the SDK
|
|
198
|
+
* keeps its versions/builds but can't build a new version until re-linked.
|
|
199
|
+
*
|
|
200
|
+
* Branded as a ManagedDoc uid: this points at a managed DOC, not a managed
|
|
201
|
+
* SCHEMA, so comparing it to a `ManagedSchema` uid is a compile error.
|
|
202
|
+
*/
|
|
203
|
+
apiUid: brandedUid().nullable(),
|
|
204
|
+
/**
|
|
205
|
+
* The API version this SDK follows — the auto-update gate. An exact value
|
|
206
|
+
* (`3.0.1`, kept in sync with the version the SDK is on) auto-rebuilds only
|
|
207
|
+
* when that version's content changes; a range prefix widens it (`~1.2.0`
|
|
208
|
+
* adds patch bumps, `^1.2.3` minors, `3` any 3.x, `*` any version). Ranges
|
|
209
|
+
* are user intent and never rewritten by the platform. Distinct from
|
|
210
|
+
* `sdkVersionSchema.apiVersion`, the exact build provenance of one SDK
|
|
211
|
+
* version. Null while unlinked; absent on pre-feature docs (readers fall
|
|
212
|
+
* back to the tracked version with exact semantics). `docVersionSchema`
|
|
213
|
+
* keeps the same floor as every other version field: non-empty, no
|
|
214
|
+
* reserved names (`latest` would be a spec that can never match).
|
|
215
|
+
*/
|
|
216
|
+
apiVersion: docVersionSchema.nullable().optional(),
|
|
217
|
+
/**
|
|
218
|
+
* Current latest revision
|
|
219
|
+
* for SDK. Can be selected
|
|
220
|
+
* by user.
|
|
221
|
+
*/
|
|
222
|
+
currentVersion: nanoidSchema,
|
|
223
|
+
/** All versions available for SDK. */
|
|
224
|
+
versions: sdkVersionSchema.array().default([]),
|
|
225
|
+
/**
|
|
226
|
+
* Persistent per-language registry: every language the SDK has, each with its
|
|
227
|
+
* registry slug + git destination. Survives across versions — destinations and
|
|
228
|
+
* slugs persist even when a version drops a language. The *active* language set
|
|
229
|
+
* is the latest published version's `languages`.
|
|
230
|
+
*/
|
|
231
|
+
targets: sdkTargetSchema.array().min(1),
|
|
232
|
+
/**
|
|
233
|
+
* @deprecated Config now lives per-version (`sdkVersionSchema.config`). Kept
|
|
234
|
+
* optional for the migration/legacy path; new code reads the version config.
|
|
235
|
+
*/
|
|
236
|
+
config: external_exports.string().optional()
|
|
237
|
+
}).meta({ id: "sdk" });
|
|
238
|
+
var sdkBuildStatusSchema = external_exports.enum(["pending", "error", "generated"]).meta({ id: "sdk-build-status" });
|
|
239
|
+
var sdkGitStatusSchema = external_exports.enum(["pending", "error", "synced", "conflicts"]).meta({ id: "sdk-git-status" });
|
|
240
|
+
var sdkBuildApiSchema = external_exports.object({
|
|
241
|
+
uid: nanoidSchema,
|
|
242
|
+
namespace: namespaceSchema,
|
|
243
|
+
version: docVersionSchema,
|
|
244
|
+
slug: slugSchema,
|
|
245
|
+
upgraded: external_exports.boolean().default(false),
|
|
246
|
+
/**
|
|
247
|
+
* Identity of the API document content this build was enqueued against:
|
|
248
|
+
* the managed doc version's `jsonSha` at enqueue time. Rebuild triggering
|
|
249
|
+
* compares it with the version's current `jsonSha` — an in-place content
|
|
250
|
+
* rewrite that lands between enqueue and generation makes the comparison
|
|
251
|
+
* conservatively re-trigger rather than miss the change. Nullable:
|
|
252
|
+
* document versions hashed before `jsonSha` existed carry none, and
|
|
253
|
+
* mongobase round-trips an unset optional as null.
|
|
254
|
+
*/
|
|
255
|
+
documentHash: external_exports.string().nullable().optional()
|
|
256
|
+
}).meta({ id: "sdk-build-api" });
|
|
257
|
+
var sdkbuildSdkSchema = external_exports.object({
|
|
258
|
+
uid: nanoidSchema,
|
|
259
|
+
namespace: namespaceSchema,
|
|
260
|
+
version: docVersionSchema,
|
|
261
|
+
slug: slugSchema
|
|
262
|
+
}).meta({ id: "sdk-build-sdk" });
|
|
263
|
+
var sdkBuildGitSchema = external_exports.object({
|
|
264
|
+
/**
|
|
265
|
+
* The release PR (clean sync) or conflict PR (conflicted sync), when one
|
|
266
|
+
* exists. Nullable: mongobase round-trips an unset optional as null, and a
|
|
267
|
+
* strict number parse would drop the doc on read.
|
|
268
|
+
*/
|
|
269
|
+
pullRequest: external_exports.number().nullable().optional(),
|
|
270
|
+
commitHash: external_exports.string()
|
|
271
|
+
}).optional().meta({ id: "sdk-build-git" });
|
|
272
|
+
var sdkBuildTargetSchema = external_exports.object({
|
|
273
|
+
/** SDK language to generate */
|
|
274
|
+
language: external_exports.enum(SdkLanguage),
|
|
275
|
+
/** Per-target published slug the artifact lands under */
|
|
276
|
+
slug: slugSchema,
|
|
277
|
+
/** Build status */
|
|
278
|
+
buildStatus: sdkBuildStatusSchema,
|
|
279
|
+
/**
|
|
280
|
+
* Additional build message. Nullable: mongobase round-trips an unset
|
|
281
|
+
* optional as null, and a strict string parse would drop the doc on read.
|
|
282
|
+
*/
|
|
283
|
+
buildMessage: external_exports.string().nullable().optional(),
|
|
284
|
+
/** Git sync status */
|
|
285
|
+
gitStatus: sdkGitStatusSchema.optional(),
|
|
286
|
+
/**
|
|
287
|
+
* When the target entered `gitStatus: 'pending'`, in unix seconds. Lets a
|
|
288
|
+
* still-"pending" sync be recognized as stalled (a terminal message never
|
|
289
|
+
* arrived) so the dashboard can offer a retry instead of spinning forever.
|
|
290
|
+
* Nullable for the same round-trip reason as buildMessage.
|
|
291
|
+
*/
|
|
292
|
+
syncStartedAt: external_exports.number().nullable().optional(),
|
|
293
|
+
/** Additional git message. Nullable for the same round-trip reason as buildMessage. */
|
|
294
|
+
gitMessage: external_exports.string().nullable().optional(),
|
|
295
|
+
/**
|
|
296
|
+
* Machine-readable git failure class assigned by the generator (e.g.
|
|
297
|
+
* 'github-workflows-permission'). Nullable for the same round-trip reason
|
|
298
|
+
* as buildMessage.
|
|
299
|
+
*/
|
|
300
|
+
gitErrorCode: external_exports.string().nullable().optional(),
|
|
301
|
+
/** Linked git repository name */
|
|
302
|
+
repository: external_exports.string().nullable().optional(),
|
|
303
|
+
/** Git sync commit and PR */
|
|
304
|
+
gitSync: sdkBuildGitSchema
|
|
305
|
+
}).meta({ id: "sdk-build-target" });
|
|
306
|
+
var sdkBuildSchema = entitySchema.extend({
|
|
307
|
+
teamUid: nanoidSchema,
|
|
308
|
+
/** SDK metadata on generation */
|
|
309
|
+
sdk: sdkbuildSdkSchema,
|
|
310
|
+
/** Original API used to generate SDK */
|
|
311
|
+
api: sdkBuildApiSchema,
|
|
312
|
+
/** Custom SDK config */
|
|
313
|
+
config: external_exports.string(),
|
|
314
|
+
/** Should auto set active sdk version */
|
|
315
|
+
autoBump: external_exports.boolean().default(false),
|
|
316
|
+
/** Per-language build targets */
|
|
317
|
+
targets: sdkBuildTargetSchema.array().min(1)
|
|
318
|
+
}).meta({ id: "sdk-build" });
|
|
319
|
+
var sdkBuildLogChunkSchema = entitySchema.extend({
|
|
320
|
+
teamUid: nanoidSchema,
|
|
321
|
+
buildUid: nanoidSchema,
|
|
322
|
+
/** Monotonic order within a build. */
|
|
323
|
+
sequence: external_exports.number().int(),
|
|
324
|
+
chunk: external_exports.string()
|
|
325
|
+
}).meta({ id: "sdk-build-log-chunk" });
|
|
326
|
+
var sdkCodeSampleSchema = external_exports.object({
|
|
327
|
+
lang: external_exports.string(),
|
|
328
|
+
label: external_exports.string(),
|
|
329
|
+
source: external_exports.string()
|
|
330
|
+
}).meta({ id: "sdk-code-sample" });
|
|
331
|
+
|
|
332
|
+
// ../../packages/entities/dist/sdk/auto-update.js
|
|
333
|
+
import semver2 from "semver";
|
|
334
|
+
|
|
335
|
+
// ../../packages/entities/dist/sdk/helpers.js
|
|
336
|
+
import semver from "semver";
|
|
337
|
+
|
|
338
|
+
// ../../packages/entities/dist/sdk/scalar-config.js
|
|
339
|
+
var import_yaml = __toESM(require_dist(), 1);
|
|
340
|
+
var SCALAR_TARGET_LANGUAGES = [
|
|
341
|
+
"node",
|
|
342
|
+
"typescript",
|
|
343
|
+
"python",
|
|
344
|
+
"go",
|
|
345
|
+
"rust",
|
|
346
|
+
"java",
|
|
347
|
+
"kotlin",
|
|
348
|
+
"ruby",
|
|
349
|
+
"swift",
|
|
350
|
+
"terraform",
|
|
351
|
+
"cli",
|
|
352
|
+
"php",
|
|
353
|
+
"csharp",
|
|
354
|
+
"cpp",
|
|
355
|
+
"dart",
|
|
356
|
+
"sql",
|
|
357
|
+
"http",
|
|
358
|
+
"openapi"
|
|
359
|
+
];
|
|
360
|
+
var scalarTargetLanguageSchema = external_exports.enum(SCALAR_TARGET_LANGUAGES).meta({ id: "scalar-target-language" });
|
|
361
|
+
var sdkLanguageToScalarTarget = {
|
|
362
|
+
[SdkLanguage.Typescript]: "typescript",
|
|
363
|
+
[SdkLanguage.Python]: "python",
|
|
364
|
+
[SdkLanguage.CSharp]: "csharp",
|
|
365
|
+
[SdkLanguage.Java]: "java",
|
|
366
|
+
[SdkLanguage.Ruby]: "ruby",
|
|
367
|
+
[SdkLanguage.Php]: "php",
|
|
368
|
+
[SdkLanguage.Go]: "go",
|
|
369
|
+
[SdkLanguage.Rust]: "rust",
|
|
370
|
+
[SdkLanguage.Kotlin]: "kotlin",
|
|
371
|
+
[SdkLanguage.Swift]: "swift",
|
|
372
|
+
[SdkLanguage.Cpp]: "cpp",
|
|
373
|
+
[SdkLanguage.Dart]: "dart",
|
|
374
|
+
[SdkLanguage.Cli]: "cli"
|
|
375
|
+
};
|
|
376
|
+
var sdkLanguageToRegistry = {
|
|
377
|
+
[SdkLanguage.Typescript]: "npm",
|
|
378
|
+
[SdkLanguage.Python]: "pypi",
|
|
379
|
+
[SdkLanguage.Go]: "go",
|
|
380
|
+
[SdkLanguage.Rust]: "cargo",
|
|
381
|
+
[SdkLanguage.Java]: "maven",
|
|
382
|
+
[SdkLanguage.Kotlin]: "maven",
|
|
383
|
+
[SdkLanguage.Ruby]: "rubygems",
|
|
384
|
+
[SdkLanguage.Php]: "packagist",
|
|
385
|
+
[SdkLanguage.CSharp]: "nuget",
|
|
386
|
+
[SdkLanguage.Swift]: "swiftpm",
|
|
387
|
+
[SdkLanguage.Dart]: "pub",
|
|
388
|
+
[SdkLanguage.Cli]: "homebrew"
|
|
389
|
+
};
|
|
390
|
+
var registryPackageUrls = {
|
|
391
|
+
[SdkLanguage.Typescript]: (name) => `https://www.npmjs.com/package/${name}`,
|
|
392
|
+
[SdkLanguage.Python]: (name) => `https://pypi.org/project/${name}`,
|
|
393
|
+
[SdkLanguage.Ruby]: (name) => `https://rubygems.org/gems/${name}`,
|
|
394
|
+
[SdkLanguage.Rust]: (name) => `https://crates.io/crates/${name}`,
|
|
395
|
+
[SdkLanguage.CSharp]: (name) => `https://www.nuget.org/packages/${name}`,
|
|
396
|
+
[SdkLanguage.Dart]: (name) => `https://pub.dev/packages/${name}`,
|
|
397
|
+
// Packagist pages exist only for `vendor/name` packages.
|
|
398
|
+
[SdkLanguage.Php]: (name) => name.includes("/") ? `https://packagist.org/packages/${name}` : null
|
|
399
|
+
};
|
|
400
|
+
var scalarTargetDestinationsSchema = external_exports.object({
|
|
401
|
+
production: external_exports.object({
|
|
402
|
+
repo: external_exports.string(),
|
|
403
|
+
branch: external_exports.string().optional()
|
|
404
|
+
}).optional()
|
|
405
|
+
}).meta({ id: "scalar-target-destinations" });
|
|
406
|
+
var scalarTargetEntrySchema = external_exports.looseObject({
|
|
407
|
+
packageName: external_exports.string().optional(),
|
|
408
|
+
// Prerelease channel for the target's releases (release-please's
|
|
409
|
+
// `prerelease-type` with its `prerelease` versioning strategy): releases
|
|
410
|
+
// version as `1.2.0-<type>.1`, `-<type>.2`, … auto-incrementing. Absent
|
|
411
|
+
// falls back to the channel the promote branch implies (see
|
|
412
|
+
// derivePrereleaseType); a conventional branch like `main` means stable
|
|
413
|
+
// releases.
|
|
414
|
+
prereleaseType: external_exports.string().optional(),
|
|
415
|
+
destinations: scalarTargetDestinationsSchema.optional(),
|
|
416
|
+
// Per-registry publish config (e.g. `{ npm: { authMethod: 'oidc' } }`). Present only when the
|
|
417
|
+
// target opts into publish-on-merge; the generator reads it to emit publish workflow steps.
|
|
418
|
+
publish: external_exports.record(external_exports.string(), external_exports.any()).optional()
|
|
419
|
+
}).meta({ id: "scalar-target-entry" });
|
|
420
|
+
var scalarClientSettingsSchema = external_exports.looseObject({
|
|
421
|
+
opts: external_exports.record(external_exports.string(), external_exports.any()).optional(),
|
|
422
|
+
defaultHeaders: external_exports.record(external_exports.string(), external_exports.string()).optional(),
|
|
423
|
+
defaultTimeout: external_exports.union([external_exports.number(), external_exports.string()]).optional(),
|
|
424
|
+
defaultEnvPrefix: external_exports.string().optional()
|
|
425
|
+
}).meta({ id: "scalar-client-settings" });
|
|
426
|
+
var scalarDiagnosticsSchema = external_exports.looseObject({
|
|
427
|
+
failOn: external_exports.enum(["off", "info", "warn", "error"]).optional(),
|
|
428
|
+
maxWarnings: external_exports.number().optional()
|
|
429
|
+
}).meta({ id: "scalar-diagnostics" });
|
|
430
|
+
var scalarSdkConfigSchema = external_exports.looseObject({
|
|
431
|
+
name: external_exports.string().optional(),
|
|
432
|
+
resources: external_exports.record(external_exports.string(), external_exports.any()).optional(),
|
|
433
|
+
targets: external_exports.partialRecord(scalarTargetLanguageSchema, scalarTargetEntrySchema).optional(),
|
|
434
|
+
clientSettings: scalarClientSettingsSchema.optional(),
|
|
435
|
+
environments: external_exports.record(external_exports.string(), external_exports.string()).optional(),
|
|
436
|
+
codeSampleLanguages: scalarTargetLanguageSchema.array().optional(),
|
|
437
|
+
diagnostics: scalarDiagnosticsSchema.optional()
|
|
438
|
+
}).meta({ id: "scalar-sdk-config" });
|
|
439
|
+
var scalarTargetToSdkLanguage = Object.fromEntries(Object.entries(sdkLanguageToScalarTarget).map(([language, target]) => [
|
|
440
|
+
target,
|
|
441
|
+
language
|
|
442
|
+
]));
|
|
443
|
+
var resolveSdkConfigRequestSchema = external_exports.object({
|
|
444
|
+
api: external_exports.object({
|
|
445
|
+
namespace: namespaceSchema,
|
|
446
|
+
slug: slugSchema,
|
|
447
|
+
version: docVersionSchema.optional(),
|
|
448
|
+
upgraded: external_exports.boolean().optional()
|
|
449
|
+
}),
|
|
450
|
+
namespace: namespaceSchema,
|
|
451
|
+
slug: slugSchema,
|
|
452
|
+
languages: external_exports.enum(SdkLanguage).array().min(1),
|
|
453
|
+
/** Candidate config to validate/complete; omit for the pure
|
|
454
|
+
* document-derived default. */
|
|
455
|
+
config: external_exports.string().optional()
|
|
456
|
+
});
|
|
457
|
+
|
|
458
|
+
export {
|
|
459
|
+
SdkLanguage,
|
|
460
|
+
sdkSchema,
|
|
461
|
+
sdkBuildSchema,
|
|
462
|
+
scalarSdkConfigSchema
|
|
463
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { createRequire as $$cR } from "node:module"; const require = $$cR(import.meta.url);
|
|
2
|
+
|
|
3
|
+
// ../../packages/helpers/dist/datetime/index.js
|
|
4
|
+
function formatAbsoluteTime(date) {
|
|
5
|
+
return new Intl.DateTimeFormat("en", {
|
|
6
|
+
month: "short",
|
|
7
|
+
day: "numeric",
|
|
8
|
+
year: "numeric",
|
|
9
|
+
hour: "numeric",
|
|
10
|
+
minute: "2-digit"
|
|
11
|
+
}).format(new Date(date));
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export {
|
|
15
|
+
formatAbsoluteTime
|
|
16
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { createRequire as $$cR } from "node:module"; const require = $$cR(import.meta.url);
|
|
2
|
+
|
|
3
|
+
// src/domains/document/bundle/index.ts
|
|
4
|
+
import { Command } from "commander";
|
|
5
|
+
var DEFAULT_FETCH_CONCURRENCY = 5;
|
|
6
|
+
function BundleCommand() {
|
|
7
|
+
const cmd = new Command("bundle");
|
|
8
|
+
cmd.description(
|
|
9
|
+
"Bundle an OpenAPI document by resolving all references and external dependencies"
|
|
10
|
+
);
|
|
11
|
+
cmd.argument("[file|url]", "Path to OpenAPI file or URL to bundle");
|
|
12
|
+
cmd.option("-o, --output <file>", "Path to save the bundled output file");
|
|
13
|
+
cmd.option("--treeShake", "Remove unused components from the bundled output");
|
|
14
|
+
cmd.option(
|
|
15
|
+
"--urlMap",
|
|
16
|
+
"Generate a map of resolved URLs in the bundled output"
|
|
17
|
+
);
|
|
18
|
+
cmd.option(
|
|
19
|
+
"--fetchLimit <limit>",
|
|
20
|
+
"Maximum number of URLs to fetch during bundling at the same time"
|
|
21
|
+
);
|
|
22
|
+
cmd.action(async (...args) => {
|
|
23
|
+
const { bundleAction } = await import("./action-BYZUBXVB.js");
|
|
24
|
+
return bundleAction(...args);
|
|
25
|
+
});
|
|
26
|
+
return cmd;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export {
|
|
30
|
+
DEFAULT_FETCH_CONCURRENCY,
|
|
31
|
+
BundleCommand
|
|
32
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { createRequire as $$cR } from "node:module"; const require = $$cR(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
userSchema
|
|
4
|
+
} from "./chunk-B6QZJWCQ.js";
|
|
5
|
+
|
|
6
|
+
// src/domains/team/helpers.ts
|
|
7
|
+
var getUserTeams = async (client, email) => {
|
|
8
|
+
const user = await client.getOne({
|
|
9
|
+
collectionPath: "users",
|
|
10
|
+
query: { email },
|
|
11
|
+
schema: userSchema
|
|
12
|
+
});
|
|
13
|
+
if (user.error) return user;
|
|
14
|
+
return { error: false, data: user.data.teams };
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export {
|
|
18
|
+
getUserTeams
|
|
19
|
+
};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { createRequire as $$cR } from "node:module"; const require = $$cR(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
teamImageSchema,
|
|
4
|
+
teamNameSchema
|
|
5
|
+
} from "./chunk-4DGQIAJX.js";
|
|
6
|
+
import {
|
|
7
|
+
brandedUid,
|
|
8
|
+
emailSchema,
|
|
9
|
+
entitySchema,
|
|
10
|
+
mintUid,
|
|
11
|
+
timestampSchema
|
|
12
|
+
} from "./chunk-ISGLWBXZ.js";
|
|
13
|
+
import {
|
|
14
|
+
external_exports,
|
|
15
|
+
zod_default
|
|
16
|
+
} from "./chunk-H2WRMLYY.js";
|
|
17
|
+
|
|
18
|
+
// ../../packages/entities/dist/user/bitbucket.js
|
|
19
|
+
var userBitbucketSchema = entitySchema.extend({
|
|
20
|
+
token: zod_default.string(),
|
|
21
|
+
refreshToken: zod_default.string(),
|
|
22
|
+
expiry: timestampSchema,
|
|
23
|
+
refreshExpiry: timestampSchema
|
|
24
|
+
}).meta({ id: "user-bitbucket" });
|
|
25
|
+
|
|
26
|
+
// ../../packages/entities/dist/user/github.js
|
|
27
|
+
var userGithubSchema = entitySchema.extend({
|
|
28
|
+
token: zod_default.string(),
|
|
29
|
+
refreshToken: zod_default.string(),
|
|
30
|
+
expiry: timestampSchema,
|
|
31
|
+
refreshExpiry: timestampSchema
|
|
32
|
+
}).meta({ id: "user-github" });
|
|
33
|
+
|
|
34
|
+
// ../../packages/entities/dist/user/password.js
|
|
35
|
+
var userPasswordSchema = entitySchema.extend({
|
|
36
|
+
passwordHash: external_exports.string().nullable().default(null),
|
|
37
|
+
salt: external_exports.string().nullable().default(null),
|
|
38
|
+
password: external_exports.string().nullable().default(null),
|
|
39
|
+
passwordDeprecatedExp: external_exports.number().nullable().default(null)
|
|
40
|
+
}).overwrite((d) => {
|
|
41
|
+
if (d.passwordHash) {
|
|
42
|
+
d.password = null;
|
|
43
|
+
d.salt = null;
|
|
44
|
+
d.passwordDeprecatedExp = null;
|
|
45
|
+
}
|
|
46
|
+
return d;
|
|
47
|
+
}).meta({ id: "user-password" });
|
|
48
|
+
var emailSignupOtpSchema = entitySchema.extend({
|
|
49
|
+
email: emailSchema,
|
|
50
|
+
otp: external_exports.string().min(6).max(6),
|
|
51
|
+
otpClientId: external_exports.string(),
|
|
52
|
+
exp: timestampSchema
|
|
53
|
+
}).meta({ id: "email-signup-otp" });
|
|
54
|
+
|
|
55
|
+
// ../../packages/entities/dist/user/signup-meta.js
|
|
56
|
+
var signupMetaSchema = entitySchema.extend({
|
|
57
|
+
email: zod_default.string().optional(),
|
|
58
|
+
ip: zod_default.string().optional(),
|
|
59
|
+
region: zod_default.string().optional(),
|
|
60
|
+
city: zod_default.string().optional(),
|
|
61
|
+
location: zod_default.string().optional()
|
|
62
|
+
}).meta({ id: "signup-meta" });
|
|
63
|
+
|
|
64
|
+
// ../../packages/entities/dist/user/user.js
|
|
65
|
+
var teamRefSchema = zod_default.object({
|
|
66
|
+
// Brand only — keeps the runtime `z.string()` validation while flowing the
|
|
67
|
+
// Team brand into Team-scoped accessors.
|
|
68
|
+
teamUid: zod_default.string().brand(),
|
|
69
|
+
teamName: teamNameSchema,
|
|
70
|
+
teamImageUri: teamImageSchema
|
|
71
|
+
}).meta({ id: "team-ref" });
|
|
72
|
+
var userSchema = entitySchema.extend({
|
|
73
|
+
/** Own uid, branded so it cannot be confused with another entity's uid */
|
|
74
|
+
uid: brandedUid().default(mintUid).meta({
|
|
75
|
+
default: "nanoid()"
|
|
76
|
+
}),
|
|
77
|
+
theme: zod_default.string().optional(),
|
|
78
|
+
/** Email or other unique token identifier for performant auth lookup */
|
|
79
|
+
userIndex: zod_default.string().overwrite((s) => s.toLowerCase()),
|
|
80
|
+
/** Federated auth provided must have a linked email */
|
|
81
|
+
email: emailSchema,
|
|
82
|
+
teams: teamRefSchema.array(),
|
|
83
|
+
activeTeamId: zod_default.string().brand().nullable(),
|
|
84
|
+
hasGithub: zod_default.boolean().optional().default(false),
|
|
85
|
+
hasBitbucket: zod_default.boolean().optional().default(false),
|
|
86
|
+
/** Forgejo personal access token for git operations */
|
|
87
|
+
forgejoToken: zod_default.string().optional()
|
|
88
|
+
}).meta({ id: "user" });
|
|
89
|
+
|
|
90
|
+
export {
|
|
91
|
+
userSchema
|
|
92
|
+
};
|