@scalar/cli 2.0.1 → 2.5.1
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 +68 -24
- package/chunks/action-37EV4UHW.js +125 -0
- package/chunks/action-4XI7XJR4.js +204 -0
- package/chunks/action-5IU77OII.js +60 -0
- package/chunks/action-B3KKREWQ.js +64 -0
- package/chunks/action-CH24QGTE.js +86 -0
- package/chunks/action-F3UX5E3M.js +522 -0
- package/chunks/action-FDB7NEOK.js +81 -0
- package/chunks/action-FIXBOJEW.js +244 -0
- package/chunks/action-G26LSVZ7.js +40 -0
- package/chunks/action-H3RTILLM.js +46 -0
- package/chunks/action-HGBBV353.js +86 -0
- package/chunks/action-IUE4IOWO.js +2142 -0
- package/chunks/action-JZLZ7ZAD.js +110 -0
- package/chunks/action-LA6KVAXQ.js +374 -0
- package/chunks/action-M7RQKBSB.js +169 -0
- package/chunks/action-MSLBC2SO.js +92 -0
- package/chunks/action-NVSZT2ZD.js +37 -0
- package/chunks/action-OGQSTRMX.js +37 -0
- package/chunks/action-PAGJ5PWC.js +60 -0
- package/chunks/action-QE2ZQQX7.js +250 -0
- package/chunks/action-QPUSPD5M.js +54 -0
- package/chunks/action-R7IMFHQ5.js +147 -0
- package/chunks/action-SH4UUXPL.js +60 -0
- package/chunks/action-SNLCIBQC.js +84 -0
- package/chunks/action-SQG3JAII.js +150 -0
- package/chunks/action-UZQJNYK4.js +18 -0
- package/chunks/action-VC4DCVST.js +68 -0
- package/chunks/action-VTVFY2MP.js +181 -0
- package/chunks/action-WFWYGY7O.js +67 -0
- package/chunks/action-XMNX5ZYT.js +197 -0
- package/chunks/agent-HCQRMHQ5.js +132 -0
- package/chunks/asyncapi-QM76O55R.js +105 -0
- package/chunks/build.action-P7FCIMYU.js +108 -0
- package/chunks/chunk-24WAOKGG.js +105 -0
- package/chunks/chunk-3L6DLIXJ.js +25530 -0
- package/chunks/chunk-3MZYUBJ6.js +49 -0
- package/chunks/chunk-3ZJYGGAA.js +30 -0
- package/chunks/chunk-4NHMAG6F.js +21 -0
- package/chunks/chunk-4ORL4MST.js +16 -0
- package/chunks/chunk-4ZDQXWBT.js +26 -0
- package/chunks/chunk-6ZMT63IV.js +19 -0
- package/chunks/chunk-7AGLC7WV.js +107 -0
- package/chunks/chunk-AEFPCC4U.js +16 -0
- package/chunks/chunk-AO3F5XWR.js +3147 -0
- package/chunks/chunk-B2MHTD3R.js +90 -0
- package/chunks/chunk-CISTON3A.js +153 -0
- package/chunks/chunk-COBPBRQF.js +25 -0
- package/chunks/chunk-F467BYYR.js +568 -0
- package/chunks/chunk-GSGZHE26.js +352 -0
- package/chunks/chunk-HCPN3KNF.js +637 -0
- package/chunks/chunk-HPL3ZZ2P.js +1726 -0
- package/chunks/chunk-IKT5F47M.js +17344 -0
- package/chunks/chunk-JFIXNSPP.js +26 -0
- package/chunks/chunk-K4DTP5TV.js +32 -0
- package/chunks/chunk-K74E42RV.js +7311 -0
- package/chunks/chunk-KHDYYVYF.js +16 -0
- package/chunks/chunk-LFU5ZUAP.js +350 -0
- package/chunks/chunk-M37TP6U2.js +445 -0
- package/chunks/chunk-OQKDBLOZ.js +741 -0
- package/chunks/chunk-P7H7GY5A.js +14 -0
- package/chunks/chunk-PBXZN65A.js +63911 -0
- package/chunks/chunk-PT5TI77I.js +34 -0
- package/chunks/chunk-Q7DOQHZN.js +404 -0
- package/chunks/chunk-T5HJUAWB.js +242 -0
- package/chunks/chunk-T7B6WNZC.js +18 -0
- package/chunks/chunk-UGGNHILG.js +38 -0
- package/chunks/chunk-VNYE4R7N.js +499 -0
- package/chunks/chunk-X5T526CE.js +23 -0
- package/chunks/chunk-XCSR4RIT.js +210 -0
- package/chunks/chunk-Z2KMGFE6.js +295 -0
- package/chunks/create.action-HDD2WUON.js +108 -0
- package/chunks/delete.action-7GOZY7ID.js +88 -0
- package/chunks/delete.action-VE66JFDS.js +96 -0
- package/chunks/get.action-2745EB4N.js +86 -0
- package/chunks/list.action-3VTXQJRA.js +116 -0
- package/chunks/list.action-4QDCZLSZ.js +95 -0
- package/chunks/publish.action-ULQLZKWU.js +190 -0
- package/chunks/update.action-6QEFP7NA.js +95 -0
- package/chunks/update.action-OROQSP2S.js +101 -0
- package/docs.html +352 -250
- package/index.js +664 -99064
- package/package.json +17 -11
|
@@ -0,0 +1,637 @@
|
|
|
1
|
+
import { createRequire as $$cR } from "node:module"; const require = $$cR(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
RegistryResourceTypes,
|
|
4
|
+
baseRegistrySchema,
|
|
5
|
+
contentShaSchema
|
|
6
|
+
} from "./chunk-Q7DOQHZN.js";
|
|
7
|
+
import {
|
|
8
|
+
brandedUid,
|
|
9
|
+
docVersionSchema,
|
|
10
|
+
emailSchema,
|
|
11
|
+
entitySchema,
|
|
12
|
+
external_exports,
|
|
13
|
+
mintUid,
|
|
14
|
+
nanoid,
|
|
15
|
+
nanoidSchema,
|
|
16
|
+
randomAccessGroupSlug,
|
|
17
|
+
registryMetaSchema,
|
|
18
|
+
scalarSet,
|
|
19
|
+
slugSchema,
|
|
20
|
+
timestampSchema,
|
|
21
|
+
unixTimestamp
|
|
22
|
+
} from "./chunk-IKT5F47M.js";
|
|
23
|
+
|
|
24
|
+
// ../../packages/entities/dist/access-group/schema.js
|
|
25
|
+
var emailDomainRegex = /^([A-Za-z0-9]+(-[A-Za-z0-9]+)*\.)+[A-Za-z]{2,}$/i;
|
|
26
|
+
var emailDomainSchema = external_exports.string().regex(emailDomainRegex, "Invalid domain").max(253).meta({ id: "email-domain" });
|
|
27
|
+
var accessGroupEmails = scalarSet(external_exports.set(emailSchema).max(1e3, "You can only add up to 1000 emails"));
|
|
28
|
+
var accessGroupDomains = scalarSet(external_exports.set(emailDomainSchema).max(1e3, "You can only add up to 1000 domains"));
|
|
29
|
+
var accessGroupNameSchema = external_exports.string().max(40).meta({ id: "access-group-name" });
|
|
30
|
+
var accessGroupSchema = entitySchema.extend({
|
|
31
|
+
name: accessGroupNameSchema.default(""),
|
|
32
|
+
slug: slugSchema.default(randomAccessGroupSlug).meta({ default: "randomAccessGroupSlug()" }),
|
|
33
|
+
/** Set of allowed external email addresses */
|
|
34
|
+
allowedEmails: accessGroupEmails.default([]),
|
|
35
|
+
/** List of allowed email domains */
|
|
36
|
+
allowedDomains: accessGroupDomains.default([])
|
|
37
|
+
}).meta({ id: "access-group" });
|
|
38
|
+
|
|
39
|
+
// ../../packages/entities/dist/auth/identity-provider.js
|
|
40
|
+
var identityProviders = [
|
|
41
|
+
"local",
|
|
42
|
+
"google",
|
|
43
|
+
"okta",
|
|
44
|
+
"auth0",
|
|
45
|
+
"azure",
|
|
46
|
+
"one-login",
|
|
47
|
+
"ping-identity"
|
|
48
|
+
];
|
|
49
|
+
var identityProviderRecordSchema = entitySchema.extend({
|
|
50
|
+
uid: nanoidSchema,
|
|
51
|
+
name: external_exports.string(),
|
|
52
|
+
provider: external_exports.enum(identityProviders),
|
|
53
|
+
createUsers: external_exports.boolean().default(false),
|
|
54
|
+
signRequests: external_exports.boolean().default(false),
|
|
55
|
+
/** Initiation URL */
|
|
56
|
+
ssoUrl: external_exports.string().default("").describe("This URL is used by Scalar to initiate a SAML login."),
|
|
57
|
+
/** IdP issuer */
|
|
58
|
+
issuer: external_exports.string().default("").describe("This is the URI that identifies your SAML identity provider. Any assertions must use a matching <saml:Issuer> attribute."),
|
|
59
|
+
/** Public provider certificate */
|
|
60
|
+
x509Cert: external_exports.string().default("").describe("The authentication certificate issued by your identity provider"),
|
|
61
|
+
/** Allow hosting authentication only */
|
|
62
|
+
consumerOnly: external_exports.boolean()
|
|
63
|
+
}).meta({ id: "identity-provider-record" });
|
|
64
|
+
|
|
65
|
+
// ../../packages/entities/dist/auth/login-attempt.js
|
|
66
|
+
var loginAttemptRecordSchema = entitySchema.extend({
|
|
67
|
+
/**
|
|
68
|
+
* HMAC of the account's userIndex, scoped to the action being counted. The
|
|
69
|
+
* address itself is deliberately not stored, so this collection cannot be
|
|
70
|
+
* read as a list of registered users.
|
|
71
|
+
*/
|
|
72
|
+
attemptKey: external_exports.string(),
|
|
73
|
+
/** Consecutive failures. The record is dropped when a login succeeds. */
|
|
74
|
+
failedCount: external_exports.number().int(),
|
|
75
|
+
/** When the most recent failure was recorded, in unix seconds */
|
|
76
|
+
lastFailureAt: external_exports.number().int(),
|
|
77
|
+
/**
|
|
78
|
+
* When this record may be collected, as a Date because MongoDB TTL indexes
|
|
79
|
+
* only act on BSON dates and silently ignore numeric fields.
|
|
80
|
+
*/
|
|
81
|
+
expiresAt: external_exports.date()
|
|
82
|
+
}).meta({ id: "login-attempt-record" });
|
|
83
|
+
|
|
84
|
+
// ../../packages/entities/dist/auth/flows.js
|
|
85
|
+
var OnboardingFlow;
|
|
86
|
+
(function(OnboardingFlow2) {
|
|
87
|
+
OnboardingFlow2["OssAgent"] = "oss-agent";
|
|
88
|
+
})(OnboardingFlow || (OnboardingFlow = {}));
|
|
89
|
+
|
|
90
|
+
// ../../packages/entities/dist/auth/oauth-state.js
|
|
91
|
+
var googleProfileSchema = external_exports.object({
|
|
92
|
+
email: emailSchema,
|
|
93
|
+
name: external_exports.string().min(1),
|
|
94
|
+
picture: external_exports.string().optional(),
|
|
95
|
+
email_verified: external_exports.boolean()
|
|
96
|
+
}).meta({ id: "google-profile" });
|
|
97
|
+
var githubProfileSchema = external_exports.object({
|
|
98
|
+
login: external_exports.string(),
|
|
99
|
+
name: external_exports.string().optional().nullable().default(null),
|
|
100
|
+
email: emailSchema.optional().nullable().default(null),
|
|
101
|
+
avatar_url: external_exports.string().optional().nullable().default(null)
|
|
102
|
+
}).meta({ id: "github-profile" });
|
|
103
|
+
var oauthStateSchema = external_exports.object({
|
|
104
|
+
uid: external_exports.string(),
|
|
105
|
+
redirect: external_exports.string(),
|
|
106
|
+
signupDataUid: external_exports.string().optional(),
|
|
107
|
+
teamInvite: external_exports.string().optional(),
|
|
108
|
+
flow: external_exports.enum(OnboardingFlow).optional()
|
|
109
|
+
}).meta({ id: "oauth-state" });
|
|
110
|
+
var microsoftProfileSchema = external_exports.object({
|
|
111
|
+
email: emailSchema,
|
|
112
|
+
name: external_exports.string().optional(),
|
|
113
|
+
/** Entra tenant id; the consumer tenant means a personal account */
|
|
114
|
+
tid: external_exports.string(),
|
|
115
|
+
/**
|
|
116
|
+
* "Email domain owner verified" optional claim. Entra tenant admins can
|
|
117
|
+
* put arbitrary emails on their users (nOAuth), so without this claim a
|
|
118
|
+
* work-account email cannot be trusted for allowlist checks.
|
|
119
|
+
*/
|
|
120
|
+
xms_edov: external_exports.union([external_exports.boolean(), external_exports.string()]).optional()
|
|
121
|
+
}).meta({ id: "microsoft-profile" });
|
|
122
|
+
var hostingOauthResourceSchema = external_exports.enum([
|
|
123
|
+
...RegistryResourceTypes,
|
|
124
|
+
"sync-project",
|
|
125
|
+
"project",
|
|
126
|
+
"publish",
|
|
127
|
+
"namespace"
|
|
128
|
+
]).meta({ id: "hosting-oauth-resource" });
|
|
129
|
+
var hostingOauthStateSchema = external_exports.object({
|
|
130
|
+
uid: nanoidSchema,
|
|
131
|
+
resource: external_exports.object({
|
|
132
|
+
uid: nanoidSchema,
|
|
133
|
+
type: hostingOauthResourceSchema
|
|
134
|
+
}),
|
|
135
|
+
teamUid: nanoidSchema,
|
|
136
|
+
redirect: external_exports.string().optional(),
|
|
137
|
+
/** Stamped on the stored record so abandoned states can be vacuumed */
|
|
138
|
+
createdAt: external_exports.number().optional()
|
|
139
|
+
}).meta({ id: "hosting-oauth-state" });
|
|
140
|
+
|
|
141
|
+
// ../../packages/entities/dist/auth/personal-token.js
|
|
142
|
+
var personalTokenRecordSchema = external_exports.object({
|
|
143
|
+
uid: external_exports.string(),
|
|
144
|
+
/** User friendly name */
|
|
145
|
+
name: external_exports.string().min(3).max(50),
|
|
146
|
+
/** User friendly description */
|
|
147
|
+
description: external_exports.string().max(200).optional().default(""),
|
|
148
|
+
/** Associate a personal token with a team */
|
|
149
|
+
teamUid: external_exports.string(),
|
|
150
|
+
/** Token expiry time in unix timestamp */
|
|
151
|
+
expiresAt: external_exports.number().int(),
|
|
152
|
+
/** Tracks if a token is blacklisted. Should not be used if token is revoked */
|
|
153
|
+
revoked: external_exports.boolean()
|
|
154
|
+
}).meta({ id: "personal-token-record" });
|
|
155
|
+
|
|
156
|
+
// ../../packages/entities/dist/auth/saml-state.js
|
|
157
|
+
var samlStateSchema = external_exports.object({
|
|
158
|
+
uid: nanoidSchema,
|
|
159
|
+
// AuthN request identifier
|
|
160
|
+
requestId: external_exports.string(),
|
|
161
|
+
// IDP configuration identifier
|
|
162
|
+
idpUid: nanoidSchema,
|
|
163
|
+
// Random state
|
|
164
|
+
relayState: external_exports.string().min(20),
|
|
165
|
+
// Redirect after sign in
|
|
166
|
+
redirect: external_exports.string().optional(),
|
|
167
|
+
// Expiry
|
|
168
|
+
expiresAt: external_exports.number()
|
|
169
|
+
}).meta({ id: "saml-state" });
|
|
170
|
+
var ssoResourceSchema = external_exports.enum([
|
|
171
|
+
...RegistryResourceTypes,
|
|
172
|
+
"sync-project",
|
|
173
|
+
"project",
|
|
174
|
+
"publish",
|
|
175
|
+
"mcp",
|
|
176
|
+
/** A team's registry namespace page, rather than one record on it. */
|
|
177
|
+
"namespace"
|
|
178
|
+
]).meta({ id: "sso-resource" });
|
|
179
|
+
var relayStateSchema = external_exports.object({
|
|
180
|
+
/** Uniquely identifies a relay state */
|
|
181
|
+
uid: nanoidSchema.default(nanoid).meta({ default: "nanoid()" }),
|
|
182
|
+
/** Identity provider metadata */
|
|
183
|
+
idp: external_exports.object({
|
|
184
|
+
uid: nanoidSchema,
|
|
185
|
+
provider: external_exports.enum(identityProviders)
|
|
186
|
+
}),
|
|
187
|
+
/**
|
|
188
|
+
* A resource indicates which specific product entity a
|
|
189
|
+
* relay state is meant for.
|
|
190
|
+
*
|
|
191
|
+
* If optional, the relay state is meant to redirect
|
|
192
|
+
* you to the platform (i.e. Dashboard URL) by default.
|
|
193
|
+
*/
|
|
194
|
+
resource: external_exports.object({
|
|
195
|
+
/** Identify resource by UID */
|
|
196
|
+
uid: nanoidSchema,
|
|
197
|
+
/** Allowed product SSO connections */
|
|
198
|
+
type: ssoResourceSchema
|
|
199
|
+
}).optional()
|
|
200
|
+
}).meta({ id: "relay-state", default: "nanoid()" });
|
|
201
|
+
|
|
202
|
+
// ../../packages/entities/dist/auth/domains.js
|
|
203
|
+
var AuthDomains;
|
|
204
|
+
(function(AuthDomains2) {
|
|
205
|
+
AuthDomains2["Cli"] = "cli";
|
|
206
|
+
AuthDomains2["Client"] = "client";
|
|
207
|
+
AuthDomains2["Local"] = "local";
|
|
208
|
+
AuthDomains2["Dashboard"] = "dashboard";
|
|
209
|
+
AuthDomains2["Agent"] = "agent";
|
|
210
|
+
AuthDomains2["Mcp"] = "mcp";
|
|
211
|
+
})(AuthDomains || (AuthDomains = {}));
|
|
212
|
+
|
|
213
|
+
// ../../packages/entities/dist/login-portals/customization.js
|
|
214
|
+
var loginPortalEmailSchema = external_exports.object({
|
|
215
|
+
/** @deprecated No longer rendered in the email template */
|
|
216
|
+
logo: external_exports.string().default(""),
|
|
217
|
+
/** @deprecated No longer rendered in the email template */
|
|
218
|
+
logoSize: external_exports.string().default("100"),
|
|
219
|
+
buttonText: external_exports.string().max(50).default("Login"),
|
|
220
|
+
message: external_exports.string().max(1e3).default("Click to access private documentation hosted by scalar.com"),
|
|
221
|
+
title: external_exports.string().max(100).default("Private Docs"),
|
|
222
|
+
mainColor: external_exports.string().max(100).default("#2a2f45"),
|
|
223
|
+
mainBackground: external_exports.string().max(100).default("#f6f6f6"),
|
|
224
|
+
cardColor: external_exports.string().max(100).default("#2a2f45"),
|
|
225
|
+
cardBackground: external_exports.string().max(100).default("#fff"),
|
|
226
|
+
buttonColor: external_exports.string().max(100).default("#fff"),
|
|
227
|
+
buttonBackground: external_exports.string().max(100).default("#0f0f0f")
|
|
228
|
+
}).meta({ id: "login-portal-email" });
|
|
229
|
+
var loginPortalPageSchema = external_exports.object({
|
|
230
|
+
/** Title of the page for the HTML Head */
|
|
231
|
+
title: external_exports.string().max(100).default("Scalar Private Docs"),
|
|
232
|
+
/** Description of the page for the HTML Head */
|
|
233
|
+
description: external_exports.string().max(500).default("Login to access your documentation"),
|
|
234
|
+
/** Custom HTML for the head of the page */
|
|
235
|
+
head: external_exports.string().default(""),
|
|
236
|
+
/** Script to include in the head of the page */
|
|
237
|
+
script: external_exports.string().default(""),
|
|
238
|
+
/** UID of the team theme to apply to the page */
|
|
239
|
+
theme: external_exports.string().default(""),
|
|
240
|
+
/** Company name used in the header */
|
|
241
|
+
companyName: external_exports.string().max(100).default(""),
|
|
242
|
+
/** Logo of the company used in the header as raw SVG/HTML */
|
|
243
|
+
logo: external_exports.string().default(""),
|
|
244
|
+
/** Link that the logo redirects to when clicking */
|
|
245
|
+
logoURL: external_exports.string().default(""),
|
|
246
|
+
/** Favicon URL or dataURI */
|
|
247
|
+
favicon: external_exports.string().default(""),
|
|
248
|
+
/** Terms link */
|
|
249
|
+
termsLink: external_exports.string().default(""),
|
|
250
|
+
/** Privacy link */
|
|
251
|
+
privacyLink: external_exports.string().default(""),
|
|
252
|
+
/** Title of the form */
|
|
253
|
+
formTitle: external_exports.string().max(100).default("Scalar Private Docs"),
|
|
254
|
+
/** Description of the form */
|
|
255
|
+
formDescription: external_exports.string().max(500).default("Login to access your documentation"),
|
|
256
|
+
/** Image of the form */
|
|
257
|
+
formImage: external_exports.string().default("")
|
|
258
|
+
}).meta({ id: "login-portal-page" });
|
|
259
|
+
var loginPortalSchema = external_exports.object({
|
|
260
|
+
uid: nanoidSchema,
|
|
261
|
+
title: external_exports.string().max(200),
|
|
262
|
+
slug: slugSchema,
|
|
263
|
+
email: loginPortalEmailSchema,
|
|
264
|
+
page: loginPortalPageSchema
|
|
265
|
+
}).meta({ id: "login-portal" });
|
|
266
|
+
|
|
267
|
+
// ../../packages/entities/dist/managed-schema/schema.js
|
|
268
|
+
var managedSchemaVersion = entitySchema.extend({
|
|
269
|
+
/** Version identifier (e.g. 0.0.1) for schema */
|
|
270
|
+
version: docVersionSchema.default("0.0.1"),
|
|
271
|
+
/**
|
|
272
|
+
* SHA-256 hex digest of the YAML content the version serves, from its
|
|
273
|
+
* chain head. Integrity metadata for the YAML serialization, never a
|
|
274
|
+
* storage key.
|
|
275
|
+
*/
|
|
276
|
+
yamlSha: contentShaSchema.optional(),
|
|
277
|
+
/**
|
|
278
|
+
* SHA-256 hex digest of the JSON content the version serves, from its
|
|
279
|
+
* chain head. This is the blob key for both formats, matching the API
|
|
280
|
+
* document entity.
|
|
281
|
+
*/
|
|
282
|
+
jsonSha: contentShaSchema.optional()
|
|
283
|
+
}).meta({ id: "managed-schema-version" });
|
|
284
|
+
var managedSchemaFormat = external_exports.enum(["json", "yaml"]).meta({ id: "managed-schema-format" });
|
|
285
|
+
var managedSchema = baseRegistrySchema.extend({
|
|
286
|
+
/** Own uid, branded so it cannot be confused with another entity's uid */
|
|
287
|
+
uid: brandedUid().default(mintUid).meta({ default: "nanoid()" }),
|
|
288
|
+
/** The current version served to consumers by default */
|
|
289
|
+
version: docVersionSchema.default("0.0.1"),
|
|
290
|
+
/** Default schema format for edit/view */
|
|
291
|
+
format: managedSchemaFormat.default("json")
|
|
292
|
+
}).meta({ id: "managed-schema" });
|
|
293
|
+
|
|
294
|
+
// ../../packages/entities/dist/repository/repository.js
|
|
295
|
+
var linkedRepositoryRemoteSchema = external_exports.discriminatedUnion("provider", [
|
|
296
|
+
external_exports.object({
|
|
297
|
+
provider: external_exports.literal("github"),
|
|
298
|
+
installationId: external_exports.number().int(),
|
|
299
|
+
/** GitHub's numeric repository id; stable across renames. */
|
|
300
|
+
id: external_exports.number().int(),
|
|
301
|
+
/** The `owner/repo` full name. */
|
|
302
|
+
name: external_exports.string().min(2),
|
|
303
|
+
defaultBranch: external_exports.string().default("main")
|
|
304
|
+
}),
|
|
305
|
+
external_exports.object({
|
|
306
|
+
provider: external_exports.literal("bitbucket"),
|
|
307
|
+
workspaceUuid: external_exports.string(),
|
|
308
|
+
workspaceSlug: external_exports.string(),
|
|
309
|
+
repoUuid: external_exports.string(),
|
|
310
|
+
repoSlug: external_exports.string(),
|
|
311
|
+
/** The `workspace/repo` full name. */
|
|
312
|
+
name: external_exports.string().min(2),
|
|
313
|
+
defaultBranch: external_exports.string().default("main")
|
|
314
|
+
})
|
|
315
|
+
]).meta({ id: "linked-repository-remote" });
|
|
316
|
+
var linkedRepositorySchema = entitySchema.extend({
|
|
317
|
+
/** Own uid, branded so it cannot be confused with another entity's uid */
|
|
318
|
+
uid: brandedUid().default(mintUid).meta({ default: "nanoid()" }),
|
|
319
|
+
remote: linkedRepositoryRemoteSchema,
|
|
320
|
+
/**
|
|
321
|
+
* The single internal mirror. Null until provisioning succeeds — the link
|
|
322
|
+
* itself must not fail because Forgejo was briefly unreachable, so the
|
|
323
|
+
* mirror is re-ensured on demand rather than required up front.
|
|
324
|
+
*/
|
|
325
|
+
forgejo: external_exports.object({
|
|
326
|
+
owner: external_exports.string(),
|
|
327
|
+
repo: external_exports.string(),
|
|
328
|
+
branch: external_exports.string().default("main")
|
|
329
|
+
}).nullable().default(null),
|
|
330
|
+
/** Email of the user who linked the repository. */
|
|
331
|
+
linkedBy: external_exports.string()
|
|
332
|
+
}).meta({ id: "linked-repository" });
|
|
333
|
+
|
|
334
|
+
// ../../packages/entities/dist/repository/webhook-event-claim.js
|
|
335
|
+
var webhookEventClaimRecordSchema = entitySchema.extend({
|
|
336
|
+
/** `<teamUid>:<projectUid>:<eventKey>`, unique across the collection. */
|
|
337
|
+
claimKey: external_exports.string(),
|
|
338
|
+
/**
|
|
339
|
+
* The delivery that holds the claim. A delivery whose work failed removes
|
|
340
|
+
* its own claim by this, so it cannot take away a claim another delivery
|
|
341
|
+
* has since taken over.
|
|
342
|
+
*/
|
|
343
|
+
delivery: external_exports.string(),
|
|
344
|
+
/**
|
|
345
|
+
* When the claim lapses and this record may be collected, as a Date because
|
|
346
|
+
* MongoDB TTL indexes only act on BSON dates and silently ignore numeric
|
|
347
|
+
* fields.
|
|
348
|
+
*/
|
|
349
|
+
expiresAt: external_exports.date()
|
|
350
|
+
}).meta({ id: "webhook-event-claim-record" });
|
|
351
|
+
|
|
352
|
+
// ../../packages/entities/dist/waitlist/index.js
|
|
353
|
+
var WaitlistProducts;
|
|
354
|
+
(function(WaitlistProducts2) {
|
|
355
|
+
WaitlistProducts2["Client"] = "client";
|
|
356
|
+
})(WaitlistProducts || (WaitlistProducts = {}));
|
|
357
|
+
var WaitlistSources;
|
|
358
|
+
(function(WaitlistSources2) {
|
|
359
|
+
WaitlistSources2["Client"] = "client";
|
|
360
|
+
})(WaitlistSources || (WaitlistSources = {}));
|
|
361
|
+
var waitlistRecordSchema = external_exports.object({
|
|
362
|
+
uid: nanoidSchema,
|
|
363
|
+
email: emailSchema,
|
|
364
|
+
products: external_exports.array(external_exports.enum(WaitlistProducts)),
|
|
365
|
+
createdAt: timestampSchema,
|
|
366
|
+
updatedAt: timestampSchema,
|
|
367
|
+
metadata: external_exports.record(external_exports.string(), external_exports.union([external_exports.string(), external_exports.number(), external_exports.boolean()])).optional().overwrite((obj) => {
|
|
368
|
+
if (!obj || Object.keys(obj).length < 50)
|
|
369
|
+
return obj;
|
|
370
|
+
const trimmedObj = Object.fromEntries(Object.entries(obj).slice(0, 50));
|
|
371
|
+
return trimmedObj;
|
|
372
|
+
})
|
|
373
|
+
}).meta({ id: "waitlist-record" });
|
|
374
|
+
|
|
375
|
+
// ../../packages/entities/dist/webhook/schema.js
|
|
376
|
+
var webhookEventSchema = external_exports.enum(["sdk.build.completed"]).meta({ id: "webhook-event" });
|
|
377
|
+
var webhookDisabledReasonSchema = external_exports.enum(["consecutive-failures"]).meta({ id: "webhook-disabled-reason" });
|
|
378
|
+
var webhookSubscriptionSchema = entitySchema.extend({
|
|
379
|
+
uid: brandedUid().default(mintUid).meta({ default: "nanoid()" }),
|
|
380
|
+
teamUid: nanoidSchema,
|
|
381
|
+
/** Event delivered to this endpoint. */
|
|
382
|
+
event: webhookEventSchema.default("sdk.build.completed"),
|
|
383
|
+
/** Where deliveries are POSTed. Validated against the SSRF guard on write. */
|
|
384
|
+
url: external_exports.url(),
|
|
385
|
+
/** Whether deliveries are attempted. Cleared by the auto-disable path. */
|
|
386
|
+
enabled: external_exports.boolean().default(true),
|
|
387
|
+
/** Optional label describing the endpoint. */
|
|
388
|
+
description: external_exports.string().max(200).default(""),
|
|
389
|
+
/**
|
|
390
|
+
* Terminal failures since the last success. Reset to zero on any 2xx, and
|
|
391
|
+
* compared against {@link WEBHOOK_FAILURE_DISABLE_THRESHOLD}.
|
|
392
|
+
*/
|
|
393
|
+
consecutiveFailures: external_exports.number().int().min(0).default(0),
|
|
394
|
+
/**
|
|
395
|
+
* Set when the platform disabled this itself, so the dashboard can explain
|
|
396
|
+
* why an endpoint stopped rather than showing a bare "off" toggle.
|
|
397
|
+
*
|
|
398
|
+
* Nullable as well as optional: mongobase round-trips an unset optional as
|
|
399
|
+
* null, and a strict parse would drop the whole document on read.
|
|
400
|
+
*/
|
|
401
|
+
disabledReason: webhookDisabledReasonSchema.nullable().optional(),
|
|
402
|
+
/** When the platform disabled it, in unix seconds. Nullable, as above. */
|
|
403
|
+
disabledAt: external_exports.number().nullable().optional()
|
|
404
|
+
}).meta({ id: "webhook-subscription" });
|
|
405
|
+
var WEBHOOK_SECRET_KEY_VERSION = 1;
|
|
406
|
+
var WEBHOOK_SECRET_GRACE_PERIOD_SECONDS = 24 * 60 * 60;
|
|
407
|
+
var webhookSecretSchema = entitySchema.extend({
|
|
408
|
+
uid: brandedUid(),
|
|
409
|
+
teamUid: nanoidSchema,
|
|
410
|
+
/** AES-256-GCM ciphertext of the secret, hex encoded. */
|
|
411
|
+
ciphertext: external_exports.string(),
|
|
412
|
+
/** Initialisation vector for {@link ciphertext}, hex encoded. */
|
|
413
|
+
iv: external_exports.string(),
|
|
414
|
+
/**
|
|
415
|
+
* GCM authentication tag, hex encoded. Covers the ciphertext and the
|
|
416
|
+
* subscription the record belongs to, so tampering or moving a record
|
|
417
|
+
* between endpoints fails the decrypt.
|
|
418
|
+
*/
|
|
419
|
+
tag: external_exports.string(),
|
|
420
|
+
/** {@link WEBHOOK_SECRET_KEY_VERSION} in force when this was written. */
|
|
421
|
+
keyVersion: external_exports.number().int().default(WEBHOOK_SECRET_KEY_VERSION),
|
|
422
|
+
/**
|
|
423
|
+
* The secret this one replaced, kept signing until `expiresAt` so a
|
|
424
|
+
* routine roll does not drop deliveries while the customer updates their
|
|
425
|
+
* receiver. At most one — rolling again inside the window replaces it.
|
|
426
|
+
*
|
|
427
|
+
* Nullable as well as optional: mongobase round-trips an unset optional as
|
|
428
|
+
* null, and a strict parse would drop the whole document on read.
|
|
429
|
+
*/
|
|
430
|
+
previous: external_exports.object({
|
|
431
|
+
ciphertext: external_exports.string(),
|
|
432
|
+
iv: external_exports.string(),
|
|
433
|
+
tag: external_exports.string(),
|
|
434
|
+
keyVersion: external_exports.number().int(),
|
|
435
|
+
/** Unix seconds after which this secret stops signing deliveries. */
|
|
436
|
+
expiresAt: external_exports.number()
|
|
437
|
+
}).nullable().optional()
|
|
438
|
+
}).meta({ id: "webhook-secret" });
|
|
439
|
+
var webhookDeliveryStatusSchema = external_exports.enum(["pending", "succeeded", "failed"]).meta({ id: "webhook-delivery-status" });
|
|
440
|
+
var webhookDeliverySchema = entitySchema.extend({
|
|
441
|
+
uid: brandedUid().default(mintUid).meta({ default: "nanoid()" }),
|
|
442
|
+
teamUid: nanoidSchema,
|
|
443
|
+
subscriptionUid: brandedUid(),
|
|
444
|
+
event: webhookEventSchema,
|
|
445
|
+
/**
|
|
446
|
+
* What made this delivery unique for its subscription — the build uid for a
|
|
447
|
+
* build event. Pub/Sub is at-least-once, so a redelivered source message
|
|
448
|
+
* must land on the same delivery document rather than POSTing twice.
|
|
449
|
+
*/
|
|
450
|
+
dedupeKey: external_exports.string(),
|
|
451
|
+
/** The exact JSON body that is sent. */
|
|
452
|
+
payload: external_exports.string(),
|
|
453
|
+
/** Attempts made so far, across Cloud Tasks retries. */
|
|
454
|
+
attempts: external_exports.number().int().min(0).default(0),
|
|
455
|
+
status: webhookDeliveryStatusSchema.default("pending"),
|
|
456
|
+
/** Unix seconds of the most recent attempt. Nullable for the round-trip reason above. */
|
|
457
|
+
lastAttemptAt: external_exports.number().nullable().optional(),
|
|
458
|
+
/** HTTP status the endpoint returned, when it returned one at all. */
|
|
459
|
+
responseStatus: external_exports.number().nullable().optional(),
|
|
460
|
+
/** Why the last attempt failed, in terms a customer can act on. */
|
|
461
|
+
errorMessage: external_exports.string().nullable().optional()
|
|
462
|
+
}).meta({ id: "webhook-delivery" });
|
|
463
|
+
|
|
464
|
+
// ../../packages/entities/dist/workspace/hotkeys/constants.js
|
|
465
|
+
var HOTKEY_EVENT_NAMES = [
|
|
466
|
+
"closeModal",
|
|
467
|
+
"commandPaletteDown",
|
|
468
|
+
"commandPaletteSelect",
|
|
469
|
+
"commandPaletteUp",
|
|
470
|
+
"openCommandPalette",
|
|
471
|
+
"toggleSidebar",
|
|
472
|
+
"addTopNav",
|
|
473
|
+
"closeTopNav",
|
|
474
|
+
"navigateTopNavLeft",
|
|
475
|
+
"navigateTopNavRight",
|
|
476
|
+
"focusAddressBar",
|
|
477
|
+
"jumpToTab",
|
|
478
|
+
"jumpToLastTab"
|
|
479
|
+
];
|
|
480
|
+
var KEYDOWN_KEYS = [
|
|
481
|
+
"Space",
|
|
482
|
+
"Backspace",
|
|
483
|
+
"Tab",
|
|
484
|
+
"Enter",
|
|
485
|
+
"Escape",
|
|
486
|
+
"ArrowDown",
|
|
487
|
+
"ArrowLeft",
|
|
488
|
+
"ArrowRight",
|
|
489
|
+
"ArrowUp",
|
|
490
|
+
"End",
|
|
491
|
+
"Home",
|
|
492
|
+
"PageDown",
|
|
493
|
+
"PageUp",
|
|
494
|
+
"Delete",
|
|
495
|
+
"0",
|
|
496
|
+
"1",
|
|
497
|
+
"2",
|
|
498
|
+
"3",
|
|
499
|
+
"4",
|
|
500
|
+
"5",
|
|
501
|
+
"6",
|
|
502
|
+
"7",
|
|
503
|
+
"8",
|
|
504
|
+
"9",
|
|
505
|
+
"a",
|
|
506
|
+
"b",
|
|
507
|
+
"c",
|
|
508
|
+
"d",
|
|
509
|
+
"e",
|
|
510
|
+
"f",
|
|
511
|
+
"g",
|
|
512
|
+
"h",
|
|
513
|
+
"i",
|
|
514
|
+
"j",
|
|
515
|
+
"k",
|
|
516
|
+
"l",
|
|
517
|
+
"m",
|
|
518
|
+
"n",
|
|
519
|
+
"o",
|
|
520
|
+
"p",
|
|
521
|
+
"q",
|
|
522
|
+
"r",
|
|
523
|
+
"s",
|
|
524
|
+
"t",
|
|
525
|
+
"u",
|
|
526
|
+
"v",
|
|
527
|
+
"w",
|
|
528
|
+
"x",
|
|
529
|
+
"y",
|
|
530
|
+
"z",
|
|
531
|
+
"0",
|
|
532
|
+
"1",
|
|
533
|
+
"2",
|
|
534
|
+
"3",
|
|
535
|
+
"4",
|
|
536
|
+
"5",
|
|
537
|
+
"6",
|
|
538
|
+
"7",
|
|
539
|
+
"8",
|
|
540
|
+
"9",
|
|
541
|
+
"*",
|
|
542
|
+
"+",
|
|
543
|
+
"-",
|
|
544
|
+
".",
|
|
545
|
+
"/",
|
|
546
|
+
"F1",
|
|
547
|
+
"F2",
|
|
548
|
+
"F3",
|
|
549
|
+
"F4",
|
|
550
|
+
"F5",
|
|
551
|
+
"F6",
|
|
552
|
+
"F7",
|
|
553
|
+
"F8",
|
|
554
|
+
"F9",
|
|
555
|
+
"F10",
|
|
556
|
+
"F11",
|
|
557
|
+
"F12",
|
|
558
|
+
";",
|
|
559
|
+
"=",
|
|
560
|
+
",",
|
|
561
|
+
"-",
|
|
562
|
+
".",
|
|
563
|
+
"/",
|
|
564
|
+
"`",
|
|
565
|
+
"[",
|
|
566
|
+
"\\",
|
|
567
|
+
"]",
|
|
568
|
+
""
|
|
569
|
+
];
|
|
570
|
+
|
|
571
|
+
// ../../packages/entities/dist/workspace/hotkeys/hotkeys.js
|
|
572
|
+
var modifier = external_exports.enum(["Meta", "Control", "Shift", "Alt", "default"]).optional().default("default").meta({ id: "modifier" });
|
|
573
|
+
var modifiers = external_exports.array(modifier).optional().default(["default"]).meta({ id: "modifiers" });
|
|
574
|
+
var hotKeys = external_exports.record(external_exports.enum(KEYDOWN_KEYS), external_exports.object({
|
|
575
|
+
modifiers: modifiers.optional(),
|
|
576
|
+
event: external_exports.enum(HOTKEY_EVENT_NAMES)
|
|
577
|
+
})).meta({ id: "hot-keys" });
|
|
578
|
+
var hotKeyConfigSchema = external_exports.object({
|
|
579
|
+
modifiers,
|
|
580
|
+
hotKeys: hotKeys.optional()
|
|
581
|
+
}).optional().meta({ id: "hot-key-config" });
|
|
582
|
+
|
|
583
|
+
// ../../packages/entities/dist/workspace/workspace.js
|
|
584
|
+
var workspaceJsonSchema = external_exports.object({
|
|
585
|
+
/** Customize hotkeys */
|
|
586
|
+
hotKeyConfig: hotKeyConfigSchema,
|
|
587
|
+
/** Workspace level proxy for all requests to be sent through */
|
|
588
|
+
proxyUrl: external_exports.string().optional(),
|
|
589
|
+
/** Workspace level theme */
|
|
590
|
+
theme: external_exports.string().optional(),
|
|
591
|
+
/** Ordered list of documents to add to the workspace */
|
|
592
|
+
documents: external_exports.record(external_exports.string(), external_exports.looseObject({
|
|
593
|
+
title: external_exports.string().optional(),
|
|
594
|
+
$ref: external_exports.string().optional()
|
|
595
|
+
})),
|
|
596
|
+
/**
|
|
597
|
+
* Workspace level spec extensions.
|
|
598
|
+
*
|
|
599
|
+
* This must be an OAS Compliant JSON object that extends a spec with additional
|
|
600
|
+
* properties such as extra servers, cookies, auth, and environments
|
|
601
|
+
*/
|
|
602
|
+
extensions: external_exports.looseObject({})
|
|
603
|
+
}).meta({ id: "workspace-json" });
|
|
604
|
+
var workspaceVersionSchema = external_exports.object({
|
|
605
|
+
version: docVersionSchema,
|
|
606
|
+
/**
|
|
607
|
+
* We also keep a list of any managed docs used
|
|
608
|
+
* in the workspace version, in case we need to
|
|
609
|
+
* trigger any platform actions or update the
|
|
610
|
+
* workspace JSON
|
|
611
|
+
*/
|
|
612
|
+
managedDocs: registryMetaSchema.array(),
|
|
613
|
+
createdAt: timestampSchema.default(unixTimestamp).meta({ default: "unixTimestamp()" }),
|
|
614
|
+
updatedAt: timestampSchema.default(unixTimestamp).meta({ default: "unixTimestamp()" })
|
|
615
|
+
}).meta({ id: "workspace-version" });
|
|
616
|
+
var workspaceSchema = baseRegistrySchema.extend({
|
|
617
|
+
uid: nanoidSchema,
|
|
618
|
+
/** The current version served to consumers by default */
|
|
619
|
+
version: docVersionSchema,
|
|
620
|
+
versions: workspaceVersionSchema.array()
|
|
621
|
+
}).meta({ id: "workspace" });
|
|
622
|
+
|
|
623
|
+
export {
|
|
624
|
+
accessGroupSchema,
|
|
625
|
+
identityProviders,
|
|
626
|
+
identityProviderRecordSchema,
|
|
627
|
+
loginPortalSchema,
|
|
628
|
+
managedSchemaVersion,
|
|
629
|
+
managedSchema,
|
|
630
|
+
linkedRepositorySchema,
|
|
631
|
+
WaitlistProducts,
|
|
632
|
+
WaitlistSources,
|
|
633
|
+
webhookSubscriptionSchema,
|
|
634
|
+
webhookDeliverySchema,
|
|
635
|
+
workspaceVersionSchema,
|
|
636
|
+
workspaceSchema
|
|
637
|
+
};
|