@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,38 @@
|
|
|
1
|
+
import { createRequire as $$cR } from "node:module"; const require = $$cR(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
registryUrl
|
|
4
|
+
} from "./chunk-COBPBRQF.js";
|
|
5
|
+
|
|
6
|
+
// src/domains/registry/helpers/fetch.ts
|
|
7
|
+
async function fetchFromRegistry(path, accessToken) {
|
|
8
|
+
let response;
|
|
9
|
+
try {
|
|
10
|
+
response = await fetch(registryUrl(path), {
|
|
11
|
+
headers: {
|
|
12
|
+
"x-scalar-auth": accessToken
|
|
13
|
+
},
|
|
14
|
+
// Should always error on redirect
|
|
15
|
+
redirect: "error"
|
|
16
|
+
});
|
|
17
|
+
} catch (error) {
|
|
18
|
+
return {
|
|
19
|
+
error: true,
|
|
20
|
+
message: error instanceof Error && error.message.length > 0 ? error.message : "Registry request failed before a response was received."
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
if (!response.ok) {
|
|
24
|
+
const message = await response.text();
|
|
25
|
+
return {
|
|
26
|
+
error: true,
|
|
27
|
+
message: message.length ? message : `Registry request failed with status ${response.status}.`
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
return {
|
|
31
|
+
error: false,
|
|
32
|
+
data: await response.text()
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export {
|
|
37
|
+
fetchFromRegistry
|
|
38
|
+
};
|
|
@@ -0,0 +1,499 @@
|
|
|
1
|
+
import { createRequire as $$cR } from "node:module"; const require = $$cR(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
customProjectIconSchema
|
|
4
|
+
} from "./chunk-OQKDBLOZ.js";
|
|
5
|
+
import {
|
|
6
|
+
brandedUid,
|
|
7
|
+
emailSchema,
|
|
8
|
+
entitySchema,
|
|
9
|
+
external_exports,
|
|
10
|
+
mintUid,
|
|
11
|
+
namespaceSchema,
|
|
12
|
+
nanoidSchema,
|
|
13
|
+
schemaModel,
|
|
14
|
+
slugSchema,
|
|
15
|
+
timestampSchema,
|
|
16
|
+
unixTimestamp
|
|
17
|
+
} from "./chunk-IKT5F47M.js";
|
|
18
|
+
|
|
19
|
+
// ../../packages/entities/dist/team/access.js
|
|
20
|
+
var ExternalAccessMethod;
|
|
21
|
+
(function(ExternalAccessMethod2) {
|
|
22
|
+
ExternalAccessMethod2["Email"] = "email";
|
|
23
|
+
ExternalAccessMethod2["SSO"] = "sso";
|
|
24
|
+
ExternalAccessMethod2["Google"] = "google";
|
|
25
|
+
ExternalAccessMethod2["Microsoft"] = "microsoft";
|
|
26
|
+
})(ExternalAccessMethod || (ExternalAccessMethod = {}));
|
|
27
|
+
var emailInheritingExternalAccessMethods = [
|
|
28
|
+
ExternalAccessMethod.Google
|
|
29
|
+
];
|
|
30
|
+
var externalAccessMethodByProvider = {
|
|
31
|
+
google: ExternalAccessMethod.Google,
|
|
32
|
+
microsoft: ExternalAccessMethod.Microsoft
|
|
33
|
+
};
|
|
34
|
+
var externalAccessMethodsSchema = external_exports.object({
|
|
35
|
+
[ExternalAccessMethod.Email]: external_exports.boolean().default(true),
|
|
36
|
+
[ExternalAccessMethod.SSO]: external_exports.boolean().default(false),
|
|
37
|
+
/** No default: an unset social method inherits the email setting */
|
|
38
|
+
[ExternalAccessMethod.Google]: external_exports.boolean().optional(),
|
|
39
|
+
[ExternalAccessMethod.Microsoft]: external_exports.boolean().optional()
|
|
40
|
+
}).meta({ id: "external-access-methods" });
|
|
41
|
+
var externalAccessMethodLabels = {
|
|
42
|
+
[ExternalAccessMethod.Email]: "Email Magic Link",
|
|
43
|
+
[ExternalAccessMethod.SSO]: "Single Sign-On",
|
|
44
|
+
[ExternalAccessMethod.Google]: "Google OAuth",
|
|
45
|
+
[ExternalAccessMethod.Microsoft]: "Microsoft OAuth"
|
|
46
|
+
};
|
|
47
|
+
var externalAccessSchema = external_exports.object({
|
|
48
|
+
/** Available authentication methods for external access */
|
|
49
|
+
methods: externalAccessMethodsSchema.default(schemaModel({}, externalAccessMethodsSchema))
|
|
50
|
+
}).meta({ id: "external-access" });
|
|
51
|
+
|
|
52
|
+
// ../../packages/entities/dist/team/billing-plan.js
|
|
53
|
+
var BillingPlan;
|
|
54
|
+
(function(BillingPlan2) {
|
|
55
|
+
BillingPlan2["Trial"] = "trial";
|
|
56
|
+
BillingPlan2["Free"] = "free";
|
|
57
|
+
BillingPlan2["ProMonthly"] = "pro_monthly";
|
|
58
|
+
BillingPlan2["ProYearly"] = "pro_yearly";
|
|
59
|
+
BillingPlan2["Premium"] = "premium";
|
|
60
|
+
BillingPlan2["BusinessMonthly"] = "business_monthly";
|
|
61
|
+
BillingPlan2["BusinessYearly"] = "business_yearly";
|
|
62
|
+
BillingPlan2["Enterprise"] = "enterprise";
|
|
63
|
+
})(BillingPlan || (BillingPlan = {}));
|
|
64
|
+
var billingPlanLabels = {
|
|
65
|
+
[BillingPlan.Free]: "Free",
|
|
66
|
+
[BillingPlan.Trial]: "Trial",
|
|
67
|
+
[BillingPlan.ProMonthly]: "Pro (Monthly)",
|
|
68
|
+
[BillingPlan.Premium]: "Pro (Monthly)",
|
|
69
|
+
[BillingPlan.ProYearly]: "Pro (Yearly)",
|
|
70
|
+
[BillingPlan.BusinessMonthly]: "Business (Monthly)",
|
|
71
|
+
[BillingPlan.BusinessYearly]: "Business (Yearly)",
|
|
72
|
+
[BillingPlan.Enterprise]: "Enterprise"
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
// ../../packages/entities/dist/team/feature-flags.js
|
|
76
|
+
var FeatureFlag;
|
|
77
|
+
(function(FeatureFlag2) {
|
|
78
|
+
FeatureFlag2["Rules"] = "rules";
|
|
79
|
+
FeatureFlag2["Registry"] = "registry";
|
|
80
|
+
FeatureFlag2["Schemas"] = "schemas";
|
|
81
|
+
FeatureFlag2["SDK"] = "sdk";
|
|
82
|
+
FeatureFlag2["CLI"] = "cli";
|
|
83
|
+
FeatureFlag2["Agent"] = "agent";
|
|
84
|
+
FeatureFlag2["MCP"] = "mcp";
|
|
85
|
+
FeatureFlag2["Workspaces"] = "workspaces";
|
|
86
|
+
FeatureFlag2["Export"] = "export";
|
|
87
|
+
FeatureFlag2["DocsMCP"] = "docsMcp";
|
|
88
|
+
FeatureFlag2["DisableApiSSR"] = "disableApiSSR";
|
|
89
|
+
FeatureFlag2["UnifiedDocs"] = "unifiedDocs";
|
|
90
|
+
FeatureFlag2["UnifiedMcp"] = "unifiedMcp";
|
|
91
|
+
FeatureFlag2["DocsAnalytics"] = "docsAnalytics";
|
|
92
|
+
FeatureFlag2["McpAnalytics"] = "mcpAnalytics";
|
|
93
|
+
FeatureFlag2["MicrosoftLogin"] = "microsoftLogin";
|
|
94
|
+
FeatureFlag2["EditorPreview"] = "editorPreview";
|
|
95
|
+
FeatureFlag2["RegistryGit"] = "registryGit";
|
|
96
|
+
FeatureFlag2["AutoBillSeats"] = "autoBillSeats";
|
|
97
|
+
FeatureFlag2["AutoBillSdks"] = "autoBillSdks";
|
|
98
|
+
FeatureFlag2["SdkOpenApiEditor"] = "sdkOpenApiEditor";
|
|
99
|
+
FeatureFlag2["DashboardChat"] = "dashboardChat";
|
|
100
|
+
})(FeatureFlag || (FeatureFlag = {}));
|
|
101
|
+
var featureSchema = external_exports.boolean().optional().meta({ id: "feature" });
|
|
102
|
+
var featureUpdateSchema = external_exports.boolean().nullable().optional();
|
|
103
|
+
var featureFlagSchema = external_exports.object({
|
|
104
|
+
[FeatureFlag.Rules]: featureSchema,
|
|
105
|
+
[FeatureFlag.Registry]: featureSchema,
|
|
106
|
+
[FeatureFlag.Schemas]: featureSchema,
|
|
107
|
+
[FeatureFlag.SDK]: featureSchema,
|
|
108
|
+
[FeatureFlag.CLI]: featureSchema,
|
|
109
|
+
[FeatureFlag.Agent]: featureSchema,
|
|
110
|
+
[FeatureFlag.Workspaces]: featureSchema,
|
|
111
|
+
[FeatureFlag.MCP]: featureSchema,
|
|
112
|
+
[FeatureFlag.Export]: featureSchema,
|
|
113
|
+
[FeatureFlag.DocsMCP]: featureSchema,
|
|
114
|
+
[FeatureFlag.DisableApiSSR]: featureSchema,
|
|
115
|
+
[FeatureFlag.UnifiedDocs]: featureSchema,
|
|
116
|
+
[FeatureFlag.UnifiedMcp]: featureSchema,
|
|
117
|
+
[FeatureFlag.DocsAnalytics]: featureSchema,
|
|
118
|
+
[FeatureFlag.McpAnalytics]: featureSchema,
|
|
119
|
+
[FeatureFlag.MicrosoftLogin]: featureSchema,
|
|
120
|
+
[FeatureFlag.EditorPreview]: featureSchema,
|
|
121
|
+
[FeatureFlag.RegistryGit]: featureSchema,
|
|
122
|
+
[FeatureFlag.AutoBillSeats]: featureSchema,
|
|
123
|
+
[FeatureFlag.AutoBillSdks]: featureSchema,
|
|
124
|
+
[FeatureFlag.SdkOpenApiEditor]: featureSchema,
|
|
125
|
+
[FeatureFlag.DashboardChat]: featureSchema
|
|
126
|
+
}).meta({ id: "feature-flag" });
|
|
127
|
+
var featureFlagUpdateSchema = external_exports.object(Object.fromEntries(Object.values(FeatureFlag).map((featureFlag) => [
|
|
128
|
+
featureFlag,
|
|
129
|
+
featureUpdateSchema
|
|
130
|
+
]))).meta({ id: "feature-flag-update" });
|
|
131
|
+
var autoBillingFlags = {
|
|
132
|
+
seats: FeatureFlag.AutoBillSeats,
|
|
133
|
+
sdks: FeatureFlag.AutoBillSdks
|
|
134
|
+
};
|
|
135
|
+
var DEFAULT_ON_FLAGS = /* @__PURE__ */ new Set([
|
|
136
|
+
...Object.values(autoBillingFlags),
|
|
137
|
+
/**
|
|
138
|
+
* MCP analytics is on for everyone; the flag remains only as a per-team kill
|
|
139
|
+
* switch. Ingest has always run for every team regardless of the flag, so
|
|
140
|
+
* this grants read access to records that already exist rather than starting
|
|
141
|
+
* any new collection.
|
|
142
|
+
*/
|
|
143
|
+
FeatureFlag.McpAnalytics,
|
|
144
|
+
/**
|
|
145
|
+
* The dashboard assistant is on for everyone; an explicit per-team false
|
|
146
|
+
* remains the kill switch, which also hides the docs editor's Ask AI entry
|
|
147
|
+
* points since the editor's chat is a plug-in of the assistant. Listed here
|
|
148
|
+
* so the server-side gate and the admin flag editor's "Default (On)" label
|
|
149
|
+
* agree with the dashboard's client default.
|
|
150
|
+
*/
|
|
151
|
+
FeatureFlag.DashboardChat,
|
|
152
|
+
/**
|
|
153
|
+
* The MCP studio is on for everyone; an explicit per-team false remains the
|
|
154
|
+
* kill switch back to the legacy MCP pages. Listed here so the server-side
|
|
155
|
+
* gate and the admin flag editor's "Default (On)" label agree with the
|
|
156
|
+
* dashboard's client default.
|
|
157
|
+
*/
|
|
158
|
+
FeatureFlag.UnifiedMcp,
|
|
159
|
+
/**
|
|
160
|
+
* The unified editor is on for everyone: the legacy dashboard surfaces are
|
|
161
|
+
* deleted, so the dashboard serves the studios regardless. Listed here so
|
|
162
|
+
* the server-side gate and the admin flag editor's "Default (On)" label
|
|
163
|
+
* agree with the dashboard's client default; an explicit per-team false
|
|
164
|
+
* remains the kill switch.
|
|
165
|
+
*/
|
|
166
|
+
FeatureFlag.UnifiedDocs,
|
|
167
|
+
/**
|
|
168
|
+
* Editing an SDK's OpenAPI document is on for everyone; an explicit per-team
|
|
169
|
+
* false remains the kill switch, and the dashboard still gates the surface on
|
|
170
|
+
* the flag, so withdrawing it withdraws the panel. Listed here so the
|
|
171
|
+
* server-side gate and the admin flag editor's "Default (On)" label agree
|
|
172
|
+
* with the dashboard's client default.
|
|
173
|
+
*/
|
|
174
|
+
FeatureFlag.SdkOpenApiEditor
|
|
175
|
+
]);
|
|
176
|
+
|
|
177
|
+
// ../../packages/entities/dist/team/schema.js
|
|
178
|
+
var TeamUserRole;
|
|
179
|
+
(function(TeamUserRole2) {
|
|
180
|
+
TeamUserRole2["Owner"] = "owner";
|
|
181
|
+
TeamUserRole2["Admin"] = "admin";
|
|
182
|
+
TeamUserRole2["Editor"] = "editor";
|
|
183
|
+
TeamUserRole2["Viewer"] = "viewer";
|
|
184
|
+
})(TeamUserRole || (TeamUserRole = {}));
|
|
185
|
+
var roleLabels = {
|
|
186
|
+
[TeamUserRole.Admin]: "Admin",
|
|
187
|
+
[TeamUserRole.Editor]: "Editor",
|
|
188
|
+
[TeamUserRole.Owner]: "Owner",
|
|
189
|
+
[TeamUserRole.Viewer]: "Viewer"
|
|
190
|
+
};
|
|
191
|
+
var roleSchema = external_exports.enum(TeamUserRole).meta({ id: "role" });
|
|
192
|
+
var userRefSchema = external_exports.object({
|
|
193
|
+
uid: brandedUid(),
|
|
194
|
+
role: roleSchema,
|
|
195
|
+
displayName: external_exports.string(),
|
|
196
|
+
imageUri: external_exports.string().optional(),
|
|
197
|
+
activeProjectUid: external_exports.string().default(""),
|
|
198
|
+
nonBillable: external_exports.boolean().default(false).optional()
|
|
199
|
+
}).meta({ id: "user-ref" });
|
|
200
|
+
var billingPlanSchema = external_exports.enum(BillingPlan).meta({ id: "billing-plan" });
|
|
201
|
+
var billingInfoSchema = external_exports.preprocess((arg) => {
|
|
202
|
+
if (typeof arg?.hasTrial === "boolean" && ![
|
|
203
|
+
BillingPlan.Premium,
|
|
204
|
+
BillingPlan.ProMonthly,
|
|
205
|
+
BillingPlan.ProYearly,
|
|
206
|
+
BillingPlan.BusinessMonthly,
|
|
207
|
+
BillingPlan.BusinessYearly,
|
|
208
|
+
BillingPlan.Enterprise
|
|
209
|
+
].includes(arg?.plan)) {
|
|
210
|
+
arg.plan = "trial";
|
|
211
|
+
}
|
|
212
|
+
return arg;
|
|
213
|
+
}, external_exports.object({
|
|
214
|
+
billingId: nanoidSchema.optional(),
|
|
215
|
+
email: emailSchema,
|
|
216
|
+
plan: billingPlanSchema,
|
|
217
|
+
expires: external_exports.number().optional(),
|
|
218
|
+
sdkTrialReminderSentAt: external_exports.number().optional(),
|
|
219
|
+
trialEndedReminderSentAt: external_exports.number().optional(),
|
|
220
|
+
trialExtendedAt: external_exports.number().optional(),
|
|
221
|
+
includedCreditsOverride: external_exports.number().optional(),
|
|
222
|
+
pastDue: external_exports.boolean().optional(),
|
|
223
|
+
pricingModel: external_exports.enum(["flat_2026"]).nullish()
|
|
224
|
+
})).meta({ id: "billing-info" });
|
|
225
|
+
var invoiceStatusSchema = external_exports.enum(["open", "paid", "draft", "void", "uncollectible"]).meta({ id: "invoice-status" });
|
|
226
|
+
var billingInvoiceSchema = external_exports.object({
|
|
227
|
+
id: external_exports.string(),
|
|
228
|
+
/** Total invoice payment amount */
|
|
229
|
+
total: external_exports.number(),
|
|
230
|
+
/** Invoice status - we should only display open and paid to users */
|
|
231
|
+
status: invoiceStatusSchema.nullable(),
|
|
232
|
+
/** Invoice payment date */
|
|
233
|
+
paymentDate: external_exports.number(),
|
|
234
|
+
/** Currency for payment */
|
|
235
|
+
currency: external_exports.string(),
|
|
236
|
+
/** PDF download link */
|
|
237
|
+
downloadUrl: external_exports.string().nullable().optional()
|
|
238
|
+
}).meta({ id: "billing-invoice" });
|
|
239
|
+
var cardSchema = external_exports.object({
|
|
240
|
+
last4: external_exports.string().length(4),
|
|
241
|
+
expMonth: external_exports.number(),
|
|
242
|
+
expYear: external_exports.number()
|
|
243
|
+
}).meta({ id: "card" });
|
|
244
|
+
var teamBillingSummary = external_exports.object({
|
|
245
|
+
/** All invoices for a team */
|
|
246
|
+
invoices: billingInvoiceSchema.array().default([]),
|
|
247
|
+
/** Stripe customer billing address */
|
|
248
|
+
address: external_exports.string().nullable(),
|
|
249
|
+
card: cardSchema.nullable(),
|
|
250
|
+
/** Basic Scalar billing info from team record */
|
|
251
|
+
billingInfo: billingInfoSchema
|
|
252
|
+
}).meta({ id: "team-billing-summary" });
|
|
253
|
+
var sdkPriceBandLiterals = {
|
|
254
|
+
standard: "standard",
|
|
255
|
+
large: "large"
|
|
256
|
+
};
|
|
257
|
+
var sdkPriceBandSchema = external_exports.enum(sdkPriceBandLiterals);
|
|
258
|
+
var requiredTierLiterals = {
|
|
259
|
+
pro: "pro",
|
|
260
|
+
business: "business",
|
|
261
|
+
enterprise: "enterprise"
|
|
262
|
+
};
|
|
263
|
+
var teamSdkPricing = external_exports.object({
|
|
264
|
+
sdks: external_exports.object({
|
|
265
|
+
uid: nanoidSchema,
|
|
266
|
+
/** Endpoints in the document this SDK builds against; null when unmeasured. */
|
|
267
|
+
endpointCount: external_exports.number().int().nullable(),
|
|
268
|
+
/** Targets this SDK currently bills. */
|
|
269
|
+
billedTargets: external_exports.number().int(),
|
|
270
|
+
band: sdkPriceBandSchema
|
|
271
|
+
}).array().default([]),
|
|
272
|
+
/**
|
|
273
|
+
* Managed APIs with the size of the version they serve, for quoting an SDK
|
|
274
|
+
* that does not exist yet.
|
|
275
|
+
*/
|
|
276
|
+
apis: external_exports.object({
|
|
277
|
+
uid: nanoidSchema,
|
|
278
|
+
endpointCount: external_exports.number().int().nullable(),
|
|
279
|
+
band: sdkPriceBandSchema
|
|
280
|
+
}).array().default([]),
|
|
281
|
+
/** Billable targets per band, after the plan's included unit is comped. */
|
|
282
|
+
bands: external_exports.record(sdkPriceBandSchema, external_exports.number().int()),
|
|
283
|
+
/** The lowest tier the team's largest SDK requires. */
|
|
284
|
+
requiredTier: external_exports.enum(requiredTierLiterals)
|
|
285
|
+
}).meta({ id: "team-sdk-pricing" });
|
|
286
|
+
var pendingInviteSchema = external_exports.object({
|
|
287
|
+
uid: nanoidSchema,
|
|
288
|
+
role: roleSchema.default(TeamUserRole.Editor),
|
|
289
|
+
email: emailSchema,
|
|
290
|
+
expires: external_exports.number().optional()
|
|
291
|
+
}).meta({ id: "pending-invite" });
|
|
292
|
+
var teamNameSchema = external_exports.string().trim().overwrite((s) => s.length ? s : "Untitled Team").meta({ id: "team-name" });
|
|
293
|
+
var teamImageSchema = external_exports.string().optional().meta({ id: "team-image" });
|
|
294
|
+
var TeamOnboardingState;
|
|
295
|
+
(function(TeamOnboardingState2) {
|
|
296
|
+
TeamOnboardingState2["Setup"] = "setup";
|
|
297
|
+
TeamOnboardingState2["Complete"] = "complete";
|
|
298
|
+
})(TeamOnboardingState || (TeamOnboardingState = {}));
|
|
299
|
+
var UnifiedDocsMigrationStatus;
|
|
300
|
+
(function(UnifiedDocsMigrationStatus2) {
|
|
301
|
+
UnifiedDocsMigrationStatus2["Requested"] = "requested";
|
|
302
|
+
UnifiedDocsMigrationStatus2["InProgress"] = "in-progress";
|
|
303
|
+
UnifiedDocsMigrationStatus2["Completed"] = "completed";
|
|
304
|
+
UnifiedDocsMigrationStatus2["Failed"] = "failed";
|
|
305
|
+
})(UnifiedDocsMigrationStatus || (UnifiedDocsMigrationStatus = {}));
|
|
306
|
+
var unifiedDocsMigrationSchema = external_exports.object({
|
|
307
|
+
status: external_exports.enum(UnifiedDocsMigrationStatus),
|
|
308
|
+
/** When the current status was entered, not when the team first asked */
|
|
309
|
+
updatedAt: timestampSchema.default(unixTimestamp).meta({ default: "unixTimestamp()" }),
|
|
310
|
+
/**
|
|
311
|
+
* The user who pressed the button, or null when ops started the migration.
|
|
312
|
+
* Only used to attribute the request — permissions are checked at the route.
|
|
313
|
+
*/
|
|
314
|
+
requestedBy: external_exports.string().nullable().default(null),
|
|
315
|
+
/** Populated on `Failed` so the dashboard can show why without a log dive */
|
|
316
|
+
error: external_exports.string().nullable().default(null),
|
|
317
|
+
projectsMigrated: external_exports.number().int().default(0),
|
|
318
|
+
projectsTotal: external_exports.number().int().default(0)
|
|
319
|
+
});
|
|
320
|
+
var TeamAuthenticationMethod;
|
|
321
|
+
(function(TeamAuthenticationMethod2) {
|
|
322
|
+
TeamAuthenticationMethod2["Password"] = "password";
|
|
323
|
+
TeamAuthenticationMethod2["Google"] = "google";
|
|
324
|
+
TeamAuthenticationMethod2["GitHub"] = "github";
|
|
325
|
+
TeamAuthenticationMethod2["SSO"] = "sso";
|
|
326
|
+
})(TeamAuthenticationMethod || (TeamAuthenticationMethod = {}));
|
|
327
|
+
var teamAuthenticationMethodLabels = {
|
|
328
|
+
[TeamAuthenticationMethod.Google]: "Google OAuth",
|
|
329
|
+
[TeamAuthenticationMethod.GitHub]: "GitHub OAuth",
|
|
330
|
+
[TeamAuthenticationMethod.Password]: "Email & Password",
|
|
331
|
+
[TeamAuthenticationMethod.SSO]: "Single Sign-On"
|
|
332
|
+
};
|
|
333
|
+
var teamAuthenticationMethodsSchema = external_exports.object({
|
|
334
|
+
[TeamAuthenticationMethod.Password]: external_exports.boolean().default(true),
|
|
335
|
+
[TeamAuthenticationMethod.Google]: external_exports.boolean().default(true),
|
|
336
|
+
[TeamAuthenticationMethod.GitHub]: external_exports.boolean().default(true),
|
|
337
|
+
[TeamAuthenticationMethod.SSO]: external_exports.boolean().default(true)
|
|
338
|
+
}).meta({ id: "team-authentication-methods" });
|
|
339
|
+
var teamAuthenticationSchema = external_exports.object({
|
|
340
|
+
/** General team level enabled authentication methods */
|
|
341
|
+
methods: teamAuthenticationMethodsSchema.default(schemaModel({}, teamAuthenticationMethodsSchema)),
|
|
342
|
+
/**
|
|
343
|
+
* Allowlist of domains for login.
|
|
344
|
+
*
|
|
345
|
+
* If empty, all domains are allowed.
|
|
346
|
+
*/
|
|
347
|
+
domains: external_exports.string().array().default([]),
|
|
348
|
+
/**
|
|
349
|
+
* User level authentication methods.
|
|
350
|
+
*
|
|
351
|
+
* Overrides general team methods that were
|
|
352
|
+
* enabled/disabled.
|
|
353
|
+
*/
|
|
354
|
+
userControls: external_exports.record(nanoidSchema, teamAuthenticationMethodsSchema).default({})
|
|
355
|
+
}).meta({ id: "team-authentication" });
|
|
356
|
+
var teamSchema = entitySchema.extend({
|
|
357
|
+
/** Own uid, branded so it cannot be confused with another entity's uid */
|
|
358
|
+
uid: brandedUid().default(mintUid).meta({ default: "nanoid()" }),
|
|
359
|
+
name: teamNameSchema,
|
|
360
|
+
slug: slugSchema,
|
|
361
|
+
archived: external_exports.boolean().optional().default(false),
|
|
362
|
+
imageUri: teamImageSchema,
|
|
363
|
+
theme: external_exports.string().default("default"),
|
|
364
|
+
onboarding: external_exports.enum(TeamOnboardingState).default(TeamOnboardingState.Complete),
|
|
365
|
+
billingInfo: billingInfoSchema,
|
|
366
|
+
namespaces: namespaceSchema.array().refine((ns) => !ns.includes("share"), {
|
|
367
|
+
message: '"share" is a reserved namespace and cannot be used'
|
|
368
|
+
}).default([]),
|
|
369
|
+
users: userRefSchema.array(),
|
|
370
|
+
icons: customProjectIconSchema.array().default([]),
|
|
371
|
+
pendingInvites: pendingInviteSchema.array().default([]),
|
|
372
|
+
/** Team auth configuration */
|
|
373
|
+
authentication: teamAuthenticationSchema.default(schemaModel({}, teamAuthenticationSchema)),
|
|
374
|
+
externalAccess: externalAccessSchema.default(schemaModel({}, externalAccessSchema)),
|
|
375
|
+
features: featureFlagSchema.default({}),
|
|
376
|
+
/**
|
|
377
|
+
* Progress through the move off the legacy WYSIWYG editor. Absent on teams
|
|
378
|
+
* that have never been touched by the migration — including every team that
|
|
379
|
+
* signed up already on Unified Docs, which has nothing to migrate.
|
|
380
|
+
*/
|
|
381
|
+
unifiedDocsMigration: unifiedDocsMigrationSchema.optional(),
|
|
382
|
+
/**
|
|
383
|
+
* Teams can be manually verified when they need to upload documents
|
|
384
|
+
* containing prohibited text or links. This is manually set by request.
|
|
385
|
+
*/
|
|
386
|
+
verified: external_exports.boolean().default(false).optional()
|
|
387
|
+
}).meta({ id: "team" });
|
|
388
|
+
|
|
389
|
+
// ../../packages/entities/dist/team/helpers.js
|
|
390
|
+
var billingFeatures = {
|
|
391
|
+
team: {
|
|
392
|
+
archival: "teamArchival"
|
|
393
|
+
},
|
|
394
|
+
authentication: {
|
|
395
|
+
sso: "sso"
|
|
396
|
+
},
|
|
397
|
+
access: {
|
|
398
|
+
groups: "accessGroups"
|
|
399
|
+
},
|
|
400
|
+
publishing: {
|
|
401
|
+
subpath: "subpathHosting"
|
|
402
|
+
}
|
|
403
|
+
};
|
|
404
|
+
var teamBillingFeatures = {
|
|
405
|
+
[billingFeatures.team.archival]: {
|
|
406
|
+
[BillingPlan.Enterprise]: true,
|
|
407
|
+
[BillingPlan.Premium]: true,
|
|
408
|
+
[BillingPlan.ProMonthly]: true,
|
|
409
|
+
[BillingPlan.ProYearly]: true,
|
|
410
|
+
[BillingPlan.BusinessMonthly]: true,
|
|
411
|
+
[BillingPlan.BusinessYearly]: true
|
|
412
|
+
},
|
|
413
|
+
// SSO/SAML starts on Business under the four-plan model.
|
|
414
|
+
[billingFeatures.authentication.sso]: {
|
|
415
|
+
[BillingPlan.BusinessMonthly]: true,
|
|
416
|
+
[BillingPlan.BusinessYearly]: true,
|
|
417
|
+
[BillingPlan.Enterprise]: true
|
|
418
|
+
},
|
|
419
|
+
// Access groups start on Pro; Trial is included so it keeps demoing the Pro
|
|
420
|
+
// experience (expiry already short-circuits in hasTeamBillingFeature).
|
|
421
|
+
[billingFeatures.access.groups]: {
|
|
422
|
+
[BillingPlan.Trial]: true,
|
|
423
|
+
[BillingPlan.Premium]: true,
|
|
424
|
+
[BillingPlan.ProMonthly]: true,
|
|
425
|
+
[BillingPlan.ProYearly]: true,
|
|
426
|
+
[BillingPlan.BusinessMonthly]: true,
|
|
427
|
+
[BillingPlan.BusinessYearly]: true,
|
|
428
|
+
[BillingPlan.Enterprise]: true
|
|
429
|
+
},
|
|
430
|
+
// Subpath hosting starts on Business.
|
|
431
|
+
[billingFeatures.publishing.subpath]: {
|
|
432
|
+
[BillingPlan.BusinessMonthly]: true,
|
|
433
|
+
[BillingPlan.BusinessYearly]: true,
|
|
434
|
+
[BillingPlan.Enterprise]: true
|
|
435
|
+
}
|
|
436
|
+
};
|
|
437
|
+
var permissions = {
|
|
438
|
+
team: {
|
|
439
|
+
delete: "deleteTeam",
|
|
440
|
+
manage: "manageTeam",
|
|
441
|
+
manageOwners: "manageOwners"
|
|
442
|
+
},
|
|
443
|
+
docs: {
|
|
444
|
+
create: "createDocs",
|
|
445
|
+
edit: "editDocs",
|
|
446
|
+
delete: "deleteDocs"
|
|
447
|
+
}
|
|
448
|
+
};
|
|
449
|
+
var teamPermissions = {
|
|
450
|
+
[permissions.team.manageOwners]: {
|
|
451
|
+
[TeamUserRole.Owner]: true,
|
|
452
|
+
[TeamUserRole.Admin]: false,
|
|
453
|
+
[TeamUserRole.Editor]: false,
|
|
454
|
+
[TeamUserRole.Viewer]: false
|
|
455
|
+
},
|
|
456
|
+
[permissions.team.manage]: {
|
|
457
|
+
[TeamUserRole.Owner]: true,
|
|
458
|
+
[TeamUserRole.Admin]: true,
|
|
459
|
+
[TeamUserRole.Editor]: false,
|
|
460
|
+
[TeamUserRole.Viewer]: false
|
|
461
|
+
},
|
|
462
|
+
[permissions.team.delete]: {
|
|
463
|
+
[TeamUserRole.Owner]: true,
|
|
464
|
+
[TeamUserRole.Admin]: false,
|
|
465
|
+
[TeamUserRole.Editor]: false,
|
|
466
|
+
[TeamUserRole.Viewer]: false
|
|
467
|
+
},
|
|
468
|
+
[permissions.docs.create]: {
|
|
469
|
+
[TeamUserRole.Owner]: true,
|
|
470
|
+
[TeamUserRole.Admin]: true,
|
|
471
|
+
[TeamUserRole.Editor]: true,
|
|
472
|
+
[TeamUserRole.Viewer]: false
|
|
473
|
+
},
|
|
474
|
+
[permissions.docs.edit]: {
|
|
475
|
+
[TeamUserRole.Owner]: true,
|
|
476
|
+
[TeamUserRole.Admin]: true,
|
|
477
|
+
[TeamUserRole.Editor]: true,
|
|
478
|
+
[TeamUserRole.Viewer]: false
|
|
479
|
+
},
|
|
480
|
+
[permissions.docs.delete]: {
|
|
481
|
+
[TeamUserRole.Owner]: true,
|
|
482
|
+
[TeamUserRole.Admin]: true,
|
|
483
|
+
[TeamUserRole.Editor]: true,
|
|
484
|
+
[TeamUserRole.Viewer]: false
|
|
485
|
+
}
|
|
486
|
+
};
|
|
487
|
+
|
|
488
|
+
export {
|
|
489
|
+
roleSchema,
|
|
490
|
+
userRefSchema,
|
|
491
|
+
billingPlanSchema,
|
|
492
|
+
teamBillingSummary,
|
|
493
|
+
teamSdkPricing,
|
|
494
|
+
pendingInviteSchema,
|
|
495
|
+
teamNameSchema,
|
|
496
|
+
teamImageSchema,
|
|
497
|
+
UnifiedDocsMigrationStatus,
|
|
498
|
+
teamSchema
|
|
499
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { createRequire as $$cR } from "node:module"; const require = $$cR(import.meta.url);
|
|
2
|
+
|
|
3
|
+
// src/domains/project/download-isolate/index.ts
|
|
4
|
+
import os from "node:os";
|
|
5
|
+
import path from "node:path";
|
|
6
|
+
import { Command } from "commander";
|
|
7
|
+
var ISOLATE_EXTRACTION_DIR = path.join(os.homedir(), ".scalar");
|
|
8
|
+
var ISOLATE_DIR = path.join(ISOLATE_EXTRACTION_DIR, "isolate");
|
|
9
|
+
var DownloadIsolateCommand = () => {
|
|
10
|
+
const cmd = new Command("download-isolate");
|
|
11
|
+
cmd.description("Download the docs preview server");
|
|
12
|
+
cmd.action(async () => {
|
|
13
|
+
const { downloadIsolate } = await import("./action-UZQJNYK4.js");
|
|
14
|
+
await downloadIsolate();
|
|
15
|
+
});
|
|
16
|
+
return cmd;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export {
|
|
20
|
+
ISOLATE_EXTRACTION_DIR,
|
|
21
|
+
ISOLATE_DIR,
|
|
22
|
+
DownloadIsolateCommand
|
|
23
|
+
};
|